@vertesia/ui 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/components/SelectList.d.ts.map +1 -1
- package/lib/core/components/SelectList.js +3 -3
- package/lib/core/components/SelectList.js.map +1 -1
- package/lib/core/components/SidePanel.d.ts.map +1 -1
- package/lib/core/components/SidePanel.js +2 -1
- package/lib/core/components/SidePanel.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.js +51 -17
- package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts +5 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +9 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentPlans.d.ts +1 -1
- package/lib/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -1
- package/lib/features/agent/chat/hooks/useAgentPlans.js +5 -5
- package/lib/features/agent/chat/hooks/useAgentPlans.js.map +1 -1
- package/lib/features/magic-pdf/GroundedExtractionView.js +3 -3
- package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.d.ts +2 -2
- package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.js +9 -7
- package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js +7 -3
- package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
- package/lib/features/oauth/useMcpConnections.d.ts +4 -2
- package/lib/features/oauth/useMcpConnections.d.ts.map +1 -1
- package/lib/features/oauth/useMcpConnections.js +15 -9
- package/lib/features/oauth/useMcpConnections.js.map +1 -1
- package/lib/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
- package/lib/features/store/objects/selection/ObjectsActionContext.js +2 -0
- package/lib/features/store/objects/selection/ObjectsActionContext.js.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.d.ts +4 -2
- package/lib/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.js +6 -3
- package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/features/store/objects/selection/actions/RunIntakeAction.d.ts +8 -0
- package/lib/features/store/objects/selection/actions/RunIntakeAction.d.ts.map +1 -0
- package/lib/features/store/objects/selection/actions/RunIntakeAction.js +65 -0
- package/lib/features/store/objects/selection/actions/RunIntakeAction.js.map +1 -0
- package/lib/features/store/objects/selection/actions/index.d.ts +1 -0
- package/lib/features/store/objects/selection/actions/index.d.ts.map +1 -1
- package/lib/features/store/objects/selection/actions/index.js +1 -0
- package/lib/features/store/objects/selection/actions/index.js.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.js +11 -3
- package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.js +14 -14
- package/lib/features/store/types/IntakePolicyEditor.js.map +1 -1
- package/lib/features/store/types/TypeRegistry.d.ts +275 -150
- package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +275 -150
- package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
- package/lib/i18n/locales/ar.json +28 -7
- package/lib/i18n/locales/de.json +24 -7
- package/lib/i18n/locales/en.json +24 -7
- package/lib/i18n/locales/es.json +24 -7
- package/lib/i18n/locales/fr.json +25 -7
- package/lib/i18n/locales/it.json +24 -7
- package/lib/i18n/locales/ja.json +24 -7
- package/lib/i18n/locales/ko.json +24 -7
- package/lib/i18n/locales/pt.json +24 -7
- package/lib/i18n/locales/ru.json +26 -7
- package/lib/i18n/locales/tr.json +24 -7
- package/lib/i18n/locales/zh-TW.json +24 -7
- package/lib/i18n/locales/zh.json +24 -7
- package/lib/shell/apps/AppInstallationProvider.d.ts +4 -4
- package/lib/shell/login/SignInIcons.d.ts.map +1 -1
- package/lib/shell/login/SignInIcons.js +2 -1
- package/lib/shell/login/SignInIcons.js.map +1 -1
- package/lib/shell/login/SignInPasswordStep.d.ts +9 -0
- package/lib/shell/login/SignInPasswordStep.d.ts.map +1 -0
- package/lib/shell/login/SignInPasswordStep.js +58 -0
- package/lib/shell/login/SignInPasswordStep.js.map +1 -0
- package/lib/shell/login/SignInPrimitives.d.ts +13 -0
- package/lib/shell/login/SignInPrimitives.d.ts.map +1 -1
- package/lib/shell/login/SignInPrimitives.js +11 -1
- package/lib/shell/login/SignInPrimitives.js.map +1 -1
- package/lib/shell/login/SignInProvidersStep.d.ts +3 -1
- package/lib/shell/login/SignInProvidersStep.d.ts.map +1 -1
- package/lib/shell/login/SignInProvidersStep.js +4 -2
- package/lib/shell/login/SignInProvidersStep.js.map +1 -1
- package/lib/shell/login/SignInReturningStep.d.ts +3 -1
- package/lib/shell/login/SignInReturningStep.d.ts.map +1 -1
- package/lib/shell/login/SignInReturningStep.js +18 -8
- package/lib/shell/login/SignInReturningStep.js.map +1 -1
- package/lib/shell/login/SignInTenantStep.d.ts +3 -1
- package/lib/shell/login/SignInTenantStep.d.ts.map +1 -1
- package/lib/shell/login/SignInTenantStep.js +2 -2
- package/lib/shell/login/SignInTenantStep.js.map +1 -1
- package/lib/shell/login/SignInWithProviderButton.d.ts +5 -3
- package/lib/shell/login/SignInWithProviderButton.d.ts.map +1 -1
- package/lib/shell/login/SignInWithProviderButton.js +8 -7
- package/lib/shell/login/SignInWithProviderButton.js.map +1 -1
- package/lib/shell/login/SigninScreen.d.ts.map +1 -1
- package/lib/shell/login/SigninScreen.js +13 -4
- package/lib/shell/login/SigninScreen.js.map +1 -1
- package/lib/shell/login/signInUtils.d.ts +20 -4
- package/lib/shell/login/signInUtils.d.ts.map +1 -1
- package/lib/shell/login/signInUtils.js +47 -1
- package/lib/shell/login/signInUtils.js.map +1 -1
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +14 -14
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.BoNE1APG.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.BoNE1APG.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.BoPtiSPb.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.BoPtiSPb.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.C4BBW5v5.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.C4BBW5v5.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.C81wuNkY.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.C81wuNkY.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.C9GipKIH.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.C9GipKIH.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.CWsoS0W9.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.CWsoS0W9.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.Cr9NtzZB.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.Cr9NtzZB.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.DEpkHOD5.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.DEpkHOD5.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.DPXaRKFO.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.DPXaRKFO.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.D_QNm1Xg.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.D_QNm1Xg.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.F26Cc0f7.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.F26Cc0f7.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.YkXIESV_.chunk.js +5 -0
- package/lib/vertesia-ui-i18n.YkXIESV_.chunk.js.map +1 -0
- package/lib/vertesia-ui-i18n.js +3 -3
- package/lib/vertesia-ui-i18n.js.map +1 -1
- package/lib/vertesia-ui-shell.js +15 -9
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
- package/package.json +7 -7
- package/src/core/components/SelectList.tsx +5 -2
- package/src/core/components/SidePanel.tsx +65 -60
- package/src/features/agent/chat/ModernAgentConversation.test.tsx +150 -1
- package/src/features/agent/chat/ModernAgentConversation.tsx +59 -21
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +17 -1
- package/src/features/agent/chat/hooks/useAgentPlans.test.ts +52 -0
- package/src/features/agent/chat/hooks/useAgentPlans.ts +5 -5
- package/src/features/magic-pdf/GroundedExtractionView.tsx +3 -3
- package/src/features/oauth/McpConnectionsButton.test.tsx +56 -0
- package/src/features/oauth/McpConnectionsButton.tsx +9 -6
- package/src/features/oauth/McpConnectionsDialog.tsx +14 -5
- package/src/features/oauth/useMcpConnections.test.ts +10 -0
- package/src/features/oauth/useMcpConnections.ts +18 -10
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +2 -0
- package/src/features/store/objects/selection/SelectionActions.tsx +13 -6
- package/src/features/store/objects/selection/actions/RunIntakeAction.tsx +69 -0
- package/src/features/store/objects/selection/actions/index.ts +1 -0
- package/src/features/store/types/ContentObjectTypesTable.tsx +20 -3
- package/src/features/store/types/IntakePolicyEditor.tsx +33 -28
- package/src/i18n/locales/ar.json +28 -7
- package/src/i18n/locales/de.json +24 -7
- package/src/i18n/locales/en.json +24 -7
- package/src/i18n/locales/es.json +24 -7
- package/src/i18n/locales/fr.json +25 -7
- package/src/i18n/locales/it.json +24 -7
- package/src/i18n/locales/ja.json +24 -7
- package/src/i18n/locales/ko.json +24 -7
- package/src/i18n/locales/pt.json +24 -7
- package/src/i18n/locales/ru.json +26 -7
- package/src/i18n/locales/tr.json +24 -7
- package/src/i18n/locales/zh-TW.json +24 -7
- package/src/i18n/locales/zh.json +24 -7
- package/src/shell/login/SignInIcons.tsx +2 -1
- package/src/shell/login/SignInPasswordRequired.test.tsx +82 -0
- package/src/shell/login/SignInPasswordStep.test.tsx +71 -0
- package/src/shell/login/SignInPasswordStep.tsx +103 -0
- package/src/shell/login/SignInPrimitives.tsx +53 -1
- package/src/shell/login/SignInProvidersStep.tsx +8 -4
- package/src/shell/login/SignInReturningStep.tsx +20 -8
- package/src/shell/login/SignInTenantStep.tsx +6 -2
- package/src/shell/login/SignInWithProviderButton.tsx +11 -7
- package/src/shell/login/SigninScreen.tsx +32 -3
- package/src/shell/login/signInPassword.test.ts +133 -0
- package/src/shell/login/signInUtils.ts +60 -7
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.d.ts +0 -7
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.d.ts.map +0 -1
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js +0 -51
- package/lib/features/store/objects/selection/actions/StartWorkflowButton.js.map +0 -1
- package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DN79y06J.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DN79y06J.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js.map +0 -1
- package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js +0 -5
- package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js.map +0 -1
- package/src/features/store/objects/selection/actions/StartWorkflowButton.tsx +0 -104
package/lib/vertesia-ui-shell.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{Children as i,Component as a,Fragment as o,createContext as s,createElement as c,forwardRef as l,isValidElement as u,useCallback as d,useContext as f,useEffect as p,useId as m,useInsertionEffect as h,useLayoutEffect as g,useMemo as _,useRef as v,useState as y}from"react";import{Avatar as b,Button as x,Center as S,ErrorBox as C,Input as w,MenuList as T,Modal as E,ModalBody as
|
|
1
|
+
import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import*as r from"react";import{Children as i,Component as a,Fragment as o,createContext as s,createElement as c,forwardRef as l,isValidElement as u,useCallback as d,useContext as f,useEffect as p,useId as m,useInsertionEffect as h,useLayoutEffect as g,useMemo as _,useRef as v,useState as y}from"react";import{Avatar as b,Button as x,Center as S,ErrorBox as C,Input as w,MenuList as T,Modal as E,ModalBody as ee,ModalFooter as te,ModalTitle as ne,ModeToggle as re,Popover as ie,PopoverContent as ae,PopoverTrigger as oe,RadioGroup as se,SelectBox as D,Spinner as ce,Tabs as le,TabsBar as ue,TabsPanel as de,ThemeProvider as fe,ToastProvider as pe,VTooltip as me,errorMessage as he,useFetch as ge,useToast as _e}from"@vertesia/ui/core";import{AuthenticationServiceError as ve,CredentialError as ye,DevSessionProvider as be,LastSelectedAccountId_KEY as xe,LastSelectedProjectId_KEY as Se,NoAccessibleAccountError as Ce,RequestedScopeUnavailableError as we,RestrictedEnvironmentError as Te,UserNotFoundError as Ee,UserSessionProvider as De,fetchComposableTokenFromFirebaseToken as Oe,fetchComposableTokenFromVertesiaToken as ke,getCurrentVertesiaToken as Ae,getFirebaseAuth as je,setFirebaseTenant as Me,useUXTracking as Ne,useUserSession as O}from"@vertesia/ui/session";import"@radix-ui/react-direction";import{LanguageBoundI18nProvider as Pe,LanguageProvider as Fe,useUITranslation as k}from"@vertesia/ui/i18n";import{Permission as Ie,REQUESTED_SCOPE_UNAVAILABLE_ERROR_CODE as Le,getTenantIdFromProject as Re}from"@vertesia/common";import{Env as A}from"@vertesia/ui/env";import{RegionTag as ze}from"@vertesia/ui/layout";import{FirebaseError as Be}from"firebase/app";import{GithubAuthProvider as Ve,GoogleAuthProvider as He,OAuthProvider as Ue,signInWithEmailAndPassword as We,signInWithRedirect as Ge,signOut as Ke}from"firebase/auth";import{useLocation as qe,useNavigate as Je}from"@vertesia/ui/router";import{TypeRegistryProvider as Ye,UserPermissionProvider as Xe,useUserPermissions as Ze}from"@vertesia/ui/features";import Qe from"clsx";var $e=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});const et=s(null);function tt({installation:e,children:n}){return t(et.Provider,{value:e,children:n})}function nt(){return f(et)}function rt({app:e,onChange:r,placeholder:i}){let{client:a,project:o}=O(),{data:s,error:c}=ge(()=>a.apps.getAppInstallationProjects(e),[e.id,e.name]);return c?n(`span`,{className:`text-destructive`,children:[`Error: failed to fetch projects: `,he(c)]}):t(it,{placeholder:i,initialValue:o?.id,projects:s||[],onChange:e=>{r&&!r(e)||(localStorage.setItem(xe,e.account),localStorage.setItem(`${Se}-${e.account}`,e.id),window.location.reload())}})}function it({initialValue:e,projects:n,onChange:r,placeholder:i=`Select Project`}){let[a,o]=y(),s=e=>{o(e),r(e)},c=!a&&e?n.find(t=>t.id===e):a;return t(D,{by:`id`,value:c,options:n,optionLabel:e=>e.name,placeholder:i,onChange:s})}const at=s({theme:`system`,setTheme:()=>null}),ot=()=>{let e=f(at);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e},st=[`ar`,`de`,`en`,`es`,`fr`,`it`,`ja`,`ko`,`pt`,`ru`,`tr`,`zh`,`zh-TW`],ct=s({language:`en`,setLanguage:()=>null,isRTL:!1});function lt(){let e=f(ct);if(e===void 0)throw Error(`useLanguage must be used within a LanguageProvider`);return e}const ut=`vertesia:iframe-auth-request`,dt=`vertesia:iframe-auth-response`,ft=`vertesia:iframe-context-request`,pt=`vertesia:iframe-context`,mt=`vertesia:iframe-navigate`,ht=`vertesia:iframe-location-change`,gt=`__vertesia_slot`,_t=`__vertesia_host_origin`,vt=`content`;function yt(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`vertesia:iframe-auth-request`&&typeof t.requestId==`string`&&!!t.requestId}function bt(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`vertesia:iframe-auth-response`&&typeof t.requestId==`string`&&!!t.requestId&&(t.token===void 0||typeof t.token==`string`)}function xt(e){return!e||typeof e!=`object`?!1:e.type===ft}function St(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`vertesia:iframe-context`&&(t.theme===`dark`||t.theme===`light`||t.theme===`system`)&&typeof t.language==`string`&&st.includes(t.language)}function Ct(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`vertesia:iframe-navigate`&&typeof t.url==`string`&&!!t.url}function wt(e){if(!e||typeof e!=`object`)return!1;let t=e;return t.type===`vertesia:iframe-location-change`&&typeof t.url==`string`&&!!t.url}const Tt=new Set([`localhost`,`127.0.0.1`,`[::1]`]);function Et(e){if(e)try{let t=new URL(e),n=Tt.has(t.hostname);return t.protocol===`https:`||t.protocol===`http:`&&n?t:void 0}catch{return}}function Dt(e){if(!e)return!1;let t=e.trim(),n=t.indexOf(`://`);if(n<0)return!1;let r=n+3,i=t.slice(r),a=i.search(/[/?#]/);return(a<0?i:i.slice(0,a)).includes(`@`)}function Ot(e){if(e===`studio.vertesia.io`)return!0;let t=e.split(`.`);if(t.at(-2)!==`vertesia`||t.at(-1)!==`io`)return!1;let n=t.slice(0,-2),r=n.lastIndexOf(`cloud`);if(r>=0&&n.length-r<=2)return!0;let i=n.lastIndexOf(`ui`);return i>=0&&n.length-i===2}function kt(e){if(Dt(e))return;let t=Et(e);if(!t)return;let n=t.hostname,r=Ot(n),i=Tt.has(n)&&Tt.has(window.location.hostname);return t.protocol===`https:`&&r||i?t.origin:void 0}function At(){return window.parent===window?void 0:kt(new URL(window.location.href).searchParams.get(_t))||kt(document.referrer)}function jt(e=5e3){let t=At();if(!t)return Promise.resolve(void 0);let n=crypto.randomUUID();return new Promise(r=>{let i,a,o=250,s=e=>{window.removeEventListener(`message`,c),clearTimeout(i),clearTimeout(a),r(e)},c=e=>{e.source!==window.parent||e.origin!==t||!bt(e.data)||e.data.requestId===n&&e.data.token&&s(e.data.token)},l={type:ut,requestId:n},u=()=>{window.parent.postMessage(l,t),a=window.setTimeout(u,o),o=Math.min(o*2,1e3)};i=window.setTimeout(()=>s(),e),window.addEventListener(`message`,c),u()})}function Mt(e){if(e==null)return e;let t=new URL(window.location.href).searchParams.get(_t);if(!t)return e;try{let n=new URL(e,window.location.href);return n.origin===window.location.origin?(n.searchParams.set(_t,t),n):e}catch{return e}}function Nt(){let{setTheme:e}=ot(),{setLanguage:t}=lt();return p(()=>{let n=At();if(!n)return;let r=()=>{let e={type:ht,url:window.location.href};window.parent.postMessage(e,n)},i=window.history.pushState,a=window.history.replaceState,o=(e,t,n)=>{i.call(window.history,e,t,Mt(n)),r()},s=(e,t,n)=>{a.call(window.history,e,t,Mt(n)),r()};window.history.pushState=o,window.history.replaceState=s;let c=i=>{if(i.source===window.parent&&i.origin===n){if(St(i.data)){let n=i.data;e(n.theme,{persist:!1}),t(n.language,{persist:!1});return}if(Ct(i.data)){let e;try{e=new URL(i.data.url,window.location.href)}catch{return}if(e.origin!==window.location.origin)return;if(e.href===window.location.href){r();return}window.history.replaceState(window.history.state,``,e),window.dispatchEvent(new PopStateEvent(`popstate`,{state:window.history.state}))}}},l={type:ft};return window.addEventListener(`message`,c),window.addEventListener(`popstate`,r),window.addEventListener(`hashchange`,r),window.parent.postMessage(l,n),r(),()=>{window.removeEventListener(`message`,c),window.removeEventListener(`popstate`,r),window.removeEventListener(`hashchange`,r),window.history.pushState===o&&(window.history.pushState=i),window.history.replaceState===s&&(window.history.replaceState=a)}},[t,e]),null}
|
|
2
2
|
/**
|
|
3
3
|
* @license lucide-react v1.31.0 - ISC
|
|
4
4
|
*
|
|
5
5
|
* This source code is licensed under the ISC license.
|
|
6
6
|
* See the LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
|
-
const
|
|
8
|
+
const Pt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Ft=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),It=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Lt=e=>{
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v1.31.0 - ISC
|
|
11
11
|
*
|
|
@@ -24,21 +24,21 @@ const Mt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(`
|
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
26
|
*/
|
|
27
|
-
let t=
|
|
27
|
+
let t=It(e);return t.charAt(0).toUpperCase()+t.slice(1)};
|
|
28
28
|
/**
|
|
29
29
|
* @license lucide-react v1.31.0 - ISC
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the ISC license.
|
|
32
32
|
* See the LICENSE file in the root directory of this source tree.
|
|
33
33
|
*/
|
|
34
|
-
var
|
|
34
|
+
var Rt={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};
|
|
35
35
|
/**
|
|
36
36
|
* @license lucide-react v1.31.0 - ISC
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
39
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
40
|
*/
|
|
41
|
-
const
|
|
41
|
+
const zt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},Bt=s({}),Vt=()=>f(Bt),Ht=l(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},l)=>{
|
|
42
42
|
/**
|
|
43
43
|
* @license lucide-react v1.31.0 - ISC
|
|
44
44
|
*
|
|
@@ -51,14 +51,14 @@ const Lt=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)re
|
|
|
51
51
|
* This source code is licensed under the ISC license.
|
|
52
52
|
* See the LICENSE file in the root directory of this source tree.
|
|
53
53
|
*/
|
|
54
|
-
let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=
|
|
54
|
+
let{size:u=24,strokeWidth:d=2,absoluteStrokeWidth:f=!1,color:p=`currentColor`,className:m=``}=Vt()??{},h=r??f?Number(n??d)*24/Number(t??u):n??d;return c(`svg`,{ref:l,...Rt,width:t??u??Rt.width,height:t??u??Rt.height,stroke:e??p,strokeWidth:h,className:Pt(`lucide`,m,i),...!a&&!zt(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>c(e,t)),...Array.isArray(a)?a:[a]])}),Ut=(e,t)=>{
|
|
55
55
|
/**
|
|
56
56
|
* @license lucide-react v1.31.0 - ISC
|
|
57
57
|
*
|
|
58
58
|
* This source code is licensed under the ISC license.
|
|
59
59
|
* See the LICENSE file in the root directory of this source tree.
|
|
60
60
|
*/
|
|
61
|
-
let n=l(({className:n,...r},i)=>c(
|
|
61
|
+
let n=l(({className:n,...r},i)=>c(Ht,{ref:i,iconNode:t,className:Pt(`lucide-${Ft(Lt(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Lt(e),n},Wt=Ut(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Gt=Ut(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Kt=Ut(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),qt=Ut(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Jt=Ut(`lock-keyhole`,[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]),Yt=Ut(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Xt=Ut(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Zt=Ut(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Qt=Ut(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]])
|
|
62
62
|
/**
|
|
63
63
|
* @license lucide-react v1.31.0 - ISC
|
|
64
64
|
*
|
|
@@ -107,7 +107,13 @@ let n=l(({className:n,...r},i)=>c(Bt,{ref:i,iconNode:t,className:Mt(`lucide-${Nt
|
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
109
|
*/
|
|
110
|
-
;function Xt({name:e,AccessDenied:n=Qt,children:r}){return e?t(Zt,{name:e,AccessDenied:n,children:r}):t($t,{})}function Zt({name:e,AccessDenied:n=Qt,children:r}){let{authToken:i,client:a}=O(),[o,s]=y(null),[c,l]=y(`loading`);if(p(()=>{i?i.apps.includes(e)?a.apps.getAppInstallationByName(e).then(t=>{t?(l(`loaded`),s(t)):(console.log(`App ${e} not found!`),l(`error`))}):l(`error`):l(`loading`)},[e,i,a.apps.getAppInstallationByName]),c===`loading`)return null;if(c===`error`)return t(n,{name:e});if(o)return t($e,{installation:o,children:r})}function Qt({name:e}){let{project:r,accounts:i,client:a}=O(),{t:o}=k(),[s,c]=y(),{data:l}=ge(()=>a.apps.getAppInstallationProjects({name:e}),[e]),{projectsByOrg:u,orgOptions:d}=_(()=>{if(!l||!i)return{projectsByOrg:{},orgOptions:[]};let e={};for(let t of l)e[t.account]||(e[t.account]=[]),e[t.account].push(t);return{projectsByOrg:e,orgOptions:i.filter(t=>e[t.id]?.length>0)}},[l,i]);p(()=>{!s&&d.length>0&&c(d[0].id)},[d,s]);let f=e=>{localStorage.setItem(xe,e.account),localStorage.setItem(`${Se}-${e.account}`,e.id),window.location.reload()},m=s&&u[s]||[],h=d.find(e=>e.id===s);return n(S,{className:`pt-10 flex flex-col items-center text-center text-foreground`,children:[t(Kt,{className:`w-10 h-10 mb-4 text-muted`}),t(`div`,{className:`text-xl font-semibold`,children:o(`shell.accessDenied`)}),n(`div`,{className:`mt-2 text-sm text-muted`,children:[`You don't have permission to view the `,t(`span`,{className:`font-semibold`,children:e}),` app in project:`,` `,n(`span`,{className:`font-semibold`,children:[`«`,r?.name,`»`]}),`.`]}),d.length===0&&l!==void 0&&t(`div`,{className:`mt-4 text-sm text-muted`,children:`This app is not installed in any project you have access to.`}),d.length>0&&n(`div`,{className:`mt-4 flex flex-row gap-4 items-end`,children:[d.length>1&&n(`div`,{children:[t(`div`,{className:`text-sm text-muted mb-2`,children:o(`shell.organization`)}),t(se,{by:`id`,value:h,options:d,optionLabel:e=>e.name,placeholder:o(`shell.selectOrganization`),onChange:e=>c(e.id)})]}),n(`div`,{children:[d.length>1&&t(`div`,{className:`text-sm text-muted mb-2`,children:o(`login.terminal.project`)}),t(se,{by:`id`,value:void 0,options:m,optionLabel:e=>e.name,placeholder:o(`shell.selectProject`),onChange:f})]})]})]})}function $t(){let{t:e}=k();return n(S,{className:`pt-10 flex flex-col items-center text-center text-foreground`,children:[t(Kt,{className:`w-10 h-10 mb-4 text-muted`}),t(`div`,{className:`text-xl font-semibold`,children:e(`shell.applicationNotRegistered`)}),n(`div`,{className:`mt-2 text-sm text-muted`,children:[`Before starting to code a Vertesia application you must register an application manifest in Vertesia Studio then install it in one or more projects.`,t(`p`,{}),`Then use the created app name as a parameter to`,` `,t(`code`,{children:`<StandaloneApp name="your-app-name">`}),` in the `,t(`code`,{children:`src/main.tsx`}),` file.`]})]})}function en(){let e=O(),{client:r}=e,{t:i}=k(),[a,o]=y(!1),[s,c]=y([]);p(()=>{r.account.listInvites().then(e=>{if(e.length>0){let t=e.filter(e=>e.data.account);if(t.length===0){console.log(`No valid invites found, closing modal`);return}console.log(`Found valid invites`,t.length),o(!0),c(t)}else console.log(`No invites found, closing modal`),o(!1)}).catch(e=>{console.error(`Error fetching invites`,e)})},[r.account.listInvites]);let l=()=>o(!1),u=async t=>{await r.account.acceptInvite(t.id),await e.authCallback,await e.fetchAccounts(),await e.fetchProjects(t.data.account.id);let n=s.filter(e=>e.id!==t.id).filter(e=>e.data.account);n.length>0?c(n):l()},d=async e=>{await r.account.rejectInvite(e.id);let t=s.filter(t=>t.id!==e.id);c(t),t.length===0&&l()},f=s.map(e=>e.data.account?n(`div`,{className:`flex flex-row w-full justify-between border rounded-sm px-2 py-2 `,children:[n(`div`,{className:`flex flex-col`,children:[t(`div`,{className:`w-full font-semibold`,children:e.data.account.name??e.data.account}),e.data.project&&n(`div`,{className:`w-full text-base`,children:[`- `,e.data.project.name]}),n(`div`,{className:`text-xs`,children:[`Role: `,e.data.role]}),e.data.invited_by&&n(`div`,{className:`text-xs`,children:[`by `,e.data.invited_by.name??e.data.invited_by]})]}),n(`div`,{className:`flex flex-col gap-4`,children:[t(x,{size:`xs`,onClick:()=>u(e),children:i(`login.accept`)}),` `,t(x,{size:`xs`,variant:`secondary`,onClick:()=>d(e),children:i(`login.reject`)})]})]},e.id):(console.warn(`Invite has no account data`,e),null));return t(`div`,{children:n(E,{isOpen:a,onClose:l,children:[t(te,{children:i(`login.reviewInvites`)}),n(D,{children:[t(`div`,{className:`text-sm pb-4`,children:`You have received the following invites to join other accounts. Please review and accept or declined them.`}),f]})]})})}function tn(e){return n(`svg`,{viewBox:`0 0 48 48`,"aria-hidden":`true`,...e,children:[t(`path`,{fill:`#FFC107`,d:`M43.6 20.5H42V20H24v8h11.3c-1.6 4.7-6.1 8-11.3 8a12 12 0 0 1 0-24c3 0 5.8 1.1 7.9 3l5.7-5.7A20 20 0 1 0 24 44c11 0 20-9 20-20 0-1.2-.1-2.3-.4-3.5z`}),t(`path`,{fill:`#FF3D00`,d:`M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.1 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z`}),t(`path`,{fill:`#4CAF50`,d:`M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28.5l-6.6 5.1A20 20 0 0 0 24 44z`}),t(`path`,{fill:`#1976D2`,d:`M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4 5.5l6.3 5.3C37.9 36.6 44 31 44 24c0-1.2-.1-2.3-.4-3.5z`})]})}function nn(e){return t(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:t(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2C6.48 2 2 6.58 2 12.25c0 4.54 2.87 8.39 6.84 9.75.5.09.68-.22.68-.49v-1.7c-2.78.62-3.37-1.36-3.37-1.36-.46-1.18-1.11-1.5-1.11-1.5-.91-.63.07-.62.07-.62 1 .07 1.53 1.05 1.53 1.05.89 1.57 2.34 1.12 2.91.86.09-.66.35-1.12.63-1.38-2.22-.26-4.56-1.14-4.56-5.07 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.3.1-2.7 0 0 .84-.28 2.76 1.05A9.4 9.4 0 0 1 12 7.07c.85 0 1.71.12 2.51.34 1.91-1.33 2.75-1.05 2.75-1.05.55 1.4.2 2.44.1 2.7.64.72 1.03 1.63 1.03 2.75 0 3.94-2.34 4.81-4.57 5.06.36.32.68.94.68 1.9v2.81c0 .27.18.59.69.49C19.13 20.64 22 16.78 22 12.25 22 6.58 17.52 2 12 2z`})})}function rn(e){return n(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:[t(`path`,{fill:`#F25022`,d:`M2 2h9.5v9.5H2z`}),t(`path`,{fill:`#7FBA00`,d:`M12.5 2H22v9.5h-9.5z`}),t(`path`,{fill:`#00A4EF`,d:`M2 12.5h9.5V22H2z`}),t(`path`,{fill:`#FFB900`,d:`M12.5 12.5H22V22h-9.5z`})]})}const an=Gt,on={google:tn,github:nn,microsoft:rn,oidc:an};function sn(e){return e&&e in on?on[e]:an}function cn({children:e,centered:n=!1}){return t(`div`,{className:n?`w-full max-w-[420px] flex flex-col gap-6 items-center text-center`:`w-full max-w-[420px] flex flex-col gap-6`,children:e})}function ln({eyebrow:e,title:r,body:i,variant:a=`info`}){return n(`div`,{children:[e&&t(`div`,{className:`${a===`destructive`?`text-destructive`:`text-info`} text-[12.5px] font-medium mb-2`,children:e}),t(`h1`,{className:`text-foreground text-[22px] font-semibold tracking-tight leading-tight mb-1.5`,children:r}),i&&t(`p`,{className:`text-muted text-sm leading-relaxed`,children:i})]})}const un={primary:`h-[42px] gap-2.5 rounded-md bg-foreground text-background hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed`,loading:`h-[42px] gap-2.5 rounded-md bg-foreground text-background opacity-90`,ghost:`h-9 text-muted hover:text-foreground`};function j({variant:e=`primary`,className:n=``,type:r=`button`,disabled:i,...a}){return t(x,{variant:`unstyled`,size:`none`,type:r,disabled:e===`loading`||i,className:`cursor-pointer inline-flex items-center justify-center text-sm font-medium transition ${un[e]} ${n}`.trim(),...a})}function dn({size:e=`xs`,className:n=``,type:r=`button`,...i}){let a=`cursor-pointer ${e===`smaller`?`!text-[11px]`:`!text-xs`} text-muted hover:text-foreground !transition px-2 py-1 !rounded underline decoration-transparent hover:decoration-current underline-offset-[3px]`;return t(x,{variant:`unstyled`,size:`none`,type:r,className:n?`${a} ${n}`:a,...i})}const fn={circle:`size-9 rounded-full text-sm ring-4 ring-background ring-offset-1 ring-offset-border`,square:`size-[30px] rounded-md text-[11px]`};function pn({initials:e,shape:n=`circle`}){return t(`span`,{className:`bg-info text-info-foreground grid place-items-center font-semibold shrink-0 ${fn[n]}`,children:e})}function mn({children:e}){return t(`div`,{className:`inline-grid place-items-center size-14 rounded-xl bg-info-background border border-info/15 mb-3.5`,children:e})}function hn({title:e,subtitle:r,titleClass:i,subtitleClass:a}){return n(`div`,{className:`flex-1 min-w-0`,children:[t(`div`,{className:i,children:e}),t(`div`,{className:a,children:r})]})}const gn={tenant:{topRow:`flex items-center gap-2.5 px-3 py-2.5`,title:`text-[13.5px] font-semibold text-foreground leading-tight`,subtitle:`text-[11.5px] text-muted leading-tight mt-0.5`,bottomRow:`flex items-center gap-2.5 px-3 py-1.5 border-t border-border bg-muted-background`,mailBox:`size-[30px] grid place-items-center shrink-0`,mailIcon:`size-4 text-muted`,email:`text-sm text-foreground/80 flex-1 truncate`,actionSize:`xs`},returning:{topRow:`flex items-center gap-3 px-3.5 py-2.5`,title:`text-sm font-semibold text-foreground truncate`,subtitle:`text-xs text-foreground/80 truncate`,bottomRow:`flex items-center gap-3 px-3.5 py-1 border-t border-border bg-muted-background`,mailBox:`w-9 h-6 grid place-items-center shrink-0`,mailIcon:`size-3.5 text-muted`,email:`text-xs text-foreground/80 flex-1 truncate`,actionSize:`smaller`}};function _n({variant:e=`returning`,badge:r,title:i,subtitle:a,email:o,actionLabel:s,onAction:c}){let l=gn[e];return n(`div`,{className:`rounded-md border border-border bg-background overflow-hidden`,children:[n(`div`,{className:l.topRow,children:[r,t(hn,{title:i,subtitle:a,titleClass:l.title,subtitleClass:l.subtitle})]}),n(`div`,{className:l.bottomRow,children:[t(`div`,{className:l.mailBox,children:t(qt,{className:l.mailIcon})}),t(`span`,{className:l.email,children:o}),t(dn,{size:l.actionSize,onClick:c,children:s})]})]})}function vn({badge:e,title:r,subtitle:i,actionLabel:a,onAction:o}){return n(`div`,{className:`flex items-center gap-3 px-3.5 py-2.5 rounded-md border border-border bg-muted-background`,children:[e,t(hn,{title:r,subtitle:i,titleClass:`text-sm font-semibold text-foreground truncate`,subtitleClass:`text-xs text-muted truncate`}),t(dn,{onClick:o,children:a})]})}function yn({email:e,actionLabel:r,onAction:i}){return n(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-md border border-border bg-muted-background`,children:[t(qt,{className:`size-4 text-muted shrink-0`}),t(`span`,{className:`text-sm text-foreground/80 flex-1 truncate`,children:e}),t(dn,{onClick:i,children:r})]})}function bn({provider:e,label:r,onClick:i,variant:a=`outline`}){let o=sn(e);return a===`arrow`?n(x,{variant:`unstyled`,size:`none`,onClick:i,className:`cursor-pointer group h-[42px] w-full inline-flex items-center gap-3 ps-3.5 pe-3 rounded-md border border-border bg-background text-sm font-medium text-foreground transition hover:bg-muted-background`,children:[t(o,{className:`!size-[18px] shrink-0`}),t(`span`,{className:`flex-1 text-start`,children:r}),t(Ht,{className:`!size-3.5 text-muted opacity-0 group-hover:opacity-100 group-hover:translate-x-0.5 rtl:group-hover:-translate-x-0.5 transition`})]}):n(x,{variant:`outline`,onClick:i,className:`w-full py-5 flex rounded-lg transition duration-150 text-center ${a===`filled`?`!bg-foreground text-background hover:!bg-foreground/90`:`hover:shadow-sm`}`,children:[t(o,{className:`!size-[18px]`}),t(`span`,{className:`text-sm font-medium`,children:r})]})}function xn({icon:e,title:r,meta:i}){return n(`div`,{className:`flex items-center gap-2.5 px-3 py-2.5 rounded-md bg-destructive-background border border-destructive/20`,children:[t(e,{className:`size-5 text-destructive shrink-0`}),n(`div`,{className:`flex-1 min-w-0 text-sm`,children:[t(`div`,{className:`font-semibold text-destructive`,children:r}),t(`div`,{className:`text-xs text-destructive/80`,children:i})]})]})}function Sn({inputRef:e,label:r,placeholder:i,value:a,onChange:o,invalid:s=!1,error:c}){return n(`div`,{className:`flex flex-col gap-1.5`,children:[t(`label`,{htmlFor:`vt-login-email`,className:`text-xs font-medium text-foreground/80`,children:r}),t(`input`,{ref:e,id:`vt-login-email`,name:`vt-login-email`,type:`email`,className:`h-[42px] px-3.5 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted outline-none transition focus:border-info focus:ring-4 focus:ring-info/15 aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/15`,placeholder:i,value:a,onChange:e=>o(e.target.value),"aria-invalid":s,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":`true`,"data-form-type":`other`}),c&&t(`div`,{role:`alert`,className:`text-xs text-destructive`,children:c})]})}const Cn=`vt.lastSuccessfulLogin`,wn=`vt.pendingSignin`;function Tn(){try{let e=localStorage.getItem(Cn);if(!e)return null;let t=JSON.parse(e);return!t?.email||!t?.lastProvider?null:t}catch{return null}}function En(e){try{localStorage.setItem(Cn,JSON.stringify(e))}catch{}}function Dn(){try{localStorage.removeItem(Cn)}catch{}}function On(){try{let e=sessionStorage.getItem(wn);return e?JSON.parse(e):null}catch{return null}}function kn(e){try{sessionStorage.setItem(wn,JSON.stringify(e))}catch{}}function An(){try{sessionStorage.removeItem(wn)}catch{}}async function jn(){Dn(),An();try{await We(je())}catch{}}function Mn(e){let t=e||window.location.pathname||`/`;return t[0]!==`/`&&(t=`/${t}`),t}const Nn={google:(e,t)=>{let n=new Ve;return n.addScope(`profile`),n.addScope(`email`),n.setCustomParameters({redirect_uri:window.location.origin+Mn(t),...e?{login_hint:e}:{prompt:`select_account`}}),n},github:e=>{let t=new Be;return t.addScope(`profile`),t.addScope(`email`),e&&t.setCustomParameters({login:e}),t},microsoft:e=>{let t=new He(`microsoft.com`);return t.addScope(`profile`),t.addScope(`email`),e&&t.setCustomParameters({login_hint:e}),t},oidc:e=>{let t=new He(`oidc.main`);return e&&t.setCustomParameters({login_hint:e}),t}};function Pn(e,t,n){return Nn[e](t,n)}async function Fn(e,t,n){if(!t)return{ok:!1,reason:`no-email`};let r=await Me(t),i=je(),a=e,o;return r?(r.provider&&(a=r.provider),o=r.label||r.name||void 0,localStorage.setItem(`tenantName`,o??``)):(localStorage.removeItem(`tenantName`),i.tenantId&&=null),kn({email:t,provider:a,tenantName:o}),Ue(i,Pn(a,t,n)),{ok:!0}}function In(e,t){let n=je();localStorage.removeItem(`tenantName`),n.tenantId&&=null,Ue(n,Pn(e,void 0,t))}function Ln(e){return e===`google`?`Google`:e===`github`?`GitHub`:e===`microsoft`?`Microsoft`:`Sign In`}function Rn(e){if(!e)return``;let t=e.lastIndexOf(`@`);return t>0?e.slice(0,t):e}function zn(e){if(!e)return``;let t=e.lastIndexOf(`@`);return t>0?e.slice(t+1):``}function Bn(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Vn(e){return(e||`?`).charAt(0).toUpperCase()}function Hn(e){let t=Rn(e).split(/[._-]+/).filter(Boolean)[0]||`friend`;return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function Un(e){for(let t of e)if(t.trim()===``)return!0;return!1}function Wn(e){let t=(e||``).trim(),n=t.indexOf(`@`);if(n<=0||n!==t.lastIndexOf(`@`))return!1;let r=t.slice(n+1),i=r.indexOf(`.`);return i>0&&i<r.length-1&&!Un(t)}function Gn(e){let t=e;for(let e=0;t!=null&&e<8;e++){if((t instanceof Error?t.message:String(t)).includes(`Customer-domain user requires an invite to join`))return!0;t=t instanceof Error?t.cause:void 0}return!1}function Kn({provider:e,onCancel:r}){let{t:i}=k(),a=sn(e),o=e===`oidc`?i(`auth.pending.genericProvider`):Ln(e);return n(cn,{centered:!0,children:[n(`div`,{children:[t(mn,{children:t(a,{className:e===`oidc`?`size-6 text-info`:`size-6`})}),t(ln,{title:i(`auth.pending.title`,{provider:o}),body:i(`auth.pending.body`)})]}),n(`div`,{className:`w-full flex flex-col gap-2`,children:[n(j,{variant:`loading`,children:[t(ce,{}),t(`span`,{children:i(`auth.pending.authenticating`)})]}),r&&t(j,{variant:`ghost`,onClick:r,children:i(`auth.pending.cancel`)})]})]})}function qn({initialEmail:r,onProceed:i}){let{t:a}=k(),[o,s]=y(r??``),[c,l]=y(!1),[u,d]=y(!1),f=v(null);return p(()=>{f.current?.focus()},[]),n(cn,{children:[t(ln,{eyebrow:a(`auth.email.eyebrow`),title:a(`auth.email.title`),body:a(`auth.email.body`)}),n(`form`,{onSubmit:async e=>{if(e.preventDefault(),!u){if(!Wn(o)){l(!0);return}l(!1),d(!0);try{let e=await Me(o.trim().toLowerCase());i(o.trim().toLowerCase(),e??void 0)}catch{i(o.trim().toLowerCase(),void 0)}finally{d(!1)}}},noValidate:!0,className:`flex flex-col ${c?`gap-2`:`gap-6`}`,children:[t(Sn,{inputRef:f,label:a(`auth.email.label`),placeholder:a(`auth.email.placeholder`),value:o,onChange:e=>{s(e),c&&l(!1)},invalid:c,error:c?a(`auth.email.invalidError`):void 0}),t(j,{type:`submit`,disabled:u,children:u?t(ce,{}):n(e,{children:[t(`span`,{children:a(`auth.continue`)}),t(Ht,{className:`!size-3.5`})]})})]})]})}const Jn=[`google`,`github`,`microsoft`];function Yn({email:e,onBack:r,onProviderClicked:i,redirectTo:a}){let{t:o}=k(),s=async t=>{i(t),await Fn(t,e,a)};return n(cn,{children:[t(ln,{eyebrow:o(`auth.providers.eyebrow`),title:o(`auth.providers.title`),body:o(`auth.providers.bodyConsumer`)}),t(yn,{email:e,actionLabel:o(`auth.change`),onAction:r}),t(`div`,{className:`flex flex-col gap-2`,children:Jn.map(e=>t(bn,{provider:e,label:o(`auth.continueWithProvider`,{provider:Ln(e)}),onClick:()=>s(e),variant:`arrow`},e))})]})}function Xn({details:r,identity:i,kind:a,onContinue:o,onUseDifferentAccount:s}){let{t:c}=k(),[l,u]=y(!1),d=v(null);p(()=>{d.current?.focus()},[]);let f=a===`scopeProject`||a===`scopeAccount`,m;m=a===`scopeProject`?{eyebrow:c(`auth.recovery.scopeProject.eyebrow`),title:c(`auth.recovery.scopeProject.title`),body:c(`auth.recovery.scopeProject.body`)}:a===`scopeAccount`?{eyebrow:c(`auth.recovery.scopeAccount.eyebrow`),title:c(`auth.recovery.scopeAccount.title`),body:c(`auth.recovery.scopeAccount.body`)}:a===`noAccessibleAccount`?{eyebrow:c(`auth.recovery.noAccessibleAccount.eyebrow`),title:c(`auth.recovery.noAccessibleAccount.title`),body:c(`auth.recovery.noAccessibleAccount.body`)}:a===`credential`?{eyebrow:c(`auth.recovery.credential.eyebrow`),title:c(`auth.recovery.credential.title`),body:c(`auth.recovery.credential.body`)}:{eyebrow:c(`auth.recovery.service.eyebrow`),title:c(`auth.recovery.service.title`),body:c(`auth.recovery.service.body`)};let h=e=>{l||(u(!0),e())};return n(cn,{children:[n(`div`,{role:`alert`,"aria-live":`assertive`,children:[t(mn,{children:t(Yt,{className:`size-7 text-attention`,"aria-hidden":`true`})}),t(ln,{eyebrow:m.eyebrow,title:m.title,body:m.body})]}),i&&t(vn,{badge:t(pn,{initials:Vn(i.email)}),title:i.name||Hn(i.email),subtitle:i.email,actionLabel:c(`auth.returning.notYou`),onAction:s}),n(`div`,{className:`flex flex-col gap-2`,children:[o&&t(j,{ref:d,className:`w-full`,disabled:l,onClick:()=>h(o),children:c(f?`auth.recovery.continue`:`auth.recovery.tryAgain`)}),t(j,{ref:o?void 0:d,variant:o?`ghost`:`primary`,disabled:l,onClick:()=>h(s),children:c(`auth.recovery.useDifferentAccount`)}),(a===`noAccessibleAccount`||a===`service`)&&n(`p`,{className:`text-center text-xs text-muted`,children:[c(`auth.recovery.supportPrefix`),` `,t(`a`,{className:`text-info`,href:`mailto:support@vertesiahq.com`,children:`support@vertesiahq.com`})]})]}),r&&n(`details`,{className:`rounded-lg border border-mixer-muted/30 bg-mixer-muted/10 px-4 py-3 text-sm`,children:[t(`summary`,{className:`cursor-pointer font-medium text-muted marker:text-muted focus-visible:outline-2 focus-visible:outline-offset-2`,children:c(`auth.recovery.technicalDetails`)}),n(`dl`,{className:`mt-3 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3 gap-y-2 text-xs`,children:[r.errorCode&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.errorCode`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.errorCode})]}),r.status&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.httpStatus`)}),t(`dd`,{className:`font-mono`,children:r.status})]}),r.accountId&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.requestedAccount`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.accountId})]}),r.projectId&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.requestedProject`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.projectId})]}),t(`dt`,{className:`text-muted`,children:c(`auth.recovery.errorMessage`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.message})]})]})]})}const Zn={dev1:`us1`};function Qn(e){let t=e&&Zn[e]||e;return t?`https://cloud.${t}.vertesia.io/`:`https://cloud.vertesia.io/`}function $n({onUseDifferentEmail:e}){let{t:r}=k(),i=Qn(A.region),[a,o]=y(15);return p(()=>{jn()},[]),p(()=>{let e=setTimeout(()=>{window.location.href=i},15e3),t=setInterval(()=>{o(e=>e>0?e-1:0)},1e3);return()=>{clearTimeout(e),clearInterval(t)}},[i]),n(cn,{children:[t(ln,{variant:`destructive`,eyebrow:r(`auth.restricted.eyebrow`),title:r(`auth.restricted.title`),body:r(`auth.restricted.body`)}),n(`div`,{className:`flex flex-col gap-2`,children:[t(xn,{icon:Jt,title:r(`auth.restricted.calloutTitle`),meta:r(`auth.restricted.calloutMeta`)}),t(j,{className:`w-full`,onClick:()=>{window.location.href=i},children:r(`auth.restricted.redirect`)}),t(j,{variant:`ghost`,onClick:e,children:r(`auth.restricted.useDifferent`)}),t(`p`,{className:`text-center text-xs text-muted`,children:r(`auth.restricted.autoRedirect`,{seconds:a})})]})]})}function er({session:e,onNotYou:r,onProviderClicked:i,redirectTo:a}){let{t:o}=k(),s=e.name?e.name.split(` `)[0]||e.name:Hn(e.email),c=e.name||Hn(e.email),l=t(pn,{initials:Vn(e.email)}),u=!!e.tenantName,d=e.lastProvider===`oidc`?o(`auth.continueWithSignIn`):o(`auth.continueWithProvider`,{provider:Ln(e.lastProvider)}),f=async t=>{i(t),await Fn(t,e.email,a)};return n(cn,{children:[t(ln,{eyebrow:o(`auth.returning.eyebrow`),title:o(`auth.returning.title`,{name:s}),body:o(`auth.returning.body`)}),u&&e.tenantName?t(_n,{variant:`returning`,badge:l,title:c,subtitle:e.tenantName,email:e.email,actionLabel:o(`auth.returning.notYou`),onAction:r}):t(vn,{badge:l,title:c,subtitle:e.email,actionLabel:o(`auth.returning.notYou`),onAction:r}),n(`div`,{className:`flex flex-col gap-2`,children:[t(bn,{provider:e.lastProvider,label:d,onClick:()=>f(e.lastProvider),variant:`filled`}),t(j,{variant:`ghost`,onClick:r,children:o(`auth.returning.useDifferent`)})]})]})}function tr({email:e,tenantName:r,onBack:i}){let{t:a}=k(),o=r||a(`auth.blocked.tenantFallback`),s=zn(e),c=r||(s?a(`auth.blocked.teamFromDomain`,{domain:Bn(s)}):a(`auth.blocked.tenantFallback`));return n(cn,{children:[t(ln,{variant:`destructive`,eyebrow:a(`auth.blocked.eyebrow`),title:a(`auth.blocked.title`),body:a(`auth.blocked.body`,{name:o,email:e})}),n(`div`,{className:`flex flex-col gap-2`,children:[t(xn,{icon:Jt,title:c,meta:a(`auth.blocked.tenantMeta`,{email:e})}),t(j,{variant:`ghost`,onClick:i,children:a(`auth.blocked.useDifferent`)})]})]})}function nr({provider:e,email:n,redirectTo:r,variant:i=`outline`,onClick:a}){let{t:o}=k(),s=e===`oidc`?o(`auth.continueWithSignIn`):o(`auth.continueWithProvider`,{provider:Ln(e)});return t(bn,{provider:e,label:s,onClick:()=>{a?.(),n?Fn(e,n,r):In(e,r)},variant:i})}function rr(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)}function ir({email:e,tenant:r,onBack:i,onProviderClicked:a,redirectTo:o}){let{t:s}=k(),c=r.label||r.name||s(`auth.blocked.tenantFallback`),l=r.provider===`google`||r.provider===`github`||r.provider===`microsoft`?r.provider:`oidc`,u=l===`oidc`?s(`auth.tenant.viaIdpFallback`):Ln(l);return n(cn,{children:[t(ln,{eyebrow:s(`auth.tenant.eyebrow`),title:s(`auth.tenant.title`,{name:c}),body:s(`auth.tenant.body`)}),t(_n,{variant:`tenant`,badge:t(pn,{initials:rr(c),shape:`square`}),title:c,subtitle:s(`auth.tenant.viaIdp`,{idp:u}),email:e,actionLabel:s(`auth.change`),onAction:i}),n(`div`,{className:`flex flex-col gap-2`,children:[t(nr,{provider:l,email:e,redirectTo:o,variant:`filled`,onClick:a}),t(j,{variant:`ghost`,onClick:i,children:s(`auth.tenant.notPartOf`,{name:c})})]})]})}function ar({onSignup:r,goBack:i}){let{t:a}=k(),[o,s]=y(void 0),[c,l]=y(void 0),[u,d]=y(void 0),[f,m]=y(void 0),[h,g]=y(void 0),[_,v]=y(void 0),[b,S]=y(void 0),C=o===`company`,T=[{id:1,label:a(`signup.size1to10`)},{id:11,label:a(`signup.size11to100`)},{id:101,label:a(`signup.size101to1000`)},{id:1001,label:a(`signup.size1001to5000`)},{id:5001,label:a(`signup.size5000plus`)}],E=[{id:`personal`,label:a(`signup.personal`),description:a(`signup.personalDescription`)},{id:`company`,label:a(`signup.company`),description:a(`signup.companyDescription`)}],D=[{id:`testing`,label:a(`signup.justTesting`)},{id:`exploring`,label:a(`signup.activelyExploring`)},{id:`using`,label:a(`signup.alreadyUsing`)},{id:`migrating`,label:a(`signup.migratingLLMs`)},{id:`other`,label:a(`signup.other`)}];p(()=>{let e=je().currentUser;if(!e){console.error(`No user found`);return}v(e)},[]);let ee=()=>o?C&&!u?(S(a(`signup.pleaseEnterOrgName`)),!1):C&&!c?(S(a(`signup.pleaseSelectCompanySize`)),!1):!0:(S(a(`signup.pleaseSelectAccountType`)),!1);return n(`div`,{className:`flex flex-col space-y-2`,children:[n(`div`,{className:`prose`,children:[t(`p`,{className:`prose text-sm text-muted pt-4`,children:a(`signup.welcomeMessage`,{name:_?.displayName,email:_?.email})}),b&&t(`div`,{className:`text-destructive`,children:b})]}),t(or,{label:a(`signup.accountType`),children:t(oe,{options:E,selected:E.find(e=>e.id===o),onSelect:e=>s(e.id)})}),C&&n(e,{children:[t(or,{label:a(`signup.companySize`),children:t(se,{className:`w-full border border-muted bg-muted`,value:c,options:T,onChange:l,optionLabel:e=>e?.label,placeholder:a(`signup.selectCompanySize`)})}),t(or,{label:a(`signup.companyName`),children:t(w,{value:u,onChange:d,type:`text`,required:!0})}),t(or,{label:a(`signup.companyWebsite`),children:t(w,{value:f,onChange:m,type:`text`})})]}),t(or,{label:a(`signup.projectMaturity`),children:t(se,{className:`w-full border border-muted bg-muted`,options:D,value:D.find(e=>e.id===h),optionLabel:e=>e?.label,placeholder:a(`signup.selectProjectMaturity`),onChange:e=>g(e?.id)})}),n(`div`,{className:`pt-8 flex flex-col`,children:[t(x,{variant:`primary`,onClick:async()=>{if(!ee()||!o)return;let e={accountType:o,companyName:u,companySize:c?.id,companyWebsite:f,maturity:h};window.localStorage.setItem(`composableSignupData`,JSON.stringify(e));let t=await je().currentUser?.getIdToken();if(console.log(`Got firebase token`,je(),t),!t){console.error(`No firebase token found`);return}r(e,t)},size:`xl`,children:t(`span`,{className:`text-lg`,children:a(`signup.signUp`)})}),t(x,{variant:`ghost`,size:`xl`,className:`mt-4`,onClick:i,children:t(`span`,{className:``,children:a(`signup.wrongAccountGoBack`)})})]})]})}function or({label:e,children:r}){return n(`div`,{className:`flex flex-col space-y-2 pt-4`,children:[t(`div`,{className:`text-sm text-muted`,children:e}),r]})}function sr({allowedPrefix:e,isNested:n=!1,lightLogo:r,darkLogo:i,preservePath:a,suppressAuthErrorPrefix:o}){let s=typeof window>`u`?``:window.location.pathname,c=cr(s,e),l=cr(s,o);return c?null:t(ur,{isNested:n,lightLogo:r,darkLogo:i,preservePath:a,suppressAuthError:l})}function cr(e,t){return(Array.isArray(t)?t:t?[t]:[]).some(t=>e===t||e.startsWith(t.endsWith(`/`)?t:`${t}/`))}function lr(e){return e instanceof Ee||e instanceof Te||e instanceof we||e instanceof Ce||e instanceof ye||e instanceof ve}function ur({isNested:e=!1,lightLogo:r,darkLogo:i,preservePath:a,suppressAuthError:o}){let{t:s}=k(),{isLoading:c,user:l,authError:u,signOut:f}=O(),{trackEvent:m}=Ne(),[h,g]=y(()=>Tn()),[_,v]=y(()=>Tn()?`returning`:`email`),[b,x]=y(``),[S,C]=y(void 0),[w,T]=y(null),E=u instanceof we||u instanceof Ce?u.identity:void 0,D=E&&h?.email.toLowerCase()===E.email.toLowerCase()?h:void 0,ee=E?{email:E.email,name:E.name??D?.name}:void 0;p(()=>{if(!a&&!c&&!u){let e=new URL(document.baseURI).pathname||`/`;history.replaceState({},``,e)}},[u,c,a]),p(()=>{if(u){if(u instanceof Ee)v(`signup`);else if(u instanceof Te)v(`restricted`);else if(u instanceof we)v(`scopeUnavailable`);else if(u instanceof Ce)v(`noAccessibleAccount`);else if(u instanceof ye)v(`credentialFailure`);else if(u instanceof ve)v(`serviceFailure`);else if(Gn(u)){let e=On();e&&x(e.email),v(`blocked`)}}},[u]),p(()=>{if(!l)return;let e=On();e&&(En({email:e.email,lastProvider:e.provider,tenantName:e.tenantName,name:l.name||void 0}),An())},[l]);let te=d((e,t)=>{x(e),C(t),v(t?`tenant`:`providers`)},[]),ne=d(()=>{v(`email`),C(void 0)},[]),re=d(()=>{Dn(),An(),g(null),x(``),C(void 0),v(`email`),f()},[f]),ie=d(e=>{(S||h?.tenantName)&&m(`enterprise_signin`,{provider:e}),T(e),v(`pending`)},[m,h?.tenantName,S]),ae=d(()=>{g(null),x(``),C(void 0),v(`email`),jn()},[]),oe=d(()=>{A.logger.info(`Authentication recovery action selected`,{vertesia:{recovery_action:`use_different_account`}}),g(null),x(``),C(void 0),v(`email`),jn().finally(()=>f())},[f]),se=d(()=>{u instanceof we&&(A.logger.info(`Authentication recovery action selected`,{vertesia:{error_code:Le,selector_source:u.selectorSource,requested_scope:u.requestedScope,recovery_action:`continue_sanitized`}}),window.location.replace(u.recoveryUrl??window.location.href))},[u]),ce=d(()=>{A.logger.info(`Authentication recovery action selected`,{vertesia:{recovery_action:`retry`}}),window.location.reload()},[]),le=(e,t)=>{let n={signupData:e,firebaseToken:t};fetch(`${A.endpoints.studio}/auth/signup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}).then(()=>{m(`sign_up`),window.location.href=`/`})},ue=o&&u!==void 0&&!lr(u);if(c||l||ue)return null;let de=null;if(_===`pending`&&w)de=t(Kn,{provider:w});else if(_===`blocked`)de=t(tr,{email:b||h?.email||``,tenantName:S?.label||S?.name||h?.tenantName||void 0,onBack:ae});else if(_===`restricted`)de=t($n,{onUseDifferentEmail:ae});else if(_===`scopeUnavailable`&&u instanceof we){let e=u.requestedScope===`project`?`scopeProject`:`scopeAccount`;de=t(Xn,{details:{accountId:u.accountId,errorCode:u.errorCode,message:u.message,projectId:u.projectId,status:u.status},identity:ee,kind:e,onContinue:se,onUseDifferentAccount:oe})}else de=_===`noAccessibleAccount`&&u instanceof Ce?t(Xn,{details:{errorCode:u.errorCode,message:u.message,status:u.status},identity:ee,kind:`noAccessibleAccount`,onUseDifferentAccount:oe}):_===`credentialFailure`&&u instanceof ye?t(Xn,{details:{errorCode:u.errorCode,message:u.message,status:u.status},kind:`credential`,onUseDifferentAccount:oe}):_===`serviceFailure`&&u instanceof ve?t(Xn,{details:{errorCode:u.errorCode,message:u.message,status:u.status},kind:`service`,onContinue:ce,onUseDifferentAccount:oe}):_===`signup`&&!localStorage.getItem(`tenantName`)?t(ar,{onSignup:le,goBack:ae}):_===`tenant`&&S?t(ir,{email:b,tenant:S,onBack:ne,onProviderClicked:()=>ie(S.provider??`oidc`)}):_===`providers`?t(Yn,{email:b,onBack:ne,onProviderClicked:ie}):_===`returning`&&h?t(er,{session:h,onNotYou:re,onProviderClicked:ie}):t(qn,{initialEmail:b,onProceed:te});return t(`div`,{style:{zIndex:999998},className:`${e?`absolute`:`fixed`} inset-0 overflow-y-auto bg-background`,children:t(`div`,{className:`min-h-full flex flex-col items-center justify-center py-12 px-4`,children:n(`div`,{className:`flex flex-col items-center w-full`,children:[(r||i)&&n(`div`,{className:`mb-7`,children:[r&&t(`img`,{src:r,alt:`Vertesia`,className:`h-10 block dark:hidden`}),i&&t(`img`,{src:i,alt:`Vertesia`,className:`h-10 hidden dark:block`})]}),de,u&&!lr(u)&&!Gn(u)&&t(`div`,{className:`mt-6 max-w-[420px] text-center text-sm text-muted`,children:n(`div`,{children:[s(`auth.signInError`),t(`br`,{}),s(`auth.signInErrorContact`),t(`a`,{className:`text-info mx-1`,href:`mailto:support@vertesiahq.com`,children:`support@vertesiahq.com`}),s(`auth.signInErrorPersists`)]})}),n(`div`,{className:`flex items-center gap-5 mt-10 text-xs text-muted`,children:[t(`a`,{href:`https://vertesiahq.com/privacy`,className:`hover:text-foreground transition`,children:s(`auth.privacyPolicy`)}),t(`span`,{className:`text-border`,children:`·`}),t(`a`,{href:`https://vertesiahq.com/terms`,className:`hover:text-foreground transition`,children:s(`auth.termsOfService`)}),t(`span`,{className:`text-border`,children:`·`}),t(ze,{className:`cursor-default`})]})]})})})}const dr=new Set([`127.0.0.1`,`localhost`]);function fr(e){if(!e)return null;let t;try{t=decodeURIComponent(e)}catch{return null}let n;try{n=new URL(t)}catch{return null}return n.protocol!==`http:`||!n.port||n.username||n.password||!dr.has(n.hostname)?null:n.toString()}function pr(e){let t=new URLSearchParams(e.search),n=fr(t.get(`redirect_uri`)),r=t.get(`code`);return!n||!r?null:{redirect:n,code:r,profile:t.get(`profile`)??`default`,project:t.get(`project`)??void 0,account:t.get(`account`)??void 0}}function mr(){let[e,n]=y(),[r,i]=y(),a=pr(Ge()),o=_e(),{t:s}=k(),c=a?e?t(gr,{payload:e,error:r}):t(hr,{clientInfo:a,onAccept:async e=>{if(!a)return;if(!e.profile){o({title:s(`login.terminal.profileRequired`),description:s(`login.terminal.profileRequiredDesc`),status:`error`,duration:2e3});return}if(!e.account){o({title:s(`login.terminal.accountRequired`),description:s(`login.terminal.accountRequiredDesc`),status:`error`,duration:2e3});return}if(!e.project){o({title:s(`login.terminal.projectRequired`),description:s(`login.terminal.projectRequiredDesc`),status:`error`,duration:2e3});return}let t;try{let r=Ae(),i=r?await ke(r,e.account,e.project,86400):await Oe(e.account,e.project,86400);i?(t={...e,studio_server_url:A.endpoints.studio,zeno_server_url:A.endpoints.zeno,token:i},await fetch(a.redirect,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),n(t)):o({title:s(`login.terminal.failedToGetToken`),status:`error`,duration:5e3})}catch(e){t?(i(e instanceof Error?e:Error(he(e))),n(t)):o({title:s(`login.terminal.errorAuthorizingClient`),description:he(e),status:`error`,duration:5e3})}}}):t(C,{title:s(`login.terminal.invalidRequest`),children:s(`login.terminal.invalidRequestDesc`)});return t(`div`,{className:`w-full flex flex-col items-center gap-4 mt-24`,children:c})}function hr({onAccept:r,clientInfo:i}){let{client:a,user:o}=O(),{data:s,error:c}=ge(()=>o?a.projects.list():Promise.resolve([]),[o]),{t:l}=k();if(c)return t(C,{title:l(`login.terminal.errorLoadingProjects`),children:he(c)});let u=A.isLocalDev?l(`login.terminal.envLocalDev`):A.isDev?l(`login.terminal.envStaging`):l(`login.terminal.envProduction`);return o&&s?n(e,{children:[n(`div`,{className:`w-1/3`,children:[n(`div`,{className:`mb-4 text-xl font-semibold text-info`,children:[`Authorizing client on `,u,` environment.`]}),n(`div`,{className:`mb-2 text-base text-muted`,children:[t(`div`,{children:l(`login.terminal.clientWantsAuth`)}),n(`div`,{children:[`The client app code is `,t(`b`,{className:`text-foreground`,children:i.code}),`. You can check if the code is correct in the terminal.`]})]}),n(`div`,{className:`mb-2 text-sm text-muted`,children:[t(`div`,{children:l(`login.terminal.chooseAccountProject`)}),t(`div`,{children:l(`login.terminal.profileNameNote`)})]})]}),t(_r,{onAccept:r,allProjects:s,data:i})]}):t(ce,{size:`lg`})}function gr({payload:e,error:r}){let i=_e(),{t:a}=k();return n(`div`,{children:[r?t(`div`,{children:t(C,{title:a(`login.terminal.failedToSendToken`),children:a(`login.terminal.failedToSendTokenDesc`,{error:r.message})})}):t(`div`,{children:a(`login.terminal.clientAuthenticated`)}),t(S,{className:`mt-4`,children:t(x,{variant:`secondary`,onClick:()=>{e&&(navigator.clipboard.writeText(JSON.stringify(e)),i({title:a(`login.terminal.authPayloadCopied`),description:r?a(`login.terminal.authPayloadCopiedWithError`,{error:r.message}):a(`login.terminal.authPayloadCopiedSuccess`),status:`success`,duration:5e3}))},children:a(`login.terminal.copyAuthPayload`)})})]})}function _r({allProjects:e,data:r,onAccept:i}){let{accounts:a,account:o,project:s}=O(),{t:c}=k(),[l,u]=y(()=>({profile:r.profile,account:r.account??o?.id,project:r.project??s?.id})),d=e=>{u({...l,profile:e})},f=e=>{u({...l,account:e.id,project:void 0})},p=e=>{u({...l,project:e.id})},m=e.filter(e=>e.account===l.account);return n(`div`,{className:`w-1/3`,children:[n(`div`,{className:`mb-4 flex flex-col gap-2`,children:[t(`span`,{className:`font-semibold text-muted`,children:c(`login.terminal.profileName`)}),t(w,{type:`text`,value:l.profile,onChange:d})]}),n(`div`,{className:`mb-4 flex flex-col gap-2`,children:[t(`span`,{className:`font-semibold text-muted`,children:c(`login.terminal.account`)}),t(vr,{value:l.account,onChange:f,accounts:a||[]})]}),n(`div`,{className:`mb-4 flex flex-col gap-2`,children:[t(`span`,{className:`font-semibold text-muted`,children:c(`login.terminal.project`)}),t(yr,{value:l.project,onChange:p,projects:m})]}),t(`div`,{className:`mb-4 text-sm text-attention`,children:c(`login.terminal.browserPermissionNote`)}),t(`div`,{children:t(x,{size:`xl`,onClick:()=>i(l),children:c(`login.terminal.authorizeClient`)})})]})}function vr({value:e,accounts:n,onChange:r}){let{t:i}=k();return t(se,{options:n,value:n?.find(t=>t.id===e),onChange:e=>{r(e)},by:`id`,optionLabel:e=>e.name,placeholder:i(`login.terminal.selectAccount`)})}function yr({value:e,projects:n,onChange:r}){let{t:i}=k();return t(se,{by:`id`,value:n.find(t=>t.id===e),options:n,optionLabel:e=>e.name,placeholder:i(`login.terminal.selectProject`),onChange:e=>{r(e)}})}function br({isOpen:e,onClose:r}){return n(E,{isOpen:e,onClose:r,children:[t(te,{children:`Sign In`}),n(D,{className:`flex flex-col gap-2`,children:[t(nr,{provider:`google`}),t(nr,{provider:`github`}),t(nr,{provider:`microsoft`})]}),t(ee,{align:`right`,children:t(x,{variant:`ghost`,onClick:r,children:`Cancel`})})]})}function M({title:e,value:r}){function i(e){navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}let[a,o]=y(!1);return n(`div`,{className:`w-full flex justify-between items-center mb-1`,children:[n(`div`,{className:`flex flex-col w-[calc(100%-3rem)]`,children:[t(`div`,{className:`text-sm px-2 dark:text-foreground`,children:e}),t(me,{description:r,size:`xs`,placement:`left`,children:n(`div`,{className:`text-xs truncate text-muted w-full text-start px-2`,children:[r,` `]})})]}),a?t(Ut,{className:`size-4 cursor-pointer text-success`}):t(Wt,{className:`size-4 cursor-pointer text-muted`,onClick:()=>i(r)})]})}function xr(){let{t:e}=k(),{account:r,project:i,client:a,authToken:o}=O(),s=a.baseUrl,c=a.store.baseUrl,l=c.replace(/\/+$/,``)!==s.replace(/\/+$/,``),u=A.endpoints.mcp??e(`user.unknown`),d=i?Re(i):``,f=[{name:`user`,label:e(`user.user`),content:n(`div`,{className:`space-y-1 p-2`,children:[t(M,{title:e(`user.organizationId`),value:r?.id??e(`user.unknown`)}),t(M,{title:e(`user.projectId`),value:i?.id??e(`user.unknown`)}),t(M,{title:e(`user.userId`),value:o?.sub??e(`user.unknown`)}),t(M,{title:e(`user.organizationRoles`),value:o?.account_roles?.join(`,`)??e(`user.unknown`)}),t(M,{title:e(`user.projectRoles`),value:o?.project_roles?.join(`,`)??e(`user.unknown`)})]})},{name:`environment`,label:e(`user.environment`),content:n(`div`,{className:`space-y-1 p-2`,children:[t(M,{title:e(`user.tenantId`),value:d}),t(M,{title:e(`user.environment`),value:A.type}),t(M,{title:e(`user.server`),value:s}),l&&t(M,{title:e(`user.store`),value:c}),t(M,{title:e(`user.mcpServer`),value:u}),t(M,{title:e(`user.appVersion`),value:A.version}),t(M,{title:e(`user.sdkVersion`),value:A.sdkVersion||e(`user.unknown`)})]})}];return t(`div`,{className:`w-full`,children:n(le,{defaultValue:`user`,tabs:f,fullWidth:!0,updateHash:!1,children:[t(ue,{}),t(de,{})]})})}function Sr(r){let{user:i,isLoading:a}=O(),[o,s]=y(!1);return a?t(ce,{}):i?t(`div`,{className:`px-3`,children:t(Cr,{asMenuTrigger:!0})}):n(e,{children:[t(x,{onClick:()=>s(!0),children:`Sign In`}),t(br,{isOpen:o,onClose:()=>s(!1)})]})}function Cr({className:e,asMenuTrigger:r=!1}){let i=O(),a=Ke(),o=Ye(),{user:s}=i;if(!i||!s)return null;let c=o.hasPermission(Ie.project_admin);return n(re,{click:!0,children:[t(ae,{children:t(`div`,{className:Xe(e,`flex items-center justify-start`,r&&`cursor-pointer`),children:t(b,{size:`sm`,color:`bg-amber-500`,shape:`circle`,name:s?.name})})}),t(ie,{align:`start`,className:`w-[280px] mx-2 my-1 p-0`,children:n(`div`,{className:`divide-y divide-border`,children:[n(`div`,{className:`py-2 ps-2`,children:[t(`p`,{className:`px-4 dark:text-white mb-1`,children:s?.name??`Unknown`}),t(`p`,{className:`px-4 text-xs text-muted`,children:s?.email??``})]}),t(`div`,{className:`w-full p-1`,children:t(xr,{})}),t(`div`,{className:`py-2 ps-2`,children:t(ne,{})}),t(`div`,{className:`py-2`,children:n(T,{children:[c&&t(T.Item,{className:`px-2`,onClick:()=>a(`/settings`,{replace:!0}),children:`Settings`}),t(T.Item,{className:`px-2`,onClick:()=>i.logout(),children:`Sign out`})]})})]})})]})}function wr(e){return e?e.endsWith(`@vertesiahq.com`)||e.endsWith(`@becomposable.com`)||e.endsWith(`@composableprompts.com`):!1}const Tr=s({});function Er(e){let t=v(null);return t.current===null&&(t.current=e()),t.current}const Dr=typeof window<`u`?g:p,Or=s(null);function kr(e,t){e.indexOf(t)===-1&&e.push(t)}function Ar(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const N=(e,t,n)=>n>t?t:n<e?e:n,jr={},Mr=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Nr=e=>typeof e==`object`&&!!e,Pr=e=>/^0[^.\s]+$/u.test(e);function Fr(e){let t;return()=>(t===void 0&&(t=e()),t)}const P=e=>e,Ir=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Lr=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var Rr=class{constructor(){this.subscriptions=[]}add(e){return kr(this.subscriptions,e),()=>Ar(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const F=e=>e*1e3,I=e=>e/1e3,zr=(e,t)=>t?1e3/t*e:0,Br=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Vr(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Br(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}function Hr(e,t,n,r){if(e===t&&n===r)return P;let i=t=>Vr(t,0,1,e,n);return e=>e===0||e===1?e:Br(i(e),t,r)}const Ur=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Wr=e=>t=>1-e(1-t),Gr=Hr(.33,1.53,.69,.99),Kr=Wr(Gr),qr=Ur(Kr),Jr=e=>e>=1?1:(e*=2)<1?.5*Kr(e):.5*(2-2**(-10*(e-1))),Yr=e=>1-Math.sin(Math.acos(e)),Xr=Wr(Yr),Zr=Ur(Yr),Qr=Hr(.42,0,1,1),$r=Hr(0,0,.58,1),ei=Hr(.42,0,.58,1),ti=e=>Array.isArray(e)&&typeof e[0]!=`number`,ni=e=>Array.isArray(e)&&typeof e[0]==`number`,ri={linear:P,easeIn:Qr,easeInOut:ei,easeOut:$r,circIn:Yr,circInOut:Zr,circOut:Xr,backIn:Kr,backInOut:qr,backOut:Gr,anticipate:Jr},ii=e=>typeof e==`string`,ai=e=>{if(ni(e)){e.length;let[t,n,r,i]=e;return Hr(t,n,r,i)}return ii(e)?(ri[e],`${e}`,ri[e]):e},oi=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function si(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function ci(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=oi.reduce((e,t)=>(e[t]=si(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=jr.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:oi.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<oi.length;t++)o[oi[t]].cancel(e)},state:i,steps:o}}const{schedule:L,cancel:li,state:R,steps:ui}=ci(typeof requestAnimationFrame<`u`?requestAnimationFrame:P,!0);let di;function fi(){di=void 0}const z={now:()=>(di===void 0&&z.set(R.isProcessing||jr.useManualTiming?R.timestamp:performance.now()),di),set:e=>{di=e,queueMicrotask(fi)}},pi=e=>t=>typeof t==`string`&&t.startsWith(e),mi=pi(`--`),hi=pi(`var(--`),gi=e=>hi(e)?_i.test(e.split(`/*`)[0].trim()):!1,_i=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function vi(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const yi={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},bi={...yi,transform:e=>N(0,1,e)},xi={...yi,default:1},Si=e=>Math.round(e*1e5)/1e5,Ci=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wi(e){return e==null}const Ti=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ei=(e,t)=>n=>!!(typeof n==`string`&&Ti.test(n)&&n.startsWith(e)||t&&!wi(n)&&Object.prototype.hasOwnProperty.call(n,t)),Di=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Ci);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Oi=e=>N(0,255,e),ki={...yi,transform:e=>Math.round(Oi(e))},Ai={test:Ei(`rgb`,`red`),parse:Di(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+ki.transform(e)+`, `+ki.transform(t)+`, `+ki.transform(n)+`, `+Si(bi.transform(r))+`)`};function ji(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Mi={test:Ei(`#`),parse:ji,transform:Ai.transform},Ni=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),B=Ni(`deg`),V=Ni(`%`),H=Ni(`px`),Pi=Ni(`vh`),Fi=Ni(`vw`),Ii={...V,parse:e=>V.parse(e)/100,transform:e=>V.transform(e*100)},Li={test:Ei(`hsl`,`hue`),parse:Di(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+V.transform(Si(t))+`, `+V.transform(Si(n))+`, `+Si(bi.transform(r))+`)`},U={test:e=>Ai.test(e)||Mi.test(e)||Li.test(e),parse:e=>Ai.test(e)?Ai.parse(e):Li.test(e)?Li.parse(e):Mi.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?Ai.transform(e):Li.transform(e),getAnimatableNone:e=>{let t=U.parse(e);return t.alpha=0,U.transform(t)}},Ri=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function zi(e){return isNaN(e)&&typeof e==`string`&&(e.match(Ci)?.length||0)+(e.match(Ri)?.length||0)>0}const Bi=`number`,Vi=`color`,Hi=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ui(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Hi,e=>(U.test(e)?(r.color.push(a),i.push(Vi),n.push(U.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Bi),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function Wi(e){return Ui(e).values}function Gi({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Bi?Si(r[a]):e===Vi?U.transform(r[a]):r[a]}return i}}function Ki(e){return Gi(Ui(e))}const qi=e=>typeof e==`number`?0:U.test(e)?U.getAnimatableNone(e):e,Ji=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:qi(e);function Yi(e){let t=Ui(e);return Gi(t)(t.values.map((e,n)=>Ji(e,t.split[n])))}const W={test:zi,parse:Wi,createTransformer:Ki,getAnimatableNone:Yi};function Xi(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Zi({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Xi(s,r,e+1/3),a=Xi(s,r,e),o=Xi(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Qi(e,t){return n=>n>0?t:e}const G=(e,t,n)=>e+(t-e)*n,$i=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},ea=[Mi,Ai,Li],ta=e=>ea.find(t=>t.test(e));function na(e){let t=ta(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Li&&(n=Zi(n)),n}const ra=(e,t)=>{let n=na(e),r=na(t);if(!n||!r)return Qi(e,t);let i={...n};return e=>(i.red=$i(n.red,r.red,e),i.green=$i(n.green,r.green,e),i.blue=$i(n.blue,r.blue,e),i.alpha=G(n.alpha,r.alpha,e),Ai.transform(i))},ia=new Set([`none`,`hidden`]);function aa(e,t){return ia.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function oa(e,t){return n=>G(e,t,n)}function sa(e){return typeof e==`number`?oa:typeof e==`string`?gi(e)?Qi:U.test(e)?ra:da:Array.isArray(e)?ca:typeof e==`object`?U.test(e)?ra:la:Qi}function ca(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>sa(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function la(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=sa(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ua(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const da=(e,t)=>{let n=W.createTransformer(t),r=Ui(e),i=Ui(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?ia.has(e)&&!i.values.length||ia.has(t)&&!r.values.length?aa(e,t):Ir(ca(ua(r,i),i.values),n):(`${e}${t}`,Qi(e,t))};function fa(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?G(e,t,n):sa(e)(e,t)}const pa=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>L.update(t,e),stop:()=>li(t),now:()=>R.isProcessing?R.timestamp:z.now()}},ma=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},ha=2e4;function ga(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function _a(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(ga(r),ha);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:I(i)}}const K={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function va(e,t){return e*Math.sqrt(1-t*t)}function ya(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const ba=.001;function xa({duration:e=K.duration,bounce:t=K.bounce,velocity:n=K.velocity,mass:r=K.mass}){let i,a;K.maxDuration;let o=1-t;o=N(K.minDamping,K.maxDamping,o),e=N(K.minDuration,K.maxDuration,I(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=va(t,o),c=Math.exp(-i);return ba-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=va(t**2,o);return(-i(t)+ba>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=ya(i,a,s);if(e=F(e),isNaN(c))return{stiffness:K.stiffness,damping:K.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const Sa=[`duration`,`bounce`],Ca=[`stiffness`,`damping`,`mass`];function wa(e,t){return t.some(t=>e[t]!==void 0)}function Ta(e){let t={velocity:K.velocity,stiffness:K.stiffness,damping:K.damping,mass:K.mass,isResolvedFromDuration:!1,...e};if(!wa(e,Ca)&&wa(e,Sa)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*N(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:K.mass,stiffness:i,damping:a}}else{let n=xa({...e,velocity:0});t={...t,...n,mass:K.mass},t.isResolvedFromDuration=!0}}return t}function Ea(e=K.visualDuration,t=K.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Ta({...n,velocity:-I(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=I(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?K.restSpeed.granular:K.restSpeed.default,i||=v?K.restDelta.granular:K.restDelta.default;let y,b,x,S,C,w;if(h<1)x=va(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>F(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=F(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=F(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(ga(T),ha),t=ma(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Ea.applyToOptions=e=>{let t=_a(e,100,Ea);return e.ease=t.ease,e.duration=F(t.duration),e.type=`keyframes`,e};function Da(e,t,n){let r=Math.max(t-5,0);return zr(n-e(r),t-r)}function Oa({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Ea({keyframes:[f.value,m(f.value)],velocity:Da(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function ka(e,t,n){let r=[],i=n||jr.mix||fa,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||P:t;a=Ir(e,a)}r.push(a)}return r}function Aa(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=ka(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Lr(e[r],e[r+1],n);return s[r](i)};return n?t=>l(N(e[0],e[a-1],t)):l}function ja(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Lr(0,t,r);e.push(G(n,1,i))}}function Ma(e){let t=[0];return ja(t,e.length-1),t}function Na(e,t){return e.map(e=>e*t)}function Pa(e,t){return e.map(()=>t||ei).splice(0,e.length-1)}function Fa({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=ti(r)?r.map(ai):ai(r),a={done:!1,value:t[0]},o=Aa(Na(n&&n.length===t.length?n:Ma(t),e),t,{ease:Array.isArray(i)?i:Pa(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}const Ia=e=>e!==null;function La(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Ia),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const Ra={decay:Oa,inertia:Oa,tween:Fa,keyframes:Fa,spring:Ea};function za(e){typeof e.type==`string`&&(e.type=Ra[e.type])}var Ba=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const Va=e=>e/100;var Ha=class extends Ba{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==z.now()&&this.tick(z.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;za(e);let{type:t=Fa,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Fa;s!==Fa&&typeof o[0]!=`number`&&(this.mixKeyframes=Ir(Va,fa(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=ga(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=N(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==Oa&&(b.value=La(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return I(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(this.currentTime)}set time(e){e=F(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Da(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(z.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=I(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=pa,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(z.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Ua(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Wa=e=>e*180/Math.PI,Ga=e=>{let t=Wa(Math.atan2(e[1],e[0]));return qa(t)},Ka={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Ga,rotateZ:Ga,skewX:e=>Wa(Math.atan(e[1])),skewY:e=>Wa(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},qa=e=>(e%=360,e<0&&(e+=360),e),Ja=Ga,Ya=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Xa=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Za={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ya,scaleY:Xa,scale:e=>(Ya(e)+Xa(e))/2,rotateX:e=>qa(Wa(Math.atan2(e[6],e[5]))),rotateY:e=>qa(Wa(Math.atan2(-e[2],e[0]))),rotateZ:Ja,rotate:Ja,skewX:e=>Wa(Math.atan(e[4])),skewY:e=>Wa(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Qa(e){return+!!e.includes(`scale`)}function $a(e,t){if(!e||e===`none`)return Qa(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Za,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Ka,i=t}if(!i)return Qa(t);let a=r[t],o=i[1].split(`,`).map(to);return typeof a==`function`?a(o):o[a]}const eo=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return $a(n,t)};function to(e){return parseFloat(e.trim())}const no=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],ro=new Set([...no,`pathRotation`]),io=e=>e===yi||e===H,ao=new Set([`x`,`y`,`z`]),oo=no.filter(e=>!ao.has(e));function so(e){let t=[];return oo.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const co={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>$a(t,`x`),y:(e,{transform:t})=>$a(t,`y`)};co.translateX=co.x,co.translateY=co.y;const lo=new Set;let uo=!1,fo=!1,po=!1;function mo(){if(fo){let e=Array.from(lo).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=so(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}fo=!1,uo=!1,lo.forEach(e=>e.complete(po)),lo.clear()}function ho(){lo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(fo=!0)})}function go(){po=!0,ho(),mo(),po=!1}var _o=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(lo.add(this),uo||(uo=!0,L.read(ho),L.resolveKeyframes(mo))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Ua(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),lo.delete(this)}cancel(){this.state===`scheduled`&&(lo.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const vo=e=>e.startsWith(`--`);function yo(e,t,n){vo(t)?e.style.setProperty(t,n):e.style[t]=n}const bo={};function xo(e,t){let n=Fr(e);return()=>bo[t]??n()}const So=xo(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Co=xo(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),wo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,To={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:wo([0,.65,.55,1]),circOut:wo([.55,0,1,.45]),backIn:wo([.31,.01,.66,-.59]),backOut:wo([.33,1.53,.69,.99])};function Eo(e,t){if(e)return typeof e==`function`?Co()?ma(e,t):`ease-out`:ni(e)?wo(e):Array.isArray(e)?e.map(e=>Eo(e,t)||To.easeOut):To[e]}function Do(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Eo(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Oo(e){return typeof e==`function`&&`applyToOptions`in e}function ko({type:e,...t}){return Oo(e)&&Co()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var Ao=class extends Ba{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=ko(e);this.animation=Do(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=La(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),yo(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return I(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=F(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&So()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),P):r(this)}};const jo={anticipate:Jr,backInOut:qr,circInOut:Zr};function Mo(e){return e in jo}function No(e){typeof e.ease==`string`&&Mo(e.ease)&&(e.ease=jo[e.ease])}var Po=class extends Ao{constructor(e){No(e),za(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Ha({...a,autoplay:!1}),s=Math.max(10,z.now()-this.startTime),c=N(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&yo(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const Fo=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(W.test(e)||e===`0`)&&!e.startsWith(`url(`));function Io(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Lo(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Fo(i,t),s=Fo(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Io(e)||(n===`spring`||Oo(n))&&r}function Ro(e){e.duration=0,e.type=`keyframes`}const zo=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Bo=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Vo(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Bo.test(e[t]))return!0;return!1}const Ho=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Uo=Fr(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Wo(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Uo()&&n&&(zo.has(n)||Ho.has(n)&&Vo(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var Go=class extends Ba{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=z.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||_o;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=z.now();let u=!0;Lo(e,i,a,o)||(u=!1,(jr.instantAnimations||!s)&&l?.(La(e,n,t)),e[0]=e[e.length-1],Ro(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Wo(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Po({...d,element:p})}catch{m=new Ha(d)}else m=new Ha(d);m.finished.then(()=>{this.notifyFinished()}).catch(P),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),go()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Ko(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const qo=e=>!isNaN(parseFloat(e)),Jo={current:void 0};var Yo=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=z.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=z.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=qo(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new Rr);let n=this.events[e].add(t);return e===`change`?()=>{n(),L.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Jo.current&&Jo.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return zr(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Xo(e,t){return new Yo(e,t)}function Zo(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Qo(e,t){let n=e?.[t]??e?.default??e;return n===e?n:Zo(n,e)}const $o={type:`spring`,stiffness:500,damping:25,restSpeed:10},es=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),ts={type:`keyframes`,duration:.8},ns={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},rs=(e,{keyframes:t})=>t.length>2?ts:ro.has(e)?e.startsWith(`scale`)?es(t[1]):$o:ns,is=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function as(e){for(let t in e)if(!is.has(t))return!0;return!1}const os=(e,t,n,r={},i,a)=>o=>{let s=Qo(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=F(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};as(s)||Object.assign(u,rs(e,u)),u.duration&&=F(u.duration),u.repeatDelay&&=F(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(Ro(u),u.delay===0&&(d=!0)),(jr.instantAnimations||jr.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,Ro(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=La(u.keyframes,s);if(e!==void 0){L.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Ha(u):new Go(u)},ss=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function cs(e){let t=ss.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function ls(e,t,n=1){`${e}`;let[r,i]=cs(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Mr(e)?parseFloat(e):e}return gi(i)?ls(i,t,n+1):i}function us(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function ds(e,t,n,r){if(typeof t==`function`){let[i,a]=us(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=us(r);t=t(n===void 0?e.custom:n,i,a)}return t}function fs(e,t,n){let r=e.getProps();return ds(r,t,n===void 0?r.custom:n,e)}const ps=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...no]),ms=e=>Array.isArray(e);function hs(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xo(n))}function gs(e){return ms(e)?e[e.length-1]||0:e}function _s(e,t){let{transitionEnd:n={},transition:r={},...i}=fs(e,t)||{};i={...i,...n};for(let t in i)hs(e,t,gs(i[t]))}const q=e=>!!(e&&e.getVelocity);function vs(e){return!!(q(e)&&e.add)}function ys(e,t){let n=e.getValue(`willChange`);if(vs(n))return n.add(t);if(!n&&jr.WillChange){let n=new jr.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function bs(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const xs=`data-`+bs(`framerAppearId`);function Ss(e){return e.props[xs]}function Cs({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ws(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?Zo(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Cs(f,t))continue;let o={delay:n,...Qo(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){L.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Ss(e);if(n){let e=window.MotionHandoffAnimation(n,t,L);e!==null&&(o.startTime=e,p=!0)}}ys(e,t);let m=l??e.shouldReduceMotion;r.start(os(t,r,i,m&&ps.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>L.update(()=>{o&&_s(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ts(e,t,n={}){let r=fs(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(ws(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Es(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Es(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Ts(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Ko(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Ds(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Ts(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Ts(e,t,n);else{let i=typeof t==`function`?fs(e,t,n.custom):t;r=Promise.all(ws(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const Os={test:e=>e===`auto`,parse:e=>e},ks=e=>t=>t.test(e),As=[yi,H,V,B,Fi,Pi,Os],js=e=>As.find(ks(e));function Ms(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Pr(e)}const Ns=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Ps(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Ci)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Ns.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const Fs=/\b([a-z-]*)\(.*?\)/gu,Is={...W,getAnimatableNone:e=>{let t=e.match(Fs);return t?t.map(Ps).join(` `):e}},Ls={...W,getAnimatableNone:e=>{let t=W.parse(e);return W.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},Rs={...yi,transform:Math.round},zs={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,inset:H,insetBlock:H,insetBlockStart:H,insetBlockEnd:H,insetInline:H,insetInlineStart:H,insetInlineEnd:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,paddingBlock:H,paddingBlockStart:H,paddingBlockEnd:H,paddingInline:H,paddingInlineStart:H,paddingInlineEnd:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,marginBlock:H,marginBlockStart:H,marginBlockEnd:H,marginInline:H,marginInlineStart:H,marginInlineEnd:H,fontSize:H,backgroundPositionX:H,backgroundPositionY:H,rotate:B,pathRotation:B,rotateX:B,rotateY:B,rotateZ:B,scale:xi,scaleX:xi,scaleY:xi,scaleZ:xi,skew:B,skewX:B,skewY:B,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:bi,originX:Ii,originY:Ii,originZ:H,zIndex:Rs,fillOpacity:bi,strokeOpacity:bi,numOctaves:Rs},Bs={...zs,color:U,backgroundColor:U,outlineColor:U,fill:U,stroke:U,borderColor:U,borderTopColor:U,borderRightColor:U,borderBottomColor:U,borderLeftColor:U,filter:Is,WebkitFilter:Is,mask:Ls,WebkitMask:Ls},Vs=e=>Bs[e],Hs=new Set([Is,Ls]);function Us(e,t){let n=Vs(e);return Hs.has(n)||(n=W),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Ws=new Set([`auto`,`none`,`0`]);function Gs(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!Ws.has(t)&&Ui(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Us(n,i)}var Ks=class extends _o{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),gi(r))){let i=ls(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!ps.has(n)||e.length!==2)return;let[r,i]=e,a=js(r),o=js(i);if(vi(r)!==vi(i)&&co[n]){this.needsMeasurement=!0;return}if(a!==o){if(io(a)&&io(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else co[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Ms(e[t]))&&n.push(t);n.length&&Gs(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=co[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=co[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const qs=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function Js(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const Ys=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function Xs(e){return Nr(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:Zs,cancel:Qs}=ci(queueMicrotask,!1),J={x:!1,y:!1};function $s(){return J.x||J.y}function ec(e){return e===`x`||e===`y`?J[e]?null:(J[e]=!0,()=>{J[e]=!1}):J.x||J.y?null:(J.x=J.y=!0,()=>{J.x=J.y=!1})}function tc(e,t){let n=Js(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function nc(e){return!(e.pointerType===`touch`||$s())}function rc(e,t,n={}){let[r,i,a]=tc(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!nc(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const ic=(e,t)=>t?e===t||ic(e,t.parentElement):!1,ac=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,oc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function sc(e){return oc.has(e.tagName)||e.isContentEditable===!0}const cc=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function lc(e){return cc.has(e.tagName)||e.isContentEditable===!0}const uc=new WeakSet;function dc(e){return t=>{t.key===`Enter`&&e(t)}}function fc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const pc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=dc(()=>{if(uc.has(n))return;fc(n,`down`);let e=dc(()=>{fc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>fc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function mc(e){return ac(e)&&!$s()}const hc=new WeakSet;function gc(e,t,n={}){let[r,i,a]=tc(e,n),o=e=>{let r=e.currentTarget;if(!mc(e)||hc.has(e))return;uc.add(r),n.stopPropagation&&hc.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),uc.has(r)&&uc.delete(r),mc(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||ic(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),Xs(e)&&(e.addEventListener(`focus`,e=>pc(e,i)),!sc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function _c(e){return Nr(e)&&`ownerSVGElement`in e}const vc=new WeakMap;let yc;const bc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:_c(r)&&`getBBox`in r?r.getBBox()[t]:r[n],xc=bc(`inline`,`width`,`offsetWidth`),Sc=bc(`block`,`height`,`offsetHeight`);function Cc({target:e,borderBoxSize:t}){vc.get(e)?.forEach(n=>{n(e,{get width(){return xc(e,t)},get height(){return Sc(e,t)}})})}function wc(e){e.forEach(Cc)}function Tc(){typeof ResizeObserver>`u`||(yc=new ResizeObserver(wc))}function Ec(e,t){yc||Tc();let n=Js(e);return n.forEach(e=>{let n=vc.get(e);n||(n=new Set,vc.set(e,n)),n.add(t),yc?.observe(e)}),()=>{n.forEach(e=>{let n=vc.get(e);n?.delete(t),n?.size||yc?.unobserve(e)})}}const Dc=new Set;let Oc;function kc(){Oc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Dc.forEach(t=>t(e))},window.addEventListener(`resize`,Oc)}function Ac(e){return Dc.add(e),Oc||kc(),()=>{Dc.delete(e),!Dc.size&&typeof Oc==`function`&&(window.removeEventListener(`resize`,Oc),Oc=void 0)}}function jc(e,t){return typeof e==`function`?Ac(e):Ec(e,t)}const Mc={value:null,addProjectionMetrics:null};function Nc(e){return _c(e)&&e.tagName===`svg`}const Pc=[...As,U,W],Fc=e=>Pc.find(ks(e)),Ic=()=>({translate:0,scale:1,origin:0,originPoint:0}),Lc=()=>({x:Ic(),y:Ic()}),Rc=()=>({min:0,max:0}),Y=()=>({x:Rc(),y:Rc()}),zc=new WeakMap;function Bc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Vc(e){return typeof e==`string`||Array.isArray(e)}const Hc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Uc=[`initial`,...Hc];function Wc(e){return Bc(e.animate)||Uc.some(t=>Vc(e[t]))}function Gc(e){return!!(Wc(e)||e.variants)}function Kc(e,t,n){for(let r in t){let i=t[r],a=n[r];if(q(i))e.addValue(r,i);else if(q(a))e.addValue(r,Xo(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Xo(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const qc={current:null},Jc={current:!1},Yc=typeof window<`u`;function Xc(){if(Jc.current=!0,Yc){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>qc.current=e.matches;e.addEventListener(`change`,t),t()}else qc.current=!1}}const Zc=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let Qc={};function $c(e){Qc=e}function el(){return Qc}var tl=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=_o,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=z.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,L.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Wc(t),this.isVariantNode=Gc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&q(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,zc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(Jc.current||Xc(),this.shouldReduceMotion=qc.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),li(this.notifyUpdate),li(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&zo.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new Ao({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:F(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=ro.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&L.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Qc){let t=Qc[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Y()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Zc.length;t++){let n=Zc[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Kc(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Xo(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Mr(n)||Pr(n))?n=parseFloat(n):!Fc(n)&&W.test(t)&&(n=Us(e,t)),this.setBaseTarget(e,q(n)?n.get():n)),q(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=ds(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!q(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new Rr),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){Zs.render(this.render)}},nl=class extends tl{constructor(){super(...arguments),this.KeyframeResolver=Ks}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;q(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},rl=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function il({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function al({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ol(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function sl(e){return e===void 0||e===1}function cl({scale:e,scaleX:t,scaleY:n}){return!sl(e)||!sl(t)||!sl(n)}function ll(e){return cl(e)||ul(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ul(e){return dl(e.x)||dl(e.y)}function dl(e){return e&&e!==`0%`}function fl(e,t,n){return n+t*(e-n)}function pl(e,t,n,r,i){return i!==void 0&&(e=fl(e,i,r)),fl(e,n,r)+t}function ml(e,t=0,n=1,r,i){e.min=pl(e.min,t,n,r,i),e.max=pl(e.max,t,n,r,i)}function hl(e,{x:t,y:n}){ml(e.x,t.translate,t.scale,t.originPoint),ml(e.y,n.translate,n.scale,n.originPoint)}const gl=.999999999999,_l=1.0000000000001;function vl(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(X(e.x,-a.scroll.offset.x),X(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,hl(e,o)),r&&ll(a.latestValues)&&xl(e,a.latestValues,a.layout?.layoutBox))}t.x<_l&&t.x>gl&&(t.x=1),t.y<_l&&t.y>gl&&(t.y=1)}function X(e,t){e.min+=t,e.max+=t}function yl(e,t,n,r,i=.5){ml(e,t,n,G(e.min,e.max,i),r)}function bl(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function xl(e,t,n){let r=n??e;yl(e.x,bl(t.x,r.x),t.scaleX,t.scale,t.originX),yl(e.y,bl(t.y,r.y),t.scaleY,t.scale,t.originY)}function Sl(e,t){return il(ol(e.getBoundingClientRect(),t))}function Cl(e,t,n){let r=Sl(e,n),{scroll:i}=t;return i&&(X(r.x,i.offset.x),X(r.y,i.offset.y)),r}const wl={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Tl=no.length;function El(e,t,n){let r=``,i=!0;for(let a=0;a<Tl;a++){let o=no[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=Ys(s,zs[o]);if(!c){i=!1;let t=wl[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${Ys(a,zs.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Dl(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(ro.has(e)){o=!0;continue}if(mi(e)){i[e]=n;continue}{let t=Ys(n,zs[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=El(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Ol(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function kl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Al={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(H.test(e))e=parseFloat(e);else return e}return`${kl(e,t.target.x)}% ${kl(e,t.target.y)}%`}},jl={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=W.parse(e);if(i.length>5)return r;let a=W.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=G(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Ml={borderRadius:{...Al,applyTo:[...qs]},borderTopLeftRadius:Al,borderTopRightRadius:Al,borderBottomLeftRadius:Al,borderBottomRightRadius:Al,boxShadow:jl};function Nl(e,{layout:t,layoutId:n}){return ro.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ml[e]||e===`opacity`)}function Pl(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(q(r[t])||i&&q(i[t])||Nl(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Fl(e){return window.getComputedStyle(e)}var Il=class extends nl{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ol}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(ro.has(t))return this.projection?.isProjecting?Qa(t):eo(e,t);{let n=Fl(e),r=(mi(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Sl(e,t)}build(e,t,n){Dl(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Pl(e,t,n)}};const Ll={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Rl={offset:`strokeDashoffset`,array:`strokeDasharray`};function zl(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Ll:Rl;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Bl=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Vl(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Dl(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Bl)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&zl(d,i,a,o,!1)}const Hl=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Ul=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Wl(e,t,n,r){Ol(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Hl.has(n)?n:bs(n),t.attrs[n])}function Gl(e,t,n){let r=Pl(e,t,n);for(let n in e)if(q(e[n])||q(t[n])){let t=no.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Kl=class extends nl{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(ro.has(t)){let e=Vs(t);return e&&e.default||0}return t=Hl.has(t)?t:bs(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Gl(e,t,n)}build(e,t,n){Vl(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Wl(e,t,n,r)}mount(e){this.isSVGTag=Ul(e.tagName),super.mount(e)}};const ql=Uc.length;function Jl(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&Jl(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<ql;n++){let r=Uc[n],i=e.props[r];(Vc(i)||i===!1)&&(t[r]=i)}return t}function Yl(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const Xl=[...Hc].reverse(),Zl=Hc.length;function Ql(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Ds(e,t,n)))}function $l(e){let t=Ql(e),n=nu(),r=!0,i=!1,a=t=>(n,r)=>{let i=fs(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=Jl(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Zl;t++){let p=Xl[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Vc(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Bc(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=eu(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=ms(t)&&ms(n)?!Yl(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=fs(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Ko(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=fs(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=nu(),i=!0}}}function eu(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Yl(t,e):!1}function tu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nu(){return{animate:tu(!0),whileInView:tu(),whileHover:tu(),whileTap:tu(),whileDrag:tu(),whileFocus:tu(),exit:tu()}}function ru(e,t){e.min=t.min,e.max=t.max}function Z(e,t){ru(e.x,t.x),ru(e.y,t.y)}function iu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Q(e){return e.max-e.min}function au(e,t,n){return Math.abs(e-t)<=n}function ou(e,t,n,r=.5){e.origin=r,e.originPoint=G(t.min,t.max,e.origin),e.scale=Q(n)/Q(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function su(e,t,n,r){ou(e.x,t.x,n.x,r?r.originX:void 0),ou(e.y,t.y,n.y,r?r.originY:void 0)}function cu(e,t,n,r=0){e.min=(r?G(n.min,n.max,r):n.min)+t.min,e.max=e.min+Q(t)}function lu(e,t,n,r){cu(e.x,t.x,n.x,r?.x),cu(e.y,t.y,n.y,r?.y)}function uu(e,t,n,r=0){let i=r?G(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Q(t)}function du(e,t,n,r){uu(e.x,t.x,n.x,r?.x),uu(e.y,t.y,n.y,r?.y)}function fu(e,t,n,r,i){return e-=t,e=fl(e,1/n,r),i!==void 0&&(e=fl(e,1/i,r)),e}function pu(e,t=0,n=1,r=.5,i,a=e,o=e){if(V.test(t)&&(t=parseFloat(t),t=G(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=G(a.min,a.max,r);e===a&&(s-=t),e.min=fu(e.min,t,n,s,i),e.max=fu(e.max,t,n,s,i)}function mu(e,t,[n,r,i],a,o){pu(e,t[n],t[r],t[i],t.scale,a,o)}const hu=[`x`,`scaleX`,`originX`],gu=[`y`,`scaleY`,`originY`];function _u(e,t,n,r){mu(e.x,t,hu,n?n.x:void 0,r?r.x:void 0),mu(e.y,t,gu,n?n.y:void 0,r?r.y:void 0)}function vu(e){return e.translate===0&&e.scale===1}function yu(e){return vu(e.x)&&vu(e.y)}function bu(e,t){return e.min===t.min&&e.max===t.max}function xu(e,t){return bu(e.x,t.x)&&bu(e.y,t.y)}function Su(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Cu(e,t){return Su(e.x,t.x)&&Su(e.y,t.y)}function wu(e){return Q(e.x)/Q(e.y)}function Tu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $(e){return[e(`x`),e(`y`)]}function Eu(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const Du=qs.length,Ou=e=>typeof e==`string`?parseFloat(e):e,ku=e=>typeof e==`number`||H.test(e);function Au(e,t,n,r,i,a){i?(e.opacity=G(0,n.opacity??1,Mu(r)),e.opacityExit=G(t.opacity??1,0,Nu(r))):a&&(e.opacity=G(t.opacity??1,n.opacity??1,r));for(let i=0;i<Du;i++){let a=qs[i],o=ju(t,a),s=ju(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||ku(o)===ku(s)?(e[a]=Math.max(G(Ou(o),Ou(s),r),0),(V.test(s)||V.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,r))}function ju(e,t){return e[t]===void 0?e.borderRadius:e[t]}const Mu=Pu(0,.5,Xr),Nu=Pu(.5,.95,P);function Pu(e,t,n){return r=>r<e?0:r>t?1:n(Lr(e,t,r))}function Fu(e,t,n){let r=q(e)?e:Xo(e);return r.start(os(``,r,t,n)),r.animation}function Iu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Lu=(e,t)=>e.depth-t.depth;var Ru=class{constructor(){this.children=[],this.isDirty=!1}add(e){kr(this.children,e),this.isDirty=!0}remove(e){Ar(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Lu),this.isDirty=!1,this.children.forEach(e)}};function zu(e,t){let n=z.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(li(r),e(a-t))};return L.setup(r,!0),()=>li(r)}function Bu(e){return q(e)?e.get():e}var Vu=class{constructor(){this.members=[]}add(e){kr(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Ar(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Ar(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const Hu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Uu={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Wu=[``,`X`,`Y`,`Z`];let Gu=0;function Ku(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Ss(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,L,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qu(r)}function Ju({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Gu++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Mc.value&&(Uu.nodes=Uu.calculatedTargetDeltas=Uu.calculatedProjections=0),this.nodes.forEach(Zu),this.nodes.forEach(od),this.nodes.forEach(sd),this.nodes.forEach(Qu),Mc.addProjectionMetrics&&Mc.addProjectionMetrics(Uu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Ru)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Rr),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=_c(t)&&!Nc(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;L.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=zu(i,250),Hu.hasAnimatedSinceResize&&(Hu.hasAnimatedSinceResize=!1,this.nodes.forEach(ad)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||md,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Cu(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Qo(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||ad(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),li(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cd),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(td),this.nodes.forEach(ed);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nd);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rd),this.nodes.forEach(id),this.nodes.forEach(Yu),this.nodes.forEach(Xu)):this.nodes.forEach(nd),this.clearAllSnapshots();let e=z.now();R.delta=N(0,1e3/60,e-R.timestamp),R.timestamp=e,R.isProcessing=!0,ui.update.process(R),ui.preRender.process(R),ui.render.process(R),R.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zs.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($u),this.sharedNodes.forEach(ld)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Q(this.snapshot.measuredBox.x)&&!Q(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Y(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!yu(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ll(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),vd(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Y();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(bd))){let{scroll:e}=this.root;e&&(X(t.x,e.offset.x),X(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Y();if(Z(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Z(t,e),X(t.x,i.offset.x),X(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Y();Z(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(X(r.x,-n.scroll.offset.x),X(r.y,-n.scroll.offset.y)),ll(n.latestValues)&&xl(r,n.latestValues,n.layout?.layoutBox)}return ll(this.latestValues)&&xl(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Y();Z(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!ll(n.latestValues))continue;let r;n.instance&&(cl(n.latestValues)&&n.updateSnapshot(),r=Y(),Z(r,n.measurePageBox())),_u(t,n.latestValues,n.snapshot?.layoutBox,r)}return ll(this.latestValues)&&_u(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==R.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=R.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),lu(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Z(this.target,this.layout.layoutBox),hl(this.target,this.targetDelta)):Z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Mc.value&&Uu.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||cl(this.parent.latestValues)||ul(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),du(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Z(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===R.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Z(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;vl(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Y());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(iu(this.prevProjectionDelta.x,this.projectionDelta.x),iu(this.prevProjectionDelta.y,this.projectionDelta.y)),su(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Tu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Tu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Mc.value&&Uu.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Lc(),this.projectionDelta=Lc(),this.projectionDeltaWithTransform=Lc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Lc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Y(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(pd));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=G(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=G(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ud(o.x,e.x,n),ud(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(du(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),fd(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&xu(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Y(),Z(f,this.relativeTarget)),c&&(this.animationValues=a,Au(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(li(this.pendingAnimation),void 0),this.pendingAnimation=L.update(()=>{Hu.hasAnimatedSinceResize=!0,this.motionValue||=Xo(0),this.motionValue.jump(0,!1),this.currentAnimation=Fu(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&yd(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Y();let t=Q(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Q(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Z(t,n),xl(t,i),su(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Vu),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Ku(`z`,e,r,this.animationValues);for(let t=0;t<Wu.length;t++)Ku(`rotate${Wu[t]}`,e,r,this.animationValues),Ku(`skew${Wu[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Bu(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Bu(t?.pointerEvents)||``),this.hasProjected&&!ll(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Eu(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Ml){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Ml[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Bu(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ed),this.root.sharedNodes.clear()}}}function Yu(e){e.updateLayout()}function Xu(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)$(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Q(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;ru(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else yd(i,t.layoutBox,n)&&$(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Q(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Lc();su(o,n,t.layoutBox);let s=Lc();a?su(s,e.applyTransform(r,!0),t.measuredBox):su(s,n,t.layoutBox);let c=!yu(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Y();du(s,t.layoutBox,i.layoutBox,o);let c=Y();du(c,n,a.layoutBox,o),Cu(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Zu(e){Mc.value&&Uu.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Qu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $u(e){e.clearSnapshot()}function ed(e){e.clearMeasurements()}function td(e){e.isLayoutDirty=!0,e.updateLayout()}function nd(e){e.isLayoutDirty=!1}function rd(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function id(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ad(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function od(e){e.resolveTargetDelta()}function sd(e){e.calcProjection()}function cd(e){e.resetSkewAndRotation()}function ld(e){e.removeLeadSnapshot()}function ud(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function dd(e,t,n,r){e.min=G(t.min,n.min,r),e.max=G(t.max,n.max,r)}function fd(e,t,n,r){dd(e.x,t.x,n.x,r),dd(e.y,t.y,n.y,r)}function pd(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const md={duration:.45,ease:[.4,0,.1,1]},hd=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),gd=hd(`applewebkit/`)&&!hd(`chrome/`)?Math.round:P;function _d(e){e.min=gd(e.min),e.max=gd(e.max)}function vd(e){_d(e.x),_d(e.y)}function yd(e,t,n){return e===`position`||e===`preserve-aspect`&&!au(wu(t),wu(n),.2)}function bd(e){return e!==e.root&&e.scroll?.wasRoot}const xd=Ju({attachResizeListener:(e,t)=>Iu(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Sd={current:void 0},Cd=Ju({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Sd.current){let e=new xd({});e.mount(window),e.setOptions({layoutScroll:!0}),Sd.current=e}return Sd.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),wd=s({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Td(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ed(...e){return t=>{let n=!1,r=e.map(e=>{let r=Td(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Td(e[t],null)}}}}function Dd(...e){return r.useCallback(Ed(...e),e)}var Od=class extends r.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(Xs(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=Xs(e)&&e.offsetWidth||0,r=Xs(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function kd({children:e,isPresent:n,anchorX:i,anchorY:a,root:o,pop:s}){let c=m(),l=v(null),u=v({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=f(wd),p=Dd(l,s===!1?void 0:e.props?.ref??e?.ref);return h(()=>{let{width:e,height:t,top:r,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=i===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=a===`bottom`?`bottom: ${m}`:`top: ${r}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=o??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
110
|
+
/**
|
|
111
|
+
* @license lucide-react v1.31.0 - ISC
|
|
112
|
+
*
|
|
113
|
+
* This source code is licensed under the ISC license.
|
|
114
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
+
*/
|
|
116
|
+
;function $t({name:e,AccessDenied:n=tn,children:r}){return e?t(en,{name:e,AccessDenied:n,children:r}):t(nn,{})}function en({name:e,AccessDenied:n=tn,children:r}){let{authToken:i,client:a}=O(),[o,s]=y(null),[c,l]=y(`loading`);if(p(()=>{i?i.apps.includes(e)?a.apps.getAppInstallationByName(e).then(t=>{t?(l(`loaded`),s(t)):(console.log(`App ${e} not found!`),l(`error`))}):l(`error`):l(`loading`)},[e,i,a.apps.getAppInstallationByName]),c===`loading`)return null;if(c===`error`)return t(n,{name:e});if(o)return t(tt,{installation:o,children:r})}function tn({name:e}){let{project:r,accounts:i,client:a}=O(),{t:o}=k(),[s,c]=y(),{data:l}=ge(()=>a.apps.getAppInstallationProjects({name:e}),[e]),{projectsByOrg:u,orgOptions:d}=_(()=>{if(!l||!i)return{projectsByOrg:{},orgOptions:[]};let e={};for(let t of l)e[t.account]||(e[t.account]=[]),e[t.account].push(t);return{projectsByOrg:e,orgOptions:i.filter(t=>e[t.id]?.length>0)}},[l,i]);p(()=>{!s&&d.length>0&&c(d[0].id)},[d,s]);let f=e=>{localStorage.setItem(xe,e.account),localStorage.setItem(`${Se}-${e.account}`,e.id),window.location.reload()},m=s&&u[s]||[],h=d.find(e=>e.id===s);return n(S,{className:`pt-10 flex flex-col items-center text-center text-foreground`,children:[t(Yt,{className:`w-10 h-10 mb-4 text-muted`}),t(`div`,{className:`text-xl font-semibold`,children:o(`shell.accessDenied`)}),n(`div`,{className:`mt-2 text-sm text-muted`,children:[`You don't have permission to view the `,t(`span`,{className:`font-semibold`,children:e}),` app in project:`,` `,n(`span`,{className:`font-semibold`,children:[`«`,r?.name,`»`]}),`.`]}),d.length===0&&l!==void 0&&t(`div`,{className:`mt-4 text-sm text-muted`,children:`This app is not installed in any project you have access to.`}),d.length>0&&n(`div`,{className:`mt-4 flex flex-row gap-4 items-end`,children:[d.length>1&&n(`div`,{children:[t(`div`,{className:`text-sm text-muted mb-2`,children:o(`shell.organization`)}),t(D,{by:`id`,value:h,options:d,optionLabel:e=>e.name,placeholder:o(`shell.selectOrganization`),onChange:e=>c(e.id)})]}),n(`div`,{children:[d.length>1&&t(`div`,{className:`text-sm text-muted mb-2`,children:o(`login.terminal.project`)}),t(D,{by:`id`,value:void 0,options:m,optionLabel:e=>e.name,placeholder:o(`shell.selectProject`),onChange:f})]})]})]})}function nn(){let{t:e}=k();return n(S,{className:`pt-10 flex flex-col items-center text-center text-foreground`,children:[t(Yt,{className:`w-10 h-10 mb-4 text-muted`}),t(`div`,{className:`text-xl font-semibold`,children:e(`shell.applicationNotRegistered`)}),n(`div`,{className:`mt-2 text-sm text-muted`,children:[`Before starting to code a Vertesia application you must register an application manifest in Vertesia Studio then install it in one or more projects.`,t(`p`,{}),`Then use the created app name as a parameter to`,` `,t(`code`,{children:`<StandaloneApp name="your-app-name">`}),` in the `,t(`code`,{children:`src/main.tsx`}),` file.`]})]})}function rn(){let e=O(),{client:r}=e,{t:i}=k(),[a,o]=y(!1),[s,c]=y([]);p(()=>{r.account.listInvites().then(e=>{if(e.length>0){let t=e.filter(e=>e.data.account);if(t.length===0){console.log(`No valid invites found, closing modal`);return}console.log(`Found valid invites`,t.length),o(!0),c(t)}else console.log(`No invites found, closing modal`),o(!1)}).catch(e=>{console.error(`Error fetching invites`,e)})},[r.account.listInvites]);let l=()=>o(!1),u=async t=>{await r.account.acceptInvite(t.id),await e.authCallback,await e.fetchAccounts(),await e.fetchProjects(t.data.account.id);let n=s.filter(e=>e.id!==t.id).filter(e=>e.data.account);n.length>0?c(n):l()},d=async e=>{await r.account.rejectInvite(e.id);let t=s.filter(t=>t.id!==e.id);c(t),t.length===0&&l()},f=s.map(e=>e.data.account?n(`div`,{className:`flex flex-row w-full justify-between border rounded-sm px-2 py-2 `,children:[n(`div`,{className:`flex flex-col`,children:[t(`div`,{className:`w-full font-semibold`,children:e.data.account.name??e.data.account}),e.data.project&&n(`div`,{className:`w-full text-base`,children:[`- `,e.data.project.name]}),n(`div`,{className:`text-xs`,children:[`Role: `,e.data.role]}),e.data.invited_by&&n(`div`,{className:`text-xs`,children:[`by `,e.data.invited_by.name??e.data.invited_by]})]}),n(`div`,{className:`flex flex-col gap-4`,children:[t(x,{size:`xs`,onClick:()=>u(e),children:i(`login.accept`)}),` `,t(x,{size:`xs`,variant:`secondary`,onClick:()=>d(e),children:i(`login.reject`)})]})]},e.id):(console.warn(`Invite has no account data`,e),null));return t(`div`,{children:n(E,{isOpen:a,onClose:l,children:[t(ne,{children:i(`login.reviewInvites`)}),n(ee,{children:[t(`div`,{className:`text-sm pb-4`,children:`You have received the following invites to join other accounts. Please review and accept or declined them.`}),f]})]})})}function an(e){return n(`svg`,{viewBox:`0 0 48 48`,"aria-hidden":`true`,...e,children:[t(`path`,{fill:`#FFC107`,d:`M43.6 20.5H42V20H24v8h11.3c-1.6 4.7-6.1 8-11.3 8a12 12 0 0 1 0-24c3 0 5.8 1.1 7.9 3l5.7-5.7A20 20 0 1 0 24 44c11 0 20-9 20-20 0-1.2-.1-2.3-.4-3.5z`}),t(`path`,{fill:`#FF3D00`,d:`M6.3 14.7l6.6 4.8A12 12 0 0 1 24 12c3 0 5.8 1.1 7.9 3l5.7-5.7A20 20 0 0 0 6.3 14.7z`}),t(`path`,{fill:`#4CAF50`,d:`M24 44c5.2 0 10-2 13.6-5.2l-6.3-5.3A12 12 0 0 1 12.7 28.5l-6.6 5.1A20 20 0 0 0 24 44z`}),t(`path`,{fill:`#1976D2`,d:`M43.6 20.5H42V20H24v8h11.3a12 12 0 0 1-4 5.5l6.3 5.3C37.9 36.6 44 31 44 24c0-1.2-.1-2.3-.4-3.5z`})]})}function on(e){return t(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:t(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2C6.48 2 2 6.58 2 12.25c0 4.54 2.87 8.39 6.84 9.75.5.09.68-.22.68-.49v-1.7c-2.78.62-3.37-1.36-3.37-1.36-.46-1.18-1.11-1.5-1.11-1.5-.91-.63.07-.62.07-.62 1 .07 1.53 1.05 1.53 1.05.89 1.57 2.34 1.12 2.91.86.09-.66.35-1.12.63-1.38-2.22-.26-4.56-1.14-4.56-5.07 0-1.12.39-2.03 1.03-2.75-.1-.26-.45-1.3.1-2.7 0 0 .84-.28 2.76 1.05A9.4 9.4 0 0 1 12 7.07c.85 0 1.71.12 2.51.34 1.91-1.33 2.75-1.05 2.75-1.05.55 1.4.2 2.44.1 2.7.64.72 1.03 1.63 1.03 2.75 0 3.94-2.34 4.81-4.57 5.06.36.32.68.94.68 1.9v2.81c0 .27.18.59.69.49C19.13 20.64 22 16.78 22 12.25 22 6.58 17.52 2 12 2z`})})}function sn(e){return n(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,...e,children:[t(`path`,{fill:`#F25022`,d:`M2 2h9.5v9.5H2z`}),t(`path`,{fill:`#7FBA00`,d:`M12.5 2H22v9.5h-9.5z`}),t(`path`,{fill:`#00A4EF`,d:`M2 12.5h9.5V22H2z`}),t(`path`,{fill:`#FFB900`,d:`M12.5 12.5H22V22h-9.5z`})]})}const cn=Jt,ln={google:an,github:on,microsoft:sn,oidc:cn,password:qt};function un(e){return e&&e in ln?ln[e]:cn}function dn({children:e,centered:n=!1}){return t(`div`,{className:n?`w-full max-w-[420px] flex flex-col gap-6 items-center text-center`:`w-full max-w-[420px] flex flex-col gap-6`,children:e})}function fn({eyebrow:e,title:r,body:i,variant:a=`info`}){return n(`div`,{children:[e&&t(`div`,{className:`${a===`destructive`?`text-destructive`:`text-info`} text-[12.5px] font-medium mb-2`,children:e}),t(`h1`,{className:`text-foreground text-[22px] font-semibold tracking-tight leading-tight mb-1.5`,children:r}),i&&t(`p`,{className:`text-muted text-sm leading-relaxed`,children:i})]})}const pn={primary:`h-[42px] gap-2.5 rounded-md bg-foreground text-background hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed`,loading:`h-[42px] gap-2.5 rounded-md bg-foreground text-background opacity-90`,ghost:`h-9 text-muted hover:text-foreground`};function j({variant:e=`primary`,className:n=``,type:r=`button`,disabled:i,...a}){return t(x,{variant:`unstyled`,size:`none`,type:r,disabled:e===`loading`||i,className:`cursor-pointer inline-flex items-center justify-center text-sm font-medium transition ${pn[e]} ${n}`.trim(),...a})}function mn({size:e=`xs`,className:n=``,type:r=`button`,...i}){let a=`cursor-pointer ${e===`smaller`?`!text-[11px]`:`!text-xs`} text-muted hover:text-foreground !transition px-2 py-1 !rounded underline decoration-transparent hover:decoration-current underline-offset-[3px]`;return t(x,{variant:`unstyled`,size:`none`,type:r,className:n?`${a} ${n}`:a,...i})}const hn={circle:`size-9 rounded-full text-sm ring-4 ring-background ring-offset-1 ring-offset-border`,square:`size-[30px] rounded-md text-[11px]`};function gn({initials:e,shape:n=`circle`}){return t(`span`,{className:`bg-info text-info-foreground grid place-items-center font-semibold shrink-0 ${hn[n]}`,children:e})}function _n({children:e}){return t(`div`,{className:`inline-grid place-items-center size-14 rounded-xl bg-info-background border border-info/15 mb-3.5`,children:e})}function vn({title:e,subtitle:r,titleClass:i,subtitleClass:a}){return n(`div`,{className:`flex-1 min-w-0`,children:[t(`div`,{className:i,children:e}),t(`div`,{className:a,children:r})]})}const yn={tenant:{topRow:`flex items-center gap-2.5 px-3 py-2.5`,title:`text-[13.5px] font-semibold text-foreground leading-tight`,subtitle:`text-[11.5px] text-muted leading-tight mt-0.5`,bottomRow:`flex items-center gap-2.5 px-3 py-1.5 border-t border-border bg-muted-background`,mailBox:`size-[30px] grid place-items-center shrink-0`,mailIcon:`size-4 text-muted`,email:`text-sm text-foreground/80 flex-1 truncate`,actionSize:`xs`},returning:{topRow:`flex items-center gap-3 px-3.5 py-2.5`,title:`text-sm font-semibold text-foreground truncate`,subtitle:`text-xs text-foreground/80 truncate`,bottomRow:`flex items-center gap-3 px-3.5 py-1 border-t border-border bg-muted-background`,mailBox:`w-9 h-6 grid place-items-center shrink-0`,mailIcon:`size-3.5 text-muted`,email:`text-xs text-foreground/80 flex-1 truncate`,actionSize:`smaller`}};function bn({variant:e=`returning`,badge:r,title:i,subtitle:a,email:o,actionLabel:s,onAction:c}){let l=yn[e];return n(`div`,{className:`rounded-md border border-border bg-background overflow-hidden`,children:[n(`div`,{className:l.topRow,children:[r,t(vn,{title:i,subtitle:a,titleClass:l.title,subtitleClass:l.subtitle})]}),n(`div`,{className:l.bottomRow,children:[t(`div`,{className:l.mailBox,children:t(Xt,{className:l.mailIcon})}),t(`span`,{className:l.email,children:o}),t(mn,{size:l.actionSize,onClick:c,children:s})]})]})}function xn({badge:e,title:r,subtitle:i,actionLabel:a,onAction:o}){return n(`div`,{className:`flex items-center gap-3 px-3.5 py-2.5 rounded-md border border-border bg-muted-background`,children:[e,t(vn,{title:r,subtitle:i,titleClass:`text-sm font-semibold text-foreground truncate`,subtitleClass:`text-xs text-muted truncate`}),t(mn,{onClick:o,children:a})]})}function Sn({email:e,actionLabel:r,onAction:i}){return n(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-md border border-border bg-muted-background`,children:[t(Xt,{className:`size-4 text-muted shrink-0`}),t(`span`,{className:`text-sm text-foreground/80 flex-1 truncate`,children:e}),t(mn,{onClick:i,children:r})]})}function Cn({provider:e,label:r,onClick:i,variant:a=`outline`}){let o=un(e);return a===`arrow`?n(x,{variant:`unstyled`,size:`none`,onClick:i,className:`cursor-pointer group h-[42px] w-full inline-flex items-center gap-3 ps-3.5 pe-3 rounded-md border border-border bg-background text-sm font-medium text-foreground transition hover:bg-muted-background`,children:[t(o,{className:`!size-[18px] shrink-0`}),t(`span`,{className:`flex-1 text-start`,children:r}),t(Wt,{className:`!size-3.5 text-muted opacity-0 group-hover:opacity-100 group-hover:translate-x-0.5 rtl:group-hover:-translate-x-0.5 transition`})]}):n(x,{variant:`outline`,onClick:i,className:`w-full py-5 flex rounded-lg transition duration-150 text-center ${a===`filled`?`!bg-foreground text-background hover:!bg-foreground/90`:`hover:shadow-sm`}`,children:[t(o,{className:`!size-[18px]`}),t(`span`,{className:`text-sm font-medium`,children:r})]})}function wn({icon:e,title:r,meta:i}){return n(`div`,{className:`flex items-center gap-2.5 px-3 py-2.5 rounded-md bg-destructive-background border border-destructive/20`,children:[t(e,{className:`size-5 text-destructive shrink-0`}),n(`div`,{className:`flex-1 min-w-0 text-sm`,children:[t(`div`,{className:`font-semibold text-destructive`,children:r}),t(`div`,{className:`text-xs text-destructive/80`,children:i})]})]})}const Tn=`h-[42px] px-3.5 rounded-md border border-border bg-background text-sm text-foreground placeholder:text-muted outline-none transition focus:border-info focus:ring-4 focus:ring-info/15 aria-[invalid=true]:border-destructive aria-[invalid=true]:ring-destructive/15`;function En({inputRef:e,label:r,placeholder:i,value:a,onChange:o,invalid:s=!1,error:c}){return n(`div`,{className:`flex flex-col gap-1.5`,children:[t(`label`,{htmlFor:`vt-login-email`,className:`text-xs font-medium text-foreground/80`,children:r}),t(`input`,{ref:e,id:`vt-login-email`,name:`vt-login-email`,type:`email`,className:Tn,placeholder:i,value:a,onChange:e=>o(e.target.value),"aria-invalid":s,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`off`,spellCheck:!1,"data-1p-ignore":!0,"data-lpignore":`true`,"data-form-type":`other`}),c&&t(`div`,{role:`alert`,className:`text-xs text-destructive`,children:c})]})}function Dn({inputRef:e,label:r,value:i,onChange:a,invalid:o=!1,error:s}){return n(`div`,{className:`flex flex-col gap-1.5`,children:[t(`label`,{htmlFor:`vt-login-password`,className:`text-xs font-medium text-foreground/80`,children:r}),t(`input`,{ref:e,id:`vt-login-password`,name:`vt-login-password`,type:`password`,className:Tn,value:i,onChange:e=>a(e.target.value),"aria-invalid":o,"aria-describedby":s?`vt-login-password-error`:void 0,autoComplete:`current-password`}),s&&t(`div`,{id:`vt-login-password-error`,role:`alert`,className:`text-xs text-destructive`,children:s})]})}const On=`vt.lastSuccessfulLogin`,kn=`vt.pendingSignin`;function An(){try{let e=localStorage.getItem(On);if(!e)return null;let t=JSON.parse(e);return!t?.email||!t?.lastProvider?null:t}catch{return null}}function jn(e){try{localStorage.setItem(On,JSON.stringify(e))}catch{}}function Mn(){try{localStorage.removeItem(On)}catch{}}function Nn(){try{let e=sessionStorage.getItem(kn);return e?JSON.parse(e):null}catch{return null}}function Pn(e){try{sessionStorage.setItem(kn,JSON.stringify(e))}catch{}}function Fn(){try{sessionStorage.removeItem(kn)}catch{}}async function In(){Mn(),Fn();try{await Ke(je())}catch{}}function Ln(e){let t=e||window.location.pathname||`/`;return t[0]!==`/`&&(t=`/${t}`),t}const Rn={google:(e,t)=>{let n=new He;return n.addScope(`profile`),n.addScope(`email`),n.setCustomParameters({redirect_uri:window.location.origin+Ln(t),...e?{login_hint:e}:{prompt:`select_account`}}),n},github:e=>{let t=new Ve;return t.addScope(`profile`),t.addScope(`email`),e&&t.setCustomParameters({login:e}),t},microsoft:e=>{let t=new Ue(`microsoft.com`);return t.addScope(`profile`),t.addScope(`email`),e&&t.setCustomParameters({login_hint:e}),t},oidc:e=>{let t=new Ue(`oidc.main`);return e&&t.setCustomParameters({login_hint:e}),t}};function zn(e,t,n){return Rn[e](t,n)}async function Bn(e,t,n){if(!t)return{ok:!1,reason:`no-email`};let r=await Me(t),i=je(),a=e,o;return r?(r.provider&&(a=r.provider),o=r.label||r.name||void 0,localStorage.setItem(`tenantName`,o??``)):(localStorage.removeItem(`tenantName`),i.tenantId&&=null),a===`password`?{ok:!1,reason:`password-required`}:(Pn({email:t,provider:a,tenantName:o}),Ge(i,zn(a,t,n)),{ok:!0})}const Vn=new Set([`auth/invalid-credential`,`auth/invalid-email`,`auth/user-disabled`,`auth/user-not-found`,`auth/wrong-password`]);function Hn(e){return e instanceof Be?Vn.has(e.code)?`invalid-credentials`:e.code===`auth/too-many-requests`?`too-many-attempts`:`failed`:`failed`}async function Un(e,t){let n=await Me(e);if(!n)return{ok:!1,reason:`failed`};if(n.provider!==`password`)return{ok:!1,reason:`not-password-tenant`};let r=n.label||n.name||void 0;localStorage.setItem(`tenantName`,r??``),Pn({email:e,provider:`password`,tenantName:r});try{return await We(je(),e,t),{ok:!0}}catch(e){return Fn(),{ok:!1,reason:Hn(e)}}}function Wn(e,t){let n=je();localStorage.removeItem(`tenantName`),n.tenantId&&=null,Ge(n,zn(e,void 0,t))}function Gn(e){return e===`google`?`Google`:e===`github`?`GitHub`:e===`microsoft`?`Microsoft`:`Sign In`}function Kn(e){if(!e)return``;let t=e.lastIndexOf(`@`);return t>0?e.slice(0,t):e}function qn(e){if(!e)return``;let t=e.lastIndexOf(`@`);return t>0?e.slice(t+1):``}function Jn(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Yn(e){return(e||`?`).charAt(0).toUpperCase()}function Xn(e){let t=Kn(e).split(/[._-]+/).filter(Boolean)[0]||`friend`;return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function Zn(e){for(let t of e)if(t.trim()===``)return!0;return!1}function Qn(e){let t=(e||``).trim(),n=t.indexOf(`@`);if(n<=0||n!==t.lastIndexOf(`@`))return!1;let r=t.slice(n+1),i=r.indexOf(`.`);return i>0&&i<r.length-1&&!Zn(t)}function $n(e){let t=e;for(let e=0;t!=null&&e<8;e++){if((t instanceof Error?t.message:String(t)).includes(`Customer-domain user requires an invite to join`))return!0;t=t instanceof Error?t.cause:void 0}return!1}function er({provider:e,onCancel:r}){let{t:i}=k(),a=un(e),o=e===`oidc`?i(`auth.pending.genericProvider`):Gn(e);return n(dn,{centered:!0,children:[n(`div`,{children:[t(_n,{children:t(a,{className:e===`oidc`?`size-6 text-info`:`size-6`})}),t(fn,{title:i(`auth.pending.title`,{provider:o}),body:i(`auth.pending.body`)})]}),n(`div`,{className:`w-full flex flex-col gap-2`,children:[n(j,{variant:`loading`,children:[t(ce,{}),t(`span`,{children:i(`auth.pending.authenticating`)})]}),r&&t(j,{variant:`ghost`,onClick:r,children:i(`auth.pending.cancel`)})]})]})}function tr({initialEmail:r,onProceed:i}){let{t:a}=k(),[o,s]=y(r??``),[c,l]=y(!1),[u,d]=y(!1),f=v(null);return p(()=>{f.current?.focus()},[]),n(dn,{children:[t(fn,{eyebrow:a(`auth.email.eyebrow`),title:a(`auth.email.title`),body:a(`auth.email.body`)}),n(`form`,{onSubmit:async e=>{if(e.preventDefault(),!u){if(!Qn(o)){l(!0);return}l(!1),d(!0);try{let e=await Me(o.trim().toLowerCase());i(o.trim().toLowerCase(),e??void 0)}catch{i(o.trim().toLowerCase(),void 0)}finally{d(!1)}}},noValidate:!0,className:`flex flex-col ${c?`gap-2`:`gap-6`}`,children:[t(En,{inputRef:f,label:a(`auth.email.label`),placeholder:a(`auth.email.placeholder`),value:o,onChange:e=>{s(e),c&&l(!1)},invalid:c,error:c?a(`auth.email.invalidError`):void 0}),t(j,{type:`submit`,disabled:u,children:u?t(ce,{}):n(e,{children:[t(`span`,{children:a(`auth.continue`)}),t(Wt,{className:`!size-3.5`})]})})]})]})}function nr({email:r,tenantName:i,onBack:a}){let{t:o}=k(),[s,c]=y(``),[l,u]=y(null),[d,f]=y(!1),[m,h]=y(!1),g=v(null);p(()=>{g.current?.focus()},[]);let _=async e=>{if(e.preventDefault(),m)return;if(!s){f(!0);return}f(!1),u(null),h(!0);let t=await Un(r,s);t.ok||(u(t.reason),h(!1))},b=d?o(`auth.password.required`):l?(e=>{switch(e){case`invalid-credentials`:return o(`auth.password.invalidCredentials`);case`too-many-attempts`:return o(`auth.password.tooManyAttempts`);case`not-password-tenant`:return o(`auth.password.notAvailable`);case`failed`:return o(`auth.password.failed`)}})(l):void 0;return n(dn,{children:[t(fn,{eyebrow:i??o(`auth.password.eyebrow`),title:o(`auth.password.title`),body:o(`auth.password.body`)}),t(Sn,{email:r,actionLabel:o(`auth.change`),onAction:a}),n(`form`,{onSubmit:_,noValidate:!0,className:`flex flex-col ${b?`gap-2`:`gap-6`}`,children:[t(Dn,{inputRef:g,label:o(`auth.password.label`),value:s,onChange:e=>{c(e),d&&f(!1)},invalid:!!b,error:b}),t(j,{type:`submit`,disabled:m,children:m?t(ce,{}):n(e,{children:[t(`span`,{children:o(`auth.password.submit`)}),t(Wt,{className:`!size-3.5`})]})})]})]})}const rr=[`google`,`github`,`microsoft`];function ir({email:e,onBack:r,onProviderClicked:i,onPasswordRequired:a,redirectTo:o}){let{t:s}=k(),c=async t=>{i(t);let n=await Bn(t,e,o);!n.ok&&n.reason===`password-required`&&a(e)};return n(dn,{children:[t(fn,{eyebrow:s(`auth.providers.eyebrow`),title:s(`auth.providers.title`),body:s(`auth.providers.bodyConsumer`)}),t(Sn,{email:e,actionLabel:s(`auth.change`),onAction:r}),t(`div`,{className:`flex flex-col gap-2`,children:rr.map(e=>t(Cn,{provider:e,label:s(`auth.continueWithProvider`,{provider:Gn(e)}),onClick:()=>c(e),variant:`arrow`},e))})]})}function ar({details:r,identity:i,kind:a,onContinue:o,onUseDifferentAccount:s}){let{t:c}=k(),[l,u]=y(!1),d=v(null);p(()=>{d.current?.focus()},[]);let f=a===`scopeProject`||a===`scopeAccount`,m;m=a===`scopeProject`?{eyebrow:c(`auth.recovery.scopeProject.eyebrow`),title:c(`auth.recovery.scopeProject.title`),body:c(`auth.recovery.scopeProject.body`)}:a===`scopeAccount`?{eyebrow:c(`auth.recovery.scopeAccount.eyebrow`),title:c(`auth.recovery.scopeAccount.title`),body:c(`auth.recovery.scopeAccount.body`)}:a===`noAccessibleAccount`?{eyebrow:c(`auth.recovery.noAccessibleAccount.eyebrow`),title:c(`auth.recovery.noAccessibleAccount.title`),body:c(`auth.recovery.noAccessibleAccount.body`)}:a===`credential`?{eyebrow:c(`auth.recovery.credential.eyebrow`),title:c(`auth.recovery.credential.title`),body:c(`auth.recovery.credential.body`)}:{eyebrow:c(`auth.recovery.service.eyebrow`),title:c(`auth.recovery.service.title`),body:c(`auth.recovery.service.body`)};let h=e=>{l||(u(!0),e())};return n(dn,{children:[n(`div`,{role:`alert`,"aria-live":`assertive`,children:[t(_n,{children:t(Qt,{className:`size-7 text-attention`,"aria-hidden":`true`})}),t(fn,{eyebrow:m.eyebrow,title:m.title,body:m.body})]}),i&&t(xn,{badge:t(gn,{initials:Yn(i.email)}),title:i.name||Xn(i.email),subtitle:i.email,actionLabel:c(`auth.returning.notYou`),onAction:s}),n(`div`,{className:`flex flex-col gap-2`,children:[o&&t(j,{ref:d,className:`w-full`,disabled:l,onClick:()=>h(o),children:c(f?`auth.recovery.continue`:`auth.recovery.tryAgain`)}),t(j,{ref:o?void 0:d,variant:o?`ghost`:`primary`,disabled:l,onClick:()=>h(s),children:c(`auth.recovery.useDifferentAccount`)}),(a===`noAccessibleAccount`||a===`service`)&&n(`p`,{className:`text-center text-xs text-muted`,children:[c(`auth.recovery.supportPrefix`),` `,t(`a`,{className:`text-info`,href:`mailto:support@vertesiahq.com`,children:`support@vertesiahq.com`})]})]}),r&&n(`details`,{className:`rounded-lg border border-mixer-muted/30 bg-mixer-muted/10 px-4 py-3 text-sm`,children:[t(`summary`,{className:`cursor-pointer font-medium text-muted marker:text-muted focus-visible:outline-2 focus-visible:outline-offset-2`,children:c(`auth.recovery.technicalDetails`)}),n(`dl`,{className:`mt-3 grid grid-cols-[max-content_minmax(0,1fr)] gap-x-3 gap-y-2 text-xs`,children:[r.errorCode&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.errorCode`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.errorCode})]}),r.status&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.httpStatus`)}),t(`dd`,{className:`font-mono`,children:r.status})]}),r.accountId&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.requestedAccount`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.accountId})]}),r.projectId&&n(e,{children:[t(`dt`,{className:`text-muted`,children:c(`auth.recovery.requestedProject`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.projectId})]}),t(`dt`,{className:`text-muted`,children:c(`auth.recovery.errorMessage`)}),t(`dd`,{className:`wrap-break-word font-mono`,children:r.message})]})]})]})}const or={dev1:`us1`};function sr(e){let t=e&&or[e]||e;return t?`https://cloud.${t}.vertesia.io/`:`https://cloud.vertesia.io/`}function cr({onUseDifferentEmail:e}){let{t:r}=k(),i=sr(A.region),[a,o]=y(15);return p(()=>{In()},[]),p(()=>{let e=setTimeout(()=>{window.location.href=i},15e3),t=setInterval(()=>{o(e=>e>0?e-1:0)},1e3);return()=>{clearTimeout(e),clearInterval(t)}},[i]),n(dn,{children:[t(fn,{variant:`destructive`,eyebrow:r(`auth.restricted.eyebrow`),title:r(`auth.restricted.title`),body:r(`auth.restricted.body`)}),n(`div`,{className:`flex flex-col gap-2`,children:[t(wn,{icon:Zt,title:r(`auth.restricted.calloutTitle`),meta:r(`auth.restricted.calloutMeta`)}),t(j,{className:`w-full`,onClick:()=>{window.location.href=i},children:r(`auth.restricted.redirect`)}),t(j,{variant:`ghost`,onClick:e,children:r(`auth.restricted.useDifferent`)}),t(`p`,{className:`text-center text-xs text-muted`,children:r(`auth.restricted.autoRedirect`,{seconds:a})})]})]})}function lr({session:e,onNotYou:r,onProviderClicked:i,onPasswordRequired:a,redirectTo:o}){let{t:s}=k(),c=e.name?e.name.split(` `)[0]||e.name:Xn(e.email),l=e.name||Xn(e.email),u=t(gn,{initials:Yn(e.email)}),d=!!e.tenantName,f=e.lastProvider,p=f===`password`?s(`auth.password.continue`):f===`oidc`?s(`auth.continueWithSignIn`):s(`auth.continueWithProvider`,{provider:Gn(f)});return n(dn,{children:[t(fn,{eyebrow:s(`auth.returning.eyebrow`),title:s(`auth.returning.title`,{name:c}),body:s(`auth.returning.body`)}),d&&e.tenantName?t(bn,{variant:`returning`,badge:u,title:l,subtitle:e.tenantName,email:e.email,actionLabel:s(`auth.returning.notYou`),onAction:r}):t(xn,{badge:u,title:l,subtitle:e.email,actionLabel:s(`auth.returning.notYou`),onAction:r}),n(`div`,{className:`flex flex-col gap-2`,children:[t(Cn,{provider:f,label:p,onClick:async()=>{if(f===`password`){a(e.email);return}i(f);let t=await Bn(f,e.email,o);!t.ok&&t.reason===`password-required`&&a(e.email)},variant:`filled`}),t(j,{variant:`ghost`,onClick:r,children:s(`auth.returning.useDifferent`)})]})]})}function ur({email:e,tenantName:r,onBack:i}){let{t:a}=k(),o=r||a(`auth.blocked.tenantFallback`),s=qn(e),c=r||(s?a(`auth.blocked.teamFromDomain`,{domain:Jn(s)}):a(`auth.blocked.tenantFallback`));return n(dn,{children:[t(fn,{variant:`destructive`,eyebrow:a(`auth.blocked.eyebrow`),title:a(`auth.blocked.title`),body:a(`auth.blocked.body`,{name:o,email:e})}),n(`div`,{className:`flex flex-col gap-2`,children:[t(wn,{icon:Zt,title:c,meta:a(`auth.blocked.tenantMeta`,{email:e})}),t(j,{variant:`ghost`,onClick:i,children:a(`auth.blocked.useDifferent`)})]})]})}function dr({provider:e,email:n,redirectTo:r,variant:i=`outline`,onClick:a,onPasswordRequired:o}){let{t:s}=k(),c=e===`oidc`?s(`auth.continueWithSignIn`):s(`auth.continueWithProvider`,{provider:Gn(e)}),l=async()=>{if(a?.(),!n){Wn(e,r);return}let t=await Bn(e,n,r);!t.ok&&t.reason===`password-required`&&o?.()};return t(Cn,{provider:e,label:c,onClick:()=>void l(),variant:i})}function fr(e){return e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e.charAt(0).toUpperCase()).join(``)}function pr({email:e,tenant:r,onBack:i,onProviderClicked:a,onPasswordRequired:o,redirectTo:s}){let{t:c}=k(),l=r.label||r.name||c(`auth.blocked.tenantFallback`),u=r.provider===`google`||r.provider===`github`||r.provider===`microsoft`?r.provider:`oidc`,d=u===`oidc`?c(`auth.tenant.viaIdpFallback`):Gn(u);return n(dn,{children:[t(fn,{eyebrow:c(`auth.tenant.eyebrow`),title:c(`auth.tenant.title`,{name:l}),body:c(`auth.tenant.body`)}),t(bn,{variant:`tenant`,badge:t(gn,{initials:fr(l),shape:`square`}),title:l,subtitle:c(`auth.tenant.viaIdp`,{idp:d}),email:e,actionLabel:c(`auth.change`),onAction:i}),n(`div`,{className:`flex flex-col gap-2`,children:[t(dr,{provider:u,email:e,redirectTo:s,variant:`filled`,onClick:a,onPasswordRequired:()=>o(e)}),t(j,{variant:`ghost`,onClick:i,children:c(`auth.tenant.notPartOf`,{name:l})})]})]})}function mr({onSignup:r,goBack:i}){let{t:a}=k(),[o,s]=y(void 0),[c,l]=y(void 0),[u,d]=y(void 0),[f,m]=y(void 0),[h,g]=y(void 0),[_,v]=y(void 0),[b,S]=y(void 0),C=o===`company`,T=[{id:1,label:a(`signup.size1to10`)},{id:11,label:a(`signup.size11to100`)},{id:101,label:a(`signup.size101to1000`)},{id:1001,label:a(`signup.size1001to5000`)},{id:5001,label:a(`signup.size5000plus`)}],E=[{id:`personal`,label:a(`signup.personal`),description:a(`signup.personalDescription`)},{id:`company`,label:a(`signup.company`),description:a(`signup.companyDescription`)}],ee=[{id:`testing`,label:a(`signup.justTesting`)},{id:`exploring`,label:a(`signup.activelyExploring`)},{id:`using`,label:a(`signup.alreadyUsing`)},{id:`migrating`,label:a(`signup.migratingLLMs`)},{id:`other`,label:a(`signup.other`)}];p(()=>{let e=je().currentUser;if(!e){console.error(`No user found`);return}v(e)},[]);let te=()=>o?C&&!u?(S(a(`signup.pleaseEnterOrgName`)),!1):C&&!c?(S(a(`signup.pleaseSelectCompanySize`)),!1):!0:(S(a(`signup.pleaseSelectAccountType`)),!1);return n(`div`,{className:`flex flex-col space-y-2`,children:[n(`div`,{className:`prose`,children:[t(`p`,{className:`prose text-sm text-muted pt-4`,children:a(`signup.welcomeMessage`,{name:_?.displayName,email:_?.email})}),b&&t(`div`,{className:`text-destructive`,children:b})]}),t(hr,{label:a(`signup.accountType`),children:t(se,{options:E,selected:E.find(e=>e.id===o),onSelect:e=>s(e.id)})}),C&&n(e,{children:[t(hr,{label:a(`signup.companySize`),children:t(D,{className:`w-full border border-muted bg-muted`,value:c,options:T,onChange:l,optionLabel:e=>e?.label,placeholder:a(`signup.selectCompanySize`)})}),t(hr,{label:a(`signup.companyName`),children:t(w,{value:u,onChange:d,type:`text`,required:!0})}),t(hr,{label:a(`signup.companyWebsite`),children:t(w,{value:f,onChange:m,type:`text`})})]}),t(hr,{label:a(`signup.projectMaturity`),children:t(D,{className:`w-full border border-muted bg-muted`,options:ee,value:ee.find(e=>e.id===h),optionLabel:e=>e?.label,placeholder:a(`signup.selectProjectMaturity`),onChange:e=>g(e?.id)})}),n(`div`,{className:`pt-8 flex flex-col`,children:[t(x,{variant:`primary`,onClick:async()=>{if(!te()||!o)return;let e={accountType:o,companyName:u,companySize:c?.id,companyWebsite:f,maturity:h};window.localStorage.setItem(`composableSignupData`,JSON.stringify(e));let t=await je().currentUser?.getIdToken();if(console.log(`Got firebase token`,je(),t),!t){console.error(`No firebase token found`);return}r(e,t)},size:`xl`,children:t(`span`,{className:`text-lg`,children:a(`signup.signUp`)})}),t(x,{variant:`ghost`,size:`xl`,className:`mt-4`,onClick:i,children:t(`span`,{className:``,children:a(`signup.wrongAccountGoBack`)})})]})]})}function hr({label:e,children:r}){return n(`div`,{className:`flex flex-col space-y-2 pt-4`,children:[t(`div`,{className:`text-sm text-muted`,children:e}),r]})}function gr({allowedPrefix:e,isNested:n=!1,lightLogo:r,darkLogo:i,preservePath:a,suppressAuthErrorPrefix:o}){let s=typeof window>`u`?``:window.location.pathname,c=_r(s,e),l=_r(s,o);return c?null:t(yr,{isNested:n,lightLogo:r,darkLogo:i,preservePath:a,suppressAuthError:l})}function _r(e,t){return(Array.isArray(t)?t:t?[t]:[]).some(t=>e===t||e.startsWith(t.endsWith(`/`)?t:`${t}/`))}function vr(e){return e instanceof Ee||e instanceof Te||e instanceof we||e instanceof Ce||e instanceof ye||e instanceof ve}function yr({isNested:e=!1,lightLogo:r,darkLogo:i,preservePath:a,suppressAuthError:o}){let{t:s}=k(),{isLoading:c,user:l,authError:u,signOut:f}=O(),{trackEvent:m}=Ne(),[h,g]=y(()=>An()),[_,v]=y(()=>An()?`returning`:`email`),[b,x]=y(``),[S,C]=y(void 0),[w,T]=y(null),E=u instanceof we||u instanceof Ce?u.identity:void 0,ee=E&&h?.email.toLowerCase()===E.email.toLowerCase()?h:void 0,te=E?{email:E.email,name:E.name??ee?.name}:void 0;p(()=>{if(!a&&!c&&!u){let e=new URL(document.baseURI).pathname||`/`;history.replaceState({},``,e)}},[u,c,a]),p(()=>{if(u){if(u instanceof Ee)v(`signup`);else if(u instanceof Te)v(`restricted`);else if(u instanceof we)v(`scopeUnavailable`);else if(u instanceof Ce)v(`noAccessibleAccount`);else if(u instanceof ye)v(`credentialFailure`);else if(u instanceof ve)v(`serviceFailure`);else if($n(u)){let e=Nn();e&&x(e.email),v(`blocked`)}}},[u]),p(()=>{if(!l)return;let e=Nn();e&&(jn({email:e.email,lastProvider:e.provider,tenantName:e.tenantName,name:l.name||void 0}),Fn())},[l]);let ne=d((e,t)=>{x(e),C(t),v(t?.provider===`password`?`password`:t?`tenant`:`providers`)},[]),re=d(e=>{x(e),v(`password`)},[]),ie=d(()=>{v(`email`),C(void 0)},[]),ae=d(()=>{Mn(),Fn(),g(null),x(``),C(void 0),v(`email`),f()},[f]),oe=d(e=>{(S||h?.tenantName)&&m(`enterprise_signin`,{provider:e}),T(e),v(`pending`)},[m,h?.tenantName,S]),se=d(()=>{g(null),x(``),C(void 0),v(`email`),In()},[]),D=d(()=>{A.logger.info(`Authentication recovery action selected`,{vertesia:{recovery_action:`use_different_account`}}),g(null),x(``),C(void 0),v(`email`),In().finally(()=>f())},[f]),ce=d(()=>{u instanceof we&&(A.logger.info(`Authentication recovery action selected`,{vertesia:{error_code:Le,selector_source:u.selectorSource,requested_scope:u.requestedScope,recovery_action:`continue_sanitized`}}),window.location.replace(u.recoveryUrl??window.location.href))},[u]),le=d(()=>{A.logger.info(`Authentication recovery action selected`,{vertesia:{recovery_action:`retry`}}),window.location.reload()},[]),ue=(e,t)=>{let n={signupData:e,firebaseToken:t};fetch(`${A.endpoints.studio}/auth/signup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(n)}).then(()=>{m(`sign_up`),window.location.href=`/`})},de=o&&u!==void 0&&!vr(u);if(c||l||de)return null;let fe=null;if(_===`pending`&&w)fe=t(er,{provider:w});else if(_===`blocked`)fe=t(ur,{email:b||h?.email||``,tenantName:S?.label||S?.name||h?.tenantName||void 0,onBack:se});else if(_===`restricted`)fe=t(cr,{onUseDifferentEmail:se});else if(_===`scopeUnavailable`&&u instanceof we){let e=u.requestedScope===`project`?`scopeProject`:`scopeAccount`;fe=t(ar,{details:{accountId:u.accountId,errorCode:u.errorCode,message:u.message,projectId:u.projectId,status:u.status},identity:te,kind:e,onContinue:ce,onUseDifferentAccount:D})}else fe=_===`noAccessibleAccount`&&u instanceof Ce?t(ar,{details:{errorCode:u.errorCode,message:u.message,status:u.status},identity:te,kind:`noAccessibleAccount`,onUseDifferentAccount:D}):_===`credentialFailure`&&u instanceof ye?t(ar,{details:{errorCode:u.errorCode,message:u.message,status:u.status},kind:`credential`,onUseDifferentAccount:D}):_===`serviceFailure`&&u instanceof ve?t(ar,{details:{errorCode:u.errorCode,message:u.message,status:u.status},kind:`service`,onContinue:le,onUseDifferentAccount:D}):_===`signup`&&!localStorage.getItem(`tenantName`)?t(mr,{onSignup:ue,goBack:se}):_===`password`&&b?t(nr,{email:b,tenantName:S?.label||S?.name||h?.tenantName||void 0,onBack:ie}):_===`tenant`&&S?t(pr,{email:b,tenant:S,onBack:ie,onProviderClicked:()=>oe(S.provider??`oidc`),onPasswordRequired:re}):_===`providers`?t(ir,{email:b,onBack:ie,onProviderClicked:oe,onPasswordRequired:re}):_===`returning`&&h?t(lr,{session:h,onNotYou:ae,onProviderClicked:oe,onPasswordRequired:re}):t(tr,{initialEmail:b,onProceed:ne});return t(`div`,{style:{zIndex:999998},className:`${e?`absolute`:`fixed`} inset-0 overflow-y-auto bg-background`,children:t(`div`,{className:`min-h-full flex flex-col items-center justify-center py-12 px-4`,children:n(`div`,{className:`flex flex-col items-center w-full`,children:[(r||i)&&n(`div`,{className:`mb-7`,children:[r&&t(`img`,{src:r,alt:`Vertesia`,className:`h-10 block dark:hidden`}),i&&t(`img`,{src:i,alt:`Vertesia`,className:`h-10 hidden dark:block`})]}),fe,u&&!vr(u)&&!$n(u)&&t(`div`,{className:`mt-6 max-w-[420px] text-center text-sm text-muted`,children:n(`div`,{children:[s(`auth.signInError`),t(`br`,{}),s(`auth.signInErrorContact`),t(`a`,{className:`text-info mx-1`,href:`mailto:support@vertesiahq.com`,children:`support@vertesiahq.com`}),s(`auth.signInErrorPersists`)]})}),n(`div`,{className:`flex items-center gap-5 mt-10 text-xs text-muted`,children:[t(`a`,{href:`https://vertesiahq.com/privacy`,className:`hover:text-foreground transition`,children:s(`auth.privacyPolicy`)}),t(`span`,{className:`text-border`,children:`·`}),t(`a`,{href:`https://vertesiahq.com/terms`,className:`hover:text-foreground transition`,children:s(`auth.termsOfService`)}),t(`span`,{className:`text-border`,children:`·`}),t(ze,{className:`cursor-default`})]})]})})})}const br=new Set([`127.0.0.1`,`localhost`]);function xr(e){if(!e)return null;let t;try{t=decodeURIComponent(e)}catch{return null}let n;try{n=new URL(t)}catch{return null}return n.protocol!==`http:`||!n.port||n.username||n.password||!br.has(n.hostname)?null:n.toString()}function Sr(e){let t=new URLSearchParams(e.search),n=xr(t.get(`redirect_uri`)),r=t.get(`code`);return!n||!r?null:{redirect:n,code:r,profile:t.get(`profile`)??`default`,project:t.get(`project`)??void 0,account:t.get(`account`)??void 0}}function Cr(){let[e,n]=y(),[r,i]=y(),a=Sr(qe()),o=_e(),{t:s}=k(),c=a?e?t(Tr,{payload:e,error:r}):t(wr,{clientInfo:a,onAccept:async e=>{if(!a)return;if(!e.profile){o({title:s(`login.terminal.profileRequired`),description:s(`login.terminal.profileRequiredDesc`),status:`error`,duration:2e3});return}if(!e.account){o({title:s(`login.terminal.accountRequired`),description:s(`login.terminal.accountRequiredDesc`),status:`error`,duration:2e3});return}if(!e.project){o({title:s(`login.terminal.projectRequired`),description:s(`login.terminal.projectRequiredDesc`),status:`error`,duration:2e3});return}let t;try{let r=Ae(),i=r?await ke(r,e.account,e.project,86400):await Oe(e.account,e.project,86400);i?(t={...e,studio_server_url:A.endpoints.studio,zeno_server_url:A.endpoints.zeno,token:i},await fetch(a.redirect,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),n(t)):o({title:s(`login.terminal.failedToGetToken`),status:`error`,duration:5e3})}catch(e){t?(i(e instanceof Error?e:Error(he(e))),n(t)):o({title:s(`login.terminal.errorAuthorizingClient`),description:he(e),status:`error`,duration:5e3})}}}):t(C,{title:s(`login.terminal.invalidRequest`),children:s(`login.terminal.invalidRequestDesc`)});return t(`div`,{className:`w-full flex flex-col items-center gap-4 mt-24`,children:c})}function wr({onAccept:r,clientInfo:i}){let{client:a,user:o}=O(),{data:s,error:c}=ge(()=>o?a.projects.list():Promise.resolve([]),[o]),{t:l}=k();if(c)return t(C,{title:l(`login.terminal.errorLoadingProjects`),children:he(c)});let u=A.isLocalDev?l(`login.terminal.envLocalDev`):A.isDev?l(`login.terminal.envStaging`):l(`login.terminal.envProduction`);return o&&s?n(e,{children:[n(`div`,{className:`w-1/3`,children:[n(`div`,{className:`mb-4 text-xl font-semibold text-info`,children:[`Authorizing client on `,u,` environment.`]}),n(`div`,{className:`mb-2 text-base text-muted`,children:[t(`div`,{children:l(`login.terminal.clientWantsAuth`)}),n(`div`,{children:[`The client app code is `,t(`b`,{className:`text-foreground`,children:i.code}),`. You can check if the code is correct in the terminal.`]})]}),n(`div`,{className:`mb-2 text-sm text-muted`,children:[t(`div`,{children:l(`login.terminal.chooseAccountProject`)}),t(`div`,{children:l(`login.terminal.profileNameNote`)})]})]}),t(Er,{onAccept:r,allProjects:s,data:i})]}):t(ce,{size:`lg`})}function Tr({payload:e,error:r}){let i=_e(),{t:a}=k();return n(`div`,{children:[r?t(`div`,{children:t(C,{title:a(`login.terminal.failedToSendToken`),children:a(`login.terminal.failedToSendTokenDesc`,{error:r.message})})}):t(`div`,{children:a(`login.terminal.clientAuthenticated`)}),t(S,{className:`mt-4`,children:t(x,{variant:`secondary`,onClick:()=>{e&&(navigator.clipboard.writeText(JSON.stringify(e)),i({title:a(`login.terminal.authPayloadCopied`),description:r?a(`login.terminal.authPayloadCopiedWithError`,{error:r.message}):a(`login.terminal.authPayloadCopiedSuccess`),status:`success`,duration:5e3}))},children:a(`login.terminal.copyAuthPayload`)})})]})}function Er({allProjects:e,data:r,onAccept:i}){let{accounts:a,account:o,project:s}=O(),{t:c}=k(),[l,u]=y(()=>({profile:r.profile,account:r.account??o?.id,project:r.project??s?.id})),d=e=>{u({...l,profile:e})},f=e=>{u({...l,account:e.id,project:void 0})},p=e=>{u({...l,project:e.id})},m=e.filter(e=>e.account===l.account);return n(`div`,{className:`w-1/3`,children:[n(`div`,{className:`mb-4 flex flex-col gap-2`,children:[t(`span`,{className:`font-semibold text-muted`,children:c(`login.terminal.profileName`)}),t(w,{type:`text`,value:l.profile,onChange:d})]}),n(`div`,{className:`mb-4 flex flex-col gap-2`,children:[t(`span`,{className:`font-semibold text-muted`,children:c(`login.terminal.account`)}),t(Dr,{value:l.account,onChange:f,accounts:a||[]})]}),n(`div`,{className:`mb-4 flex flex-col gap-2`,children:[t(`span`,{className:`font-semibold text-muted`,children:c(`login.terminal.project`)}),t(Or,{value:l.project,onChange:p,projects:m})]}),t(`div`,{className:`mb-4 text-sm text-attention`,children:c(`login.terminal.browserPermissionNote`)}),t(`div`,{children:t(x,{size:`xl`,onClick:()=>i(l),children:c(`login.terminal.authorizeClient`)})})]})}function Dr({value:e,accounts:n,onChange:r}){let{t:i}=k();return t(D,{options:n,value:n?.find(t=>t.id===e),onChange:e=>{r(e)},by:`id`,optionLabel:e=>e.name,placeholder:i(`login.terminal.selectAccount`)})}function Or({value:e,projects:n,onChange:r}){let{t:i}=k();return t(D,{by:`id`,value:n.find(t=>t.id===e),options:n,optionLabel:e=>e.name,placeholder:i(`login.terminal.selectProject`),onChange:e=>{r(e)}})}function kr({isOpen:e,onClose:r}){return n(E,{isOpen:e,onClose:r,children:[t(ne,{children:`Sign In`}),n(ee,{className:`flex flex-col gap-2`,children:[t(dr,{provider:`google`}),t(dr,{provider:`github`}),t(dr,{provider:`microsoft`})]}),t(te,{align:`right`,children:t(x,{variant:`ghost`,onClick:r,children:`Cancel`})})]})}function M({title:e,value:r}){function i(e){navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3)}let[a,o]=y(!1);return n(`div`,{className:`w-full flex justify-between items-center mb-1`,children:[n(`div`,{className:`flex flex-col w-[calc(100%-3rem)]`,children:[t(`div`,{className:`text-sm px-2 dark:text-foreground`,children:e}),t(me,{description:r,size:`xs`,placement:`left`,children:n(`div`,{className:`text-xs truncate text-muted w-full text-start px-2`,children:[r,` `]})})]}),a?t(Gt,{className:`size-4 cursor-pointer text-success`}):t(Kt,{className:`size-4 cursor-pointer text-muted`,onClick:()=>i(r)})]})}function Ar(){let{t:e}=k(),{account:r,project:i,client:a,authToken:o}=O(),s=a.baseUrl,c=a.store.baseUrl,l=c.replace(/\/+$/,``)!==s.replace(/\/+$/,``),u=A.endpoints.mcp??e(`user.unknown`),d=i?Re(i):``,f=[{name:`user`,label:e(`user.user`),content:n(`div`,{className:`space-y-1 p-2`,children:[t(M,{title:e(`user.organizationId`),value:r?.id??e(`user.unknown`)}),t(M,{title:e(`user.projectId`),value:i?.id??e(`user.unknown`)}),t(M,{title:e(`user.userId`),value:o?.sub??e(`user.unknown`)}),t(M,{title:e(`user.organizationRoles`),value:o?.account_roles?.join(`,`)??e(`user.unknown`)}),t(M,{title:e(`user.projectRoles`),value:o?.project_roles?.join(`,`)??e(`user.unknown`)})]})},{name:`environment`,label:e(`user.environment`),content:n(`div`,{className:`space-y-1 p-2`,children:[t(M,{title:e(`user.tenantId`),value:d}),t(M,{title:e(`user.environment`),value:A.type}),t(M,{title:e(`user.server`),value:s}),l&&t(M,{title:e(`user.store`),value:c}),t(M,{title:e(`user.mcpServer`),value:u}),t(M,{title:e(`user.appVersion`),value:A.version}),t(M,{title:e(`user.sdkVersion`),value:A.sdkVersion||e(`user.unknown`)})]})}];return t(`div`,{className:`w-full`,children:n(le,{defaultValue:`user`,tabs:f,fullWidth:!0,updateHash:!1,children:[t(ue,{}),t(de,{})]})})}function jr(r){let{user:i,isLoading:a}=O(),[o,s]=y(!1);return a?t(ce,{}):i?t(`div`,{className:`px-3`,children:t(Mr,{asMenuTrigger:!0})}):n(e,{children:[t(x,{onClick:()=>s(!0),children:`Sign In`}),t(kr,{isOpen:o,onClose:()=>s(!1)})]})}function Mr({className:e,asMenuTrigger:r=!1}){let i=O(),a=Je(),o=Ze(),{user:s}=i;if(!i||!s)return null;let c=o.hasPermission(Ie.project_admin);return n(ie,{click:!0,children:[t(oe,{children:t(`div`,{className:Qe(e,`flex items-center justify-start`,r&&`cursor-pointer`),children:t(b,{size:`sm`,color:`bg-amber-500`,shape:`circle`,name:s?.name})})}),t(ae,{align:`start`,className:`w-[280px] mx-2 my-1 p-0`,children:n(`div`,{className:`divide-y divide-border`,children:[n(`div`,{className:`py-2 ps-2`,children:[t(`p`,{className:`px-4 dark:text-white mb-1`,children:s?.name??`Unknown`}),t(`p`,{className:`px-4 text-xs text-muted`,children:s?.email??``})]}),t(`div`,{className:`w-full p-1`,children:t(Ar,{})}),t(`div`,{className:`py-2 ps-2`,children:t(re,{})}),t(`div`,{className:`py-2`,children:n(T,{children:[c&&t(T.Item,{className:`px-2`,onClick:()=>a(`/settings`,{replace:!0}),children:`Settings`}),t(T.Item,{className:`px-2`,onClick:()=>i.logout(),children:`Sign out`})]})})]})})]})}function Nr(e){return e?e.endsWith(`@vertesiahq.com`)||e.endsWith(`@becomposable.com`)||e.endsWith(`@composableprompts.com`):!1}const Pr=s({});function Fr(e){let t=v(null);return t.current===null&&(t.current=e()),t.current}const Ir=typeof window<`u`?g:p,Lr=s(null);function Rr(e,t){e.indexOf(t)===-1&&e.push(t)}function zr(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}const N=(e,t,n)=>n>t?t:n<e?e:n,Br={},Vr=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Hr=e=>typeof e==`object`&&!!e,Ur=e=>/^0[^.\s]+$/u.test(e);function Wr(e){let t;return()=>(t===void 0&&(t=e()),t)}const P=e=>e,Gr=(...e)=>e.reduce((e,t)=>n=>t(e(n))),Kr=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1};var qr=class{constructor(){this.subscriptions=[]}add(e){return Rr(this.subscriptions,e),()=>zr(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};const F=e=>e*1e3,I=e=>e/1e3,Jr=(e,t)=>t?1e3/t*e:0,Yr=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Xr(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Yr(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>1e-7&&++s<12);return o}function Zr(e,t,n,r){if(e===t&&n===r)return P;let i=t=>Xr(t,0,1,e,n);return e=>e===0||e===1?e:Yr(i(e),t,r)}const Qr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,$r=e=>t=>1-e(1-t),ei=Zr(.33,1.53,.69,.99),ti=$r(ei),ni=Qr(ti),ri=e=>e>=1?1:(e*=2)<1?.5*ti(e):.5*(2-2**(-10*(e-1))),ii=e=>1-Math.sin(Math.acos(e)),ai=$r(ii),oi=Qr(ii),si=Zr(.42,0,1,1),ci=Zr(0,0,.58,1),li=Zr(.42,0,.58,1),ui=e=>Array.isArray(e)&&typeof e[0]!=`number`,di=e=>Array.isArray(e)&&typeof e[0]==`number`,fi={linear:P,easeIn:si,easeInOut:li,easeOut:ci,circIn:ii,circInOut:oi,circOut:ai,backIn:ti,backInOut:ni,backOut:ei,anticipate:ri},pi=e=>typeof e==`string`,mi=e=>{if(di(e)){e.length;let[t,n,r,i]=e;return Zr(t,n,r,i)}return pi(e)?(fi[e],`${e}`,fi[e]):e},hi=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function gi(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}function _i(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=hi.reduce((e,t)=>(e[t]=gi(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Br.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,40),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:hi.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<hi.length;t++)o[hi[t]].cancel(e)},state:i,steps:o}}const{schedule:L,cancel:vi,state:R,steps:yi}=_i(typeof requestAnimationFrame<`u`?requestAnimationFrame:P,!0);let bi;function xi(){bi=void 0}const z={now:()=>(bi===void 0&&z.set(R.isProcessing||Br.useManualTiming?R.timestamp:performance.now()),bi),set:e=>{bi=e,queueMicrotask(xi)}},Si=e=>t=>typeof t==`string`&&t.startsWith(e),Ci=Si(`--`),wi=Si(`var(--`),Ti=e=>wi(e)?Ei.test(e.split(`/*`)[0].trim()):!1,Ei=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Di(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}const Oi={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},ki={...Oi,transform:e=>N(0,1,e)},Ai={...Oi,default:1},ji=e=>Math.round(e*1e5)/1e5,Mi=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Ni(e){return e==null}const Pi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Fi=(e,t)=>n=>!!(typeof n==`string`&&Pi.test(n)&&n.startsWith(e)||t&&!Ni(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ii=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Mi);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},Li=e=>N(0,255,e),Ri={...Oi,transform:e=>Math.round(Li(e))},zi={test:Fi(`rgb`,`red`),parse:Ii(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ri.transform(e)+`, `+Ri.transform(t)+`, `+Ri.transform(n)+`, `+ji(ki.transform(r))+`)`};function Bi(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const Vi={test:Fi(`#`),parse:Bi,transform:zi.transform},Hi=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),B=Hi(`deg`),V=Hi(`%`),H=Hi(`px`),Ui=Hi(`vh`),Wi=Hi(`vw`),Gi={...V,parse:e=>V.parse(e)/100,transform:e=>V.transform(e*100)},Ki={test:Fi(`hsl`,`hue`),parse:Ii(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+V.transform(ji(t))+`, `+V.transform(ji(n))+`, `+ji(ki.transform(r))+`)`},U={test:e=>zi.test(e)||Vi.test(e)||Ki.test(e),parse:e=>zi.test(e)?zi.parse(e):Ki.test(e)?Ki.parse(e):Vi.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?zi.transform(e):Ki.transform(e),getAnimatableNone:e=>{let t=U.parse(e);return t.alpha=0,U.transform(t)}},qi=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Ji(e){return isNaN(e)&&typeof e==`string`&&(e.match(Mi)?.length||0)+(e.match(qi)?.length||0)>0}const Yi=`number`,Xi=`color`,Zi=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Qi(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Zi,e=>(U.test(e)?(r.color.push(a),i.push(Xi),n.push(U.parse(e))):e.startsWith(`var(`)?(r.var.push(a),i.push(`var`),n.push(e)):(r.number.push(a),i.push(Yi),n.push(parseFloat(e))),++a,"${}")).split("${}"),indexes:r,types:i}}function $i(e){return Qi(e).values}function ea({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===Yi?ji(r[a]):e===Xi?U.transform(r[a]):r[a]}return i}}function ta(e){return ea(Qi(e))}const na=e=>typeof e==`number`?0:U.test(e)?U.getAnimatableNone(e):e,ra=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:na(e);function ia(e){let t=Qi(e);return ea(t)(t.values.map((e,n)=>ra(e,t.split[n])))}const W={test:Ji,parse:$i,createTransformer:ta,getAnimatableNone:ia};function aa(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function oa({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=aa(s,r,e+1/3),a=aa(s,r,e),o=aa(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function sa(e,t){return n=>n>0?t:e}const G=(e,t,n)=>e+(t-e)*n,ca=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},la=[Vi,zi,Ki],ua=e=>la.find(t=>t.test(e));function da(e){let t=ua(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Ki&&(n=oa(n)),n}const fa=(e,t)=>{let n=da(e),r=da(t);if(!n||!r)return sa(e,t);let i={...n};return e=>(i.red=ca(n.red,r.red,e),i.green=ca(n.green,r.green,e),i.blue=ca(n.blue,r.blue,e),i.alpha=G(n.alpha,r.alpha,e),zi.transform(i))},pa=new Set([`none`,`hidden`]);function ma(e,t){return pa.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ha(e,t){return n=>G(e,t,n)}function ga(e){return typeof e==`number`?ha:typeof e==`string`?Ti(e)?sa:U.test(e)?fa:ba:Array.isArray(e)?_a:typeof e==`object`?U.test(e)?fa:va:sa}function _a(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>ga(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function va(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=ga(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function ya(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const ba=(e,t)=>{let n=W.createTransformer(t),r=Qi(e),i=Qi(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?pa.has(e)&&!i.values.length||pa.has(t)&&!r.values.length?ma(e,t):Gr(_a(ya(r,i),i.values),n):(`${e}${t}`,sa(e,t))};function xa(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?G(e,t,n):ga(e)(e,t)}const Sa=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>L.update(t,e),stop:()=>vi(t),now:()=>R.isProcessing?R.timestamp:z.now()}},Ca=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},wa=2e4;function Ta(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Ea(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Ta(r),wa);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:I(i)}}const K={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Da(e,t){return e*Math.sqrt(1-t*t)}function Oa(e,t,n){let r=n;for(let n=1;n<12;n++)r-=e(r)/t(r);return r}const ka=.001;function Aa({duration:e=K.duration,bounce:t=K.bounce,velocity:n=K.velocity,mass:r=K.mass}){let i,a;K.maxDuration;let o=1-t;o=N(K.minDamping,K.maxDamping,o),e=N(K.minDuration,K.maxDuration,I(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=Da(t,o),c=Math.exp(-i);return ka-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=Da(t**2,o);return(-i(t)+ka>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Oa(i,a,s);if(e=F(e),isNaN(c))return{stiffness:K.stiffness,damping:K.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}const ja=[`duration`,`bounce`],Ma=[`stiffness`,`damping`,`mass`];function Na(e,t){return t.some(t=>e[t]!==void 0)}function Pa(e){let t={velocity:K.velocity,stiffness:K.stiffness,damping:K.damping,mass:K.mass,isResolvedFromDuration:!1,...e};if(!Na(e,Ma)&&Na(e,ja)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*N(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:K.mass,stiffness:i,damping:a}}else{let n=Aa({...e,velocity:0});t={...t,...n,mass:K.mass},t.isResolvedFromDuration=!0}}return t}function Fa(e=K.visualDuration,t=K.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Pa({...n,velocity:-I(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=I(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?K.restSpeed.granular:K.restSpeed.default,i||=v?K.restDelta.granular:K.restDelta.default;let y,b,x,S,C,w;if(h<1)x=Da(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>F(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=F(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=F(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Ta(T),wa),t=Ca(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}Fa.applyToOptions=e=>{let t=Ea(e,100,Fa);return e.ease=t.ease,e.duration=F(t.duration),e.type=`keyframes`,e};function Ia(e,t,n){let r=Math.max(t-5,0);return Jr(n-e(r),t-r)}function La({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Fa({keyframes:[f.value,m(f.value)],velocity:Ia(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Ra(e,t,n){let r=[],i=n||Br.mix||xa,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);if(t){let e=Array.isArray(t)?t[n]||P:t;a=Gr(e,a)}r.push(a)}return r}function za(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Ra(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=Kr(e[r],e[r+1],n);return s[r](i)};return n?t=>l(N(e[0],e[a-1],t)):l}function Ba(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=Kr(0,t,r);e.push(G(n,1,i))}}function Va(e){let t=[0];return Ba(t,e.length-1),t}function Ha(e,t){return e.map(e=>e*t)}function Ua(e,t){return e.map(()=>t||li).splice(0,e.length-1)}function Wa({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=ui(r)?r.map(mi):mi(r),a={done:!1,value:t[0]},o=za(Ha(n&&n.length===t.length?n:Va(t),e),t,{ease:Array.isArray(i)?i:Ua(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}const Ga=e=>e!==null;function Ka(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Ga),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}const qa={decay:La,inertia:La,tween:Wa,keyframes:Wa,spring:Fa};function Ja(e){typeof e.type==`string`&&(e.type=qa[e.type])}var Ya=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}};const Xa=e=>e/100;var Za=class extends Ya{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==z.now()&&this.tick(z.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Ja(e);let{type:t=Wa,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||Wa;s!==Wa&&typeof o[0]!=`number`&&(this.mixKeyframes=Gr(Xa,xa(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Ta(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=N(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==La&&(b.value=Ka(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return I(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(this.currentTime)}set time(e){e=F(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return Ia(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(z.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=I(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Sa,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(z.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function Qa(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const $a=e=>e*180/Math.PI,eo=e=>{let t=$a(Math.atan2(e[1],e[0]));return no(t)},to={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:eo,rotateZ:eo,skewX:e=>$a(Math.atan(e[1])),skewY:e=>$a(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},no=e=>(e%=360,e<0&&(e+=360),e),ro=eo,io=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),ao=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),oo={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:io,scaleY:ao,scale:e=>(io(e)+ao(e))/2,rotateX:e=>no($a(Math.atan2(e[6],e[5]))),rotateY:e=>no($a(Math.atan2(-e[2],e[0]))),rotateZ:ro,rotate:ro,skewX:e=>$a(Math.atan(e[4])),skewY:e=>$a(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function so(e){return+!!e.includes(`scale`)}function co(e,t){if(!e||e===`none`)return so(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=oo,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=to,i=t}if(!i)return so(t);let a=r[t],o=i[1].split(`,`).map(uo);return typeof a==`function`?a(o):o[a]}const lo=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return co(n,t)};function uo(e){return parseFloat(e.trim())}const fo=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],po=new Set([...fo,`pathRotation`]),mo=e=>e===Oi||e===H,ho=new Set([`x`,`y`,`z`]),go=fo.filter(e=>!ho.has(e));function _o(e){let t=[];return go.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}const vo={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>co(t,`x`),y:(e,{transform:t})=>co(t,`y`)};vo.translateX=vo.x,vo.translateY=vo.y;const yo=new Set;let bo=!1,xo=!1,So=!1;function Co(){if(xo){let e=Array.from(yo).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=_o(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}xo=!1,bo=!1,yo.forEach(e=>e.complete(So)),yo.clear()}function wo(){yo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(xo=!0)})}function To(){So=!0,wo(),Co(),So=!1}var Eo=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(yo.add(this),bo||(bo=!0,L.read(wo),L.resolveKeyframes(Co))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}Qa(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),yo.delete(this)}cancel(){this.state===`scheduled`&&(yo.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}};const Do=e=>e.startsWith(`--`);function Oo(e,t,n){Do(t)?e.style.setProperty(t,n):e.style[t]=n}const ko={};function Ao(e,t){let n=Wr(e);return()=>ko[t]??n()}const jo=Ao(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Mo=Ao(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),No=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Po={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:No([0,.65,.55,1]),circOut:No([.55,0,1,.45]),backIn:No([.31,.01,.66,-.59]),backOut:No([.33,1.53,.69,.99])};function Fo(e,t){if(e)return typeof e==`function`?Mo()?Ca(e,t):`ease-out`:di(e)?No(e):Array.isArray(e)?e.map(e=>Fo(e,t)||Po.easeOut):Po[e]}function Io(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Fo(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Lo(e){return typeof e==`function`&&`applyToOptions`in e}function Ro({type:e,...t}){return Lo(e)&&Mo()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var zo=class extends Ya{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Ro(e);this.animation=Io(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ka(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),Oo(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return I(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+I(e)}get time(){return I(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=F(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&jo()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),P):r(this)}};const Bo={anticipate:ri,backInOut:ni,circInOut:oi};function Vo(e){return e in Bo}function Ho(e){typeof e.ease==`string`&&Vo(e.ease)&&(e.ease=Bo[e.ease])}var Uo=class extends zo{constructor(e){Ho(e),Ja(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Za({...a,autoplay:!1}),s=Math.max(10,z.now()-this.startTime),c=N(0,10,s-10),l=o.sample(s).value,{name:u}=this.options;i&&u&&Oo(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}};const Wo=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(W.test(e)||e===`0`)&&!e.startsWith(`url(`));function Go(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ko(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=Wo(i,t),s=Wo(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Go(e)||(n===`spring`||Lo(n))&&r}function qo(e){e.duration=0,e.type=`keyframes`}const Jo=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Yo=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Xo(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Yo.test(e[t]))return!0;return!1}const Zo=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),Qo=Wr(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function $o(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return Qo()&&n&&(Jo.has(n)||Zo.has(n)&&Xo(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var es=class extends Ya{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=z.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Eo;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=z.now();let u=!0;Ko(e,i,a,o)||(u=!1,(Br.instantAnimations||!s)&&l?.(Ka(e,n,t)),e[0]=e[e.length-1],qo(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&$o(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new Uo({...d,element:p})}catch{m=new Za(d)}else m=new Za(d);m.finished.then(()=>{this.notifyFinished()}).catch(P),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),To()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function ts(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}const ns=e=>!isNaN(parseFloat(e)),rs={current:void 0};var is=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=z.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=z.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=ns(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new qr);let n=this.events[e].add(t);return e===`change`?()=>{n(),L.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return rs.current&&rs.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Jr(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function as(e,t){return new is(e,t)}function os(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function ss(e,t){let n=e?.[t]??e?.default??e;return n===e?n:os(n,e)}const cs={type:`spring`,stiffness:500,damping:25,restSpeed:10},ls=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),us={type:`keyframes`,duration:.8},ds={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},fs=(e,{keyframes:t})=>t.length>2?us:po.has(e)?e.startsWith(`scale`)?ls(t[1]):cs:ds,ps=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function ms(e){for(let t in e)if(!ps.has(t))return!0;return!1}const hs=(e,t,n,r={},i,a)=>o=>{let s=ss(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=F(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};ms(s)||Object.assign(u,fs(e,u)),u.duration&&=F(u.duration),u.repeatDelay&&=F(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(qo(u),u.delay===0&&(d=!0)),(Br.instantAnimations||Br.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,qo(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ka(u.keyframes,s);if(e!==void 0){L.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Za(u):new es(u)},gs=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _s(e){let t=gs.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function vs(e,t,n=1){`${e}`;let[r,i]=_s(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Vr(e)?parseFloat(e):e}return Ti(i)?vs(i,t,n+1):i}function ys(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function bs(e,t,n,r){if(typeof t==`function`){let[i,a]=ys(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=ys(r);t=t(n===void 0?e.custom:n,i,a)}return t}function xs(e,t,n){let r=e.getProps();return bs(r,t,n===void 0?r.custom:n,e)}const Ss=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...fo]),Cs=e=>Array.isArray(e);function ws(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,as(n))}function Ts(e){return Cs(e)?e[e.length-1]||0:e}function Es(e,t){let{transitionEnd:n={},transition:r={},...i}=xs(e,t)||{};i={...i,...n};for(let t in i)ws(e,t,Ts(i[t]))}const q=e=>!!(e&&e.getVelocity);function Ds(e){return!!(q(e)&&e.add)}function Os(e,t){let n=e.getValue(`willChange`);if(Ds(n))return n.add(t);if(!n&&Br.WillChange){let n=new Br.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function ks(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const As=`data-`+ks(`framerAppearId`);function js(e){return e.props[As]}function Ms({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ns(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?os(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Ms(f,t))continue;let o={delay:n,...ss(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){L.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=js(e);if(n){let e=window.MotionHandoffAnimation(n,t,L);e!==null&&(o.startTime=e,p=!0)}}Os(e,t);let m=l??e.shouldReduceMotion;r.start(hs(t,r,i,m&&Ss.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>L.update(()=>{o&&Es(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ps(e,t,n={}){let r=xs(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Ns(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Fs(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Fs(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Ps(c,t,{...o,delay:n+(typeof r==`function`?0:r)+ts(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Is(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Ps(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Ps(e,t,n);else{let i=typeof t==`function`?xs(e,t,n.custom):t;r=Promise.all(Ns(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}const Ls={test:e=>e===`auto`,parse:e=>e},Rs=e=>t=>t.test(e),zs=[Oi,H,V,B,Wi,Ui,Ls],Bs=e=>zs.find(Rs(e));function Vs(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||Ur(e)}const Hs=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Us(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Mi)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Hs.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}const Ws=/\b([a-z-]*)\(.*?\)/gu,Gs={...W,getAnimatableNone:e=>{let t=e.match(Ws);return t?t.map(Us).join(` `):e}},Ks={...W,getAnimatableNone:e=>{let t=W.parse(e);return W.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},qs={...Oi,transform:Math.round},Js={borderWidth:H,borderTopWidth:H,borderRightWidth:H,borderBottomWidth:H,borderLeftWidth:H,borderRadius:H,borderTopLeftRadius:H,borderTopRightRadius:H,borderBottomRightRadius:H,borderBottomLeftRadius:H,width:H,maxWidth:H,height:H,maxHeight:H,top:H,right:H,bottom:H,left:H,inset:H,insetBlock:H,insetBlockStart:H,insetBlockEnd:H,insetInline:H,insetInlineStart:H,insetInlineEnd:H,padding:H,paddingTop:H,paddingRight:H,paddingBottom:H,paddingLeft:H,paddingBlock:H,paddingBlockStart:H,paddingBlockEnd:H,paddingInline:H,paddingInlineStart:H,paddingInlineEnd:H,margin:H,marginTop:H,marginRight:H,marginBottom:H,marginLeft:H,marginBlock:H,marginBlockStart:H,marginBlockEnd:H,marginInline:H,marginInlineStart:H,marginInlineEnd:H,fontSize:H,backgroundPositionX:H,backgroundPositionY:H,rotate:B,pathRotation:B,rotateX:B,rotateY:B,rotateZ:B,scale:Ai,scaleX:Ai,scaleY:Ai,scaleZ:Ai,skew:B,skewX:B,skewY:B,distance:H,translateX:H,translateY:H,translateZ:H,x:H,y:H,z:H,perspective:H,transformPerspective:H,opacity:ki,originX:Gi,originY:Gi,originZ:H,zIndex:qs,fillOpacity:ki,strokeOpacity:ki,numOctaves:qs},Ys={...Js,color:U,backgroundColor:U,outlineColor:U,fill:U,stroke:U,borderColor:U,borderTopColor:U,borderRightColor:U,borderBottomColor:U,borderLeftColor:U,filter:Gs,WebkitFilter:Gs,mask:Ks,WebkitMask:Ks},Xs=e=>Ys[e],Zs=new Set([Gs,Ks]);function Qs(e,t){let n=Xs(e);return Zs.has(n)||(n=W),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const $s=new Set([`auto`,`none`,`0`]);function ec(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!$s.has(t)&&Qi(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=Qs(n,i)}var tc=class extends Eo{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Ti(r))){let i=vs(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Ss.has(n)||e.length!==2)return;let[r,i]=e,a=Bs(r),o=Bs(i);if(Di(r)!==Di(i)&&vo[n]){this.needsMeasurement=!0;return}if(a!==o){if(mo(a)&&mo(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else vo[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Vs(e[t]))&&n.push(t);n.length&&ec(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vo[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=vo[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}};const nc=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function rc(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}const ic=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function ac(e){return Hr(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}const{schedule:oc,cancel:sc}=_i(queueMicrotask,!1),J={x:!1,y:!1};function cc(){return J.x||J.y}function lc(e){return e===`x`||e===`y`?J[e]?null:(J[e]=!0,()=>{J[e]=!1}):J.x||J.y?null:(J.x=J.y=!0,()=>{J.x=J.y=!1})}function uc(e,t){let n=rc(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function dc(e){return!(e.pointerType===`touch`||cc())}function fc(e,t,n={}){let[r,i,a]=uc(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!dc(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}const pc=(e,t)=>t?e===t||pc(e,t.parentElement):!1,mc=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,hc=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function gc(e){return hc.has(e.tagName)||e.isContentEditable===!0}const _c=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function vc(e){return _c.has(e.tagName)||e.isContentEditable===!0}const yc=new WeakSet;function bc(e){return t=>{t.key===`Enter`&&e(t)}}function xc(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}const Sc=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=bc(()=>{if(yc.has(n))return;xc(n,`down`);let e=bc(()=>{xc(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>xc(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Cc(e){return mc(e)&&!cc()}const wc=new WeakSet;function Tc(e,t,n={}){let[r,i,a]=uc(e,n),o=e=>{let r=e.currentTarget;if(!Cc(e)||wc.has(e))return;yc.add(r),n.stopPropagation&&wc.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),yc.has(r)&&yc.delete(r),Cc(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||pc(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),ac(e)&&(e.addEventListener(`focus`,e=>Sc(e,i)),!gc(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Ec(e){return Hr(e)&&`ownerSVGElement`in e}const Dc=new WeakMap;let Oc;const kc=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Ec(r)&&`getBBox`in r?r.getBBox()[t]:r[n],Ac=kc(`inline`,`width`,`offsetWidth`),jc=kc(`block`,`height`,`offsetHeight`);function Mc({target:e,borderBoxSize:t}){Dc.get(e)?.forEach(n=>{n(e,{get width(){return Ac(e,t)},get height(){return jc(e,t)}})})}function Nc(e){e.forEach(Mc)}function Pc(){typeof ResizeObserver>`u`||(Oc=new ResizeObserver(Nc))}function Fc(e,t){Oc||Pc();let n=rc(e);return n.forEach(e=>{let n=Dc.get(e);n||(n=new Set,Dc.set(e,n)),n.add(t),Oc?.observe(e)}),()=>{n.forEach(e=>{let n=Dc.get(e);n?.delete(t),n?.size||Oc?.unobserve(e)})}}const Ic=new Set;let Lc;function Rc(){Lc=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Ic.forEach(t=>t(e))},window.addEventListener(`resize`,Lc)}function zc(e){return Ic.add(e),Lc||Rc(),()=>{Ic.delete(e),!Ic.size&&typeof Lc==`function`&&(window.removeEventListener(`resize`,Lc),Lc=void 0)}}function Bc(e,t){return typeof e==`function`?zc(e):Fc(e,t)}const Vc={value:null,addProjectionMetrics:null};function Hc(e){return Ec(e)&&e.tagName===`svg`}const Uc=[...zs,U,W],Wc=e=>Uc.find(Rs(e)),Gc=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kc=()=>({x:Gc(),y:Gc()}),qc=()=>({min:0,max:0}),Y=()=>({x:qc(),y:qc()}),Jc=new WeakMap;function Yc(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Xc(e){return typeof e==`string`||Array.isArray(e)}const Zc=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Qc=[`initial`,...Zc];function $c(e){return Yc(e.animate)||Qc.some(t=>Xc(e[t]))}function el(e){return!!($c(e)||e.variants)}function tl(e,t,n){for(let r in t){let i=t[r],a=n[r];if(q(i))e.addValue(r,i);else if(q(a))e.addValue(r,as(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,as(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}const nl={current:null},rl={current:!1},il=typeof window<`u`;function al(){if(rl.current=!0,il){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>nl.current=e.matches;e.addEventListener(`change`,t),t()}else nl.current=!1}}const ol=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`];let sl={};function cl(e){sl=e}function ll(){return sl}var ul=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Eo,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=z.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,L.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=$c(t),this.isVariantNode=el(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&q(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Jc.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(rl.current||al(),this.shouldReduceMotion=nl.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),vi(this.notifyUpdate),vi(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Jo.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new zo({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:F(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=po.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&L.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in sl){let t=sl[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Y()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ol.length;t++){let n=ol[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=tl(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=as(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Vr(n)||Ur(n))?n=parseFloat(n):!Wc(n)&&W.test(t)&&(n=Qs(e,t)),this.setBaseTarget(e,q(n)?n.get():n)),q(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=bs(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!q(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new qr),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){oc.render(this.render)}},dl=class extends ul{constructor(){super(...arguments),this.KeyframeResolver=tc}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;q(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},fl=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function pl({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function ml({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function hl(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function gl(e){return e===void 0||e===1}function _l({scale:e,scaleX:t,scaleY:n}){return!gl(e)||!gl(t)||!gl(n)}function vl(e){return _l(e)||yl(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yl(e){return bl(e.x)||bl(e.y)}function bl(e){return e&&e!==`0%`}function xl(e,t,n){return n+t*(e-n)}function Sl(e,t,n,r,i){return i!==void 0&&(e=xl(e,i,r)),xl(e,n,r)+t}function Cl(e,t=0,n=1,r,i){e.min=Sl(e.min,t,n,r,i),e.max=Sl(e.max,t,n,r,i)}function wl(e,{x:t,y:n}){Cl(e.x,t.translate,t.scale,t.originPoint),Cl(e.y,n.translate,n.scale,n.originPoint)}const Tl=.999999999999,El=1.0000000000001;function Dl(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(X(e.x,-a.scroll.offset.x),X(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,wl(e,o)),r&&vl(a.latestValues)&&Al(e,a.latestValues,a.layout?.layoutBox))}t.x<El&&t.x>Tl&&(t.x=1),t.y<El&&t.y>Tl&&(t.y=1)}function X(e,t){e.min+=t,e.max+=t}function Ol(e,t,n,r,i=.5){Cl(e,t,n,G(e.min,e.max,i),r)}function kl(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function Al(e,t,n){let r=n??e;Ol(e.x,kl(t.x,r.x),t.scaleX,t.scale,t.originX),Ol(e.y,kl(t.y,r.y),t.scaleY,t.scale,t.originY)}function jl(e,t){return pl(hl(e.getBoundingClientRect(),t))}function Ml(e,t,n){let r=jl(e,n),{scroll:i}=t;return i&&(X(r.x,i.offset.x),X(r.y,i.offset.y)),r}const Nl={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Pl=fo.length;function Fl(e,t,n){let r=``,i=!0;for(let a=0;a<Pl;a++){let o=fo[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=ic(s,Js[o]);if(!c){i=!1;let t=Nl[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${ic(a,Js.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Il(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(po.has(e)){o=!0;continue}if(Ci(e)){i[e]=n;continue}{let t=ic(n,Js[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Fl(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Ll(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Rl(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const zl={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(H.test(e))e=parseFloat(e);else return e}return`${Rl(e,t.target.x)}% ${Rl(e,t.target.y)}%`}},Bl={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=W.parse(e);if(i.length>5)return r;let a=W.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=G(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Vl={borderRadius:{...zl,applyTo:[...nc]},borderTopLeftRadius:zl,borderTopRightRadius:zl,borderBottomLeftRadius:zl,borderBottomRightRadius:zl,boxShadow:Bl};function Hl(e,{layout:t,layoutId:n}){return po.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Vl[e]||e===`opacity`)}function Ul(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(q(r[t])||i&&q(i[t])||Hl(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Wl(e){return window.getComputedStyle(e)}var Gl=class extends dl{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Ll}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(po.has(t))return this.projection?.isProjecting?so(t):lo(e,t);{let n=Wl(e),r=(Ci(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return jl(e,t)}build(e,t,n){Il(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ul(e,t,n)}};const Kl={offset:`stroke-dashoffset`,array:`stroke-dasharray`},ql={offset:`strokeDashoffset`,array:`strokeDasharray`};function Jl(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?Kl:ql;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const Yl=[`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Xl(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Il(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;d.transform&&(f.transform=d.transform,delete d.transform),(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox);for(let e of Yl)d[e]!==void 0&&(f[e]=d[e],delete d[e]);t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&Jl(d,i,a,o,!1)}const Zl=new Set([`baseFrequency`,`diffuseConstant`,`kernelMatrix`,`kernelUnitLength`,`keySplines`,`keyTimes`,`limitingConeAngle`,`markerHeight`,`markerWidth`,`numOctaves`,`targetX`,`targetY`,`surfaceScale`,`specularConstant`,`specularExponent`,`stdDeviation`,`tableValues`,`viewBox`,`gradientTransform`,`pathLength`,`startOffset`,`textLength`,`lengthAdjust`]),Ql=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function $l(e,t,n,r){Ll(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Zl.has(n)?n:ks(n),t.attrs[n])}function eu(e,t,n){let r=Ul(e,t,n);for(let n in e)if(q(e[n])||q(t[n])){let t=fo.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var tu=class extends dl{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=Y}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(po.has(t)){let e=Xs(t);return e&&e.default||0}return t=Zl.has(t)?t:ks(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return eu(e,t,n)}build(e,t,n){Xl(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){$l(e,t,n,r)}mount(e){this.isSVGTag=Ql(e.tagName),super.mount(e)}};const nu=Qc.length;function ru(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&ru(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<nu;n++){let r=Qc[n],i=e.props[r];(Xc(i)||i===!1)&&(t[r]=i)}return t}function iu(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const au=[...Zc].reverse(),ou=Zc.length;function su(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Is(e,t,n)))}function cu(e){let t=su(e),n=du(),r=!0,i=!1,a=t=>(n,r)=>{let i=xs(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=ru(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<ou;t++){let p=au[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Xc(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||Yc(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=lu(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Cs(t)&&Cs(n)?!iu(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let ee=v&&y;b&&(!ee||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!ee&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=xs(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=ts(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=xs(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=du(),i=!0}}}function lu(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!iu(t,e):!1}function uu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function du(){return{animate:uu(!0),whileInView:uu(),whileHover:uu(),whileTap:uu(),whileDrag:uu(),whileFocus:uu(),exit:uu()}}function fu(e,t){e.min=t.min,e.max=t.max}function Z(e,t){fu(e.x,t.x),fu(e.y,t.y)}function pu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Q(e){return e.max-e.min}function mu(e,t,n){return Math.abs(e-t)<=n}function hu(e,t,n,r=.5){e.origin=r,e.originPoint=G(t.min,t.max,e.origin),e.scale=Q(n)/Q(t),e.translate=G(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function gu(e,t,n,r){hu(e.x,t.x,n.x,r?r.originX:void 0),hu(e.y,t.y,n.y,r?r.originY:void 0)}function _u(e,t,n,r=0){e.min=(r?G(n.min,n.max,r):n.min)+t.min,e.max=e.min+Q(t)}function vu(e,t,n,r){_u(e.x,t.x,n.x,r?.x),_u(e.y,t.y,n.y,r?.y)}function yu(e,t,n,r=0){let i=r?G(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Q(t)}function bu(e,t,n,r){yu(e.x,t.x,n.x,r?.x),yu(e.y,t.y,n.y,r?.y)}function xu(e,t,n,r,i){return e-=t,e=xl(e,1/n,r),i!==void 0&&(e=xl(e,1/i,r)),e}function Su(e,t=0,n=1,r=.5,i,a=e,o=e){if(V.test(t)&&(t=parseFloat(t),t=G(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=G(a.min,a.max,r);e===a&&(s-=t),e.min=xu(e.min,t,n,s,i),e.max=xu(e.max,t,n,s,i)}function Cu(e,t,[n,r,i],a,o){Su(e,t[n],t[r],t[i],t.scale,a,o)}const wu=[`x`,`scaleX`,`originX`],Tu=[`y`,`scaleY`,`originY`];function Eu(e,t,n,r){Cu(e.x,t,wu,n?n.x:void 0,r?r.x:void 0),Cu(e.y,t,Tu,n?n.y:void 0,r?r.y:void 0)}function Du(e){return e.translate===0&&e.scale===1}function Ou(e){return Du(e.x)&&Du(e.y)}function ku(e,t){return e.min===t.min&&e.max===t.max}function Au(e,t){return ku(e.x,t.x)&&ku(e.y,t.y)}function ju(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Mu(e,t){return ju(e.x,t.x)&&ju(e.y,t.y)}function Nu(e){return Q(e.x)/Q(e.y)}function Pu(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function $(e){return[e(`x`),e(`y`)]}function Fu(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}const Iu=nc.length,Lu=e=>typeof e==`string`?parseFloat(e):e,Ru=e=>typeof e==`number`||H.test(e);function zu(e,t,n,r,i,a){i?(e.opacity=G(0,n.opacity??1,Vu(r)),e.opacityExit=G(t.opacity??1,0,Hu(r))):a&&(e.opacity=G(t.opacity??1,n.opacity??1,r));for(let i=0;i<Iu;i++){let a=nc[i],o=Bu(t,a),s=Bu(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ru(o)===Ru(s)?(e[a]=Math.max(G(Lu(o),Lu(s),r),0),(V.test(s)||V.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=G(t.rotate||0,n.rotate||0,r))}function Bu(e,t){return e[t]===void 0?e.borderRadius:e[t]}const Vu=Uu(0,.5,ai),Hu=Uu(.5,.95,P);function Uu(e,t,n){return r=>r<e?0:r>t?1:n(Kr(e,t,r))}function Wu(e,t,n){let r=q(e)?e:as(e);return r.start(hs(``,r,t,n)),r.animation}function Gu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const Ku=(e,t)=>e.depth-t.depth;var qu=class{constructor(){this.children=[],this.isDirty=!1}add(e){Rr(this.children,e),this.isDirty=!0}remove(e){zr(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ku),this.isDirty=!1,this.children.forEach(e)}};function Ju(e,t){let n=z.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(vi(r),e(a-t))};return L.setup(r,!0),()=>vi(r)}function Yu(e){return q(e)?e.get():e}var Xu=class{constructor(){this.members=[]}add(e){Rr(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(zr(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(zr(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}};const Zu={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Qu={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},$u=[``,`X`,`Y`,`Z`];let ed=0;function td(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function nd(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=js(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,L,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&nd(r)}function rd({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=ed++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Vc.value&&(Qu.nodes=Qu.calculatedTargetDeltas=Qu.calculatedProjections=0),this.nodes.forEach(od),this.nodes.forEach(hd),this.nodes.forEach(gd),this.nodes.forEach(sd),Vc.addProjectionMetrics&&Vc.addProjectionMetrics(Qu)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new qu)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new qr),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Ec(t)&&!Hc(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;L.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Ju(i,250),Zu.hasAnimatedSinceResize&&(Zu.hasAnimatedSinceResize=!1,this.nodes.forEach(md)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Cd,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Mu(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...ss(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||md(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),vi(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(_d),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&nd(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(ud),this.nodes.forEach(ld);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(dd);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(fd),this.nodes.forEach(pd),this.nodes.forEach(id),this.nodes.forEach(ad)):this.nodes.forEach(dd),this.clearAllSnapshots();let e=z.now();R.delta=N(0,1e3/60,e-R.timestamp),R.timestamp=e,R.isProcessing=!0,yi.update.process(R),yi.preRender.process(R),yi.render.process(R),R.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,oc.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(cd),this.sharedNodes.forEach(vd)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,L.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){L.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Q(this.snapshot.measuredBox.x)&&!Q(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=Y(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Ou(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||vl(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Dd(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return Y();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(kd))){let{scroll:e}=this.root;e&&(X(t.x,e.offset.x),X(t.y,e.offset.y))}return t}removeElementScroll(e){let t=Y();if(Z(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Z(t,e),X(t.x,i.offset.x),X(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||Y();Z(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(X(r.x,-n.scroll.offset.x),X(r.y,-n.scroll.offset.y)),vl(n.latestValues)&&Al(r,n.latestValues,n.layout?.layoutBox)}return vl(this.latestValues)&&Al(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=Y();Z(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!vl(n.latestValues))continue;let r;n.instance&&(_l(n.latestValues)&&n.updateSnapshot(),r=Y(),Z(r,n.measurePageBox())),Eu(t,n.latestValues,n.snapshot?.layoutBox,r)}return vl(this.latestValues)&&Eu(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==R.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=R.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Y(),this.targetWithTransforms=Y()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),vu(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Z(this.target,this.layout.layoutBox),wl(this.target,this.targetDelta)):Z(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Vc.value&&Qu.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||_l(this.parent.latestValues)||yl(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Y(),this.relativeTargetOrigin=Y(),bu(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Z(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===R.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Z(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Dl(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=Y());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(pu(this.prevProjectionDelta.x,this.projectionDelta.x),pu(this.prevProjectionDelta.y,this.projectionDelta.y)),gu(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Pu(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pu(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Vc.value&&Qu.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kc(),this.projectionDelta=Kc(),this.projectionDeltaWithTransform=Kc()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Kc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=Y(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(Sd));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=G(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=G(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(yd(o.x,e.x,n),yd(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(bu(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),xd(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Au(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=Y(),Z(f,this.relativeTarget)),c&&(this.animationValues=a,zu(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(vi(this.pendingAnimation),void 0),this.pendingAnimation=L.update(()=>{Zu.hasAnimatedSinceResize=!0,this.motionValue||=as(0),this.motionValue.jump(0,!1),this.currentAnimation=Wu(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&Od(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||Y();let t=Q(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Q(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Z(t,n),Al(t,i),gu(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Xu),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&td(`z`,e,r,this.animationValues);for(let t=0;t<$u.length;t++)td(`rotate${$u[t]}`,e,r,this.animationValues),td(`skew${$u[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=Yu(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=Yu(t?.pointerEvents)||``),this.hasProjected&&!vl(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Fu(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Vl){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Vl[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?Yu(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ld),this.root.sharedNodes.clear()}}}function id(e){e.updateLayout()}function ad(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)$(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Q(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;fu(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else Od(i,t.layoutBox,n)&&$(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Q(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Kc();gu(o,n,t.layoutBox);let s=Kc();a?gu(s,e.applyTransform(r,!0),t.measuredBox):gu(s,n,t.layoutBox);let c=!Ou(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=Y();bu(s,t.layoutBox,i.layoutBox,o);let c=Y();bu(c,n,a.layoutBox,o),Mu(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function od(e){Vc.value&&Qu.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function sd(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function cd(e){e.clearSnapshot()}function ld(e){e.clearMeasurements()}function ud(e){e.isLayoutDirty=!0,e.updateLayout()}function dd(e){e.isLayoutDirty=!1}function fd(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function pd(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function md(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function hd(e){e.resolveTargetDelta()}function gd(e){e.calcProjection()}function _d(e){e.resetSkewAndRotation()}function vd(e){e.removeLeadSnapshot()}function yd(e,t,n){e.translate=G(t.translate,0,n),e.scale=G(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function bd(e,t,n,r){e.min=G(t.min,n.min,r),e.max=G(t.max,n.max,r)}function xd(e,t,n,r){bd(e.x,t.x,n.x,r),bd(e.y,t.y,n.y,r)}function Sd(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Cd={duration:.45,ease:[.4,0,.1,1]},wd=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Td=wd(`applewebkit/`)&&!wd(`chrome/`)?Math.round:P;function Ed(e){e.min=Td(e.min),e.max=Td(e.max)}function Dd(e){Ed(e.x),Ed(e.y)}function Od(e,t,n){return e===`position`||e===`preserve-aspect`&&!mu(Nu(t),Nu(n),.2)}function kd(e){return e!==e.root&&e.scroll?.wasRoot}const Ad=rd({attachResizeListener:(e,t)=>Gu(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),jd={current:void 0},Md=rd({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!jd.current){let e=new Ad({});e.mount(window),e.setOptions({layoutScroll:!0}),jd.current=e}return jd.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Nd=s({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Pd(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Fd(...e){return t=>{let n=!1,r=e.map(e=>{let r=Pd(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Pd(e[t],null)}}}}function Id(...e){return r.useCallback(Fd(...e),e)}var Ld=class extends r.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(ac(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=ac(e)&&e.offsetWidth||0,r=ac(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function Rd({children:e,isPresent:n,anchorX:i,anchorY:a,root:o,pop:s}){let c=m(),l=v(null),u=v({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:d}=f(Nd),p=Id(l,s===!1?void 0:e.props?.ref??e?.ref);return h(()=>{let{width:e,height:t,top:r,left:f,right:p,bottom:m,direction:h}=u.current;if(n||s===!1||!l.current||!e||!t)return;let g=h===`rtl`,_=i===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=a===`bottom`?`bottom: ${m}`:`top: ${r}`;l.current.dataset.motionPopId=c;let y=document.createElement(`style`);d&&(y.nonce=d);let b=o??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
111
117
|
[data-motion-pop-id="${c}"] {
|
|
112
118
|
position: absolute !important;
|
|
113
119
|
width: ${e}px !important;
|
|
@@ -115,5 +121,5 @@ let n=l(({className:n,...r},i)=>c(Bt,{ref:i,iconNode:t,className:Mt(`lucide-${Nt
|
|
|
115
121
|
${_}px !important;
|
|
116
122
|
${v}px !important;
|
|
117
123
|
}
|
|
118
|
-
`),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t(Od,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:r.cloneElement(e,{ref:p})})}const Ad=({children:e,initial:n,isPresent:i,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Er(jd),p=m(),h=v(i),g=v(a);Dr(()=>{h.current=i,g.current=a});let y=!0,b=_(()=>(y=!1,{id:p,initial:n,isPresent:i,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;a&&a()},register:e=>(f.set(e,!1),()=>{f.delete(e),!h.current&&!f.size&&g.current?.()})}),[i,f,a]);return s&&y&&(b={...b}),_(()=>{f.forEach((e,t)=>f.set(t,!1))},[i]),r.useEffect(()=>{!i&&!f.size&&a&&a()},[i]),e=t(kd,{pop:c===`popLayout`,isPresent:i,anchorX:l,anchorY:u,root:d,children:e}),t(Or.Provider,{value:b,children:e})};function jd(){return new Map}function Md(e=!0){let t=f(Or);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=m();p(()=>{if(e)return i(a)},[e]);let o=d(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const Nd=e=>e.key||``;function Pd(e){let t=[];return i.forEach(e,e=>{u(e)&&t.push(e)}),t}const Fd=({children:n,custom:r,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[p,m]=Md(c),h=_(()=>Pd(n),[n]),g=c&&!p?[]:h.map(Nd),b=v(!0),x=v(h),S=Er(()=>new Map),C=v(new Set),[w,T]=y(h),[E,D]=y(h);Dr(()=>{b.current=!1,x.current=h;for(let e=0;e<E.length;e++){let t=Nd(E[e]);g.includes(t)?(S.delete(t),C.current.delete(t)):S.get(t)!==!0&&S.set(t,!1)}},[E,g.length,g.join(`-`)]);let ee=[];if(h!==w){let e=[...h];for(let t=0;t<E.length;t++){let n=E[t],r=Nd(n);g.includes(r)||(e.splice(t,0,n),ee.push(n))}return s===`wait`&&ee.length&&(e=ee),D(Pd(e)),T(h),null}let{forceRender:te}=f(Tr);return t(e,{children:E.map(e=>{let n=Nd(e),f=c&&!p?!1:h===E||g.includes(n);return t(Ad,{isPresent:f,initial:!b.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:f?void 0:()=>{if(C.current.has(n))return;if(S.has(n))C.current.add(n),S.set(n,!0);else return;let e=!0;S.forEach(t=>{t||(e=!1)}),e&&(te?.(),D(x.current),c&&m?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},Id=s({strict:!1}),Ld={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]};let Rd=!1;function zd(){if(Rd)return;let e={};for(let t in Ld)e[t]={isEnabled:e=>Ld[t].some(t=>!!e[t])};$c(e),Rd=!0}function Bd(){return zd(),el()}function Vd(e){let t=Bd();for(let n in e)t[n]={...t[n],...e[n]};$c(t)}const Hd=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Ud(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Hd.has(e)}let Wd=e=>!Ud(e);function Gd(e){typeof e==`function`&&(Wd=t=>t.startsWith(`on`)?!Ud(t):e(t))}try{Gd(Ze(`@emotion/is-prop-valid`).default)}catch{}function Kd(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(q(e[i])||(Wd(i)||n===!0&&Ud(i)||!t&&!Ud(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}const qd=s({});function Jd(e,t){if(Wc(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Vc(t)?t:void 0,animate:Vc(n)?n:void 0}}return e.inherit===!1?{}:t}function Yd(e){let{initial:t,animate:n}=Jd(e,f(qd));return _(()=>({initial:t,animate:n}),[Xd(t),Xd(n)])}function Xd(e){return Array.isArray(e)?e.join(` `):e}const Zd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Qd(e,t,n){for(let r in t)!q(t[r])&&!Nl(r,n)&&(e[r]=t[r])}function $d({transformTemplate:e},t){return _(()=>{let n=Zd();return Dl(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ef(e,t){let n=e.style||{},r={};return Qd(r,n,e),Object.assign(r,$d(e,t)),r}function tf(e,t){let n={},r=ef(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const nf=()=>({...Zd(),attrs:{}});function rf(e,t,n,r){let i=_(()=>{let n=nf();return Vl(n,t,Ul(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Qd(t,e.style,e),i.style={...t,...i.style}}return i}const af=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function of(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(af.indexOf(e)>-1||/[A-Z]/u.test(e))}function sf(e,t,n,{latestValues:r},i,a=!1,s){let l=(s??of(e)?rf:tf)(t,r,i,e),u=Kd(t,typeof e==`string`,a),d=e===o?{}:{...u,...l,ref:n},{children:f}=t,p=_(()=>q(f)?f.get():f,[f]);return c(e,{...d,children:p})}function cf({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:lf(n,r,i,e),renderState:t()}}function lf(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Bu(a[e]);let{initial:o,animate:s}=e,c=Wc(e),l=Gc(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Bc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=ds(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const uf=e=>(t,n)=>{let r=f(qd),i=f(Or),a=()=>cf(e,t,r,i);return n?a():Er(a)},df=uf({scrapeMotionValuesFromProps:Pl,createRenderState:Zd}),ff=uf({scrapeMotionValuesFromProps:Gl,createRenderState:nf}),pf=Symbol.for(`motionComponentSymbol`);function mf(e,t,n){let r=v(n);h(()=>{r.current=n});let i=v(null);return d(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}const hf=s({});function gf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function _f(e,t,n,r,i,a){let{visualElement:o}=f(qd),s=f(Id),c=f(Or),l=f(wd),u=l.reducedMotion,d=l.skipAnimations,m=v(null),g=v(!1);r||=s.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),g.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let _=m.current,y=f(hf);_&&!_.projection&&i&&(_.type===`html`||_.type===`svg`)&&vf(m.current,n,i,y);let b=v(!1);h(()=>{_&&b.current&&_.update(n,c)});let x=n[xs],S=v(!!x&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return Dr(()=>{g.current=!0,_&&(b.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),S.current&&_.animationState&&_.animationState.animateChanges())}),p(()=>{_&&(!S.current&&_.animationState&&_.animationState.animateChanges(),S.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),!1),_.enteringChildren=void 0)}),_}function vf(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:yf(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&gf(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function yf(e){if(e)return e.options.allowProjection===!1?yf(e.parent):e.projection}function bf(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&Vd(a);let s=i?i===`svg`:of(e),c=s?ff:df;function u(i,l){let u,d={...f(wd),...i,layoutId:xf(i)},{isStatic:p}=d,m=Yd(i),h=c(i,p);if(!p&&typeof window<`u`){Sf(d,a);let t=Cf(d);u=t.MeasureLayout,m.visualElement=_f(e,h,d,o,t.ProjectionNode,s)}return n(qd.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,sf(e,i,mf(h,m.visualElement,l),h,p,r,s)]})}u.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let d=l(u);return d[pf]=e,d}function xf({layoutId:e}){let t=f(Tr).id;return t&&e!==void 0?t+`-`+e:e}function Sf(e,t){f(Id).strict}function Cf(e){let{drag:t,layout:n}=Bd();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function wf(e,t){if(typeof Proxy>`u`)return bf;let n=new Map,r=(n,r)=>bf(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,bf(a,void 0,e,t)),n.get(a))})}const Tf=(e,t)=>t.isSVG??of(e)?new Kl(t):new Il(t,{allowProjection:e!==o});var Ef=class extends rl{constructor(e){super(e),e.animationState||=$l(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Bc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let Df=0;const Of={animation:{Feature:Ef},exit:{Feature:class extends rl{constructor(){super(...arguments),this.id=Df++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=fs(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function kf(e){return{point:{x:e.pageX,y:e.pageY}}}const Af=e=>t=>ac(t)&&e(t,kf(t));function jf(e,t,n,r){return Iu(e,t,Af(n),r)}const Mf=({current:e})=>e?e.ownerDocument.defaultView:null,Nf=(e,t)=>Math.abs(e-t);function Pf(e,t){let n=Nf(e.x,t.x),r=Nf(e.y,t.y);return Math.sqrt(n**2+r**2)}const Ff=new Set([`auto`,`scroll`]);var If=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Lf(this.lastRawMoveEventInfo,this.transformPagePoint));let e=zf(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Pf(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=R;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Lf(t,this.transformPagePoint),L.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=zf(e.type===`pointercancel`?this.lastMoveEventInfo:Lf(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!ac(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Lf(kf(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=R;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,zf(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Ir(jf(this.contextWindow,`pointermove`,this.handlePointerMove,d),jf(this.contextWindow,`pointerup`,this.handlePointerUp,d),jf(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Ff.has(e.overflowX)||Ff.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),li(this.updatePoint)}};function Lf(e,t){return t?{point:t(e.point)}:e}function Rf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zf({point:e},t){return{point:e,delta:Rf(e,Vf(t)),offset:Rf(e,Bf(t)),velocity:Hf(t,.1)}}function Bf(e){return e[0]}function Vf(e){return e[e.length-1]}function Hf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Vf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>F(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>F(t)*2&&(r=e[1]);let a=I(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Uf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?G(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?G(n,e,r.max):Math.min(e,n)),e}function Wf(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function Gf(e,{top:t,left:n,bottom:r,right:i}){return{x:Wf(e.x,n,i),y:Wf(e.y,t,r)}}function Kf(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function qf(e,t){return{x:Kf(e.x,t.x),y:Kf(e.y,t.y)}}function Jf(e,t){let n=.5,r=Q(e),i=Q(t);return i>r?n=Lr(t.min,t.max-r,e.min):r>i&&(n=Lr(e.min,e.max-i,t.min)),N(0,1,n)}function Yf(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Xf=.35;function Zf(e=Xf){return e===!1?e=0:e===!0&&(e=Xf),{x:Qf(e,`left`,`right`),y:Qf(e,`top`,`bottom`)}}function Qf(e,t,n){return{min:$f(e,t),max:$f(e,n)}}function $f(e,t){return typeof e==`number`?e:e[t]||0}const ep=new WeakMap;var tp=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Y(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(kf(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=ec(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$(e=>{let t=this.getAxisMotionValue(e).get()||0;if(V.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Q(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&L.update(()=>i(e,t),!1,!0),ys(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=ap(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&L.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new If(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Mf(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&L.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!ip(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Uf(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&gf(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?Gf(n.layoutBox,e):!1,this.elastic=Zf(t),r!==this.constraints&&!gf(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&$(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=Yf(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!gf(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Cl(n,r.root,this.visualElement.getTransformPagePoint()),a=qf(r.layout.layoutBox,i);if(t){let e=t(al(a));this.hasMutatedConstraints=!!e,e&&(a=il(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=$(o=>{if(!ip(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return ys(this.visualElement,e),n.start(os(e,n,0,t,this.visualElement,!1))}stopAnimation(){$(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){$(t=>{let{drag:n}=this.getProps();if(!ip(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-G(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!gf(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};$(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=Jf({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),$(t=>{if(!ip(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(G(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;ep.set(this.visualElement,this);let e=this.visualElement.current,t=jf(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&lc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();gf(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=rp(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),L.read(r);let o=Iu(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=Xf,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function np(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function rp(e,t,n){let r=jc(e,np(n)),i=jc(t,np(n));return()=>{r(),i()}}function ip(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function ap(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var op=class extends rl{constructor(e){super(e),this.removeGroupControls=P,this.removeListeners=P,this.controls=new tp(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||P}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const sp=e=>(t,n)=>{e&&L.update(()=>e(t,n),!1,!0)};var cp=class extends rl{constructor(){super(...arguments),this.removePointerDownListener=P}onPointerDown(e){this.session=new If(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Mf(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:sp(e),onStart:sp(t),onMove:sp(n),onEnd:(e,t)=>{delete this.session,r&&L.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=jf(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let lp=!1;var up=class extends a{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),lp&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Hu.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),lp=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||L.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),Zs.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;lp=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function dp(e){let[n,r]=Md(),i=f(Tr);return t(up,{...e,layoutGroup:i,switchLayoutGroup:f(hf),isPresent:n,safeToRemove:r})}const fp={pan:{Feature:cp},drag:{Feature:op,ProjectionNode:Cd,MeasureLayout:dp}};function pp(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&L.postRender(()=>i(t,kf(t)))}var mp=class extends rl{mount(){let{current:e}=this.node;e&&(this.unmount=rc(e,(e,t)=>(pp(this.node,t,`Start`),e=>pp(this.node,e,`End`))))}unmount(){}},hp=class extends rl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Ir(Iu(this.node.current,`focus`,()=>this.onFocus()),Iu(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function gp(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&L.postRender(()=>i(t,kf(t)))}var _p=class extends rl{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=gc(e,(e,t)=>(gp(this.node,t,`Start`),(e,{success:t})=>gp(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const vp=new WeakMap,yp=new WeakMap,bp=e=>{let t=vp.get(e.target);t&&t(e)},xp=e=>{e.forEach(bp)};function Sp({root:e,...t}){let n=e||document;yp.has(n)||yp.set(n,{});let r=yp.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(xp,{root:e,...t})),r[i]}function Cp(e,t,n){let r=Sp(t);return vp.set(e,n),r.observe(e),()=>{vp.delete(e),r.unobserve(e)}}const wp={some:0,all:1};var Tp=class extends rl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:wp[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Cp(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Ep(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Ep({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Dp={inView:{Feature:Tp},tap:{Feature:_p},focus:{Feature:hp},hover:{Feature:mp}},Op={layout:{ProjectionNode:Cd,MeasureLayout:dp}},kp=wf({...Of,...Dp,...fp,...Op},Tf);function Ap({icon:e}){let{isLoading:n,authToken:r}=O(),[i,a]=y(!0);return p(()=>{n||a(!1)},[n]),r?null:t(Fd,{children:i&&t(kp.div,{style:{zIndex:999999,position:`fixed`,inset:0},className:`fixed inset-x-0 inset-y-0`,initial:{opacity:1},exit:{opacity:0},transition:{ease:`easeIn`,duration:.5},children:t(`div`,{style:{display:`flex`,width:`100%`,height:`100%`,alignItems:`center`,justifyContent:`center`},className:`flex w-full h-full items-center justify-center`,children:t(`div`,{className:`animate-[spin_4s_linear_infinite]`,children:t(`div`,{className:`animate-pulse rounded-full bg-transparent`,children:e||t(jp,{})})})})})})}function jp(){return n(`svg`,{width:`32`,height:`32`,className:`w-8 h-8 text-info`,viewBox:`0 0 50 50`,xmlns:`http://www.w3.org/2000/svg`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`defs`,{children:n(`linearGradient`,{id:`spinner-gradient`,x1:`1`,y1:`0`,x2:`0`,y2:`1`,children:[t(`stop`,{offset:`0%`,stopColor:`currentColor`,stopOpacity:`1`}),t(`stop`,{offset:`100%`,stopColor:`currentColor`,stopOpacity:`0`})]})}),t(`circle`,{cx:`25`,cy:`25`,r:`20`,stroke:`url(#spinner-gradient)`,strokeWidth:`5`,fill:`none`,strokeLinecap:`round`})]})}function Mp({children:r,lightLogo:i,darkLogo:a,loadingIcon:o,loadOnboardingStatus:s,preserveSignInPath:c,suppressSignInErrorPrefixes:l,authToken:u,defaultLanguage:d}){let f=t(qe,{children:t(fe,{defaultTheme:`system`,storageKey:`vite-ui-theme`,children:t(Fe,{defaultLanguage:d,children:n(Pe,{children:[t(jt,{}),!u&&n(e,{children:[t(Ap,{icon:o}),t(sr,{allowedPrefix:`/shared/`,darkLogo:a,lightLogo:i,preservePath:c,suppressAuthErrorPrefix:l})]}),t(Je,{loadingIcon:o,children:r})]})})})});return t(pe,{children:u?t(be,{token:u,children:f}):t(De,{loadOnboardingStatus:s,children:f})})}export{Qe as AppInstallationContext,$e as AppInstallationProvider,tt as AppProjectSelector,gt as IFRAME_APP_CONTENT_SLOT,dt as IFRAME_APP_CONTEXT,ut as IFRAME_APP_CONTEXT_REQUEST,ht as IFRAME_APP_HOST_ORIGIN_PARAM,pt as IFRAME_APP_LOCATION_CHANGE,ft as IFRAME_APP_NAVIGATE,mt as IFRAME_APP_SLOT_PARAM,ct as IFRAME_AUTH_REQUEST,lt as IFRAME_AUTH_RESPONSE,jt as IframeAppContextSync,en as InviteAcceptModal,sr as SigninScreen,Xt as StandaloneApp,Zt as StandaloneAppImpl,mr as TerminalLogin,Sr as UserSessionMenu,Mp as VertesiaShell,bt as isIframeAppContext,yt as isIframeAppContextRequest,St as isIframeAppLocationChange,xt as isIframeAppNavigate,_t as isIframeAuthRequest,vt as isIframeAuthResponse,wr as isVertesiaEmail,kt as requestIframeHostAuthToken,Ot as resolveIframeHostOrigin,et as useAppInstallation};
|
|
124
|
+
`),()=>{l.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[n]),t(Ld,{isPresent:n,childRef:l,sizeRef:u,pop:s,children:s===!1?e:r.cloneElement(e,{ref:p})})}const zd=({children:e,initial:n,isPresent:i,onExitComplete:a,custom:o,presenceAffectsLayout:s,mode:c,anchorX:l,anchorY:u,root:d})=>{let f=Fr(Bd),p=m(),h=v(i),g=v(a);Ir(()=>{h.current=i,g.current=a});let y=!0,b=_(()=>(y=!1,{id:p,initial:n,isPresent:i,custom:o,onExitComplete:e=>{f.set(e,!0);for(let e of f.values())if(!e)return;a&&a()},register:e=>(f.set(e,!1),()=>{f.delete(e),!h.current&&!f.size&&g.current?.()})}),[i,f,a]);return s&&y&&(b={...b}),_(()=>{f.forEach((e,t)=>f.set(t,!1))},[i]),r.useEffect(()=>{!i&&!f.size&&a&&a()},[i]),e=t(Rd,{pop:c===`popLayout`,isPresent:i,anchorX:l,anchorY:u,root:d,children:e}),t(Lr.Provider,{value:b,children:e})};function Bd(){return new Map}function Vd(e=!0){let t=f(Lr);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=m();p(()=>{if(e)return i(a)},[e]);let o=d(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}const Hd=e=>e.key||``;function Ud(e){let t=[];return i.forEach(e,e=>{u(e)&&t.push(e)}),t}const Wd=({children:n,custom:r,initial:i=!0,onExitComplete:a,presenceAffectsLayout:o=!0,mode:s=`sync`,propagate:c=!1,anchorX:l=`left`,anchorY:u=`top`,root:d})=>{let[p,m]=Vd(c),h=_(()=>Ud(n),[n]),g=c&&!p?[]:h.map(Hd),b=v(!0),x=v(h),S=Fr(()=>new Map),C=v(new Set),[w,T]=y(h),[E,ee]=y(h);Ir(()=>{b.current=!1,x.current=h;for(let e=0;e<E.length;e++){let t=Hd(E[e]);g.includes(t)?(S.delete(t),C.current.delete(t)):S.get(t)!==!0&&S.set(t,!1)}},[E,g.length,g.join(`-`)]);let te=[];if(h!==w){let e=[...h];for(let t=0;t<E.length;t++){let n=E[t],r=Hd(n);g.includes(r)||(e.splice(t,0,n),te.push(n))}return s===`wait`&&te.length&&(e=te),ee(Ud(e)),T(h),null}let{forceRender:ne}=f(Pr);return t(e,{children:E.map(e=>{let n=Hd(e),f=c&&!p?!1:h===E||g.includes(n);return t(zd,{isPresent:f,initial:!b.current||i?void 0:!1,custom:r,presenceAffectsLayout:o,mode:s,root:d,onExitComplete:f?void 0:()=>{if(C.current.has(n))return;if(S.has(n))C.current.add(n),S.set(n,!0);else return;let e=!0;S.forEach(t=>{t||(e=!1)}),e&&(ne?.(),ee(x.current),c&&m?.(),a&&a())},anchorX:l,anchorY:u,children:e},n)})})},Gd=s({strict:!1}),Kd={animation:[`animate`,`variants`,`whileHover`,`whileTap`,`exit`,`whileInView`,`whileFocus`,`whileDrag`],exit:[`exit`],drag:[`drag`,`dragControls`],focus:[`whileFocus`],hover:[`whileHover`,`onHoverStart`,`onHoverEnd`],tap:[`whileTap`,`onTap`,`onTapStart`,`onTapCancel`],pan:[`onPan`,`onPanStart`,`onPanSessionStart`,`onPanEnd`],inView:[`whileInView`,`onViewportEnter`,`onViewportLeave`],layout:[`layout`,`layoutId`]};let qd=!1;function Jd(){if(qd)return;let e={};for(let t in Kd)e[t]={isEnabled:e=>Kd[t].some(t=>!!e[t])};cl(e),qd=!0}function Yd(){return Jd(),ll()}function Xd(e){let t=Yd();for(let n in e)t[n]={...t[n],...e[n]};cl(t)}const Zd=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function Qd(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||Zd.has(e)}let $d=e=>!Qd(e);function ef(e){typeof e==`function`&&($d=t=>t.startsWith(`on`)?!Qd(t):e(t))}try{ef($e(`@emotion/is-prop-valid`).default)}catch{}function tf(e,t,n){let r={};for(let i in e)(i!==`values`||typeof e.values!=`object`)&&(q(e[i])||($d(i)||n===!0&&Qd(i)||!t&&!Qd(i)||e.draggable&&i.startsWith(`onDrag`))&&(r[i]=e[i]));return r}const nf=s({});function rf(e,t){if($c(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Xc(t)?t:void 0,animate:Xc(n)?n:void 0}}return e.inherit===!1?{}:t}function af(e){let{initial:t,animate:n}=rf(e,f(nf));return _(()=>({initial:t,animate:n}),[of(t),of(n)])}function of(e){return Array.isArray(e)?e.join(` `):e}const sf=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function cf(e,t,n){for(let r in t)!q(t[r])&&!Hl(r,n)&&(e[r]=t[r])}function lf({transformTemplate:e},t){return _(()=>{let n=sf();return Il(n,t,e),Object.assign({},n.vars,n.style)},[t])}function uf(e,t){let n=e.style||{},r={};return cf(r,n,e),Object.assign(r,lf(e,t)),r}function df(e,t){let n={},r=uf(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const ff=()=>({...sf(),attrs:{}});function pf(e,t,n,r){let i=_(()=>{let n=ff();return Xl(n,t,Ql(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};cf(t,e.style,e),i.style={...t,...i.style}}return i}const mf=[`animate`,`circle`,`defs`,`desc`,`ellipse`,`g`,`image`,`line`,`filter`,`marker`,`mask`,`metadata`,`path`,`pattern`,`polygon`,`polyline`,`rect`,`stop`,`switch`,`symbol`,`svg`,`text`,`tspan`,`use`,`view`];function hf(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(mf.indexOf(e)>-1||/[A-Z]/u.test(e))}function gf(e,t,n,{latestValues:r},i,a=!1,s){let l=(s??hf(e)?pf:df)(t,r,i,e),u=tf(t,typeof e==`string`,a),d=e===o?{}:{...u,...l,ref:n},{children:f}=t,p=_(()=>q(f)?f.get():f,[f]);return c(e,{...d,children:p})}function _f({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:vf(n,r,i,e),renderState:t()}}function vf(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=Yu(a[e]);let{initial:o,animate:s}=e,c=$c(e),l=el(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!Yc(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=bs(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}const yf=e=>(t,n)=>{let r=f(nf),i=f(Lr),a=()=>_f(e,t,r,i);return n?a():Fr(a)},bf=yf({scrapeMotionValuesFromProps:Ul,createRenderState:sf}),xf=yf({scrapeMotionValuesFromProps:eu,createRenderState:ff}),Sf=Symbol.for(`motionComponentSymbol`);function Cf(e,t,n){let r=v(n);h(()=>{r.current=n});let i=v(null);return d(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}const wf=s({});function Tf(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Ef(e,t,n,r,i,a){let{visualElement:o}=f(nf),s=f(Gd),c=f(Lr),l=f(Nd),u=l.reducedMotion,d=l.skipAnimations,m=v(null),g=v(!1);r||=s.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),g.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let _=m.current,y=f(wf);_&&!_.projection&&i&&(_.type===`html`||_.type===`svg`)&&Df(m.current,n,i,y);let b=v(!1);h(()=>{_&&b.current&&_.update(n,c)});let x=n[As],S=v(!!x&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(x)&&window.MotionHasOptimisedAnimation?.(x));return Ir(()=>{g.current=!0,_&&(b.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),S.current&&_.animationState&&_.animationState.animateChanges())}),p(()=>{_&&(!S.current&&_.animationState&&_.animationState.animateChanges(),S.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(x)}),!1),_.enteringChildren=void 0)}),_}function Df(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Of(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&Tf(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Of(e){if(e)return e.options.allowProjection===!1?Of(e.parent):e.projection}function kf(e,{forwardMotionProps:r=!1,type:i}={},a,o){a&&Xd(a);let s=i?i===`svg`:hf(e),c=s?xf:bf;function u(i,l){let u,d={...f(Nd),...i,layoutId:Af(i)},{isStatic:p}=d,m=af(i),h=c(i,p);if(!p&&typeof window<`u`){jf(d,a);let t=Mf(d);u=t.MeasureLayout,m.visualElement=Ef(e,h,d,o,t.ProjectionNode,s)}return n(nf.Provider,{value:m,children:[u&&m.visualElement?t(u,{visualElement:m.visualElement,...d}):null,gf(e,i,Cf(h,m.visualElement,l),h,p,r,s)]})}u.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let d=l(u);return d[Sf]=e,d}function Af({layoutId:e}){let t=f(Pr).id;return t&&e!==void 0?t+`-`+e:e}function jf(e,t){f(Gd).strict}function Mf(e){let{drag:t,layout:n}=Yd();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Nf(e,t){if(typeof Proxy>`u`)return kf;let n=new Map,r=(n,r)=>kf(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,kf(a,void 0,e,t)),n.get(a))})}const Pf=(e,t)=>t.isSVG??hf(e)?new tu(t):new Gl(t,{allowProjection:e!==o});var Ff=class extends fl{constructor(e){super(e),e.animationState||=cu(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();Yc(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}};let If=0;const Lf={animation:{Feature:Ff},exit:{Feature:class extends fl{constructor(){super(...arguments),this.id=If++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=xs(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Rf(e){return{point:{x:e.pageX,y:e.pageY}}}const zf=e=>t=>mc(t)&&e(t,Rf(t));function Bf(e,t,n,r){return Gu(e,t,zf(n),r)}const Vf=({current:e})=>e?e.ownerDocument.defaultView:null,Hf=(e,t)=>Math.abs(e-t);function Uf(e,t){let n=Hf(e.x,t.x),r=Hf(e.y,t.y);return Math.sqrt(n**2+r**2)}const Wf=new Set([`auto`,`scroll`]);var Gf=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Kf(this.lastRawMoveEventInfo,this.transformPagePoint));let e=Jf(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Uf(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=R;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Kf(t,this.transformPagePoint),L.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=Jf(e.type===`pointercancel`?this.lastMoveEventInfo:Kf(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!mc(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Kf(Rf(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=R;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,Jf(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=Gr(Bf(this.contextWindow,`pointermove`,this.handlePointerMove,d),Bf(this.contextWindow,`pointerup`,this.handlePointerUp,d),Bf(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Wf.has(e.overflowX)||Wf.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),L.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),vi(this.updatePoint)}};function Kf(e,t){return t?{point:t(e.point)}:e}function qf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Jf({point:e},t){return{point:e,delta:qf(e,Xf(t)),offset:qf(e,Yf(t)),velocity:Zf(t,.1)}}function Yf(e){return e[0]}function Xf(e){return e[e.length-1]}function Zf(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Xf(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>F(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>F(t)*2&&(r=e[1]);let a=I(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Qf(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?G(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?G(n,e,r.max):Math.min(e,n)),e}function $f(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function ep(e,{top:t,left:n,bottom:r,right:i}){return{x:$f(e.x,n,i),y:$f(e.y,t,r)}}function tp(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function np(e,t){return{x:tp(e.x,t.x),y:tp(e.y,t.y)}}function rp(e,t){let n=.5,r=Q(e),i=Q(t);return i>r?n=Kr(t.min,t.max-r,e.min):r>i&&(n=Kr(e.min,e.max-i,t.min)),N(0,1,n)}function ip(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const ap=.35;function op(e=ap){return e===!1?e=0:e===!0&&(e=ap),{x:sp(e,`left`,`right`),y:sp(e,`top`,`bottom`)}}function sp(e,t,n){return{min:cp(e,t),max:cp(e,n)}}function cp(e,t){return typeof e==`number`?e:e[t]||0}const lp=new WeakMap;var up=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Y(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Rf(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=lc(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),$(e=>{let t=this.getAxisMotionValue(e).get()||0;if(V.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Q(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&L.update(()=>i(e,t),!1,!0),Os(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=mp(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&L.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Gf(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Vf(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&L.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!pp(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Qf(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Tf(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?ep(n.layoutBox,e):!1,this.elastic=op(t),r!==this.constraints&&!Tf(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&$(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=ip(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Tf(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=Ml(n,r.root,this.visualElement.getTransformPagePoint()),a=np(r.layout.layoutBox,i);if(t){let e=t(ml(a));this.hasMutatedConstraints=!!e,e&&(a=pl(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=$(o=>{if(!pp(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Os(this.visualElement,e),n.start(hs(e,n,0,t,this.visualElement,!1))}stopAnimation(){$(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){$(t=>{let{drag:n}=this.getProps();if(!pp(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-G(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!Tf(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};$(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=rp({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),$(t=>{if(!pp(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(G(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;lp.set(this.visualElement,this);let e=this.visualElement.current,t=Bf(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&vc(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();Tf(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=fp(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),L.read(r);let o=Gu(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&($(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=ap,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function dp(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function fp(e,t,n){let r=Bc(e,dp(n)),i=Bc(t,dp(n));return()=>{r(),i()}}function pp(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function mp(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var hp=class extends fl{constructor(e){super(e),this.removeGroupControls=P,this.removeListeners=P,this.controls=new up(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||P}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};const gp=e=>(t,n)=>{e&&L.update(()=>e(t,n),!1,!0)};var _p=class extends fl{constructor(){super(...arguments),this.removePointerDownListener=P}onPointerDown(e){this.session=new Gf(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Vf(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:gp(e),onStart:gp(t),onMove:gp(n),onEnd:(e,t)=>{delete this.session,r&&L.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=Bf(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};let vp=!1;var yp=class extends a{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),vp&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Zu.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),vp=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||L.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),oc.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;vp=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function bp(e){let[n,r]=Vd(),i=f(Pr);return t(yp,{...e,layoutGroup:i,switchLayoutGroup:f(wf),isPresent:n,safeToRemove:r})}const xp={pan:{Feature:_p},drag:{Feature:hp,ProjectionNode:Md,MeasureLayout:bp}};function Sp(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&L.postRender(()=>i(t,Rf(t)))}var Cp=class extends fl{mount(){let{current:e}=this.node;e&&(this.unmount=fc(e,(e,t)=>(Sp(this.node,t,`Start`),e=>Sp(this.node,e,`End`))))}unmount(){}},wp=class extends fl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=Gr(Gu(this.node.current,`focus`,()=>this.onFocus()),Gu(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function Tp(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&L.postRender(()=>i(t,Rf(t)))}var Ep=class extends fl{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Tc(e,(e,t)=>(Tp(this.node,t,`Start`),(e,{success:t})=>Tp(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}};const Dp=new WeakMap,Op=new WeakMap,kp=e=>{let t=Dp.get(e.target);t&&t(e)},Ap=e=>{e.forEach(kp)};function jp({root:e,...t}){let n=e||document;Op.has(n)||Op.set(n,{});let r=Op.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Ap,{root:e,...t})),r[i]}function Mp(e,t,n){let r=jp(t);return Dp.set(e,n),r.observe(e),()=>{Dp.delete(e),r.unobserve(e)}}const Np={some:0,all:1};var Pp=class extends fl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Np[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=Mp(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Fp(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Fp({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Ip={inView:{Feature:Pp},tap:{Feature:Ep},focus:{Feature:wp},hover:{Feature:Cp}},Lp={layout:{ProjectionNode:Md,MeasureLayout:bp}},Rp=Nf({...Lf,...Ip,...xp,...Lp},Pf);function zp({icon:e}){let{isLoading:n,authToken:r}=O(),[i,a]=y(!0);return p(()=>{n||a(!1)},[n]),r?null:t(Wd,{children:i&&t(Rp.div,{style:{zIndex:999999,position:`fixed`,inset:0},className:`fixed inset-x-0 inset-y-0`,initial:{opacity:1},exit:{opacity:0},transition:{ease:`easeIn`,duration:.5},children:t(`div`,{style:{display:`flex`,width:`100%`,height:`100%`,alignItems:`center`,justifyContent:`center`},className:`flex w-full h-full items-center justify-center`,children:t(`div`,{className:`animate-[spin_4s_linear_infinite]`,children:t(`div`,{className:`animate-pulse rounded-full bg-transparent`,children:e||t(Bp,{})})})})})})}function Bp(){return n(`svg`,{width:`32`,height:`32`,className:`w-8 h-8 text-info`,viewBox:`0 0 50 50`,xmlns:`http://www.w3.org/2000/svg`,role:`img`,"aria-label":`Loading`,children:[t(`title`,{children:`Loading`}),t(`defs`,{children:n(`linearGradient`,{id:`spinner-gradient`,x1:`1`,y1:`0`,x2:`0`,y2:`1`,children:[t(`stop`,{offset:`0%`,stopColor:`currentColor`,stopOpacity:`1`}),t(`stop`,{offset:`100%`,stopColor:`currentColor`,stopOpacity:`0`})]})}),t(`circle`,{cx:`25`,cy:`25`,r:`20`,stroke:`url(#spinner-gradient)`,strokeWidth:`5`,fill:`none`,strokeLinecap:`round`})]})}function Vp({children:r,lightLogo:i,darkLogo:a,loadingIcon:o,loadOnboardingStatus:s,preserveSignInPath:c,suppressSignInErrorPrefixes:l,authToken:u,defaultLanguage:d}){let f=t(Ye,{children:t(fe,{defaultTheme:`system`,storageKey:`vite-ui-theme`,children:t(Fe,{defaultLanguage:d,children:n(Pe,{children:[t(Nt,{}),!u&&n(e,{children:[t(zp,{icon:o}),t(gr,{allowedPrefix:`/shared/`,darkLogo:a,lightLogo:i,preservePath:c,suppressAuthErrorPrefix:l})]}),t(Xe,{loadingIcon:o,children:r})]})})})});return t(pe,{children:u?t(be,{token:u,children:f}):t(De,{loadOnboardingStatus:s,children:f})})}export{et as AppInstallationContext,tt as AppInstallationProvider,rt as AppProjectSelector,vt as IFRAME_APP_CONTENT_SLOT,pt as IFRAME_APP_CONTEXT,ft as IFRAME_APP_CONTEXT_REQUEST,_t as IFRAME_APP_HOST_ORIGIN_PARAM,ht as IFRAME_APP_LOCATION_CHANGE,mt as IFRAME_APP_NAVIGATE,gt as IFRAME_APP_SLOT_PARAM,ut as IFRAME_AUTH_REQUEST,dt as IFRAME_AUTH_RESPONSE,Nt as IframeAppContextSync,rn as InviteAcceptModal,gr as SigninScreen,$t as StandaloneApp,en as StandaloneAppImpl,Cr as TerminalLogin,jr as UserSessionMenu,Vp as VertesiaShell,St as isIframeAppContext,xt as isIframeAppContextRequest,wt as isIframeAppLocationChange,Ct as isIframeAppNavigate,yt as isIframeAuthRequest,bt as isIframeAuthResponse,Nr as isVertesiaEmail,jt as requestIframeHostAuthToken,At as resolveIframeHostOrigin,nt as useAppInstallation};
|
|
119
125
|
//# sourceMappingURL=vertesia-ui-shell.js.map
|