@tapflowio/relay 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RelayServer.d.ts +6 -0
- package/dist/RelayServer.d.ts.map +1 -1
- package/dist/RelayServer.js +48 -3
- package/dist/RelayServer.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +14 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +98 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/launchDefaults.d.ts +25 -0
- package/dist/lib/launchDefaults.d.ts.map +1 -0
- package/dist/lib/launchDefaults.js +41 -0
- package/dist/lib/launchDefaults.js.map +1 -0
- package/dist/server.js +2 -2
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
- package/public/assets/{AISessionWatch-BSBkpTom.js → AISessionWatch-DxsyhjAy.js} +1 -1
- package/public/assets/AISessionWatch-DxsyhjAy.js.br +0 -0
- package/public/assets/AISessionWatch-DxsyhjAy.js.gz +0 -0
- package/public/assets/{AppCenter-DD_6LQx-.js → AppCenter-CZMTgfBh.js} +1 -1
- package/public/assets/AppCenter-CZMTgfBh.js.br +0 -0
- package/public/assets/AppCenter-CZMTgfBh.js.gz +0 -0
- package/public/assets/{Default-CQ3Ae2mK.js → Default-DCk7wCIg.js} +1 -1
- package/public/assets/Default-DCk7wCIg.js.br +0 -0
- package/public/assets/Default-DCk7wCIg.js.gz +0 -0
- package/public/assets/{Invite-D1uNMm0-.js → Invite-BNgu8qb9.js} +1 -1
- package/public/assets/Invite-BNgu8qb9.js.br +0 -0
- package/public/assets/Invite-BNgu8qb9.js.gz +0 -0
- package/public/assets/{MacResources-D2UeRbKL.js → MacResources-B26lSN5B.js} +1 -1
- package/public/assets/MacResources-B26lSN5B.js.br +0 -0
- package/public/assets/MacResources-B26lSN5B.js.gz +0 -0
- package/public/assets/{QASession-d0eOjXXo.js → QASession-Rin1Ol-2.js} +1 -1
- package/public/assets/QASession-Rin1Ol-2.js.br +0 -0
- package/public/assets/QASession-Rin1Ol-2.js.gz +0 -0
- package/public/assets/{ResetPassword-B-4Uyfwr.js → ResetPassword-CQsALVBn.js} +1 -1
- package/public/assets/ResetPassword-CQsALVBn.js.br +0 -0
- package/public/assets/ResetPassword-CQsALVBn.js.gz +0 -0
- package/public/assets/{RunDetail-C50RjsuM.js → RunDetail-D0JKuXAS.js} +1 -1
- package/public/assets/RunDetail-D0JKuXAS.js.br +0 -0
- package/public/assets/RunDetail-D0JKuXAS.js.gz +0 -0
- package/public/assets/{Runs-A7RcDLgO.js → Runs-DSHpDs0m.js} +1 -1
- package/public/assets/Runs-DSHpDs0m.js.br +0 -0
- package/public/assets/Runs-DSHpDs0m.js.gz +0 -0
- package/public/assets/{Setup-DK6TZbwh.js → Setup-4-HC1rwb.js} +1 -1
- package/public/assets/Setup-4-HC1rwb.js.br +0 -0
- package/public/assets/Setup-4-HC1rwb.js.gz +0 -0
- package/public/assets/{Team-VoGput2p.js → Team-CgJM95TR.js} +1 -1
- package/public/assets/Team-CgJM95TR.js.br +0 -0
- package/public/assets/Team-CgJM95TR.js.gz +0 -0
- package/public/assets/{Tokens-qkcJgunR.js → Tokens-D2wbiDVG.js} +1 -1
- package/public/assets/Tokens-D2wbiDVG.js.br +0 -0
- package/public/assets/Tokens-D2wbiDVG.js.gz +0 -0
- package/public/assets/{aiSession-U7UqgdSb.js → aiSession-DE80E1QU.js} +1 -1
- package/public/assets/aiSession-DE80E1QU.js.br +0 -0
- package/public/assets/aiSession-DE80E1QU.js.gz +0 -0
- package/public/assets/{alert-dialog-C0mRms8g.js → alert-dialog-nxQTqXgk.js} +1 -1
- package/public/assets/alert-dialog-nxQTqXgk.js.br +0 -0
- package/public/assets/alert-dialog-nxQTqXgk.js.gz +0 -0
- package/public/assets/{badge-BjEnOmb0.js → badge-DM1m4CLq.js} +1 -1
- package/public/assets/badge-DM1m4CLq.js.br +0 -0
- package/public/assets/badge-DM1m4CLq.js.gz +0 -0
- package/public/assets/{dialog-Cugbp1C4.js → dialog-CTc84wr4.js} +1 -1
- package/public/assets/dialog-CTc84wr4.js.br +0 -0
- package/public/assets/dialog-CTc84wr4.js.gz +0 -0
- package/public/assets/{field-hint-qmBa0qqN.js → field-hint-xptj_gfn.js} +1 -1
- package/public/assets/field-hint-xptj_gfn.js.br +0 -0
- package/public/assets/field-hint-xptj_gfn.js.gz +0 -0
- package/public/assets/{index-C_3Q51YJ.js → index-2zL1a5_0.js} +3 -3
- package/public/assets/index-2zL1a5_0.js.br +0 -0
- package/public/assets/index-2zL1a5_0.js.gz +0 -0
- package/public/assets/{list-view-CyM0QUaH.js → list-view-BzI8tLvX.js} +1 -1
- package/public/assets/list-view-BzI8tLvX.js.br +0 -0
- package/public/assets/list-view-BzI8tLvX.js.gz +0 -0
- package/public/assets/{pencil-DUZRZB3S.js → pencil-CEWs8Of9.js} +1 -1
- package/public/assets/pencil-CEWs8Of9.js.br +0 -0
- package/public/assets/pencil-CEWs8Of9.js.gz +0 -0
- package/public/assets/{play-Z1L2Eb91.js → play-Dab2J3Tw.js} +1 -1
- package/public/assets/play-Dab2J3Tw.js.br +0 -0
- package/public/assets/play-Dab2J3Tw.js.gz +0 -0
- package/public/assets/{search-input-B0s9mzRt.js → search-input-BK7cFT1m.js} +1 -1
- package/public/assets/search-input-BK7cFT1m.js.br +0 -0
- package/public/assets/search-input-BK7cFT1m.js.gz +0 -0
- package/public/assets/{select-CHbE6M4S.js → select-BH7E2Q0r.js} +1 -1
- package/public/assets/select-BH7E2Q0r.js.br +0 -0
- package/public/assets/select-BH7E2Q0r.js.gz +0 -0
- package/public/assets/{slider-tyb3JvL2.js → slider-B4sPZi8m.js} +1 -1
- package/public/assets/slider-B4sPZi8m.js.br +0 -0
- package/public/assets/slider-B4sPZi8m.js.gz +0 -0
- package/public/assets/{tabs-Bf7ou-eS.js → tabs-CYoB-S2t.js} +1 -1
- package/public/assets/tabs-CYoB-S2t.js.br +0 -0
- package/public/assets/tabs-CYoB-S2t.js.gz +0 -0
- package/public/assets/{tech-label-KAwM5qZ_.js → tech-label-fz5PvoAL.js} +1 -1
- package/public/assets/tech-label-fz5PvoAL.js.br +3 -0
- package/public/assets/tech-label-fz5PvoAL.js.gz +0 -0
- package/public/assets/{trash-HEJmY7DQ.js → trash-CZ-V9h2G.js} +1 -1
- package/public/assets/trash-CZ-V9h2G.js.br +0 -0
- package/public/assets/trash-CZ-V9h2G.js.gz +0 -0
- package/public/assets/{video-DdHH0Q0l.js → video-CilstoqV.js} +1 -1
- package/public/assets/video-CilstoqV.js.br +0 -0
- package/public/assets/video-CilstoqV.js.gz +0 -0
- package/public/index.html +1 -1
- package/public/index.html.br +0 -0
- package/public/index.html.gz +0 -0
- package/public/assets/AISessionWatch-BSBkpTom.js.br +0 -0
- package/public/assets/AISessionWatch-BSBkpTom.js.gz +0 -0
- package/public/assets/AppCenter-DD_6LQx-.js.br +0 -0
- package/public/assets/AppCenter-DD_6LQx-.js.gz +0 -0
- package/public/assets/Default-CQ3Ae2mK.js.br +0 -0
- package/public/assets/Default-CQ3Ae2mK.js.gz +0 -0
- package/public/assets/Invite-D1uNMm0-.js.br +0 -0
- package/public/assets/Invite-D1uNMm0-.js.gz +0 -0
- package/public/assets/MacResources-D2UeRbKL.js.br +0 -0
- package/public/assets/MacResources-D2UeRbKL.js.gz +0 -0
- package/public/assets/QASession-d0eOjXXo.js.br +0 -0
- package/public/assets/QASession-d0eOjXXo.js.gz +0 -0
- package/public/assets/ResetPassword-B-4Uyfwr.js.br +0 -0
- package/public/assets/ResetPassword-B-4Uyfwr.js.gz +0 -0
- package/public/assets/RunDetail-C50RjsuM.js.br +0 -0
- package/public/assets/RunDetail-C50RjsuM.js.gz +0 -0
- package/public/assets/Runs-A7RcDLgO.js.br +0 -0
- package/public/assets/Runs-A7RcDLgO.js.gz +0 -0
- package/public/assets/Setup-DK6TZbwh.js.br +0 -0
- package/public/assets/Setup-DK6TZbwh.js.gz +0 -0
- package/public/assets/Team-VoGput2p.js.br +0 -0
- package/public/assets/Team-VoGput2p.js.gz +0 -0
- package/public/assets/Tokens-qkcJgunR.js.br +0 -0
- package/public/assets/Tokens-qkcJgunR.js.gz +0 -0
- package/public/assets/aiSession-U7UqgdSb.js.br +0 -0
- package/public/assets/aiSession-U7UqgdSb.js.gz +0 -0
- package/public/assets/alert-dialog-C0mRms8g.js.br +0 -0
- package/public/assets/alert-dialog-C0mRms8g.js.gz +0 -0
- package/public/assets/badge-BjEnOmb0.js.br +0 -0
- package/public/assets/badge-BjEnOmb0.js.gz +0 -0
- package/public/assets/dialog-Cugbp1C4.js.br +0 -0
- package/public/assets/dialog-Cugbp1C4.js.gz +0 -0
- package/public/assets/field-hint-qmBa0qqN.js.br +0 -0
- package/public/assets/field-hint-qmBa0qqN.js.gz +0 -0
- package/public/assets/index-C_3Q51YJ.js.br +0 -0
- package/public/assets/index-C_3Q51YJ.js.gz +0 -0
- package/public/assets/list-view-CyM0QUaH.js.br +0 -0
- package/public/assets/list-view-CyM0QUaH.js.gz +0 -0
- package/public/assets/pencil-DUZRZB3S.js.br +0 -0
- package/public/assets/pencil-DUZRZB3S.js.gz +0 -0
- package/public/assets/play-Z1L2Eb91.js.br +0 -0
- package/public/assets/play-Z1L2Eb91.js.gz +0 -0
- package/public/assets/search-input-B0s9mzRt.js.br +0 -0
- package/public/assets/search-input-B0s9mzRt.js.gz +0 -0
- package/public/assets/select-CHbE6M4S.js.br +0 -0
- package/public/assets/select-CHbE6M4S.js.gz +0 -0
- package/public/assets/slider-tyb3JvL2.js.br +0 -0
- package/public/assets/slider-tyb3JvL2.js.gz +0 -0
- package/public/assets/tabs-Bf7ou-eS.js.br +0 -0
- package/public/assets/tabs-Bf7ou-eS.js.gz +0 -0
- package/public/assets/tech-label-KAwM5qZ_.js.br +0 -0
- package/public/assets/tech-label-KAwM5qZ_.js.gz +0 -0
- package/public/assets/trash-HEJmY7DQ.js.br +0 -0
- package/public/assets/trash-HEJmY7DQ.js.gz +0 -0
- package/public/assets/video-DdHH0Q0l.js.br +0 -0
- package/public/assets/video-DdHH0Q0l.js.gz +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-4-HC1rwb.js","assets/vendor-react-DTSdA8m-.js","assets/field-hint-xptj_gfn.js","assets/vendor-router-B1pQim9Z.js","assets/Invite-BNgu8qb9.js","assets/pencil-CEWs8Of9.js","assets/ResetPassword-CQsALVBn.js","assets/AppCenter-CZMTgfBh.js","assets/search-input-BK7cFT1m.js","assets/select-BH7E2Q0r.js","assets/index-D17hSi50.js","assets/dialog-CTc84wr4.js","assets/tech-label-fz5PvoAL.js","assets/trash-CZ-V9h2G.js","assets/badge-DM1m4CLq.js","assets/alert-dialog-nxQTqXgk.js","assets/build-format-ofd2iIzf.js","assets/play-Dab2J3Tw.js","assets/useFocusAfterSwap-BdItkQCu.js","assets/useShownAfter-By1Yxysz.js","assets/QASession-Rin1Ol-2.js","assets/useRelay-CES3I1Mt.js","assets/AndroidDeviceScreen-C55msKfh.js","assets/aiSession-DE80E1QU.js","assets/video-CilstoqV.js","assets/tabs-CYoB-S2t.js","assets/publicLink-D6zKS_wu.js","assets/resource-health-oWJ8hy9X.js","assets/Runs-DSHpDs0m.js","assets/list-view-BzI8tLvX.js","assets/runs-CFQ6M4rx.js","assets/RunDetail-D0JKuXAS.js","assets/slider-B4sPZi8m.js","assets/WatchedDevice-CpaKHa1x.js","assets/AISessionWatch-DxsyhjAy.js","assets/MacResources-B26lSN5B.js","assets/vendor-charts-BE7R_8yA.js","assets/Default-DCk7wCIg.js","assets/Team-CgJM95TR.js","assets/Tokens-D2wbiDVG.js","assets/NotFound-DVq_rCKc.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var nc=e=>{throw TypeError(e)};var ks=(e,t,n)=>t.has(e)||nc("Cannot "+n);var E=(e,t,n)=>(ks(e,t,"read from private field"),n?n.call(e):t.get(e)),ie=(e,t,n)=>t.has(e)?nc("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),G=(e,t,n,r)=>(ks(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pe=(e,t,n)=>(ks(e,t,"access private method"),n);var po=(e,t,n,r)=>({set _(o){G(e,t,o,n)},get _(){return E(e,t,r)}});import{r as h,j as m,R as I,a as Tp,c as ee,b as Bn,d as ru,u as Ip,o as Ap,s as Np,f as Dp,e as Mp,h as jp,i as $p,l as zp,k as Fp,m as Lp}from"./vendor-react-DTSdA8m-.js";import{u as ou,a as su,L as mo,N as Gi,O as Vp,R as st,B as Up,b as Zp}from"./vendor-router-B1pQim9Z.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=n(o);fetch(o.href,s)}})();var Bp=(e,t,n,r,o,s,i,a)=>{let c=document.documentElement,u=["light","dark"];function d(p){(Array.isArray(e)?e:[e]).forEach(v=>{let g=v==="class",w=g&&s?o.map(b=>s[b]||b):o;g?(c.classList.remove(...w),c.classList.add(s&&s[p]?s[p]:p)):c.setAttribute(v,p)}),l(p)}function l(p){a&&u.includes(p)&&(c.style.colorScheme=p)}function f(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)d(r);else try{let p=localStorage.getItem(t)||n,v=i&&p==="system"?f():p;d(v)}catch{}},rc=["light","dark"],iu="(prefers-color-scheme: dark)",Hp=typeof window>"u",qi=h.createContext(void 0),Wp={setTheme:e=>{},themes:[]},ss=()=>{var e;return(e=h.useContext(qi))!=null?e:Wp},Kp=e=>h.useContext(qi)?h.createElement(h.Fragment,null,e.children):h.createElement(qp,{...e}),Gp=["light","dark"],qp=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:s=Gp,defaultTheme:i=n?"system":"light",attribute:a="data-theme",value:c,children:u,nonce:d,scriptProps:l})=>{let[f,p]=h.useState(()=>Yp(o,i)),[v,g]=h.useState(()=>f==="system"?Os():f),w=c?Object.values(c):s,b=h.useCallback(S=>{let P=S;if(!P)return;S==="system"&&n&&(P=Os());let R=c?c[P]:P,T=t?Jp(d):null,A=document.documentElement,j=F=>{F==="class"?(A.classList.remove(...w),R&&A.classList.add(R)):F.startsWith("data-")&&(R?A.setAttribute(F,R):A.removeAttribute(F))};if(Array.isArray(a)?a.forEach(j):j(a),r){let F=rc.includes(i)?i:null,z=rc.includes(P)?P:F;A.style.colorScheme=z}T==null||T()},[d]),x=h.useCallback(S=>{let P=typeof S=="function"?S(f):S;p(P);try{localStorage.setItem(o,P)}catch{}},[f]),_=h.useCallback(S=>{let P=Os(S);g(P),f==="system"&&n&&!e&&b("system")},[f,e]);h.useEffect(()=>{let S=window.matchMedia(iu);return S.addListener(_),_(S),()=>S.removeListener(_)},[_]),h.useEffect(()=>{let S=P=>{P.key===o&&(P.newValue?p(P.newValue):x(i))};return window.addEventListener("storage",S),()=>window.removeEventListener("storage",S)},[x]),h.useEffect(()=>{b(e??f)},[e,f]);let C=h.useMemo(()=>({theme:f,setTheme:x,forcedTheme:e,resolvedTheme:f==="system"?v:f,themes:n?[...s,"system"]:s,systemTheme:n?v:void 0}),[f,x,e,v,n,s]);return h.createElement(qi.Provider,{value:C},h.createElement(Qp,{forcedTheme:e,storageKey:o,attribute:a,enableSystem:n,enableColorScheme:r,defaultTheme:i,value:c,themes:s,nonce:d,scriptProps:l}),u)},Qp=h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:s,value:i,themes:a,nonce:c,scriptProps:u})=>{if(typeof window<"u")return null;let d=JSON.stringify([n,t,s,e,a,i,r,o]).slice(1,-1);return h.createElement("script",{...u,suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(${Bp.toString()})(${d})`}})}),Yp=(e,t)=>{if(Hp)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},Jp=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},Os=e=>(e||(e=window.matchMedia(iu)),e.matches?"dark":"light");const Xp="modulepreload",em=function(e){return"/"+e},oc={},Et=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){let i=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(l=>({status:"fulfilled",value:l}),l=>({status:"rejected",reason:l}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),c=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(n.map(u=>{if(u=em(u),u in oc)return;oc[u]=!0;const d=u.endsWith(".css"),l=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${l}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":Xp,d||(f.as="script"),f.crossOrigin="",f.href=u,c&&f.setAttribute("nonce",c),document.head.appendChild(f),d)return new Promise((p,v)=>{f.addEventListener("load",p),f.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},au=h.createContext(void 0),Qi=e=>{const t=h.useContext(au);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tm=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(au.Provider,{value:e,children:t})),nm={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)};var mn,Ki,Kl,rm=(Kl=class{constructor(){ie(this,mn,nm);ie(this,Ki,!1)}setTimeoutProvider(e){G(this,mn,e)}setTimeout(e,t){return E(this,mn).setTimeout(e,t)}clearTimeout(e){E(this,mn).clearTimeout(e)}setInterval(e,t){return E(this,mn).setInterval(e,t)}clearInterval(e){E(this,mn).clearInterval(e)}},mn=new WeakMap,Ki=new WeakMap,Kl);const In=new rm;function om(e){setTimeout(e,0)}const sm=typeof window>"u"||"Deno"in globalThis;function vt(){}function im(e,t){return typeof e=="function"?e(t):e}function cu(e){return typeof e=="number"&&e>=0&&e!==1/0}function lu(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ie(e,t){return typeof e=="function"?e(t):e}function sc(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:s,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Yi(i,t.options))return!1}else if(!vr(t.queryKey,i))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||s&&!s(t))}function ic(e,t){const{exact:n,status:r,predicate:o,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(Wr(t.options.mutationKey)!==Wr(s))return!1}else if(!vr(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Yi(e,t){return((t==null?void 0:t.queryKeyHashFn)||Wr)(e)}function Wr(e){return JSON.stringify(e,(t,n)=>Qs(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function vr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(!vr(e[r],t[r]))return!1;return!0}const n=Object.keys(t);for(const r of n)if(!vr(e[r],t[r]))return!1;return!0}return!1}const am=Object.prototype.hasOwnProperty;function uu(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=ac(e)&&ac(t);if(!r&&!(Qs(e)&&Qs(t)))return t;const o=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),i=s.length,a=r?new Array(i):{};let c=0;for(let u=0;u<i;u++){const d=r?u:s[u],l=e[d],f=t[d];if(l===f){a[d]=l,(r?u<o:am.call(e,d))&&c++;continue}if(l===null||f===null||typeof l!="object"||typeof f!="object"){a[d]=f;continue}const p=uu(l,f,n+1);a[d]=p,p===l&&c++}return o===i&&c===o?e:a}function Ps(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function ac(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Qs(e){if(!cc(e))return!1;const t=Object.getPrototypeOf(e),n=t==null?void 0:t.constructor;if(n===void 0)return!0;if(typeof n!="function")return!1;const r=n.prototype;return!(!cc(r)||!r.hasOwnProperty("isPrototypeOf")||t!==Object.prototype)}function cc(e){return Object.prototype.toString.call(e)==="[object Object]"}function cm(e){return new Promise(t=>{In.setTimeout(t,e)})}function Ys(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?uu(e,t):t}function S2(e){return e}function lm(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function um(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}const Ji=Symbol();function du(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ji?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function fu(e,t){return typeof e=="function"?e(...t):!!e}function dm(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}let fm=()=>sm;const Xi=()=>fm();var oo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},An,gn,or,Gl,hm=(Gl=class extends oo{constructor(){super();ie(this,An);ie(this,gn);ie(this,or);G(this,or,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){E(this,gn)||this.setEventListener(E(this,or))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,gn))==null||t.call(this),G(this,gn,void 0))}setEventListener(t){var n;G(this,or,t),(n=E(this,gn))==null||n.call(this),G(this,gn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){E(this,An)!==t&&(G(this,An,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof E(this,An)=="boolean"?E(this,An):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},An=new WeakMap,gn=new WeakMap,or=new WeakMap,Gl);const ea=new hm,pm=om;function mm(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=pm;const s=a=>{t?e.push(a):o(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(c=>{n(c)})})})};return{batch:a=>{let c;t++;try{c=a()}finally{t--,t||i()}return c},batchCalls:a=>(...c)=>{s(()=>{a(...c)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}const tt=mm();var sr,vn,ir,ql,gm=(ql=class extends oo{constructor(){super();ie(this,sr,!0);ie(this,vn);ie(this,ir);G(this,ir,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){E(this,vn)||this.setEventListener(E(this,ir))}onUnsubscribe(){var t;this.hasListeners()||((t=E(this,vn))==null||t.call(this),G(this,vn,void 0))}setEventListener(t){var n;G(this,ir,t),(n=E(this,vn))==null||n.call(this),G(this,vn,t(this.setOnline.bind(this)))}setOnline(t){E(this,sr)!==t&&(G(this,sr,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return E(this,sr)}},sr=new WeakMap,vn=new WeakMap,ir=new WeakMap,ql);const Ho=new gm;function vm(e){return Math.min(1e3*2**e,3e4)}function hu(e){return(e??"online")==="online"?Ho.isOnline():!0}var Js=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function pu(e){let t=!1,n=0,r,o="pending",s,i;const a=new Promise((x,_)=>{s=x,i=_});a.catch(vt);const c=()=>o!=="pending",u=x=>{var _;if(!c()){const C=new Js(x);g(C),(_=e.onCancel)==null||_.call(e,C)}},d=()=>{t=!0},l=()=>{t=!1},f=()=>ea.isFocused()&&(e.networkMode==="always"||Ho.isOnline())&&e.canRun(),p=()=>hu(e.networkMode)&&e.canRun(),v=x=>{c()||(r==null||r(),o="resolved",s(x))},g=x=>{c()||(r==null||r(),o="rejected",i(x))},w=x=>new Promise(_=>{var C;r=S=>{(c()||x())&&_(S)},(C=e.onPause)==null||C.call(e)}).then(()=>{var _;r=void 0,c()||(_=e.onContinue)==null||_.call(e)}),b=()=>{if(c())return;let x;const _=n===0?e.initialPromise:void 0;try{x=_??e.fn()}catch(C){x=Promise.reject(C)}Promise.resolve(x).then(v).catch(C=>{var A;if(c())return;const S=e.retry??(Xi()?0:3),P=e.retryDelay??vm,R=typeof P=="function"?P(n,C):P,T=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,C);if(t||!T){g(C);return}n++,(A=e.onFail)==null||A.call(e,n,C),cm(R).then(()=>f()?void 0:w(f)).then(()=>{t?g(C):b()})})};return{promise:a,status:()=>o,cancel:u,continue:()=>(r==null||r(),a),cancelRetry:d,continueRetry:l,canStart:p,start:()=>(p()?b():w(p).then(b),a)}}var Nn,Ql,mu=(Ql=class{constructor(){ie(this,Nn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),cu(this.gcTime)&&G(this,Nn,In.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xi()?1/0:3e5))}clearGcTimeout(){E(this,Nn)!==void 0&&(In.clearTimeout(E(this,Nn)),G(this,Nn,void 0))}},Nn=new WeakMap,Ql);function ym(e){return{onFetch:(t,n)=>{var d,l,f,p,v;const r=t.options,o=(f=(l=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:l.fetchMore)==null?void 0:f.direction,s=((p=t.state.data)==null?void 0:p.pages)||[],i=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const w=_=>{dm(_,()=>t.signal,()=>g=!0)},b=du(t.options,t.fetchOptions),x=async(_,C,S)=>{if(g)return Promise.reject(t.signal.reason);if(C==null&&_.pages.length)return Promise.resolve(_);const R=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:C,direction:S?"backward":"forward",meta:t.options.meta};return w(F),F})(),T=await b(R),{maxPages:A}=t.options,j=S?um:lm;return{pages:j(_.pages,T,A),pageParams:j(_.pageParams,C,A)}};if(o&&s.length){const _=o==="backward",C=_?bm:lc,S={pages:s,pageParams:i};a=await x(S,C(r,S),_)}else{const _=e??s.length;do{const C=c===0?i[0]===void 0?r.initialPageParam:i[0]:lc(r,a);if(c>0&&C==null)break;a=await x(a,C),c++}while(c<_)}return a};t.options.persister?t.fetchFn=()=>{var g,w;return(w=(g=t.options).persister)==null?void 0:w.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function lc(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function bm(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ar,Dn,cr,Ot,Mn,qe,Xr,jn,Nt,Kt,Yl,wm=(Yl=class extends mu{constructor(t){super();ie(this,Nt);ie(this,ar);ie(this,Dn);ie(this,cr);ie(this,Ot);ie(this,Mn);ie(this,qe);ie(this,Xr);ie(this,jn);G(this,jn,!1),G(this,Xr,t.defaultOptions),this.setOptions(t.options),this.observers=[],G(this,Mn,t.client),G(this,Ot,E(this,Mn).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,G(this,Dn,dc(this.options)),this.state=t.state??E(this,Dn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return E(this,ar)}get promise(){var t;return(t=E(this,qe))==null?void 0:t.promise}setOptions(t){if(this.options={...E(this,Xr),...t},t!=null&&t._type&&G(this,ar,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=dc(this.options);n.data!==void 0&&(this.setState(uc(n.data,n.dataUpdatedAt)),G(this,Dn,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,Ot).remove(this)}setData(t,n){const r=Ys(this.state.data,t,this.options);return pe(this,Nt,Kt).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t){pe(this,Nt,Kt).call(this,{type:"setState",state:t})}cancel(t){var r,o;const n=(r=E(this,qe))==null?void 0:r.promise;return(o=E(this,qe))==null||o.cancel(t),n?n.then(vt).catch(vt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return E(this,Dn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Ie(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ji||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ie(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!lu(this.state.dataUpdatedAt,t)}onFocus(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnWindowFocus()))==null||t.refetch({cancelRefetch:!1}),(n=E(this,qe))==null||n.continue()}onOnline(){var t,n;(t=this.observers.find(r=>r.shouldFetchOnReconnect()))==null||t.refetch({cancelRefetch:!1}),(n=E(this,qe))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),E(this,Ot).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){const n=this.observers.indexOf(t);n!==-1&&(this.observers.splice(n,1),this.observers.length||(E(this,qe)&&(E(this,jn)||this.state.fetchStatus==="paused"&&this.state.status==="pending"?E(this,qe).cancel({revert:!0}):E(this,qe).cancelRetry()),this.scheduleGc()),E(this,Ot).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pe(this,Nt,Kt).call(this,{type:"invalidate"})}async fetch(t,n){var u,d,l,f,p,v,g,w,b,x,_,C;if(this.state.fetchStatus!=="idle"&&((u=E(this,qe))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(E(this,qe))return E(this,qe).continueRetry(),E(this,qe).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(P=>P.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(G(this,jn,!0),r.signal)})},s=()=>{const S=du(this.options,n),R=(()=>{const T={client:E(this,Mn),queryKey:this.queryKey,meta:this.meta};return o(T),T})();return G(this,jn,!1),this.options.persister?this.options.persister(S,R,this):S(R)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:E(this,Mn),state:this.state,fetchFn:s};return o(S),S})();(d=E(this,ar)==="infinite"?ym(this.options.pages):this.options.behavior)==null||d.onFetch(a,this),G(this,cr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((l=a.fetchOptions)==null?void 0:l.meta))&&pe(this,Nt,Kt).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const c=G(this,qe,pu({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof Js&&S.revert&&this.setState({...E(this,cr),fetchStatus:"idle"}),r.abort()},onFail:(S,P)=>{pe(this,Nt,Kt).call(this,{type:"failed",failureCount:S,error:P})},onPause:()=>{pe(this,Nt,Kt).call(this,{type:"pause"})},onContinue:()=>{pe(this,Nt,Kt).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await c.start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(v=(p=E(this,Ot).config).onSuccess)==null||v.call(p,S,this),(w=(g=E(this,Ot).config).onSettled)==null||w.call(g,S,this.state.error,this),S}catch(S){if(S instanceof Js){if(S.silent)return E(this,qe).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw pe(this,Nt,Kt).call(this,{type:"error",error:S}),(x=(b=E(this,Ot).config).onError)==null||x.call(b,S,this),(C=(_=E(this,Ot).config).onSettled)==null||C.call(_,this.state.data,S,this),S}finally{E(this,qe)===c&&G(this,qe,void 0),this.scheduleGc()}}},ar=new WeakMap,Dn=new WeakMap,cr=new WeakMap,Ot=new WeakMap,Mn=new WeakMap,qe=new WeakMap,Xr=new WeakMap,jn=new WeakMap,Nt=new WeakSet,Kt=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...gu(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...uc(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return G(this,cr,t.manual?o:void 0),o;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),tt.batch(()=>{this.observers.slice().forEach(r=>{r.onQueryUpdate()}),E(this,Ot).notify({query:this,type:"updated",action:t})})},Yl);function gu(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hu(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function uc(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function dc(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var dt,ge,eo,ft,$n,lr,Qt,to,ur,dr,zn,Fn,yn,fr,Se,Fr,Xs,ei,ti,ni,ri,oi,si,ii,Jl,_m=(Jl=class extends oo{constructor(t,n){super();ie(this,Se);ie(this,dt);ie(this,ge);ie(this,eo);ie(this,ft);ie(this,$n);ie(this,lr);ie(this,Qt);ie(this,to);ie(this,ur);ie(this,dr);ie(this,zn);ie(this,Fn);ie(this,yn);ie(this,fr,new Set);this.options=n,G(this,dt,t),G(this,Qt,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,ge).addObserver(this),fc(E(this,ge),this.options)?pe(this,Se,Fr).call(this):this.updateResult(),pe(this,Se,ri).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ai(E(this,ge),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ai(E(this,ge),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pe(this,Se,oi).call(this),pe(this,Se,si).call(this),E(this,ge).removeObserver(this)}setOptions(t){const n=this.options,r=E(this,ge);if(this.options=E(this,dt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ie(this.options.enabled,E(this,ge))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pe(this,Se,ii).call(this),E(this,ge).setOptions(this.options),n._defaulted&&!Ps(this.options,n)&&E(this,dt).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,ge),observer:this});const o=this.hasListeners();o&&hc(E(this,ge),r,this.options,n)&&pe(this,Se,Fr).call(this),this.updateResult(),o&&(E(this,ge)!==r||Ie(this.options.enabled,E(this,ge))!==Ie(n.enabled,E(this,ge))||Ie(this.options.staleTime,E(this,ge))!==Ie(n.staleTime,E(this,ge)))&&pe(this,Se,ei).call(this);const s=pe(this,Se,ti).call(this);o&&(E(this,ge)!==r||Ie(this.options.enabled,E(this,ge))!==Ie(n.enabled,E(this,ge))||s!==E(this,yn))&&pe(this,Se,ni).call(this,s)}getOptimisticResult(t){const n=E(this,dt).getQueryCache().build(E(this,dt),t),r=this.createResult(n,t);return Ps(this.getCurrentResult(),r)||(G(this,ft,r),G(this,lr,this.options),G(this,$n,E(this,ge).state)),r}getCurrentResult(){return E(this,ft)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),Reflect.get(r,o))})}trackProp(t){E(this,fr).add(t)}getCurrentQuery(){return E(this,ge)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=E(this,dt).defaultQueryOptions(t),r=E(this,dt).getQueryCache().build(E(this,dt),n);let o=()=>{},s;const i=new Promise(a=>{s=a,o=E(this,dt).getQueryCache().subscribe(c=>{c.type==="updated"&&c.query.queryHash===r.queryHash&&r.state.data!==void 0&&(o(),a(this.createResult(r,n)))})});return Promise.race([r.fetch().then(()=>{const a=this.createResult(r,n);return s==null||s(a),a}).finally(()=>{o()}),i])}fetch(t){return pe(this,Se,Fr).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,ft)))}createResult(t,n){var P;const r=E(this,ge),o=this.options,s=E(this,ft),i=E(this,$n),a=E(this,lr),c=t!==r?t.state:E(this,eo),{state:u}=t;let d={...u},l=!1,f;if(n._optimisticResults){const R=this.hasListeners(),T=!R&&fc(t,n),A=R&&hc(t,r,n,o);(T||A)&&(d={...d,...gu(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:v,status:g}=d;f=d.data;let w=!1;if(n.placeholderData!==void 0&&f===void 0&&g==="pending"){let R;s!=null&&s.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(R=s.data,w=!0):R=typeof n.placeholderData=="function"?n.placeholderData((P=E(this,dr))==null?void 0:P.state.data,E(this,dr)):n.placeholderData,R!==void 0&&(g="success",f=Ys(s==null?void 0:s.data,R,n),l=!0)}if(n.select&&f!==void 0&&!w)if(s&&f===(i==null?void 0:i.data)&&n.select===E(this,to))f=E(this,ur);else try{G(this,to,n.select),f=n.select(f),f=Ys(s==null?void 0:s.data,f,n),G(this,ur,f),G(this,Qt,null)}catch(R){G(this,Qt,R)}else f===void 0&&G(this,Qt,null);E(this,Qt)&&(p=E(this,Qt),f=E(this,ur),v=Date.now(),g="error",l=!1);const b=d.fetchStatus==="fetching",x=g==="pending",_=g==="error",C=x&&b,S=f!==void 0;return{status:g,fetchStatus:d.fetchStatus,isPending:x,isSuccess:g==="success",isError:_,isInitialLoading:C,isLoading:C,data:f,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:_&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:l,isRefetchError:_&&S,isStale:ta(t,n),refetch:this.refetch,isEnabled:Ie(n.enabled,t)!==!1}}updateResult(){const t=E(this,ft),n=this.createResult(E(this,ge),this.options);if(G(this,$n,E(this,ge).state),G(this,lr,this.options),E(this,$n).data!==void 0&&G(this,dr,E(this,ge)),Ps(n,t))return;G(this,ft,n);const o=(()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!E(this,fr).size)return!0;const a=new Set(i??E(this,fr));return this.options.throwOnError&&a.add("error"),Object.keys(E(this,ft)).some(c=>{const u=c;return E(this,ft)[u]!==t[u]&&a.has(u)})})();tt.batch(()=>{o&&this.listeners.forEach(s=>{s(E(this,ft))}),E(this,dt).getQueryCache().notify({query:E(this,ge),type:"observerResultsUpdated"})})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pe(this,Se,ri).call(this)}},dt=new WeakMap,ge=new WeakMap,eo=new WeakMap,ft=new WeakMap,$n=new WeakMap,lr=new WeakMap,Qt=new WeakMap,to=new WeakMap,ur=new WeakMap,dr=new WeakMap,zn=new WeakMap,Fn=new WeakMap,yn=new WeakMap,fr=new WeakMap,Se=new WeakSet,Fr=function(t){pe(this,Se,ii).call(this);let n=E(this,ge).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(vt)),n},Xs=function(t){return!Xi()&&Ie(this.options.enabled,E(this,ge))!==!1&&cu(t)},ei=function(){pe(this,Se,oi).call(this);const t=Ie(this.options.staleTime,E(this,ge));if(E(this,ft).isStale||!pe(this,Se,Xs).call(this,t))return;const n=lu(E(this,ft).dataUpdatedAt,t)+1;G(this,zn,In.setTimeout(()=>{E(this,ft).isStale||this.updateResult()},n))},ti=function(){return Ie(this.options.refetchInterval,E(this,ge))??!1},ni=function(t){pe(this,Se,si).call(this),G(this,yn,t),!(E(this,yn)===0||!pe(this,Se,Xs).call(this,E(this,yn)))&&G(this,Fn,In.setInterval(()=>{(this.options.refetchIntervalInBackground||ea.isFocused())&&pe(this,Se,Fr).call(this)},E(this,yn)))},ri=function(){pe(this,Se,ei).call(this),pe(this,Se,ni).call(this,pe(this,Se,ti).call(this))},oi=function(){E(this,zn)!==void 0&&(In.clearTimeout(E(this,zn)),G(this,zn,void 0))},si=function(){E(this,Fn)!==void 0&&(In.clearInterval(E(this,Fn)),G(this,Fn,void 0))},ii=function(){const t=E(this,dt).getQueryCache().build(E(this,dt),this.options);if(t===E(this,ge))return;const n=E(this,ge);G(this,ge,t),G(this,eo,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Jl);function xm(e,t){return Ie(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Ie(t.retryOnMount,e)===!1)}function fc(e,t){return xm(e,t)||e.state.data!==void 0&&ai(e,t,t.refetchOnMount)}function ai(e,t,n){if(Ie(t.enabled,e)!==!1&&Ie(t.staleTime,e)!=="static"){const r=Ie(n,e);return r==="always"||r!==!1&&ta(e,t)}return!1}function hc(e,t,n,r){return(e!==t||Ie(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ta(e,n)}function ta(e,t){return Ie(t.enabled,e)!==!1&&e.isStaleByTime(Ie(t.staleTime,e))}var no,Ft,it,Ln,Lt,fn,Xl,Sm=(Xl=class extends mu{constructor(t){super();ie(this,Lt);ie(this,no);ie(this,Ft);ie(this,it);ie(this,Ln);G(this,no,t.client),this.mutationId=t.mutationId,G(this,it,t.mutationCache),G(this,Ft,[]),this.state=t.state||Em(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){E(this,Ft).includes(t)||(E(this,Ft).push(t),this.clearGcTimeout(),E(this,it).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){G(this,Ft,E(this,Ft).filter(n=>n!==t)),this.scheduleGc(),E(this,it).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){E(this,Ft).length||(this.state.status==="pending"?this.scheduleGc():E(this,it).remove(this))}continue(){var t;return((t=E(this,Ln))==null?void 0:t.continue())??(this.state.status==="pending"?this.execute(this.state.variables):Promise.resolve())}async execute(t){var a,c,u,d,l,f,p,v,g,w,b,x,_,C,S,P,R,T;const n=()=>{pe(this,Lt,fn).call(this,{type:"continue"})},r={client:E(this,no),meta:this.options.meta,mutationKey:this.options.mutationKey},o=G(this,Ln,pu({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(A,j)=>{pe(this,Lt,fn).call(this,{type:"failed",failureCount:A,error:j})},onPause:()=>{pe(this,Lt,fn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,it).canRun(this)})),s=this.state.status==="pending",i=!o.canStart();try{if(s)n();else{pe(this,Lt,fn).call(this,{type:"pending",variables:t,isPaused:i}),E(this,it).config.onMutate&&await E(this,it).config.onMutate(t,this,r);const j=await((c=(a=this.options).onMutate)==null?void 0:c.call(a,t,r));j!==this.state.context&&pe(this,Lt,fn).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const A=await o.start();return await((d=(u=E(this,it).config).onSuccess)==null?void 0:d.call(u,A,t,this.state.context,this,r)),await((f=(l=this.options).onSuccess)==null?void 0:f.call(l,A,t,this.state.context,r)),await((v=(p=E(this,it).config).onSettled)==null?void 0:v.call(p,A,null,this.state.variables,this.state.context,this,r)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,A,null,t,this.state.context,r)),pe(this,Lt,fn).call(this,{type:"success",data:A}),A}catch(A){try{await((x=(b=E(this,it).config).onError)==null?void 0:x.call(b,A,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((C=(_=this.options).onError)==null?void 0:C.call(_,A,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((P=(S=E(this,it).config).onSettled)==null?void 0:P.call(S,void 0,A,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((T=(R=this.options).onSettled)==null?void 0:T.call(R,void 0,A,t,this.state.context,r))}catch(j){Promise.reject(j)}throw pe(this,Lt,fn).call(this,{type:"error",error:A}),A}finally{E(this,Ln)===o&&G(this,Ln,void 0),E(this,it).runNext(this)}}},no=new WeakMap,Ft=new WeakMap,it=new WeakMap,Ln=new WeakMap,Lt=new WeakSet,fn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),tt.batch(()=>{E(this,Ft).forEach(r=>{r.onMutationUpdate(t)}),E(this,it).notify({mutation:this,type:"updated",action:t})})},Xl);function Em(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bn,Dt,ro,eu,Cm=(eu=class extends oo{constructor(t={}){super();ie(this,bn);ie(this,Dt);ie(this,ro);this.config=t,G(this,bn,new Set),G(this,Dt,new Map),G(this,ro,0)}build(t,n,r){const o=new Sm({client:t,mutationCache:this,mutationId:++po(this,ro)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){E(this,bn).add(t);const n=go(t);if(typeof n=="string"){const r=E(this,Dt).get(n);r?r.push(t):E(this,Dt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(E(this,bn).delete(t)){const n=go(t);if(typeof n=="string"){const r=E(this,Dt).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&E(this,Dt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=go(t);if(typeof n=="string"){const o=(r=E(this,Dt).get(n))==null?void 0:r.find(s=>s.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r,o;const n=go(t);return typeof n=="string"?((o=(r=E(this,Dt).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused))==null?void 0:o.continue())??Promise.resolve():Promise.resolve()}clear(){tt.batch(()=>{const t=this.getAll();E(this,bn).clear(),E(this,Dt).clear(),t.forEach(n=>{this.notify({type:"removed",mutation:n})})})}getAll(){return Array.from(E(this,bn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ic(n,r))}findAll(t={}){return this.getAll().filter(n=>ic(t,n))}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return tt.batch(()=>Promise.all(t.map(n=>n.continue().catch(vt))))}},bn=new WeakMap,Dt=new WeakMap,ro=new WeakMap,eu);function go(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Vt,tu,km=(tu=class extends oo{constructor(t={}){super();ie(this,Vt);this.config=t,G(this,Vt,new Map)}build(t,n,r){const o=n.queryKey,s=n.queryHash??Yi(o,n);let i=this.get(s);return i||(i=new wm({client:t,queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(i)),i}add(t){E(this,Vt).has(t.queryHash)||(E(this,Vt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){E(this,Vt).get(t.queryHash)===t&&(t.destroy(),E(this,Vt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){tt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return E(this,Vt).get(t)}getAll(){return[...E(this,Vt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sc(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>sc(t,r)):n}notify(t){tt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){tt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){tt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Vt=new WeakMap,tu),De,wn,_n,hr,pr,xn,mr,gr,nu,Om=(nu=class{constructor(e={}){ie(this,De);ie(this,wn);ie(this,_n);ie(this,hr);ie(this,pr);ie(this,xn);ie(this,mr);ie(this,gr);G(this,De,e.queryCache||new km),G(this,wn,e.mutationCache||new Cm),G(this,_n,e.defaultOptions||{}),G(this,hr,new Map),G(this,pr,new Map),G(this,xn,0)}mount(){po(this,xn)._++,E(this,xn)===1&&(G(this,mr,ea.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,De).onFocus())})),G(this,gr,Ho.subscribe(async e=>{e&&(await this.resumePausedMutations(),E(this,De).onOnline())})))}unmount(){var e,t;po(this,xn)._--,E(this,xn)===0&&((e=E(this,mr))==null||e.call(this),G(this,mr,void 0),(t=E(this,gr))==null||t.call(this),G(this,gr,void 0))}isFetching(e){return E(this,De).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return E(this,wn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,De).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=E(this,De).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ie(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return E(this,De).findAll(e).map(({queryKey:t,state:n})=>[t,n.data])}setQueryData(e,t,n){var i;const r=this.defaultQueryOptions({queryKey:e}),o=(i=E(this,De).get(r.queryHash))==null?void 0:i.state.data,s=im(t,o);if(s!==void 0)return E(this,De).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return tt.batch(()=>E(this,De).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=E(this,De).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=E(this,De);tt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=E(this,De);return tt.batch(()=>{const r=n.findAll(e),o=new Set(r);return r.forEach(s=>{s.reset()}),this.refetchQueries({type:"active",predicate:s=>o.has(s)},t)})}cancelQueries(e,t={}){const n={revert:!0,...t},r=tt.batch(()=>E(this,De).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(vt).catch(vt)}invalidateQueries(e,t={}){return tt.batch(()=>(E(this,De).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=tt.batch(()=>E(this,De).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let s=o.fetch(void 0,n);return n.throwOnError||(s=s.catch(vt)),o.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(vt)}async query(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=E(this,De).build(this,t),r=n.isStaleByTime(Ie(t.staleTime,n))?await n.fetch(t):n.state.data,o=t.select;return o?o(r):r}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=E(this,De).build(this,t);return n.isStaleByTime(Ie(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vt).catch(vt)}infiniteQuery(e){return e._type="infinite",this.query(e)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vt).catch(vt)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return Ho.isOnline()?E(this,wn).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,De)}getMutationCache(){return E(this,wn)}getDefaultOptions(){return E(this,_n)}setDefaultOptions(e){G(this,_n,e)}setQueryDefaults(e,t){E(this,hr).set(Wr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...E(this,hr).values()],n={};return t.forEach(r=>{vr(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){E(this,pr).set(Wr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...E(this,pr).values()],n={};return t.forEach(r=>{vr(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...E(this,_n).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Yi(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ji&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...E(this,_n).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){E(this,De).clear(),E(this,wn).clear()}},De=new WeakMap,wn=new WeakMap,_n=new WeakMap,hr=new WeakMap,pr=new WeakMap,xn=new WeakMap,mr=new WeakMap,gr=new WeakMap,nu);const vu=h.createContext(!1),Pm=()=>h.useContext(vu);vu.Provider;function Rm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Tm=h.createContext(Rm()),Im=()=>h.useContext(Tm),Am=(e,t,n)=>{const r=(n==null?void 0:n.state.status)==="error"&&typeof e.throwOnError=="function"?fu(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Nm=e=>{h.useEffect(()=>{e.clearReset()},[e])},Dm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||fu(n,[e.error,r])),Mm=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},jm=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,$m=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function zm(e,t,n){const r=Pm(),o=Im(),s=Qi(),i=s.defaultQueryOptions(e),a=s.getQueryCache().get(i.queryHash),c=e.subscribed!==!1;i._optimisticResults=r?"isRestoring":c?"optimistic":void 0,Mm(i),Am(i,o,a),Nm(o);const[u]=h.useState(()=>new t(s,i)),d=u.getOptimisticResult(i),l=!r&&c;if(h.useSyncExternalStore(h.useCallback(f=>{const p=l?u.subscribe(tt.batchCalls(f)):vt;return u.updateResult(),p},[u,l]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),h.useEffect(()=>{u.setOptions(i)},[i,u]),jm(i,d))throw $m(i,u,o);if(Dm({result:d,errorResetBoundary:o,throwOnError:i.throwOnError,query:a,suspense:i.suspense}))throw d.error;return i.notifyOnChangeProps?d:u.trackResult(d)}function Wo(e,t){return zm(e,_m)}/**
|
|
3
3
|
* @license lucide-react v1.59.0 - ISC
|
|
4
4
|
*
|
|
@@ -189,7 +189,7 @@ var nc=e=>{throw TypeError(e)};var ks=(e,t,n)=>t.has(e)||nc("Cannot "+n);var E=(
|
|
|
189
189
|
`)},Tc=function(){var e=parseInt(document.body.getAttribute(rr)||"0",10);return isFinite(e)?e:0},Iy=function(){h.useEffect(function(){return document.body.setAttribute(rr,(Tc()+1).toString()),function(){var e=Tc()-1;e<=0?document.body.removeAttribute(rr):document.body.setAttribute(rr,e.toString())}},[])},Ay=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Iy();var s=h.useMemo(function(){return Py(o)},[o]);return h.createElement(Ry,{styles:Ty(s,!t,o,n?"":"!important")})},yi=!1;if(typeof window<"u")try{var bo=Object.defineProperty({},"passive",{get:function(){return yi=!0,!0}});window.addEventListener("test",bo,bo),window.removeEventListener("test",bo,bo)}catch{yi=!1}var Yn=yi?{passive:!1}:!1,Ny=function(e){return e.tagName==="TEXTAREA"},Ad=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Ny(e)&&n[t]==="visible")},Dy=function(e){return Ad(e,"overflowY")},My=function(e){return Ad(e,"overflowX")},Ic=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=Nd(e,r);if(o){var s=Dd(e,r),i=s[1],a=s[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jy=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},$y=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Nd=function(e,t){return e==="v"?Dy(t):My(t)},Dd=function(e,t){return e==="v"?jy(t):$y(t)},zy=function(e,t){return e==="h"&&t==="rtl"?-1:1},Fy=function(e,t,n,r,o){var s=zy(e,window.getComputedStyle(t).direction),i=s*r,a=n.target,c=t.contains(a),u=!1,d=i>0,l=0,f=0;do{if(!a)break;var p=Dd(e,a),v=p[0],g=p[1],w=p[2],b=g-w-s*v;(v||b)&&Nd(e,a)&&(l+=b,f+=v);var x=a.parentNode;a=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!c&&a!==document.body||c&&(t.contains(a)||t===a));return(d&&Math.abs(l)<1||!d&&Math.abs(f)<1)&&(u=!0),u},wo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Ac=function(e){return[e.deltaX,e.deltaY]},Nc=function(e){return e&&"current"in e?e.current:e},Ly=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Vy=function(e){return`
|
|
190
190
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
191
191
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
192
|
-
`)},Uy=0,Jn=[];function Zy(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Uy++)[0],s=h.useState(Id)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=uy([e.lockRef.current],(e.shards||[]).map(Nc),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=wo(g),x=n.current,_="deltaX"in g?g.deltaX:x[0]-b[0],C="deltaY"in g?g.deltaY:x[1]-b[1],S,P=g.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in g&&R==="h"&&P.type==="range")return!1;var T=window.getSelection(),A=T&&T.anchorNode,j=A?A===P||A.contains(P):!1;if(j)return!1;var F=Ic(R,P);if(!F)return!0;if(F?S=R:(S=R==="v"?"h":"v",F=Ic(R,P)),!F)return!1;if(!r.current&&"changedTouches"in g&&(_||C)&&(r.current=S),!S)return!0;var z=r.current||S;return Fy(z,w,g,z==="h"?_:C)},[]),c=h.useCallback(function(g){var w=g;if(!(!Jn.length||Jn[Jn.length-1]!==s)){var b="deltaY"in w?Ac(w):wo(w),x=t.current.filter(function(S){return S.name===w.type&&(S.target===w.target||w.target===S.shadowParent)&&Ly(S.delta,b)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var _=(i.current.shards||[]).map(Nc).filter(Boolean).filter(function(S){return S.contains(w.target)}),C=_.length>0?a(w,_[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=h.useCallback(function(g,w,b,x){var _={name:g,delta:w,target:b,should:x,shadowParent:By(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=h.useCallback(function(g){n.current=wo(g),r.current=void 0},[]),l=h.useCallback(function(g){u(g.type,Ac(g),g.target,a(g,e.lockRef.current))},[]),f=h.useCallback(function(g){u(g.type,wo(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Jn.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Yn),document.addEventListener("touchmove",c,Yn),document.addEventListener("touchstart",d,Yn),function(){Jn=Jn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Yn),document.removeEventListener("touchmove",c,Yn),document.removeEventListener("touchstart",d,Yn)}},[]);var p=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:Vy(o)}):null,p?h.createElement(Ay,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function By(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hy=by(Td,Zy);var ma=h.forwardRef(function(e,t){return h.createElement(cs,Ut({},e,{ref:t,sideCar:Hy}))});ma.classNames=cs.classNames;var Wy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xn=new WeakMap,_o=new WeakMap,xo={},js=0,Md=function(e){return e&&(e.host||Md(e.parentNode))},Ky=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Md(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gy=function(e,t,n,r){var o=Ky(t,Array.isArray(e)?e:[e]);xo[n]||(xo[n]=new WeakMap);var s=xo[n],i=[],a=new Set,c=new Set(o),u=function(l){!l||a.has(l)||(a.add(l),u(l.parentNode))};o.forEach(u);var d=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(f){if(a.has(f))d(f);else try{var p=f.getAttribute(r),v=p!==null&&p!=="false",g=(Xn.get(f)||0)+1,w=(s.get(f)||0)+1;Xn.set(f,g),s.set(f,w),i.push(f),g===1&&v&&_o.set(f,!0),w===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),js++,function(){i.forEach(function(l){var f=Xn.get(l)-1,p=s.get(l)-1;Xn.set(l,f),s.set(l,p),f||(_o.has(l)||l.removeAttribute(r),_o.delete(l)),p||l.removeAttribute(n)}),js--,js||(Xn=new WeakMap,Xn=new WeakMap,_o=new WeakMap,xo={})}},jd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Wy(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Gy(r,o,n,"aria-hidden")):function(){return null}},qy=Object.defineProperty,bt=(e,t)=>qy(e,"name",{value:t,configurable:!0}),ga="Dialog",[$d,C2]=nn(ga),[Qy,jt]=$d(ga),Yy=bt(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),c=h.useRef(null),{nodes:u,registry:d}=ua(),[l,f]=ao({prop:r,defaultProp:o??!1,onChange:s,caller:ga}),[p,v]=h.useState(0),[g,w]=h.useState(0);return m.jsx(Qy,{scope:t,triggerRef:a,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:v,setDescriptionCount:w,open:l,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(b=>!b),[f]),modal:i,branchNodes:u,branchRegistry:d,children:n})},"Dialog"),Jy="DialogTrigger",k2=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(Jy,r),i=Te(n,s.triggerRef);return m.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ls(s.open),...o,ref:i,onClick:de(t.onClick,s.onOpenToggle)})},"DialogTrigger")),zd="DialogPortal",[Xy,Fd]=$d(zd,{forceMount:void 0}),eb=bt(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=jt(zd,t);return m.jsx(Xy,{scope:t,forceMount:n,children:h.Children.map(r,i=>m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),bi="DialogOverlay",Ld=h.forwardRef(bt(function(t,n){const r=Fd(bi,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(bi,t.__scopeDialog);return i.modal?m.jsx(rn,{present:o||i.open,children:m.jsx(nb,{...s,ref:n})}):null},"DialogOverlay")),tb=Jt("DialogOverlay.RemoveScroll"),nb=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(bi,r),i=hd(),a=Te(n,i);return m.jsx(ma,{as:tb,allowPinchZoom:!0,shards:h.useMemo(()=>[s.contentRef,...s.branchNodes.map(c=>({current:c}))],[s.contentRef,s.branchNodes]),children:m.jsx(Ze.div,{"data-state":ls(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Kr="DialogContent",Vd=h.forwardRef(bt(function(t,n){const r=Fd(Kr,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(Kr,t.__scopeDialog);return m.jsx(rn,{present:o||i.open,children:i.modal?m.jsx(rb,{...s,ref:n}):m.jsx(ob,{...s,ref:n})})},"DialogContent")),rb=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(null),s=Te(n,r.contentRef,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Ud,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:de(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:de(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),ob=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(!1),s=h.useRef(!1);return m.jsx(Ud,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Ud=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,"aria-describedby":a,children:c,...u}=t,d=jt(Kr,r);return as(),m.jsx(la,{registry:d.branchRegistry,children:m.jsx(gd,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(aa,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?Hd(a,d.descriptionId):a,"data-state":ls(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),Zd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogTitle",r),{setTitleCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),Bd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogDescription",r),{setDescriptionCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),sb="DialogClose",ib=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(sb,r);return m.jsx(Ze.button,{type:"button",...o,ref:n,onClick:de(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Hd(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}bt(Hd,"concatAriaDescribedby");function ls(e){return e?"open":"closed"}bt(ls,"getState");const ab=Yy,cb=eb,Wd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ld,{className:s,...o,ref:t}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wd.displayName=Ld.displayName;const lb=so("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Kd=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s,i;n[0]!==e?({side:i,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=i===void 0?"right":i;let c;n[5]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(Wd,{}),n[5]=c):c=n[5];let u;n[6]!==o||n[7]!==a?(u=ce(lb({side:a}),o),n[6]=o,n[7]=a,n[8]=u):u=n[8];let d;n[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsxs(ib,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[m.jsx(hg,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]}),n[9]=d):d=n[9];let l;return n[10]!==r||n[11]!==s||n[12]!==t||n[13]!==u?(l=m.jsxs(cb,{children:[c,m.jsxs(Vd,{ref:t,className:u,...s,children:[r,d]})]}),n[10]=r,n[11]=s,n[12]=t,n[13]=u,n[14]=l):l=n[14],l});Kd.displayName=Vd.displayName;const Gd=e=>{const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("flex flex-col space-y-2 text-center sm:text-left",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s};Gd.displayName="SheetHeader";const qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-lg font-semibold text-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Zd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qd.displayName=Zd.displayName;const Qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Bd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Qd.displayName=Bd.displayName;function Dc(e){const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("animate-pulse rounded-md bg-muted",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s}var ub=Object.defineProperty,db=(e,t)=>ub(e,"name",{value:t,configurable:!0});function Yd(e){const[t,n]=h.useState(void 0);return ct(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return o.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}else n(void 0)},[e]),t}db(Yd,"useSize");var fb=Object.defineProperty,Cn=(e,t)=>fb(e,"name",{value:t,configurable:!0}),Mc={Partial:"partial"},jc={Optimized:"optimized",Always:"always"},Jd="Popper",[Xd,us]=nn(Jd),[hb,ef]=Xd(Jd),tf=Cn(e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null),[s,i]=h.useState(void 0);return m.jsx(hb,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),pb="PopperAnchor",nf=h.forwardRef(Cn(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,i=ef(pb,r),a=h.useRef(null),c=i.onAnchorChange,u=h.useCallback(g=>{a.current=g,g&&c(g)},[c]),d=Te(n,u),l=h.useRef(null);h.useEffect(()=>{if(!o)return;const g=l.current;l.current=o.current,g!==l.current&&c(l.current)});const f=i.placementState&&ds(i.placementState),p=f==null?void 0:f[0],v=f==null?void 0:f[1];return o?null:m.jsx(Ze.div,{"data-radix-popper-side":p,"data-radix-popper-align":v,...s,ref:d})},"PopperAnchor")),rf="PopperContent",[mb,O2]=Xd(rf),of=h.forwardRef(Cn(function(t,n){var le,Pe,je,Ee,$e,We,kt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:l=0,sticky:f=Mc.Partial,hideWhenDetached:p=!1,updatePositionStrategy:v=jc.Optimized,onPlaced:g,...w}=t,b=ef(rf,r),[x,_]=h.useState(null),C=Te(n,_),[S,P]=h.useState(null),R=Yd(S),T=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,j=o+(i!=="center"?"-"+i:""),F=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},z=Array.isArray(d)?d:[d],Y=z.length>0,Z={padding:F,boundary:z.filter(sf),altBoundary:Y},{refs:K,floatingStyles:H,placement:J,isPositioned:ne,middlewareData:te}=Ip({strategy:"fixed",placement:j,whileElementsMounted:Cn((...lt)=>Fp(...lt,{animationFrame:v===jc.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Ap({mainAxis:s+A,alignmentAxis:a}),u&&Np({mainAxis:!0,crossAxis:!1,...f===Mc.Partial?{limiter:zp()}:{},...Z}),u&&Dp({...Z}),Mp({...Z,apply:Cn(({elements:lt,rects:Le,availableWidth:qn,availableHeight:pt})=>{const{width:Rn,height:on}=Le.reference,ze=lt.floating.style;ze.setProperty("--radix-popper-available-width",`${qn}px`),ze.setProperty("--radix-popper-available-height",`${pt}px`),ze.setProperty("--radix-popper-anchor-width",`${Rn}px`),ze.setProperty("--radix-popper-anchor-height",`${on}px`)},"apply")}),S&&jp({element:S,padding:c}),gb({arrowWidth:T,arrowHeight:A}),p&&$p(Y?{strategy:"referenceHidden",...Z}:{strategy:"referenceHidden",padding:Z.padding,altBoundary:Z.altBoundary})]}),X=b.setPlacementState;ct(()=>(X(J),()=>{X(void 0)}),[J,X]);const[q,me]=ds(J),he=Xt(g);ct(()=>{ne&&(he==null||he())},[ne,he]);const ae=(le=te.arrow)==null?void 0:le.x,re=(Pe=te.arrow)==null?void 0:Pe.y,B=((je=te.arrow)==null?void 0:je.centerOffset)!==0,[se,ye]=h.useState();return ct(()=>{x&&ye(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Ee=te.transformOrigin)==null?void 0:Ee.x,($e=te.transformOrigin)==null?void 0:$e.y].join(" "),...((We=te.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(mb,{scope:r,placedSide:q,placedAlign:me,onArrowChange:P,arrowX:ae,arrowY:re,shouldHideArrow:B,children:m.jsx(Ze.div,{"data-side":q,"data-align":me,...w,ref:C,style:{...w.style,animation:ne?(kt=w.style)==null?void 0:kt.animation:"none"}})})})},"PopperContent"));function sf(e){return e!==null}Cn(sf,"isNotNull");var gb=Cn(e=>({name:"transformOrigin",options:e,fn(t){var w,b,x;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=ds(n),l={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?l:`${f}px`,g=`${-c}px`):u==="top"?(v=i?l:`${f}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?l:`${p}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?l:`${p}px`),{data:{x:v,y:g}}}}),"transformOrigin");function ds(e){const[t,n="center"]=e.split("-");return[t,n]}Cn(ds,"getSideAndAlignFromPlacement");var vb=Object.defineProperty,yb=(e,t)=>vb(e,"name",{value:t,configurable:!0}),bb=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wb=h.forwardRef(yb(function(t,n){return m.jsx(Ze.span,{...t,ref:n,style:{...bb,...t.style}})},"VisuallyHidden")),_b=Object.defineProperty,Ye=(e,t)=>_b(e,"name",{value:t,configurable:!0}),[va,P2]=nn("Tooltip",[us]),ya=us(),xb="TooltipProvider",Sb=700,wi="tooltip.open",[Eb,ba]=va(xb),Cb=Ye(e=>{const{__scopeTooltip:t,delayDuration:n=Sb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=h.useRef(!0),a=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.jsx(Eb,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),_i="Tooltip",[kb,co]=va(_i),Ob=Ye(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ba(_i,e.__scopeTooltip),u=ya(t),[d,l]=h.useState(null),[f,p]=h.useState(void 0),v=En(),g=h.useRef(0),w=i??c.disableHoverableContent,b=a??c.delayDuration,x=h.useRef(!1),[_,C]=ao({prop:r,defaultProp:o??!1,onChange:Ye(j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(wi))):c.onClose(),s==null||s(j)},"onChange"),caller:_i}),S=h.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),P=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,C(!0)},[C]),R=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),T=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,C(!0),g.current=0},b)},[b,C]);h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const A=f??v;return m.jsx(tf,{...u,children:m.jsx(kb,{scope:t,contentId:A,setContentId:p,open:_,stateAttribute:S,trigger:d,onTriggerChange:l,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?T():P()},[c.isOpenDelayedRef,T,P]),onTriggerLeave:h.useCallback(()=>{w?R():(window.clearTimeout(g.current),g.current=0)},[R,w]),onOpen:P,onClose:R,disableHoverableContent:w,children:n})})},"Tooltip"),$c="TooltipTrigger",Pb=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,"aria-describedby":o,...s}=t,i=co($c,r),a=ba($c,r),c=ya(r),u=h.useRef(null),d=Te(n,u,i.onTriggerChange),l=h.useRef(!1),f=h.useRef(!1),p=h.useCallback(()=>l.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),m.jsx(nf,{asChild:!0,...c,children:m.jsx(Ze.button,{"aria-describedby":i.open?gf(o,i.contentId):o,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:de(t.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:de(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:de(t.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:de(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:de(t.onBlur,i.onClose),onClick:de(t.onClick,i.onClose)})})},"TooltipTrigger")),af="TooltipPortal",[Rb,Tb]=va(af,{forceMount:void 0}),Ib=Ye(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=co(af,t);return m.jsx(Rb,{scope:t,forceMount:n,children:m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Gr="TooltipContent",cf=h.forwardRef(Ye(function(t,n){const r=Tb(Gr,t.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=t,a=co(Gr,t.__scopeTooltip);return m.jsx(rn,{present:o||a.open,children:a.disableHoverableContent?m.jsx(lf,{side:s,...i,ref:n}):m.jsx(Ab,{side:s,...i,ref:n})})},"TooltipContent")),Ab=h.forwardRef(Ye(function(t,n){const r=co(Gr,t.__scopeTooltip),o=ba(Gr,t.__scopeTooltip),s=h.useRef(null),i=Te(n,s),[a,c]=h.useState(null),{trigger:u,onClose:d}=r,l=s.current,{onPointerInTransitChange:f}=o,p=h.useCallback(()=>{c(null),f(!1)},[f]),v=h.useCallback((g,w)=>{const b=g.currentTarget,x={x:g.clientX,y:g.clientY},_=uf(x,b.getBoundingClientRect()),C=df(x,_),S=ff(w.getBoundingClientRect()),P=pf([...C,...S]);c(P),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(u&&l){const g=Ye(b=>v(b,l),"handleTriggerLeave"),w=Ye(b=>v(b,u),"handleContentLeave");return u.addEventListener("pointerleave",g),l.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",g),l.removeEventListener("pointerleave",w)}}},[u,l,v,p]),h.useEffect(()=>{if(a){const g=Ye(w=>{const b=w.target,x={x:w.clientX,y:w.clientY},_=(u==null?void 0:u.contains(b))||(l==null?void 0:l.contains(b)),C=!hf(x,a);_?p():C&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,l,a,d,p]),m.jsx(lf,{...t,ref:i})},"TooltipContentHoverable")),Nb=Vu("TooltipContent"),lf=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=t,d=co(Gr,r),l=ya(r),{onClose:f}=d,[p,v]=h.useState(null),g=Te(n,v);da(p),h.useEffect(()=>(document.addEventListener(wi,f),()=>document.removeEventListener(wi,f)),[f]),h.useEffect(()=>{if(d.trigger){const b=Ye(x=>{x.target instanceof Node&&x.target.contains(d.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[d.trigger,f]);const{setContentId:w}=d;return ct(()=>(w(i),()=>{w(void 0)}),[i,w]),m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:b=>b.preventDefault(),onDismiss:f,children:m.jsxs(of,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...l,...u,ref:g,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(Nb,{children:o}),s?m.jsx(wb,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function uf(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ye(uf,"getExitSideFromRect");function df(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Ye(df,"getPaddedExitPoints");function ff(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}Ye(ff,"getPointsFromRect");function hf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}Ye(hf,"isPointInPolygon");function pf(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),mf(t)}Ye(pf,"getHull");function mf(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ye(mf,"getHullPresorted");function gf(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ye(gf,"concatAriaDescribedby");const Db=Cb,Mb=Ob,jb=Pb,vf=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-[50] overflow-hidden rounded-lg bg-foreground/85 px-[7px] py-1.5 text-[11px] text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(Ib,{children:m.jsx(cf,{ref:t,sideOffset:i,"data-slot":"tooltip-content",className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});vf.displayName=cf.displayName;const $b="sidebar_state",zb=3600*24*7,Fb="16rem",Lb="18rem",Vb="3rem",Ub="b",yf=h.createContext(null);function lo(){const e=h.useContext(yf);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const bf=h.forwardRef((e,t)=>{const n=ee.c(37);let r,o,s,i,a,c,u;n[0]!==e?({defaultOpen:u,open:s,onOpenChange:a,className:o,style:c,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=u===void 0?!0:u,l=Jg(),[f,p]=h.useState(!1),[v,g]=h.useState(d),w=s??v;let b;n[8]!==w||n[9]!==a?(b=K=>{const H=typeof K=="function"?K(w):K;a?a(H):g(H),document.cookie=`${$b}=${H}; path=/; max-age=${zb}`},n[8]=w,n[9]=a,n[10]=b):b=n[10];const x=b;let _;n[11]!==l||n[12]!==x?(_=()=>l?p(ew):x(tw),n[11]=l,n[12]=x,n[13]=_):_=n[13];const C=_;let S,P;n[14]!==C?(S=()=>{const K=H=>{H.key===Ub&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),C())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},P=[C],n[14]=C,n[15]=S,n[16]=P):(S=n[15],P=n[16]),h.useEffect(S,P);const R=w?"expanded":"collapsed";let T;n[17]!==l||n[18]!==w||n[19]!==f||n[20]!==x||n[21]!==R||n[22]!==C?(T={state:R,open:w,setOpen:x,isMobile:l,openMobile:f,setOpenMobile:p,toggleSidebar:C},n[17]=l,n[18]=w,n[19]=f,n[20]=x,n[21]=R,n[22]=C,n[23]=T):T=n[23];const A=T;let j;n[24]!==c?(j={"--sidebar-width":Fb,"--sidebar-width-icon":Vb,...c},n[24]=c,n[25]=j):j=n[25];const F=j;let z;n[26]!==o?(z=ce("group/sidebar-wrapper flex h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),n[26]=o,n[27]=z):z=n[27];let Y;n[28]!==r||n[29]!==i||n[30]!==t||n[31]!==F||n[32]!==z?(Y=m.jsx(Db,{delayDuration:0,children:m.jsx("div",{style:F,className:z,ref:t,...i,children:r})}),n[28]=r,n[29]=i,n[30]=t,n[31]=F,n[32]=z,n[33]=Y):Y=n[33];let Z;return n[34]!==A||n[35]!==Y?(Z=m.jsx(yf.Provider,{value:A,children:Y}),n[34]=A,n[35]=Y,n[36]=Z):Z=n[36],Z});bf.displayName="SidebarProvider";const wf=h.forwardRef((e,t)=>{const n=ee.c(48);let r,o,s,i,a,c;n[0]!==e?({side:i,variant:a,collapsible:c,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6]);const u=i===void 0?"left":i,d=a===void 0?"sidebar":a,l=c===void 0?"offcanvas":c,{isMobile:f,state:p,openMobile:v,setOpenMobile:g}=lo();if(l==="none"){let j;n[7]!==o?(j=ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),n[7]=o,n[8]=j):j=n[8];let F;return n[9]!==r||n[10]!==s||n[11]!==t||n[12]!==j?(F=m.jsx("div",{className:j,ref:t,...s,children:r}),n[9]=r,n[10]=s,n[11]=t,n[12]=j,n[13]=F):F=n[13],F}if(f){let j;n[14]===Symbol.for("react.memo_cache_sentinel")?(j={"--sidebar-width":Lb},n[14]=j):j=n[14];let F;n[15]===Symbol.for("react.memo_cache_sentinel")?(F=m.jsxs(Gd,{className:"sr-only",children:[m.jsx(qd,{children:"Sidebar"}),m.jsx(Qd,{children:"Displays the mobile sidebar."})]}),n[15]=F):F=n[15];let z;n[16]!==r?(z=m.jsx("div",{className:"flex h-full w-full flex-col",children:r}),n[16]=r,n[17]=z):z=n[17];let Y;n[18]!==u||n[19]!==z?(Y=m.jsxs(Kd,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:j,side:u,children:[F,z]}),n[18]=u,n[19]=z,n[20]=Y):Y=n[20];let Z;return n[21]!==v||n[22]!==s||n[23]!==g||n[24]!==Y?(Z=m.jsx(ab,{open:v,onOpenChange:g,...s,children:Y}),n[21]=v,n[22]=s,n[23]=g,n[24]=Y,n[25]=Z):Z=n[25],Z}const w=p==="collapsed"?l:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]";let x;n[26]!==b?(x=ce("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),n[26]=b,n[27]=x):x=n[27];let _;n[28]!==x?(_=m.jsx("div",{className:x}),n[28]=x,n[29]=_):_=n[29];const C=u==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",S=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l";let P;n[30]!==o||n[31]!==C||n[32]!==S?(P=ce("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",C,S,o),n[30]=o,n[31]=C,n[32]=S,n[33]=P):P=n[33];let R;n[34]!==r?(R=m.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r}),n[34]=r,n[35]=R):R=n[35];let T;n[36]!==s||n[37]!==P||n[38]!==R?(T=m.jsx("div",{className:P,...s,children:R}),n[36]=s,n[37]=P,n[38]=R,n[39]=T):T=n[39];let A;return n[40]!==t||n[41]!==u||n[42]!==p||n[43]!==T||n[44]!==w||n[45]!==_||n[46]!==d?(A=m.jsxs("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":w,"data-variant":d,"data-side":u,children:[_,T]}),n[40]=t,n[41]=u,n[42]=p,n[43]=T,n[44]=w,n[45]=_,n[46]=d,n[47]=A):A=n[47],A});wf.displayName="Sidebar";const _f=h.forwardRef((e,t)=>{const n=ee.c(16);let r,o,s;n[0]!==e?({className:r,onClick:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const{toggleSidebar:i}=lo();let a;n[4]!==r?(a=ce("h-7 w-7",r),n[4]=r,n[5]=a):a=n[5];let c;n[6]!==o||n[7]!==i?(c=f=>{o==null||o(f),i()},n[6]=o,n[7]=i,n[8]=c):c=n[8];let u,d;n[9]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(cg,{}),d=m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),n[9]=u,n[10]=d):(u=n[9],d=n[10]);let l;return n[11]!==s||n[12]!==t||n[13]!==a||n[14]!==c?(l=m.jsxs(is,{ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:a,onClick:c,...s,children:[u,d]}),n[11]=s,n[12]=t,n[13]=a,n[14]=c,n[15]=l):l=n[15],l});_f.displayName="SidebarTrigger";const Zb=h.forwardRef((e,t)=>{const n=ee.c(10);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{toggleSidebar:s}=lo();let i;n[3]!==r?(i=ce("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",r),n[3]=r,n[4]=i):i=n[4];let a;return n[5]!==o||n[6]!==t||n[7]!==i||n[8]!==s?(a=m.jsx("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:i,...o}),n[5]=o,n[6]=t,n[7]=i,n[8]=s,n[9]=a):a=n[9],a});Zb.displayName="SidebarRail";const xf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("main",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});xf.displayName="SidebarInset";const Bb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Go,{ref:t,"data-sidebar":"input",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Bb.displayName="SidebarInput";const Sf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"header",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Sf.displayName="SidebarHeader";const Ef=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"footer",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Ef.displayName="SidebarFooter";const Hb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("mx-2 w-auto bg-sidebar-border",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(qo,{ref:t,"data-sidebar":"separator",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Hb.displayName="SidebarSeparator";const Cf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Cf.displayName="SidebarContent";const Mo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full min-w-0 flex-col p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Mo.displayName="SidebarGroup";const xi=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"div";let c;n[4]!==r?(c=ce("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-label",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});xi.displayName="SidebarGroupLabel";const Wb=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"button";let c;n[4]!==r?(c=ce("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-action",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});Wb.displayName="SidebarGroupAction";const jo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("w-full text-sm",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group-content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});jo.displayName="SidebarGroupContent";const $o=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex w-full min-w-0 flex-col gap-1",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});$o.displayName="SidebarMenu";const zo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("group/menu-item relative",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("li",{ref:t,"data-sidebar":"menu-item",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});zo.displayName="SidebarMenuItem";const Kb=so("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Fo=h.forwardRef((e,t)=>{const n=ee.c(29);let r,o,s,i,a,c,u;n[0]!==e?({asChild:s,isActive:i,variant:a,size:c,tooltip:u,className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=s===void 0?!1:s,l=i===void 0?!1:i,f=a===void 0?"default":a,p=c===void 0?"default":c,v=d?xr:"button",{isMobile:g,state:w}=lo();let b;n[8]!==r||n[9]!==p||n[10]!==f?(b=ce(Kb({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=b):b=n[11];let x;n[12]!==v||n[13]!==l||n[14]!==o||n[15]!==t||n[16]!==p||n[17]!==b?(x=m.jsx(v,{ref:t,"data-sidebar":"menu-button","data-size":p,"data-active":l,className:b,...o}),n[12]=v,n[13]=l,n[14]=o,n[15]=t,n[16]=p,n[17]=b,n[18]=x):x=n[18];const _=x;if(!u)return _;if(typeof u=="string"){let T;n[19]!==u?(T={children:u},n[19]=u,n[20]=T):T=n[20],u=T}let C;n[21]!==_?(C=m.jsx(jb,{asChild:!0,children:_}),n[21]=_,n[22]=C):C=n[22];const S=w!=="collapsed"||g;let P;n[23]!==S||n[24]!==u?(P=m.jsx(vf,{side:"right",align:"center",hidden:S,...u}),n[23]=S,n[24]=u,n[25]=P):P=n[25];let R;return n[26]!==C||n[27]!==P?(R=m.jsxs(Mb,{children:[C,P]}),n[26]=C,n[27]=P,n[28]=R):R=n[28],R});Fo.displayName="SidebarMenuButton";const Gb=h.forwardRef((e,t)=>{const n=ee.c(13);let r,o,s,i;n[0]!==e?({className:r,asChild:s,showOnHover:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?!1:s,c=i===void 0?!1:i,u=a?xr:"button",d=c&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0";let l;n[5]!==r||n[6]!==d?(l=ce("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",d,r),n[5]=r,n[6]=d,n[7]=l):l=n[7];let f;return n[8]!==u||n[9]!==o||n[10]!==t||n[11]!==l?(f=m.jsx(u,{ref:t,"data-sidebar":"menu-action",className:l,...o}),n[8]=u,n[9]=o,n[10]=t,n[11]=l,n[12]=f):f=n[12],f});Gb.displayName="SidebarMenuAction";const qb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"menu-badge",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qb.displayName="SidebarMenuBadge";const Qb=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s;n[0]!==e?({className:r,showIcon:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?!1:s,a=`${Math.floor(Math.random()*40)+50}%`;let c;n[4]!==r?(c=ce("flex h-8 items-center gap-2 rounded-md px-2",r),n[4]=r,n[5]=c):c=n[5];let u;n[6]!==i?(u=i&&m.jsx(Dc,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n[6]=i,n[7]=u):u=n[7];let d;n[8]===Symbol.for("react.memo_cache_sentinel")?(d={"--skeleton-width":a},n[8]=d):d=n[8];let l;n[9]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(Dc,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:d}),n[9]=l):l=n[9];let f;return n[10]!==o||n[11]!==t||n[12]!==c||n[13]!==u?(f=m.jsxs("div",{ref:t,"data-sidebar":"menu-skeleton",className:c,...o,children:[u,l]}),n[10]=o,n[11]=t,n[12]=c,n[13]=u,n[14]=f):f=n[14],f});Qb.displayName="SidebarMenuSkeleton";const Yb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu-sub",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Yb.displayName="SidebarMenuSub";const Jb=h.forwardRef((e,t)=>{const n=ee.c(5);let r;n[0]!==e?({...r}=e,n[0]=e,n[1]=r):r=n[1];let o;return n[2]!==r||n[3]!==t?(o=m.jsx("li",{ref:t,...r}),n[2]=r,n[3]=t,n[4]=o):o=n[4],o});Jb.displayName="SidebarMenuSubItem";const Xb=h.forwardRef((e,t)=>{const n=ee.c(17);let r,o,s,i,a;n[0]!==e?({asChild:i,size:a,isActive:o,className:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const c=i===void 0?!1:i,u=a===void 0?"md":a,d=c?xr:"a",l=u==="sm"&&"text-xs",f=u==="md"&&"text-sm";let p;n[6]!==r||n[7]!==l||n[8]!==f?(p=ce("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",l,f,"group-data-[collapsible=icon]:hidden",r),n[6]=r,n[7]=l,n[8]=f,n[9]=p):p=n[9];let v;return n[10]!==d||n[11]!==o||n[12]!==s||n[13]!==t||n[14]!==u||n[15]!==p?(v=m.jsx(d,{ref:t,"data-sidebar":"menu-sub-button","data-size":u,"data-active":o,className:p,...s}),n[10]=d,n[11]=o,n[12]=s,n[13]=t,n[14]=u,n[15]=p,n[16]=v):v=n[16],v});Xb.displayName="SidebarMenuSubButton";function ew(e){return!e}function tw(e){return!e}var nw=Object.defineProperty,Qe=(e,t)=>nw(e,"name",{value:t,configurable:!0});function wa(e){const t=e+"CollectionProvider",[n,r]=nn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Qe(g=>{const{scope:w,children:b}=g,x=h.useRef(null),_=h.useRef(new Map).current;return m.jsx(o,{scope:w,itemMap:_,collectionRef:x,children:b})},"CollectionProvider");i.displayName=t;const a=e+"CollectionSlot",c=Jt(a),u=h.forwardRef((g,w)=>{const{scope:b,children:x}=g,_=s(a,b),C=Te(w,_.collectionRef);return m.jsx(c,{ref:C,children:x})});u.displayName=a;const d=e+"CollectionItemSlot",l="data-radix-collection-item",f=Jt(d),p=h.forwardRef((g,w)=>{const{scope:b,children:x,..._}=g,C=h.useRef(null),S=Te(w,C),P=s(d,b);return h.useEffect(()=>(P.itemMap.set(C,{ref:C,..._}),()=>void P.itemMap.delete(C))),m.jsx(f,{[l]:"",ref:S,children:x})});p.displayName=d;function v(g){const w=s(e+"CollectionConsumer",g);return h.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${l}]`));return Array.from(w.itemMap.values()).sort((P,R)=>_.indexOf(P.ref.current)-_.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return Qe(v,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},v,r]}Qe(wa,"createCollection");var zc=new WeakMap,Ue,xt,So=(xt=class extends Map{constructor(n){super(n);ie(this,Ue);G(this,Ue,[...super.keys()]),zc.set(this,!0)}set(n,r){return zc.get(this)&&!this.has(n)&&E(this,Ue).push(n),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=s?this.size:this.size+1,a=_a(n),c=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(s?E(this,Ue).indexOf(r)===c:c===this.size)return this.set(r,o),this;const u=E(this,Ue).filter(l=>l!==r);u.splice(c,0,r);const d=u.map(l=>[l,l===r?o:this.get(l)]);this.clear();for(const[l,f]of d)this.set(l,f);return this}with(n,r,o){const s=new xt(this);return s.insert(n,r,o),s}before(n){const r=E(this,Ue).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=E(this,Ue).indexOf(n);if(s===-1)return this;const i=E(this,Ue).indexOf(r),a=i!==-1&&i<s?s-1:s;return this.insert(a,r,o)}after(n){let r=E(this,Ue).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=E(this,Ue).indexOf(n);if(s===-1)return this;const i=E(this,Ue).indexOf(r),a=i!==-1&&i<=s?s:s+1;return this.insert(a,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return G(this,Ue,[]),super.clear()}delete(n){const r=super.delete(n);return r&&E(this,Ue).splice(E(this,Ue).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Lo(E(this,Ue),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Lo(E(this,Ue),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return E(this,Ue).indexOf(n)}keyAt(n){return Lo(E(this,Ue),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new xt(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new xt(o)}reduce(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=0,a=o;for(const c of this)i===0&&!s?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let a=this.size-1;a>=0;a--){const c=this.entryAt(a);a===this.size-1&&!s?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[o,s]of r)this.set(o,s);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new xt(r)}toReversed(){const n=new xt;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new xt(r)}slice(n,r){const o=new xt;for(const s of E(this,Ue).slice(n,r))o.set(s,this.get(s));return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Ue=new WeakMap,Qe(xt,"OrderedDict"),xt);function Lo(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=kf(e,t);return n===-1?void 0:e[n]}Qe(Lo,"at");function kf(e,t){const n=e.length,r=_a(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Qe(kf,"toSafeIndex");function _a(e){return e!==e||e===0?0:Math.trunc(e)}Qe(_a,"toSafeInteger");function rw(e){const t=e+"CollectionProvider",[n,r]=nn(t),[o,s]=n(t);o.displayName=e+"CollectionStableContextProvider";const[i,a]=n(t);i.displayName=e+"CollectionStatefulContextProvider";const c=Qe(({state:P,...R})=>P?m.jsx(d,{...R,state:P}):m.jsx(u,{...R}),"CollectionProvider");c.displayName=t;const u=Qe(P=>{const R=x();return m.jsx(d,{...P,state:R})},"CollectionInit");u.displayName=e+"CollectionInit";const d=Qe(P=>{const{scope:R,children:T,state:A}=P,j=h.useRef(null),[F,z]=h.useState(null),Y=Te(j,z),[Z,K]=A,H=h.useRef(new So),J=h.useCallback(()=>{const ne=H.current;return Rf(ne)||ne.sort(Vo),ne},[]);return h.useEffect(()=>{if(!F)return;const ne=Tf(()=>{K(te=>{const X=te.toSorted(Vo);return X.some(([me],he)=>te.keyAt(he)!==me)?X:te})});return ne.observe(F,{childList:!0,subtree:!0}),()=>{ne.disconnect()}},[F,K]),m.jsx(o,{scope:R,collectionElementRef:Y,collectionElementRefObject:j,getCollection:J,setCollection:K,registryRef:H,children:m.jsx(i,{scope:R,collectionElement:F,collection:Z,children:T})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";const l=e+"CollectionSlot",f=Jt(l),p=h.forwardRef((P,R)=>{const{scope:T,children:A}=P,j=s(l,T),F=Te(R,j.collectionElementRef);return m.jsx(f,{ref:F,children:A})});p.displayName=l;const v=e+"CollectionItemSlot",g="data-radix-collection-item",w=Jt(v),b=h.forwardRef((P,R)=>{const{scope:T,children:A,...j}=P,F=h.useRef(null),z=s(v,T),{setCollection:Y,registryRef:Z}=z,K=h.useRef(j);Of(K.current,j)||(K.current=j);const H=K.current,J=h.useCallback(X=>{const q=Z.current;X?q.set(X,{...K.current,element:X}):F.current&&q.delete(F.current)},[Z]),ne=Te(R,J,F);ct(()=>{const X=F.current,q=Z.current;X&&q.has(X)&&q.set(X,{...H,element:X})},[H,Z]);const te=h.useRef(null);return h.useEffect(()=>{const X=F.current,q=te.current;((q==null?void 0:q.element)??null)===X&&(!X||(q==null?void 0:q.itemData)===H)||(te.current=X?{element:X,itemData:H}:null,Y(me=>{const he=new So(me);return q&&q.element!==X&&he.delete(q.element),X&&he.set(X,{...H,element:X}),he.sort(Vo)}))}),h.useEffect(()=>()=>{const X=te.current;te.current=null,X&&Y(q=>{if(!q.has(X.element))return q;const me=new So(q);return me.delete(X.element),me})},[Y]),m.jsx(w,{[g]:"",ref:ne,children:A})});b.displayName=v;function x(){return h.useState(new So)}Qe(x,"useInitCollection");function _(P){const{collection:R}=a(e+"CollectionConsumer",P);return R}Qe(_,"useCollection");function C(P){const{getCollection:R}=s(e+"CollectionConsumer",P);return R}return Qe(C,"useGetCollection"),[{Provider:c,Slot:p,ItemSlot:b},{createCollectionScope:r,useCollection:_,useGetCollection:C,useInitCollection:x}]}Qe(rw,"createCollection");function Of(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}Qe(Of,"shallowEqual");function Pf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Qe(Pf,"isElementPreceding");function Rf(e){let t;for(const n of e.keys()){if(t){const r=t.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Qe(Rf,"isInDocumentOrder");function Vo(e,t){return!e[1].element||!t[1].element?0:Pf(e[1].element,t[1].element)?-1:1}Qe(Vo,"sortByDocumentPosition");function Tf(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Qe(Tf,"getChildListObserver");var ow=Object.defineProperty,sw=(e,t)=>ow(e,"name",{value:t,configurable:!0}),iw={LTR:"ltr"},aw=h.createContext(void 0);function xa(e){const t=h.useContext(aw);return e||t||iw.LTR}sw(xa,"useDirection");var cw=Object.defineProperty,Sa=(e,t)=>cw(e,"name",{value:t,configurable:!0}),$s=!1;function If(){const[e,t]=h.useState($s);return h.useEffect(()=>{$s||($s=!0,t(!0))},[]),e}Sa(If,"useIsHydrated");var Af=Bn[" useSyncExternalStore ".trim().toString()];function Nf(){return()=>{}}Sa(Nf,"subscribe");function Df(){return Af(Nf,()=>!0,()=>!1)}Sa(Df,"useIsHydratedModern");var lw=typeof Af=="function"?Df:If,uw=Object.defineProperty,Hn=(e,t)=>uw(e,"name",{value:t,configurable:!0}),zs="rovingFocusGroup.onEntryFocus",dw={bubbles:!1,cancelable:!0},fs="RovingFocusGroup",[Si,Mf,fw]=wa(fs),[hw,jf]=nn(fs,[fw]),Fc={Vertical:"vertical",Horizontal:"horizontal"},pw={RTL:"rtl"},[mw,gw]=hw(fs),vw=h.forwardRef(Hn(function(t,n){return m.jsx(Si.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Si.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(yw,{...t,ref:n})})})},"RovingFocusGroup")),yw=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:l=!1,...f}=t,p=h.useRef(null),v=Te(n,p),g=xa(i),[w,b]=ao({prop:a,defaultProp:c??null,onChange:u,caller:fs}),[x,_]=h.useState(!1),C=Xt(d),S=Mf(r),P=h.useRef(!1),[R,T]=h.useState(0);return h.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(zs,C),()=>A.removeEventListener(zs,C)},[C]),m.jsx(mw,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:w,onItemFocus:h.useCallback(A=>b(A),[b]),onItemShiftTab:h.useCallback(()=>_(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>T(A=>A-1),[]),children:m.jsx(Ze.div,{tabIndex:x||R===0?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...t.style},onMouseDown:de(t.onMouseDown,()=>{P.current=!0}),onFocus:de(t.onFocus,A=>{const j=!P.current;if(A.target===A.currentTarget&&j&&!x){const F=new CustomEvent(zs,dw);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const z=S().filter(J=>J.focusable),Y=z.find(J=>J.active),Z=z.find(J=>J.id===w),H=[Y,Z,...z].filter(Boolean).map(J=>J.ref.current);Ea(H,l)}}P.current=!1}),onBlur:de(t.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),bw="RovingFocusGroupItem",ww=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=t,u=En(),d=i||u,l=gw(bw,r),f=l.currentTabStopId===d,p=Mf(r),{onFocusableItemAdd:v,onFocusableItemRemove:g,currentTabStopId:w}=l,b=lw();return ct(()=>{if(!(!b||!o))return v(),()=>g()},[b,o,v,g]),h.useEffect(()=>{if(!(b||!o))return v(),()=>g()},[b,o,v,g]),m.jsx(Si.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:m.jsx(Ze.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...c,ref:n,onMouseDown:de(t.onMouseDown,x=>{o?l.onItemFocus(d):x.preventDefault()}),onFocus:de(t.onFocus,()=>l.onItemFocus(d)),onKeyDown:de(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=zf(x,l.orientation,l.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=p().filter(P=>P.focusable).map(P=>P.ref.current);if(_==="last")S.reverse();else if(_==="prev"||_==="next"){_==="prev"&&S.reverse();const P=S.indexOf(x.currentTarget);S=l.loop?Ff(S,P+1):S.slice(P+1)}setTimeout(()=>Ea(S))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:w!=null}):a})})},"RovingFocusGroupItem")),_w={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $f(e,t){return t!==pw.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Hn($f,"getDirectionAwareKey");function zf(e,t,n){const r=$f(e.key,n);if(!(t===Fc.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===Fc.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return _w[r]}Hn(zf,"getFocusIntent");function Ea(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Hn(Ea,"focusFirst");function Ff(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Hn(Ff,"wrapArray");var xw=Object.defineProperty,xe=(e,t)=>xw(e,"name",{value:t,configurable:!0}),Sw={RTL:"rtl"},Ei=["Enter"," "],Ew=["ArrowDown","PageUp","Home"],Lf=["ArrowUp","PageDown","End"],Cw=[...Ew,...Lf],kw={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},Ow={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hs="Menu",[qr,Pw,Rw]=wa(hs),[Wn,Vf]=nn(hs,[Rw,us,jf]),Ca=us(),Uf=jf(),[Tw,Kn]=Wn(hs),[Iw,uo]=Wn(hs),Aw=xe(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ca(t),[c,u]=h.useState(null),d=h.useRef(!1),l=Xt(s),f=xa(o);return h.useEffect(()=>{const p=xe(()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=xe(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const p=xe(()=>l(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,l]),m.jsx(tf,{...a,children:m.jsx(Tw,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:u,children:m.jsx(Iw,{scope:t,onClose:h.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})},"Menu"),Zf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t,s=Ca(r);return m.jsx(nf,{...s,...o,ref:n})},"MenuAnchor")),Bf="MenuPortal",[Nw,Hf]=Wn(Bf,{forceMount:void 0}),Dw=xe(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Kn(Bf,t);return m.jsx(Nw,{scope:t,forceMount:n,children:m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Mt="MenuContent",[Mw,ka]=Wn(Mt),jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,...s}=t,i=Kn(Mt,t.__scopeMenu),a=uo(Mt,t.__scopeMenu);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(rn,{present:o||i.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:a.modal?m.jsx($w,{...s,ref:n}):m.jsx(zw,{...s,ref:n})})})})},"MenuContent")),$w=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu),o=h.useRef(null),s=Te(n,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Oa,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),zw=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu);return m.jsx(Oa,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Fw=Jt("MenuContent.ScrollLock"),Oa=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:g,...w}=t,b=Kn(Mt,r),x=uo(Mt,r),_=Ca(r),C=Uf(r),S=Pw(r),[P,R]=h.useState(null),T=h.useRef(null),[A,j]=h.useState(null);da(A);const{nodes:F,registry:z}=ua(),Y=!!(s||g),Z=Te(n,T,b.onContentChange,j),K=h.useRef(0),H=h.useRef(""),J=h.useRef(0),ne=h.useRef(null),te=h.useRef("right"),X=h.useRef(0),q=h.useMemo(()=>g?[T,...F.map(B=>({current:B}))]:[],[T,F,g]),me=g?ma:h.Fragment,he=g?{as:Fw,allowPinchZoom:!0,shards:q}:void 0,ae=xe(B=>{var kt,lt;const se=H.current+B,ye=S().filter(Le=>!Le.disabled),le=document.activeElement,Pe=(kt=ye.find(Le=>Le.ref.current===le))==null?void 0:kt.textValue,je=ye.map(Le=>Le.textValue),Ee=Jf(je,se,Pe),$e=(lt=ye.find(Le=>Le.textValue===Ee))==null?void 0:lt.ref.current;function We(Le){H.current=Le,window.clearTimeout(K.current),Le!==""&&(K.current=window.setTimeout(()=>We(""),1e3))}xe(We,"updateSearch"),We(se),$e&&setTimeout(()=>$e.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(K.current),[]),as();const re=h.useCallback(B=>{var ye,le;return te.current===((ye=ne.current)==null?void 0:ye.side)&&eh(B,(le=ne.current)==null?void 0:le.area)},[]);return m.jsx(Mw,{scope:r,searchRef:H,onItemEnter:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),onItemLeave:h.useCallback(B=>{var se;re(B)||((se=T.current)==null||se.focus(),R(null))},[re]),onTriggerLeave:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),pointerGraceTimerRef:J,onPointerGraceIntentChange:h.useCallback(B=>{ne.current=B},[]),children:m.jsx(la,{registry:Y?z:null,children:m.jsx(me,{...he,children:m.jsx(gd,{asChild:!0,trapped:s,branches:F,onMountAutoFocus:de(i,B=>{var se;B.preventDefault(),(se=T.current)==null||se.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx(vw,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:R,onEntryFocus:de(u,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(of,{role:"menu","aria-orientation":"vertical","data-state":Ra(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...w,ref:Z,style:{outline:"none",...w.style},onKeyDown:de(w.onKeyDown,B=>{const ye=B.target.closest("[data-radix-menu-content]")===B.currentTarget,le=B.ctrlKey||B.altKey||B.metaKey,Pe=B.key.length===1;ye&&(B.key==="Tab"&&B.preventDefault(),!le&&Pe&&ae(B.key));const je=T.current;if(B.target!==je||!Cw.includes(B.key))return;B.preventDefault();const $e=S().filter(We=>!We.disabled).map(We=>We.ref.current);Lf.includes(B.key)&&$e.reverse(),Qf($e)}),onBlur:de(t.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(K.current),H.current="")}),onPointerMove:de(t.onPointerMove,yr(B=>{const se=B.target,ye=X.current!==B.clientX;if(B.currentTarget.contains(se)&&ye){const le=B.clientX>X.current?"right":"left";te.current=le,X.current=B.clientX}}))})})})})})})})},"MenuContentImpl")),Lw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{...o,ref:n})},"MenuLabel")),Ci="MenuItem",Lc="menu.itemSelect",Pa=h.forwardRef(xe(function(t,n){const{disabled:r=!1,onSelect:o,...s}=t,i=h.useRef(null),a=uo(Ci,t.__scopeMenu),c=ka(Ci,t.__scopeMenu),u=Te(n,i),d=h.useRef(!1),l=xe(()=>{const f=i.current;if(!r&&f){const p=new CustomEvent(Lc,{bubbles:!0,cancelable:!0});f.addEventListener(Lc,v=>o==null?void 0:o(v),{once:!0}),sa(f,p),p.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return m.jsx(Wf,{...s,ref:u,disabled:r,onClick:de(t.onClick,l),onPointerDown:f=>{var p;(p=t.onPointerDown)==null||p.call(t,f),d.current=!0},onPointerUp:de(t.onPointerUp,f=>{var p;d.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:de(t.onKeyDown,f=>{r||f.target!==f.currentTarget||c.searchRef.current!==""&&f.key===" "||Ei.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),Wf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=t,a=ka(Ci,r),c=Uf(r),u=h.useRef(null),d=Te(n,u),[l,f]=h.useState(!1),[p,v]=h.useState("");return h.useEffect(()=>{const g=u.current;g&&v((g.textContent??"").trim())},[i.children]),m.jsx(qr.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:m.jsx(ww,{asChild:!0,...c,focusable:!o,children:m.jsx(Ze.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:de(t.onPointerMove,yr(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:de(t.onPointerLeave,yr(g=>a.onItemLeave(g))),onFocus:de(t.onFocus,()=>f(!0)),onBlur:de(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),Vw=h.forwardRef(xe(function(t,n){const{checked:r=!1,onCheckedChange:o,...s}=t;return m.jsx(Gf,{scope:t.__scopeMenu,checked:r,children:m.jsx(Pa,{role:"menuitemcheckbox","aria-checked":Qr(r)?"mixed":r,...s,ref:n,"data-state":ps(r),onSelect:de(s.onSelect,()=>o==null?void 0:o(Qr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Uw="MenuRadioGroup",[R2,Zw]=Wn(Uw,{value:void 0,onValueChange:xe(()=>{},"onValueChange")}),Bw="MenuRadioItem",Hw=h.forwardRef(xe(function(t,n){const{value:r,...o}=t,s=Zw(Bw,t.__scopeMenu),i=r===s.value;return m.jsx(Gf,{scope:t.__scopeMenu,checked:i,children:m.jsx(Pa,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":ps(i),onSelect:de(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Kf="MenuItemIndicator",[Gf,Ww]=Wn(Kf,{checked:!1}),Kw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,forceMount:o,...s}=t,i=Ww(Kf,r);return m.jsx(rn,{present:o||Qr(i.checked)||i.checked===!0,children:m.jsx(Ze.span,{...s,ref:n,"data-state":ps(i.checked)})})},"MenuItemIndicator")),Gw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),qw="MenuSub",[T2,qf]=Wn(qw),Eo="MenuSubTrigger",Qw=h.forwardRef(xe(function(t,n){const r=Kn(Eo,t.__scopeMenu),o=uo(Eo,t.__scopeMenu),s=qf(Eo,t.__scopeMenu),i=ka(Eo,t.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:t.__scopeMenu},l=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);h.useEffect(()=>l,[l]),h.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const f=Te(n,s.onTriggerChange);return m.jsx(Zf,{asChild:!0,...d,children:m.jsx(Wf,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ra(r.open),...t,ref:f,onClick:p=>{var v;(v=t.onClick)==null||v.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:de(t.onPointerMove,yr(p=>{i.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),l()},100))})),onPointerLeave:de(t.onPointerLeave,yr(p=>{var g,w;l();const v=(g=r.content)==null?void 0:g.getBoundingClientRect();if(v){const b=(w=r.content)==null?void 0:w.dataset.side,x=b==="right",_=x?-5:5,C=v[x?"left":"right"],S=v[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:C,y:v.top},{x:S,y:v.top},{x:S,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:de(t.onKeyDown,p=>{var g;t.disabled||p.target!==p.currentTarget||i.searchRef.current!==""&&p.key===" "||kw[o.dir].includes(p.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),p.preventDefault())})})})},"MenuSubTrigger")),Yw="MenuSubContent",Jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=t,a=Kn(Mt,t.__scopeMenu),c=uo(Mt,t.__scopeMenu),u=qf(Yw,t.__scopeMenu),d=h.useRef(null),l=Te(n,d);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(rn,{present:o||a.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:m.jsx(Oa,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:l,align:s,side:c.dir===Sw.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:de(t.onFocusOutside,f=>{f.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:de(t.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:de(t.onKeyDown,f=>{var g;const p=f.currentTarget.contains(f.target),v=Ow[c.dir].includes(f.key);p&&v&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),f.preventDefault())})})})})})},"MenuSubContent"));function Ra(e){return e?"open":"closed"}xe(Ra,"getOpenState");function Qr(e){return e==="indeterminate"}xe(Qr,"isIndeterminate");function ps(e){return Qr(e)?"indeterminate":e?"checked":"unchecked"}xe(ps,"getCheckedState");function Qf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}xe(Qf,"focusFirst");function Yf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xe(Yf,"wrapArray");function Jf(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Yf(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}xe(Jf,"getNextMatch");function Xf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}xe(Xf,"isPointInPolygon");function eh(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Xf(n,t)}xe(eh,"isPointerInGraceArea");function yr(e){return t=>t.pointerType==="mouse"?e(t):void 0}xe(yr,"whenMouse");var Xw=Object.defineProperty,Tt=(e,t)=>Xw(e,"name",{value:t,configurable:!0}),Ta="DropdownMenu",[e0,I2]=nn(Ta,[Vf]),It=Vf(),[t0,th]=e0(Ta),n0=Tt(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=It(t),u=h.useRef(null),[d,l]=ao({prop:o,defaultProp:s??!1,onChange:i,caller:Ta});return m.jsx(t0,{scope:t,triggerId:En(),triggerRef:u,contentId:En(),open:d,onOpenChange:l,onOpenToggle:h.useCallback(()=>l(f=>!f),[l]),modal:a,children:m.jsx(Aw,{...c,open:d,onOpenChange:l,dir:r,modal:a,children:n})})},"DropdownMenu"),r0="DropdownMenuTrigger",o0=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=t,i=th(r0,r),a=It(r),c=Te(n,i.triggerRef);return m.jsx(Zf,{asChild:!0,...a,children:m.jsx(Ze.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:de(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:de(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),s0=Tt(e=>{const{__scopeDropdownMenu:t,...n}=e,r=It(t);return m.jsx(Dw,{...r,...n})},"DropdownMenuPortal"),i0="DropdownMenuContent",nh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=th(i0,r),i=It(r),a=h.useRef(!1);return m.jsx(jw,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:de(t.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:de(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,l=u.button===2||d;(!s.modal||l)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),rh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Lw,{...s,...o,ref:n})},"DropdownMenuLabel")),oh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Pa,{...s,...o,ref:n})},"DropdownMenuItem")),sh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Vw,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),ih=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Hw,{...s,...o,ref:n})},"DropdownMenuRadioItem")),ah=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Kw,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),ch=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Gw,{...s,...o,ref:n})},"DropdownMenuSeparator")),lh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Qw,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),uh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Jw,{...s,...o,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent"));const a0=n0,c0=o0,l0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:o,inset:s,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s&&"pl-8";let c;n[5]!==o||n[6]!==a?(c=ce("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a,o),n[5]=o,n[6]=a,n[7]=c):c=n[7];let u;n[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Ym,{className:"ml-auto"}),n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==i||n[11]!==t||n[12]!==c?(d=m.jsxs(lh,{ref:t,className:c,...i,children:[r,u]}),n[9]=r,n[10]=i,n[11]=t,n[12]=c,n[13]=d):d=n[13],d});l0.displayName=lh.displayName;const u0=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(uh,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});u0.displayName=uh.displayName;const dh=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(s0,{children:m.jsx(nh,{ref:t,sideOffset:i,className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});dh.displayName=nh.displayName;const ki=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(oh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});ki.displayName=oh.displayName;const d0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:s,children:o,checked:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);let a;n[5]!==s?(a=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),n[5]=s,n[6]=a):a=n[6];let c;n[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Qm,{className:"h-4 w-4"})})}),n[7]=c):c=n[7];let u;return n[8]!==r||n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==a?(u=m.jsxs(sh,{ref:t,className:a,checked:r,...i,children:[c,o]}),n[8]=r,n[9]=o,n[10]=i,n[11]=t,n[12]=a,n[13]=u):u=n[13],u});d0.displayName=sh.displayName;const f0=h.forwardRef((e,t)=>{const n=ee.c(12);let r,o,s;n[0]!==e?({className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==o?(i=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),n[4]=o,n[5]=i):i=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Xm,{className:"h-2 w-2 fill-current"})})}),n[6]=a):a=n[6];let c;return n[7]!==r||n[8]!==s||n[9]!==t||n[10]!==i?(c=m.jsxs(ih,{ref:t,className:i,...s,children:[a,r]}),n[7]=r,n[8]=s,n[9]=t,n[10]=i,n[11]=c):c=n[11],c});f0.displayName=ih.displayName;const h0=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("px-2 py-1.5 text-sm font-semibold",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(rh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});h0.displayName=rh.displayName;const fh=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("-mx-1 my-1 h-px bg-muted",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(ch,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});fh.displayName=ch.displayName;const p0=1,m0=1,g0=2,Vc=9;function v0(e,t){const n=new DataView(e),r=[];let o=0;for(;o+Vc<=e.byteLength;){const s=n.getUint8(o),i=n.getUint32(o+1),a=n.getUint32(o+5),c=o+Vc;if(c+a>e.byteLength)break;if(s===m0)r.push({kind:"frame",ms:i,chunk:t,data:e.slice(c,c+a)});else if(s===g0)try{r.push({kind:"event",ms:i,chunk:t,event:JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,a)))})}catch{}o=c+a}return r}function A2(e,t){const n=[...e.chunks].sort((f,p)=>f.seq-p.seq),r=[],o=[];n.forEach((f,p)=>{o.push(r.length),f.offset+f.length<=t.byteLength&&r.push(...v0(t.slice(f.offset,f.offset+f.length),p))});const s=r.length>0?r[r.length-1].ms:0,i=[],a=new Set(e.gaps);n.forEach((f,p)=>{const v=n[p+1];if(v&&v.seq!==f.seq+1){const g=r[(o[p+1]??r.length)-1];i.push({fromMs:(g==null?void 0:g.ms)??f.startMs,toMs:v.startMs})}}),n.length>0&&[...a].some(f=>f<n[0].seq)&&i.unshift({fromMs:0,toMs:n[0].startMs});const c=n.length>0?n[n.length-1].seq:-1;[...a].some(f=>f>c)&&i.push({fromMs:s,toMs:s});const d=r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="start"?[{index:f.event.index,name:f.event.name,ms:f.ms}]:[]),l=new Map(r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="end"?[[f.event.index,f.event.status]]:[]));return{meta:e.meta,records:r,chunkStarts:o,chunks:n,durationMs:s,gaps:i,steps:d.map(f=>{const p=l.get(f.index);return p?{...f,status:p}:f})}}function N2(e,t){const n=e.chunks;let r=-1;n.forEach((o,s)=>{o.startMs<=t&&(r=s)});for(let o=r;o>=0;o--){if(n[o].keyframe)return o;if(o>0&&n[o].seq!==n[o-1].seq+1)break}return n.findIndex((o,s)=>s>r&&o.keyframe)}function D2(e,t){let n;for(const r of e.records)if(!(r.kind!=="event"||r.event.type!=="chrome")){if(r.ms>t&&n!==void 0)break;n=r.event.payload}return n??null}function M2(e,t){const n=Math.max(150,e.durationMs*.02);let r=null;for(const o of e.steps){const s=Math.abs(o.ms-t);s<=n&&(!r||s<r.d)&&(r={ms:o.ms,d:s})}return r?r.ms:t}function j2(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function $2(e){return e.notRecorded==="jpeg"?"No video: this device streamed JPEG, which is not kept. The agent sends H.264 unless TAPFLOW_IOS_CODEC=jpeg is set.":e.notRecorded==="no-keyframe"?"No video: the device's stream gave no frame a video could start from.":e.notRecorded?"No video for this flow.":e.evicted?"Video no longer kept: removed by the retention policy, or to make room when video storage was full.":null}function z2(e){switch(e){case"size-limit":return"The video stops early: it reached the 100 MB limit for one flow.";case"storage-full":return"The video stops early: the relay's storage for videos was full.";case"cancelled":return"The run was cancelled here.";case"runner-lost":return"The video stops where the runner disconnected.";case"truncated":return"The end of this video did not reach the relay.";default:return null}}const Oi="";async function Co(e,t,n,r){const o=await fetch(`${Oi}${t}`,{method:e,credentials:"include",headers:{"Content-Type":"application/json",...r},body:n!=null?JSON.stringify(n):void 0});if(o.status===204)return{data:null,status:204};const s=await o.json().catch(()=>null);return o.ok?{data:s,status:o.status}:{data:null,status:o.status,error:(s==null?void 0:s.error)??"Request failed"}}const hh={get:e=>Co("GET",e),post:(e,t)=>Co("POST",e,t),patch:(e,t)=>Co("PATCH",e,t),delete:e=>Co("DELETE",e),upload:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"POST",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}},uploadPatch:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"PATCH",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}}},Qo={authStatus:["auth","status"],me:["auth","me"],inviteToken:e=>["invitations","verify",e],resetToken:e=>["auth","reset-password",e],apps:["apps"],settings:["settings"],tokens:["tokens"],teamMembers:["team","members"],comments:e=>["comments",e],allRecordings:["recordings"],recordings:e=>["recordings",e],agents:["agents"],resourceHistory:(e,t)=>["agents",e,"resources",t],runs:e=>["runs","list",e],run:e=>["runs","detail",e],runVideo:(e,t)=>["runs","video",e,t],anyRun:["runs","any"]};async function y0(){const e=await fetch("/api/v1/auth/status");if(!e.ok)throw new Error(`GET /api/v1/auth/status failed with ${e.status}`);return e.json()}async function b0(){const{data:e,status:t}=await hh.get("/api/v1/auth/me");if(t===401)return null;if(!e)throw new Error(`GET /api/v1/auth/me failed with ${t}`);return e}async function F2(e){const t=await fetch(`/api/v1/invitations/verify?token=${e}`);if(!t.ok)throw new Error(`invitation refused with ${t.status}`);return t.json()}async function Cr(e){const t=await fetch(e,{credentials:"include"});if(!t.ok)throw new Error(`GET ${e} failed with ${t.status}`);return t.json()}const w0=()=>Cr("/api/v1/settings"),L2=()=>Cr("/api/v1/tokens"),V2=()=>Cr("/api/v1/team/members"),U2=e=>Cr(`/api/v1/comments?build_id=${e}`),Z2=e=>Cr(`/api/v1/recordings?buildId=${e}`),B2=()=>Cr("/api/v1/agents");async function H2(e,t,n){const r=await fetch(`/api/v1/agents/${encodeURIComponent(e)}/resources?range=${t}`,{credentials:"include",signal:n});if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}async function W2(e){const t=await fetch(`/api/v1/auth/reset-password/verify?token=${e}`);if(!t.ok)throw new Error(`reset token refused with ${t.status}`);return!0}async function K2(){const e=await fetch("/api/v1/apps",{credentials:"include"});if(!e.ok)throw new Error(`GET /api/v1/apps failed with ${e.status}`);return(await e.json()).items}async function G2({appId:e,search:t,statusFilter:n}){const r=new URLSearchParams({app_id:String(e),limit:"100",sort:"uploaded_at",dir:"desc"});t&&r.set("q",t),n&&n!=="all"&&r.set("status",n);const o=await fetch(`/api/v1/builds?${r}`,{credentials:"include"});if(!o.ok)throw new Error(`GET /api/v1/builds failed with ${o.status}`);return(await o.json()).items}async function q2(e){const t=await fetch("/api/v1/apps",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.status===409?{error:"App with this bundle ID already exists"}:t.ok?t.json():null}class _0 extends Error{}async function Ia(e){if(e.status!==403)return;const t=await e.json().catch(()=>null);throw new _0((t==null?void 0:t.error)??"You do not have permission to do this")}async function Q2(e,t){const n=await fetch(`/api/v1/builds/${e}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status_label:t})});if(await Ia(n),!n.ok)throw new Error(`PATCH /api/v1/builds/${e} failed with ${n.status}`)}async function Y2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"POST",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to schedule deletion (${t.status})`);return(await t.json()).delete_after}async function J2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"DELETE",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to cancel scheduled deletion (${t.status})`)}async function X2(e){const t=await fetch(`/api/v1/builds/${e}`,{credentials:"include"});return t.ok?t.json():null}function ek(e){const t=new Map;for(const n of e){const r=n.version_name??"Unversioned";t.has(r)||t.set(r,[]),t.get(r).push(n)}return Array.from(t.entries()).map(([n,r])=>({versionName:n,builds:r}))}const x0=1e4;function Aa(e){const t=new AbortController,n=setTimeout(()=>t.abort(new DOMException("timed out","TimeoutError")),x0);return t.signal.addEventListener("abort",()=>clearTimeout(n),{once:!0}),e&&(e.aborted?t.abort(e.reason):e.addEventListener("abort",()=>t.abort(e.reason),{once:!0})),t.signal}const S0=25;async function E0(e){const t=await fetch("/api/v1/runs?limit=1",{credentials:"include",signal:Aa(e)});if(!t.ok)throw new Error(`GET /api/v1/runs failed with ${t.status}`);return(await t.json()).items.length>0}async function tk(e,t,n){const r=new URLSearchParams;e.ci!==void 0&&r.set("ci",e.ci?"1":"0"),e.status&&r.set("status",e.status),e.flow&&r.set("flow",e.flow),e.build!==void 0&&r.set("build",String(e.build)),t.before&&r.set("before",t.before),t.after&&r.set("after",t.after),r.set("limit",String(S0));const o=`/api/v1/runs${r.size?`?${r}`:""}`,s=await fetch(o,{credentials:"include",signal:Aa(n)});if(!s.ok)throw new Error(`GET /api/v1/runs failed with ${s.status}`);return s.json()}async function nk(e,t){const n=await fetch(`/api/v1/runs/${encodeURIComponent(e)}`,{credentials:"include",signal:Aa(t)});if(n.status===404)return null;if(!n.ok)throw new Error(`GET /api/v1/runs/${e} failed with ${n.status}`);return n.json()}async function rk(e,t,n){const r=await fetch(C0(e,t),{credentials:"include",signal:n});if(r.status===404||r.status===410)return{kind:"gone"};if(!r.ok)throw new Error(`video index ${r.status}`);const o=await r.json();if(o.evicted)return{kind:"gone"};if(o.meta.formatVersion!==p0)return{kind:"unsupported"};const s=await fetch(k0(e,t),{credentials:"include",signal:n});if(s.status===404||s.status===410)return{kind:"gone"};if(!s.ok)throw new Error(`video ${s.status}`);return{kind:"ready",index:o,file:await s.arrayBuffer()}}function C0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video/index`}function k0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video`}function ok(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/screenshot`}function ph(){const e=ee.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:Qo.me,queryFn:b0},e[0]=t):t=e[0];const n=Wo(t),r=n.data??null,o=n.data===void 0;let s;return e[1]!==r||e[2]!==o?(s={user:r,loading:o},e[1]=r,e[2]=o,e[3]=s):s=e[3],s}const O0={"/settings/team":["Admin"],"/settings/tokens":["Admin","Developer","QA"]};function mh(e,t){const n=Object.entries(O0).find(([r])=>e.startsWith(r));return!n||t!==void 0&&n[1].includes(t)}const P0=6;function R0(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)&4294967295;return Math.abs(t)}function T0(e){const t=R0(e)%P0+1;return{bg:`hsl(var(--avatar-${t}-bg))`,fg:`hsl(var(--avatar-${t}-fg))`}}function I0(e){const t=ee.c(20),{name:n,avatarUrl:r,size:o}=e,s=o===void 0?28:o,i=(n==null?void 0:n[0])??"?";let a;t[0]!==i?(a=i.toUpperCase(),t[0]=i,t[1]=a):a=t[1];const c=a;let u;t[2]!==s?(u={width:s,height:s,borderRadius:"50%",flexShrink:0},t[2]=s,t[3]=u):u=t[3];const d=u;if(r){let b;t[4]!==d?(b={...d,objectFit:"cover"},t[4]=d,t[5]=b):b=t[5];let x;return t[6]!==r||t[7]!==n||t[8]!==b?(x=m.jsx("img",{src:r,alt:n,style:b}),t[6]=r,t[7]=n,t[8]=b,t[9]=x):x=t[9],x}let l;t[10]!==n?(l=T0(n),t[10]=n,t[11]=l):l=t[11];const{bg:f,fg:p}=l,v=s*.42;let g;t[12]!==f||t[13]!==p||t[14]!==d||t[15]!==v?(g={...d,background:f,display:"inline-flex",alignItems:"center",justifyContent:"center",color:p,fontSize:v,fontWeight:600,userSelect:"none"},t[12]=f,t[13]=p,t[14]=d,t[15]=v,t[16]=g):g=t[16];let w;return t[17]!==c||t[18]!==g?(w=m.jsx("span",{style:g,children:c}),t[17]=c,t[18]=g,t[19]=w):w=t[19],w}const Pi="/automation/runs",A0=[{label:"App Center",href:"/app-center",icon:ng},{label:"Flow Runs",href:Pi,icon:lg},{label:"Mac Resources",href:"/mac-resources",icon:sg}],N0=[{label:"Default",href:"/settings/default",icon:Nu},{label:"Team",href:"/settings/team",icon:fg},{label:"Tokens",href:"/settings/tokens",icon:tg}],D0=[{label:"Docs",href:"https://www.tapflow.dev/get-started/teammates",icon:qm}];function M0(){const e=ee.c(87),{pathname:t}=ou(),n=su(),{user:r}=ph(),{resolvedTheme:o}=ss(),s=o==="dark"?"/logo-dark.svg":"/logo.svg";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={queryKey:Qo.settings,queryFn:w0},e[0]=i):i=e[0];const a=Wo(i).data,c=(a==null?void 0:a.logo_url)??null,u=(a==null?void 0:a.team_name)||"tapflow",d=Qi(),{setOpenMobile:l}=lo();let f;e[1]!==l?(f=()=>l(!1),e[1]=l,e[2]=f):f=e[2];const p=f;let v;e[3]!==l?(v=()=>{l(!1)},e[3]=l,e[4]=v):v=e[4];let g;e[5]!==t||e[6]!==l?(g=[t,l],e[5]=t,e[6]=l,e[7]=g):g=e[7],h.useEffect(v,g);let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w={queryKey:Qo.anyRun,queryFn:j0},e[8]=w):w=e[8];const b=Wo(w);let x;e[9]!==b.data||e[10]!==b.isError||e[11]!==t?(x=b.data===!0||b.isError||t.startsWith(Pi),e[9]=b.data,e[10]=b.isError,e[11]=t,e[12]=x):x=e[12];const _=x;let C,S,P,R,T,A,j,F,z;if(e[13]!==p||e[14]!==s||e[15]!==c||e[16]!==n||e[17]!==t||e[18]!==d||e[19]!==_||e[20]!==u){let re;e[30]!==_?(re=Ee=>Ee.href!==Pi||_,e[30]=_,e[31]=re):re=e[31];const B=A0.filter(re);let se;e[32]!==n||e[33]!==d?(se=async function(){await fetch("/api/v1/auth/logout",{method:"POST",credentials:"include"}),d.clear(),n("/login",{replace:!0})},e[32]=n,e[33]=d,e[34]=se):se=e[34],A=se,T=wf,F="icon";const ye=c??s;let le;e[35]!==ye?(le=m.jsx("img",{src:ye,alt:"tapflow",className:"w-6 h-6 min-w-6 shrink-0"}),e[35]=ye,e[36]=le):le=e[36];let Pe;e[37]!==u?(Pe=m.jsx("span",{className:"text-base font-semibold tracking-tight truncate text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden",children:u}),e[37]=u,e[38]=Pe):Pe=e[38],e[39]!==p||e[40]!==le||e[41]!==Pe?(z=m.jsx(Sf,{className:"p-2",children:m.jsxs(mo,{to:"/app-center",onClick:p,className:"flex items-center gap-2 p-1",children:[le,Pe]})}),e[39]=p,e[40]=le,e[41]=Pe,e[42]=z):z=e[42],R=Cf,P=Mo,S=jo,C=$o;let je;e[43]!==p||e[44]!==t?(je=Ee=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t.startsWith(Ee.href),tooltip:Ee.label,children:m.jsxs(mo,{to:Ee.href,onClick:p,children:[m.jsx(Ee.icon,{}),m.jsx("span",{children:Ee.label})]})})},Ee.href),e[43]=p,e[44]=t,e[45]=je):je=e[45],j=B.map(je),e[13]=p,e[14]=s,e[15]=c,e[16]=n,e[17]=t,e[18]=d,e[19]=_,e[20]=u,e[21]=C,e[22]=S,e[23]=P,e[24]=R,e[25]=T,e[26]=A,e[27]=j,e[28]=F,e[29]=z}else C=e[21],S=e[22],P=e[23],R=e[24],T=e[25],A=e[26],j=e[27],F=e[28],z=e[29];let Y;e[46]!==C||e[47]!==j?(Y=m.jsx(C,{children:j}),e[46]=C,e[47]=j,e[48]=Y):Y=e[48];let Z;e[49]!==S||e[50]!==Y?(Z=m.jsx(S,{children:Y}),e[49]=S,e[50]=Y,e[51]=Z):Z=e[51];let K;e[52]!==P||e[53]!==Z?(K=m.jsx(P,{children:Z}),e[52]=P,e[53]=Z,e[54]=K):K=e[54];let H;e[55]===Symbol.for("react.memo_cache_sentinel")?(H=m.jsx(xi,{children:"Settings"}),e[55]=H):H=e[55];let J;if(e[56]!==p||e[57]!==t||e[58]!==(r==null?void 0:r.role)){let re;e[60]!==(r==null?void 0:r.role)?(re=se=>mh(se.href,r==null?void 0:r.role),e[60]=r==null?void 0:r.role,e[61]=re):re=e[61];let B;e[62]!==p||e[63]!==t?(B=se=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t===se.href,tooltip:se.label,children:m.jsxs(mo,{to:se.href,onClick:p,children:[m.jsx(se.icon,{}),m.jsx("span",{children:se.label})]})})},se.href),e[62]=p,e[63]=t,e[64]=B):B=e[64],J=N0.filter(re).map(B),e[56]=p,e[57]=t,e[58]=r==null?void 0:r.role,e[59]=J}else J=e[59];let ne;e[65]!==J?(ne=m.jsxs(Mo,{children:[H,m.jsx(jo,{children:m.jsx($o,{children:J})})]}),e[65]=J,e[66]=ne):ne=e[66];let te;e[67]===Symbol.for("react.memo_cache_sentinel")?(te=m.jsx(xi,{children:"Reference"}),e[67]=te):te=e[67];let X;e[68]!==p?(X=D0.map(re=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,tooltip:re.label,children:m.jsxs("a",{href:re.href,target:"_blank",rel:"noopener noreferrer",onClick:p,children:[m.jsx(re.icon,{}),m.jsx("span",{children:re.label})]})})},re.href)),e[68]=p,e[69]=X):X=e[69];let q;e[70]!==X?(q=m.jsxs(Mo,{children:[te,m.jsx(jo,{children:m.jsx($o,{children:X})})]}),e[70]=X,e[71]=q):q=e[71];let me;e[72]!==R||e[73]!==K||e[74]!==ne||e[75]!==q?(me=m.jsxs(R,{children:[K,ne,q]}),e[72]=R,e[73]=K,e[74]=ne,e[75]=q,e[76]=me):me=e[76];let he;e[77]!==p||e[78]!==A||e[79]!==r?(he=r&&m.jsx(Ef,{className:"px-3 py-3",children:m.jsxs(a0,{children:[m.jsx(c0,{asChild:!0,children:m.jsxs("button",{className:"flex w-full items-center gap-2.5 rounded-md px-1 py-1 text-left hover:bg-sidebar-accent transition-colors group-data-[collapsible=icon]:justify-center",children:[m.jsx(I0,{name:r.displayName??"",avatarUrl:r.avatarUrl,size:28}),m.jsxs("div",{className:"flex flex-col min-w-0 flex-1 group-data-[collapsible=icon]:sr-only",children:[m.jsx("span",{className:"text-sm font-medium truncate",children:r.displayName}),m.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r.email})]})]})}),m.jsxs(dh,{side:"top",align:"start",className:"w-56",children:[m.jsx(ki,{asChild:!0,children:m.jsxs(mo,{to:"/settings/default",onClick:p,children:[m.jsx(Nu,{className:"mr-2 h-4 w-4"}),"Settings"]})}),m.jsx(fh,{}),m.jsxs(ki,{onClick:A,className:"text-destructive focus:text-destructive",children:[m.jsx(og,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})}),e[77]=p,e[78]=A,e[79]=r,e[80]=he):he=e[80];let ae;return e[81]!==T||e[82]!==me||e[83]!==he||e[84]!==F||e[85]!==z?(ae=m.jsxs(T,{collapsible:F,children:[z,me,he]}),e[81]=T,e[82]=me,e[83]=he,e[84]=F,e[85]=z,e[86]=ae):ae=e[86],ae}function j0(e){const{signal:t}=e;return E0(t)}function $0(){const e=ee.c(7),{theme:t,setTheme:n}=ss();let r;e[0]!==n||e[1]!==t?(r=()=>n(t==="dark"?"light":"dark"),e[0]=n,e[1]=t,e[2]=r):r=e[2];let o,s;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(ug,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s=m.jsx(ig,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let i;return e[5]!==r?(i=m.jsxs(is,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Toggle theme",children:[o,s]}),e[5]=r,e[6]=i):i=e[6],i}const gh=h.createContext({node:null,setNode:()=>{}});function z0(e){const t=ee.c(5),{children:n}=e,[r,o]=h.useState(null);let s;t[0]!==r?(s={node:r,setNode:o},t[0]=r,t[1]=s):s=t[1];const i=s;let a;return t[2]!==n||t[3]!==i?(a=m.jsx(gh.Provider,{value:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function F0(){return h.useContext(gh)}function L0(){const e=ee.c(8),{node:t}=F0();let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(_f,{className:"-ml-1"}),r=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let o,s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"flex-1"}),s=m.jsx($0,{}),i=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[2]=o,e[3]=s,e[4]=i):(o=e[2],s=e[3],i=e[4]);let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("a",{href:"https://github.com/jo-duchan/tapflow",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-accent transition-colors","aria-label":"GitHub",children:m.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current","aria-hidden":"true",children:m.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),e[5]=a):a=e[5];let c;return e[6]!==t?(c=m.jsxs("header",{className:"flex h-16 items-center gap-2 border-b px-4",children:[n,r,t,o,s,i,a]}),e[6]=t,e[7]=c):c=e[7],c}function V0(){const e=ee.c(5),{user:t,loading:n}=ph(),r=ou();if(n)return null;if(!t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Gi,{to:"/login",replace:!0}),e[0]=a):a=e[0],a}if(!mh(r.pathname,t.role)){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsxs("div",{className:"text-center space-y-2",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Access Denied"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Your role does not have access to this page."})]})}),e[1]=a):a=e[1],a}let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(M0,{}),e[2]=o):o=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(L0,{}),e[3]=s):s=e[3];let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(z0,{children:m.jsxs(bf,{children:[o,m.jsxs(xf,{children:[s,m.jsx("main",{className:"relative flex-1 min-h-0 overflow-auto",children:m.jsx(h.Suspense,{fallback:m.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),children:m.jsx(Vp,{})})})]})]})}),e[4]=i):i=e[4],i}var kr=e=>e.type==="checkbox",ms=e=>e.type==="file",Sn=e=>e instanceof Date,Xe=e=>e==null;const Na=e=>typeof e=="object";var Ae=e=>!Xe(e)&&!Array.isArray(e)&&Na(e)&&!Sn(e),Ri=e=>Ae(e)&&e.target?kr(e.target)?e.target.checked:ms(e.target)?e.target.files:e.target.value:e;const U0=/[.[\]'"]/;var Un=e=>e.split(U0).filter(Boolean);function Z0(e,t){const n=Un(t);let r=e._formValues,o=e._defaultValues;for(let s=0;s<n.length-1;s++){const i=n[s];if(r=r==null?r:r[i],o=o==null?o:o[i],r===null||o===null)return null}}var vh=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),gs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Oe(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const t=typeof Blob<"u"&&e instanceof Blob,n=typeof FileList<"u"&&e instanceof FileList;if(gs&&(t||n))return e;const r=Array.isArray(e),o=Object.getPrototypeOf(e);if(!r&&o&&e.constructor!==Object)return e;const s=r?new Array(e.length):Object.create(o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=Oe(e[i]));return s}const pn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Rt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Je={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},B0=[Je.required,Je.min,Je.max,Je.minLength,Je.maxLength,Je.pattern,Je.validate],Lr="form",yh="root",Da=["__proto__","constructor","prototype"],H0=/^\w*$/;var br=e=>H0.test(e),ve=e=>e===void 0,U=(e,t,n)=>{if(!t||!Ae(e))return n;const r=br(t)?[t]:Un(t);if(r.some(s=>Da.includes(s)))return n;const o=r.reduce((s,i)=>Xe(s)?void 0:s[i],e);return ve(o)||o===e?ve(e[t])?n:e[t]:o},yt=e=>typeof e=="boolean",nt=e=>typeof e=="function",_e=(e,t,n)=>{let r=-1;const o=br(t)?[t]:Un(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let c=n;if(r!==i){const u=e[a];c=Ae(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(Da.includes(a))return;e[a]=c,e=e[a]}};const bh=I.createContext(null);bh.displayName="HookFormControlContext";const Ma=()=>I.useContext(bh);var wh=(e,t,n,r=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Rt.all&&(t._proxyFormState[i]=!r||Rt.all),n&&(n[i]=!0),e[i]}});return o};const ja=gs?I.useLayoutEffect:I.useEffect;var W0=e=>{const t=e.constructor&&e.constructor.prototype;return Ae(t)&&t.hasOwnProperty("isPrototypeOf")},Ti=e=>Xe(e)||!Na(e);const Uc=(e,t)=>t.length===0&&!Array.isArray(e)&&!W0(e);function at(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Ti(e)||Ti(t))return Object.is(e,t);if(Sn(e)&&Sn(t))return Object.is(e.getTime(),t.getTime());const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;if(Uc(e,o)||Uc(t,s))return Object.is(e,t);if(!o.length&&Array.isArray(e)!==Array.isArray(t))return!1;const i=r.get(e);if(i&&i.has(t))return!0;if(i)i.add(t);else{const a=new WeakSet;a.add(t),r.set(e,a)}for(const a of o){const c=e[a];if(!(a in t))return!1;if(!n||a!=="ref"){const u=t[a];if(Sn(c)&&Sn(u)||(Ae(c)||Array.isArray(c))&&(Ae(u)||Array.isArray(u))?!at(c,u,n,r):!Object.is(c,u))return!1}}return!0}function $a(e){const t=I.useRef(!1),n=I.useRef(!1),r=I.useRef(void 0),o=I.useRef(0);o.current++,!n.current&&e&&(n.current=!0,r.current=Oe(e()));const s=I.useCallback((a,c,u)=>{if(a&&(t.current||n.current&&o.current>1)){const d=c();at(r.current,d)||u(d)}t.current=!0},[]),i=I.useCallback((a,c)=>{a&&(r.current=Oe(c()))},[]);return{resyncIfNeeded:s,snapshot:i}}function K0(e){const t=Ma(),{control:n=t,disabled:r,name:o,exact:s}=e||{},i=()=>({...n._formState,defaultValues:n._defaultValues}),[a,c]=I.useState(i),u=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:d,snapshot:l}=$a(i);return ja(()=>{d(!r,i,c);const f=n._subscribe({name:o,formState:u.current,exact:s,callback:p=>{!r&&c({...n._formState,...p,defaultValues:n._defaultValues})}});return()=>{f(),l(!r,i)}},[n,o,r,s,d,l]),I.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>wh(a,n,u.current,!1),[a,n])}var rt=e=>typeof e=="string",Ii=(e,t,n,r,o)=>rt(e)?(r&&t.watch.add(e),U(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),U(n,s,U(o,s)))):(r&&(t.watchAll=!0),n);function G0(e){const t=Ma(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=I.useRef(o),u=I.useRef(a),d=I.useRef(n),l=I.useRef(r);u.current=a;const f=()=>{const A=n._getWatch(r,c.current);return u.current?u.current(A):A},[p,v]=I.useState(f),g=I.useRef(p),w=I.useCallback(A=>{const j=Ii(r,n._names,A||n._formValues,!1,c.current);return u.current?u.current(j):j},[n._formValues,n._names,r]),b=I.useCallback(A=>{if(!s){const j=Ii(r,n._names,A||n._formValues,!1,c.current);if(u.current){const F=u.current(j);at(F,g.current)||(v(F),g.current=F)}else v(j)}},[n._formValues,n._names,s,r]),{resyncIfNeeded:x,snapshot:_}=$a(f),C=I.useRef(b);C.current=b;const S=I.useRef(w);S.current=w,ja(()=>{d.current!==n||!at(l.current,r)?(d.current=n,l.current=r,C.current()):x(!s,()=>S.current(),j=>{const F=Oe(j);v(F),g.current=F});const A=n._subscribe({name:r,formState:{values:!0},exact:i,callback:j=>{C.current(j.values)}});return()=>{A(),_(!s,()=>S.current())}},[n,i,r,s,x,_]),I.useEffect(()=>n._removeUnmounted());const P=d.current!==n,R=l.current;return I.useMemo(()=>{if(s)return!1;const A=!P&&!at(R,r);return P||A},[s,P,r,R])?w():p}function q0(e){const t=Ma(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=vh(o._names.array,n),u=I.useMemo(()=>{const C=U(o._formValues,n,U(o._defaultValues,n,i));return ve(C)?Z0(o,n):C},[o,n,i]),d=G0({control:o,name:n,defaultValue:u,exact:a}),l=K0({control:o,name:n,exact:a}),f=I.useRef(e),p=I.useRef(null),v=I.useRef(o.register(n,{...e.rules,value:d,...yt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const g=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!U(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!U(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!U(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!U(l.validatingFields,n)},error:{enumerable:!0,get:()=>U(l.errors,n)}}),[l,n]),w=I.useCallback(C=>{const S=Ri(C);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:S})),v.current.onChange({target:{value:Ri(C),name:n},type:pn.CHANGE})},[n,o]),b=I.useCallback(()=>{const C=U(o._formValues,n);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:C})),v.current.onBlur({target:{value:C,name:n},type:pn.BLUR})},[n,o]),x=I.useCallback(C=>{C&&(p.current={focus:()=>nt(C.focus)&&C.focus(),select:()=>nt(C.select)&&C.select(),setCustomValidity:P=>nt(C.setCustomValidity)&&C.setCustomValidity(P),reportValidity:()=>nt(C.reportValidity)&&C.reportValidity()});const S=U(o._fields,n);S&&S._f&&C&&(S._f.ref=p.current,S._f._c=!0)},[o._fields,n]),_=I.useMemo(()=>({name:n,value:d,...yt(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:w,onBlur:b,ref:x}),[n,r,l.disabled,w,b,x,d]);return I.useEffect(()=>{const C=o._options.shouldUnregister||s;v.current=o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}});const S=(P,R)=>{const T=U(o._fields,P);T&&T._f&&(T._f.mount=R,T._f._c=R)};if(S(n,!0),C){const P=Oe(U(s?o._defaultValues:o._options.values||o._defaultValues,n,U(o._options.defaultValues,n,f.current.defaultValue)));_e(o._defaultValues,n,P),ve(U(o._formValues,n))&&_e(o._formValues,n,P)}if(!c&&o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}}),p.current){const P=U(o._fields,n);P&&P._f&&(P._f.ref=p.current)}return()=>{(c?C&&!o._state.action:C)?o.unregister(n):S(n,!1)}},[n,o,c,s]),I.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),I.useMemo(()=>({field:_,formState:l,fieldState:g}),[_,l,g])}const sk=e=>e.render(q0(e));var ko=e=>({isOnSubmit:!e||e===Rt.onSubmit,isOnBlur:e===Rt.onBlur,isOnChange:e===Rt.onChange,isOnAll:e===Rt.all,isOnTouch:e===Rt.onTouched}),Fs=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const r of t.watch)if(e.startsWith(r)&&e.charAt(r.length)===".")return!0;return!1};const Zr=(e,t,n)=>{for(const r of n||Object.keys(e)){if(r==="_f")continue;const o=n?U(e,r):e[r];if(o){const{_f:s}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],s.name))return!0;if(s.ref&&t(s.ref,s.name))return!0;if(Zr(o,t))return!0}else if((Ae(o)||Array.isArray(o))&&Zr(o,t))return!0}}};var Zc=(e,t,n)=>{const r=U(e,n),o=Array.isArray(r)?r:[];return _e(o,yh,t[n]),_e(e,n,o),e},Ve=e=>Ae(e)&&!Object.keys(e).length,Yo=e=>{if(!gs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vs=e=>e.type==="radio",Jo=e=>e instanceof RegExp,za=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const Bc={value:!1,isValid:!1},Hc={value:!0,isValid:!0};var _h=e=>{if(!Array.isArray(e))return Bc;if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}const t=e[0];return!t||!t.checked||t.disabled?Bc:!t.attributes||!("value"in t.attributes)||ve(t.value)||t.value===""?Hc:{value:t.value,isValid:!0}};const Wc={isValid:!1,value:null};var xh=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Wc):Wc;function Kc(e,t,n="validate"){if(rt(e)||Array.isArray(e)&&e.every(rt)||yt(e)&&!e)return{type:n,message:rt(e)?e:"",ref:t}}var er=e=>Ae(e)&&!Jo(e)?e:{value:e,message:""},Gc=async(e,t,n,r,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:l,max:f,pattern:p,validate:v,name:g,valueAsNumber:w,mount:b,_c:x}=e._f,_=U(n,g);if(!b||t.has(g))return{};const C=a?a[0]:i,S=Z=>{if(o&&C.reportValidity){const K=yt(Z)?"":Z||"";a?a.forEach(H=>nt(H.setCustomValidity)&&H.setCustomValidity(K)):C.setCustomValidity(K),C.reportValidity()}},P={},R=vs(i),T=kr(i),A=R||T,j=(w||ms(i))&&ve(i.value)&&ve(_)||Yo(i)&&i.value===""&&!x||_===""||Array.isArray(_)&&!_.length,F=za.bind(null,g,r,P),z=(Z,K,H,J=Je.maxLength,ne=Je.minLength)=>{const te=Z?K:H;P[g]={type:Z?J:ne,message:te,ref:i,...F(Z?J:ne,te)}};if(s?!Array.isArray(_)||!_.length:c&&(!A&&(j||Xe(_))||yt(_)&&!_||T&&!_h(a).isValid||R&&!xh(a).isValid)){const{value:Z,message:K}=rt(c)?{value:!!c,message:c}:er(c);if(Z&&(P[g]={type:Je.required,message:K,ref:C,...F(Je.required,K)},!r))return S(K),P}if(!j&&(!Xe(l)||!Xe(f))){let Z,K;const H=er(f),J=er(l);if(!Xe(_)&&!Sn(_)&&!isNaN(_)){const ne=i.valueAsNumber||_&&+_;Xe(H.value)||(Z=ne>H.value),Xe(J.value)||(K=ne<J.value)}else{const ne=i.valueAsDate||new Date(_),te=me=>new Date(new Date().toDateString()+" "+me),X=i.type=="time",q=i.type=="week";rt(H.value)&&_&&(Z=X?te(_)>te(H.value):q?_>H.value:ne>new Date(H.value)),rt(J.value)&&_&&(K=X?te(_)<te(J.value):q?_<J.value:ne<new Date(J.value))}if((Z||K)&&(z(!!Z,H.message,J.message,Je.max,Je.min),!r))return S(P[g].message),P}if((u||d)&&!j&&(rt(_)||s&&Array.isArray(_))){const Z=er(u),K=er(d),H=!Xe(Z.value)&&_.length>+Z.value,J=!Xe(K.value)&&_.length<+K.value;if((H||J)&&(z(H,Z.message,K.message),!r))return S(P[g].message),P}if(p&&!j&&rt(_)){const{value:Z,message:K}=er(p);if(Jo(Z)&&!_.match(Z)&&(P[g]={type:Je.pattern,message:K,ref:i,...F(Je.pattern,K)},!r))return S(K),P}if(v){if(nt(v)){const Z=await v(_,n),K=Kc(Z,C);if(K&&(P[g]={...K,...F(Je.validate,K.message)},!r))return S(K.message),P}else if(Ae(v)){let Z={};for(const K in v){if(!Ve(Z)&&!r)break;const H=Kc(await v[K](_,n),C,K);H&&(Z={...H,...F(K,H.message)},r||S(H.message),r&&(P[g]=Z))}if(!Ve(Z)&&(P[g]={ref:C,...Z},!r))return P}}const Y=P[g];return S(Y?Y.message:!0),P},Ls=e=>Array.isArray(e)?e:[e],Sh=e=>Array.isArray(e)?e.filter(Boolean):[];function Q0(e,t){const n=t.length-1;let r=0;for(;r<n;){if(Xe(e)){e=void 0;break}e=e[t[r]],r++}return e}function Y0(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function Fe(e,t){if(rt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:br(t)?[t]:Un(t);if(n.some(i=>Da.includes(String(i))))return e;const r=n.length===1?e:Q0(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ae(r)&&Ve(r)||Array.isArray(r)&&Y0(r))&&Fe(e,n.slice(0,-1)),e}const J0=I.createContext(null);J0.displayName="HookFormContext";var qc=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:s=>{const i=e;t++;for(const a of i)a.next&&a.next(s);i===e&&t--},subscribe:s=>(e.add(s),{unsubscribe:()=>{t&&(e=new Set(e),t=0),e.delete(s)}}),unsubscribe:()=>{e=new Set,t=0}}};function Eh(e,t){const n=Array.isArray(e)?[]:{};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=e[r],s=t[r];o&&(Ae(o)||Array.isArray(o))&&s?n[r]=Eh(o,s):e[r]&&(n[r]=s)}return n}const Qc=(e,t)=>e!==null&&Na(e)&&Object.prototype.hasOwnProperty.call(e,t);var Yc=(e,t)=>{if(!t)return!1;let n=e;for(const r of br(t)?[t]:Un(t)){if(!Qc(n,r))return Qc(e,t);n=n[r]}return!0},X0=e=>kr(e)?e.checked!==e.defaultChecked:!vs(e)&&"defaultValue"in e&&e.value!==e.defaultValue,Ch=e=>e.type==="select-multiple",e_=e=>vs(e)||kr(e),Vs=e=>Yo(e)&&e.isConnected;function Jc(e){return Array.isArray(e)||Ae(e)}function kh(e,t,n="",r=[]){for(const o in e){const s=n?`${n}.${o}`:o,i=e[o];Jc(i)&&Jc(U(t,s))?kh(i,t,s,r):r.push(s)}return r}var t_=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function Oh(e){return Array.isArray(e)||Ae(e)&&!t_(e)}function Ph(e){return!!(e&&"_f"in e)}function Rh(e){return Array.isArray(e)?!e.some(t=>!ve(t)):!Object.keys(e).length}function Ai(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Ni(e,t={},n){for(const r in e){const o=e[r],s=n&&n[r];Oh(o)&&(!Array.isArray(o)||!Ph(s))?(t[r]=Array.isArray(o)?[]:{},Ni(o,t[r],s),Rh(t[r])&&Ai(t,r)):ve(o)||(t[r]=!0)}return t}function Gt(e,t,n,r){n||(n=Ni(t,Array.isArray(t)?[]:{},r));for(const o in e){const s=e[o],i=r&&r[o];Oh(s)&&(!Array.isArray(s)||!Ph(i))?(ve(t)||Ti(n[o])?n[o]=Ni(s,Array.isArray(s)?[]:{},i):Gt(s,Xe(t)?{}:t[o],n[o],i),Rh(n[o])&&Ai(n,o)):at(s,t[o])?Ai(n,o):n[o]=!0}return n}var n_=(e,t)=>{const n=t.split("."),r=[];let o=n[0];for(let s=1;s<n.length;o+="."+n[s++])!isNaN(+n[s])&&e.has(o)&&r.push(`${o}.${n[s]}`);return r},Di=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ve(e)?e:t?e===""?NaN:e&&+e:n&&rt(e)?new Date(e):r?r(e):e;function Xc(e){const t=e.ref;return ms(t)?t.files:vs(t)?xh(e.refs).value:Ch(t)?[...t.selectedOptions].map(({value:n})=>n):kr(t)?_h(e.refs).value:Di(t.value,e)}var r_=(e,t,n,r)=>{const o={};for(const s of e){const i=U(t,s);i&&_e(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},$r=e=>ve(e)?e:Jo(e)?e.source:Ae(e)?Jo(e.value)?e.value.source:e.value:e;const el="AsyncFunction";var o_=e=>{if(!e||!e.validate)return!1;if(nt(e.validate))return e.validate.constructor.name===el;if(Ae(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===el)return!0}return!1},s_=e=>e.mount&&(e.required||!ve(e.required)&&e.required!==!1||!ve(e.min)||!ve(e.max)||!ve(e.maxLength)||!ve(e.minLength)||e.pattern||e.validate);function tl(e,t,n){const r=U(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=U(t,s),a=U(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:n}}var i_=(e,t,n)=>{const r=Object.keys(e).filter(o=>o!=="name");return!r.length||n&&r.length>=Object.keys(t).length||r.find(o=>t[o]===(!n||Rt.all))};const nl=(e,t,n)=>n?e===t||e.startsWith(t+"."):e.startsWith(t)||t.startsWith(e);var rl=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return nl(e,t,n);for(const r of e)if(r&&nl(r,t,n))return!0;return!1},a_=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,c_=(e,t)=>{const n=U(e,t);!Sh(n).length&&!(n&&n.root)&&Fe(e,t)};const Uo={mode:Rt.onSubmit,reValidateMode:Rt.onChange,shouldFocusError:!0},l_=(e,t)=>{for(const n in e)delete e[n];Object.assign(e,t)},Th={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function u_(e={}){let t={...Uo,...e},n={...Oe(Th),isLoading:nt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ae(t.defaultValues)||Ae(t.values)?Oe(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Oe(o),i={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},a=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const u={},d={},l=new Set;let f=ko(t.mode),p=ko(t.reValidateMode);const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...v},w={},b=(...y)=>y.some(O=>g[O]||w[O]),x=y=>{for(const O of l)if(rl(O.name,y,O.exact))return!0;return!1},_={array:qc(),state:qc()};let C=0,S=0,P=t.criteriaMode===Rt.all;const R=(y,O)=>k=>{clearTimeout(d[y]),d[y]=setTimeout(O,k)},T=y=>{clearTimeout(d[y]),delete d[y],delete u[y]},A=y=>{T(y);const O=`${y}.`;for(const k of Object.keys(u))k.startsWith(O)&&T(k)},j=async y=>{if(!i.keepIsValid&&!t.disabled&&(b("isValid")||y)){const O=++C;let k;t.resolver?(k=Ve((await q()).errors),O===C&&F()):k=await ae({fields:r,onlyCheckValid:!0,eventType:pn.VALID}),O===C&&k!==n.isValid&&_.state.next({isValid:k})}},F=(y,O)=>{!t.disabled&&b("isValidating","validatingFields")&&((y||c.mount).forEach(k=>{k&&(O?_e(n.validatingFields,k,O):Fe(n.validatingFields,k))}),_.state.next({validatingFields:n.validatingFields,isValidating:!Ve(n.validatingFields)}))},z=()=>{n.dirtyFields=Gt(o,s,void 0,r)},Y=(y,O=[],k,N,$=!0,W=!0)=>{if(N&&k&&!t.disabled){i.action=!0;const L=U(r,y);if(i.actionArrayLengths.has(y)||i.actionArrayLengths.set(y,Array.isArray(L)?L.length:0),W&&Array.isArray(L)){const be=k(L,N.argA,N.argB);$&&_e(r,y,be)}const D=U(n.errors,y);if(W&&Array.isArray(D)){const be=D.root,we=k(D,N.argA,N.argB)||D;be&&(we.root=be),$&&_e(n.errors,y,we),c_(n.errors,y),n.errors={...n.errors}}const V=U(n.touchedFields,y),Q=W&&Array.isArray(V);if(Q){const be=k(V,N.argA,N.argB);$&&_e(n.touchedFields,y,be)}const ue=U(n.dirtyFields,y);if(W&&Array.isArray(ue)){const be=k(ue,N.argA,N.argB)||ue;$&&_e(n.dirtyFields,y,be)}b("dirtyFields")?z():a=!0,_.state.next({name:y,isDirty:B(y,O),dirtyFields:n.dirtyFields,...Q&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else _e(s,y,O)},Z=(y,O)=>{_e(n.errors,y,O),n.errors={...n.errors},_.state.next({errors:n.errors})},K=y=>{Object.keys(u).forEach(T);const O=!Ve(y);n.errors=y,_.state.next({errors:n.errors,...O?{isValid:!1}:{}}),!O&&i.mount&&j()},H=y=>{const O=br(y)?[y]:Un(y);let k=s,N=o;for(let $=0;$<O.length-1;$++){const W=O[$];if(k=Xe(k)?k:k[W],N=Xe(N)?N:N[W],k===null&&N!==null)return!0}return!1},J=y=>{if(!i.actionArrayLengths.size)return!1;const O=br(y)?[y]:Un(y);let k=s,N="",$=-1,W=0;for(let L=0;L<O.length;L++){if(Xe(k))return!1;const D=O[L];if(N=N?`${N}.${D}`:D,Array.isArray(k)&&+D>=k.length)return $===-1?!1:L===$?+D<W:!0;if(i.actionArrayLengths.has(N)&&($=L+1,W=i.actionArrayLengths.get(N)),k=k[D],ve(k)&&$!==-1&&L>$&&+O[$]<W)return!0}return!1},ne=(y,O,k,N)=>{const $=U(r,y);if($){if(H(y)||J(y))return;const W=ve(U(s,y)),L=U(s,y,ve(k)?U(o,y):k),D=!!N&&!n.isReady&&X0(N);if(ve(L)||N&&N.defaultChecked||D||O){const V=O?L:Xc($._f);b("dirtyFields")&&!at(U(s,y),V)&&(a=!0),_e(s,y,V),D&&te(y,V)}else le(y,L);i.mount&&!i.action&&(t.resolver&&b("isValidating","validatingFields")?Promise.resolve().then(()=>j()):j(),W&&n.isDirty&&b("isDirty")&&(B()||(n.isDirty=!1,_.state.next({...n}))),t.shouldUnregister&&W&&!ve(U(s,y))&&Fs(y,c)&&(i.watch=!0))}},te=(y,O,k,N,$)=>{let W=!1,L=!1;const D={name:y};if(!t.disabled||N===!0){if(!k||N){const V=at(U(o,y),O);if(b("isDirty")&&(L=n.isDirty,n.isDirty=D.isDirty=!V||B(),W=L!==D.isDirty),L=!!U(n.dirtyFields,y),V)Fe(n.dirtyFields,y);else{const ue=U(o,y),be=U(r,y),we=!(be&&be._f)&&(Ae(ue)||Array.isArray(ue))?Gt(ue,O,void 0,be):!0;_e(n.dirtyFields,y,we)}let Q=!1;if(a||V&&(b("isDirty")?n.isDirty:B())){a=!1;const ue=Gt(o,s,void 0,r);at(n.dirtyFields,ue)||(Q=!0,l_(n.dirtyFields,ue))}D.dirtyFields=n.dirtyFields,W=W||b("dirtyFields")&&(Q||L!==!V)}if(k){const V=Yc(n.touchedFields,y)?U(n.touchedFields,y):void 0;V||(_e(n.touchedFields,y,k),D.touchedFields=n.touchedFields,W=W||b("touchedFields")&&V!==k)}W&&$&&_.state.next(D)}return W?D:{}},X=(y,O,k,N)=>{const $=U(n.errors,y),W=b("isValid")&&yt(O)&&n.isValid!==O;if(t.delayError&&k?(u[y]=R(y,()=>Z(y,k)),u[y](t.delayError)):(T(y),k?_e(n.errors,y,k):Fe(n.errors,y),n.errors={...n.errors}),(k?!at($,k,!0):$)||!Ve(N)||W){const L={...N,...W&&yt(O)?{isValid:O}:{},errors:n.errors,name:y};_.state.next(L)}},q=async y=>(F(y,!0),await t.resolver(s,t.context,r_(y||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),me=async y=>{const O=S,{errors:k}=await q(y);if(O!==S)return k;if(F(y),y){for(const N of y){const $=U(k,N);A(N);const W=c.array.has(N)&&Ae($)&&!Object.keys($).some(V=>!Number.isNaN(Number(V))),L=U(r,N),D=Ae(L)&&Object.keys(L).some(V=>V!=="_f");W?Zc(n.errors,{[N]:$},N):$&&($.type||$.message)||Array.isArray($)||Ae($)&&D?_e(n.errors,N,$):Fe(n.errors,N)}n.errors={...n.errors}}else Object.keys(u).forEach(T),n.errors=k;return k},he=async({name:y,eventType:O})=>{if(t.validate){const k=S,N=await t.validate({formValues:s,formState:n,name:y,eventType:O});if(k!==S)return!0;if(Ae(N)){let $=!0;Rn(Lr);for(const W in N){const L=N[W];L&&($=!1,on(`${Lr}.${W}`,{message:rt(L.message)?L.message:"",type:L.type||Je.validate}))}return $}else return rt(N)||!N?(on(Lr,{message:N||"",type:Je.validate}),!1):(Rn(Lr),!0)}return!0},ae=async({fields:y,onlyCheckValid:O,name:k,eventType:N,context:$={valid:!0,runRootValidation:!1}})=>{const W=S;if(t.validate&&!$.runRootValidation&&($.runRootValidation=!0,!await he({name:k,eventType:N})&&($.valid=!1,O)))return $.valid;for(const L in y){const D=y[L];if(D){const{_f:V,...Q}=D;if(V){const ue=c.array.has(V.name),be=D._f&&o_(D._f),we=b("isValidating","validatingFields");be&&we&&F([V.name],!0);const ke=await Gc(D,c.disabled,s,P,t.shouldUseNativeValidation&&!O,ue);if(W!==S)return $.valid;if(be&&we&&F([V.name]),ke[V.name]&&($.valid=!1,O)||(O||(T(V.name),U(ke,V.name)?ue?Zc(n.errors,ke,V.name):_e(n.errors,V.name,ke[V.name]):Fe(n.errors,V.name)),t.shouldUseNativeValidation&&ke[V.name]))break}!Ve(Q)&&await ae({context:$,onlyCheckValid:O,fields:Q,name:L,eventType:N})}}return $.valid},re=()=>{for(const y of c.unMount){const O=U(r,y);O&&(O._f.refs?O._f.refs.every(k=>!Vs(k)):!Vs(O._f.ref))&&Ir(y)}c.unMount=new Set},B=(y,O)=>(y&&O&&_e(s,y,O),!at(i.mount?s:o,o)),se=(y,O,k)=>{const N=i.mount?s:ve(O)||!ve(y)?o:O;return Ii(y,c,ve(y)?{...N}:N,k,O)},ye=y=>Sh(U(i.mount?s:o,y,t.shouldUnregister?U(o,y,[]):[])),le=(y,O,k={},N=!1,$=!1,W=!1)=>{const L=U(r,y);let D=O;if(L){const V=L._f;V&&(!V.disabled&&_e(s,y,Di(O,V)),D=Yo(V.ref)&&Xe(O)?"":O,Ch(V.ref)?[...V.ref.options].forEach(Q=>Q.selected=D.includes(Q.value)):V.refs?kr(V.ref)?V.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(D)?Q.checked=!!D.find(ue=>ue===Q.value):Q.checked=D===Q.value||!!D)}):V.refs.forEach(Q=>Q.checked=Q.value===D):ms(V.ref)?V.ref.value="":(V.ref.value=D,!V.ref.type&&!$&&!W&&_.state.next({name:y,values:N?s:x(y)?Oe(s):void 0})))}(k.shouldDirty||k.shouldTouch)&&te(y,L&&L._f&&!L._f.disabled&&(L._f.valueAsNumber||L._f.valueAsDate||L._f.setValueAs)?Di(O,L._f):D,k.shouldTouch,k.shouldDirty,!$),k.shouldValidate&<(y,{delayError:k.delayError}),k.shouldValidate&&L&&L._f&&L._f.deps&&(!Array.isArray(L._f.deps)||L._f.deps.length>0)&<(L._f.deps)},Pe=(y,O,k,N=!1,$=!1,W=!1)=>{c.array.has(y)&&_.array.next({name:y,values:N?s:Oe(s)});for(const L in O){if(!O.hasOwnProperty(L))continue;const D=O[L],V=y+"."+L,Q=U(r,V);(c.array.has(y)||Ae(D)||Q&&!Q._f)&&!Sn(D)?Pe(V,D,k,N,$,W):le(V,D,k,N,$,W)}},je=(y,O,k,N,$=!1)=>{const W=U(r,y),L=c.array.has(y),D=N?O:Oe(O),V=U(s,y),Q=at(V,D);if(Q||_e(s,y,D),L)_.array.next({name:y,values:N?s:Oe(s)}),b("isDirty","dirtyFields")&&k.shouldDirty&&(z(),$||_.state.next({name:y,dirtyFields:n.dirtyFields,isDirty:B(y,D)})),k.shouldValidate&<(y,{delayError:k.delayError});else{const ue=Array.isArray(D)&&!D.length||Ve(D),be=!Q&&!$;!W||W._f||Xe(D)||ue?le(y,D,k,N,$,be):Pe(y,D,k,N,$,be)}if(!Q&&!$){const ue=Fs(y,c),be=i.mount||ue?y:void 0,we=L?[]:n_(c.array,y),ke=N?s:x(be)||we.some(x)?Oe(s):void 0;_.state.next({...ue&&n,name:be,values:ke});for(const mt of we)_.state.next({name:mt,values:ke})}},Ee=(y,O,k={})=>je(y,O,k,!1),$e=(y,O={})=>{const k=nt(y)?y(s):y;if(!at(s,k)){s={...s,...k};for(const N of c.mount)Yc(k,N)&&je(N,U(k,N),O,!0,!0);_.state.next({...n,name:void 0,type:void 0,...l.size?{values:s}:{}}),O.shouldValidate&&j()}},We=async y=>{i.mount=!0;const O=y.target;let k=O.name,N=!0;const $=U(r,k),W=L=>{N=Number.isNaN(L)||Sn(L)&&isNaN(L.getTime())||at(L,U(s,k,L))};if($){let L,D;const V=O.type?Xc($._f):Ri(y),Q=y.type===pn.BLUR||y.type===pn.FOCUS_OUT,ue=!s_($._f)&&!t.validate&&!t.resolver&&!U(n.errors,k)&&!$._f.deps,be=ue||a_(Q,U(n.touchedFields,k),n.isSubmitted,p,f),we=Fs(k,c,Q);_e(s,k,Oe(V)),Q?(!O||!O.readOnly)&&($._f.onBlur&&$._f.onBlur(y),Object.prototype.hasOwnProperty.call(u,k)&&u[k](0)):$._f.onChange&&$._f.onChange(y);const ke=te(k,V,Q),mt=!Ve(ke)||we;if(!Q&&_.state.next({name:k,type:y.type,...x(k)?{values:Oe(s)}:{}}),be)return(!ue||!n.isValid)&&b("isValid")&&(t.mode==="onBlur"?Q&&j():Q||j()),mt&&_.state.next({name:k,...we?{}:ke});if(!t.resolver&&t.validate&&await he({name:k,eventType:y.type}),!Q&&we&&_.state.next({...n}),t.resolver){const ln=S,{errors:_t}=await q([k]);if(ln!==S)return;if(F([k]),W(V),!N){!Ve(ke)&&_.state.next(ke);return}const Dr=tl(n.errors,r,k),tc=tl(_t,r,Dr.name||k);L=tc.error,k=tc.name,D=Ve(_t)}else{const ln=S;if(F([k],!0),L=(await Gc($,c.disabled,s,P,t.shouldUseNativeValidation))[k],ln!==S)return;if(F([k]),W(V),N){if(L)D=!1;else if(b("isValid")&&(D=await ae({fields:r,onlyCheckValid:!0,name:k,eventType:y.type}),ln!==S))return}}N&&($._f.deps&&(!Array.isArray($._f.deps)||$._f.deps.length>0)&<($._f.deps),X(k,D,L,ke))}},kt=(y,O)=>{if(U(n.errors,O)&&y.focus)return y.focus(),1},lt=async(y,O={})=>{let k,N;const $=Ls(y);if(t.resolver){const W=S,L=await me(ve(y)?y:$);if(k=Ve(L),N=y?!$.some(D=>U(L,D)):k,W!==S)return N}else y?(N=(await Promise.all($.map(async W=>{const L=U(r,W);return await ae({fields:L&&L._f?{[W]:L}:L,eventType:pn.TRIGGER})}))).every(Boolean),!(!N&&!n.isValid)&&j()):N=k=await ae({fields:r,name:y,eventType:pn.TRIGGER});if(O.delayError&&t.delayError&&rt(y)){const W=U(n.errors,y);W?(Fe(n.errors,y),u[y]=R(y,()=>Z(y,W)),u[y](t.delayError)):T(y)}if(O.shouldTouch)for(const W of y?$:c.mount)!c.array.has(W)&&_e(n.touchedFields,W,!0);return n.errors={...n.errors},_.state.next({...!rt(y)||b("isValid")&&k!==n.isValid?{}:{name:y},...t.resolver||!y?{isValid:k}:{},...O.shouldTouch&&b("touchedFields")?{touchedFields:n.touchedFields}:{},errors:n.errors}),O.shouldFocus&&!N&&Zr(r,kt,y?$:c.mount),N},Le=(y,O)=>{let k={...i.mount?s:o};return O&&(k=Eh(O.dirtyFields?n.dirtyFields:n.touchedFields,k)),ve(y)?k:rt(y)?U(k,y):y.map(N=>U(k,N))},qn=y=>ve(y)?{...n.errors}:rt(y)?U(n.errors,y):y.map(O=>U(n.errors,O)),pt=(y,O)=>{const k=O||n,N=U(k.errors,y);return{invalid:!!N,isDirty:!!U(k.dirtyFields,y),error:N,isValidating:!!U(k.validatingFields,y),isTouched:!!U(k.touchedFields,y)}},Rn=y=>{const O=y?Ls(y):void 0;O?O.forEach(k=>{A(k),Fe(n.errors,k),n.errors={...n.errors},_.state.next({name:k,errors:n.errors})}):(Object.keys(u).forEach(T),n.errors={},_.state.next({errors:n.errors}))},on=(y,O,k)=>{A(y);const N=(U(r,y,{_f:{}})._f||{}).ref,$=U(n.errors,y)||{},{ref:W,message:L,type:D,types:V,...Q}=$;_e(n.errors,y,{...Q,...O,ref:N}),n.errors={...n.errors},_.state.next({name:y,errors:n.errors,isValid:!1}),k&&k.shouldFocus&&N&&N.focus&&N.focus()},ze=(y,O)=>{if(nt(y)){const k={};l.add(k);const{unsubscribe:N}=_.state.subscribe({next:$=>"values"in $&&y($.values||se(void 0,O),$)});return{unsubscribe:()=>{l.delete(k),N()}}}return se(y,O,!0)},Tr=y=>{const O={name:y.name,exact:y.exact};y.formState&&y.formState.values&&l.add(O);const{unsubscribe:k}=_.state.subscribe({next:N=>{if(rl(y.name,N.name,y.exact)&&i_(N,y.formState||g,y.reRenderRoot)){const $=N.values||{...s};y.callback({...n,...N,values:$,defaultValues:o})}}});return()=>{l.delete(O),k()}},sn=y=>{i.mount=!0;const O=Object.keys(y.formState||{}).filter(N=>y.formState&&y.formState[N]);for(const N of O)w[N]=(w[N]||0)+1;const k=Tr({...y,formState:{...v,...y.formState}});return()=>{for(const N of O.splice(0))w[N]--;k()}},Ir=(y,O={})=>{for(const k of y?Ls(y):c.mount)c.mount.delete(k),c.array.delete(k),c.disabled.delete(k),O.keepValue||(Fe(r,k),Fe(s,k)),O.keepError||(A(k),Fe(n.errors,k)),!O.keepDirty&&Fe(n.dirtyFields,k),!O.keepTouched&&Fe(n.touchedFields,k),!O.keepIsValidating&&Fe(n.validatingFields,k),!t.shouldUnregister&&!O.keepDefaultValue&&Fe(o,k);O.keepError||(n.errors={...n.errors}),l.size&&_.state.next({values:Oe(s)}),_.state.next({...n,...O.keepDirty?{}:{isDirty:B()},...O.keepIsValidating?{}:{isValidating:!Ve(n.validatingFields)}}),!O.keepIsValid&&j()},fo=({disabled:y,name:O})=>{if(yt(y)&&i.mount||y||c.disabled.has(O)){const $=c.disabled.has(O)!==!!y;y?c.disabled.add(O):c.disabled.delete(O),$&&i.mount&&!i.action&&j()}},an=(y,O={})=>{let k=U(r,y);const N=yt(O.disabled)||yt(t.disabled),$=!c.registerName.has(y)&&k&&k._f&&!k._f.mount;if(_e(r,y,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:y}},name:y,mount:!0,...O}}),c.mount.add(y),k&&k._f){const W=U(r,y);for(const L of B0)L in O||delete W._f[L]}return k&&!$?fo({disabled:yt(O.disabled)?O.disabled:t.disabled,name:y}):ne(y,!0,O.value),{...N?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:$r(O.min),max:$r(O.max),minLength:$r(O.minLength),maxLength:$r(O.maxLength),pattern:$r(O.pattern)}:{},name:y,onChange:We,onBlur:We,ref:W=>{if(W){c.registerName.add(y),an(y,O),c.registerName.delete(y),k=U(r,y);const L=ve(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,D=e_(L),V=k._f.refs||[];if(D?V.find(ue=>ue===L):L===k._f.ref)return;const Q={...k._f};D?(Q.refs=[...V.filter(Vs),L,...Array.isArray(U(o,y))?[{}]:[]],Q.ref={type:L.type,name:y}):(Q.ref=L,delete Q.refs),_e(r,y,{_f:Q}),ne(y,!1,void 0,L)}else k=U(r,y,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(vh(c.array,y)&&i.action)&&c.unMount.add(y)}}},Ar=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Zr(r,kt,c.mount),ho=y=>{yt(y)&&(_.state.next({disabled:y}),Zr(r,(O,k)=>{const N=U(r,k);N&&(O.disabled=N._f.disabled||y,Array.isArray(N._f.refs)&&N._f.refs.forEach($=>{$.disabled=N._f.disabled||y}))},0))},Qn=(y,O)=>async k=>{let N,$;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let W=Oe(s);if(_.state.next({isSubmitting:!0}),t.resolver){const L=S,{errors:D,values:V}=await q();if(L!==S)return;F(),Object.keys(u).forEach(T),n.errors=D,W=Oe(V)}else{const L=S;if(await ae({fields:r,eventType:pn.SUBMIT}),L!==S)return;Fe(n.errors,yh),n.errors={...n.errors}}if(c.disabled.size)for(const L of c.disabled)Fe(W,L);if(Ve(n.errors)){_.state.next({errors:{}});try{N=await y(W,k)}catch(L){$=L}}else O&&await O({...n.errors},k),Ar(),setTimeout(Ar);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ve(n.errors)&&!$,submitCount:n.submitCount+1,errors:n.errors}),$)throw $;return N},cn=(y,O={})=>{U(r,y)&&(Fe(n.validatingFields,y),ve(O.defaultValue)?Ee(y,Oe(U(o,y))):(Ee(y,O.defaultValue),_e(o,y,Oe(O.defaultValue))),O.keepTouched||Fe(n.touchedFields,y),O.keepDirty||(Fe(n.dirtyFields,y),n.isDirty=O.defaultValue?B(y,Oe(U(o,y))):B()),O.keepError||(A(y),Fe(n.errors,y),n.errors={...n.errors},j()),_.state.next({...n,isValidating:!Ve(n.validatingFields)}))},Nr=(y,O={})=>{S++;const k=y?Oe(y):o,N=Oe(k),$=Ve(y),W=N,L=r;if(Object.keys(u).forEach(T),O.keepDefaultValues||(o=k),!O.keepValues){if(O.keepDirtyValues){const D=new Set([...c.mount,...kh(Gt(o,s,void 0,L),n.dirtyFields)]);for(const V of D){const Q=U(n.dirtyFields,V),ue=U(s,V),be=U(W,V);Q&&!ve(ue)?_e(W,V,ue):!Q&&!ve(be)&&Ee(V,be)}}else{if(gs&&ve(y))for(const D of c.mount){const V=U(r,D);if(V&&V._f){const Q=Array.isArray(V._f.refs)?V._f.refs[0]:V._f.ref;if(Yo(Q)){const ue=Q.closest("form");if(ue){ue.reset();break}}}}if(O.keepFieldsRef)for(const D of c.mount)Ee(D,U(W,D));else r={}}if(t.shouldUnregister){if(s=O.keepDefaultValues?Oe(o):{},O.keepFieldsRef)for(const D of c.mount)_e(s,D,U(W,D))}else s=Oe(W);_.array.next({values:{...W}}),_.state.next({name:void 0,type:void 0,values:{...W}})}c={mount:O.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!g.isValid||!!O.keepIsValid||!!O.keepDirtyValues||!t.shouldUnregister&&!Ve(W),i.watch=!!t.shouldUnregister,i.keepIsValid=!!O.keepIsValid,i.action=!1,i.actionArrayLengths.clear(),a=!1,O.keepErrors||(n.errors={}),_.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:$?!1:O.keepDirty?n.isDirty:O.keepValues?B():!!(O.keepDefaultValues&&y&&!at(y,o)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:$?{}:O.keepDirtyValues?O.keepDefaultValues&&s?Gt(o,s,void 0,L):n.dirtyFields:O.keepDefaultValues&&y?Gt(o,y,void 0,L):O.keepDirty?n.dirtyFields:O.keepValues?Gt(o,s,void 0,L):{},touchedFields:O.keepTouched?n.touchedFields:{},...!O.keepIsValidating&&(n.isValidating||!Ve(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ht=(y,O)=>Nr(nt(y)?y(s):y,{...t.resetOptions,...O}),xs=(y,O={})=>{const k=U(r,y),N=k&&k._f;if(N){const $=N.refs?N.refs[0]:N.ref;$.focus&&setTimeout(()=>{$.focus(),O.shouldSelect&&nt($.select)&&$.select()})}},Ss=y=>{const{name:O,type:k,values:N,...$}=y;Object.keys($).length&&(n={...n,...$})};_.state.subscribe({next:Ss});const wt={control:{register:an,unregister:Ir,getFieldState:pt,handleSubmit:Qn,setError:on,_subscribe:Tr,_runSchema:q,_updateIsValidating:F,_focusError:Ar,_getWatch:se,_getDirty:B,_setValid:j,_setFieldArray:Y,_setDisabledField:fo,_setErrors:K,_getFieldArray:ye,_reset:Nr,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(y=>{Ht(y,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:ho,_subjects:_,_proxyFormState:g,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(y){i=y},get _defaultValues(){return o},get _names(){return c},set _names(y){c=y},get _formState(){return n},get _options(){return t},set _options(y){t={...t,...y},f=ko(t.mode),p=ko(t.reValidateMode),P=t.criteriaMode===Rt.all}},subscribe:sn,trigger:lt,register:an,handleSubmit:Qn,watch:ze,setValue:Ee,setValues:$e,getValues:Le,getErrors:qn,reset:Ht,resetField:cn,resetDefaultValues:(y,O={})=>{if(o=Oe(y),!O.keepDirty){const k=Gt(o,s,void 0,r);n.dirtyFields=k,n.isDirty=!Ve(k)}O.keepIsValid||j(),_.state.next({...n,defaultValues:o})},clearErrors:Rn,unregister:Ir,setError:on,setFocus:xs,getFieldState:pt};return{...wt,formControl:wt}}const ol={mode:Uo.mode,reValidateMode:Uo.reValidateMode,shouldFocusError:Uo.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0};function d_(e={}){const t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),o=I.useRef(!!e.validate),[s,i]=I.useState(()=>({...Oe(Th),isLoading:nt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:nt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:p,...v}=u_(e);t.current={...v,formState:s}}const a=t.current.control,c=a._options,u={};for(const p in ol)p in c&&!(p in e)&&(u[p]=ol[p]);a._options={...u,...e,validate:e.validate};const d=()=>({...a._formState,defaultValues:a._defaultValues}),{resyncIfNeeded:l,snapshot:f}=$a(d);return ja(()=>{l(!0,d,i);const p=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(v=>({...v,isReady:!0})),a._formState.isReady=!0,()=>{p(),f(!0,d)}},[a,l,f]),I.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),I.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),I.useEffect(()=>{o.current&&!e.validate&&t.current&&t.current.clearErrors(Lr),o.current=!!e.validate},[e.validate]),I.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),I.useEffect(()=>{if(a._proxyFormState.isDirty){const p=a._getDirty();p!==s.isDirty&&a._subjects.state.next({isDirty:p})}},[a,s.isDirty]),I.useEffect(()=>{e.values&&!at(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions&&a._options.resetOptions.keepIsValid||a._setValid(),n.current=e.values,i(p=>({...p}))):a._resetDefaultValues()},[a,e.values]),I.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=I.useMemo(()=>wh(s,a),[a,s]),t.current}const sl=(e,t,n)=>{if(e&&"reportValidity"in e){const r=U(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Mi=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?sl(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>sl(o,n,e))}},il=(e,t)=>{t.shouldUseNativeValidation&&Mi(e,t);const n={};for(const r in e){const o=U(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(f_(t.names||Object.keys(e),r)){const i=Object.assign({},U(n,r));_e(i,"root",s),_e(n,r,i)}else _e(n,r,s)}return n},f_=(e,t)=>{const n=al(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(r=>al(r).match(`^${n}\\.\\d+`))};function al(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(null,arguments)}function cl(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function h_(e,t){for(var n=Object.create(null);e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a,c,u=r.unionErrors.reduce(function(f,p){return p.errors.length<f.errors.length?p:f}).errors[0];n[i]={message:(a=u==null?void 0:u.message)!=null?a:s,type:(c=u==null?void 0:u.code)!=null?c:o}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var d=n[i].types,l=d&&d[r.code];n[i]=za(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function p_(e,t){for(var n=Object.create(null),r=function(){var o=e[0],s=o.code,i=o.message,a=o.path.join(".");if(!n[a])if(o.code==="invalid_union"&&o.errors.length>0){var c,u,d=o.errors.reduce(function(p,v){return v.length<p.length?v:p})[0];n[a]={message:(c=d==null?void 0:d.message)!=null?c:i,type:(u=d==null?void 0:d.code)!=null?u:s}}else n[a]={message:i,type:s};if(o.code==="invalid_union"&&o.errors.forEach(function(p){return p.forEach(function(v){return e.push(ji({},v,{path:[].concat(o.path,v.path)}))})}),t){var l=n[a].types,f=l&&l[o.code];n[a]=za(a,t,n,s,f?[].concat(f,o.message):o.message)}e.shift()};e.length;)r();return n}function m_(e,t,n){if(n===void 0&&(n={}),(function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){function i(c){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):c}}var a=e;return n.mode==="sync"?i(a.parse(r,t)):Promise.resolve(a.parseAsync(r,t)).then(i)},function(i){if((function(a){var c;return!(a==null||(c=a._zod)==null||(c=c.traits)==null||!c.has("$ZodError"))})(i))return{values:{},errors:il(p_(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_def"in r&&typeof r._def=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a==null?void 0:a.issues)})(i))return{values:{},errors:il(h_(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function $i(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ll(e,t="|"){return e.map(n=>jh(n)).join(t)}function zi(e,t){return typeof t=="bigint"?t.toString():t}class g_{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Fa(e){return new g_(e)}function v_(e){return e==null}function La(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function y_(e,t){const n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Gn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ih(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function tn(e){return Ih(e._zod.def)??e._zod.def.shape}function Ah(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Gn(this,t,r),r},enumerable:!0,configurable:!0})}function Nh(e,t,n){t in e?Gn(e,t,n):e[t]=n}function Zn(e,t,n,r){const o=tn(t);for(const s of n){const i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Ah(e,s,()=>{const a=t._zod.def.shape[s];return r?r(a,s):a}):Nh(e,s,r?r(i.value,s):i.value))}}function b_(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ah(e,n,()=>t[n]):Nh(e,n,r.value))}}function St(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function w_(e){return JSON.stringify(e)}function __(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Dh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const x_=Fa(()=>{var e;if(Bt.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Yr(e){if(Xo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Xo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Mh(e){return Yr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const S_=new Set(["string","number","symbol"]);function ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function On(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function oe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jh(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function E_(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const $h={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},C_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return Zn(s,e,bs(e,t)),On(e,St(n,{shape:s,checks:[]}))}function bs(e,t){var o;const n=tn(e),r=[];for(const s of Reflect.ownKeys(t)){if(!((o=Object.getOwnPropertyDescriptor(n,s))!=null&&o.enumerable))throw new Error(`Unrecognized key: "${String(s)}"`);t[s]&&r.push(s)}return r}function O_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(bs(e,t)),i={};return Zn(i,e,Reflect.ownKeys(tn(e)).filter(a=>!s.has(a))),On(e,St(n,{shape:i,checks:[]}))}function P_(e,t){if(!Yr(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=tn(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return On(e,St(e._zod.def,{shape:zh(e,t)}))}function zh(e,t){const n={};return Zn(n,e,Reflect.ownKeys(tn(e))),b_(n,t),n}function R_(e,t){if(!Yr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return On(e,St(e._zod.def,{shape:zh(e,t)}))}function T_(e,t){var o,s;if(!((o=t==null?void 0:t._zod)!=null&&o.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((s=e._zod.def.checks)!=null&&s.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Zn(n,e,Reflect.ownKeys(tn(e))),Zn(n,t,Reflect.ownKeys(tn(t)));const r=St(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return On(e,r)}function ul(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const a=n?new Set(bs(t,n)):void 0,c={};return Zn(c,t,Reflect.ownKeys(tn(t)),e&&((u,d)=>a&&!a.has(d)?u:new e({type:"optional",innerType:u}))),On(t,St(t._zod.def,{shape:c,checks:[]}))}function I_(e,t,n){const r=n?new Set(bs(t,n)):void 0,o={};return Zn(o,t,Reflect.ownKeys(tn(t)),(s,i)=>r&&!r.has(i)?s:new e({type:"nonoptional",innerType:s})),On(t,St(t._zod.def,{shape:o}))}function Yt(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function A_(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Va(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function zr(e){return typeof e=="string"?e:e==null?void 0:e.message}function dl(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const o=r.maximum??r.length??r.size;o>=0&&t.push([o,n])}return t}function Fi(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function Or(e,t,n){var c,u,d,l,f,p,v,g,w,b;var r;const o=(u=(c=e.inst)==null?void 0:c._zod)==null?void 0:u.traits;o!=null&&o.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?(l=(d=e.schema)==null?void 0:d._zod.def)==null?void 0:l.error:void 0,i=e.message?e.message:zr((v=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:v.call(p,e))??zr(s==null?void 0:s(e))??zr((g=t==null?void 0:t.error)==null?void 0:g.call(t,e))??zr((w=n.customError)==null?void 0:w.call(n,e))??zr((b=n.localeError)==null?void 0:b.call(n,e))??"Invalid input",a={};for(const x of Object.keys(e))x==="inst"||x==="schema"||x==="continue"||x==="input"||x==="__proto__"||(a[x]=e[x]);return a.path??(a.path=[]),a.message=i,t!=null&&t.reportInput&&(a.input=e.input),a}const N_=/[\uD800-\uDBFF]/;function Ua(e){const t=e.length;if(!N_.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Za(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function D_(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function M_(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):j_(e,n,r.value)}}function kn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ba(e,t,n){return kn(e,t,n,!1)}function Fh(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return kn(this,n,r(this))},set(o){kn(this,n,o)}})}return t}function j_(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:kn(this,t,n.bind(this))},set(r){kn(this,t,r)}})}function $_(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let Us,hn=!1;const z_={configurable:!0,get(){hn=!0}};function Ce(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&Us!==e._zod){Us=void 0;return}Us=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,z_);const o=hn;hn=!1;try{const s=n(this);return hn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),hn=hn||o,s}catch(s){throw delete this[t],hn=hn||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function F_(e,t,n,r){const o=$_(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const s={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:s})}})}const L_="~constantCatch";function V_(e){const t=()=>e;return t[L_]=!0,t}var fl;const Zs={value:void 0,enumerable:!1};let hl="captureStackTrace"in Error?Error:null;function U_(e){const t=hl;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return hl=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function M(e,t,n,r){const o={};function s(f){this.def=f,this.constr=l,this.traits=new Set}s.prototype=o;const i=n,a=i&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Zs.value=new s(p);try{Object.defineProperty(f,"_zod",Zs)}finally{Zs.value=void 0}}if(f._zod.traits.add(e),t(f,p),a){const g=Object.getPrototypeOf(f),w=f._zod.constr.prototype;let b=g;for(;b&&b!==w;)b=Object.getPrototypeOf(b);const x=b??g;a.has(x)||(a.add(x),M_(x,i))}const v=l.prototype;for(const g in v)Object.prototype.hasOwnProperty.call(v,g)&&(g in f||(f[g]=v[g].bind(f)))}const u=(r==null?void 0:r.Parent)??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function l(f){var w;const p=r!=null&&r.Parent?U_(d):this;c(p,f);const v=p._zod.deferred;if(v){for(const b of v)b();p._zod.deferred=void 0}const g=(w=globalThis.__zod_globalConfig)==null?void 0:w.postProcessor;return g&&g(p),p}return Object.defineProperty(l,"init",{value:c}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>{var p,v;return r!=null&&r.Parent&&f instanceof r.Parent?!0:(v=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:v.has(e)}}),Object.defineProperty(l,"name",{value:e}),l}class Vn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(fl=globalThis).__zod_globalConfig??(fl.__zod_globalConfig={});const Bt=globalThis.__zod_globalConfig;function Pn(e){return e&&Object.assign(Bt,e),Bt}function Z_(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,zi,2)),e.message}function B_(e){this._zod.message=e}const H_={get:Z_,set:B_,enumerable:!0,configurable:!0},Bs={value:void 0,enumerable:!1},pl=new WeakSet([Object.prototype,Error.prototype]),W_=(e,t)=>{e.name="$ZodError",Bs.value=t,Object.defineProperty(e,"issues",Bs),Bs.value=void 0,Object.defineProperty(e,"message",H_);const n=Object.getPrototypeOf(e);pl.has(n)||(pl.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},K_=M("$ZodError",W_);function G_(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function q_(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?G_(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Q_(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<a.length;){const d=a[u],l=u===a.length-1;if(d==="_errors"){l&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,d)||Object.defineProperty(c,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const f=c[d];l&&f._errors.push(t(i)),c=f,u++}}}};return r(e),n}function ws(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const Ha=e=>{const t=(n,r,o,s)=>{const i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Vn;if(a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Wa=e=>{const t=async(n,r,o,s)=>{const i=o?{...o,async:!0}:{async:!0};let a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Ka=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Vn;return s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}};function Vh(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>Or(o,n,Pn()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}const Ga=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}},Y_=Symbol.for("zod.compile.invalid"),J_=Symbol.for("zod.compile.fallback"),X_=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Y_)return!0;if(r.definite===!0&&n===void 0)return!1}return e1(e,t,n)});function e1(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let s;if(o?(r[J_]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new Vn;return s.issues.length===0}const t1=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},n1=e=>{const t=Ha(e),n=(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,o,a,ws(n,i))};return n},r1=e=>{const t=Ha(e),n=(r,o,s,i)=>t(r,o,s,ws(n,i));return n},o1=e=>{const t=Wa(e),n=async(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,o,a,ws(n,i))};return n},s1=e=>{const t=Wa(e),n=async(r,o,s,i)=>await t(r,o,s,ws(n,i));return n},i1=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ka(e)(t,n,o)},a1=e=>(t,n,r)=>Ka(e)(t,n,r),c1=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ga(e)(t,n,o)},l1=e=>async(t,n,r)=>Ga(e)(t,n,r),u1=/^[cC][0-9a-z]{6,}$/,d1=/^[0-9a-z]+$/,f1=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,h1=/^[0-9a-vA-V]{20}$/,p1=/^[A-Za-z0-9]{27}$/,m1=/^[a-zA-Z0-9_-]{21}$/;function g1(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const v1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ml=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,b1=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,w1="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function _1(){return new RegExp(w1,"u")}const x1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,E1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,C1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,k1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,O1=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,P1=/^https?$/,R1=/^\+[1-9]\d{6,14}$/,Uh="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function T1(e){return new RegExp(`^${e}$`)}const I1=T1(Uh);function Li(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function A1(e){return new RegExp(`^${Li(e)}$`)}function N1(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Li({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Li({precision:e.precision})}`:n;return new RegExp(`^${Uh}T(?:${r})$`)}const D1=/^[\s\S]{0,}$/,M1=/^-?\d+(?:\.\d+)?$/,j1=/^(?:true|false)$/i,$1=/^[^A-Z]*$/,z1=/^[^a-z]*$/,ht=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qa=e=>{const t=e.value;return!v_(t)&&t.length!==void 0},es={number:"number",bigint:"bigint",object:"date"},Zh=M("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bh=M("$ZodCheckGreaterThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),F1=M("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):y_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),L1=M("$ZodCheckNumberFormat",(e,t)=>{var i;ht.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[o,s]=$h[t.format];e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),V1=M("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Ua(o):s)<=t.maximum)return;const a=Za(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),U1=M("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Ua(o):s)>=t.minimum)return;const a=Za(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Z1=M("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Ua(o):s;if(i===t.length)return;const a=Za(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),_s=M("$ZodCheckStringFormat",(e,t)=>{var n,r;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),B1=M("$ZodCheckRegex",(e,t)=>{_s.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),H1=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$1),_s.init(e,t)}),W1=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=z1),_s.init(e,t)}),K1=M("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);const n=ys(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),G1=M("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`^${ys(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),q1=M("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`.*${ys(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function gl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues))}const Q1=M("$ZodCheckProperties",(e,t)=>{ht.init(e,t),Ba(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(i=>[i,t.shape[i]]));const o=r.value;let s;for(const[i,a]of n){const c=a._zod.run({value:o[i],issues:[]},{});c instanceof Promise?(s??(s=[]),s.push(c.then(u=>gl(u,r,i)))):gl(c,r,i)}if(s)return Promise.all(s).then(()=>{})}}),Y1=M("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class J1{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
192
|
+
`)},Uy=0,Jn=[];function Zy(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(Uy++)[0],s=h.useState(Id)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=uy([e.lockRef.current],(e.shards||[]).map(Nc),!0).filter(Boolean);return g.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(g,w){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=wo(g),x=n.current,_="deltaX"in g?g.deltaX:x[0]-b[0],C="deltaY"in g?g.deltaY:x[1]-b[1],S,P=g.target,R=Math.abs(_)>Math.abs(C)?"h":"v";if("touches"in g&&R==="h"&&P.type==="range")return!1;var T=window.getSelection(),A=T&&T.anchorNode,j=A?A===P||A.contains(P):!1;if(j)return!1;var F=Ic(R,P);if(!F)return!0;if(F?S=R:(S=R==="v"?"h":"v",F=Ic(R,P)),!F)return!1;if(!r.current&&"changedTouches"in g&&(_||C)&&(r.current=S),!S)return!0;var z=r.current||S;return Fy(z,w,g,z==="h"?_:C)},[]),c=h.useCallback(function(g){var w=g;if(!(!Jn.length||Jn[Jn.length-1]!==s)){var b="deltaY"in w?Ac(w):wo(w),x=t.current.filter(function(S){return S.name===w.type&&(S.target===w.target||w.target===S.shadowParent)&&Ly(S.delta,b)})[0];if(x&&x.should){w.cancelable&&w.preventDefault();return}if(!x){var _=(i.current.shards||[]).map(Nc).filter(Boolean).filter(function(S){return S.contains(w.target)}),C=_.length>0?a(w,_[0]):!i.current.noIsolation;C&&w.cancelable&&w.preventDefault()}}},[]),u=h.useCallback(function(g,w,b,x){var _={name:g,delta:w,target:b,should:x,shadowParent:By(b)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(C){return C!==_})},1)},[]),d=h.useCallback(function(g){n.current=wo(g),r.current=void 0},[]),l=h.useCallback(function(g){u(g.type,Ac(g),g.target,a(g,e.lockRef.current))},[]),f=h.useCallback(function(g){u(g.type,wo(g),g.target,a(g,e.lockRef.current))},[]);h.useEffect(function(){return Jn.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Yn),document.addEventListener("touchmove",c,Yn),document.addEventListener("touchstart",d,Yn),function(){Jn=Jn.filter(function(g){return g!==s}),document.removeEventListener("wheel",c,Yn),document.removeEventListener("touchmove",c,Yn),document.removeEventListener("touchstart",d,Yn)}},[]);var p=e.removeScrollBar,v=e.inert;return h.createElement(h.Fragment,null,v?h.createElement(s,{styles:Vy(o)}):null,p?h.createElement(Ay,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function By(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Hy=by(Td,Zy);var ma=h.forwardRef(function(e,t){return h.createElement(cs,Ut({},e,{ref:t,sideCar:Hy}))});ma.classNames=cs.classNames;var Wy=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xn=new WeakMap,_o=new WeakMap,xo={},js=0,Md=function(e){return e&&(e.host||Md(e.parentNode))},Ky=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Md(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Gy=function(e,t,n,r){var o=Ky(t,Array.isArray(e)?e:[e]);xo[n]||(xo[n]=new WeakMap);var s=xo[n],i=[],a=new Set,c=new Set(o),u=function(l){!l||a.has(l)||(a.add(l),u(l.parentNode))};o.forEach(u);var d=function(l){!l||c.has(l)||Array.prototype.forEach.call(l.children,function(f){if(a.has(f))d(f);else try{var p=f.getAttribute(r),v=p!==null&&p!=="false",g=(Xn.get(f)||0)+1,w=(s.get(f)||0)+1;Xn.set(f,g),s.set(f,w),i.push(f),g===1&&v&&_o.set(f,!0),w===1&&f.setAttribute(n,"true"),v||f.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),js++,function(){i.forEach(function(l){var f=Xn.get(l)-1,p=s.get(l)-1;Xn.set(l,f),s.set(l,p),f||(_o.has(l)||l.removeAttribute(r),_o.delete(l)),p||l.removeAttribute(n)}),js--,js||(Xn=new WeakMap,Xn=new WeakMap,_o=new WeakMap,xo={})}},jd=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Wy(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Gy(r,o,n,"aria-hidden")):function(){return null}},qy=Object.defineProperty,bt=(e,t)=>qy(e,"name",{value:t,configurable:!0}),ga="Dialog",[$d,C2]=nn(ga),[Qy,jt]=$d(ga),Yy=bt(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,a=h.useRef(null),c=h.useRef(null),{nodes:u,registry:d}=ua(),[l,f]=ao({prop:r,defaultProp:o??!1,onChange:s,caller:ga}),[p,v]=h.useState(0),[g,w]=h.useState(0);return m.jsx(Qy,{scope:t,triggerRef:a,contentRef:c,contentId:En(),titleId:En(),descriptionId:En(),titlePresent:p>0,descriptionPresent:g>0,setTitleCount:v,setDescriptionCount:w,open:l,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(b=>!b),[f]),modal:i,branchNodes:u,branchRegistry:d,children:n})},"Dialog"),Jy="DialogTrigger",k2=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(Jy,r),i=Te(n,s.triggerRef);return m.jsx(Ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":ls(s.open),...o,ref:i,onClick:de(t.onClick,s.onOpenToggle)})},"DialogTrigger")),zd="DialogPortal",[Xy,Fd]=$d(zd,{forceMount:void 0}),eb=bt(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=jt(zd,t);return m.jsx(Xy,{scope:t,forceMount:n,children:h.Children.map(r,i=>m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),bi="DialogOverlay",Ld=h.forwardRef(bt(function(t,n){const r=Fd(bi,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(bi,t.__scopeDialog);return i.modal?m.jsx(rn,{present:o||i.open,children:m.jsx(nb,{...s,ref:n})}):null},"DialogOverlay")),tb=Jt("DialogOverlay.RemoveScroll"),nb=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(bi,r),i=hd(),a=Te(n,i);return m.jsx(ma,{as:tb,allowPinchZoom:!0,shards:h.useMemo(()=>[s.contentRef,...s.branchNodes.map(c=>({current:c}))],[s.contentRef,s.branchNodes]),children:m.jsx(Ze.div,{"data-state":ls(s.open),...o,ref:a,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),Kr="DialogContent",Vd=h.forwardRef(bt(function(t,n){const r=Fd(Kr,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=jt(Kr,t.__scopeDialog);return m.jsx(rn,{present:o||i.open,children:i.modal?m.jsx(rb,{...s,ref:n}):m.jsx(ob,{...s,ref:n})})},"DialogContent")),rb=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(null),s=Te(n,r.contentRef,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Ud,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:de(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=r.triggerRef.current)==null||a.focus()}),onPointerDownOutside:de(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,c=a.button===0&&a.ctrlKey===!0;(a.button===2||c)&&i.preventDefault()}),onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),ob=h.forwardRef(bt(function(t,n){const r=jt(Kr,t.__scopeDialog),o=h.useRef(!1),s=h.useRef(!1);return m.jsx(Ud,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,c;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(o.current||(c=r.triggerRef.current)==null||c.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Ud=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,"aria-describedby":a,children:c,...u}=t,d=jt(Kr,r);return as(),m.jsx(la,{registry:d.branchRegistry,children:m.jsx(gd,{asChild:!0,loop:!0,trapped:o,branches:d.branchNodes,onMountAutoFocus:s,onUnmountAutoFocus:i,children:m.jsx(aa,{role:"dialog",id:d.contentId,"aria-labelledby":d.titlePresent?d.titleId:void 0,"aria-describedby":d.descriptionPresent?Hd(a,d.descriptionId):a,"data-state":ls(d.open),...u,ref:n,deferPointerDownOutside:!0,onDismiss:()=>d.onOpenChange(!1),children:c})})})},"DialogContentImpl")),Zd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogTitle",r),{setTitleCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.h2,{id:s.titleId,...o,ref:n})},"DialogTitle")),Bd=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt("DialogDescription",r),{setDescriptionCount:i}=s;return ct(()=>(i(a=>a+1),()=>i(a=>a-1)),[i]),m.jsx(Ze.p,{id:s.descriptionId,...o,ref:n})},"DialogDescription")),sb="DialogClose",ib=h.forwardRef(bt(function(t,n){const{__scopeDialog:r,...o}=t,s=jt(sb,r);return m.jsx(Ze.button,{type:"button",...o,ref:n,onClick:de(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Hd(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}bt(Hd,"concatAriaDescribedby");function ls(e){return e?"open":"closed"}bt(ls,"getState");const ab=Yy,cb=eb,Wd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ld,{className:s,...o,ref:t}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wd.displayName=Ld.displayName;const lb=so("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),Kd=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s,i;n[0]!==e?({side:i,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=i===void 0?"right":i;let c;n[5]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(Wd,{}),n[5]=c):c=n[5];let u;n[6]!==o||n[7]!==a?(u=ce(lb({side:a}),o),n[6]=o,n[7]=a,n[8]=u):u=n[8];let d;n[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsxs(ib,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",children:[m.jsx(hg,{className:"h-4 w-4"}),m.jsx("span",{className:"sr-only",children:"Close"})]}),n[9]=d):d=n[9];let l;return n[10]!==r||n[11]!==s||n[12]!==t||n[13]!==u?(l=m.jsxs(cb,{children:[c,m.jsxs(Vd,{ref:t,className:u,...s,children:[r,d]})]}),n[10]=r,n[11]=s,n[12]=t,n[13]=u,n[14]=l):l=n[14],l});Kd.displayName=Vd.displayName;const Gd=e=>{const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("flex flex-col space-y-2 text-center sm:text-left",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s};Gd.displayName="SheetHeader";const qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-lg font-semibold text-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Zd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qd.displayName=Zd.displayName;const Qd=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Bd,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Qd.displayName=Bd.displayName;function Dc(e){const t=ee.c(8);let n,r;t[0]!==e?({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r):(n=t[1],r=t[2]);let o;t[3]!==n?(o=ce("animate-pulse rounded-md bg-muted",n),t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==r||t[6]!==o?(s=m.jsx("div",{className:o,...r}),t[5]=r,t[6]=o,t[7]=s):s=t[7],s}var ub=Object.defineProperty,db=(e,t)=>ub(e,"name",{value:t,configurable:!0});function Yd(e){const[t,n]=h.useState(void 0);return ct(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let a,c;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,c=d.blockSize}else a=e.offsetWidth,c=e.offsetHeight;n({width:a,height:c})})});return o.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}else n(void 0)},[e]),t}db(Yd,"useSize");var fb=Object.defineProperty,Cn=(e,t)=>fb(e,"name",{value:t,configurable:!0}),Mc={Partial:"partial"},jc={Optimized:"optimized",Always:"always"},Jd="Popper",[Xd,us]=nn(Jd),[hb,ef]=Xd(Jd),tf=Cn(e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null),[s,i]=h.useState(void 0);return m.jsx(hb,{scope:t,anchor:r,onAnchorChange:o,placementState:s,setPlacementState:i,children:n})},"Popper"),pb="PopperAnchor",nf=h.forwardRef(Cn(function(t,n){const{__scopePopper:r,virtualRef:o,...s}=t,i=ef(pb,r),a=h.useRef(null),c=i.onAnchorChange,u=h.useCallback(g=>{a.current=g,g&&c(g)},[c]),d=Te(n,u),l=h.useRef(null);h.useEffect(()=>{if(!o)return;const g=l.current;l.current=o.current,g!==l.current&&c(l.current)});const f=i.placementState&&ds(i.placementState),p=f==null?void 0:f[0],v=f==null?void 0:f[1];return o?null:m.jsx(Ze.div,{"data-radix-popper-side":p,"data-radix-popper-align":v,...s,ref:d})},"PopperAnchor")),rf="PopperContent",[mb,O2]=Xd(rf),of=h.forwardRef(Cn(function(t,n){var le,Pe,je,Ee,$e,We,kt;const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:l=0,sticky:f=Mc.Partial,hideWhenDetached:p=!1,updatePositionStrategy:v=jc.Optimized,onPlaced:g,...w}=t,b=ef(rf,r),[x,_]=h.useState(null),C=Te(n,_),[S,P]=h.useState(null),R=Yd(S),T=(R==null?void 0:R.width)??0,A=(R==null?void 0:R.height)??0,j=o+(i!=="center"?"-"+i:""),F=typeof l=="number"?l:{top:0,right:0,bottom:0,left:0,...l},z=Array.isArray(d)?d:[d],Y=z.length>0,Z={padding:F,boundary:z.filter(sf),altBoundary:Y},{refs:K,floatingStyles:H,placement:J,isPositioned:ne,middlewareData:te}=Ip({strategy:"fixed",placement:j,whileElementsMounted:Cn((...lt)=>Fp(...lt,{animationFrame:v===jc.Always}),"whileElementsMounted"),elements:{reference:b.anchor},middleware:[Ap({mainAxis:s+A,alignmentAxis:a}),u&&Np({mainAxis:!0,crossAxis:!1,...f===Mc.Partial?{limiter:zp()}:{},...Z}),u&&Dp({...Z}),Mp({...Z,apply:Cn(({elements:lt,rects:Le,availableWidth:qn,availableHeight:pt})=>{const{width:Rn,height:on}=Le.reference,ze=lt.floating.style;ze.setProperty("--radix-popper-available-width",`${qn}px`),ze.setProperty("--radix-popper-available-height",`${pt}px`),ze.setProperty("--radix-popper-anchor-width",`${Rn}px`),ze.setProperty("--radix-popper-anchor-height",`${on}px`)},"apply")}),S&&jp({element:S,padding:c}),gb({arrowWidth:T,arrowHeight:A}),p&&$p(Y?{strategy:"referenceHidden",...Z}:{strategy:"referenceHidden",padding:Z.padding,altBoundary:Z.altBoundary})]}),X=b.setPlacementState;ct(()=>(X(J),()=>{X(void 0)}),[J,X]);const[q,me]=ds(J),he=Xt(g);ct(()=>{ne&&(he==null||he())},[ne,he]);const ae=(le=te.arrow)==null?void 0:le.x,re=(Pe=te.arrow)==null?void 0:Pe.y,B=((je=te.arrow)==null?void 0:je.centerOffset)!==0,[se,ye]=h.useState();return ct(()=>{x&&ye(window.getComputedStyle(x).zIndex)},[x]),m.jsx("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:ne?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Ee=te.transformOrigin)==null?void 0:Ee.x,($e=te.transformOrigin)==null?void 0:$e.y].join(" "),...((We=te.hide)==null?void 0:We.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m.jsx(mb,{scope:r,placedSide:q,placedAlign:me,onArrowChange:P,arrowX:ae,arrowY:re,shouldHideArrow:B,children:m.jsx(Ze.div,{"data-side":q,"data-align":me,...w,ref:C,style:{...w.style,animation:ne?(kt=w.style)==null?void 0:kt.animation:"none"}})})})},"PopperContent"));function sf(e){return e!==null}Cn(sf,"isNotNull");var gb=Cn(e=>({name:"transformOrigin",options:e,fn(t){var w,b,x;const{placement:n,rects:r,middlewareData:o}=t,i=((w=o.arrow)==null?void 0:w.centerOffset)!==0,a=i?0:e.arrowWidth,c=i?0:e.arrowHeight,[u,d]=ds(n),l={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+c/2;let v="",g="";return u==="bottom"?(v=i?l:`${f}px`,g=`${-c}px`):u==="top"?(v=i?l:`${f}px`,g=`${r.floating.height+c}px`):u==="right"?(v=`${-c}px`,g=i?l:`${p}px`):u==="left"&&(v=`${r.floating.width+c}px`,g=i?l:`${p}px`),{data:{x:v,y:g}}}}),"transformOrigin");function ds(e){const[t,n="center"]=e.split("-");return[t,n]}Cn(ds,"getSideAndAlignFromPlacement");var vb=Object.defineProperty,yb=(e,t)=>vb(e,"name",{value:t,configurable:!0}),bb=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),wb=h.forwardRef(yb(function(t,n){return m.jsx(Ze.span,{...t,ref:n,style:{...bb,...t.style}})},"VisuallyHidden")),_b=Object.defineProperty,Ye=(e,t)=>_b(e,"name",{value:t,configurable:!0}),[va,P2]=nn("Tooltip",[us]),ya=us(),xb="TooltipProvider",Sb=700,wi="tooltip.open",[Eb,ba]=va(xb),Cb=Ye(e=>{const{__scopeTooltip:t,delayDuration:n=Sb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,i=h.useRef(!0),a=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.jsx(Eb,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),i.current=!1)},[r]),onClose:h.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(u=>{a.current=u},[]),disableHoverableContent:o,children:s})},"TooltipProvider"),_i="Tooltip",[kb,co]=va(_i),Ob=Ye(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:s,disableHoverableContent:i,delayDuration:a}=e,c=ba(_i,e.__scopeTooltip),u=ya(t),[d,l]=h.useState(null),[f,p]=h.useState(void 0),v=En(),g=h.useRef(0),w=i??c.disableHoverableContent,b=a??c.delayDuration,x=h.useRef(!1),[_,C]=ao({prop:r,defaultProp:o??!1,onChange:Ye(j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(wi))):c.onClose(),s==null||s(j)},"onChange"),caller:_i}),S=h.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),P=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x.current=!1,C(!0)},[C]),R=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,C(!1)},[C]),T=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,C(!0),g.current=0},b)},[b,C]);h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const A=f??v;return m.jsx(tf,{...u,children:m.jsx(kb,{scope:t,contentId:A,setContentId:p,open:_,stateAttribute:S,trigger:d,onTriggerChange:l,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?T():P()},[c.isOpenDelayedRef,T,P]),onTriggerLeave:h.useCallback(()=>{w?R():(window.clearTimeout(g.current),g.current=0)},[R,w]),onOpen:P,onClose:R,disableHoverableContent:w,children:n})})},"Tooltip"),$c="TooltipTrigger",Pb=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,"aria-describedby":o,...s}=t,i=co($c,r),a=ba($c,r),c=ya(r),u=h.useRef(null),d=Te(n,u,i.onTriggerChange),l=h.useRef(!1),f=h.useRef(!1),p=h.useCallback(()=>l.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),m.jsx(nf,{asChild:!0,...c,children:m.jsx(Ze.button,{"aria-describedby":i.open?gf(o,i.contentId):o,"data-state":i.stateAttribute,...s,ref:d,onPointerMove:de(t.onPointerMove,v=>{v.pointerType!=="touch"&&!f.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),f.current=!0)}),onPointerLeave:de(t.onPointerLeave,()=>{i.onTriggerLeave(),f.current=!1}),onPointerDown:de(t.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:de(t.onFocus,()=>{l.current||i.onOpen()}),onBlur:de(t.onBlur,i.onClose),onClick:de(t.onClick,i.onClose)})})},"TooltipTrigger")),af="TooltipPortal",[Rb,Tb]=va(af,{forceMount:void 0}),Ib=Ye(e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,s=co(af,t);return m.jsx(Rb,{scope:t,forceMount:n,children:m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"TooltipPortal"),Gr="TooltipContent",cf=h.forwardRef(Ye(function(t,n){const r=Tb(Gr,t.__scopeTooltip),{forceMount:o=r.forceMount,side:s="top",...i}=t,a=co(Gr,t.__scopeTooltip);return m.jsx(rn,{present:o||a.open,children:a.disableHoverableContent?m.jsx(lf,{side:s,...i,ref:n}):m.jsx(Ab,{side:s,...i,ref:n})})},"TooltipContent")),Ab=h.forwardRef(Ye(function(t,n){const r=co(Gr,t.__scopeTooltip),o=ba(Gr,t.__scopeTooltip),s=h.useRef(null),i=Te(n,s),[a,c]=h.useState(null),{trigger:u,onClose:d}=r,l=s.current,{onPointerInTransitChange:f}=o,p=h.useCallback(()=>{c(null),f(!1)},[f]),v=h.useCallback((g,w)=>{const b=g.currentTarget,x={x:g.clientX,y:g.clientY},_=uf(x,b.getBoundingClientRect()),C=df(x,_),S=ff(w.getBoundingClientRect()),P=pf([...C,...S]);c(P),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(u&&l){const g=Ye(b=>v(b,l),"handleTriggerLeave"),w=Ye(b=>v(b,u),"handleContentLeave");return u.addEventListener("pointerleave",g),l.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",g),l.removeEventListener("pointerleave",w)}}},[u,l,v,p]),h.useEffect(()=>{if(a){const g=Ye(w=>{const b=w.target,x={x:w.clientX,y:w.clientY},_=(u==null?void 0:u.contains(b))||(l==null?void 0:l.contains(b)),C=!hf(x,a);_?p():C&&(p(),d())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,l,a,d,p]),m.jsx(lf,{...t,ref:i})},"TooltipContentHoverable")),Nb=Vu("TooltipContent"),lf=h.forwardRef(Ye(function(t,n){const{__scopeTooltip:r,children:o,"aria-label":s,id:i,onEscapeKeyDown:a,onPointerDownOutside:c,...u}=t,d=co(Gr,r),l=ya(r),{onClose:f}=d,[p,v]=h.useState(null),g=Te(n,v);da(p),h.useEffect(()=>(document.addEventListener(wi,f),()=>document.removeEventListener(wi,f)),[f]),h.useEffect(()=>{if(d.trigger){const b=Ye(x=>{x.target instanceof Node&&x.target.contains(d.trigger)&&f()},"handleScroll");return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[d.trigger,f]);const{setContentId:w}=d;return ct(()=>(w(i),()=>{w(void 0)}),[i,w]),m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:c,onFocusOutside:b=>b.preventDefault(),onDismiss:f,children:m.jsxs(of,{"data-state":d.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:d.contentId,...l,...u,ref:g,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(Nb,{children:o}),s?m.jsx(wb,{id:d.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function uf(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,o,s)){case s:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}Ye(uf,"getExitSideFromRect");function df(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}Ye(df,"getPaddedExitPoints");function ff(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}Ye(ff,"getPointsFromRect");function hf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}Ye(hf,"isPointInPolygon");function pf(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),mf(t)}Ye(pf,"getHull");function mf(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const s=t[t.length-1],i=t[t.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const s=n[n.length-1],i=n[n.length-2];if((s.x-i.x)*(o.y-i.y)>=(s.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ye(mf,"getHullPresorted");function gf(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}Ye(gf,"concatAriaDescribedby");const Db=Cb,Mb=Ob,jb=Pb,vf=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-[50] overflow-hidden rounded-lg bg-foreground/85 px-[7px] py-1.5 text-[11px] text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(Ib,{children:m.jsx(cf,{ref:t,sideOffset:i,"data-slot":"tooltip-content",className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});vf.displayName=cf.displayName;const $b="sidebar_state",zb=3600*24*7,Fb="16rem",Lb="18rem",Vb="3rem",Ub="b",yf=h.createContext(null);function lo(){const e=h.useContext(yf);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const bf=h.forwardRef((e,t)=>{const n=ee.c(37);let r,o,s,i,a,c,u;n[0]!==e?({defaultOpen:u,open:s,onOpenChange:a,className:o,style:c,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=u===void 0?!0:u,l=Jg(),[f,p]=h.useState(!1),[v,g]=h.useState(d),w=s??v;let b;n[8]!==w||n[9]!==a?(b=K=>{const H=typeof K=="function"?K(w):K;a?a(H):g(H),document.cookie=`${$b}=${H}; path=/; max-age=${zb}`},n[8]=w,n[9]=a,n[10]=b):b=n[10];const x=b;let _;n[11]!==l||n[12]!==x?(_=()=>l?p(ew):x(tw),n[11]=l,n[12]=x,n[13]=_):_=n[13];const C=_;let S,P;n[14]!==C?(S=()=>{const K=H=>{H.key===Ub&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),C())};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},P=[C],n[14]=C,n[15]=S,n[16]=P):(S=n[15],P=n[16]),h.useEffect(S,P);const R=w?"expanded":"collapsed";let T;n[17]!==l||n[18]!==w||n[19]!==f||n[20]!==x||n[21]!==R||n[22]!==C?(T={state:R,open:w,setOpen:x,isMobile:l,openMobile:f,setOpenMobile:p,toggleSidebar:C},n[17]=l,n[18]=w,n[19]=f,n[20]=x,n[21]=R,n[22]=C,n[23]=T):T=n[23];const A=T;let j;n[24]!==c?(j={"--sidebar-width":Fb,"--sidebar-width-icon":Vb,...c},n[24]=c,n[25]=j):j=n[25];const F=j;let z;n[26]!==o?(z=ce("group/sidebar-wrapper flex h-svh w-full has-[[data-variant=inset]]:bg-sidebar",o),n[26]=o,n[27]=z):z=n[27];let Y;n[28]!==r||n[29]!==i||n[30]!==t||n[31]!==F||n[32]!==z?(Y=m.jsx(Db,{delayDuration:0,children:m.jsx("div",{style:F,className:z,ref:t,...i,children:r})}),n[28]=r,n[29]=i,n[30]=t,n[31]=F,n[32]=z,n[33]=Y):Y=n[33];let Z;return n[34]!==A||n[35]!==Y?(Z=m.jsx(yf.Provider,{value:A,children:Y}),n[34]=A,n[35]=Y,n[36]=Z):Z=n[36],Z});bf.displayName="SidebarProvider";const wf=h.forwardRef((e,t)=>{const n=ee.c(48);let r,o,s,i,a,c;n[0]!==e?({side:i,variant:a,collapsible:c,className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6]);const u=i===void 0?"left":i,d=a===void 0?"sidebar":a,l=c===void 0?"offcanvas":c,{isMobile:f,state:p,openMobile:v,setOpenMobile:g}=lo();if(l==="none"){let j;n[7]!==o?(j=ce("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",o),n[7]=o,n[8]=j):j=n[8];let F;return n[9]!==r||n[10]!==s||n[11]!==t||n[12]!==j?(F=m.jsx("div",{className:j,ref:t,...s,children:r}),n[9]=r,n[10]=s,n[11]=t,n[12]=j,n[13]=F):F=n[13],F}if(f){let j;n[14]===Symbol.for("react.memo_cache_sentinel")?(j={"--sidebar-width":Lb},n[14]=j):j=n[14];let F;n[15]===Symbol.for("react.memo_cache_sentinel")?(F=m.jsxs(Gd,{className:"sr-only",children:[m.jsx(qd,{children:"Sidebar"}),m.jsx(Qd,{children:"Displays the mobile sidebar."})]}),n[15]=F):F=n[15];let z;n[16]!==r?(z=m.jsx("div",{className:"flex h-full w-full flex-col",children:r}),n[16]=r,n[17]=z):z=n[17];let Y;n[18]!==u||n[19]!==z?(Y=m.jsxs(Kd,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:j,side:u,children:[F,z]}),n[18]=u,n[19]=z,n[20]=Y):Y=n[20];let Z;return n[21]!==v||n[22]!==s||n[23]!==g||n[24]!==Y?(Z=m.jsx(ab,{open:v,onOpenChange:g,...s,children:Y}),n[21]=v,n[22]=s,n[23]=g,n[24]=Y,n[25]=Z):Z=n[25],Z}const w=p==="collapsed"?l:"",b=d==="floating"||d==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]";let x;n[26]!==b?(x=ce("relative w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",b),n[26]=b,n[27]=x):x=n[27];let _;n[28]!==x?(_=m.jsx("div",{className:x}),n[28]=x,n[29]=_):_=n[29];const C=u==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",S=d==="floating"||d==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l";let P;n[30]!==o||n[31]!==C||n[32]!==S?(P=ce("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",C,S,o),n[30]=o,n[31]=C,n[32]=S,n[33]=P):P=n[33];let R;n[34]!==r?(R=m.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:r}),n[34]=r,n[35]=R):R=n[35];let T;n[36]!==s||n[37]!==P||n[38]!==R?(T=m.jsx("div",{className:P,...s,children:R}),n[36]=s,n[37]=P,n[38]=R,n[39]=T):T=n[39];let A;return n[40]!==t||n[41]!==u||n[42]!==p||n[43]!==T||n[44]!==w||n[45]!==_||n[46]!==d?(A=m.jsxs("div",{ref:t,className:"group peer hidden text-sidebar-foreground md:block","data-state":p,"data-collapsible":w,"data-variant":d,"data-side":u,children:[_,T]}),n[40]=t,n[41]=u,n[42]=p,n[43]=T,n[44]=w,n[45]=_,n[46]=d,n[47]=A):A=n[47],A});wf.displayName="Sidebar";const _f=h.forwardRef((e,t)=>{const n=ee.c(16);let r,o,s;n[0]!==e?({className:r,onClick:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const{toggleSidebar:i}=lo();let a;n[4]!==r?(a=ce("h-7 w-7",r),n[4]=r,n[5]=a):a=n[5];let c;n[6]!==o||n[7]!==i?(c=f=>{o==null||o(f),i()},n[6]=o,n[7]=i,n[8]=c):c=n[8];let u,d;n[9]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(cg,{}),d=m.jsx("span",{className:"sr-only",children:"Toggle Sidebar"}),n[9]=u,n[10]=d):(u=n[9],d=n[10]);let l;return n[11]!==s||n[12]!==t||n[13]!==a||n[14]!==c?(l=m.jsxs(is,{ref:t,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:a,onClick:c,...s,children:[u,d]}),n[11]=s,n[12]=t,n[13]=a,n[14]=c,n[15]=l):l=n[15],l});_f.displayName="SidebarTrigger";const Zb=h.forwardRef((e,t)=>{const n=ee.c(10);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);const{toggleSidebar:s}=lo();let i;n[3]!==r?(i=ce("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",r),n[3]=r,n[4]=i):i=n[4];let a;return n[5]!==o||n[6]!==t||n[7]!==i||n[8]!==s?(a=m.jsx("button",{ref:t,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:s,title:"Toggle Sidebar",className:i,...o}),n[5]=o,n[6]=t,n[7]=i,n[8]=s,n[9]=a):a=n[9],a});Zb.displayName="SidebarRail";const xf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full flex-1 flex-col bg-background","md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("main",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});xf.displayName="SidebarInset";const Bb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Go,{ref:t,"data-sidebar":"input",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Bb.displayName="SidebarInput";const Sf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"header",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Sf.displayName="SidebarHeader";const Ef=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col gap-2 p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"footer",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Ef.displayName="SidebarFooter";const Hb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("mx-2 w-auto bg-sidebar-border",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(qo,{ref:t,"data-sidebar":"separator",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Hb.displayName="SidebarSeparator";const Cf=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Cf.displayName="SidebarContent";const Mo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("relative flex w-full min-w-0 flex-col p-2",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Mo.displayName="SidebarGroup";const xi=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"div";let c;n[4]!==r?(c=ce("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-label",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});xi.displayName="SidebarGroupLabel";const Wb=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,asChild:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const a=(s===void 0?!1:s)?xr:"button";let c;n[4]!==r?(c=ce("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",r),n[4]=r,n[5]=c):c=n[5];let u;return n[6]!==a||n[7]!==o||n[8]!==t||n[9]!==c?(u=m.jsx(a,{ref:t,"data-sidebar":"group-action",className:c,...o}),n[6]=a,n[7]=o,n[8]=t,n[9]=c,n[10]=u):u=n[10],u});Wb.displayName="SidebarGroupAction";const jo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("w-full text-sm",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"group-content",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});jo.displayName="SidebarGroupContent";const $o=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex w-full min-w-0 flex-col gap-1",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});$o.displayName="SidebarMenu";const zo=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("group/menu-item relative",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("li",{ref:t,"data-sidebar":"menu-item",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});zo.displayName="SidebarMenuItem";const Kb=so("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),Fo=h.forwardRef((e,t)=>{const n=ee.c(29);let r,o,s,i,a,c,u;n[0]!==e?({asChild:s,isActive:i,variant:a,size:c,tooltip:u,className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a,n[6]=c,n[7]=u):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5],c=n[6],u=n[7]);const d=s===void 0?!1:s,l=i===void 0?!1:i,f=a===void 0?"default":a,p=c===void 0?"default":c,v=d?xr:"button",{isMobile:g,state:w}=lo();let b;n[8]!==r||n[9]!==p||n[10]!==f?(b=ce(Kb({variant:f,size:p}),r),n[8]=r,n[9]=p,n[10]=f,n[11]=b):b=n[11];let x;n[12]!==v||n[13]!==l||n[14]!==o||n[15]!==t||n[16]!==p||n[17]!==b?(x=m.jsx(v,{ref:t,"data-sidebar":"menu-button","data-size":p,"data-active":l,className:b,...o}),n[12]=v,n[13]=l,n[14]=o,n[15]=t,n[16]=p,n[17]=b,n[18]=x):x=n[18];const _=x;if(!u)return _;if(typeof u=="string"){let T;n[19]!==u?(T={children:u},n[19]=u,n[20]=T):T=n[20],u=T}let C;n[21]!==_?(C=m.jsx(jb,{asChild:!0,children:_}),n[21]=_,n[22]=C):C=n[22];const S=w!=="collapsed"||g;let P;n[23]!==S||n[24]!==u?(P=m.jsx(vf,{side:"right",align:"center",hidden:S,...u}),n[23]=S,n[24]=u,n[25]=P):P=n[25];let R;return n[26]!==C||n[27]!==P?(R=m.jsxs(Mb,{children:[C,P]}),n[26]=C,n[27]=P,n[28]=R):R=n[28],R});Fo.displayName="SidebarMenuButton";const Gb=h.forwardRef((e,t)=>{const n=ee.c(13);let r,o,s,i;n[0]!==e?({className:r,asChild:s,showOnHover:i,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s===void 0?!1:s,c=i===void 0?!1:i,u=a?xr:"button",d=c&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0";let l;n[5]!==r||n[6]!==d?(l=ce("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",d,r),n[5]=r,n[6]=d,n[7]=l):l=n[7];let f;return n[8]!==u||n[9]!==o||n[10]!==t||n[11]!==l?(f=m.jsx(u,{ref:t,"data-sidebar":"menu-action",className:l,...o}),n[8]=u,n[9]=o,n[10]=t,n[11]=l,n[12]=f):f=n[12],f});Gb.displayName="SidebarMenuAction";const qb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,"data-sidebar":"menu-badge",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});qb.displayName="SidebarMenuBadge";const Qb=h.forwardRef((e,t)=>{const n=ee.c(15);let r,o,s;n[0]!==e?({className:r,showIcon:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?!1:s,a=`${Math.floor(Math.random()*40)+50}%`;let c;n[4]!==r?(c=ce("flex h-8 items-center gap-2 rounded-md px-2",r),n[4]=r,n[5]=c):c=n[5];let u;n[6]!==i?(u=i&&m.jsx(Dc,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),n[6]=i,n[7]=u):u=n[7];let d;n[8]===Symbol.for("react.memo_cache_sentinel")?(d={"--skeleton-width":a},n[8]=d):d=n[8];let l;n[9]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(Dc,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:d}),n[9]=l):l=n[9];let f;return n[10]!==o||n[11]!==t||n[12]!==c||n[13]!==u?(f=m.jsxs("div",{ref:t,"data-sidebar":"menu-skeleton",className:c,...o,children:[u,l]}),n[10]=o,n[11]=t,n[12]=c,n[13]=u,n[14]=f):f=n[14],f});Qb.displayName="SidebarMenuSkeleton";const Yb=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("ul",{ref:t,"data-sidebar":"menu-sub",className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Yb.displayName="SidebarMenuSub";const Jb=h.forwardRef((e,t)=>{const n=ee.c(5);let r;n[0]!==e?({...r}=e,n[0]=e,n[1]=r):r=n[1];let o;return n[2]!==r||n[3]!==t?(o=m.jsx("li",{ref:t,...r}),n[2]=r,n[3]=t,n[4]=o):o=n[4],o});Jb.displayName="SidebarMenuSubItem";const Xb=h.forwardRef((e,t)=>{const n=ee.c(17);let r,o,s,i,a;n[0]!==e?({asChild:i,size:a,isActive:o,className:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i,n[5]=a):(r=n[1],o=n[2],s=n[3],i=n[4],a=n[5]);const c=i===void 0?!1:i,u=a===void 0?"md":a,d=c?xr:"a",l=u==="sm"&&"text-xs",f=u==="md"&&"text-sm";let p;n[6]!==r||n[7]!==l||n[8]!==f?(p=ce("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",l,f,"group-data-[collapsible=icon]:hidden",r),n[6]=r,n[7]=l,n[8]=f,n[9]=p):p=n[9];let v;return n[10]!==d||n[11]!==o||n[12]!==s||n[13]!==t||n[14]!==u||n[15]!==p?(v=m.jsx(d,{ref:t,"data-sidebar":"menu-sub-button","data-size":u,"data-active":o,className:p,...s}),n[10]=d,n[11]=o,n[12]=s,n[13]=t,n[14]=u,n[15]=p,n[16]=v):v=n[16],v});Xb.displayName="SidebarMenuSubButton";function ew(e){return!e}function tw(e){return!e}var nw=Object.defineProperty,Qe=(e,t)=>nw(e,"name",{value:t,configurable:!0});function wa(e){const t=e+"CollectionProvider",[n,r]=nn(t),[o,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=Qe(g=>{const{scope:w,children:b}=g,x=h.useRef(null),_=h.useRef(new Map).current;return m.jsx(o,{scope:w,itemMap:_,collectionRef:x,children:b})},"CollectionProvider");i.displayName=t;const a=e+"CollectionSlot",c=Jt(a),u=h.forwardRef((g,w)=>{const{scope:b,children:x}=g,_=s(a,b),C=Te(w,_.collectionRef);return m.jsx(c,{ref:C,children:x})});u.displayName=a;const d=e+"CollectionItemSlot",l="data-radix-collection-item",f=Jt(d),p=h.forwardRef((g,w)=>{const{scope:b,children:x,..._}=g,C=h.useRef(null),S=Te(w,C),P=s(d,b);return h.useEffect(()=>(P.itemMap.set(C,{ref:C,..._}),()=>void P.itemMap.delete(C))),m.jsx(f,{[l]:"",ref:S,children:x})});p.displayName=d;function v(g){const w=s(e+"CollectionConsumer",g);return h.useCallback(()=>{const x=w.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${l}]`));return Array.from(w.itemMap.values()).sort((P,R)=>_.indexOf(P.ref.current)-_.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return Qe(v,"useCollection"),[{Provider:i,Slot:u,ItemSlot:p},v,r]}Qe(wa,"createCollection");var zc=new WeakMap,Ue,xt,So=(xt=class extends Map{constructor(n){super(n);ie(this,Ue);G(this,Ue,[...super.keys()]),zc.set(this,!0)}set(n,r){return zc.get(this)&&!this.has(n)&&E(this,Ue).push(n),super.set(n,r),this}insert(n,r,o){const s=this.has(r),i=s?this.size:this.size+1,a=_a(n),c=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(s?E(this,Ue).indexOf(r)===c:c===this.size)return this.set(r,o),this;const u=E(this,Ue).filter(l=>l!==r);u.splice(c,0,r);const d=u.map(l=>[l,l===r?o:this.get(l)]);this.clear();for(const[l,f]of d)this.set(l,f);return this}with(n,r,o){const s=new xt(this);return s.insert(n,r,o),s}before(n){const r=E(this,Ue).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,o){const s=E(this,Ue).indexOf(n);if(s===-1)return this;const i=E(this,Ue).indexOf(r),a=i!==-1&&i<s?s-1:s;return this.insert(a,r,o)}after(n){let r=E(this,Ue).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,o){const s=E(this,Ue).indexOf(n);if(s===-1)return this;const i=E(this,Ue).indexOf(r),a=i!==-1&&i<=s?s:s+1;return this.insert(a,r,o)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return G(this,Ue,[]),super.clear()}delete(n){const r=super.delete(n);return r&&E(this,Ue).splice(E(this,Ue).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=Lo(E(this,Ue),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=Lo(E(this,Ue),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return E(this,Ue).indexOf(n)}keyAt(n){return Lo(E(this,Ue),n)}from(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const o=this.indexOf(n);if(o===-1)return;let s=o+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return s;o++}}findIndex(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return o;o++}return-1}filter(n,r){const o=[];let s=0;for(const i of this)Reflect.apply(n,r,[i,s,this])&&o.push(i),s++;return new xt(o)}map(n,r){const o=[];let s=0;for(const i of this)o.push([i[0],Reflect.apply(n,r,[i,s,this])]),s++;return new xt(o)}reduce(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=0,a=o;for(const c of this)i===0&&!s?a=c:a=Reflect.apply(r,this,[a,c,i,this]),i++;return a}reduceRight(...n){const[r,o]=n,s=n.length>1;if(!s&&this.size===0)throw new TypeError("Reduce of empty OrderedDict with no initial value");let i=o;for(let a=this.size-1;a>=0;a--){const c=this.entryAt(a);a===this.size-1&&!s?i=c:i=Reflect.apply(r,this,[i,c,a,this])}return i}sort(n){if(typeof n!="function")throw new TypeError("OrderedDict.sort requires a compare function");const r=[...this.entries()].sort(n);this.clear();for(const[o,s]of r)this.set(o,s);return this}toSorted(n){if(typeof n!="function")throw new TypeError("OrderedDict.toSorted requires a compare function");const r=[...this.entries()].sort(n);return new xt(r)}toReversed(){const n=new xt;for(let r=this.size-1;r>=0;r--){const o=this.keyAt(r),s=this.get(o);n.set(o,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new xt(r)}slice(n,r){const o=new xt;for(const s of E(this,Ue).slice(n,r))o.set(s,this.get(s));return o}every(n,r){let o=0;for(const s of this){if(!Reflect.apply(n,r,[s,o,this]))return!1;o++}return!0}some(n,r){let o=0;for(const s of this){if(Reflect.apply(n,r,[s,o,this]))return!0;o++}return!1}},Ue=new WeakMap,Qe(xt,"OrderedDict"),xt);function Lo(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=kf(e,t);return n===-1?void 0:e[n]}Qe(Lo,"at");function kf(e,t){const n=e.length,r=_a(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}Qe(kf,"toSafeIndex");function _a(e){return e!==e||e===0?0:Math.trunc(e)}Qe(_a,"toSafeInteger");function rw(e){const t=e+"CollectionProvider",[n,r]=nn(t),[o,s]=n(t);o.displayName=e+"CollectionStableContextProvider";const[i,a]=n(t);i.displayName=e+"CollectionStatefulContextProvider";const c=Qe(({state:P,...R})=>P?m.jsx(d,{...R,state:P}):m.jsx(u,{...R}),"CollectionProvider");c.displayName=t;const u=Qe(P=>{const R=x();return m.jsx(d,{...P,state:R})},"CollectionInit");u.displayName=e+"CollectionInit";const d=Qe(P=>{const{scope:R,children:T,state:A}=P,j=h.useRef(null),[F,z]=h.useState(null),Y=Te(j,z),[Z,K]=A,H=h.useRef(new So),J=h.useCallback(()=>{const ne=H.current;return Rf(ne)||ne.sort(Vo),ne},[]);return h.useEffect(()=>{if(!F)return;const ne=Tf(()=>{K(te=>{const X=te.toSorted(Vo);return X.some(([me],he)=>te.keyAt(he)!==me)?X:te})});return ne.observe(F,{childList:!0,subtree:!0}),()=>{ne.disconnect()}},[F,K]),m.jsx(o,{scope:R,collectionElementRef:Y,collectionElementRefObject:j,getCollection:J,setCollection:K,registryRef:H,children:m.jsx(i,{scope:R,collectionElement:F,collection:Z,children:T})})},"CollectionProviderImpl");d.displayName=e+"CollectionProviderImpl";const l=e+"CollectionSlot",f=Jt(l),p=h.forwardRef((P,R)=>{const{scope:T,children:A}=P,j=s(l,T),F=Te(R,j.collectionElementRef);return m.jsx(f,{ref:F,children:A})});p.displayName=l;const v=e+"CollectionItemSlot",g="data-radix-collection-item",w=Jt(v),b=h.forwardRef((P,R)=>{const{scope:T,children:A,...j}=P,F=h.useRef(null),z=s(v,T),{setCollection:Y,registryRef:Z}=z,K=h.useRef(j);Of(K.current,j)||(K.current=j);const H=K.current,J=h.useCallback(X=>{const q=Z.current;X?q.set(X,{...K.current,element:X}):F.current&&q.delete(F.current)},[Z]),ne=Te(R,J,F);ct(()=>{const X=F.current,q=Z.current;X&&q.has(X)&&q.set(X,{...H,element:X})},[H,Z]);const te=h.useRef(null);return h.useEffect(()=>{const X=F.current,q=te.current;((q==null?void 0:q.element)??null)===X&&(!X||(q==null?void 0:q.itemData)===H)||(te.current=X?{element:X,itemData:H}:null,Y(me=>{const he=new So(me);return q&&q.element!==X&&he.delete(q.element),X&&he.set(X,{...H,element:X}),he.sort(Vo)}))}),h.useEffect(()=>()=>{const X=te.current;te.current=null,X&&Y(q=>{if(!q.has(X.element))return q;const me=new So(q);return me.delete(X.element),me})},[Y]),m.jsx(w,{[g]:"",ref:ne,children:A})});b.displayName=v;function x(){return h.useState(new So)}Qe(x,"useInitCollection");function _(P){const{collection:R}=a(e+"CollectionConsumer",P);return R}Qe(_,"useCollection");function C(P){const{getCollection:R}=s(e+"CollectionConsumer",P);return R}return Qe(C,"useGetCollection"),[{Provider:c,Slot:p,ItemSlot:b},{createCollectionScope:r,useCollection:_,useGetCollection:C,useInitCollection:x}]}Qe(rw,"createCollection");function Of(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||e[o]!==t[o])return!1;return!0}Qe(Of,"shallowEqual");function Pf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Qe(Pf,"isElementPreceding");function Rf(e){let t;for(const n of e.keys()){if(t){const r=t.compareDocumentPosition(n);if(!(r&Node.DOCUMENT_POSITION_DISCONNECTED)&&r&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}Qe(Rf,"isInDocumentOrder");function Vo(e,t){return!e[1].element||!t[1].element?0:Pf(e[1].element,t[1].element)?-1:1}Qe(Vo,"sortByDocumentPosition");function Tf(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Qe(Tf,"getChildListObserver");var ow=Object.defineProperty,sw=(e,t)=>ow(e,"name",{value:t,configurable:!0}),iw={LTR:"ltr"},aw=h.createContext(void 0);function xa(e){const t=h.useContext(aw);return e||t||iw.LTR}sw(xa,"useDirection");var cw=Object.defineProperty,Sa=(e,t)=>cw(e,"name",{value:t,configurable:!0}),$s=!1;function If(){const[e,t]=h.useState($s);return h.useEffect(()=>{$s||($s=!0,t(!0))},[]),e}Sa(If,"useIsHydrated");var Af=Bn[" useSyncExternalStore ".trim().toString()];function Nf(){return()=>{}}Sa(Nf,"subscribe");function Df(){return Af(Nf,()=>!0,()=>!1)}Sa(Df,"useIsHydratedModern");var lw=typeof Af=="function"?Df:If,uw=Object.defineProperty,Hn=(e,t)=>uw(e,"name",{value:t,configurable:!0}),zs="rovingFocusGroup.onEntryFocus",dw={bubbles:!1,cancelable:!0},fs="RovingFocusGroup",[Si,Mf,fw]=wa(fs),[hw,jf]=nn(fs,[fw]),Fc={Vertical:"vertical",Horizontal:"horizontal"},pw={RTL:"rtl"},[mw,gw]=hw(fs),vw=h.forwardRef(Hn(function(t,n){return m.jsx(Si.Provider,{scope:t.__scopeRovingFocusGroup,children:m.jsx(Si.Slot,{scope:t.__scopeRovingFocusGroup,children:m.jsx(yw,{...t,ref:n})})})},"RovingFocusGroup")),yw=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:l=!1,...f}=t,p=h.useRef(null),v=Te(n,p),g=xa(i),[w,b]=ao({prop:a,defaultProp:c??null,onChange:u,caller:fs}),[x,_]=h.useState(!1),C=Xt(d),S=Mf(r),P=h.useRef(!1),[R,T]=h.useState(0);return h.useEffect(()=>{const A=p.current;if(A)return A.addEventListener(zs,C),()=>A.removeEventListener(zs,C)},[C]),m.jsx(mw,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:w,onItemFocus:h.useCallback(A=>b(A),[b]),onItemShiftTab:h.useCallback(()=>_(!0),[]),onFocusableItemAdd:h.useCallback(()=>T(A=>A+1),[]),onFocusableItemRemove:h.useCallback(()=>T(A=>A-1),[]),children:m.jsx(Ze.div,{tabIndex:x||R===0?-1:0,"data-orientation":o,...f,ref:v,style:{outline:"none",...t.style},onMouseDown:de(t.onMouseDown,()=>{P.current=!0}),onFocus:de(t.onFocus,A=>{const j=!P.current;if(A.target===A.currentTarget&&j&&!x){const F=new CustomEvent(zs,dw);if(A.currentTarget.dispatchEvent(F),!F.defaultPrevented){const z=S().filter(J=>J.focusable),Y=z.find(J=>J.active),Z=z.find(J=>J.id===w),H=[Y,Z,...z].filter(Boolean).map(J=>J.ref.current);Ea(H,l)}}P.current=!1}),onBlur:de(t.onBlur,()=>_(!1))})})},"RovingFocusGroupImpl")),bw="RovingFocusGroupItem",ww=h.forwardRef(Hn(function(t,n){const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:i,children:a,...c}=t,u=En(),d=i||u,l=gw(bw,r),f=l.currentTabStopId===d,p=Mf(r),{onFocusableItemAdd:v,onFocusableItemRemove:g,currentTabStopId:w}=l,b=lw();return ct(()=>{if(!(!b||!o))return v(),()=>g()},[b,o,v,g]),h.useEffect(()=>{if(!(b||!o))return v(),()=>g()},[b,o,v,g]),m.jsx(Si.ItemSlot,{scope:r,id:d,focusable:o,active:s,children:m.jsx(Ze.span,{tabIndex:f?0:-1,"data-orientation":l.orientation,...c,ref:n,onMouseDown:de(t.onMouseDown,x=>{o?l.onItemFocus(d):x.preventDefault()}),onFocus:de(t.onFocus,()=>l.onItemFocus(d)),onKeyDown:de(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){l.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const _=zf(x,l.orientation,l.dir);if(_!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=p().filter(P=>P.focusable).map(P=>P.ref.current);if(_==="last")S.reverse();else if(_==="prev"||_==="next"){_==="prev"&&S.reverse();const P=S.indexOf(x.currentTarget);S=l.loop?Ff(S,P+1):S.slice(P+1)}setTimeout(()=>Ea(S))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:w!=null}):a})})},"RovingFocusGroupItem")),_w={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $f(e,t){return t!==pw.RTL?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}Hn($f,"getDirectionAwareKey");function zf(e,t,n){const r=$f(e.key,n);if(!(t===Fc.Vertical&&["ArrowLeft","ArrowRight"].includes(r))&&!(t===Fc.Horizontal&&["ArrowUp","ArrowDown"].includes(r)))return _w[r]}Hn(zf,"getFocusIntent");function Ea(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Hn(Ea,"focusFirst");function Ff(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Hn(Ff,"wrapArray");var xw=Object.defineProperty,xe=(e,t)=>xw(e,"name",{value:t,configurable:!0}),Sw={RTL:"rtl"},Ei=["Enter"," "],Ew=["ArrowDown","PageUp","Home"],Lf=["ArrowUp","PageDown","End"],Cw=[...Ew,...Lf],kw={ltr:[...Ei,"ArrowRight"],rtl:[...Ei,"ArrowLeft"]},Ow={ltr:["ArrowLeft"],rtl:["ArrowRight"]},hs="Menu",[qr,Pw,Rw]=wa(hs),[Wn,Vf]=nn(hs,[Rw,us,jf]),Ca=us(),Uf=jf(),[Tw,Kn]=Wn(hs),[Iw,uo]=Wn(hs),Aw=xe(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:s,modal:i=!0}=e,a=Ca(t),[c,u]=h.useState(null),d=h.useRef(!1),l=Xt(s),f=xa(o);return h.useEffect(()=>{const p=xe(()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=xe(()=>d.current=!1,"handlePointer");return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),h.useEffect(()=>{if(!n)return;const p=xe(()=>l(!1),"handleBlur");return window.addEventListener("blur",p),()=>window.removeEventListener("blur",p)},[n,l]),m.jsx(tf,{...a,children:m.jsx(Tw,{scope:t,open:n,onOpenChange:l,content:c,onContentChange:u,children:m.jsx(Iw,{scope:t,onClose:h.useCallback(()=>l(!1),[l]),isUsingKeyboardRef:d,dir:f,modal:i,children:r})})})},"Menu"),Zf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t,s=Ca(r);return m.jsx(nf,{...s,...o,ref:n})},"MenuAnchor")),Bf="MenuPortal",[Nw,Hf]=Wn(Bf,{forceMount:void 0}),Dw=xe(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,s=Kn(Bf,t);return m.jsx(Nw,{scope:t,forceMount:n,children:m.jsx(rn,{present:n||s.open,children:m.jsx(ha,{asChild:!0,container:o,children:r})})})},"MenuPortal"),Mt="MenuContent",[Mw,ka]=Wn(Mt),jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,...s}=t,i=Kn(Mt,t.__scopeMenu),a=uo(Mt,t.__scopeMenu);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(rn,{present:o||i.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:a.modal?m.jsx($w,{...s,ref:n}):m.jsx(zw,{...s,ref:n})})})})},"MenuContent")),$w=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu),o=h.useRef(null),s=Te(n,o);return h.useEffect(()=>{const i=o.current;if(i)return jd(i)},[]),m.jsx(Oa,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:de(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),zw=h.forwardRef(xe(function(t,n){const r=Kn(Mt,t.__scopeMenu);return m.jsx(Oa,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),Fw=Jt("MenuContent.ScrollLock"),Oa=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,disableOutsideScroll:g,...w}=t,b=Kn(Mt,r),x=uo(Mt,r),_=Ca(r),C=Uf(r),S=Pw(r),[P,R]=h.useState(null),T=h.useRef(null),[A,j]=h.useState(null);da(A);const{nodes:F,registry:z}=ua(),Y=!!(s||g),Z=Te(n,T,b.onContentChange,j),K=h.useRef(0),H=h.useRef(""),J=h.useRef(0),ne=h.useRef(null),te=h.useRef("right"),X=h.useRef(0),q=h.useMemo(()=>g?[T,...F.map(B=>({current:B}))]:[],[T,F,g]),me=g?ma:h.Fragment,he=g?{as:Fw,allowPinchZoom:!0,shards:q}:void 0,ae=xe(B=>{var kt,lt;const se=H.current+B,ye=S().filter(Le=>!Le.disabled),le=document.activeElement,Pe=(kt=ye.find(Le=>Le.ref.current===le))==null?void 0:kt.textValue,je=ye.map(Le=>Le.textValue),Ee=Jf(je,se,Pe),$e=(lt=ye.find(Le=>Le.textValue===Ee))==null?void 0:lt.ref.current;function We(Le){H.current=Le,window.clearTimeout(K.current),Le!==""&&(K.current=window.setTimeout(()=>We(""),1e3))}xe(We,"updateSearch"),We(se),$e&&setTimeout(()=>$e.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(K.current),[]),as();const re=h.useCallback(B=>{var ye,le;return te.current===((ye=ne.current)==null?void 0:ye.side)&&eh(B,(le=ne.current)==null?void 0:le.area)},[]);return m.jsx(Mw,{scope:r,searchRef:H,onItemEnter:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),onItemLeave:h.useCallback(B=>{var se;re(B)||((se=T.current)==null||se.focus(),R(null))},[re]),onTriggerLeave:h.useCallback(B=>{re(B)&&B.preventDefault()},[re]),pointerGraceTimerRef:J,onPointerGraceIntentChange:h.useCallback(B=>{ne.current=B},[]),children:m.jsx(la,{registry:Y?z:null,children:m.jsx(me,{...he,children:m.jsx(gd,{asChild:!0,trapped:s,branches:F,onMountAutoFocus:de(i,B=>{var se;B.preventDefault(),(se=T.current)==null||se.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:m.jsx(aa,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:l,onFocusOutside:f,onInteractOutside:p,onDismiss:v,children:m.jsx(vw,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:P,onCurrentTabStopIdChange:R,onEntryFocus:de(u,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:m.jsx(of,{role:"menu","aria-orientation":"vertical","data-state":Ra(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...w,ref:Z,style:{outline:"none",...w.style},onKeyDown:de(w.onKeyDown,B=>{const ye=B.target.closest("[data-radix-menu-content]")===B.currentTarget,le=B.ctrlKey||B.altKey||B.metaKey,Pe=B.key.length===1;ye&&(B.key==="Tab"&&B.preventDefault(),!le&&Pe&&ae(B.key));const je=T.current;if(B.target!==je||!Cw.includes(B.key))return;B.preventDefault();const $e=S().filter(We=>!We.disabled).map(We=>We.ref.current);Lf.includes(B.key)&&$e.reverse(),Qf($e)}),onBlur:de(t.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(K.current),H.current="")}),onPointerMove:de(t.onPointerMove,yr(B=>{const se=B.target,ye=X.current!==B.clientX;if(B.currentTarget.contains(se)&&ye){const le=B.clientX>X.current?"right":"left";te.current=le,X.current=B.clientX}}))})})})})})})})},"MenuContentImpl")),Lw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{...o,ref:n})},"MenuLabel")),Ci="MenuItem",Lc="menu.itemSelect",Pa=h.forwardRef(xe(function(t,n){const{disabled:r=!1,onSelect:o,...s}=t,i=h.useRef(null),a=uo(Ci,t.__scopeMenu),c=ka(Ci,t.__scopeMenu),u=Te(n,i),d=h.useRef(!1),l=xe(()=>{const f=i.current;if(!r&&f){const p=new CustomEvent(Lc,{bubbles:!0,cancelable:!0});f.addEventListener(Lc,v=>o==null?void 0:o(v),{once:!0}),sa(f,p),p.defaultPrevented?d.current=!1:a.onClose()}},"handleSelect");return m.jsx(Wf,{...s,ref:u,disabled:r,onClick:de(t.onClick,l),onPointerDown:f=>{var p;(p=t.onPointerDown)==null||p.call(t,f),d.current=!0},onPointerUp:de(t.onPointerUp,f=>{var p;d.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:de(t.onKeyDown,f=>{r||f.target!==f.currentTarget||c.searchRef.current!==""&&f.key===" "||Ei.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})},"MenuItem")),Wf=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,disabled:o=!1,textValue:s,...i}=t,a=ka(Ci,r),c=Uf(r),u=h.useRef(null),d=Te(n,u),[l,f]=h.useState(!1),[p,v]=h.useState("");return h.useEffect(()=>{const g=u.current;g&&v((g.textContent??"").trim())},[i.children]),m.jsx(qr.ItemSlot,{scope:r,disabled:o,textValue:s??p,children:m.jsx(ww,{asChild:!0,...c,focusable:!o,children:m.jsx(Ze.div,{role:"menuitem","data-highlighted":l?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:de(t.onPointerMove,yr(g=>{o?a.onItemLeave(g):(a.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:de(t.onPointerLeave,yr(g=>a.onItemLeave(g))),onFocus:de(t.onFocus,()=>f(!0)),onBlur:de(t.onBlur,()=>f(!1))})})})},"MenuItemImpl")),Vw=h.forwardRef(xe(function(t,n){const{checked:r=!1,onCheckedChange:o,...s}=t;return m.jsx(Gf,{scope:t.__scopeMenu,checked:r,children:m.jsx(Pa,{role:"menuitemcheckbox","aria-checked":Qr(r)?"mixed":r,...s,ref:n,"data-state":ps(r),onSelect:de(s.onSelect,()=>o==null?void 0:o(Qr(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),Uw="MenuRadioGroup",[R2,Zw]=Wn(Uw,{value:void 0,onValueChange:xe(()=>{},"onValueChange")}),Bw="MenuRadioItem",Hw=h.forwardRef(xe(function(t,n){const{value:r,...o}=t,s=Zw(Bw,t.__scopeMenu),i=r===s.value;return m.jsx(Gf,{scope:t.__scopeMenu,checked:i,children:m.jsx(Pa,{role:"menuitemradio","aria-checked":i,...o,ref:n,"data-state":ps(i),onSelect:de(o.onSelect,()=>{var a;return(a=s.onValueChange)==null?void 0:a.call(s,r)},{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),Kf="MenuItemIndicator",[Gf,Ww]=Wn(Kf,{checked:!1}),Kw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,forceMount:o,...s}=t,i=Ww(Kf,r);return m.jsx(rn,{present:o||Qr(i.checked)||i.checked===!0,children:m.jsx(Ze.span,{...s,ref:n,"data-state":ps(i.checked)})})},"MenuItemIndicator")),Gw=h.forwardRef(xe(function(t,n){const{__scopeMenu:r,...o}=t;return m.jsx(Ze.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})},"MenuSeparator")),qw="MenuSub",[T2,qf]=Wn(qw),Eo="MenuSubTrigger",Qw=h.forwardRef(xe(function(t,n){const r=Kn(Eo,t.__scopeMenu),o=uo(Eo,t.__scopeMenu),s=qf(Eo,t.__scopeMenu),i=ka(Eo,t.__scopeMenu),a=h.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:t.__scopeMenu},l=h.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);h.useEffect(()=>l,[l]),h.useEffect(()=>{const p=c.current;return()=>{window.clearTimeout(p),u(null)}},[c,u]);const f=Te(n,s.onTriggerChange);return m.jsx(Zf,{asChild:!0,...d,children:m.jsx(Wf,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":Ra(r.open),...t,ref:f,onClick:p=>{var v;(v=t.onClick)==null||v.call(t,p),!(t.disabled||p.defaultPrevented)&&(p.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:de(t.onPointerMove,yr(p=>{i.onItemEnter(p),!p.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),l()},100))})),onPointerLeave:de(t.onPointerLeave,yr(p=>{var g,w;l();const v=(g=r.content)==null?void 0:g.getBoundingClientRect();if(v){const b=(w=r.content)==null?void 0:w.dataset.side,x=b==="right",_=x?-5:5,C=v[x?"left":"right"],S=v[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:p.clientX+_,y:p.clientY},{x:C,y:v.top},{x:S,y:v.top},{x:S,y:v.bottom},{x:C,y:v.bottom}],side:b}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(p),p.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:de(t.onKeyDown,p=>{var g;t.disabled||p.target!==p.currentTarget||i.searchRef.current!==""&&p.key===" "||kw[o.dir].includes(p.key)&&(r.onOpenChange(!0),(g=r.content)==null||g.focus(),p.preventDefault())})})})},"MenuSubTrigger")),Yw="MenuSubContent",Jw=h.forwardRef(xe(function(t,n){const r=Hf(Mt,t.__scopeMenu),{forceMount:o=r.forceMount,align:s="start",...i}=t,a=Kn(Mt,t.__scopeMenu),c=uo(Mt,t.__scopeMenu),u=qf(Yw,t.__scopeMenu),d=h.useRef(null),l=Te(n,d);return m.jsx(qr.Provider,{scope:t.__scopeMenu,children:m.jsx(rn,{present:o||a.open,children:m.jsx(qr.Slot,{scope:t.__scopeMenu,children:m.jsx(Oa,{id:u.contentId,"aria-labelledby":u.triggerId,...i,ref:l,align:s,side:c.dir===Sw.RTL?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{var p;c.isUsingKeyboardRef.current&&((p=d.current)==null||p.focus()),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:de(t.onFocusOutside,f=>{f.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:de(t.onEscapeKeyDown,f=>{c.onClose(),f.preventDefault()}),onKeyDown:de(t.onKeyDown,f=>{var g;const p=f.currentTarget.contains(f.target),v=Ow[c.dir].includes(f.key);p&&v&&(a.onOpenChange(!1),(g=u.trigger)==null||g.focus(),f.preventDefault())})})})})})},"MenuSubContent"));function Ra(e){return e?"open":"closed"}xe(Ra,"getOpenState");function Qr(e){return e==="indeterminate"}xe(Qr,"isIndeterminate");function ps(e){return Qr(e)?"indeterminate":e?"checked":"unchecked"}xe(ps,"getCheckedState");function Qf(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}xe(Qf,"focusFirst");function Yf(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xe(Yf,"wrapArray");function Jf(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let i=Yf(e,Math.max(s,0));o.length===1&&(i=i.filter(u=>u!==n));const c=i.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}xe(Jf,"getNextMatch");function Xf(e,t){const{x:n,y:r}=e;let o=!1;for(let s=0,i=t.length-1;s<t.length;i=s++){const a=t[s],c=t[i],u=a.x,d=a.y,l=c.x,f=c.y;d>r!=f>r&&n<(l-u)*(r-d)/(f-d)+u&&(o=!o)}return o}xe(Xf,"isPointInPolygon");function eh(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Xf(n,t)}xe(eh,"isPointerInGraceArea");function yr(e){return t=>t.pointerType==="mouse"?e(t):void 0}xe(yr,"whenMouse");var Xw=Object.defineProperty,Tt=(e,t)=>Xw(e,"name",{value:t,configurable:!0}),Ta="DropdownMenu",[e0,I2]=nn(Ta,[Vf]),It=Vf(),[t0,th]=e0(Ta),n0=Tt(e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:s,onOpenChange:i,modal:a=!0}=e,c=It(t),u=h.useRef(null),[d,l]=ao({prop:o,defaultProp:s??!1,onChange:i,caller:Ta});return m.jsx(t0,{scope:t,triggerId:En(),triggerRef:u,contentId:En(),open:d,onOpenChange:l,onOpenToggle:h.useCallback(()=>l(f=>!f),[l]),modal:a,children:m.jsx(Aw,{...c,open:d,onOpenChange:l,dir:r,modal:a,children:n})})},"DropdownMenu"),r0="DropdownMenuTrigger",o0=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,disabled:o=!1,...s}=t,i=th(r0,r),a=It(r),c=Te(n,i.triggerRef);return m.jsx(Zf,{asChild:!0,...a,children:m.jsx(Ze.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...s,ref:c,onPointerDown:de(t.onPointerDown,u=>{!o&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:de(t.onKeyDown,u=>{o||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})},"DropdownMenuTrigger")),s0=Tt(e=>{const{__scopeDropdownMenu:t,...n}=e,r=It(t);return m.jsx(Dw,{...r,...n})},"DropdownMenuPortal"),i0="DropdownMenuContent",nh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=th(i0,r),i=It(r),a=h.useRef(!1);return m.jsx(jw,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...o,ref:n,onCloseAutoFocus:de(t.onCloseAutoFocus,c=>{var u;a.current||(u=s.triggerRef.current)==null||u.focus(),a.current=!1,c.preventDefault()}),onInteractOutside:de(t.onInteractOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,l=u.button===2||d;(!s.modal||l)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),rh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Lw,{...s,...o,ref:n})},"DropdownMenuLabel")),oh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Pa,{...s,...o,ref:n})},"DropdownMenuItem")),sh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Vw,{...s,...o,ref:n})},"DropdownMenuCheckboxItem")),ih=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Hw,{...s,...o,ref:n})},"DropdownMenuRadioItem")),ah=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Kw,{...s,...o,ref:n})},"DropdownMenuItemIndicator")),ch=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Gw,{...s,...o,ref:n})},"DropdownMenuSeparator")),lh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Qw,{...s,...o,ref:n})},"DropdownMenuSubTrigger")),uh=h.forwardRef(Tt(function(t,n){const{__scopeDropdownMenu:r,...o}=t,s=It(r);return m.jsx(Jw,{...s,...o,ref:n,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuSubContent"));const a0=n0,c0=o0,l0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:o,inset:s,children:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);const a=s&&"pl-8";let c;n[5]!==o||n[6]!==a?(c=ce("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",a,o),n[5]=o,n[6]=a,n[7]=c):c=n[7];let u;n[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(Ym,{className:"ml-auto"}),n[8]=u):u=n[8];let d;return n[9]!==r||n[10]!==i||n[11]!==t||n[12]!==c?(d=m.jsxs(lh,{ref:t,className:c,...i,children:[r,u]}),n[9]=r,n[10]=i,n[11]=t,n[12]=c,n[13]=d):d=n[13],d});l0.displayName=lh.displayName;const u0=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(uh,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});u0.displayName=uh.displayName;const dh=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,sideOffset:s,...o}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=s===void 0?4:s;let a;n[4]!==r?(a=ce("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",r),n[4]=r,n[5]=a):a=n[5];let c;return n[6]!==o||n[7]!==t||n[8]!==i||n[9]!==a?(c=m.jsx(s0,{children:m.jsx(nh,{ref:t,sideOffset:i,className:a,...o})}),n[6]=o,n[7]=t,n[8]=i,n[9]=a,n[10]=c):c=n[10],c});dh.displayName=nh.displayName;const ki=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(oh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});ki.displayName=oh.displayName;const d0=h.forwardRef((e,t)=>{const n=ee.c(14);let r,o,s,i;n[0]!==e?({className:s,children:o,checked:r,...i}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s,n[4]=i):(r=n[1],o=n[2],s=n[3],i=n[4]);let a;n[5]!==s?(a=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),n[5]=s,n[6]=a):a=n[6];let c;n[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Qm,{className:"h-4 w-4"})})}),n[7]=c):c=n[7];let u;return n[8]!==r||n[9]!==o||n[10]!==i||n[11]!==t||n[12]!==a?(u=m.jsxs(sh,{ref:t,className:a,checked:r,...i,children:[c,o]}),n[8]=r,n[9]=o,n[10]=i,n[11]=t,n[12]=a,n[13]=u):u=n[13],u});d0.displayName=sh.displayName;const f0=h.forwardRef((e,t)=>{const n=ee.c(12);let r,o,s;n[0]!==e?({className:o,children:r,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==o?(i=ce("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),n[4]=o,n[5]=i):i=n[5];let a;n[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(ah,{children:m.jsx(Xm,{className:"h-2 w-2 fill-current"})})}),n[6]=a):a=n[6];let c;return n[7]!==r||n[8]!==s||n[9]!==t||n[10]!==i?(c=m.jsxs(ih,{ref:t,className:i,...s,children:[a,r]}),n[7]=r,n[8]=s,n[9]=t,n[10]=i,n[11]=c):c=n[11],c});f0.displayName=ih.displayName;const h0=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,inset:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);const i=o&&"pl-8";let a;n[4]!==r||n[5]!==i?(a=ce("px-2 py-1.5 text-sm font-semibold",i,r),n[4]=r,n[5]=i,n[6]=a):a=n[6];let c;return n[7]!==s||n[8]!==t||n[9]!==a?(c=m.jsx(rh,{ref:t,className:a,...s}),n[7]=s,n[8]=t,n[9]=a,n[10]=c):c=n[10],c});h0.displayName=rh.displayName;const fh=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("-mx-1 my-1 h-px bg-muted",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(ch,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});fh.displayName=ch.displayName;const p0=1,m0=1,g0=2,Vc=9;function v0(e,t){const n=new DataView(e),r=[];let o=0;for(;o+Vc<=e.byteLength;){const s=n.getUint8(o),i=n.getUint32(o+1),a=n.getUint32(o+5),c=o+Vc;if(c+a>e.byteLength)break;if(s===m0)r.push({kind:"frame",ms:i,chunk:t,data:e.slice(c,c+a)});else if(s===g0)try{r.push({kind:"event",ms:i,chunk:t,event:JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,a)))})}catch{}o=c+a}return r}function A2(e,t){const n=[...e.chunks].sort((f,p)=>f.seq-p.seq),r=[],o=[];n.forEach((f,p)=>{o.push(r.length),f.offset+f.length<=t.byteLength&&r.push(...v0(t.slice(f.offset,f.offset+f.length),p))});const s=r.length>0?r[r.length-1].ms:0,i=[],a=new Set(e.gaps);n.forEach((f,p)=>{const v=n[p+1];if(v&&v.seq!==f.seq+1){const g=r[(o[p+1]??r.length)-1];i.push({fromMs:(g==null?void 0:g.ms)??f.startMs,toMs:v.startMs})}}),n.length>0&&[...a].some(f=>f<n[0].seq)&&i.unshift({fromMs:0,toMs:n[0].startMs});const c=n.length>0?n[n.length-1].seq:-1;[...a].some(f=>f>c)&&i.push({fromMs:s,toMs:s});const d=r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="start"?[{index:f.event.index,name:f.event.name,ms:f.ms}]:[]),l=new Map(r.flatMap(f=>f.kind==="event"&&f.event.type==="step"&&f.event.phase==="end"?[[f.event.index,f.event]]:[]));return{meta:e.meta,records:r,chunkStarts:o,chunks:n,durationMs:s,gaps:i,steps:d.map(f=>{const p=l.get(f.index);return p?{...f,name:p.name||f.name,...p.status?{status:p.status}:{}}:f})}}function N2(e,t){const n=e.chunks;let r=-1;n.forEach((o,s)=>{o.startMs<=t&&(r=s)});for(let o=r;o>=0;o--){if(n[o].keyframe)return o;if(o>0&&n[o].seq!==n[o-1].seq+1)break}return n.findIndex((o,s)=>s>r&&o.keyframe)}function D2(e,t){let n;for(const r of e.records)if(!(r.kind!=="event"||r.event.type!=="chrome")){if(r.ms>t&&n!==void 0)break;n=r.event.payload}return n??null}function M2(e,t){const n=Math.max(150,e.durationMs*.02);let r=null;for(const o of e.steps){const s=Math.abs(o.ms-t);s<=n&&(!r||s<r.d)&&(r={ms:o.ms,d:s})}return r?r.ms:t}function j2(e){const t=Math.max(0,Math.floor(e/1e3));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function $2(e){return e.notRecorded==="jpeg"?"No video: this device streamed JPEG, which is not kept. The agent sends H.264 unless TAPFLOW_IOS_CODEC=jpeg is set.":e.notRecorded==="no-keyframe"?"No video: the device's stream gave no frame a video could start from.":e.notRecorded?"No video for this flow.":e.evicted?"Video no longer kept: removed by the retention policy, or to make room when video storage was full.":null}function z2(e){switch(e){case"size-limit":return"The video stops early: it reached the 100 MB limit for one flow.";case"storage-full":return"The video stops early: the relay's storage for videos was full.";case"cancelled":return"The run was cancelled here.";case"runner-lost":return"The video stops where the runner disconnected.";case"truncated":return"The end of this video did not reach the relay.";default:return null}}const Oi="";async function Co(e,t,n,r){const o=await fetch(`${Oi}${t}`,{method:e,credentials:"include",headers:{"Content-Type":"application/json",...r},body:n!=null?JSON.stringify(n):void 0});if(o.status===204)return{data:null,status:204};const s=await o.json().catch(()=>null);return o.ok?{data:s,status:o.status}:{data:null,status:o.status,error:(s==null?void 0:s.error)??"Request failed"}}const hh={get:e=>Co("GET",e),post:(e,t)=>Co("POST",e,t),patch:(e,t)=>Co("PATCH",e,t),delete:e=>Co("DELETE",e),upload:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"POST",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}},uploadPatch:async(e,t)=>{const n=await fetch(`${Oi}${e}`,{method:"PATCH",credentials:"include",body:t});if(n.status===204)return{data:null,status:204};const r=await n.json().catch(()=>null);return n.ok?{data:r,status:n.status}:{data:null,status:n.status,error:(r==null?void 0:r.error)??"Upload failed"}}},Qo={authStatus:["auth","status"],me:["auth","me"],inviteToken:e=>["invitations","verify",e],resetToken:e=>["auth","reset-password",e],apps:["apps"],settings:["settings"],tokens:["tokens"],teamMembers:["team","members"],comments:e=>["comments",e],allRecordings:["recordings"],recordings:e=>["recordings",e],agents:["agents"],resourceHistory:(e,t)=>["agents",e,"resources",t],runs:e=>["runs","list",e],run:e=>["runs","detail",e],runVideo:(e,t)=>["runs","video",e,t],anyRun:["runs","any"]};async function y0(){const e=await fetch("/api/v1/auth/status");if(!e.ok)throw new Error(`GET /api/v1/auth/status failed with ${e.status}`);return e.json()}async function b0(){const{data:e,status:t}=await hh.get("/api/v1/auth/me");if(t===401)return null;if(!e)throw new Error(`GET /api/v1/auth/me failed with ${t}`);return e}async function F2(e){const t=await fetch(`/api/v1/invitations/verify?token=${e}`);if(!t.ok)throw new Error(`invitation refused with ${t.status}`);return t.json()}async function Cr(e){const t=await fetch(e,{credentials:"include"});if(!t.ok)throw new Error(`GET ${e} failed with ${t.status}`);return t.json()}const w0=()=>Cr("/api/v1/settings"),L2=()=>Cr("/api/v1/tokens"),V2=()=>Cr("/api/v1/team/members"),U2=e=>Cr(`/api/v1/comments?build_id=${e}`),Z2=e=>Cr(`/api/v1/recordings?buildId=${e}`),B2=()=>Cr("/api/v1/agents");async function H2(e,t,n){const r=await fetch(`/api/v1/agents/${encodeURIComponent(e)}/resources?range=${t}`,{credentials:"include",signal:n});if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}async function W2(e){const t=await fetch(`/api/v1/auth/reset-password/verify?token=${e}`);if(!t.ok)throw new Error(`reset token refused with ${t.status}`);return!0}async function K2(){const e=await fetch("/api/v1/apps",{credentials:"include"});if(!e.ok)throw new Error(`GET /api/v1/apps failed with ${e.status}`);return(await e.json()).items}async function G2({appId:e,search:t,statusFilter:n}){const r=new URLSearchParams({app_id:String(e),limit:"100",sort:"uploaded_at",dir:"desc"});t&&r.set("q",t),n&&n!=="all"&&r.set("status",n);const o=await fetch(`/api/v1/builds?${r}`,{credentials:"include"});if(!o.ok)throw new Error(`GET /api/v1/builds failed with ${o.status}`);return(await o.json()).items}async function q2(e){const t=await fetch("/api/v1/apps",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return t.status===409?{error:"App with this bundle ID already exists"}:t.ok?t.json():null}class _0 extends Error{}async function Ia(e){if(e.status!==403)return;const t=await e.json().catch(()=>null);throw new _0((t==null?void 0:t.error)??"You do not have permission to do this")}async function Q2(e,t){const n=await fetch(`/api/v1/builds/${e}`,{method:"PATCH",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({status_label:t})});if(await Ia(n),!n.ok)throw new Error(`PATCH /api/v1/builds/${e} failed with ${n.status}`)}async function Y2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"POST",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to schedule deletion (${t.status})`);return(await t.json()).delete_after}async function J2(e){const t=await fetch(`/api/v1/builds/${e}/schedule-deletion`,{method:"DELETE",credentials:"include"});if(await Ia(t),!t.ok)throw new Error(`Failed to cancel scheduled deletion (${t.status})`)}async function X2(e){const t=await fetch(`/api/v1/builds/${e}`,{credentials:"include"});return t.ok?t.json():null}function ek(e){const t=new Map;for(const n of e){const r=n.version_name??"Unversioned";t.has(r)||t.set(r,[]),t.get(r).push(n)}return Array.from(t.entries()).map(([n,r])=>({versionName:n,builds:r}))}const x0=1e4;function Aa(e){const t=new AbortController,n=setTimeout(()=>t.abort(new DOMException("timed out","TimeoutError")),x0);return t.signal.addEventListener("abort",()=>clearTimeout(n),{once:!0}),e&&(e.aborted?t.abort(e.reason):e.addEventListener("abort",()=>t.abort(e.reason),{once:!0})),t.signal}const S0=25;async function E0(e){const t=await fetch("/api/v1/runs?limit=1",{credentials:"include",signal:Aa(e)});if(!t.ok)throw new Error(`GET /api/v1/runs failed with ${t.status}`);return(await t.json()).items.length>0}async function tk(e,t,n){const r=new URLSearchParams;e.ci!==void 0&&r.set("ci",e.ci?"1":"0"),e.status&&r.set("status",e.status),e.flow&&r.set("flow",e.flow),e.build!==void 0&&r.set("build",String(e.build)),t.before&&r.set("before",t.before),t.after&&r.set("after",t.after),r.set("limit",String(S0));const o=`/api/v1/runs${r.size?`?${r}`:""}`,s=await fetch(o,{credentials:"include",signal:Aa(n)});if(!s.ok)throw new Error(`GET /api/v1/runs failed with ${s.status}`);return s.json()}async function nk(e,t){const n=await fetch(`/api/v1/runs/${encodeURIComponent(e)}`,{credentials:"include",signal:Aa(t)});if(n.status===404)return null;if(!n.ok)throw new Error(`GET /api/v1/runs/${e} failed with ${n.status}`);return n.json()}async function rk(e,t,n){const r=await fetch(C0(e,t),{credentials:"include",signal:n});if(r.status===404||r.status===410)return{kind:"gone"};if(!r.ok)throw new Error(`video index ${r.status}`);const o=await r.json();if(o.evicted)return{kind:"gone"};if(o.meta.formatVersion!==p0)return{kind:"unsupported"};const s=await fetch(k0(e,t),{credentials:"include",signal:n});if(s.status===404||s.status===410)return{kind:"gone"};if(!s.ok)throw new Error(`video ${s.status}`);return{kind:"ready",index:o,file:await s.arrayBuffer()}}function C0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video/index`}function k0(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/video`}function ok(e,t){return`/api/v1/runs/${encodeURIComponent(e)}/flows/${t}/screenshot`}function ph(){const e=ee.c(4);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t={queryKey:Qo.me,queryFn:b0},e[0]=t):t=e[0];const n=Wo(t),r=n.data??null,o=n.data===void 0;let s;return e[1]!==r||e[2]!==o?(s={user:r,loading:o},e[1]=r,e[2]=o,e[3]=s):s=e[3],s}const O0={"/settings/team":["Admin"],"/settings/tokens":["Admin","Developer","QA"]};function mh(e,t){const n=Object.entries(O0).find(([r])=>e.startsWith(r));return!n||t!==void 0&&n[1].includes(t)}const P0=6;function R0(e){let t=0;for(const n of e)t=t*31+n.charCodeAt(0)&4294967295;return Math.abs(t)}function T0(e){const t=R0(e)%P0+1;return{bg:`hsl(var(--avatar-${t}-bg))`,fg:`hsl(var(--avatar-${t}-fg))`}}function I0(e){const t=ee.c(20),{name:n,avatarUrl:r,size:o}=e,s=o===void 0?28:o,i=(n==null?void 0:n[0])??"?";let a;t[0]!==i?(a=i.toUpperCase(),t[0]=i,t[1]=a):a=t[1];const c=a;let u;t[2]!==s?(u={width:s,height:s,borderRadius:"50%",flexShrink:0},t[2]=s,t[3]=u):u=t[3];const d=u;if(r){let b;t[4]!==d?(b={...d,objectFit:"cover"},t[4]=d,t[5]=b):b=t[5];let x;return t[6]!==r||t[7]!==n||t[8]!==b?(x=m.jsx("img",{src:r,alt:n,style:b}),t[6]=r,t[7]=n,t[8]=b,t[9]=x):x=t[9],x}let l;t[10]!==n?(l=T0(n),t[10]=n,t[11]=l):l=t[11];const{bg:f,fg:p}=l,v=s*.42;let g;t[12]!==f||t[13]!==p||t[14]!==d||t[15]!==v?(g={...d,background:f,display:"inline-flex",alignItems:"center",justifyContent:"center",color:p,fontSize:v,fontWeight:600,userSelect:"none"},t[12]=f,t[13]=p,t[14]=d,t[15]=v,t[16]=g):g=t[16];let w;return t[17]!==c||t[18]!==g?(w=m.jsx("span",{style:g,children:c}),t[17]=c,t[18]=g,t[19]=w):w=t[19],w}const Pi="/automation/runs",A0=[{label:"App Center",href:"/app-center",icon:ng},{label:"Flow Runs",href:Pi,icon:lg},{label:"Mac Resources",href:"/mac-resources",icon:sg}],N0=[{label:"Default",href:"/settings/default",icon:Nu},{label:"Team",href:"/settings/team",icon:fg},{label:"Tokens",href:"/settings/tokens",icon:tg}],D0=[{label:"Docs",href:"https://www.tapflow.dev/get-started/teammates",icon:qm}];function M0(){const e=ee.c(87),{pathname:t}=ou(),n=su(),{user:r}=ph(),{resolvedTheme:o}=ss(),s=o==="dark"?"/logo-dark.svg":"/logo.svg";let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={queryKey:Qo.settings,queryFn:w0},e[0]=i):i=e[0];const a=Wo(i).data,c=(a==null?void 0:a.logo_url)??null,u=(a==null?void 0:a.team_name)||"tapflow",d=Qi(),{setOpenMobile:l}=lo();let f;e[1]!==l?(f=()=>l(!1),e[1]=l,e[2]=f):f=e[2];const p=f;let v;e[3]!==l?(v=()=>{l(!1)},e[3]=l,e[4]=v):v=e[4];let g;e[5]!==t||e[6]!==l?(g=[t,l],e[5]=t,e[6]=l,e[7]=g):g=e[7],h.useEffect(v,g);let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w={queryKey:Qo.anyRun,queryFn:j0},e[8]=w):w=e[8];const b=Wo(w);let x;e[9]!==b.data||e[10]!==b.isError||e[11]!==t?(x=b.data===!0||b.isError||t.startsWith(Pi),e[9]=b.data,e[10]=b.isError,e[11]=t,e[12]=x):x=e[12];const _=x;let C,S,P,R,T,A,j,F,z;if(e[13]!==p||e[14]!==s||e[15]!==c||e[16]!==n||e[17]!==t||e[18]!==d||e[19]!==_||e[20]!==u){let re;e[30]!==_?(re=Ee=>Ee.href!==Pi||_,e[30]=_,e[31]=re):re=e[31];const B=A0.filter(re);let se;e[32]!==n||e[33]!==d?(se=async function(){await fetch("/api/v1/auth/logout",{method:"POST",credentials:"include"}),d.clear(),n("/login",{replace:!0})},e[32]=n,e[33]=d,e[34]=se):se=e[34],A=se,T=wf,F="icon";const ye=c??s;let le;e[35]!==ye?(le=m.jsx("img",{src:ye,alt:"tapflow",className:"w-6 h-6 min-w-6 shrink-0"}),e[35]=ye,e[36]=le):le=e[36];let Pe;e[37]!==u?(Pe=m.jsx("span",{className:"text-base font-semibold tracking-tight truncate text-sidebar-accent-foreground group-data-[collapsible=icon]:hidden",children:u}),e[37]=u,e[38]=Pe):Pe=e[38],e[39]!==p||e[40]!==le||e[41]!==Pe?(z=m.jsx(Sf,{className:"p-2",children:m.jsxs(mo,{to:"/app-center",onClick:p,className:"flex items-center gap-2 p-1",children:[le,Pe]})}),e[39]=p,e[40]=le,e[41]=Pe,e[42]=z):z=e[42],R=Cf,P=Mo,S=jo,C=$o;let je;e[43]!==p||e[44]!==t?(je=Ee=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t.startsWith(Ee.href),tooltip:Ee.label,children:m.jsxs(mo,{to:Ee.href,onClick:p,children:[m.jsx(Ee.icon,{}),m.jsx("span",{children:Ee.label})]})})},Ee.href),e[43]=p,e[44]=t,e[45]=je):je=e[45],j=B.map(je),e[13]=p,e[14]=s,e[15]=c,e[16]=n,e[17]=t,e[18]=d,e[19]=_,e[20]=u,e[21]=C,e[22]=S,e[23]=P,e[24]=R,e[25]=T,e[26]=A,e[27]=j,e[28]=F,e[29]=z}else C=e[21],S=e[22],P=e[23],R=e[24],T=e[25],A=e[26],j=e[27],F=e[28],z=e[29];let Y;e[46]!==C||e[47]!==j?(Y=m.jsx(C,{children:j}),e[46]=C,e[47]=j,e[48]=Y):Y=e[48];let Z;e[49]!==S||e[50]!==Y?(Z=m.jsx(S,{children:Y}),e[49]=S,e[50]=Y,e[51]=Z):Z=e[51];let K;e[52]!==P||e[53]!==Z?(K=m.jsx(P,{children:Z}),e[52]=P,e[53]=Z,e[54]=K):K=e[54];let H;e[55]===Symbol.for("react.memo_cache_sentinel")?(H=m.jsx(xi,{children:"Settings"}),e[55]=H):H=e[55];let J;if(e[56]!==p||e[57]!==t||e[58]!==(r==null?void 0:r.role)){let re;e[60]!==(r==null?void 0:r.role)?(re=se=>mh(se.href,r==null?void 0:r.role),e[60]=r==null?void 0:r.role,e[61]=re):re=e[61];let B;e[62]!==p||e[63]!==t?(B=se=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,isActive:t===se.href,tooltip:se.label,children:m.jsxs(mo,{to:se.href,onClick:p,children:[m.jsx(se.icon,{}),m.jsx("span",{children:se.label})]})})},se.href),e[62]=p,e[63]=t,e[64]=B):B=e[64],J=N0.filter(re).map(B),e[56]=p,e[57]=t,e[58]=r==null?void 0:r.role,e[59]=J}else J=e[59];let ne;e[65]!==J?(ne=m.jsxs(Mo,{children:[H,m.jsx(jo,{children:m.jsx($o,{children:J})})]}),e[65]=J,e[66]=ne):ne=e[66];let te;e[67]===Symbol.for("react.memo_cache_sentinel")?(te=m.jsx(xi,{children:"Reference"}),e[67]=te):te=e[67];let X;e[68]!==p?(X=D0.map(re=>m.jsx(zo,{children:m.jsx(Fo,{asChild:!0,tooltip:re.label,children:m.jsxs("a",{href:re.href,target:"_blank",rel:"noopener noreferrer",onClick:p,children:[m.jsx(re.icon,{}),m.jsx("span",{children:re.label})]})})},re.href)),e[68]=p,e[69]=X):X=e[69];let q;e[70]!==X?(q=m.jsxs(Mo,{children:[te,m.jsx(jo,{children:m.jsx($o,{children:X})})]}),e[70]=X,e[71]=q):q=e[71];let me;e[72]!==R||e[73]!==K||e[74]!==ne||e[75]!==q?(me=m.jsxs(R,{children:[K,ne,q]}),e[72]=R,e[73]=K,e[74]=ne,e[75]=q,e[76]=me):me=e[76];let he;e[77]!==p||e[78]!==A||e[79]!==r?(he=r&&m.jsx(Ef,{className:"px-3 py-3",children:m.jsxs(a0,{children:[m.jsx(c0,{asChild:!0,children:m.jsxs("button",{className:"flex w-full items-center gap-2.5 rounded-md px-1 py-1 text-left hover:bg-sidebar-accent transition-colors group-data-[collapsible=icon]:justify-center",children:[m.jsx(I0,{name:r.displayName??"",avatarUrl:r.avatarUrl,size:28}),m.jsxs("div",{className:"flex flex-col min-w-0 flex-1 group-data-[collapsible=icon]:sr-only",children:[m.jsx("span",{className:"text-sm font-medium truncate",children:r.displayName}),m.jsx("span",{className:"text-xs text-muted-foreground truncate",children:r.email})]})]})}),m.jsxs(dh,{side:"top",align:"start",className:"w-56",children:[m.jsx(ki,{asChild:!0,children:m.jsxs(mo,{to:"/settings/default",onClick:p,children:[m.jsx(Nu,{className:"mr-2 h-4 w-4"}),"Settings"]})}),m.jsx(fh,{}),m.jsxs(ki,{onClick:A,className:"text-destructive focus:text-destructive",children:[m.jsx(og,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})}),e[77]=p,e[78]=A,e[79]=r,e[80]=he):he=e[80];let ae;return e[81]!==T||e[82]!==me||e[83]!==he||e[84]!==F||e[85]!==z?(ae=m.jsxs(T,{collapsible:F,children:[z,me,he]}),e[81]=T,e[82]=me,e[83]=he,e[84]=F,e[85]=z,e[86]=ae):ae=e[86],ae}function j0(e){const{signal:t}=e;return E0(t)}function $0(){const e=ee.c(7),{theme:t,setTheme:n}=ss();let r;e[0]!==n||e[1]!==t?(r=()=>n(t==="dark"?"light":"dark"),e[0]=n,e[1]=t,e[2]=r):r=e[2];let o,s;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(ug,{className:"h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),s=m.jsx(ig,{className:"absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),e[3]=o,e[4]=s):(o=e[3],s=e[4]);let i;return e[5]!==r?(i=m.jsxs(is,{variant:"ghost",size:"icon",onClick:r,"aria-label":"Toggle theme",children:[o,s]}),e[5]=r,e[6]=i):i=e[6],i}const gh=h.createContext({node:null,setNode:()=>{}});function z0(e){const t=ee.c(5),{children:n}=e,[r,o]=h.useState(null);let s;t[0]!==r?(s={node:r,setNode:o},t[0]=r,t[1]=s):s=t[1];const i=s;let a;return t[2]!==n||t[3]!==i?(a=m.jsx(gh.Provider,{value:i,children:n}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function F0(){return h.useContext(gh)}function L0(){const e=ee.c(8),{node:t}=F0();let n,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(_f,{className:"-ml-1"}),r=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[0]=n,e[1]=r):(n=e[0],r=e[1]);let o,s,i;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx("div",{className:"flex-1"}),s=m.jsx($0,{}),i=m.jsx(qo,{orientation:"vertical",className:"h-4"}),e[2]=o,e[3]=s,e[4]=i):(o=e[2],s=e[3],i=e[4]);let a;e[5]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("a",{href:"https://github.com/jo-duchan/tapflow",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-accent transition-colors","aria-label":"GitHub",children:m.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-current","aria-hidden":"true",children:m.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})})}),e[5]=a):a=e[5];let c;return e[6]!==t?(c=m.jsxs("header",{className:"flex h-16 items-center gap-2 border-b px-4",children:[n,r,t,o,s,i,a]}),e[6]=t,e[7]=c):c=e[7],c}function V0(){const e=ee.c(5),{user:t,loading:n}=ph(),r=ou();if(n)return null;if(!t){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(Gi,{to:"/login",replace:!0}),e[0]=a):a=e[0],a}if(!mh(r.pathname,t.role)){let a;return e[1]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx("div",{className:"flex h-screen items-center justify-center",children:m.jsxs("div",{className:"text-center space-y-2",children:[m.jsx("p",{className:"text-lg font-semibold",children:"Access Denied"}),m.jsx("p",{className:"text-sm text-muted-foreground",children:"Your role does not have access to this page."})]})}),e[1]=a):a=e[1],a}let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(M0,{}),e[2]=o):o=e[2];let s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(L0,{}),e[3]=s):s=e[3];let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(z0,{children:m.jsxs(bf,{children:[o,m.jsxs(xf,{children:[s,m.jsx("main",{className:"relative flex-1 min-h-0 overflow-auto",children:m.jsx(h.Suspense,{fallback:m.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),children:m.jsx(Vp,{})})})]})]})}),e[4]=i):i=e[4],i}var kr=e=>e.type==="checkbox",ms=e=>e.type==="file",Sn=e=>e instanceof Date,Xe=e=>e==null;const Na=e=>typeof e=="object";var Ae=e=>!Xe(e)&&!Array.isArray(e)&&Na(e)&&!Sn(e),Ri=e=>Ae(e)&&e.target?kr(e.target)?e.target.checked:ms(e.target)?e.target.files:e.target.value:e;const U0=/[.[\]'"]/;var Un=e=>e.split(U0).filter(Boolean);function Z0(e,t){const n=Un(t);let r=e._formValues,o=e._defaultValues;for(let s=0;s<n.length-1;s++){const i=n[s];if(r=r==null?r:r[i],o=o==null?o:o[i],r===null||o===null)return null}}var vh=(e,t)=>t.split(".").some((n,r,o)=>!isNaN(Number(n))&&e.has(o.slice(0,r).join("."))),gs=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Oe(e){if(e===null||typeof e!="object")return e;if(e instanceof Date)return new Date(e);const t=typeof Blob<"u"&&e instanceof Blob,n=typeof FileList<"u"&&e instanceof FileList;if(gs&&(t||n))return e;const r=Array.isArray(e),o=Object.getPrototypeOf(e);if(!r&&o&&e.constructor!==Object)return e;const s=r?new Array(e.length):Object.create(o);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=Oe(e[i]));return s}const pn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Rt={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Je={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},B0=[Je.required,Je.min,Je.max,Je.minLength,Je.maxLength,Je.pattern,Je.validate],Lr="form",yh="root",Da=["__proto__","constructor","prototype"],H0=/^\w*$/;var br=e=>H0.test(e),ve=e=>e===void 0,U=(e,t,n)=>{if(!t||!Ae(e))return n;const r=br(t)?[t]:Un(t);if(r.some(s=>Da.includes(s)))return n;const o=r.reduce((s,i)=>Xe(s)?void 0:s[i],e);return ve(o)||o===e?ve(e[t])?n:e[t]:o},yt=e=>typeof e=="boolean",nt=e=>typeof e=="function",_e=(e,t,n)=>{let r=-1;const o=br(t)?[t]:Un(t),s=o.length,i=s-1;for(;++r<s;){const a=o[r];let c=n;if(r!==i){const u=e[a];c=Ae(u)||Array.isArray(u)?u:isNaN(+o[r+1])?{}:[]}if(Da.includes(a))return;e[a]=c,e=e[a]}};const bh=I.createContext(null);bh.displayName="HookFormControlContext";const Ma=()=>I.useContext(bh);var wh=(e,t,n,r=!0)=>{const o={};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Rt.all&&(t._proxyFormState[i]=!r||Rt.all),n&&(n[i]=!0),e[i]}});return o};const ja=gs?I.useLayoutEffect:I.useEffect;var W0=e=>{const t=e.constructor&&e.constructor.prototype;return Ae(t)&&t.hasOwnProperty("isPrototypeOf")},Ti=e=>Xe(e)||!Na(e);const Uc=(e,t)=>t.length===0&&!Array.isArray(e)&&!W0(e);function at(e,t,n=!1,r=new WeakMap){if(e===t)return!0;if(Ti(e)||Ti(t))return Object.is(e,t);if(Sn(e)&&Sn(t))return Object.is(e.getTime(),t.getTime());const o=Object.keys(e),s=Object.keys(t);if(o.length!==s.length)return!1;if(Uc(e,o)||Uc(t,s))return Object.is(e,t);if(!o.length&&Array.isArray(e)!==Array.isArray(t))return!1;const i=r.get(e);if(i&&i.has(t))return!0;if(i)i.add(t);else{const a=new WeakSet;a.add(t),r.set(e,a)}for(const a of o){const c=e[a];if(!(a in t))return!1;if(!n||a!=="ref"){const u=t[a];if(Sn(c)&&Sn(u)||(Ae(c)||Array.isArray(c))&&(Ae(u)||Array.isArray(u))?!at(c,u,n,r):!Object.is(c,u))return!1}}return!0}function $a(e){const t=I.useRef(!1),n=I.useRef(!1),r=I.useRef(void 0),o=I.useRef(0);o.current++,!n.current&&e&&(n.current=!0,r.current=Oe(e()));const s=I.useCallback((a,c,u)=>{if(a&&(t.current||n.current&&o.current>1)){const d=c();at(r.current,d)||u(d)}t.current=!0},[]),i=I.useCallback((a,c)=>{a&&(r.current=Oe(c()))},[]);return{resyncIfNeeded:s,snapshot:i}}function K0(e){const t=Ma(),{control:n=t,disabled:r,name:o,exact:s}=e||{},i=()=>({...n._formState,defaultValues:n._defaultValues}),[a,c]=I.useState(i),u=I.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:d,snapshot:l}=$a(i);return ja(()=>{d(!r,i,c);const f=n._subscribe({name:o,formState:u.current,exact:s,callback:p=>{!r&&c({...n._formState,...p,defaultValues:n._defaultValues})}});return()=>{f(),l(!r,i)}},[n,o,r,s,d,l]),I.useEffect(()=>{u.current.isValid&&n._setValid(!0)},[n]),I.useMemo(()=>wh(a,n,u.current,!1),[a,n])}var rt=e=>typeof e=="string",Ii=(e,t,n,r,o)=>rt(e)?(r&&t.watch.add(e),U(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),U(n,s,U(o,s)))):(r&&(t.watchAll=!0),n);function G0(e){const t=Ma(),{control:n=t,name:r,defaultValue:o,disabled:s,exact:i,compute:a}=e||{},c=I.useRef(o),u=I.useRef(a),d=I.useRef(n),l=I.useRef(r);u.current=a;const f=()=>{const A=n._getWatch(r,c.current);return u.current?u.current(A):A},[p,v]=I.useState(f),g=I.useRef(p),w=I.useCallback(A=>{const j=Ii(r,n._names,A||n._formValues,!1,c.current);return u.current?u.current(j):j},[n._formValues,n._names,r]),b=I.useCallback(A=>{if(!s){const j=Ii(r,n._names,A||n._formValues,!1,c.current);if(u.current){const F=u.current(j);at(F,g.current)||(v(F),g.current=F)}else v(j)}},[n._formValues,n._names,s,r]),{resyncIfNeeded:x,snapshot:_}=$a(f),C=I.useRef(b);C.current=b;const S=I.useRef(w);S.current=w,ja(()=>{d.current!==n||!at(l.current,r)?(d.current=n,l.current=r,C.current()):x(!s,()=>S.current(),j=>{const F=Oe(j);v(F),g.current=F});const A=n._subscribe({name:r,formState:{values:!0},exact:i,callback:j=>{C.current(j.values)}});return()=>{A(),_(!s,()=>S.current())}},[n,i,r,s,x,_]),I.useEffect(()=>n._removeUnmounted());const P=d.current!==n,R=l.current;return I.useMemo(()=>{if(s)return!1;const A=!P&&!at(R,r);return P||A},[s,P,r,R])?w():p}function q0(e){const t=Ma(),{name:n,disabled:r,control:o=t,shouldUnregister:s,defaultValue:i,exact:a=!0}=e,c=vh(o._names.array,n),u=I.useMemo(()=>{const C=U(o._formValues,n,U(o._defaultValues,n,i));return ve(C)?Z0(o,n):C},[o,n,i]),d=G0({control:o,name:n,defaultValue:u,exact:a}),l=K0({control:o,name:n,exact:a}),f=I.useRef(e),p=I.useRef(null),v=I.useRef(o.register(n,{...e.rules,value:d,...yt(e.disabled)?{disabled:e.disabled}:{}}));f.current=e;const g=I.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!U(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!U(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!U(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!U(l.validatingFields,n)},error:{enumerable:!0,get:()=>U(l.errors,n)}}),[l,n]),w=I.useCallback(C=>{const S=Ri(C);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:S})),v.current.onChange({target:{value:Ri(C),name:n},type:pn.CHANGE})},[n,o]),b=I.useCallback(()=>{const C=U(o._formValues,n);return U(o._fields,n)||(v.current=o.register(n,{...f.current.rules,value:C})),v.current.onBlur({target:{value:C,name:n},type:pn.BLUR})},[n,o]),x=I.useCallback(C=>{C&&(p.current={focus:()=>nt(C.focus)&&C.focus(),select:()=>nt(C.select)&&C.select(),setCustomValidity:P=>nt(C.setCustomValidity)&&C.setCustomValidity(P),reportValidity:()=>nt(C.reportValidity)&&C.reportValidity()});const S=U(o._fields,n);S&&S._f&&C&&(S._f.ref=p.current,S._f._c=!0)},[o._fields,n]),_=I.useMemo(()=>({name:n,value:d,...yt(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:w,onBlur:b,ref:x}),[n,r,l.disabled,w,b,x,d]);return I.useEffect(()=>{const C=o._options.shouldUnregister||s;v.current=o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}});const S=(P,R)=>{const T=U(o._fields,P);T&&T._f&&(T._f.mount=R,T._f._c=R)};if(S(n,!0),C){const P=Oe(U(s?o._defaultValues:o._options.values||o._defaultValues,n,U(o._options.defaultValues,n,f.current.defaultValue)));_e(o._defaultValues,n,P),ve(U(o._formValues,n))&&_e(o._formValues,n,P)}if(!c&&o.register(n,{...f.current.rules,...yt(f.current.disabled)?{disabled:f.current.disabled}:{}}),p.current){const P=U(o._fields,n);P&&P._f&&(P._f.ref=p.current)}return()=>{(c?C&&!o._state.action:C)?o.unregister(n):S(n,!1)}},[n,o,c,s]),I.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),I.useMemo(()=>({field:_,formState:l,fieldState:g}),[_,l,g])}const sk=e=>e.render(q0(e));var ko=e=>({isOnSubmit:!e||e===Rt.onSubmit,isOnBlur:e===Rt.onBlur,isOnChange:e===Rt.onChange,isOnAll:e===Rt.all,isOnTouch:e===Rt.onTouched}),Fs=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(const r of t.watch)if(e.startsWith(r)&&e.charAt(r.length)===".")return!0;return!1};const Zr=(e,t,n)=>{for(const r of n||Object.keys(e)){if(r==="_f")continue;const o=n?U(e,r):e[r];if(o){const{_f:s}=o;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],s.name))return!0;if(s.ref&&t(s.ref,s.name))return!0;if(Zr(o,t))return!0}else if((Ae(o)||Array.isArray(o))&&Zr(o,t))return!0}}};var Zc=(e,t,n)=>{const r=U(e,n),o=Array.isArray(r)?r:[];return _e(o,yh,t[n]),_e(e,n,o),e},Ve=e=>Ae(e)&&!Object.keys(e).length,Yo=e=>{if(!gs)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},vs=e=>e.type==="radio",Jo=e=>e instanceof RegExp,za=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{};const Bc={value:!1,isValid:!1},Hc={value:!0,isValid:!0};var _h=e=>{if(!Array.isArray(e))return Bc;if(e.length>1){const n=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:n,isValid:!!n.length}}const t=e[0];return!t||!t.checked||t.disabled?Bc:!t.attributes||!("value"in t.attributes)||ve(t.value)||t.value===""?Hc:{value:t.value,isValid:!0}};const Wc={isValid:!1,value:null};var xh=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,Wc):Wc;function Kc(e,t,n="validate"){if(rt(e)||Array.isArray(e)&&e.every(rt)||yt(e)&&!e)return{type:n,message:rt(e)?e:"",ref:t}}var er=e=>Ae(e)&&!Jo(e)?e:{value:e,message:""},Gc=async(e,t,n,r,o,s)=>{const{ref:i,refs:a,required:c,maxLength:u,minLength:d,min:l,max:f,pattern:p,validate:v,name:g,valueAsNumber:w,mount:b,_c:x}=e._f,_=U(n,g);if(!b||t.has(g))return{};const C=a?a[0]:i,S=Z=>{if(o&&C.reportValidity){const K=yt(Z)?"":Z||"";a?a.forEach(H=>nt(H.setCustomValidity)&&H.setCustomValidity(K)):C.setCustomValidity(K),C.reportValidity()}},P={},R=vs(i),T=kr(i),A=R||T,j=(w||ms(i))&&ve(i.value)&&ve(_)||Yo(i)&&i.value===""&&!x||_===""||Array.isArray(_)&&!_.length,F=za.bind(null,g,r,P),z=(Z,K,H,J=Je.maxLength,ne=Je.minLength)=>{const te=Z?K:H;P[g]={type:Z?J:ne,message:te,ref:i,...F(Z?J:ne,te)}};if(s?!Array.isArray(_)||!_.length:c&&(!A&&(j||Xe(_))||yt(_)&&!_||T&&!_h(a).isValid||R&&!xh(a).isValid)){const{value:Z,message:K}=rt(c)?{value:!!c,message:c}:er(c);if(Z&&(P[g]={type:Je.required,message:K,ref:C,...F(Je.required,K)},!r))return S(K),P}if(!j&&(!Xe(l)||!Xe(f))){let Z,K;const H=er(f),J=er(l);if(!Xe(_)&&!Sn(_)&&!isNaN(_)){const ne=i.valueAsNumber||_&&+_;Xe(H.value)||(Z=ne>H.value),Xe(J.value)||(K=ne<J.value)}else{const ne=i.valueAsDate||new Date(_),te=me=>new Date(new Date().toDateString()+" "+me),X=i.type=="time",q=i.type=="week";rt(H.value)&&_&&(Z=X?te(_)>te(H.value):q?_>H.value:ne>new Date(H.value)),rt(J.value)&&_&&(K=X?te(_)<te(J.value):q?_<J.value:ne<new Date(J.value))}if((Z||K)&&(z(!!Z,H.message,J.message,Je.max,Je.min),!r))return S(P[g].message),P}if((u||d)&&!j&&(rt(_)||s&&Array.isArray(_))){const Z=er(u),K=er(d),H=!Xe(Z.value)&&_.length>+Z.value,J=!Xe(K.value)&&_.length<+K.value;if((H||J)&&(z(H,Z.message,K.message),!r))return S(P[g].message),P}if(p&&!j&&rt(_)){const{value:Z,message:K}=er(p);if(Jo(Z)&&!_.match(Z)&&(P[g]={type:Je.pattern,message:K,ref:i,...F(Je.pattern,K)},!r))return S(K),P}if(v){if(nt(v)){const Z=await v(_,n),K=Kc(Z,C);if(K&&(P[g]={...K,...F(Je.validate,K.message)},!r))return S(K.message),P}else if(Ae(v)){let Z={};for(const K in v){if(!Ve(Z)&&!r)break;const H=Kc(await v[K](_,n),C,K);H&&(Z={...H,...F(K,H.message)},r||S(H.message),r&&(P[g]=Z))}if(!Ve(Z)&&(P[g]={ref:C,...Z},!r))return P}}const Y=P[g];return S(Y?Y.message:!0),P},Ls=e=>Array.isArray(e)?e:[e],Sh=e=>Array.isArray(e)?e.filter(Boolean):[];function Q0(e,t){const n=t.length-1;let r=0;for(;r<n;){if(Xe(e)){e=void 0;break}e=e[t[r]],r++}return e}function Y0(e){for(const t in e)if(e.hasOwnProperty(t)&&!ve(e[t]))return!1;return!0}function Fe(e,t){if(rt(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;const n=Array.isArray(t)?t:br(t)?[t]:Un(t);if(n.some(i=>Da.includes(String(i))))return e;const r=n.length===1?e:Q0(e,n),o=n.length-1,s=n[o];return r&&delete r[s],o!==0&&(Ae(r)&&Ve(r)||Array.isArray(r)&&Y0(r))&&Fe(e,n.slice(0,-1)),e}const J0=I.createContext(null);J0.displayName="HookFormContext";var qc=()=>{let e=new Set,t=0;return{get observers(){return Array.from(e)},next:s=>{const i=e;t++;for(const a of i)a.next&&a.next(s);i===e&&t--},subscribe:s=>(e.add(s),{unsubscribe:()=>{t&&(e=new Set(e),t=0),e.delete(s)}}),unsubscribe:()=>{e=new Set,t=0}}};function Eh(e,t){const n=Array.isArray(e)?[]:{};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=e[r],s=t[r];o&&(Ae(o)||Array.isArray(o))&&s?n[r]=Eh(o,s):e[r]&&(n[r]=s)}return n}const Qc=(e,t)=>e!==null&&Na(e)&&Object.prototype.hasOwnProperty.call(e,t);var Yc=(e,t)=>{if(!t)return!1;let n=e;for(const r of br(t)?[t]:Un(t)){if(!Qc(n,r))return Qc(e,t);n=n[r]}return!0},X0=e=>kr(e)?e.checked!==e.defaultChecked:!vs(e)&&"defaultValue"in e&&e.value!==e.defaultValue,Ch=e=>e.type==="select-multiple",e_=e=>vs(e)||kr(e),Vs=e=>Yo(e)&&e.isConnected;function Jc(e){return Array.isArray(e)||Ae(e)}function kh(e,t,n="",r=[]){for(const o in e){const s=n?`${n}.${o}`:o,i=e[o];Jc(i)&&Jc(U(t,s))?kh(i,t,s,r):r.push(s)}return r}var t_=e=>{for(const t in e)if(nt(e[t]))return!0;return!1};function Oh(e){return Array.isArray(e)||Ae(e)&&!t_(e)}function Ph(e){return!!(e&&"_f"in e)}function Rh(e){return Array.isArray(e)?!e.some(t=>!ve(t)):!Object.keys(e).length}function Ai(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function Ni(e,t={},n){for(const r in e){const o=e[r],s=n&&n[r];Oh(o)&&(!Array.isArray(o)||!Ph(s))?(t[r]=Array.isArray(o)?[]:{},Ni(o,t[r],s),Rh(t[r])&&Ai(t,r)):ve(o)||(t[r]=!0)}return t}function Gt(e,t,n,r){n||(n=Ni(t,Array.isArray(t)?[]:{},r));for(const o in e){const s=e[o],i=r&&r[o];Oh(s)&&(!Array.isArray(s)||!Ph(i))?(ve(t)||Ti(n[o])?n[o]=Ni(s,Array.isArray(s)?[]:{},i):Gt(s,Xe(t)?{}:t[o],n[o],i),Rh(n[o])&&Ai(n,o)):at(s,t[o])?Ai(n,o):n[o]=!0}return n}var n_=(e,t)=>{const n=t.split("."),r=[];let o=n[0];for(let s=1;s<n.length;o+="."+n[s++])!isNaN(+n[s])&&e.has(o)&&r.push(`${o}.${n[s]}`);return r},Di=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>ve(e)?e:t?e===""?NaN:e&&+e:n&&rt(e)?new Date(e):r?r(e):e;function Xc(e){const t=e.ref;return ms(t)?t.files:vs(t)?xh(e.refs).value:Ch(t)?[...t.selectedOptions].map(({value:n})=>n):kr(t)?_h(e.refs).value:Di(t.value,e)}var r_=(e,t,n,r)=>{const o={};for(const s of e){const i=U(t,s);i&&_e(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},$r=e=>ve(e)?e:Jo(e)?e.source:Ae(e)?Jo(e.value)?e.value.source:e.value:e;const el="AsyncFunction";var o_=e=>{if(!e||!e.validate)return!1;if(nt(e.validate))return e.validate.constructor.name===el;if(Ae(e.validate)){for(const t in e.validate)if(e.validate[t].constructor.name===el)return!0}return!1},s_=e=>e.mount&&(e.required||!ve(e.required)&&e.required!==!1||!ve(e.min)||!ve(e.max)||!ve(e.maxLength)||!ve(e.minLength)||e.pattern||e.validate);function tl(e,t,n){const r=U(e,n);if(r&&(r.type||r.message)||Array.isArray(r))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=U(t,s),a=U(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};if(a&&a.root&&a.root.type)return{name:`${s}.root`,error:a.root};o.pop()}return{name:n}}var i_=(e,t,n)=>{const r=Object.keys(e).filter(o=>o!=="name");return!r.length||n&&r.length>=Object.keys(t).length||r.find(o=>t[o]===(!n||Rt.all))};const nl=(e,t,n)=>n?e===t||e.startsWith(t+"."):e.startsWith(t)||t.startsWith(e);var rl=(e,t,n)=>{if(!e||!t||e===t)return!0;if(!Array.isArray(e))return nl(e,t,n);for(const r of e)if(r&&nl(r,t,n))return!0;return!1},a_=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,c_=(e,t)=>{const n=U(e,t);!Sh(n).length&&!(n&&n.root)&&Fe(e,t)};const Uo={mode:Rt.onSubmit,reValidateMode:Rt.onChange,shouldFocusError:!0},l_=(e,t)=>{for(const n in e)delete e[n];Object.assign(e,t)},Th={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function u_(e={}){let t={...Uo,...e},n={...Oe(Th),isLoading:nt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},o=Ae(t.defaultValues)||Ae(t.values)?Oe(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Oe(o),i={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},a=!1,c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const u={},d={},l=new Set;let f=ko(t.mode),p=ko(t.reValidateMode);const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...v},w={},b=(...y)=>y.some(O=>g[O]||w[O]),x=y=>{for(const O of l)if(rl(O.name,y,O.exact))return!0;return!1},_={array:qc(),state:qc()};let C=0,S=0,P=t.criteriaMode===Rt.all;const R=(y,O)=>k=>{clearTimeout(d[y]),d[y]=setTimeout(O,k)},T=y=>{clearTimeout(d[y]),delete d[y],delete u[y]},A=y=>{T(y);const O=`${y}.`;for(const k of Object.keys(u))k.startsWith(O)&&T(k)},j=async y=>{if(!i.keepIsValid&&!t.disabled&&(b("isValid")||y)){const O=++C;let k;t.resolver?(k=Ve((await q()).errors),O===C&&F()):k=await ae({fields:r,onlyCheckValid:!0,eventType:pn.VALID}),O===C&&k!==n.isValid&&_.state.next({isValid:k})}},F=(y,O)=>{!t.disabled&&b("isValidating","validatingFields")&&((y||c.mount).forEach(k=>{k&&(O?_e(n.validatingFields,k,O):Fe(n.validatingFields,k))}),_.state.next({validatingFields:n.validatingFields,isValidating:!Ve(n.validatingFields)}))},z=()=>{n.dirtyFields=Gt(o,s,void 0,r)},Y=(y,O=[],k,N,$=!0,W=!0)=>{if(N&&k&&!t.disabled){i.action=!0;const L=U(r,y);if(i.actionArrayLengths.has(y)||i.actionArrayLengths.set(y,Array.isArray(L)?L.length:0),W&&Array.isArray(L)){const be=k(L,N.argA,N.argB);$&&_e(r,y,be)}const D=U(n.errors,y);if(W&&Array.isArray(D)){const be=D.root,we=k(D,N.argA,N.argB)||D;be&&(we.root=be),$&&_e(n.errors,y,we),c_(n.errors,y),n.errors={...n.errors}}const V=U(n.touchedFields,y),Q=W&&Array.isArray(V);if(Q){const be=k(V,N.argA,N.argB);$&&_e(n.touchedFields,y,be)}const ue=U(n.dirtyFields,y);if(W&&Array.isArray(ue)){const be=k(ue,N.argA,N.argB)||ue;$&&_e(n.dirtyFields,y,be)}b("dirtyFields")?z():a=!0,_.state.next({name:y,isDirty:B(y,O),dirtyFields:n.dirtyFields,...Q&&{touchedFields:n.touchedFields},errors:n.errors,isValid:n.isValid})}else _e(s,y,O)},Z=(y,O)=>{_e(n.errors,y,O),n.errors={...n.errors},_.state.next({errors:n.errors})},K=y=>{Object.keys(u).forEach(T);const O=!Ve(y);n.errors=y,_.state.next({errors:n.errors,...O?{isValid:!1}:{}}),!O&&i.mount&&j()},H=y=>{const O=br(y)?[y]:Un(y);let k=s,N=o;for(let $=0;$<O.length-1;$++){const W=O[$];if(k=Xe(k)?k:k[W],N=Xe(N)?N:N[W],k===null&&N!==null)return!0}return!1},J=y=>{if(!i.actionArrayLengths.size)return!1;const O=br(y)?[y]:Un(y);let k=s,N="",$=-1,W=0;for(let L=0;L<O.length;L++){if(Xe(k))return!1;const D=O[L];if(N=N?`${N}.${D}`:D,Array.isArray(k)&&+D>=k.length)return $===-1?!1:L===$?+D<W:!0;if(i.actionArrayLengths.has(N)&&($=L+1,W=i.actionArrayLengths.get(N)),k=k[D],ve(k)&&$!==-1&&L>$&&+O[$]<W)return!0}return!1},ne=(y,O,k,N)=>{const $=U(r,y);if($){if(H(y)||J(y))return;const W=ve(U(s,y)),L=U(s,y,ve(k)?U(o,y):k),D=!!N&&!n.isReady&&X0(N);if(ve(L)||N&&N.defaultChecked||D||O){const V=O?L:Xc($._f);b("dirtyFields")&&!at(U(s,y),V)&&(a=!0),_e(s,y,V),D&&te(y,V)}else le(y,L);i.mount&&!i.action&&(t.resolver&&b("isValidating","validatingFields")?Promise.resolve().then(()=>j()):j(),W&&n.isDirty&&b("isDirty")&&(B()||(n.isDirty=!1,_.state.next({...n}))),t.shouldUnregister&&W&&!ve(U(s,y))&&Fs(y,c)&&(i.watch=!0))}},te=(y,O,k,N,$)=>{let W=!1,L=!1;const D={name:y};if(!t.disabled||N===!0){if(!k||N){const V=at(U(o,y),O);if(b("isDirty")&&(L=n.isDirty,n.isDirty=D.isDirty=!V||B(),W=L!==D.isDirty),L=!!U(n.dirtyFields,y),V)Fe(n.dirtyFields,y);else{const ue=U(o,y),be=U(r,y),we=!(be&&be._f)&&(Ae(ue)||Array.isArray(ue))?Gt(ue,O,void 0,be):!0;_e(n.dirtyFields,y,we)}let Q=!1;if(a||V&&(b("isDirty")?n.isDirty:B())){a=!1;const ue=Gt(o,s,void 0,r);at(n.dirtyFields,ue)||(Q=!0,l_(n.dirtyFields,ue))}D.dirtyFields=n.dirtyFields,W=W||b("dirtyFields")&&(Q||L!==!V)}if(k){const V=Yc(n.touchedFields,y)?U(n.touchedFields,y):void 0;V||(_e(n.touchedFields,y,k),D.touchedFields=n.touchedFields,W=W||b("touchedFields")&&V!==k)}W&&$&&_.state.next(D)}return W?D:{}},X=(y,O,k,N)=>{const $=U(n.errors,y),W=b("isValid")&&yt(O)&&n.isValid!==O;if(t.delayError&&k?(u[y]=R(y,()=>Z(y,k)),u[y](t.delayError)):(T(y),k?_e(n.errors,y,k):Fe(n.errors,y),n.errors={...n.errors}),(k?!at($,k,!0):$)||!Ve(N)||W){const L={...N,...W&&yt(O)?{isValid:O}:{},errors:n.errors,name:y};_.state.next(L)}},q=async y=>(F(y,!0),await t.resolver(s,t.context,r_(y||c.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),me=async y=>{const O=S,{errors:k}=await q(y);if(O!==S)return k;if(F(y),y){for(const N of y){const $=U(k,N);A(N);const W=c.array.has(N)&&Ae($)&&!Object.keys($).some(V=>!Number.isNaN(Number(V))),L=U(r,N),D=Ae(L)&&Object.keys(L).some(V=>V!=="_f");W?Zc(n.errors,{[N]:$},N):$&&($.type||$.message)||Array.isArray($)||Ae($)&&D?_e(n.errors,N,$):Fe(n.errors,N)}n.errors={...n.errors}}else Object.keys(u).forEach(T),n.errors=k;return k},he=async({name:y,eventType:O})=>{if(t.validate){const k=S,N=await t.validate({formValues:s,formState:n,name:y,eventType:O});if(k!==S)return!0;if(Ae(N)){let $=!0;Rn(Lr);for(const W in N){const L=N[W];L&&($=!1,on(`${Lr}.${W}`,{message:rt(L.message)?L.message:"",type:L.type||Je.validate}))}return $}else return rt(N)||!N?(on(Lr,{message:N||"",type:Je.validate}),!1):(Rn(Lr),!0)}return!0},ae=async({fields:y,onlyCheckValid:O,name:k,eventType:N,context:$={valid:!0,runRootValidation:!1}})=>{const W=S;if(t.validate&&!$.runRootValidation&&($.runRootValidation=!0,!await he({name:k,eventType:N})&&($.valid=!1,O)))return $.valid;for(const L in y){const D=y[L];if(D){const{_f:V,...Q}=D;if(V){const ue=c.array.has(V.name),be=D._f&&o_(D._f),we=b("isValidating","validatingFields");be&&we&&F([V.name],!0);const ke=await Gc(D,c.disabled,s,P,t.shouldUseNativeValidation&&!O,ue);if(W!==S)return $.valid;if(be&&we&&F([V.name]),ke[V.name]&&($.valid=!1,O)||(O||(T(V.name),U(ke,V.name)?ue?Zc(n.errors,ke,V.name):_e(n.errors,V.name,ke[V.name]):Fe(n.errors,V.name)),t.shouldUseNativeValidation&&ke[V.name]))break}!Ve(Q)&&await ae({context:$,onlyCheckValid:O,fields:Q,name:L,eventType:N})}}return $.valid},re=()=>{for(const y of c.unMount){const O=U(r,y);O&&(O._f.refs?O._f.refs.every(k=>!Vs(k)):!Vs(O._f.ref))&&Ir(y)}c.unMount=new Set},B=(y,O)=>(y&&O&&_e(s,y,O),!at(i.mount?s:o,o)),se=(y,O,k)=>{const N=i.mount?s:ve(O)||!ve(y)?o:O;return Ii(y,c,ve(y)?{...N}:N,k,O)},ye=y=>Sh(U(i.mount?s:o,y,t.shouldUnregister?U(o,y,[]):[])),le=(y,O,k={},N=!1,$=!1,W=!1)=>{const L=U(r,y);let D=O;if(L){const V=L._f;V&&(!V.disabled&&_e(s,y,Di(O,V)),D=Yo(V.ref)&&Xe(O)?"":O,Ch(V.ref)?[...V.ref.options].forEach(Q=>Q.selected=D.includes(Q.value)):V.refs?kr(V.ref)?V.refs.forEach(Q=>{(!Q.defaultChecked||!Q.disabled)&&(Array.isArray(D)?Q.checked=!!D.find(ue=>ue===Q.value):Q.checked=D===Q.value||!!D)}):V.refs.forEach(Q=>Q.checked=Q.value===D):ms(V.ref)?V.ref.value="":(V.ref.value=D,!V.ref.type&&!$&&!W&&_.state.next({name:y,values:N?s:x(y)?Oe(s):void 0})))}(k.shouldDirty||k.shouldTouch)&&te(y,L&&L._f&&!L._f.disabled&&(L._f.valueAsNumber||L._f.valueAsDate||L._f.setValueAs)?Di(O,L._f):D,k.shouldTouch,k.shouldDirty,!$),k.shouldValidate&<(y,{delayError:k.delayError}),k.shouldValidate&&L&&L._f&&L._f.deps&&(!Array.isArray(L._f.deps)||L._f.deps.length>0)&<(L._f.deps)},Pe=(y,O,k,N=!1,$=!1,W=!1)=>{c.array.has(y)&&_.array.next({name:y,values:N?s:Oe(s)});for(const L in O){if(!O.hasOwnProperty(L))continue;const D=O[L],V=y+"."+L,Q=U(r,V);(c.array.has(y)||Ae(D)||Q&&!Q._f)&&!Sn(D)?Pe(V,D,k,N,$,W):le(V,D,k,N,$,W)}},je=(y,O,k,N,$=!1)=>{const W=U(r,y),L=c.array.has(y),D=N?O:Oe(O),V=U(s,y),Q=at(V,D);if(Q||_e(s,y,D),L)_.array.next({name:y,values:N?s:Oe(s)}),b("isDirty","dirtyFields")&&k.shouldDirty&&(z(),$||_.state.next({name:y,dirtyFields:n.dirtyFields,isDirty:B(y,D)})),k.shouldValidate&<(y,{delayError:k.delayError});else{const ue=Array.isArray(D)&&!D.length||Ve(D),be=!Q&&!$;!W||W._f||Xe(D)||ue?le(y,D,k,N,$,be):Pe(y,D,k,N,$,be)}if(!Q&&!$){const ue=Fs(y,c),be=i.mount||ue?y:void 0,we=L?[]:n_(c.array,y),ke=N?s:x(be)||we.some(x)?Oe(s):void 0;_.state.next({...ue&&n,name:be,values:ke});for(const mt of we)_.state.next({name:mt,values:ke})}},Ee=(y,O,k={})=>je(y,O,k,!1),$e=(y,O={})=>{const k=nt(y)?y(s):y;if(!at(s,k)){s={...s,...k};for(const N of c.mount)Yc(k,N)&&je(N,U(k,N),O,!0,!0);_.state.next({...n,name:void 0,type:void 0,...l.size?{values:s}:{}}),O.shouldValidate&&j()}},We=async y=>{i.mount=!0;const O=y.target;let k=O.name,N=!0;const $=U(r,k),W=L=>{N=Number.isNaN(L)||Sn(L)&&isNaN(L.getTime())||at(L,U(s,k,L))};if($){let L,D;const V=O.type?Xc($._f):Ri(y),Q=y.type===pn.BLUR||y.type===pn.FOCUS_OUT,ue=!s_($._f)&&!t.validate&&!t.resolver&&!U(n.errors,k)&&!$._f.deps,be=ue||a_(Q,U(n.touchedFields,k),n.isSubmitted,p,f),we=Fs(k,c,Q);_e(s,k,Oe(V)),Q?(!O||!O.readOnly)&&($._f.onBlur&&$._f.onBlur(y),Object.prototype.hasOwnProperty.call(u,k)&&u[k](0)):$._f.onChange&&$._f.onChange(y);const ke=te(k,V,Q),mt=!Ve(ke)||we;if(!Q&&_.state.next({name:k,type:y.type,...x(k)?{values:Oe(s)}:{}}),be)return(!ue||!n.isValid)&&b("isValid")&&(t.mode==="onBlur"?Q&&j():Q||j()),mt&&_.state.next({name:k,...we?{}:ke});if(!t.resolver&&t.validate&&await he({name:k,eventType:y.type}),!Q&&we&&_.state.next({...n}),t.resolver){const ln=S,{errors:_t}=await q([k]);if(ln!==S)return;if(F([k]),W(V),!N){!Ve(ke)&&_.state.next(ke);return}const Dr=tl(n.errors,r,k),tc=tl(_t,r,Dr.name||k);L=tc.error,k=tc.name,D=Ve(_t)}else{const ln=S;if(F([k],!0),L=(await Gc($,c.disabled,s,P,t.shouldUseNativeValidation))[k],ln!==S)return;if(F([k]),W(V),N){if(L)D=!1;else if(b("isValid")&&(D=await ae({fields:r,onlyCheckValid:!0,name:k,eventType:y.type}),ln!==S))return}}N&&($._f.deps&&(!Array.isArray($._f.deps)||$._f.deps.length>0)&<($._f.deps),X(k,D,L,ke))}},kt=(y,O)=>{if(U(n.errors,O)&&y.focus)return y.focus(),1},lt=async(y,O={})=>{let k,N;const $=Ls(y);if(t.resolver){const W=S,L=await me(ve(y)?y:$);if(k=Ve(L),N=y?!$.some(D=>U(L,D)):k,W!==S)return N}else y?(N=(await Promise.all($.map(async W=>{const L=U(r,W);return await ae({fields:L&&L._f?{[W]:L}:L,eventType:pn.TRIGGER})}))).every(Boolean),!(!N&&!n.isValid)&&j()):N=k=await ae({fields:r,name:y,eventType:pn.TRIGGER});if(O.delayError&&t.delayError&&rt(y)){const W=U(n.errors,y);W?(Fe(n.errors,y),u[y]=R(y,()=>Z(y,W)),u[y](t.delayError)):T(y)}if(O.shouldTouch)for(const W of y?$:c.mount)!c.array.has(W)&&_e(n.touchedFields,W,!0);return n.errors={...n.errors},_.state.next({...!rt(y)||b("isValid")&&k!==n.isValid?{}:{name:y},...t.resolver||!y?{isValid:k}:{},...O.shouldTouch&&b("touchedFields")?{touchedFields:n.touchedFields}:{},errors:n.errors}),O.shouldFocus&&!N&&Zr(r,kt,y?$:c.mount),N},Le=(y,O)=>{let k={...i.mount?s:o};return O&&(k=Eh(O.dirtyFields?n.dirtyFields:n.touchedFields,k)),ve(y)?k:rt(y)?U(k,y):y.map(N=>U(k,N))},qn=y=>ve(y)?{...n.errors}:rt(y)?U(n.errors,y):y.map(O=>U(n.errors,O)),pt=(y,O)=>{const k=O||n,N=U(k.errors,y);return{invalid:!!N,isDirty:!!U(k.dirtyFields,y),error:N,isValidating:!!U(k.validatingFields,y),isTouched:!!U(k.touchedFields,y)}},Rn=y=>{const O=y?Ls(y):void 0;O?O.forEach(k=>{A(k),Fe(n.errors,k),n.errors={...n.errors},_.state.next({name:k,errors:n.errors})}):(Object.keys(u).forEach(T),n.errors={},_.state.next({errors:n.errors}))},on=(y,O,k)=>{A(y);const N=(U(r,y,{_f:{}})._f||{}).ref,$=U(n.errors,y)||{},{ref:W,message:L,type:D,types:V,...Q}=$;_e(n.errors,y,{...Q,...O,ref:N}),n.errors={...n.errors},_.state.next({name:y,errors:n.errors,isValid:!1}),k&&k.shouldFocus&&N&&N.focus&&N.focus()},ze=(y,O)=>{if(nt(y)){const k={};l.add(k);const{unsubscribe:N}=_.state.subscribe({next:$=>"values"in $&&y($.values||se(void 0,O),$)});return{unsubscribe:()=>{l.delete(k),N()}}}return se(y,O,!0)},Tr=y=>{const O={name:y.name,exact:y.exact};y.formState&&y.formState.values&&l.add(O);const{unsubscribe:k}=_.state.subscribe({next:N=>{if(rl(y.name,N.name,y.exact)&&i_(N,y.formState||g,y.reRenderRoot)){const $=N.values||{...s};y.callback({...n,...N,values:$,defaultValues:o})}}});return()=>{l.delete(O),k()}},sn=y=>{i.mount=!0;const O=Object.keys(y.formState||{}).filter(N=>y.formState&&y.formState[N]);for(const N of O)w[N]=(w[N]||0)+1;const k=Tr({...y,formState:{...v,...y.formState}});return()=>{for(const N of O.splice(0))w[N]--;k()}},Ir=(y,O={})=>{for(const k of y?Ls(y):c.mount)c.mount.delete(k),c.array.delete(k),c.disabled.delete(k),O.keepValue||(Fe(r,k),Fe(s,k)),O.keepError||(A(k),Fe(n.errors,k)),!O.keepDirty&&Fe(n.dirtyFields,k),!O.keepTouched&&Fe(n.touchedFields,k),!O.keepIsValidating&&Fe(n.validatingFields,k),!t.shouldUnregister&&!O.keepDefaultValue&&Fe(o,k);O.keepError||(n.errors={...n.errors}),l.size&&_.state.next({values:Oe(s)}),_.state.next({...n,...O.keepDirty?{}:{isDirty:B()},...O.keepIsValidating?{}:{isValidating:!Ve(n.validatingFields)}}),!O.keepIsValid&&j()},fo=({disabled:y,name:O})=>{if(yt(y)&&i.mount||y||c.disabled.has(O)){const $=c.disabled.has(O)!==!!y;y?c.disabled.add(O):c.disabled.delete(O),$&&i.mount&&!i.action&&j()}},an=(y,O={})=>{let k=U(r,y);const N=yt(O.disabled)||yt(t.disabled),$=!c.registerName.has(y)&&k&&k._f&&!k._f.mount;if(_e(r,y,{...k||{},_f:{...k&&k._f?k._f:{ref:{name:y}},name:y,mount:!0,...O}}),c.mount.add(y),k&&k._f){const W=U(r,y);for(const L of B0)L in O||delete W._f[L]}return k&&!$?fo({disabled:yt(O.disabled)?O.disabled:t.disabled,name:y}):ne(y,!0,O.value),{...N?{disabled:O.disabled||t.disabled}:{},...t.progressive?{required:!!O.required,min:$r(O.min),max:$r(O.max),minLength:$r(O.minLength),maxLength:$r(O.maxLength),pattern:$r(O.pattern)}:{},name:y,onChange:We,onBlur:We,ref:W=>{if(W){c.registerName.add(y),an(y,O),c.registerName.delete(y),k=U(r,y);const L=ve(W.value)&&W.querySelectorAll&&W.querySelectorAll("input,select,textarea")[0]||W,D=e_(L),V=k._f.refs||[];if(D?V.find(ue=>ue===L):L===k._f.ref)return;const Q={...k._f};D?(Q.refs=[...V.filter(Vs),L,...Array.isArray(U(o,y))?[{}]:[]],Q.ref={type:L.type,name:y}):(Q.ref=L,delete Q.refs),_e(r,y,{_f:Q}),ne(y,!1,void 0,L)}else k=U(r,y,{}),k._f&&(k._f.mount=!1),(t.shouldUnregister||O.shouldUnregister)&&!(vh(c.array,y)&&i.action)&&c.unMount.add(y)}}},Ar=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&Zr(r,kt,c.mount),ho=y=>{yt(y)&&(_.state.next({disabled:y}),Zr(r,(O,k)=>{const N=U(r,k);N&&(O.disabled=N._f.disabled||y,Array.isArray(N._f.refs)&&N._f.refs.forEach($=>{$.disabled=N._f.disabled||y}))},0))},Qn=(y,O)=>async k=>{let N,$;k&&(k.preventDefault&&k.preventDefault(),k.persist&&k.persist());let W=Oe(s);if(_.state.next({isSubmitting:!0}),t.resolver){const L=S,{errors:D,values:V}=await q();if(L!==S)return;F(),Object.keys(u).forEach(T),n.errors=D,W=Oe(V)}else{const L=S;if(await ae({fields:r,eventType:pn.SUBMIT}),L!==S)return;Fe(n.errors,yh),n.errors={...n.errors}}if(c.disabled.size)for(const L of c.disabled)Fe(W,L);if(Ve(n.errors)){_.state.next({errors:{}});try{N=await y(W,k)}catch(L){$=L}}else O&&await O({...n.errors},k),Ar(),setTimeout(Ar);if(_.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Ve(n.errors)&&!$,submitCount:n.submitCount+1,errors:n.errors}),$)throw $;return N},cn=(y,O={})=>{U(r,y)&&(Fe(n.validatingFields,y),ve(O.defaultValue)?Ee(y,Oe(U(o,y))):(Ee(y,O.defaultValue),_e(o,y,Oe(O.defaultValue))),O.keepTouched||Fe(n.touchedFields,y),O.keepDirty||(Fe(n.dirtyFields,y),n.isDirty=O.defaultValue?B(y,Oe(U(o,y))):B()),O.keepError||(A(y),Fe(n.errors,y),n.errors={...n.errors},j()),_.state.next({...n,isValidating:!Ve(n.validatingFields)}))},Nr=(y,O={})=>{S++;const k=y?Oe(y):o,N=Oe(k),$=Ve(y),W=N,L=r;if(Object.keys(u).forEach(T),O.keepDefaultValues||(o=k),!O.keepValues){if(O.keepDirtyValues){const D=new Set([...c.mount,...kh(Gt(o,s,void 0,L),n.dirtyFields)]);for(const V of D){const Q=U(n.dirtyFields,V),ue=U(s,V),be=U(W,V);Q&&!ve(ue)?_e(W,V,ue):!Q&&!ve(be)&&Ee(V,be)}}else{if(gs&&ve(y))for(const D of c.mount){const V=U(r,D);if(V&&V._f){const Q=Array.isArray(V._f.refs)?V._f.refs[0]:V._f.ref;if(Yo(Q)){const ue=Q.closest("form");if(ue){ue.reset();break}}}}if(O.keepFieldsRef)for(const D of c.mount)Ee(D,U(W,D));else r={}}if(t.shouldUnregister){if(s=O.keepDefaultValues?Oe(o):{},O.keepFieldsRef)for(const D of c.mount)_e(s,D,U(W,D))}else s=Oe(W);_.array.next({values:{...W}}),_.state.next({name:void 0,type:void 0,values:{...W}})}c={mount:O.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!g.isValid||!!O.keepIsValid||!!O.keepDirtyValues||!t.shouldUnregister&&!Ve(W),i.watch=!!t.shouldUnregister,i.keepIsValid=!!O.keepIsValid,i.action=!1,i.actionArrayLengths.clear(),a=!1,O.keepErrors||(n.errors={}),_.state.next({submitCount:O.keepSubmitCount?n.submitCount:0,isDirty:$?!1:O.keepDirty?n.isDirty:O.keepValues?B():!!(O.keepDefaultValues&&y&&!at(y,o)),isSubmitted:O.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:$?{}:O.keepDirtyValues?O.keepDefaultValues&&s?Gt(o,s,void 0,L):n.dirtyFields:O.keepDefaultValues&&y?Gt(o,y,void 0,L):O.keepDirty?n.dirtyFields:O.keepValues?Gt(o,s,void 0,L):{},touchedFields:O.keepTouched?n.touchedFields:{},...!O.keepIsValidating&&(n.isValidating||!Ve(n.validatingFields))?{validatingFields:{},isValidating:!1}:null,errors:O.keepErrors?n.errors:{},isSubmitSuccessful:O.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Ht=(y,O)=>Nr(nt(y)?y(s):y,{...t.resetOptions,...O}),xs=(y,O={})=>{const k=U(r,y),N=k&&k._f;if(N){const $=N.refs?N.refs[0]:N.ref;$.focus&&setTimeout(()=>{$.focus(),O.shouldSelect&&nt($.select)&&$.select()})}},Ss=y=>{const{name:O,type:k,values:N,...$}=y;Object.keys($).length&&(n={...n,...$})};_.state.subscribe({next:Ss});const wt={control:{register:an,unregister:Ir,getFieldState:pt,handleSubmit:Qn,setError:on,_subscribe:Tr,_runSchema:q,_updateIsValidating:F,_focusError:Ar,_getWatch:se,_getDirty:B,_setValid:j,_setFieldArray:Y,_setDisabledField:fo,_setErrors:K,_getFieldArray:ye,_reset:Nr,_resetDefaultValues:()=>nt(t.defaultValues)&&t.defaultValues().then(y=>{Ht(y,t.resetOptions),_.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:ho,_subjects:_,_proxyFormState:g,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(y){i=y},get _defaultValues(){return o},get _names(){return c},set _names(y){c=y},get _formState(){return n},get _options(){return t},set _options(y){t={...t,...y},f=ko(t.mode),p=ko(t.reValidateMode),P=t.criteriaMode===Rt.all}},subscribe:sn,trigger:lt,register:an,handleSubmit:Qn,watch:ze,setValue:Ee,setValues:$e,getValues:Le,getErrors:qn,reset:Ht,resetField:cn,resetDefaultValues:(y,O={})=>{if(o=Oe(y),!O.keepDirty){const k=Gt(o,s,void 0,r);n.dirtyFields=k,n.isDirty=!Ve(k)}O.keepIsValid||j(),_.state.next({...n,defaultValues:o})},clearErrors:Rn,unregister:Ir,setError:on,setFocus:xs,getFieldState:pt};return{...wt,formControl:wt}}const ol={mode:Uo.mode,reValidateMode:Uo.reValidateMode,shouldFocusError:Uo.shouldFocusError,resolver:void 0,criteriaMode:void 0,delayError:void 0,shouldUnregister:void 0,shouldUseNativeValidation:void 0,context:void 0};function d_(e={}){const t=I.useRef(void 0),n=I.useRef(void 0),r=I.useRef(e.formControl),o=I.useRef(!!e.validate),[s,i]=I.useState(()=>({...Oe(Th),isLoading:nt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:nt(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl)if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:s},e.defaultValues&&!nt(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:p,...v}=u_(e);t.current={...v,formState:s}}const a=t.current.control,c=a._options,u={};for(const p in ol)p in c&&!(p in e)&&(u[p]=ol[p]);a._options={...u,...e,validate:e.validate};const d=()=>({...a._formState,defaultValues:a._defaultValues}),{resyncIfNeeded:l,snapshot:f}=$a(d);return ja(()=>{l(!0,d,i);const p=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState,defaultValues:a._defaultValues}),reRenderRoot:!0});return i(v=>({...v,isReady:!0})),a._formState.isReady=!0,()=>{p(),f(!0,d)}},[a,l,f]),I.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),I.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),I.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),I.useEffect(()=>{o.current&&!e.validate&&t.current&&t.current.clearErrors(Lr),o.current=!!e.validate},[e.validate]),I.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),I.useEffect(()=>{if(a._proxyFormState.isDirty){const p=a._getDirty();p!==s.isDirty&&a._subjects.state.next({isDirty:p})}},[a,s.isDirty]),I.useEffect(()=>{e.values&&!at(e.values,n.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),a._options.resetOptions&&a._options.resetOptions.keepIsValid||a._setValid(),n.current=e.values,i(p=>({...p}))):a._resetDefaultValues()},[a,e.values]),I.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=I.useMemo(()=>wh(s,a),[a,s]),t.current}const sl=(e,t,n)=>{if(e&&"reportValidity"in e){const r=U(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Mi=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?sl(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>sl(o,n,e))}},il=(e,t)=>{t.shouldUseNativeValidation&&Mi(e,t);const n={};for(const r in e){const o=U(t.fields,r),s=Object.assign(e[r]||{},{ref:o&&o.refs?o.refs[0]:o&&o.ref});if(f_(t.names||Object.keys(e),r)){const i=Object.assign({},U(n,r));_e(i,"root",s),_e(n,r,i)}else _e(n,r,s)}return n},f_=(e,t)=>{const n=al(t).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(r=>al(r).match(`^${n}\\.\\d+`))};function al(e){return e.replace(/\[(\d+)]/g,".$1").replace(/[[\]]/g,"")}function ji(){return ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ji.apply(null,arguments)}function cl(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function h_(e,t){for(var n=Object.create(null);e.length;){var r=e[0],o=r.code,s=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a,c,u=r.unionErrors.reduce(function(f,p){return p.errors.length<f.errors.length?p:f}).errors[0];n[i]={message:(a=u==null?void 0:u.message)!=null?a:s,type:(c=u==null?void 0:u.code)!=null?c:o}}else n[i]={message:s,type:o};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(p){return e.push(p)})}),t){var d=n[i].types,l=d&&d[r.code];n[i]=za(i,t,n,o,l?[].concat(l,r.message):r.message)}e.shift()}return n}function p_(e,t){for(var n=Object.create(null),r=function(){var o=e[0],s=o.code,i=o.message,a=o.path.join(".");if(!n[a])if(o.code==="invalid_union"&&o.errors.length>0){var c,u,d=o.errors.reduce(function(p,v){return v.length<p.length?v:p})[0];n[a]={message:(c=d==null?void 0:d.message)!=null?c:i,type:(u=d==null?void 0:d.code)!=null?u:s}}else n[a]={message:i,type:s};if(o.code==="invalid_union"&&o.errors.forEach(function(p){return p.forEach(function(v){return e.push(ji({},v,{path:[].concat(o.path,v.path)}))})}),t){var l=n[a].types,f=l&&l[o.code];n[a]=za(a,t,n,s,f?[].concat(f,o.message):o.message)}e.shift()};e.length;)r();return n}function m_(e,t,n){if(n===void 0&&(n={}),(function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){function i(c){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):c}}var a=e;return n.mode==="sync"?i(a.parse(r,t)):Promise.resolve(a.parseAsync(r,t)).then(i)},function(i){if((function(a){var c;return!(a==null||(c=a._zod)==null||(c=c.traits)==null||!c.has("$ZodError"))})(i))return{values:{},errors:il(p_(i.issues,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};if((function(r){return"_def"in r&&typeof r._def=="object"})(e))return function(r,o,s){try{return Promise.resolve(cl(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(i){return s.shouldUseNativeValidation&&Mi({},s),{errors:{},values:n.raw?Object.assign({},r):i}})},function(i){if((function(a){return Array.isArray(a==null?void 0:a.issues)})(i))return{values:{},errors:il(h_(i.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw i}))}catch(i){return Promise.reject(i)}};throw new Error("Invalid input: not a Zod schema")}function $i(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ll(e,t="|"){return e.map(n=>jh(n)).join(t)}function zi(e,t){return typeof t=="bigint"?t.toString():t}class g_{constructor(t){this._getter=t,this._value=void 0}get value(){const t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}}function Fa(e){return new g_(e)}function v_(e){return e==null}function La(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function y_(e,t){const n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Gn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ih(e){const t=Object.getOwnPropertyDescriptor(e,"shape");return t!=null&&t.get?t.get.raw:t==null?void 0:t.value}function tn(e){return Ih(e._zod.def)??e._zod.def.shape}function Ah(e,t,n){Object.defineProperty(e,t,{get(){const r=n();return Gn(this,t,r),r},enumerable:!0,configurable:!0})}function Nh(e,t,n){t in e?Gn(e,t,n):e[t]=n}function Zn(e,t,n,r){const o=tn(t);for(const s of n){const i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?Ah(e,s,()=>{const a=t._zod.def.shape[s];return r?r(a,s):a}):Nh(e,s,r?r(i.value,s):i.value))}}function b_(e,t){for(const n of Reflect.ownKeys(t)){const r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Ah(e,n,()=>t[n]):Nh(e,n,r.value))}}function St(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function w_(e){return JSON.stringify(e)}function __(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Dh="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const x_=Fa(()=>{var e;if(Bt.jitless||typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Yr(e){if(Xo(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Xo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function Mh(e){return Yr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const S_=new Set(["string","number","symbol"]);function ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function On(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function oe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function jh(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function E_(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}const $h={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},C_={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s={};return Zn(s,e,bs(e,t)),On(e,St(n,{shape:s,checks:[]}))}function bs(e,t){var o;const n=tn(e),r=[];for(const s of Reflect.ownKeys(t)){if(!((o=Object.getOwnPropertyDescriptor(n,s))!=null&&o.enumerable))throw new Error(`Unrecognized key: "${String(s)}"`);t[s]&&r.push(s)}return r}function O_(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=new Set(bs(e,t)),i={};return Zn(i,e,Reflect.ownKeys(tn(e)).filter(a=>!s.has(a))),On(e,St(n,{shape:i,checks:[]}))}function P_(e,t){if(!Yr(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=tn(e);for(const s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return On(e,St(e._zod.def,{shape:zh(e,t)}))}function zh(e,t){const n={};return Zn(n,e,Reflect.ownKeys(tn(e))),b_(n,t),n}function R_(e,t){if(!Yr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return On(e,St(e._zod.def,{shape:zh(e,t)}))}function T_(e,t){var o,s;if(!((o=t==null?void 0:t._zod)!=null&&o.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((s=e._zod.def.checks)!=null&&s.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n={};Zn(n,e,Reflect.ownKeys(tn(e))),Zn(n,t,Reflect.ownKeys(tn(t)));const r=St(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return On(e,r)}function ul(e,t,n,r="partial"){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);const a=n?new Set(bs(t,n)):void 0,c={};return Zn(c,t,Reflect.ownKeys(tn(t)),e&&((u,d)=>a&&!a.has(d)?u:new e({type:"optional",innerType:u}))),On(t,St(t._zod.def,{shape:c,checks:[]}))}function I_(e,t,n){const r=n?new Set(bs(t,n)):void 0,o={};return Zn(o,t,Reflect.ownKeys(tn(t)),(s,i)=>r&&!r.has(i)?s:new e({type:"nonoptional",innerType:s})),On(t,St(t._zod.def,{shape:o}))}function Yt(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function A_(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)===!1)return!0;return!1}function Va(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function zr(e){return typeof e=="string"?e:e==null?void 0:e.message}function dl(e){const t=[];for(const n of e??[]){const r=n._zod.def;if(!/_(length|size)$|_equals$/.test(r.check))break;const o=r.maximum??r.length??r.size;o>=0&&t.push([o,n])}return t}function Fi(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function Or(e,t,n){var c,u,d,l,f,p,v,g,w,b;var r;const o=(u=(c=e.inst)==null?void 0:c._zod)==null?void 0:u.traits;o!=null&&o.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);const s=e.schema!==e.inst?(l=(d=e.schema)==null?void 0:d._zod.def)==null?void 0:l.error:void 0,i=e.message?e.message:zr((v=(p=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:p.error)==null?void 0:v.call(p,e))??zr(s==null?void 0:s(e))??zr((g=t==null?void 0:t.error)==null?void 0:g.call(t,e))??zr((w=n.customError)==null?void 0:w.call(n,e))??zr((b=n.localeError)==null?void 0:b.call(n,e))??"Invalid input",a={};for(const x of Object.keys(e))x==="inst"||x==="schema"||x==="continue"||x==="input"||x==="__proto__"||(a[x]=e[x]);return a.path??(a.path=[]),a.message=i,t!=null&&t.reportInput&&(a.input=e.input),a}const N_=/[\uD800-\uDBFF]/;function Ua(e){const t=e.length;if(!N_.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function Za(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function D_(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";const n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function Jr(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function M_(e,t){for(const n in t){const r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):j_(e,n,r.value)}}function kn(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Ba(e,t,n){return kn(e,t,n,!1)}function Fh(e,t){for(const n in e){const r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return kn(this,n,r(this))},set(o){kn(this,n,o)}})}return t}function j_(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:kn(this,t,n.bind(this))},set(r){kn(this,t,r)}})}function $_(e,t){const n=Object.getPrototypeOf(e);return t in n?void 0:n}let Us,hn=!1;const z_={configurable:!0,get(){hn=!0}};function Ce(e,t,n){const r=Object.getPrototypeOf(e._zod);if(t in r&&Us!==e._zod){Us=void 0;return}Us=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,z_);const o=hn;hn=!1;try{const s=n(this);return hn?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),hn=hn||o,s}catch(s){throw delete this[t],hn=hn||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function F_(e,t,n,r){const o=$_(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){const s={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:s})}})}const L_="~constantCatch";function V_(e){const t=()=>e;return t[L_]=!0,t}var fl;const Zs={value:void 0,enumerable:!1};let hl="captureStackTrace"in Error?Error:null;function U_(e){const t=hl;if(t){const n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return hl=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function M(e,t,n,r){const o={};function s(f){this.def=f,this.constr=l,this.traits=new Set}s.prototype=o;const i=n,a=i&&new WeakSet;function c(f,p){if(f._zod){if(f._zod.traits.has(e))return}else{Zs.value=new s(p);try{Object.defineProperty(f,"_zod",Zs)}finally{Zs.value=void 0}}if(f._zod.traits.add(e),t(f,p),a){const g=Object.getPrototypeOf(f),w=f._zod.constr.prototype;let b=g;for(;b&&b!==w;)b=Object.getPrototypeOf(b);const x=b??g;a.has(x)||(a.add(x),M_(x,i))}const v=l.prototype;for(const g in v)Object.prototype.hasOwnProperty.call(v,g)&&(g in f||(f[g]=v[g].bind(f)))}const u=(r==null?void 0:r.Parent)??Object;class d extends u{}Object.defineProperty(d,"name",{value:e});function l(f){var w;const p=r!=null&&r.Parent?U_(d):this;c(p,f);const v=p._zod.deferred;if(v){for(const b of v)b();p._zod.deferred=void 0}const g=(w=globalThis.__zod_globalConfig)==null?void 0:w.postProcessor;return g&&g(p),p}return Object.defineProperty(l,"init",{value:c}),Object.defineProperty(l,Symbol.hasInstance,{value:f=>{var p,v;return r!=null&&r.Parent&&f instanceof r.Parent?!0:(v=(p=f==null?void 0:f._zod)==null?void 0:p.traits)==null?void 0:v.has(e)}}),Object.defineProperty(l,"name",{value:e}),l}class Vn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lh extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(fl=globalThis).__zod_globalConfig??(fl.__zod_globalConfig={});const Bt=globalThis.__zod_globalConfig;function Pn(e){return e&&Object.assign(Bt,e),Bt}function Z_(){const e=this._zod;return e.message??(e.message=JSON.stringify(e.def,zi,2)),e.message}function B_(e){this._zod.message=e}const H_={get:Z_,set:B_,enumerable:!0,configurable:!0},Bs={value:void 0,enumerable:!1},pl=new WeakSet([Object.prototype,Error.prototype]),W_=(e,t)=>{e.name="$ZodError",Bs.value=t,Object.defineProperty(e,"issues",Bs),Bs.value=void 0,Object.defineProperty(e,"message",H_);const n=Object.getPrototypeOf(e);pl.has(n)||(pl.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){const r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},K_=M("$ZodError",W_);function G_(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function q_(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?G_(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function Q_(e,t=n=>n.message){const n={_errors:[]},r=(o,s=[])=>{for(const i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{const a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<a.length;){const d=a[u],l=u===a.length-1;if(d==="_errors"){l&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,d)||Object.defineProperty(c,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const f=c[d];l&&f._errors.push(t(i)),c=f,u++}}}};return r(e),n}function ws(e,t){return{callee:(t==null?void 0:t.callee)??e,Err:t==null?void 0:t.Err}}const Ha=e=>{const t=(n,r,o,s)=>{const i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Vn;if(a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Wa=e=>{const t=async(n,r,o,s)=>{const i=o?{...o,async:!0}:{async:!0};let a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){const c=new((s==null?void 0:s.Err)??e)(a.issues.map(u=>Or(u,i,Pn())));throw Dh(c,(s==null?void 0:s.callee)??t),c}return a.value};return t},Ka=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new Vn;return s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}};function Vh(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>Or(o,n,Pn()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}const Ga=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?Vh(e,s.issues,o):{success:!0,data:s.value}},Y_=Symbol.for("zod.compile.invalid"),J_=Symbol.for("zod.compile.fallback"),X_=((e,t,n)=>{const r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Y_)return!0;if(r.definite===!0&&n===void 0)return!1}return e1(e,t,n)});function e1(e,t,n){const r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun;let s;if(o?(r[J_]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new Vn;return s.issues.length===0}const t1=async(e,t,n)=>{const r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},n1=e=>{const t=Ha(e),n=(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,o,a,ws(n,i))};return n},r1=e=>{const t=Ha(e),n=(r,o,s,i)=>t(r,o,s,ws(n,i));return n},o1=e=>{const t=Wa(e),n=async(r,o,s,i)=>{const a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,o,a,ws(n,i))};return n},s1=e=>{const t=Wa(e),n=async(r,o,s,i)=>await t(r,o,s,ws(n,i));return n},i1=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ka(e)(t,n,o)},a1=e=>(t,n,r)=>Ka(e)(t,n,r),c1=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return Ga(e)(t,n,o)},l1=e=>async(t,n,r)=>Ga(e)(t,n,r),u1=/^[cC][0-9a-z]{6,}$/,d1=/^[0-9a-z]+$/,f1=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,h1=/^[0-9a-vA-V]{20}$/,p1=/^[A-Za-z0-9]{27}$/,m1=/^[a-zA-Z0-9_-]{21}$/;function g1(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}const v1=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,y1=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ml=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,b1=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,w1="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function _1(){return new RegExp(w1,"u")}const x1=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,S1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,E1=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,C1=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,k1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,O1=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,P1=/^https?$/,R1=/^\+[1-9]\d{6,14}$/,Uh="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function T1(e){return new RegExp(`^${e}$`)}const I1=T1(Uh);function Li(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function A1(e){return new RegExp(`^${Li(e)}$`)}function N1(e){const t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${Li({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${Li({precision:e.precision})}`:n;return new RegExp(`^${Uh}T(?:${r})$`)}const D1=/^[\s\S]{0,}$/,M1=/^-?\d+(?:\.\d+)?$/,j1=/^(?:true|false)$/i,$1=/^[^A-Z]*$/,z1=/^[^a-z]*$/,ht=M("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qa=e=>{const t=e.value;return!v_(t)&&t.length!==void 0},es={number:"number",bigint:"bigint",object:"date"},Zh=M("$ZodCheckLessThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bh=M("$ZodCheckGreaterThan",(e,t)=>{ht.init(e,t);const n=es[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:es[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),F1=M("$ZodCheckMultipleOf",(e,t)=>{ht.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):y_(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),L1=M("$ZodCheckNumberFormat",(e,t)=>{var i;ht.init(e,t),t.format=t.format||"float64";const n=(i=t.format)==null?void 0:i.includes("int"),r=n?"int":"number",[o,s]=$h[t.format];e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),V1=M("$ZodCheckMaxLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Ua(o):s)<=t.maximum)return;const a=Za(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),U1=M("$ZodCheckMinLength",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Ua(o):s)>=t.minimum)return;const a=Za(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Z1=M("$ZodCheckLengthEquals",(e,t)=>{var n;ht.init(e,t),(n=e._zod.def).when??(n.when=qa),e._zod.check=r=>{const o=r.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Ua(o):s;if(i===t.length)return;const a=Za(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),_s=M("$ZodCheckStringFormat",(e,t)=>{var n,r;ht.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),B1=M("$ZodCheckRegex",(e,t)=>{_s.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),H1=M("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$1),_s.init(e,t)}),W1=M("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=z1),_s.init(e,t)}),K1=M("$ZodCheckIncludes",(e,t)=>{ht.init(e,t);const n=ys(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),G1=M("$ZodCheckStartsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`^${ys(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),q1=M("$ZodCheckEndsWith",(e,t)=>{ht.init(e,t);const n=new RegExp(`.*${ys(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function gl(e,t,n){e.issues.length&&t.issues.push(...Va(n,e.issues))}const Q1=M("$ZodCheckProperties",(e,t)=>{ht.init(e,t),Ba(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(i=>[i,t.shape[i]]));const o=r.value;let s;for(const[i,a]of n){const c=a._zod.run({value:o[i],issues:[]},{});c instanceof Promise?(s??(s=[]),s.push(c.then(u=>gl(u,r,i)))):gl(c,r,i)}if(s)return Promise.all(s).then(()=>{})}}),Y1=M("$ZodCheckOverwrite",(e,t)=>{ht.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class J1{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
193
193
|
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of s)this.content.push(i)}compile(){const t=Function,n=(this==null?void 0:this.content)??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
194
194
|
${n.join(`
|
|
195
195
|
`)}
|
|
@@ -245,4 +245,4 @@ ${n.join(`
|
|
|
245
245
|
|
|
246
246
|
`)}return w.write("payload.value = newResult;"),w.write("return payload;"),w.compile()};let i;const a=Xo,c=!Bt.jitless,d=c&&x_.value,l=t.catchall;let f;e._zod.parse=(p,v)=>{f??(f=r.value);const g=p.value;return a(g)?c&&d&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(i||(i=s(t.shape)),p=i(p,v),l?ep([],g,p,v,f,e,(v==null?void 0:v.abortEarly)===!0):p):n(p,v):(p.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),p)}});function bl(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Yt(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>Or(i,r,Pn())))}),t)}const Zx=M("$ZodUnion",(e,t)=>{Be.init(e,t),Ce(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Ce(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Ce(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),Ce(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){const o=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>La(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1;const i=[];for(const a of t.options){const c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>bl(a,r,e,o)):bl(i,r,e,o)}}),Bx=M("$ZodIntersection",(e,t)=>{Be.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>wl(n,c,u)):wl(n,s,i)}});function Vi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Yr(e)&&Yr(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(const s of r){if(s==="__proto__")continue;const i=Vi(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],s=t[r],i=Vi(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wl(e,t,n){const r=new Map;let o;const s=new Map,i=(u,d)=>{var f,p;let l;if(u.code==="unrecognized_keys"&&!((f=u.path)!=null&&f.length))o??(o=u),l=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&((p=u.path)==null?void 0:p.length)===1){const v=String(u.path[0]);s.has(v)||s.set(v,u),l=[v]}else return!1;for(const v of l)r.has(v)||r.set(v,{}),r.get(v)[d]=!0;return!0};for(const u of t.issues)i(u,"l")||e.issues.push(u);for(const u of n.issues)i(u,"r")||e.issues.push(u);const a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){const u=o?a.filter(d=>o.keys.includes(d)):[];u.length&&e.issues.push({...o,keys:u});for(const d of a)!u.includes(d)&&s.has(d)&&e.issues.push(s.get(d))}const c=Vi(t.value,n.value);if(!c.valid){if(Yt(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}const Hx=M("$ZodEnum",(e,t)=>{Be.init(e,t);const n=$i(t.entries),r=new Set(n);e._zod.values=r,Ce(e,"pattern",o=>{const s=$i(o.def.entries).filter(i=>S_.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>ys(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,s)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Wx=M("$ZodTransform",(e,t)=>{var n;Be.init(e,t),e._zod.optin="optional",(n=Bt.memoizer)==null||n.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lh(e.constructor.name);const s=t.transform(r.value,r);if(o.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(r.value=a,r));if(s instanceof Promise)throw new Vn;return r.value=s,r}});function _l(e,t){return e.value=t.issues.length?void 0:t.value,e}const tp=M("$ZodOptional",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Ce(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>_l(n,s)):_l(n,o)}return t.innerType._zod.run(n,r)}}),Kx=M("$ZodExactOptional",(e,t)=>{tp.init(e,t),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Gx=M("$ZodNullable",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(e,"pattern",n=>{const r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${La(r.source)}|null)$`):void 0}),Ce(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),qx=M("$ZodDefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>xl(s,t)):xl(o,t)}});function xl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Qx=M("$ZodPrefault",(e,t)=>{Be.init(e,t),e._zod.optin="defaulted",Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Yx=M("$ZodNonOptional",(e,t)=>{Be.init(e,t),Ce(e,"values",n=>{const r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>Sl(s,e)):Sl(o,e)}});function Sl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function El(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>Or(o,r,Pn()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}const Jx=M("$ZodCatch",(e,t)=>{Be.init(e,t),Ce(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Ce(e,"optout",n=>n.def.innerType._zod.optout),Ce(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>El(n,s,t,r)):El(n,o,t,r)}}),Xx=M("$ZodPipe",(e,t)=>{Be.init(e,t),Ce(e,"values",n=>n.def.in._zod.values),Ce(e,"optin",n=>n.def.in._zod.optin),Ce(e,"optout",n=>n.def.out._zod.optout),Ce(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>Oo(i,t.in,r)):Oo(s,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>Oo(s,t.out,r)):Oo(o,t.out,r)}});function Oo(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const eS=M("$ZodReadonly",(e,t)=>{Be.init(e,t),Ce(e,"propValues",n=>n.def.innerType._zod.propValues),Ce(e,"values",n=>n.def.innerType._zod.values),Ce(e,"optin",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optin}),Ce(e,"optout",n=>{var r,o;return(o=(r=n.def.innerType)==null?void 0:r._zod)==null?void 0:o.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Cl):Cl(o)}});function Cl(e){return e.memo||(e.value=Object.freeze(e.value)),e}const tS=M("$ZodCustom",(e,t)=>{ht.init(e,t),Be.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>kl(s,n,r,e));kl(o,n,r,e)}});function kl(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(Jr(o))}}class nS extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Ui="~memo",Ol=[];function np(e){return e!==null&&typeof e=="object"}function Hs(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}const rp=new WeakMap,Vr=0,Zo=1,Br=2;function Bo(e,t,n){const r=rp.get(e);if(r!==void 0)return r?Br:Vr;if(t.has(e))return Br;t.add(e);let o=Vr;const s=d=>{if(o!==Br&&(d!=null&&d._zod)){const l=Bo(d,t);l>o&&(o=l)}},i=(d,l)=>{var p;let f=Vr;for(const v of Reflect.ownKeys(d)){const g=Object.getOwnPropertyDescriptor(d,v);if(!g.enumerable)continue;const w=g.get?Zo:(p=g.value)!=null&&p._zod?Bo(g.value,t):Vr;w>f&&(f=w)}return f},a=d=>{d>o&&(o=d)},c=e._zod.def;switch(c.type){case"object":{const d=Ih(c);a(d?i(d):Zo),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(const d of c.items)s(d);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(const d of c.options)s(d);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{const d=c._cachedInner??void 0;a(d?Bo(d,t):Zo);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const d in c){const l=Object.getOwnPropertyDescriptor(c,d);if(!l||l.get)continue;const f=l.value;if(!(!f||typeof f!="object")){if(f._zod)s(f);else if(Array.isArray(f))for(const p of f)s(p)}}}return t.delete(e),rS(e,o)}function rS(e,t){return t!==Zo&&rp.set(e,t===Br),t}function oS(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}let Po;const Ro=[],sS={alloc(e,t,n){const r=Po;if(!r)return n;Po=void 0;const o={value:n,issues:null};return r.set(t.value,o),Ro.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const n=e._zod.parse,r=(o,s)=>{if(s.direction!=="backward"&&aS(s,o.value))throw new nS;return n(o,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,o,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{const i=e._zod.parse,a=(c,u)=>{if(n===void 0){const b=Bo(e,new Set);if(b===Vr)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);b===Br||r?n=!0:r=!0}const d=c.value;if(!np(d))return i(c,u);let l=u[Ui];l||(l={buckets:new WeakMap,backEdges:void 0},u[Ui]=l);let f;o===u?f=s:(f=oS(l,e),o=u,s=f);const p=f.get(d);if(p)return c.value=p.value,p.issues?p.issues.length&&c.issues.push(...Hs(p.issues)):(c.memo=!0,l.backEdges??(l.backEdges=new WeakSet),l.backEdges.add(p.value)),c;Po=f;const v=Ro.length,g=i(c,u);Po=void 0;const w=Ro.length>v?Ro.pop():void 0;return g instanceof Promise?g.then(b=>(w&&(w.issues=b.issues.length?Hs(b.issues):Ol),b)):(w&&(w.issues=g.issues.length?Hs(g.issues):Ol),g)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function iS(){return sS}function aS(e,t){var r;const n=(r=e[Ui])==null?void 0:r.backEdges;return n!==void 0&&np(t)&&n.has(t)}const cS=()=>{const e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}const n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):r[s]??s}return s=>{switch(s.code){case"invalid_type":{const i=o(s.expected),a=D_(s.input),c=o(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${jh(s.values[0])}`:`Invalid option: expected one of ${ll(s.values,"|")}`;case"too_big":{const i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{const i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{const i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${ll(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function lS(){return{localeError:cS()}}var Pl;class uS{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function dS(){return new uS}(Pl=globalThis).__zod_globalRegistry??(Pl.__zod_globalRegistry=dS());const Ur=globalThis.__zod_globalRegistry;function op(e){return e.checks&&(e.checks=[...e.checks]),e}function fS(e,t){return new e(op({type:"string",...oe(t)}))}function hS(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function pS(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function mS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function gS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function vS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function yS(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function bS(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function wS(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function _S(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function xS(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function SS(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function ES(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function CS(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function kS(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function OS(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function PS(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function RS(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function TS(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function IS(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function AS(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function NS(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function DS(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function MS(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function jS(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function $S(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function zS(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function FS(e,t){return new e(op({type:"number",checks:[],...oe(t)}))}function LS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function VS(e,t){return new e({type:"boolean",...oe(t)})}function US(e){return new e({type:"unknown"})}function ZS(e,t){return new e({type:"never",...oe(t)})}function Rl(e,t){return new Zh({check:"less_than",...oe(t),value:e,inclusive:!1})}function Ws(e,t){return new Zh({check:"less_than",...oe(t),value:e,inclusive:!0})}function Tl(e,t){return new Bh({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Ks(e,t){return new Bh({check:"greater_than",...oe(t),value:e,inclusive:!0})}function Il(e,t){return new F1({check:"multiple_of",...oe(t),value:e})}function sp(e,t){return new V1({check:"max_length",...oe(t),maximum:e})}function rs(e,t){return new U1({check:"min_length",...oe(t),minimum:e})}function ip(e,t){return new Z1({check:"length_equals",...oe(t),length:e})}function BS(e,t){return new B1({check:"string_format",format:"regex",...oe(t),pattern:e})}function HS(e){return new H1({check:"string_format",format:"lowercase",...oe(e)})}function WS(e){return new W1({check:"string_format",format:"uppercase",...oe(e)})}function KS(e,t){return new K1({check:"string_format",format:"includes",...oe(t),includes:e})}function GS(e,t){return new G1({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function qS(e,t){return new q1({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function QS(e,t){return new Q1({check:"properties",shape:e,...oe(t)})}function Pr(e){return new Y1({check:"overwrite",tx:e})}function YS(e){return Pr(t=>t.normalize(e))}function JS(){return Pr(e=>e.trim())}function XS(){return Pr(e=>e.toLowerCase())}function eE(){return Pr(e=>e.toUpperCase())}function tE(){return Pr(e=>__(e))}function nE(e,t,n){return new e({type:"array",element:t,...oe(n)})}function rE(e,t,n){return new e({type:"custom",check:"custom",fn:t,...oe(n)})}function oE(e,t){const n=sE(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Jr(o,r.value,n._zod.def));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Jr(s))}},e(r.value,r)),t);return n}function sE(e,t){const n=new ht({check:"custom",...oe(t)});return n._zod.check=e,n}function Hr(e,...t){for(const n of t)for(const r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Gn(e,r,n[r]);return e}function ap(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ur,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",intersections:[],deferred:[],external:(e==null?void 0:e.external)??void 0}}function Rr(e,t,n,r,o){const s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(n,s),!0}function ot(e,t,n={path:[],schemaPath:[]}){var d,l;var r;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;const a=(l=(d=e._zod).toJSONSchema)==null?void 0:l.call(d);if(a)i.schema=a;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const v=i.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,v,f)}const p=e._zod.parent;p&&(i.ref||(i.ref=p),ot(p,t,f),t.seen.get(p).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Hr(i.schema,c),t.io==="input"&&ut(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Al(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function cp(e,t){var i,a,c,u;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;const r=new Map;for(const d of e.seen.entries()){const l=(i=e.metadataRegistry.get(d[0]))==null?void 0:i.id;if(l){const f=r.get(l);if(f&&f!==d[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,d[0])}}const o=d=>{var g;const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const w=(g=e.external.registry.get(d[0]))==null?void 0:g.id,b=e.external.uri??(_=>_);if(w)return{ref:b(w)};const x=d[1].defId??d[1].schema.id??`schema${e.counter++}`;return d[1].defId=x,{defId:x,ref:`${b("__shared")}#/${l}/${Al(x)}`}}const f="#",p=`${f}/${l}/`;if(d[1]===n&&!d[1].schema.id)return{ref:f};const v=d[1].schema.id??`__schema${e.counter++}`;return{defId:v,ref:p+Al(v)}},s=d=>{if(d[1].schema.$ref)return;const l=d[1],{ref:f,defId:p}=o(d);l.def={...l.schema},p&&(l.defId=p);const v=l.schema;for(const g in v)delete v[g];v.$ref=f};if(e.cycles==="throw")for(const d of e.seen.entries()){const l=d[1];if(l.cycle)throw new Error(`Cycle detected: #/${(a=l.cycle)==null?void 0:a.join("/")}/<root>
|
|
247
247
|
|
|
248
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const l=d[1];if(t===d[0]){s(d);continue}if(e.external){const p=(c=e.external.registry.get(d[0]))==null?void 0:c.id;if(t!==d[0]&&p){s(d);continue}}if((u=e.metadataRegistry.get(d[0]))==null?void 0:u.id){s(d);continue}if(l.cycle){s(d);continue}l.count>1&&e.reused==="ref"&&s(d)}e.external&&(e.sharedDefsExtractedFor=e.external)}function lp(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;lp(r);const o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;const s=r.type;for(const i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const up=new Set(["type","properties","required","additionalProperties"]),Nl=["oneOf","anyOf"];function Dl(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Zi(e){var s;const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const a in i)if(!up.has(a))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const a in i.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const c=[];for(const d of t){const l=((s=d.properties)==null?void 0:s[a])??Dl(d);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}const u=c.length===1?c[0]:Zi(c)??{allOf:c};Gn(n,a,u)}for(const a of i.required??[])r.add(a)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{const i=[];for(const a of t){const c=Dl(a);c&&!i.some(u=>JSON.stringify(u)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function iE(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of up)if(o in e)return;const n=t.filter(o=>Nl.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=Zi(t);else{const o=n[0],s=Nl.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;const i=t.filter(c=>c!==o),a=o[s].map(c=>Zi([...i,c]));if(a.some(c=>!c))return;r={[s]:a}}r&&(delete e.allOf,Hr(e,r))}function dp(e,t){var a,c,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const f=e.seen.get(l);if(f.ref===null)return;const p=f.def??f.schema,v={...p},g=f.ref;if(f.ref=null,g){r(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Hr(p,x),Hr(p,v),l._zod.parent===g)for(const C in p)C==="$ref"||C==="allOf"||C in v||delete p[C];if(x.$ref&&b.def)for(const C in p)C==="$ref"||C==="allOf"||C in b.def&&JSON.stringify(p[C])===JSON.stringify(b.def[C])&&delete p[C]}const w=l._zod.parent;if(w&&w!==g){r(w);const b=e.seen.get(w);if(b!=null&&b.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const x in p)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(p[x])===JSON.stringify(b.def[x])&&delete p[x]}e.override({zodSchema:l,jsonSchema:p,path:f.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const l of[...e.seen.entries()].reverse())r(l[0]);if(e.target!=="openapi-3.0")for(const l of e.seen.entries())lp(l[1].def??l[1].schema);for(const l of e.deferred)l();if(e.intersections.length){const l=new Map;for(const f of e.seen.values())for(const p of[f.schema,f.def]){const v=p==null?void 0:p.allOf;if(!Array.isArray(v))continue;const g=l.get(v);g?g.push(p):l.set(v,[p])}for(const f of e.intersections)for(const p of l.get(f)??[])iE(p)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const l=(c=e.external.registry.get(t))==null?void 0:c.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Hr(o,n.defId?n.schema:n.def??n.schema);const s=(u=e.metadataRegistry.get(t))==null?void 0:u.id;s!==void 0&&o.id===s&&delete o.id;const i=((d=e.external)==null?void 0:d.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,Gn(i,f.defId,f.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:os(t,"input",e.processors),output:os(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function ut(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ut(r.element,n);if(r.type==="set")return ut(r.valueType,n);if(r.type==="lazy")return ut(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return ut(r.innerType,n);if(r.type==="intersection")return ut(r.left,n)||ut(r.right,n);if(r.type==="record"||r.type==="map")return ut(r.keyType,n)||ut(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ut(r.in,n)||ut(r.out,n);if(r.type==="object"){for(const o in r.shape)if(ut(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(ut(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(ut(o,n))return!0;return!!(r.rest&&ut(r.rest,n))}return!1}const aE=(e,t={})=>n=>{const r=ap({...n,processors:t});return ot(e,r),cp(r,e),dp(r,e)},os=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=ap({...o??{},target:s,io:t,processors:n});return ot(e,i),cp(i,e),dp(i,e)},wr=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_r=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ml=(e,t)=>{wr(e,"minimum",t),_r(e,"maximum",t)},fp=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},hp=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},pp=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},mp=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},jl=(e,t)=>wr(e,"minimum",t.minimum),$l=(e,t)=>_r(e,"maximum",t.maximum),zl=e=>(t,n)=>{mp(t,n.format);const[r,o]=e[n.format];wr(t,"minimum",r),_r(t,"maximum",o)},Gs={greater_than:(e,t)=>wr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>_r(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>fp(e,t.value),number_format:zl($h),bigint_format:zl(C_),min_length:jl,max_length:$l,length_equals:(e,t)=>Ml(e,t.length),min_size:jl,max_size:$l,size_equals:(e,t)=>Ml(e,t.size),string_format:(e,t)=>{mp(e,t.format),t.pattern&&hp(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>pp(e,t.mime)};function Zt(e){var s;const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)(s=Gs[i._zod.def.check])==null||s.call(Gs,t,i._zod.def);const o=e._zod.bag;o.minimum!==void 0&&wr(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&wr(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&_r(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&_r(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&fp(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&pp(t,o.mime);for(const i of o.patterns??[])hp(t,i);return t}const cE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lE=new Map([[Yh,k1],[Ya,O1]]),uE=e=>lE.get(e)??e,dE=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:d}=Zt(e);if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=cE[a]??a,o.format===""&&delete o.format,(a==="time"||d)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c].map(uE);l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},fE=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:d}=Zt(e);o.type=d?"integer":"number";const l=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(l?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),f?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof i=="number"&&(o.maximum=i),a){const v=new Set;for(const b of a)Number.isFinite(b)&&b!==0?v.add(Math.abs(b)):Rr(e,t,o,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,...w]=v;g!==void 0&&(o.multipleOf=g),w.length&&(o.allOf=[...o.allOf??[],...w.map(b=>({multipleOf:b}))])}},hE=(e,t,n,r)=>{n.type="boolean"},pE=(e,t,n,r)=>{n.not={}},mE=(e,t,n,r)=>{},gE=(e,t,n,r)=>{const o=e._zod.def,s=$i(o.entries);if(s.length===0){n.not={};return}s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},vE=(e,t,n,r)=>{Rr(e,t,n,r,"Custom types cannot be represented in JSON Schema")},yE=(e,t,n,r)=>{Rr(e,t,n,r,"Transforms cannot be represented in JSON Schema")},bE=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=Zt(e);typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ot(s.element,t,{...r,path:[...r.path,"items"]})};function Bi(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bi(t.out):t.type==="catch"?Bi(t.innerType):e._zod.optin}const wE=(e,t,n,r)=>{var u;const o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Rr(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const d in i)Gn(o.properties,d,ot(i[d],t,{...r,path:[...r.path,"properties",d]}));const c=[];for(const d of Object.keys(i)){const l=s.shape[d];(t.io==="input"?Bi(l)===void 0:l._zod.optout===void 0)&&c.push(d)}c.length>0&&(o.required=c),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=ot(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},_E=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>ot(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},xE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=ot(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c,t.intersections.push(c)},SE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},EE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Ja=Symbol();function gp(e,t,n,r,o){let s=!1;const i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Rr(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Ja):JSON.parse(i)}const CE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n.default=i)},kE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n._prefault=i)},OE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Rr(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},PE=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;ot(i,t,r);const a=t.seen.get(e);a.ref=i},RE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},vp=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Fl=new WeakSet([Object.prototype,Error.prototype]);function To(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const TE=(e,t)=>{K_.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Fl.has(n)||(Fl.add(n),To(n,"format",r=>o=>Q_(r,o)),To(n,"flatten",r=>o=>q_(r,o)),To(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,zi,2)}),To(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,zi,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},At=M("ZodError",TE,void 0,{Parent:Error}),IE=Ha(At),AE=Wa(At),NE=Ka(At),DE=Ga(At),ME=n1(At),jE=r1(At),$E=o1(At),zE=s1(At),FE=i1(At),LE=a1(At),VE=c1(At),UE=l1(At);function ZE(){Bt.localeError||Pn(lS())}function Xa(){Bt.memoizer||Pn({memoizer:iS()})}const He=M("ZodType",(e,t)=>(ZE(),Be.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(St(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return On(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(VC(e,t))},superRefine(e,t){return this.check(UC(e,t))},overwrite(e){return this.check(Pr(e))},optional(){return Zl(this)},exactOptional(){return RC(this)},nullable(){return Bl(this)},nullish(){return Zl(Bl(this))},nonoptional(e){return MC(this,e)},array(){return bC(this)},or(e){return SC([this,e])},and(e){return CC(this,e)},transform(e){return Hl(this,PC(e))},default(e){return AC(this,e)},prefault(e){return DC(this,e)},catch(e){return $C(this,e)},pipe(e){return Hl(this,e)},readonly(){return LC(this)},describe(e){const t=this.clone();return Ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ur.get(this);const t=this.clone();return Ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ba(this,"~standard",{...Wh(this),jsonSchema:{input:os(this,"input"),output:os(this,"output")}})},set"~standard"(e){kn(this,"~standard",e)},parse:function e(t,n){return IE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await AE(this,t,n,{callee:e})},safeParse(e,t){return NE(this,e,t)},async safeParseAsync(e,t){return DE(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){kn(this,"spa",e)},validate(e,t){return X_(this,e,t)},validateAsync(e,t){return t1(this,e,t)},encode:function e(t,n){return ME(this,t,n,{callee:e})},decode:function e(t,n){return jE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await $E(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await zE(this,t,n,{callee:e})},safeEncode(e,t){return FE(this,e,t)},safeDecode(e,t){return LE(this,e,t)},async safeEncodeAsync(e,t){return VE(this,e,t)},async safeDecodeAsync(e,t){return UE(this,e,t)},toJSONSchema(e){return aE(this,{})(e)},get description(){var e;return(e=Ur.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),yp=M("_ZodString",(e,t)=>{Qa.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dE(e,n,r)},Fh({format:e=>Zt(e).format??null,minLength:e=>Zt(e).minimum??null,maxLength:e=>Zt(e).maximum??null},{regex(...e){return this.check(BS(...e))},includes(...e){return this.check(KS(...e))},startsWith(...e){return this.check(GS(...e))},endsWith(...e){return this.check(qS(...e))},min(...e){return this.check(rs(...e))},max(...e){return this.check(sp(...e))},length(...e){return this.check(ip(...e))},nonempty(...e){return this.check(rs(1,...e))},lowercase(e){return this.check(HS(e))},uppercase(e){return this.check(WS(e))},trim(){return this.check(JS())},normalize(...e){return this.check(YS(...e))},toLowerCase(){return this.check(XS())},toUpperCase(){return this.check(eE())},slugify(){return this.check(tE())}})),BE=M("ZodString",(e,t)=>{Qa.init(e,t),yp.init(e,t)},{email(e){return this.check(hS(qE,e))},url(e){return this.check(bS(YE,e))},jwt(e){return this.check(DS(fC,e))},emoji(e){return this.check(wS(JE,e))},guid(e){return this.check(pS(QE,e))},uuid(e){return this.check(mS(Io,e))},uuidv4(e){return this.check(gS(Io,e))},uuidv6(e){return this.check(vS(Io,e))},uuidv7(e){return this.check(yS(Io,e))},nanoid(e){return this.check(_S(XE,e))},cuid(e){return this.check(xS(eC,e))},cuid2(e){return this.check(SS(tC,e))},ulid(e){return this.check(ES(nC,e))},base64(e){return this.check(IS(lC,e))},base64url(e){return this.check(AS(uC,e))},xid(e){return this.check(CS(rC,e))},ksuid(e){return this.check(kS(oC,e))},ipv4(e){return this.check(OS(sC,e))},ipv6(e){return this.check(PS(iC,e))},cidrv4(e){return this.check(RS(aC,e))},cidrv6(e){return this.check(TS(cC,e))},e164(e){return this.check(NS(dC,e))},datetime(e){return this.check(MS(HE,e))},date(e){return this.check(jS(WE,e))},time(e){return this.check($S(KE,e))},duration(e){return this.check(zS(GE,e))}});function Ll(e){return fS(BE,e)}const Me=M("ZodStringFormat",(e,t)=>{Ne.init(e,t),yp.init(e,t)}),HE=M("ZodISODateTime",(e,t)=>{vx.init(e,t),Me.init(e,t)}),WE=M("ZodISODate",(e,t)=>{yx.init(e,t),Me.init(e,t)}),KE=M("ZodISOTime",(e,t)=>{bx.init(e,t),Me.init(e,t)}),GE=M("ZodISODuration",(e,t)=>{wx.init(e,t),Me.init(e,t)}),qE=M("ZodEmail",(e,t)=>{rx.init(e,t),Me.init(e,t)}),QE=M("ZodGUID",(e,t)=>{tx.init(e,t),Me.init(e,t)}),Io=M("ZodUUID",(e,t)=>{nx.init(e,t),Me.init(e,t)}),YE=M("ZodURL",(e,t)=>{lx.init(e,t),Me.init(e,t)}),JE=M("ZodEmoji",(e,t)=>{ux.init(e,t),Me.init(e,t)}),XE=M("ZodNanoID",(e,t)=>{dx.init(e,t),Me.init(e,t)}),eC=M("ZodCUID",(e,t)=>{fx.init(e,t),Me.init(e,t)}),tC=M("ZodCUID2",(e,t)=>{hx.init(e,t),Me.init(e,t)}),nC=M("ZodULID",(e,t)=>{px.init(e,t),Me.init(e,t)}),rC=M("ZodXID",(e,t)=>{mx.init(e,t),Me.init(e,t)}),oC=M("ZodKSUID",(e,t)=>{gx.init(e,t),Me.init(e,t)}),sC=M("ZodIPv4",(e,t)=>{_x.init(e,t),Me.init(e,t)}),iC=M("ZodIPv6",(e,t)=>{Sx.init(e,t),Me.init(e,t)}),aC=M("ZodCIDRv4",(e,t)=>{Ex.init(e,t),Me.init(e,t)}),cC=M("ZodCIDRv6",(e,t)=>{kx.init(e,t),Me.init(e,t)}),lC=M("ZodBase64",(e,t)=>{Ox.init(e,t),Me.init(e,t)}),uC=M("ZodBase64URL",(e,t)=>{Rx.init(e,t),Me.init(e,t)}),dC=M("ZodE164",(e,t)=>{Tx.init(e,t),Me.init(e,t)}),fC=M("ZodJWT",(e,t)=>{Ax.init(e,t),Me.init(e,t)}),bp=M("ZodNumber",(e,t)=>{Jh.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fE(e,n,r,o),e.isFinite=!0},Fh({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Zt(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Zt(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Zt(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>Zt(e).format??null},{gt(e,t){return this.check(Tl(e,t))},gte(e,t){return this.check(Ks(e,t))},min(e,t){return this.check(Ks(e,t))},lt(e,t){return this.check(Rl(e,t))},lte(e,t){return this.check(Ws(e,t))},max(e,t){return this.check(Ws(e,t))},int(e){return this.check(Vl(e))},safe(e){return this.check(Vl(e))},positive(e){return this.check(Tl(0,e))},nonnegative(e){return this.check(Ks(0,e))},negative(e){return this.check(Rl(0,e))},nonpositive(e){return this.check(Ws(0,e))},multipleOf(e,t){return this.check(Il(e,t))},step(e,t){return this.check(Il(e,t))},finite(){return this}}));function ik(e){return FS(bp,e)}const hC=M("ZodNumberFormat",(e,t)=>{Nx.init(e,t),bp.init(e,t)});function Vl(e){return LS(hC,e)}const pC=M("ZodBoolean",(e,t)=>{Dx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hE(e,n,r)});function ak(e){return VS(pC,e)}const mC=M("ZodUnknown",(e,t)=>{Mx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mE()});function Ul(){return US(mC)}const gC=M("ZodNever",(e,t)=>{jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pE(e,n,r)});function vC(e){return ZS(gC,e)}const yC=M("ZodArray",(e,t)=>{Xa(),Fx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bE(e,n,r,o),e.element=t.element},{min(e,t){return this.check(rs(e,t))},nonempty(e){return this.check(rs(1,e))},max(e,t){return this.check(sp(e,t))},length(e,t){return this.check(ip(e,t))},unwrap(){return this.element}});function bC(e,t){return nE(yC,e,t)}const wC=M("ZodObject",(e,t)=>{Xa(),Ux.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wE(e,n,r,o),F_(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return kC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(St(this._zod.def,{catchall:e}))},passthrough(){return this.clone(St(this._zod.def,{catchall:Ul()}))},loose(){return this.clone(St(this._zod.def,{catchall:Ul()}))},strict(){return this.clone(St(this._zod.def,{catchall:vC()}))},strip(){return this.clone(St(this._zod.def,{catchall:void 0}))},extend(e){return P_(this,e)},safeExtend(e){return R_(this,e)},merge(e){return T_(this,e)},pick(e){return k_(this,e)},omit(e){return O_(this,e)},partial(...e){return ul(wp,this,e[0])},exactPartial(...e){return ul(_p,this,e[0],"exactPartial")},required(...e){return I_(xp,this,e[0])}});function _C(e,t){const n={type:"object",shape:e??{},...oe(t)};return new wC(n)}const xC=M("ZodUnion",(e,t)=>{Zx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_E(e,n,r,o),e.options=t.options});function SC(e,t){return new xC({type:"union",options:e,...oe(t)})}const EC=M("ZodIntersection",(e,t)=>{Bx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xE(e,n,r,o)});function CC(e,t){return new EC({type:"intersection",left:e,right:t})}const Hi=M("ZodEnum",(e,t)=>{Hx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(r,o,s)=>gE(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})}});function kC(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Hi({type:"enum",entries:n,...oe(t)})}const OC=M("ZodTransform",(e,t)=>{Xa(),Wx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yE(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Lh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Jr(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Jr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function PC(e){return new OC({type:"transform",transform:e})}const wp=M("ZodOptional",(e,t)=>{tp.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Zl(e){return new wp({type:"optional",innerType:e})}const _p=M("ZodExactOptional",(e,t)=>{Kx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function RC(e){return new _p({type:"optional",innerType:e})}const TC=M("ZodNullable",(e,t)=>{Gx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bl(e){return new TC({type:"nullable",innerType:e})}const IC=M("ZodDefault",(e,t)=>{qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>CE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function AC(e,t){return new IC({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const NC=M("ZodPrefault",(e,t)=>{Qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function DC(e,t){return new NC({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const xp=M("ZodNonOptional",(e,t)=>{Yx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>EE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function MC(e,t){return new xp({type:"nonoptional",innerType:e,...oe(t)})}const jC=M("ZodCatch",(e,t)=>{Jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $C(e,t){return new jC({type:"catch",innerType:e,catchValue:typeof t=="function"?t:V_(t)})}const zC=M("ZodPipe",(e,t)=>{Xx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>PE(e,n,r,o),e.in=t.in,e.out=t.out});function Hl(e,t){return new zC({type:"pipe",in:e,out:t})}const FC=M("ZodReadonly",(e,t)=>{eS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>RE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function LC(e){return new FC({type:"readonly",innerType:e})}const Sp=M("ZodCustom",(e,t)=>{tS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vE(e,n,r,o)});function VC(e,t={}){return rE(Sp,e,t)}function UC(e,t){return oE(e,t)}const ZC=M("ZodInstanceOf",(e,t)=>{Sp.init(e,t)},{properties(e,t){return this.check(QS(e,t))}});function ck(e,t={}){const n=new ZC({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...oe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var BC=Object.defineProperty,HC=(e,t)=>BC(e,"name",{value:t,configurable:!0}),Ep=h.forwardRef(HC(function(t,n){return m.jsx(Ze.label,{...t,ref:n,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label"));const WC=so("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wi=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce(WC(),r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ep,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wi.displayName=Ep.displayName;function qs(e){const t=ee.c(10),{id:n,message:r,className:o,assertive:s}=e;let i;t[0]!==s?(i=s?{role:"alert"}:{},t[0]=s,t[1]=i):i=t[1];const a=!r&&"absolute";let c;t[2]!==o||t[3]!==a?(c=ce("text-sm text-destructive",a,o),t[2]=o,t[3]=a,t[4]=c):c=t[4];const u=r??"";let d;return t[5]!==n||t[6]!==i||t[7]!==c||t[8]!==u?(d=m.jsx("p",{id:n,...i,className:c,children:u}),t[5]=n,t[6]=i,t[7]=c,t[8]=u,t[9]=d):d=t[9],d}function KC(e){return Object.entries(e).filter(([t,n])=>t!=="root"&&typeof(n==null?void 0:n.message)=="string").length}const Wl=e=>e===1?"1 field needs attention":`${e} fields need attention`,GC=100;function qC(e){var r,o,s,i;const t=(r=e==null?void 0:e.closest("form"))==null?void 0:r.querySelector('[aria-invalid="true"]');if(!t)return"";if(t!==document.activeElement)return t.focus(),"";const n=(o=t.getAttribute("aria-describedby"))==null?void 0:o.split(" ")[0];return n&&((i=(s=document.getElementById(n))==null?void 0:s.textContent)==null?void 0:i.trim())||""}function QC(e,t){return e?`${/[.!?]$/.test(e)?e:`${e}.`} ${Wl(t)}`:Wl(t)}function YC(e){const t=ee.c(5),{errors:n,submitCount:r}=e,o=h.useRef(null),s=KC(n),[i,a]=h.useState(r),[c,u]=h.useState(""),[d,l]=h.useState(null);i!==r?(a(r),u(""),l(s>0?{submit:r,count:s}:null)):s===0&&(c!==""||d!==null)&&(u(""),l(null));let f,p;t[0]!==d?(f=()=>{if(d===null)return;const g=qC(o.current),w=setTimeout(()=>{u(QC(g,d.count)),l(null)},GC);return()=>clearTimeout(w)},p=[d],t[0]=d,t[1]=f,t[2]=p):(f=t[1],p=t[2]),h.useEffect(f,p);let v;return t[3]!==c?(v=m.jsx("p",{ref:o,"aria-live":"polite",className:"sr-only",children:c}),t[3]=c,t[4]=v):v=t[4],v}const ec=8,lk=`Use at least ${ec} characters`,JC=`Password must be at least ${ec} characters`;function uk(e,t,n){return n?t:e}const XC=so("rounded-lg bg-card text-card-foreground",{variants:{level:{0:"",1:"shadow-card-1",2:"shadow-card-2",3:"shadow-card-3",4:"shadow-card-4"}},defaultVariants:{level:2}}),Cp=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,level:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r||n[5]!==o?(i=ce(XC({level:o}),r),n[4]=r,n[5]=o,n[6]=i):i=n[6];let a;return n[7]!==s||n[8]!==t||n[9]!==i?(a=m.jsx("div",{ref:t,className:i,...s}),n[7]=s,n[8]=t,n[9]=i,n[10]=a):a=n[10],a});Cp.displayName="Card";const kp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col space-y-1.5 p-6",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});kp.displayName="CardHeader";const Op=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-2xl font-semibold leading-none tracking-tight",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Op.displayName="CardTitle";const Pp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Pp.displayName="CardDescription";const Rp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Rp.displayName="CardContent";const e2=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex items-center p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});e2.displayName="CardFooter";const t2=_C({email:Ll().email("Enter a valid email"),password:Ll().min(ec,JC)});function n2(){var le,Pe,je,Ee;const e=ee.c(58),t=su(),{resolvedTheme:n}=ss(),r=n==="dark"?"/logo-dark.svg":"/logo.svg";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:Qo.authStatus,queryFn:y0,staleTime:1/0},e[0]=o):o=e[0];const s=Wo(o),i=Qi();let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={shouldFocusError:!1,resolver:m_(t2)},e[1]=a):a=e[1];const{register:c,handleSubmit:u,setError:d,formState:l}=d_(a),{errors:f,isSubmitting:p,submitCount:v}=l;let g;e[2]!==t||e[3]!==i||e[4]!==d?(g=async function(We){try{const{status:kt}=await hh.post("/api/v1/auth/login",{email:We.email,password:We.password});if(kt!==200){d("root",{message:"Invalid email or password"});return}i.clear(),t("/app-center",{replace:!0})}catch{d("root",{message:"Network error. Please try again."})}},e[2]=t,e[3]=i,e[4]=d,e[5]=g):g=e[5];const w=g;if(((le=s.data)==null?void 0:le.initialized)===!1){let $e;return e[6]===Symbol.for("react.memo_cache_sentinel")?($e=m.jsx(Gi,{to:"/setup",replace:!0}),e[6]=$e):$e=e[6],$e}let b;e[7]!==r?(b=m.jsx("img",{src:r,alt:"tapflow",className:"w-6 h-6"}),e[7]=r,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"}),e[9]=x):x=e[9];let _;e[10]!==b?(_=m.jsxs("div",{className:"flex items-center gap-2",children:[b,x]}),e[10]=b,e[11]=_):_=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsxs(kp,{className:"text-center",children:[m.jsx(Op,{className:"text-2xl tracking-display-md",children:"Welcome back"}),m.jsx(Pp,{children:"Sign in to your team workspace"})]}),e[12]=C):C=e[12];let S;e[13]!==u||e[14]!==w?(S=u(w),e[13]=u,e[14]=w,e[15]=S):S=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(Wi,{htmlFor:"email",children:"Email"}),e[16]=P):P=e[16];const R=!!f.email,T=f.email?"email-error":void 0;let A;e[17]!==c?(A=c("email"),e[17]=c,e[18]=A):A=e[18];let j;e[19]!==R||e[20]!==T||e[21]!==A?(j=m.jsx(Go,{id:"email",type:"email",placeholder:"you@company.com",autoComplete:"email","aria-required":"true","aria-invalid":R,"aria-describedby":T,...A}),e[19]=R,e[20]=T,e[21]=A,e[22]=j):j=e[22];const F=(Pe=f.email)==null?void 0:Pe.message;let z;e[23]!==F?(z=m.jsx(qs,{id:"email-error",message:F}),e[23]=F,e[24]=z):z=e[24];let Y;e[25]!==j||e[26]!==z?(Y=m.jsxs("div",{className:"grid gap-2",children:[P,j,z]}),e[25]=j,e[26]=z,e[27]=Y):Y=e[27];let Z;e[28]===Symbol.for("react.memo_cache_sentinel")?(Z=m.jsx(Wi,{htmlFor:"password",children:"Password"}),e[28]=Z):Z=e[28];const K=!!f.password,H=f.password?"password-error":void 0;let J;e[29]!==c?(J=c("password"),e[29]=c,e[30]=J):J=e[30];let ne;e[31]!==K||e[32]!==H||e[33]!==J?(ne=m.jsx(Go,{id:"password",type:"password",autoComplete:"current-password","aria-required":"true","aria-invalid":K,"aria-describedby":H,...J}),e[31]=K,e[32]=H,e[33]=J,e[34]=ne):ne=e[34];const te=(je=f.password)==null?void 0:je.message;let X;e[35]!==te?(X=m.jsx(qs,{id:"password-error",message:te}),e[35]=te,e[36]=X):X=e[36];let q;e[37]!==ne||e[38]!==X?(q=m.jsxs("div",{className:"grid gap-2",children:[Z,ne,X]}),e[37]=ne,e[38]=X,e[39]=q):q=e[39];const me=(Ee=f.root)==null?void 0:Ee.message;let he;e[40]!==me?(he=m.jsx(qs,{assertive:!0,id:"login-error",message:me}),e[40]=me,e[41]=he):he=e[41];const ae=p?"Signing in…":"Sign in";let re;e[42]!==p||e[43]!==ae?(re=m.jsx(is,{type:"submit",size:"lg",disabled:p,className:"w-full mt-1",children:ae}),e[42]=p,e[43]=ae,e[44]=re):re=e[44];let B;e[45]!==f||e[46]!==v?(B=m.jsx(YC,{errors:f,submitCount:v}),e[45]=f,e[46]=v,e[47]=B):B=e[47];let se;e[48]!==Y||e[49]!==q||e[50]!==he||e[51]!==re||e[52]!==B||e[53]!==S?(se=m.jsxs(Cp,{level:4,className:"w-full",children:[C,m.jsx(Rp,{children:m.jsxs("form",{onSubmit:S,className:"flex flex-col gap-4",children:[Y,q,he,re,B]})})]}),e[48]=Y,e[49]=q,e[50]=he,e[51]=re,e[52]=B,e[53]=S,e[54]=se):se=e[54];let ye;return e[55]!==se||e[56]!==_?(ye=m.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:m.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-sm",children:[_,se]})}),e[55]=se,e[56]=_,e[57]=ye):ye=e[57],ye}function r2(){return new Om({defaultOptions:{queries:{retry:0,refetchOnWindowFocus:!0,networkMode:"always"}}})}const o2=h.lazy(()=>Et(()=>import("./Setup-DK6TZbwh.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.Setup}))),s2=h.lazy(()=>Et(()=>import("./Invite-D1uNMm0-.js"),__vite__mapDeps([4,1,2,3,5])).then(e=>({default:e.Invite}))),i2=h.lazy(()=>Et(()=>import("./ResetPassword-B-4Uyfwr.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.ResetPassword}))),a2=h.lazy(()=>Et(()=>import("./AppCenter-DD_6LQx-.js"),__vite__mapDeps([7,1,8,9,10,11,12,13,14,15,16,17,18,19,3])).then(e=>({default:e.AppCenter}))),c2=h.lazy(()=>Et(()=>import("./QASession-d0eOjXXo.js"),__vite__mapDeps([20,1,21,22,3,15,23,24,11,8,17,25,10,26,19,9,14,16,27])).then(e=>({default:e.QASession}))),l2=h.lazy(()=>Et(()=>import("./Runs-A7RcDLgO.js"),__vite__mapDeps([28,1,14,8,12,25,9,10,29,19,18,30,3])).then(e=>({default:e.Runs}))),u2=h.lazy(()=>Et(()=>import("./RunDetail-C50RjsuM.js"),__vite__mapDeps([31,1,14,12,30,32,10,9,33,22,17,24,3])).then(e=>({default:e.RunDetail}))),d2=h.lazy(()=>Et(()=>import("./AISessionWatch-BSBkpTom.js"),__vite__mapDeps([34,1,21,22,33,23,17,3])).then(e=>({default:e.AISessionWatch}))),f2=h.lazy(()=>Et(()=>import("./MacResources-D2UeRbKL.js"),__vite__mapDeps([35,1,21,19,25,27,36,3])).then(e=>({default:e.MacResources}))),h2=h.lazy(()=>Et(()=>import("./Default-CQ3Ae2mK.js"),__vite__mapDeps([37,1,2,14,16,15,32,10,5,3])).then(e=>({default:e.DefaultSettings}))),p2=h.lazy(()=>Et(()=>import("./Team-VoGput2p.js"),__vite__mapDeps([38,1,11,15,9,10,29,19,26,18,3])).then(e=>({default:e.TeamSettings}))),m2=h.lazy(()=>Et(()=>import("./Tokens-qkcJgunR.js"),__vite__mapDeps([39,1,14,15,11,9,10,29,19,26,18,13,3])).then(e=>({default:e.TokenSettings}))),g2=h.lazy(()=>Et(()=>import("./NotFound-DVq_rCKc.js"),__vite__mapDeps([40,1])).then(e=>({default:e.NotFound}))),v2=m.jsx("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),Ao=e=>m.jsx(h.Suspense,{fallback:v2,children:e}),y2=r2();function b2(){const e=ee.c(16);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=m.jsx(st,{path:"/login",element:m.jsx(n2,{})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(st,{path:"/setup",element:Ao(m.jsx(o2,{}))}),e[1]=n):n=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(st,{path:"/invite",element:Ao(m.jsx(s2,{}))}),e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(st,{path:"/reset-password",element:Ao(m.jsx(i2,{}))}),e[3]=o):o=e[3];let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(V0,{}),e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(st,{index:!0,element:m.jsx(Gi,{to:"/app-center",replace:!0})}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(st,{path:"/app-center",element:m.jsx(a2,{})}),e[6]=a):a=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(st,{path:"/app-center/build",element:m.jsx(c2,{})}),e[7]=c):c=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(st,{path:"/automation/runs",element:m.jsx(l2,{})}),e[8]=u):u=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(st,{path:"/automation/runs/:runId",element:m.jsx(u2,{})}),e[9]=d):d=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(st,{path:"/automation/sessions/:sessionId",element:m.jsx(d2,{})}),e[10]=l):l=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(st,{path:"/mac-resources",element:m.jsx(f2,{})}),e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(st,{path:"/settings/default",element:m.jsx(h2,{})}),e[12]=p):p=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(st,{path:"/settings/team",element:m.jsx(p2,{})}),e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsxs(st,{element:s,children:[i,a,c,u,d,l,f,p,v,m.jsx(st,{path:"/settings/tokens",element:m.jsx(m2,{})})]}),e[14]=g):g=e[14];let w;return e[15]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(tm,{client:y2,children:m.jsxs(Up,{children:[m.jsxs(Zp,{children:[t,n,r,o,g,m.jsx(st,{path:"*",element:Ao(m.jsx(g2,{}))})]}),m.jsx(Zg,{position:"bottom-right",richColors:!0})]})}),e[15]=w):w=e[15],w}Lp.createRoot(document.getElementById("root")).render(m.jsx(h.StrictMode,{children:m.jsx(Kp,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:m.jsx(b2,{})})}));export{S2 as $,tt as A,is as B,Cp as C,vt as D,fu as E,qs as F,Ge as G,E2 as H,Go as I,q2 as J,Mb as K,Wi as L,jb as M,vf as N,Ym as O,lk as P,Dc as Q,ph as R,qo as S,Db as T,ek as U,J2 as V,Y2 as W,Q2 as X,_0 as Y,K2 as Z,ck as _,m_ as a,ma as a$,G2 as a0,X2 as a1,ce as a2,rg as a3,ng as a4,Te as a5,Ze as a6,Vu as a7,nn as a8,Xt as a9,H2 as aA,vw as aB,jf as aC,ww as aD,En as aE,ik as aF,Nv as aG,w0 as aH,wa as aI,ak as aJ,V2 as aK,kC as aL,L2 as aM,so as aN,Yy as aO,k2 as aP,eb as aQ,Vd as aR,Zd as aS,Bd as aT,Ld as aU,ib as aV,nf as aW,ha as aX,us as aY,jd as aZ,as as a_,ct as aa,xa as ab,rn as ac,de as ad,U2 as ae,I0 as af,Z2 as ag,xr as ah,Yd as ai,ao as aj,F0 as ak,tk as al,hg as am,$2 as an,N2 as ao,D2 as ap,z2 as aq,j2 as ar,M2 as as,rk as at,A2 as au,nk as av,ok as aw,Jm as ax,sg as ay,B2 as az,Qi as b,gd as b0,aa as b1,Jt as b2,of as b3,bb as b4,tf as b5,Qm as b6,C2 as b7,Wo as c,kp as d,Op as e,Rp as f,uk as g,YC as h,ec as i,JC as j,y0 as k,G0 as l,Pp as m,sk as n,_C as o,T0 as p,Qo as q,W2 as r,Ll as s,oo as t,d_ as u,F2 as v,Ps as w,Wr as x,Em as y,ss as z};
|
|
248
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const d of e.seen.entries()){const l=d[1];if(t===d[0]){s(d);continue}if(e.external){const p=(c=e.external.registry.get(d[0]))==null?void 0:c.id;if(t!==d[0]&&p){s(d);continue}}if((u=e.metadataRegistry.get(d[0]))==null?void 0:u.id){s(d);continue}if(l.cycle){s(d);continue}l.count>1&&e.reused==="ref"&&s(d)}e.external&&(e.sharedDefsExtractedFor=e.external)}function lp(e){const t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;const n=[];for(const r of t){if(!r||typeof r!="object")return;lp(r);const o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;const s=r.type;for(const i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}const up=new Set(["type","properties","required","additionalProperties"]),Nl=["oneOf","anyOf"];function Dl(e){const t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function Zi(e){var s;const t=[];for(const i of e){if(typeof i!="object"||i.type!=="object")return null;for(const a in i)if(!up.has(a))return null;t.push(i)}const n={},r=new Set;for(const i of t){for(const a in i.properties){if(Object.prototype.hasOwnProperty.call(n,a))continue;const c=[];for(const d of t){const l=((s=d.properties)==null?void 0:s[a])??Dl(d);l!=null&&(c.some(f=>JSON.stringify(f)===JSON.stringify(l))||c.push(l))}const u=c.length===1?c[0]:Zi(c)??{allOf:c};Gn(n,a,u)}for(const a of i.required??[])r.add(a)}const o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(i=>i.additionalProperties===!1))o.additionalProperties=!1;else{const i=[];for(const a of t){const c=Dl(a);c&&!i.some(u=>JSON.stringify(u)===JSON.stringify(c))&&i.push(c)}i.length===1?o.additionalProperties=i[0]:i.length>1&&(o.additionalProperties={allOf:i})}return o}function iE(e){const t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(const o of up)if(o in e)return;const n=t.filter(o=>Nl.some(s=>Array.isArray(o[s])));let r=null;if(!n.length)r=Zi(t);else{const o=n[0],s=Nl.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;const i=t.filter(c=>c!==o),a=o[s].map(c=>Zi([...i,c]));if(a.some(c=>!c))return;r={[s]:a}}r&&(delete e.allOf,Hr(e,r))}function dp(e,t){var a,c,u,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const f=e.seen.get(l);if(f.ref===null)return;const p=f.def??f.schema,v={...p},g=f.ref;if(f.ref=null,g){r(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(x)):Hr(p,x),Hr(p,v),l._zod.parent===g)for(const C in p)C==="$ref"||C==="allOf"||C in v||delete p[C];if(x.$ref&&b.def)for(const C in p)C==="$ref"||C==="allOf"||C in b.def&&JSON.stringify(p[C])===JSON.stringify(b.def[C])&&delete p[C]}const w=l._zod.parent;if(w&&w!==g){r(w);const b=e.seen.get(w);if(b!=null&&b.schema.$ref&&(p.$ref=b.schema.$ref,b.def))for(const x in p)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(p[x])===JSON.stringify(b.def[x])&&delete p[x]}e.override({zodSchema:l,jsonSchema:p,path:f.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(const l of[...e.seen.entries()].reverse())r(l[0]);if(e.target!=="openapi-3.0")for(const l of e.seen.entries())lp(l[1].def??l[1].schema);for(const l of e.deferred)l();if(e.intersections.length){const l=new Map;for(const f of e.seen.values())for(const p of[f.schema,f.def]){const v=p==null?void 0:p.allOf;if(!Array.isArray(v))continue;const g=l.get(v);g?g.push(p):l.set(v,[p])}for(const f of e.intersections)for(const p of l.get(f)??[])iE(p)}}const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const l=(c=e.external.registry.get(t))==null?void 0:c.id;if(!l)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(l)}Hr(o,n.defId?n.schema:n.def??n.schema);const s=(u=e.metadataRegistry.get(t))==null?void 0:u.id;s!==void 0&&o.id===s&&delete o.id;const i=((d=e.external)==null?void 0:d.defs)??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(const l of e.seen.entries()){const f=l[1];f.def&&f.defId&&(f.def.id===f.defId&&delete f.def.id,Gn(i,f.defId,f.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{const l=JSON.parse(JSON.stringify(o));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:os(t,"input",e.processors),output:os(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function ut(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ut(r.element,n);if(r.type==="set")return ut(r.valueType,n);if(r.type==="lazy")return ut(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault"||r.type==="catch")return ut(r.innerType,n);if(r.type==="intersection")return ut(r.left,n)||ut(r.right,n);if(r.type==="record"||r.type==="map")return ut(r.keyType,n)||ut(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:ut(r.in,n)||ut(r.out,n);if(r.type==="object"){for(const o in r.shape)if(ut(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(ut(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(ut(o,n))return!0;return!!(r.rest&&ut(r.rest,n))}return!1}const aE=(e,t={})=>n=>{const r=ap({...n,processors:t});return ot(e,r),cp(r,e),dp(r,e)},os=(e,t,n={})=>r=>{const{libraryOptions:o,target:s}=r??{},i=ap({...o??{},target:s,io:t,processors:n});return ot(e,i),cp(i,e),dp(i,e)},wr=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},_r=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ml=(e,t)=>{wr(e,"minimum",t),_r(e,"maximum",t)},fp=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},hp=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},pp=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},mp=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},jl=(e,t)=>wr(e,"minimum",t.minimum),$l=(e,t)=>_r(e,"maximum",t.maximum),zl=e=>(t,n)=>{mp(t,n.format);const[r,o]=e[n.format];wr(t,"minimum",r),_r(t,"maximum",o)},Gs={greater_than:(e,t)=>wr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>_r(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>fp(e,t.value),number_format:zl($h),bigint_format:zl(C_),min_length:jl,max_length:$l,length_equals:(e,t)=>Ml(e,t.length),min_size:jl,max_size:$l,size_equals:(e,t)=>Ml(e,t.size),string_format:(e,t)=>{mp(e,t.format),t.pattern&&hp(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>pp(e,t.mime)};function Zt(e){var s;const t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(const i of r)(s=Gs[i._zod.def.check])==null||s.call(Gs,t,i._zod.def);const o=e._zod.bag;o.minimum!==void 0&&wr(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&wr(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&_r(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&_r(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&fp(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&pp(t,o.mime);for(const i of o.patterns??[])hp(t,i);return t}const cE={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},lE=new Map([[Yh,k1],[Ya,O1]]),uE=e=>lE.get(e)??e,dE=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:d}=Zt(e);if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=cE[a]??a,o.format===""&&delete o.format,(a==="time"||d)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){const l=[...c].map(uE);l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},fE=(e,t,n,r)=>{const o=n,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:d}=Zt(e);o.type=d?"integer":"number";const l=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),p=t.target==="draft-04"||t.target==="openapi-3.0";if(l?p?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),f?p?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof i=="number"&&(o.maximum=i),a){const v=new Set;for(const b of a)Number.isFinite(b)&&b!==0?v.add(Math.abs(b)):Rr(e,t,o,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);const[g,...w]=v;g!==void 0&&(o.multipleOf=g),w.length&&(o.allOf=[...o.allOf??[],...w.map(b=>({multipleOf:b}))])}},hE=(e,t,n,r)=>{n.type="boolean"},pE=(e,t,n,r)=>{n.not={}},mE=(e,t,n,r)=>{},gE=(e,t,n,r)=>{const o=e._zod.def,s=$i(o.entries);if(s.length===0){n.not={};return}s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s},vE=(e,t,n,r)=>{Rr(e,t,n,r,"Custom types cannot be represented in JSON Schema")},yE=(e,t,n,r)=>{Rr(e,t,n,r,"Transforms cannot be represented in JSON Schema")},bE=(e,t,n,r)=>{const o=n,s=e._zod.def,{minimum:i,maximum:a}=Zt(e);typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=ot(s.element,t,{...r,path:[...r.path,"items"]})};function Bi(e){const t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Bi(t.out):t.type==="catch"?Bi(t.innerType):e._zod.optin}const wE=(e,t,n,r)=>{var u;const o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Rr(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(const d in i)Gn(o.properties,d,ot(i[d],t,{...r,path:[...r.path,"properties",d]}));const c=[];for(const d of Object.keys(i)){const l=s.shape[d];(t.io==="input"?Bi(l)===void 0:l._zod.optout===void 0)&&c.push(d)}c.length>0&&(o.required=c),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=ot(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},_E=(e,t,n,r)=>{const o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>ot(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},xE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=ot(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c,t.intersections.push(c)},SE=(e,t,n,r)=>{const o=e._zod.def,s=ot(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},EE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Ja=Symbol();function gp(e,t,n,r,o){let s=!1;const i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(Rr(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Ja):JSON.parse(i)}const CE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n.default=i)},kE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;const i=gp(o.defaultValue,e,t,n,r);i!==Ja&&(n._prefault=i)},OE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{Rr(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},PE=(e,t,n,r)=>{const o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;ot(i,t,r);const a=t.seen.get(e);a.ref=i},RE=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0},vp=(e,t,n,r)=>{const o=e._zod.def;ot(o.innerType,t,r);const s=t.seen.get(e);s.ref=o.innerType},Fl=new WeakSet([Object.prototype,Error.prototype]);function To(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){const r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}const TE=(e,t)=>{K_.init(e,t),e.name="ZodError";const n=Object.getPrototypeOf(e);Fl.has(n)||(Fl.add(n),To(n,"format",r=>o=>Q_(r,o)),To(n,"flatten",r=>o=>q_(r,o)),To(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,zi,2)}),To(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,zi,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},At=M("ZodError",TE,void 0,{Parent:Error}),IE=Ha(At),AE=Wa(At),NE=Ka(At),DE=Ga(At),ME=n1(At),jE=r1(At),$E=o1(At),zE=s1(At),FE=i1(At),LE=a1(At),VE=c1(At),UE=l1(At);function ZE(){Bt.localeError||Pn(lS())}function Xa(){Bt.memoizer||Pn({memoizer:iS()})}const He=M("ZodType",(e,t)=>(ZE(),Be.init(e,t),e.def=t,e.type=t.type,e),{check(...e){const t=this.def;return this.clone(St(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return On(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(VC(e,t))},superRefine(e,t){return this.check(UC(e,t))},overwrite(e){return this.check(Pr(e))},optional(){return Zl(this)},exactOptional(){return RC(this)},nullable(){return Bl(this)},nullish(){return Zl(Bl(this))},nonoptional(e){return MC(this,e)},array(){return bC(this)},or(e){return SC([this,e])},and(e){return CC(this,e)},transform(e){return Hl(this,PC(e))},default(e){return AC(this,e)},prefault(e){return DC(this,e)},catch(e){return $C(this,e)},pipe(e){return Hl(this,e)},readonly(){return LC(this)},describe(e){const t=this.clone();return Ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ur.get(this);const t=this.clone();return Ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Ba(this,"~standard",{...Wh(this),jsonSchema:{input:os(this,"input"),output:os(this,"output")}})},set"~standard"(e){kn(this,"~standard",e)},parse:function e(t,n){return IE(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await AE(this,t,n,{callee:e})},safeParse(e,t){return NE(this,e,t)},async safeParseAsync(e,t){return DE(this,e,t)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(e){kn(this,"spa",e)},validate(e,t){return X_(this,e,t)},validateAsync(e,t){return t1(this,e,t)},encode:function e(t,n){return ME(this,t,n,{callee:e})},decode:function e(t,n){return jE(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await $E(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await zE(this,t,n,{callee:e})},safeEncode(e,t){return FE(this,e,t)},safeDecode(e,t){return LE(this,e,t)},async safeEncodeAsync(e,t){return VE(this,e,t)},async safeDecodeAsync(e,t){return UE(this,e,t)},toJSONSchema(e){return aE(this,{})(e)},get description(){var e;return(e=Ur.get(this))==null?void 0:e.description},get _def(){return this._zod.def}}),yp=M("_ZodString",(e,t)=>{Qa.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>dE(e,n,r)},Fh({format:e=>Zt(e).format??null,minLength:e=>Zt(e).minimum??null,maxLength:e=>Zt(e).maximum??null},{regex(...e){return this.check(BS(...e))},includes(...e){return this.check(KS(...e))},startsWith(...e){return this.check(GS(...e))},endsWith(...e){return this.check(qS(...e))},min(...e){return this.check(rs(...e))},max(...e){return this.check(sp(...e))},length(...e){return this.check(ip(...e))},nonempty(...e){return this.check(rs(1,...e))},lowercase(e){return this.check(HS(e))},uppercase(e){return this.check(WS(e))},trim(){return this.check(JS())},normalize(...e){return this.check(YS(...e))},toLowerCase(){return this.check(XS())},toUpperCase(){return this.check(eE())},slugify(){return this.check(tE())}})),BE=M("ZodString",(e,t)=>{Qa.init(e,t),yp.init(e,t)},{email(e){return this.check(hS(qE,e))},url(e){return this.check(bS(YE,e))},jwt(e){return this.check(DS(fC,e))},emoji(e){return this.check(wS(JE,e))},guid(e){return this.check(pS(QE,e))},uuid(e){return this.check(mS(Io,e))},uuidv4(e){return this.check(gS(Io,e))},uuidv6(e){return this.check(vS(Io,e))},uuidv7(e){return this.check(yS(Io,e))},nanoid(e){return this.check(_S(XE,e))},cuid(e){return this.check(xS(eC,e))},cuid2(e){return this.check(SS(tC,e))},ulid(e){return this.check(ES(nC,e))},base64(e){return this.check(IS(lC,e))},base64url(e){return this.check(AS(uC,e))},xid(e){return this.check(CS(rC,e))},ksuid(e){return this.check(kS(oC,e))},ipv4(e){return this.check(OS(sC,e))},ipv6(e){return this.check(PS(iC,e))},cidrv4(e){return this.check(RS(aC,e))},cidrv6(e){return this.check(TS(cC,e))},e164(e){return this.check(NS(dC,e))},datetime(e){return this.check(MS(HE,e))},date(e){return this.check(jS(WE,e))},time(e){return this.check($S(KE,e))},duration(e){return this.check(zS(GE,e))}});function Ll(e){return fS(BE,e)}const Me=M("ZodStringFormat",(e,t)=>{Ne.init(e,t),yp.init(e,t)}),HE=M("ZodISODateTime",(e,t)=>{vx.init(e,t),Me.init(e,t)}),WE=M("ZodISODate",(e,t)=>{yx.init(e,t),Me.init(e,t)}),KE=M("ZodISOTime",(e,t)=>{bx.init(e,t),Me.init(e,t)}),GE=M("ZodISODuration",(e,t)=>{wx.init(e,t),Me.init(e,t)}),qE=M("ZodEmail",(e,t)=>{rx.init(e,t),Me.init(e,t)}),QE=M("ZodGUID",(e,t)=>{tx.init(e,t),Me.init(e,t)}),Io=M("ZodUUID",(e,t)=>{nx.init(e,t),Me.init(e,t)}),YE=M("ZodURL",(e,t)=>{lx.init(e,t),Me.init(e,t)}),JE=M("ZodEmoji",(e,t)=>{ux.init(e,t),Me.init(e,t)}),XE=M("ZodNanoID",(e,t)=>{dx.init(e,t),Me.init(e,t)}),eC=M("ZodCUID",(e,t)=>{fx.init(e,t),Me.init(e,t)}),tC=M("ZodCUID2",(e,t)=>{hx.init(e,t),Me.init(e,t)}),nC=M("ZodULID",(e,t)=>{px.init(e,t),Me.init(e,t)}),rC=M("ZodXID",(e,t)=>{mx.init(e,t),Me.init(e,t)}),oC=M("ZodKSUID",(e,t)=>{gx.init(e,t),Me.init(e,t)}),sC=M("ZodIPv4",(e,t)=>{_x.init(e,t),Me.init(e,t)}),iC=M("ZodIPv6",(e,t)=>{Sx.init(e,t),Me.init(e,t)}),aC=M("ZodCIDRv4",(e,t)=>{Ex.init(e,t),Me.init(e,t)}),cC=M("ZodCIDRv6",(e,t)=>{kx.init(e,t),Me.init(e,t)}),lC=M("ZodBase64",(e,t)=>{Ox.init(e,t),Me.init(e,t)}),uC=M("ZodBase64URL",(e,t)=>{Rx.init(e,t),Me.init(e,t)}),dC=M("ZodE164",(e,t)=>{Tx.init(e,t),Me.init(e,t)}),fC=M("ZodJWT",(e,t)=>{Ax.init(e,t),Me.init(e,t)}),bp=M("ZodNumber",(e,t)=>{Jh.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fE(e,n,r,o),e.isFinite=!0},Fh({minValue:e=>{const{minimum:t,exclusiveMinimum:n}=Zt(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{const{maximum:t,exclusiveMaximum:n}=Zt(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{const{isInt:t,multipleOf:n}=Zt(e);return!!t||!!(n!=null&&n.some(Number.isSafeInteger))},format:e=>Zt(e).format??null},{gt(e,t){return this.check(Tl(e,t))},gte(e,t){return this.check(Ks(e,t))},min(e,t){return this.check(Ks(e,t))},lt(e,t){return this.check(Rl(e,t))},lte(e,t){return this.check(Ws(e,t))},max(e,t){return this.check(Ws(e,t))},int(e){return this.check(Vl(e))},safe(e){return this.check(Vl(e))},positive(e){return this.check(Tl(0,e))},nonnegative(e){return this.check(Ks(0,e))},negative(e){return this.check(Rl(0,e))},nonpositive(e){return this.check(Ws(0,e))},multipleOf(e,t){return this.check(Il(e,t))},step(e,t){return this.check(Il(e,t))},finite(){return this}}));function ik(e){return FS(bp,e)}const hC=M("ZodNumberFormat",(e,t)=>{Nx.init(e,t),bp.init(e,t)});function Vl(e){return LS(hC,e)}const pC=M("ZodBoolean",(e,t)=>{Dx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hE(e,n,r)});function ak(e){return VS(pC,e)}const mC=M("ZodUnknown",(e,t)=>{Mx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mE()});function Ul(){return US(mC)}const gC=M("ZodNever",(e,t)=>{jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pE(e,n,r)});function vC(e){return ZS(gC,e)}const yC=M("ZodArray",(e,t)=>{Xa(),Fx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bE(e,n,r,o),e.element=t.element},{min(e,t){return this.check(rs(e,t))},nonempty(e){return this.check(rs(1,e))},max(e,t){return this.check(sp(e,t))},length(e,t){return this.check(ip(e,t))},unwrap(){return this.element}});function bC(e,t){return nE(yC,e,t)}const wC=M("ZodObject",(e,t)=>{Xa(),Ux.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wE(e,n,r,o),F_(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return kC(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(St(this._zod.def,{catchall:e}))},passthrough(){return this.clone(St(this._zod.def,{catchall:Ul()}))},loose(){return this.clone(St(this._zod.def,{catchall:Ul()}))},strict(){return this.clone(St(this._zod.def,{catchall:vC()}))},strip(){return this.clone(St(this._zod.def,{catchall:void 0}))},extend(e){return P_(this,e)},safeExtend(e){return R_(this,e)},merge(e){return T_(this,e)},pick(e){return k_(this,e)},omit(e){return O_(this,e)},partial(...e){return ul(wp,this,e[0])},exactPartial(...e){return ul(_p,this,e[0],"exactPartial")},required(...e){return I_(xp,this,e[0])}});function _C(e,t){const n={type:"object",shape:e??{},...oe(t)};return new wC(n)}const xC=M("ZodUnion",(e,t)=>{Zx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_E(e,n,r,o),e.options=t.options});function SC(e,t){return new xC({type:"union",options:e,...oe(t)})}const EC=M("ZodIntersection",(e,t)=>{Bx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>xE(e,n,r,o)});function CC(e,t){return new EC({type:"intersection",left:e,right:t})}const Hi=M("ZodEnum",(e,t)=>{Hx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(r,o,s)=>gE(e,r,o),e.enum=t.entries,e.options=[...e._zod.values];const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const s={};for(const i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})},e.exclude=(r,o)=>{const s={...t.entries};for(const i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Hi({...t,checks:[],...oe(o),entries:s})}});function kC(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Hi({type:"enum",entries:n,...oe(t)})}const OC=M("ZodTransform",(e,t)=>{Xa(),Wx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yE(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new Lh(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Jr(s,n.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(Jr(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function PC(e){return new OC({type:"transform",transform:e})}const wp=M("ZodOptional",(e,t)=>{tp.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Zl(e){return new wp({type:"optional",innerType:e})}const _p=M("ZodExactOptional",(e,t)=>{Kx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vp(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function RC(e){return new _p({type:"optional",innerType:e})}const TC=M("ZodNullable",(e,t)=>{Gx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>SE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bl(e){return new TC({type:"nullable",innerType:e})}const IC=M("ZodDefault",(e,t)=>{qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>CE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function AC(e,t){return new IC({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const NC=M("ZodPrefault",(e,t)=>{Qx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>kE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function DC(e,t){return new NC({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Mh(t)}})}const xp=M("ZodNonOptional",(e,t)=>{Yx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>EE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function MC(e,t){return new xp({type:"nonoptional",innerType:e,...oe(t)})}const jC=M("ZodCatch",(e,t)=>{Jx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>OE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $C(e,t){return new jC({type:"catch",innerType:e,catchValue:typeof t=="function"?t:V_(t)})}const zC=M("ZodPipe",(e,t)=>{Xx.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>PE(e,n,r,o),e.in=t.in,e.out=t.out});function Hl(e,t){return new zC({type:"pipe",in:e,out:t})}const FC=M("ZodReadonly",(e,t)=>{eS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>RE(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function LC(e){return new FC({type:"readonly",innerType:e})}const Sp=M("ZodCustom",(e,t)=>{tS.init(e,t),He.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vE(e,n,r,o)});function VC(e,t={}){return rE(Sp,e,t)}function UC(e,t){return oE(e,t)}const ZC=M("ZodInstanceOf",(e,t)=>{Sp.init(e,t)},{properties(e,t){return this.check(QS(e,t))}});function ck(e,t={}){const n=new ZC({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...oe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var BC=Object.defineProperty,HC=(e,t)=>BC(e,"name",{value:t,configurable:!0}),Ep=h.forwardRef(HC(function(t,n){return m.jsx(Ze.label,{...t,ref:n,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label"));const WC=so("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wi=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce(WC(),r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx(Ep,{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Wi.displayName=Ep.displayName;function qs(e){const t=ee.c(10),{id:n,message:r,className:o,assertive:s}=e;let i;t[0]!==s?(i=s?{role:"alert"}:{},t[0]=s,t[1]=i):i=t[1];const a=!r&&"absolute";let c;t[2]!==o||t[3]!==a?(c=ce("text-sm text-destructive",a,o),t[2]=o,t[3]=a,t[4]=c):c=t[4];const u=r??"";let d;return t[5]!==n||t[6]!==i||t[7]!==c||t[8]!==u?(d=m.jsx("p",{id:n,...i,className:c,children:u}),t[5]=n,t[6]=i,t[7]=c,t[8]=u,t[9]=d):d=t[9],d}function KC(e){return Object.entries(e).filter(([t,n])=>t!=="root"&&typeof(n==null?void 0:n.message)=="string").length}const Wl=e=>e===1?"1 field needs attention":`${e} fields need attention`,GC=100;function qC(e){var r,o,s,i;const t=(r=e==null?void 0:e.closest("form"))==null?void 0:r.querySelector('[aria-invalid="true"]');if(!t)return"";if(t!==document.activeElement)return t.focus(),"";const n=(o=t.getAttribute("aria-describedby"))==null?void 0:o.split(" ")[0];return n&&((i=(s=document.getElementById(n))==null?void 0:s.textContent)==null?void 0:i.trim())||""}function QC(e,t){return e?`${/[.!?]$/.test(e)?e:`${e}.`} ${Wl(t)}`:Wl(t)}function YC(e){const t=ee.c(5),{errors:n,submitCount:r}=e,o=h.useRef(null),s=KC(n),[i,a]=h.useState(r),[c,u]=h.useState(""),[d,l]=h.useState(null);i!==r?(a(r),u(""),l(s>0?{submit:r,count:s}:null)):s===0&&(c!==""||d!==null)&&(u(""),l(null));let f,p;t[0]!==d?(f=()=>{if(d===null)return;const g=qC(o.current),w=setTimeout(()=>{u(QC(g,d.count)),l(null)},GC);return()=>clearTimeout(w)},p=[d],t[0]=d,t[1]=f,t[2]=p):(f=t[1],p=t[2]),h.useEffect(f,p);let v;return t[3]!==c?(v=m.jsx("p",{ref:o,"aria-live":"polite",className:"sr-only",children:c}),t[3]=c,t[4]=v):v=t[4],v}const ec=8,lk=`Use at least ${ec} characters`,JC=`Password must be at least ${ec} characters`;function uk(e,t,n){return n?t:e}const XC=so("rounded-lg bg-card text-card-foreground",{variants:{level:{0:"",1:"shadow-card-1",2:"shadow-card-2",3:"shadow-card-3",4:"shadow-card-4"}},defaultVariants:{level:2}}),Cp=h.forwardRef((e,t)=>{const n=ee.c(11);let r,o,s;n[0]!==e?({className:r,level:o,...s}=e,n[0]=e,n[1]=r,n[2]=o,n[3]=s):(r=n[1],o=n[2],s=n[3]);let i;n[4]!==r||n[5]!==o?(i=ce(XC({level:o}),r),n[4]=r,n[5]=o,n[6]=i):i=n[6];let a;return n[7]!==s||n[8]!==t||n[9]!==i?(a=m.jsx("div",{ref:t,className:i,...s}),n[7]=s,n[8]=t,n[9]=i,n[10]=a):a=n[10],a});Cp.displayName="Card";const kp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex flex-col space-y-1.5 p-6",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});kp.displayName="CardHeader";const Op=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-2xl font-semibold leading-none tracking-tight",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Op.displayName="CardTitle";const Pp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("text-sm text-muted-foreground",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Pp.displayName="CardDescription";const Rp=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});Rp.displayName="CardContent";const e2=h.forwardRef((e,t)=>{const n=ee.c(9);let r,o;n[0]!==e?({className:r,...o}=e,n[0]=e,n[1]=r,n[2]=o):(r=n[1],o=n[2]);let s;n[3]!==r?(s=ce("flex items-center p-6 pt-0",r),n[3]=r,n[4]=s):s=n[4];let i;return n[5]!==o||n[6]!==t||n[7]!==s?(i=m.jsx("div",{ref:t,className:s,...o}),n[5]=o,n[6]=t,n[7]=s,n[8]=i):i=n[8],i});e2.displayName="CardFooter";const t2=_C({email:Ll().email("Enter a valid email"),password:Ll().min(ec,JC)});function n2(){var le,Pe,je,Ee;const e=ee.c(58),t=su(),{resolvedTheme:n}=ss(),r=n==="dark"?"/logo-dark.svg":"/logo.svg";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:Qo.authStatus,queryFn:y0,staleTime:1/0},e[0]=o):o=e[0];const s=Wo(o),i=Qi();let a;e[1]===Symbol.for("react.memo_cache_sentinel")?(a={shouldFocusError:!1,resolver:m_(t2)},e[1]=a):a=e[1];const{register:c,handleSubmit:u,setError:d,formState:l}=d_(a),{errors:f,isSubmitting:p,submitCount:v}=l;let g;e[2]!==t||e[3]!==i||e[4]!==d?(g=async function(We){try{const{status:kt}=await hh.post("/api/v1/auth/login",{email:We.email,password:We.password});if(kt!==200){d("root",{message:"Invalid email or password"});return}i.clear(),t("/app-center",{replace:!0})}catch{d("root",{message:"Network error. Please try again."})}},e[2]=t,e[3]=i,e[4]=d,e[5]=g):g=e[5];const w=g;if(((le=s.data)==null?void 0:le.initialized)===!1){let $e;return e[6]===Symbol.for("react.memo_cache_sentinel")?($e=m.jsx(Gi,{to:"/setup",replace:!0}),e[6]=$e):$e=e[6],$e}let b;e[7]!==r?(b=m.jsx("img",{src:r,alt:"tapflow",className:"w-6 h-6"}),e[7]=r,e[8]=b):b=e[8];let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=m.jsx("span",{className:"text-base font-semibold tracking-tight",children:"tapflow"}),e[9]=x):x=e[9];let _;e[10]!==b?(_=m.jsxs("div",{className:"flex items-center gap-2",children:[b,x]}),e[10]=b,e[11]=_):_=e[11];let C;e[12]===Symbol.for("react.memo_cache_sentinel")?(C=m.jsxs(kp,{className:"text-center",children:[m.jsx(Op,{className:"text-2xl tracking-display-md",children:"Welcome back"}),m.jsx(Pp,{children:"Sign in to your team workspace"})]}),e[12]=C):C=e[12];let S;e[13]!==u||e[14]!==w?(S=u(w),e[13]=u,e[14]=w,e[15]=S):S=e[15];let P;e[16]===Symbol.for("react.memo_cache_sentinel")?(P=m.jsx(Wi,{htmlFor:"email",children:"Email"}),e[16]=P):P=e[16];const R=!!f.email,T=f.email?"email-error":void 0;let A;e[17]!==c?(A=c("email"),e[17]=c,e[18]=A):A=e[18];let j;e[19]!==R||e[20]!==T||e[21]!==A?(j=m.jsx(Go,{id:"email",type:"email",placeholder:"you@company.com",autoComplete:"email","aria-required":"true","aria-invalid":R,"aria-describedby":T,...A}),e[19]=R,e[20]=T,e[21]=A,e[22]=j):j=e[22];const F=(Pe=f.email)==null?void 0:Pe.message;let z;e[23]!==F?(z=m.jsx(qs,{id:"email-error",message:F}),e[23]=F,e[24]=z):z=e[24];let Y;e[25]!==j||e[26]!==z?(Y=m.jsxs("div",{className:"grid gap-2",children:[P,j,z]}),e[25]=j,e[26]=z,e[27]=Y):Y=e[27];let Z;e[28]===Symbol.for("react.memo_cache_sentinel")?(Z=m.jsx(Wi,{htmlFor:"password",children:"Password"}),e[28]=Z):Z=e[28];const K=!!f.password,H=f.password?"password-error":void 0;let J;e[29]!==c?(J=c("password"),e[29]=c,e[30]=J):J=e[30];let ne;e[31]!==K||e[32]!==H||e[33]!==J?(ne=m.jsx(Go,{id:"password",type:"password",autoComplete:"current-password","aria-required":"true","aria-invalid":K,"aria-describedby":H,...J}),e[31]=K,e[32]=H,e[33]=J,e[34]=ne):ne=e[34];const te=(je=f.password)==null?void 0:je.message;let X;e[35]!==te?(X=m.jsx(qs,{id:"password-error",message:te}),e[35]=te,e[36]=X):X=e[36];let q;e[37]!==ne||e[38]!==X?(q=m.jsxs("div",{className:"grid gap-2",children:[Z,ne,X]}),e[37]=ne,e[38]=X,e[39]=q):q=e[39];const me=(Ee=f.root)==null?void 0:Ee.message;let he;e[40]!==me?(he=m.jsx(qs,{assertive:!0,id:"login-error",message:me}),e[40]=me,e[41]=he):he=e[41];const ae=p?"Signing in…":"Sign in";let re;e[42]!==p||e[43]!==ae?(re=m.jsx(is,{type:"submit",size:"lg",disabled:p,className:"w-full mt-1",children:ae}),e[42]=p,e[43]=ae,e[44]=re):re=e[44];let B;e[45]!==f||e[46]!==v?(B=m.jsx(YC,{errors:f,submitCount:v}),e[45]=f,e[46]=v,e[47]=B):B=e[47];let se;e[48]!==Y||e[49]!==q||e[50]!==he||e[51]!==re||e[52]!==B||e[53]!==S?(se=m.jsxs(Cp,{level:4,className:"w-full",children:[C,m.jsx(Rp,{children:m.jsxs("form",{onSubmit:S,className:"flex flex-col gap-4",children:[Y,q,he,re,B]})})]}),e[48]=Y,e[49]=q,e[50]=he,e[51]=re,e[52]=B,e[53]=S,e[54]=se):se=e[54];let ye;return e[55]!==se||e[56]!==_?(ye=m.jsx("div",{className:"flex min-h-svh items-center justify-center overflow-hidden p-4",children:m.jsxs("div",{className:"flex flex-col items-center gap-6 w-full max-w-sm",children:[_,se]})}),e[55]=se,e[56]=_,e[57]=ye):ye=e[57],ye}function r2(){return new Om({defaultOptions:{queries:{retry:0,refetchOnWindowFocus:!0,networkMode:"always"}}})}const o2=h.lazy(()=>Et(()=>import("./Setup-4-HC1rwb.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.Setup}))),s2=h.lazy(()=>Et(()=>import("./Invite-BNgu8qb9.js"),__vite__mapDeps([4,1,2,3,5])).then(e=>({default:e.Invite}))),i2=h.lazy(()=>Et(()=>import("./ResetPassword-CQsALVBn.js"),__vite__mapDeps([6,1,2,3])).then(e=>({default:e.ResetPassword}))),a2=h.lazy(()=>Et(()=>import("./AppCenter-CZMTgfBh.js"),__vite__mapDeps([7,1,8,9,10,11,12,13,14,15,16,17,18,19,3])).then(e=>({default:e.AppCenter}))),c2=h.lazy(()=>Et(()=>import("./QASession-Rin1Ol-2.js"),__vite__mapDeps([20,1,21,22,3,15,23,24,11,8,17,25,10,26,19,9,14,16,27])).then(e=>({default:e.QASession}))),l2=h.lazy(()=>Et(()=>import("./Runs-DSHpDs0m.js"),__vite__mapDeps([28,1,14,8,12,25,9,10,29,19,18,30,3])).then(e=>({default:e.Runs}))),u2=h.lazy(()=>Et(()=>import("./RunDetail-D0JKuXAS.js"),__vite__mapDeps([31,1,14,12,30,32,10,9,33,22,17,24,3])).then(e=>({default:e.RunDetail}))),d2=h.lazy(()=>Et(()=>import("./AISessionWatch-DxsyhjAy.js"),__vite__mapDeps([34,1,21,22,33,23,17,3])).then(e=>({default:e.AISessionWatch}))),f2=h.lazy(()=>Et(()=>import("./MacResources-B26lSN5B.js"),__vite__mapDeps([35,1,21,19,25,27,36,3])).then(e=>({default:e.MacResources}))),h2=h.lazy(()=>Et(()=>import("./Default-DCk7wCIg.js"),__vite__mapDeps([37,1,2,14,16,15,32,10,5,3])).then(e=>({default:e.DefaultSettings}))),p2=h.lazy(()=>Et(()=>import("./Team-CgJM95TR.js"),__vite__mapDeps([38,1,11,15,9,10,29,19,26,18,3])).then(e=>({default:e.TeamSettings}))),m2=h.lazy(()=>Et(()=>import("./Tokens-D2wbiDVG.js"),__vite__mapDeps([39,1,14,15,11,9,10,29,19,26,18,13,3])).then(e=>({default:e.TokenSettings}))),g2=h.lazy(()=>Et(()=>import("./NotFound-DVq_rCKc.js"),__vite__mapDeps([40,1])).then(e=>({default:e.NotFound}))),v2=m.jsx("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading…"}),Ao=e=>m.jsx(h.Suspense,{fallback:v2,children:e}),y2=r2();function b2(){const e=ee.c(16);let t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=m.jsx(st,{path:"/login",element:m.jsx(n2,{})}),e[0]=t):t=e[0];let n;e[1]===Symbol.for("react.memo_cache_sentinel")?(n=m.jsx(st,{path:"/setup",element:Ao(m.jsx(o2,{}))}),e[1]=n):n=e[1];let r;e[2]===Symbol.for("react.memo_cache_sentinel")?(r=m.jsx(st,{path:"/invite",element:Ao(m.jsx(s2,{}))}),e[2]=r):r=e[2];let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=m.jsx(st,{path:"/reset-password",element:Ao(m.jsx(i2,{}))}),e[3]=o):o=e[3];let s;e[4]===Symbol.for("react.memo_cache_sentinel")?(s=m.jsx(V0,{}),e[4]=s):s=e[4];let i;e[5]===Symbol.for("react.memo_cache_sentinel")?(i=m.jsx(st,{index:!0,element:m.jsx(Gi,{to:"/app-center",replace:!0})}),e[5]=i):i=e[5];let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a=m.jsx(st,{path:"/app-center",element:m.jsx(a2,{})}),e[6]=a):a=e[6];let c;e[7]===Symbol.for("react.memo_cache_sentinel")?(c=m.jsx(st,{path:"/app-center/build",element:m.jsx(c2,{})}),e[7]=c):c=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=m.jsx(st,{path:"/automation/runs",element:m.jsx(l2,{})}),e[8]=u):u=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=m.jsx(st,{path:"/automation/runs/:runId",element:m.jsx(u2,{})}),e[9]=d):d=e[9];let l;e[10]===Symbol.for("react.memo_cache_sentinel")?(l=m.jsx(st,{path:"/automation/sessions/:sessionId",element:m.jsx(d2,{})}),e[10]=l):l=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=m.jsx(st,{path:"/mac-resources",element:m.jsx(f2,{})}),e[11]=f):f=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=m.jsx(st,{path:"/settings/default",element:m.jsx(h2,{})}),e[12]=p):p=e[12];let v;e[13]===Symbol.for("react.memo_cache_sentinel")?(v=m.jsx(st,{path:"/settings/team",element:m.jsx(p2,{})}),e[13]=v):v=e[13];let g;e[14]===Symbol.for("react.memo_cache_sentinel")?(g=m.jsxs(st,{element:s,children:[i,a,c,u,d,l,f,p,v,m.jsx(st,{path:"/settings/tokens",element:m.jsx(m2,{})})]}),e[14]=g):g=e[14];let w;return e[15]===Symbol.for("react.memo_cache_sentinel")?(w=m.jsx(tm,{client:y2,children:m.jsxs(Up,{children:[m.jsxs(Zp,{children:[t,n,r,o,g,m.jsx(st,{path:"*",element:Ao(m.jsx(g2,{}))})]}),m.jsx(Zg,{position:"bottom-right",richColors:!0})]})}),e[15]=w):w=e[15],w}Lp.createRoot(document.getElementById("root")).render(m.jsx(h.StrictMode,{children:m.jsx(Kp,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:m.jsx(b2,{})})}));export{S2 as $,tt as A,is as B,Cp as C,vt as D,fu as E,qs as F,Ge as G,E2 as H,Go as I,q2 as J,Mb as K,Wi as L,jb as M,vf as N,Ym as O,lk as P,Dc as Q,ph as R,qo as S,Db as T,ek as U,J2 as V,Y2 as W,Q2 as X,_0 as Y,K2 as Z,ck as _,m_ as a,ma as a$,G2 as a0,X2 as a1,ce as a2,rg as a3,ng as a4,Te as a5,Ze as a6,Vu as a7,nn as a8,Xt as a9,H2 as aA,vw as aB,jf as aC,ww as aD,En as aE,ik as aF,Nv as aG,w0 as aH,wa as aI,ak as aJ,V2 as aK,kC as aL,L2 as aM,so as aN,Yy as aO,k2 as aP,eb as aQ,Vd as aR,Zd as aS,Bd as aT,Ld as aU,ib as aV,nf as aW,ha as aX,us as aY,jd as aZ,as as a_,ct as aa,xa as ab,rn as ac,de as ad,U2 as ae,I0 as af,Z2 as ag,xr as ah,Yd as ai,ao as aj,F0 as ak,tk as al,hg as am,$2 as an,N2 as ao,D2 as ap,z2 as aq,j2 as ar,M2 as as,rk as at,A2 as au,nk as av,ok as aw,Jm as ax,sg as ay,B2 as az,Qi as b,gd as b0,aa as b1,Jt as b2,of as b3,bb as b4,tf as b5,Qm as b6,C2 as b7,Wo as c,kp as d,Op as e,Rp as f,uk as g,YC as h,ec as i,JC as j,y0 as k,G0 as l,Pp as m,sk as n,_C as o,T0 as p,Qo as q,W2 as r,Ll as s,oo as t,d_ as u,F2 as v,Ps as w,Wr as x,Em as y,ss as z};
|