@decocms/mesh 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-zCOLtXNG.js → AlertCircle-DaEUMwle.js} +1 -1
- package/dist/client/assets/{ArrowLeft-b0UM4Vui.js → ArrowLeft-CvFDkdiU.js} +1 -1
- package/dist/client/assets/{Calendar-Cxw5FKll.js → Calendar-DBqzL4c-.js} +1 -1
- package/dist/client/assets/{CheckCircle-U8-nit8x.js → CheckCircle-CILz6OCh.js} +1 -1
- package/dist/client/assets/{ChevronDown-BFYjmmoG.js → ChevronDown-g4L12M9A.js} +1 -1
- package/dist/client/assets/{Clock-qZko4uak.js → Clock-C-uwthk9.js} +1 -1
- package/dist/client/assets/{Copy01-XN5V21c6.js → Copy01-CHjgpWtl.js} +1 -1
- package/dist/client/assets/{CpuChip02-Nhk4zHXl.js → CpuChip02-DlCI7cQJ.js} +1 -1
- package/dist/client/assets/{DotsVertical-CcNQsTaW.js → DotsVertical-CIfapH0j.js} +1 -1
- package/dist/client/assets/{File06-DB55FK-Z.js → File06-CBkqKj5m.js} +1 -1
- package/dist/client/assets/{GitBranch01-CM-ab6hS.js → GitBranch01-Ci5lqvRi.js} +1 -1
- package/dist/client/assets/{Inbox01-CIzt2AdR.js → Inbox01-DCkU3Xgq.js} +1 -1
- package/dist/client/assets/{InfoCircle-ChxTTkMX.js → InfoCircle-BwNsGATl.js} +1 -1
- package/dist/client/assets/{Key01-DYiMWoz_.js → Key01-5nxXQgMM.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CBZhTXC0.js → LinkExternal01-ISpHuMJE.js} +1 -1
- package/dist/client/assets/{Loading01-Dtm2TLlA.js → Loading01-r04aEG5T.js} +1 -1
- package/dist/client/assets/{Plus-DF_I5mml.js → Plus-CS_Y2Vnc.js} +1 -1
- package/dist/client/assets/{SearchMd-C_ak4ze3.js → SearchMd-1Gq7nypQ.js} +1 -1
- package/dist/client/assets/{Terminal-4DdepWh9.js → Terminal-DYN6gEAz.js} +1 -1
- package/dist/client/assets/{Trash01-FYPMjpVf.js → Trash01-DVxmznxT.js} +1 -1
- package/dist/client/assets/{Upload01-BYeEw9Vy.js → Upload01-Da0sGkRE.js} +1 -1
- package/dist/client/assets/{X-BTsWwO_U.js → X-BX0rl0N7.js} +1 -1
- package/dist/client/assets/{XClose-CY6vd_0A.js → XClose-BUuGHVgA.js} +1 -1
- package/dist/client/assets/{alert-dialog-DhxQ40TA.js → alert-dialog-DdP064l-.js} +1 -1
- package/dist/client/assets/{auth-CfgXQhXI.js → auth-AUS48lXs.js} +1 -1
- package/dist/client/assets/{auth-catchall-CohlC3Pb.js → auth-catchall-DqCIX1bA.js} +1 -1
- package/dist/client/assets/{avatar-CcUZFpwU.js → avatar-bcdjVFyi.js} +1 -1
- package/dist/client/assets/{badge-CgUwfcKq.js → badge-1WraHGEG.js} +1 -1
- package/dist/client/assets/{button-DuitHSR8.js → button-DodNLkpL.js} +1 -1
- package/dist/client/assets/{card-DkEpNms8.js → card-BHz-BqEu.js} +1 -1
- package/dist/client/assets/{checkbox-DTaSeum9.js → checkbox-Bj9jBMQF.js} +1 -1
- package/dist/client/assets/{collection-detail-Dvc6iyHF.js → collection-detail-QGbMDWA7.js} +1 -1
- package/dist/client/assets/{collection-display-button-DgDdVSTg.js → collection-display-button-475jHotV.js} +1 -1
- package/dist/client/assets/{collection-header-D-wXFMG4.js → collection-header-DcpyPzrC.js} +1 -1
- package/dist/client/assets/{collection-page-AFIAghtr.js → collection-page-DpUZNbpd.js} +1 -1
- package/dist/client/assets/{collection-search-OoKPetka.js → collection-search-DVBnlN6E.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DEVlTpj8.js → collection-table-wrapper-DQ4F9pbh.js} +1 -1
- package/dist/client/assets/{connection-card-CVX6Dj6b.js → connection-card-opsQBUfD.js} +1 -1
- package/dist/client/assets/{connection-detail-C_uPOJ6z.js → connection-detail-DpiL6xjK.js} +1 -1
- package/dist/client/assets/{connections-DoAE9QhX.js → connections-CeDc3J_o.js} +1 -1
- package/dist/client/assets/{core-BMfBj0bw.js → core-DJoPglro.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-C_xVF_Jl.js → create-organization-dialog-fbCy_hNu.js} +1 -1
- package/dist/client/assets/{dialog-Dl9CupEb.js → dialog-BqvvzTa7.js} +1 -1
- package/dist/client/assets/{dropdown-menu-CPQpNQmn.js → dropdown-menu-DrQKdl4f.js} +1 -1
- package/dist/client/assets/{env-vars-editor-BcyBU5xA.js → env-vars-editor-DEYac6H7.js} +1 -1
- package/dist/client/assets/{error-boundary-DMJQCmxn.js → error-boundary-CdmYlIj7.js} +1 -1
- package/dist/client/assets/{extract-connection-data-Bt1_1dQ8.js → extract-connection-data-Ty2DjF1e.js} +1 -1
- package/dist/client/assets/{form-BfiwCHdz.js → form-Bus-fIfC.js} +1 -1
- package/dist/client/assets/{formatDistanceToNow-BmkU67cZ.js → formatDistanceToNow-D46rGC8T.js} +1 -1
- package/dist/client/assets/{gateway-detail-ZknLelfM.js → gateway-detail-fCVh3_nF.js} +1 -1
- package/dist/client/assets/{gateways-BAQA-e5y.js → gateways-DQmZoxNy.js} +1 -1
- package/dist/client/assets/{home-BzOK0WeX.js → home-heelYyW2.js} +1 -1
- package/dist/client/assets/{index-CCNaUj2A.js → index-A52jfksK.js} +2 -2
- package/dist/client/assets/{index-DR-B7Y1Z.js → index-DDiLOLYT.js} +1 -1
- package/dist/client/assets/index-DKrh5SL2.css +1 -0
- package/dist/client/assets/{index-T7OaHK12.js → index-JV0IIYp6.js} +1 -1
- package/dist/client/assets/{index-be58e1VX.js → index-td_4XAxf.js} +1 -1
- package/dist/client/assets/{input-YU6lpVgW.js → input-BXHWk19m.js} +1 -1
- package/dist/client/assets/json-gPxhilNK.js +1 -0
- package/dist/client/assets/{json-syntax-highlighter-Dve1WRV4.js → json-syntax-highlighter-i1hiMNnF.js} +2 -2
- package/dist/client/assets/{layout-n40g10Oh.js → layout-dxbGsEKV.js} +1 -1
- package/dist/client/assets/{lazy-highlighter-BY_mRZdt.js → lazy-highlighter-QDCjbXst.js} +1 -1
- package/dist/client/assets/{localstorage-keys-BphvZ-YX.js → localstorage-keys-D7pZSS7H.js} +1 -1
- package/dist/client/assets/{login-CJi6KFGq.js → login-CcnR2b1q.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CvO1Z13d.js → mcp-oauth-D7V7V-GS.js} +1 -1
- package/dist/client/assets/{members-UHyk3Nn4.js → members-D5QtYSzf.js} +1 -1
- package/dist/client/assets/{monitoring-65mgE8O0.js → monitoring-Cp92YRPy.js} +1 -1
- package/dist/client/assets/{oauth-callback-KqixmXKf.js → oauth-callback-1_PgXFG_.js} +1 -1
- package/dist/client/assets/{page-DmmG4y1n.js → page-C8KGQPlY.js} +1 -1
- package/dist/client/assets/{popover-PTQF8Dbg.js → popover-MhzpcVkW.js} +1 -1
- package/dist/client/assets/prism-light-C-ukkBST.js +1 -0
- package/dist/client/assets/{resizable-BF9gWgPg.js → resizable-B3HA_CX4.js} +3 -3
- package/dist/client/assets/{resource-tabs-Dx5v9tHv.js → resource-tabs-ru5yaRIE.js} +1 -1
- package/dist/client/assets/{select-C4QWjnSz.js → select-Be0LRVWn.js} +1 -1
- package/dist/client/assets/{settings-UndPSfwX.js → settings-gZFi_2QA.js} +1 -1
- package/dist/client/assets/shell-layout-adVEIdhn.js +17 -0
- package/dist/client/assets/{spinner-CNb2mD_9.js → spinner-oZ2DO2-U.js} +1 -1
- package/dist/client/assets/store-DzO4PTg0.js +1 -0
- package/dist/client/assets/{store-app-detail-BQ4UUaoG.js → store-app-detail-BIXt1EdE.js} +1 -1
- package/dist/client/assets/{switch-BmVnuO_C.js → switch-DsCvClV8.js} +1 -1
- package/dist/client/assets/{tools-list-BV-qlQqF.js → tools-list-BsHebq88.js} +1 -1
- package/dist/client/assets/{tooltip-CqCXb38Z.js → tooltip-BjhP6ibY.js} +1 -1
- package/dist/client/assets/{types-Bm46njUN.js → types-D4T3qWDr.js} +1 -1
- package/dist/client/assets/{use-binding-DdwsXkNS.js → use-binding-CapMpNVF.js} +1 -1
- package/dist/client/assets/{use-connection-BbvAiBvg.js → use-connection-BX5-4xHw.js} +1 -1
- package/dist/client/assets/{use-connection-resources-D-1-SK-8.js → use-connection-resources-FqHsvBSA.js} +1 -1
- package/dist/client/assets/{use-gateway-L1UQyU7-.js → use-gateway-CseaalWF.js} +1 -1
- package/dist/client/assets/{use-list-state-DVYCFUpb.js → use-list-state-7NLbXyOC.js} +1 -1
- package/dist/client/assets/{use-mcp-CWOlOW9q.js → use-mcp-M6XXMHar.js} +1 -1
- package/dist/client/assets/{use-members-Dyh_-7GU.js → use-members-DzZB15s9.js} +1 -1
- package/dist/client/assets/{use-mobile-B0xRFGhT.js → use-mobile-TpeNqylz.js} +1 -1
- package/dist/client/assets/{use-organization-settings-fWTyw7VB.js → use-organization-settings-BAhAEDx8.js} +1 -1
- package/dist/client/assets/{use-tool-call-CVPTtLoG.js → use-tool-call-CQCb5PBf.js} +1 -1
- package/dist/client/assets/useQuery-ojqdZMTH.js +1 -0
- package/dist/client/assets/utils-DgLfrg3u.js +1 -0
- package/dist/client/assets/{view-mode-toggle-DOtHoBLN.js → view-mode-toggle-DAXMt6ZW.js} +1 -1
- package/dist/client/assets/well-known-mcp-BPQQU1v0.js +1 -0
- package/dist/client/empty-state-openrouter.svg +320 -0
- package/dist/client/emptystate-mcp.svg +26 -70
- package/dist/client/index.html +2 -2
- package/dist/client/store-empty-state.svg +96 -349
- package/dist/server/cli.js +112 -112
- package/dist/server/server.js +105 -105
- package/package.json +1 -1
- package/dist/client/assets/index-Dgn6D_6Q.css +0 -1
- package/dist/client/assets/json-BnmF_c7J.js +0 -1
- package/dist/client/assets/prism-light-0RxCg8xt.js +0 -1
- package/dist/client/assets/shell-layout-BLjMALRt.js +0 -17
- package/dist/client/assets/store-CGyOcqhE.js +0 -1
- package/dist/client/assets/useQuery-C4GPpw7d.js +0 -1
- package/dist/client/assets/utils-o1atviYh.js +0 -1
- package/dist/client/assets/well-known-mcp-d1wcdFCF.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as te,j as t,r as se,f as ae,t as re}from"./index-
|
|
1
|
+
import{c as te,j as t,r as se,f as ae,t as re}from"./index-A52jfksK.js";import{C as ie}from"./collection-header-DcpyPzrC.js";import{C as ne}from"./collection-page-DpUZNbpd.js";import{C as le}from"./collection-search-DVBnlN6E.js";import{C as ce}from"./collection-table-wrapper-DQ4F9pbh.js";import{C as de}from"./connection-card-opsQBUfD.js";import{E as q}from"./SearchMd-1Gq7nypQ.js";import{E as me}from"./error-boundary-CdmYlIj7.js";import{u as ue,I as ge}from"./use-connection-BX5-4xHw.js";import{a as pe,u as he}from"./use-gateway-CseaalWF.js";import{u as fe,s as Q}from"./use-list-state-7NLbXyOC.js";import{u as xe}from"./tooltip-BjhP6ibY.js";import{c as ye,b as we,d as je,A as Ce,e as Ne,g as De,a as Se,f as ve}from"./alert-dialog-DdP064l-.js";import{B as oe}from"./badge-1WraHGEG.js";import{B as J}from"./button-DodNLkpL.js";import{b as U,D as X,a as Y,d as B}from"./dropdown-menu-DrQKdl4f.js";import{i as y}from"./CpuChip02-DlCI7cQJ.js";import{i as Z}from"./DotsVertical-CIfapH0j.js";import{i as be}from"./Loading01-r04aEG5T.js";import{s as ee}from"./Trash01-DVxmznxT.js";import"./collection-display-button-475jHotV.js";import"./view-mode-toggle-DAXMt6ZW.js";import"./utils-DgLfrg3u.js";import"./input-BXHWk19m.js";import"./card-BHz-BqEu.js";import"./use-mobile-TpeNqylz.js";function ke(e,a){switch(a.type){case"delete":return{mode:"deleting",gateway:a.gateway};case"close":return{mode:"idle"}}}function _e(){const e=te.c(68),{org:a}=xe(),r=ae();let w;e[0]!==a.slug?(w={namespace:a.slug,resource:"gateways"},e[0]=a.slug,e[1]=w):w=e[1];const s=fe(w),i=pe(),x=he(s);let j;e[2]===Symbol.for("react.memo_cache_sentinel")?(j={},e[2]=j):j=e[2];const R=ue(j);let C;e[3]===Symbol.for("react.memo_cache_sentinel")?(C={mode:"idle"},e[3]=C):C=e[3];const[n,N]=se.useReducer(ke,C);let D;e[4]!==i.create||e[5]!==R.length||e[6]!==r||e[7]!==a.slug?(D=async()=>{if(R.length===0){re.error("Create at least one MCP connection first");return}const o=await i.create.mutateAsync({title:"New Gateway",description:"Gateways let you securely expose integrated tools to the outside world.",status:"active",tool_selection_strategy:"passthrough",tool_selection_mode:"inclusion",connections:[]});r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},e[4]=i.create,e[5]=R.length,e[6]=r,e[7]=a.slug,e[8]=D):D=e[8];const T=D;let S;e[9]!==i.delete||e[10]!==n.gateway||e[11]!==n.mode?(S=async()=>{if(n.mode!=="deleting")return;const o=n.gateway.id;N({type:"close"});try{await i.delete.mutateAsync(o)}catch{}},e[9]=i.delete,e[10]=n.gateway,e[11]=n.mode,e[12]=S):S=e[12];const O=S;let v,b,k,_,M,I;e[13]===Symbol.for("react.memo_cache_sentinel")?(b={id:"icon",header:"",render:Be,cellClassName:"w-16 shrink-0",wrap:!0},k={id:"title",header:"Name",render:Ke,cellClassName:"w-48 min-w-0 shrink-0",sortable:!0},_={id:"description",header:"Description",render:Ge,cellClassName:"flex-1 min-w-0",wrap:!0,sortable:!0},M={id:"mode",header:"Mode",accessor:Ee,cellClassName:"w-[100px]"},I={id:"connections",header:"Connections",render:Ae,cellClassName:"w-24 shrink-0"},v={id:"status",header:"Status",render:ze,cellClassName:"w-24 shrink-0",sortable:!0},e[13]=v,e[14]=b,e[15]=k,e[16]=_,e[17]=M,e[18]=I):(v=e[13],b=e[14],k=e[15],_=e[16],M=e[17],I=e[18]);let P;e[19]!==r||e[20]!==a.slug?(P=[b,k,_,M,I,v,{id:"actions",header:"",render:o=>t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:$e,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Pe,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],e[19]=r,e[20]=a.slug,e[21]=P):P=e[21];const V=P,H=i.create.isPending?"Creating...":"Create MCP Gateway";let $;e[22]!==i.create.isPending||e[23]!==T||e[24]!==H?($=t.jsx(J,{onClick:T,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:i.create.isPending,children:H}),e[22]=i.create.isPending,e[23]=T,e[24]=H,e[25]=$):$=e[25];const L=$,F=n.mode==="deleting";let z;e[26]===Symbol.for("react.memo_cache_sentinel")?(z=o=>!o&&N({type:"close"}),e[26]=z):z=e[26];let A;e[27]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(ye,{children:"Delete Gateway?"}),e[27]=A):A=e[27];const W=n.mode==="deleting"&&n.gateway.title;let c;e[28]!==W?(c=t.jsxs(we,{children:[A,t.jsxs(je,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:W}),"."]})]}),e[28]=W,e[29]=c):c=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(Ce,{children:"Cancel"}),e[30]=E):E=e[30];let d;e[31]!==O?(d=t.jsxs(Ne,{children:[E,t.jsx(De,{onClick:O,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]}),e[31]=O,e[32]=d):d=e[32];let m;e[33]!==c||e[34]!==d?(m=t.jsxs(Se,{children:[c,d]}),e[33]=c,e[34]=d,e[35]=m):m=e[35];let u;e[36]!==F||e[37]!==m?(u=t.jsx(ve,{open:F,onOpenChange:z,children:m}),e[36]=F,e[37]=m,e[38]=u):u=e[38];let G;e[39]===Symbol.for("react.memo_cache_sentinel")?(G=[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"status",label:"Status"}],e[39]=G):G=e[39];let g;e[40]!==L||e[41]!==s.handleSort||e[42]!==s.setViewMode||e[43]!==s.sortDirection||e[44]!==s.sortKey||e[45]!==s.viewMode?(g=t.jsx(ie,{title:"MCP Gateways",viewMode:s.viewMode,onViewModeChange:s.setViewMode,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,sortOptions:G,ctaButton:L}),e[40]=L,e[41]=s.handleSort,e[42]=s.setViewMode,e[43]=s.sortDirection,e[44]=s.sortKey,e[45]=s.viewMode,e[46]=g):g=e[46];let p;e[47]!==s?(p=o=>{o.key==="Escape"&&(s.setSearch(""),o.target.blur())},e[47]=s,e[48]=p):p=e[48];let h;e[49]!==s.search||e[50]!==s.setSearch||e[51]!==p?(h=t.jsx(le,{value:s.search,onChange:s.setSearch,placeholder:"Search for a gateway...",onKeyDown:p}),e[49]=s.search,e[50]=s.setSearch,e[51]=p,e[52]=h):h=e[52];let f;e[53]!==V||e[54]!==x||e[55]!==s.handleSort||e[56]!==s.search||e[57]!==s.sortDirection||e[58]!==s.sortKey||e[59]!==s.viewMode||e[60]!==r||e[61]!==a.slug?(f=s.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:x.length===0?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:s.search?"No gateways found":"No gateways yet",description:s.search?`No gateways match "${s.search}"`:"Create a gateway to aggregate tools from multiple MCP connections."}):t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-4",children:x.map(o=>t.jsx(de,{connection:{id:o.id,title:o.title,description:o.description,icon:o.icon,status:o.status},fallbackIcon:t.jsx(y,{}),onClick:()=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),footer:t.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[t.jsxs("span",{children:[o.connections.length," connection",o.connections.length!==1?"s":""]}),t.jsx("span",{children:"•"}),t.jsx("span",{children:o.tool_selection_mode==="exclusion"?"Exclude":"Include"})]}),headerActions:t.jsxs(U,{children:[t.jsx(X,{asChild:!0,children:t.jsx(J,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:Ie,children:t.jsx(Z,{size:20})})}),t.jsxs(Y,{align:"end",onClick:Me,children:[t.jsxs(B,{onClick:l=>{l.stopPropagation(),r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}})},children:[t.jsx(Q,{size:16}),"Inspect"]}),t.jsxs(B,{variant:"destructive",onClick:l=>{l.stopPropagation(),N({type:"delete",gateway:o})},children:[t.jsx(ee,{size:16}),"Delete"]})]})]})},o.id))})}):t.jsx(ce,{columns:V,data:x,isLoading:!1,sortKey:s.sortKey,sortDirection:s.sortDirection,onSort:s.handleSort,onRowClick:o=>r({to:"/$org/gateways/$gatewayId",params:{org:a.slug,gatewayId:o.id}}),emptyState:s.search?t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways found",description:`No gateways match "${s.search}"`}):t.jsx(q,{image:t.jsx(y,{size:36,className:"text-muted-foreground"}),title:"No gateways yet",description:"Create a gateway to aggregate tools from multiple MCP connections."})}),e[53]=V,e[54]=x,e[55]=s.handleSort,e[56]=s.search,e[57]=s.sortDirection,e[58]=s.sortKey,e[59]=s.viewMode,e[60]=r,e[61]=a.slug,e[62]=f):f=e[62];let K;return e[63]!==u||e[64]!==g||e[65]!==h||e[66]!==f?(K=t.jsxs(ne,{children:[u,g,h,f]}),e[63]=u,e[64]=g,e[65]=h,e[66]=f,e[67]=K):K=e[67],K}function Me(e){return e.stopPropagation()}function Ie(e){return e.stopPropagation()}function Pe(e){return e.stopPropagation()}function $e(e){return e.stopPropagation()}function ze(e){return t.jsx(oe,{variant:e.status==="active"?"default":"outline",children:e.status})}function Ae(e){return t.jsx("span",{className:"text-sm text-muted-foreground",children:e.connections.length})}function Ee(e){return t.jsx(oe,{variant:"outline",className:"text-xs",children:e.tool_selection_mode==="exclusion"?"Exclude":"Include"})}function Ge(e){return t.jsx("span",{className:"text-sm text-foreground line-clamp-2",children:e.description||"—"})}function Ke(e){return t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:e.title})}function Be(e){return t.jsx(ge,{icon:e.icon,name:e.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(y,{size:16})})}function mt(){const e=te.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(me,{children:t.jsx(se.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(be,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(_e,{})})}),e[0]=a):a=e[0],a}export{mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as u,j as i,a as w,r as C,f as E}from"./index-CCNaUj2A.js";import{C as _}from"./card-DkEpNms8.js";import{c as v}from"./utils-o1atviYh.js";import{A as $}from"./avatar-CcUZFpwU.js";import{i as k}from"./AlertCircle-zCOLtXNG.js";import{s as A}from"./Plus-DF_I5mml.js";import{B as O}from"./button-DuitHSR8.js";import{I as L}from"./input-YU6lpVgW.js";import{C as D}from"./create-organization-dialog-C_xVF_Jl.js";import"./alert-dialog-DhxQ40TA.js";import"./form-BfiwCHdz.js";import"./spinner-CNb2mD_9.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let a;e[0]!==s?(a=p=>{s&&s(p)},e[0]=s,e[1]=a):a=e[1];const d=a,m=s&&"cursor-pointer",o=x&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==m||e[4]!==o?(c=v("group transition-all flex flex-col gap-0",m,o,l),e[2]=l,e[3]=m,e[4]=o,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==d||e[8]!==c?(g=i.jsx(_,{className:c,onClick:d,children:n}),e[6]=n,e[7]=d,e[8]=c,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:a}=t,d=s===void 0?"square":s,m=r===void 0?"lg":r,o=x===void 0?"contain":x;let c;return e[0]!==a||e[1]!==l||e[2]!==o||e[3]!==d||e[4]!==m||e[5]!==n?(c=i.jsx($,{url:n,fallback:l,shape:d,size:m,objectFit:o,className:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=d,e[4]=m,e[5]=n,e[6]=c):c=e[6],c}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const a=x,m=P[s===void 0?4:s],o=a.sm&&V[a.sm],c=a.md&&X[a.md],g=a.lg&&J[a.lg],p=a.xl&&K[a.xl],j=a["2xl"]&&U[a["2xl"]];let h;e[2]!==r||e[3]!==m||e[4]!==o||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",m,o,c,g,p,j,r),e[2]=r,e[3]=m,e[4]=o,e[5]=c,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let a;e[0]!==l?(a=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=a):a=e[1];const d=a,m=s===void 0?4:s;let o;e[2]!==x?(o=Array.from({length:x}).map(Y),e[2]=x,e[3]=o):o=e[3];let c;return e[4]!==r||e[5]!==d||e[6]!==m||e[7]!==o?(c=i.jsx(z,{columns:d,gap:m,className:r,children:o}),e[4]=r,e[5]=d,e[6]=m,e[7]=o,e[8]=c):c=e[8],c}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const o=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(o)||c.slug.toLowerCase().includes(o))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=o):o=e[3],o}if(x.length===0){let o;return e[4]!==n?(o=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=o):o=e[5],o}let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a={sm:2,md:3,lg:4},e[6]=a):a=e[6];let d;if(e[7]!==x||e[8]!==s){let o;e[10]!==s?(o=c=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:c.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",c.slug]}),i.jsx(b.Title,{children:c.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=s,e[11]=o):o=e[11],d=x.map(o),e[7]=x,e[8]=s,e[9]=d}else d=e[9];let m;return e[12]!==d?(m=i.jsx(S,{columns:a,children:d}),e[12]=d,e[13]=m):m=e[13],m}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(k,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),a=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=d):d=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=f=>s(f.target.value),t[5]=m):m=t[5];let o;t[6]!==l?(o=i.jsx(L,{className:"max-w-xs",placeholder:"Search",value:l,onChange:m}),t[6]=l,t[7]=o):o=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs(O,{variant:"default",onClick:()=>x(!0),children:[i.jsx(A,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=c):c=t[8];let g;t[9]!==o?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d,i.jsxs("div",{className:"flex items-center gap-2",children:[o,c]})]}),t[9]=o,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==a?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:a})})}),t[12]=a,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function ue(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{ue as default};
|
|
1
|
+
import{c as u,j as i,a as w,r as C,f as E}from"./index-A52jfksK.js";import{C as _}from"./card-BHz-BqEu.js";import{c as v}from"./utils-DgLfrg3u.js";import{A as $}from"./avatar-bcdjVFyi.js";import{i as k}from"./AlertCircle-DaEUMwle.js";import{s as A}from"./Plus-CS_Y2Vnc.js";import{B as O}from"./button-DodNLkpL.js";import{I as L}from"./input-BXHWk19m.js";import{C as D}from"./create-organization-dialog-fbCy_hNu.js";import"./alert-dialog-DdP064l-.js";import"./form-Bus-fIfC.js";import"./spinner-oZ2DO2-U.js";function F(t){const e=u.c(10),{children:n,className:l,onNavigate:s,showHoverRing:r}=t,x=r===void 0?!1:r;let a;e[0]!==s?(a=p=>{s&&s(p)},e[0]=s,e[1]=a):a=e[1];const d=a,m=s&&"cursor-pointer",o=x&&"hover:ring-2 hover:ring-primary";let c;e[2]!==l||e[3]!==m||e[4]!==o?(c=v("group transition-all flex flex-col gap-0",m,o,l),e[2]=l,e[3]=m,e[4]=o,e[5]=c):c=e[5];let g;return e[6]!==n||e[7]!==d||e[8]!==c?(g=i.jsx(_,{className:c,onClick:d,children:n}),e[6]=n,e[7]=d,e[8]=c,e[9]=g):g=e[9],g}function H(t){const e=u.c(7),{url:n,fallback:l,shape:s,size:r,objectFit:x,className:a}=t,d=s===void 0?"square":s,m=r===void 0?"lg":r,o=x===void 0?"contain":x;let c;return e[0]!==a||e[1]!==l||e[2]!==o||e[3]!==d||e[4]!==m||e[5]!==n?(c=i.jsx($,{url:n,fallback:l,shape:d,size:m,objectFit:o,className:a}),e[0]=a,e[1]=l,e[2]=o,e[3]=d,e[4]=m,e[5]=n,e[6]=c):c=e[6],c}function R(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function B(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("font-medium truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("p",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function G(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("h3",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex flex-col gap-[2px]",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function I(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex justify-between items-start",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function M(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function Q(t){const e=u.c(5),{children:n,className:l}=t;let s;e[0]!==l?(s=v("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=s):s=e[1];let r;return e[2]!==n||e[3]!==s?(r=i.jsx("div",{className:s,children:n}),e[2]=n,e[3]=s,e[4]=r):r=e[4],r}function T(){const t=u.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"flex justify-between items-start",children:i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,i.jsxs("div",{className:"flex flex-col gap-[2px]",children:[i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),i.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsxs(_,{className:"group transition-colors flex flex-col",children:[n,i.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const b=Object.assign(F,{Avatar:H,AvatarSection:I,Header:R,Title:B,Subtitle:G,Content:q,Footer:M,Badge:Q,Skeleton:T}),P={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},V={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},X={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},J={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},K={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},U={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function z(t){const e=u.c(13),{children:n,columns:l,gap:s,className:r}=t;let x;e[0]!==l?(x=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=x):x=e[1];const a=x,m=P[s===void 0?4:s],o=a.sm&&V[a.sm],c=a.md&&X[a.md],g=a.lg&&J[a.lg],p=a.xl&&K[a.xl],j=a["2xl"]&&U[a["2xl"]];let h;e[2]!==r||e[3]!==m||e[4]!==o||e[5]!==c||e[6]!==g||e[7]!==p||e[8]!==j?(h=v("w-full grid",m,o,c,g,p,j,r),e[2]=r,e[3]=m,e[4]=o,e[5]=c,e[6]=g,e[7]=p,e[8]=j,e[9]=h):h=e[9];const N=h;let f;return e[10]!==n||e[11]!==N?(f=i.jsx("div",{className:N,children:n}),e[10]=n,e[11]=N,e[12]=f):f=e[12],f}function W(t){const e=u.c(9),{count:n,columns:l,gap:s,className:r}=t,x=n===void 0?8:n;let a;e[0]!==l?(a=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=a):a=e[1];const d=a,m=s===void 0?4:s;let o;e[2]!==x?(o=Array.from({length:x}).map(Y),e[2]=x,e[3]=o):o=e[3];let c;return e[4]!==r||e[5]!==d||e[6]!==m||e[7]!==o?(c=i.jsx(z,{columns:d,gap:m,className:r,children:o}),e[4]=r,e[5]=d,e[6]=m,e[7]=o,e[8]=c):c=e[8],c}function Y(t,e){return i.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[i.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[i.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),i.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),i.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),i.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const S=Object.assign(z,{Skeleton:W});function Z(t){const e=u.c(14),{query:n}=t,{data:l}=w.useListOrganizations(),s=E();let r;e[0]!==l||e[1]!==n?(r=l?n?(()=>{const o=n.toLowerCase();return l.filter(c=>c.name.toLowerCase().includes(o)||c.slug.toLowerCase().includes(o))})():l:[],e[0]=l,e[1]=n,e[2]=r):r=e[2];const x=r;if(!l||l.length===0){let o;return e[3]===Symbol.for("react.memo_cache_sentinel")?(o=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=o):o=e[3],o}if(x.length===0){let o;return e[4]!==n?(o=i.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=o):o=e[5],o}let a;e[6]===Symbol.for("react.memo_cache_sentinel")?(a={sm:2,md:3,lg:4},e[6]=a):a=e[6];let d;if(e[7]!==x||e[8]!==s){let o;e[10]!==s?(o=c=>i.jsxs(b,{onNavigate:()=>s({to:"/$org",params:{org:c.slug}}),children:[i.jsxs(b.Header,{children:[i.jsx(b.AvatarSection,{children:i.jsx(b.Avatar,{url:c.logo||"",fallback:c.name,size:"lg",objectFit:"contain"})}),i.jsxs(b.Content,{children:[i.jsxs(b.Subtitle,{children:["@",c.slug]}),i.jsx(b.Title,{children:c.name})]})]}),i.jsx(b.Footer,{children:i.jsxs("div",{className:"text-xs text-muted-foreground",children:["Created:"," ",new Date(c.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},c.id),e[10]=s,e[11]=o):o=e[11],d=x.map(o),e[7]=x,e[8]=s,e[9]=d}else d=e[9];let m;return e[12]!==d?(m=i.jsx(S,{columns:a,children:d}),e[12]=d,e[13]=m):m=e[13],m}function ee(t){const e=u.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=i.jsx(k,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let s;return e[1]!==n.message?(s=i.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4 p-8",children:[l,i.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=s):s=e[2],s}function te(){const t=u.c(20),{error:e,isPending:n}=w.useListOrganizations(),[l,s]=C.useState(""),[r,x]=C.useState(!1),a=C.useDeferredValue(l);if(n){let f;t[0]===Symbol.for("react.memo_cache_sentinel")?(f=i.jsx("div",{className:"flex items-center justify-between mb-8",children:i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"})}),t[0]=f):f=t[0];let y;return t[1]===Symbol.for("react.memo_cache_sentinel")?(y=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[f,i.jsx("div",{className:"@container",children:i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})]}),t[1]=y):y=t[1],y}if(e){let f;return t[2]!==e?(f=i.jsx(ee,{error:e}),t[2]=e,t[3]=f):f=t[3],f}let d;t[4]===Symbol.for("react.memo_cache_sentinel")?(d=i.jsx("h2",{className:"text-xl font-medium",children:"My organizations"}),t[4]=d):d=t[4];let m;t[5]===Symbol.for("react.memo_cache_sentinel")?(m=f=>s(f.target.value),t[5]=m):m=t[5];let o;t[6]!==l?(o=i.jsx(L,{className:"max-w-xs",placeholder:"Search",value:l,onChange:m}),t[6]=l,t[7]=o):o=t[7];let c;t[8]===Symbol.for("react.memo_cache_sentinel")?(c=i.jsxs(O,{variant:"default",onClick:()=>x(!0),children:[i.jsx(A,{size:16}),i.jsx("span",{children:"New organization"})]}),t[8]=c):c=t[8];let g;t[9]!==o?(g=i.jsxs("div",{className:"flex items-center justify-between mb-8",children:[d,i.jsxs("div",{className:"flex items-center gap-2",children:[o,c]})]}),t[9]=o,t[10]=g):g=t[10];let p;t[11]===Symbol.for("react.memo_cache_sentinel")?(p=i.jsx(S.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[11]=p):p=t[11];let j;t[12]!==a?(j=i.jsx("div",{className:"@container",children:i.jsx(C.Suspense,{fallback:p,children:i.jsx(Z,{query:a})})}),t[12]=a,t[13]=j):j=t[13];let h;t[14]!==r?(h=i.jsx(D,{open:r,onOpenChange:x}),t[14]=r,t[15]=h):h=t[15];let N;return t[16]!==g||t[17]!==j||t[18]!==h?(N=i.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[g,j,h]}),t[16]=g,t[17]=j,t[18]=h,t[19]=N):N=t[19],N}function ue(){const t=u.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"min-h-full",children:i.jsx(te,{})}),t[0]=e):e=t[0],e}export{ue as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-CcnR2b1q.js","assets/button-DodNLkpL.js","assets/utils-DgLfrg3u.js","assets/input-BXHWk19m.js","assets/shell-layout-adVEIdhn.js","assets/SearchMd-1Gq7nypQ.js","assets/use-connection-BX5-4xHw.js","assets/tooltip-BjhP6ibY.js","assets/localstorage-keys-D7pZSS7H.js","assets/useQuery-ojqdZMTH.js","assets/CpuChip02-DlCI7cQJ.js","assets/Loading01-r04aEG5T.js","assets/Plus-CS_Y2Vnc.js","assets/X-BX0rl0N7.js","assets/resizable-B3HA_CX4.js","assets/dropdown-menu-DrQKdl4f.js","assets/dialog-BqvvzTa7.js","assets/select-Be0LRVWn.js","assets/ChevronDown-g4L12M9A.js","assets/use-mobile-TpeNqylz.js","assets/use-gateway-CseaalWF.js","assets/Copy01-CHjgpWtl.js","assets/AlertCircle-DaEUMwle.js","assets/Terminal-DYN6gEAz.js","assets/connection-card-opsQBUfD.js","assets/card-BHz-BqEu.js","assets/LinkExternal01-ISpHuMJE.js","assets/spinner-oZ2DO2-U.js","assets/File06-CBkqKj5m.js","assets/InfoCircle-BwNsGATl.js","assets/use-binding-CapMpNVF.js","assets/auth-AUS48lXs.js","assets/popover-MhzpcVkW.js","assets/Clock-C-uwthk9.js","assets/Trash01-DVxmznxT.js","assets/error-boundary-CdmYlIj7.js","assets/generate-id-Dyweu44Y.js","assets/use-organization-settings-BAhAEDx8.js","assets/create-organization-dialog-fbCy_hNu.js","assets/alert-dialog-DdP064l-.js","assets/form-Bus-fIfC.js","assets/avatar-bcdjVFyi.js","assets/home-heelYyW2.js","assets/page-C8KGQPlY.js","assets/collection-header-DcpyPzrC.js","assets/collection-display-button-475jHotV.js","assets/view-mode-toggle-DAXMt6ZW.js","assets/collection-page-DpUZNbpd.js","assets/use-tool-call-CQCb5PBf.js","assets/GitBranch01-Ci5lqvRi.js","assets/types-D4T3qWDr.js","assets/index-DDiLOLYT.js","assets/json-syntax-highlighter-i1hiMNnF.js","assets/badge-1WraHGEG.js","assets/page-BZV40eAE.css","assets/members-D5QtYSzf.js","assets/collection-search-DVBnlN6E.js","assets/collection-table-wrapper-DQ4F9pbh.js","assets/switch-DsCvClV8.js","assets/checkbox-Bj9jBMQF.js","assets/ArrowLeft-CvFDkdiU.js","assets/use-members-DzZB15s9.js","assets/well-known-mcp-BPQQU1v0.js","assets/XClose-BUuGHVgA.js","assets/DotsVertical-CIfapH0j.js","assets/Key01-5nxXQgMM.js","assets/connections-CeDc3J_o.js","assets/use-list-state-7NLbXyOC.js","assets/env-vars-editor-DEYac6H7.js","assets/settings-gZFi_2QA.js","assets/Upload01-Da0sGkRE.js","assets/monitoring-Cp92YRPy.js","assets/index-JV0IIYp6.js","assets/Calendar-DBqzL4c-.js","assets/store-DzO4PTg0.js","assets/slugify-CEUa2lfQ.js","assets/Inbox01-DCkU3Xgq.js","assets/registry-utils-ulDDT0d8.js","assets/app-name-gTETL9So.js","assets/store-app-detail-BIXt1EdE.js","assets/CheckCircle-CILz6OCh.js","assets/tools-list-BsHebq88.js","assets/layout-dxbGsEKV.js","assets/tools-list-CSRUKxnt.css","assets/resource-tabs-ru5yaRIE.js","assets/use-mcp-M6XXMHar.js","assets/extract-connection-data-Ty2DjF1e.js","assets/connection-detail-DpiL6xjK.js","assets/index-td_4XAxf.js","assets/mcp-oauth-D7V7V-GS.js","assets/formatDistanceToNow-D46rGC8T.js","assets/use-connection-resources-FqHsvBSA.js","assets/collection-detail-QGbMDWA7.js","assets/gateways-DQmZoxNy.js","assets/gateway-detail-fCVh3_nF.js","assets/oauth-callback-1_PgXFG_.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function _4(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&&!Array.isArray(o)){for(const i in o)if(i!=="default"&&!(i in e)){const l=Object.getOwnPropertyDescriptor(o,i);l&&Object.defineProperty(e,i,l.get?l:{enumerable:!0,get:()=>o[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerPolicy&&(l.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?l.credentials="include":i.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}})();const E4="modulepreload",S4=function(e){return"/"+e},v_={},Dn=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let c=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),f=d?.nonce||d?.getAttribute("nonce");i=c(n.map(h=>{if(h=S4(h),h in v_)return;v_[h]=!0;const g=h.endsWith(".css"),p=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const y=document.createElement("link");if(y.rel=g?"stylesheet":E4,g||(y.as="script"),y.crossOrigin="",y.href=h,f&&y.setAttribute("nonce",f),document.head.appendChild(y),g)return new Promise((_,S)=>{y.addEventListener("load",_),y.addEventListener("error",()=>S(Error(`Unable to preload CSS for ${h}`)))})}))}function l(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return i.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return t().catch(l)})};var LH=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function wi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jp={exports:{}},Dl={};var y_;function w4(){if(y_)return Dl;y_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,i,l){var c=null;if(l!==void 0&&(c=""+l),i.key!==void 0&&(c=""+i.key),"key"in i){l={};for(var d in i)d!=="key"&&(l[d]=i[d])}else l=i;return i=l.ref,{$$typeof:e,type:o,key:c,ref:i!==void 0?i:null,props:l}}return Dl.Fragment=t,Dl.jsx=n,Dl.jsxs=n,Dl}var b_;function x4(){return b_||(b_=1,Jp.exports=w4()),Jp.exports}var b=x4(),em={exports:{}},Ll={},tm={exports:{}},nm={};var __;function R4(){return __||(__=1,(function(e){function t(P,F){var H=P.length;P.push(F);e:for(;0<H;){var re=H-1>>>1,ye=P[re];if(0<i(ye,F))P[re]=F,P[H]=ye,H=re;else break e}}function n(P){return P.length===0?null:P[0]}function o(P){if(P.length===0)return null;var F=P[0],H=P.pop();if(H!==F){P[0]=H;e:for(var re=0,ye=P.length,k=ye>>>1;re<k;){var Q=2*(re+1)-1,ee=P[Q],se=Q+1,me=P[se];if(0>i(ee,H))se<ye&&0>i(me,ee)?(P[re]=me,P[se]=H,re=se):(P[re]=ee,P[Q]=H,re=Q);else if(se<ye&&0>i(me,H))P[re]=me,P[se]=H,re=se;else break e}}return F}function i(P,F){var H=P.sortIndex-F.sortIndex;return H!==0?H:P.id-F.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],h=[],g=1,p=null,y=3,_=!1,S=!1,w=!1,T=!1,R=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function O(P){for(var F=n(h);F!==null;){if(F.callback===null)o(h);else if(F.startTime<=P)o(h),F.sortIndex=F.expirationTime,t(f,F);else break;F=n(h)}}function M(P){if(w=!1,O(P),!S)if(n(f)!==null)S=!0,L||(L=!0,K());else{var F=n(h);F!==null&&ae(M,F.startTime-P)}}var L=!1,N=-1,D=5,z=-1;function W(){return T?!0:!(e.unstable_now()-z<D)}function G(){if(T=!1,L){var P=e.unstable_now();z=P;var F=!0;try{e:{S=!1,w&&(w=!1,A(N),N=-1),_=!0;var H=y;try{t:{for(O(P),p=n(f);p!==null&&!(p.expirationTime>P&&W());){var re=p.callback;if(typeof re=="function"){p.callback=null,y=p.priorityLevel;var ye=re(p.expirationTime<=P);if(P=e.unstable_now(),typeof ye=="function"){p.callback=ye,O(P),F=!0;break t}p===n(f)&&o(f),O(P)}else o(f);p=n(f)}if(p!==null)F=!0;else{var k=n(h);k!==null&&ae(M,k.startTime-P),F=!1}}break e}finally{p=null,y=H,_=!1}F=void 0}}finally{F?K():L=!1}}}var K;if(typeof C=="function")K=function(){C(G)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,ne=j.port2;j.port1.onmessage=G,K=function(){ne.postMessage(null)}}else K=function(){R(G,0)};function ae(P,F){N=R(function(){P(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(P){switch(y){case 1:case 2:case 3:var F=3;break;default:F=y}var H=y;y=F;try{return P()}finally{y=H}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(P,F){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var H=y;y=P;try{return F()}finally{y=H}},e.unstable_scheduleCallback=function(P,F,H){var re=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?re+H:re):H=re,P){case 1:var ye=-1;break;case 2:ye=250;break;case 5:ye=1073741823;break;case 4:ye=1e4;break;default:ye=5e3}return ye=H+ye,P={id:g++,callback:F,priorityLevel:P,startTime:H,expirationTime:ye,sortIndex:-1},H>re?(P.sortIndex=H,t(h,P),n(f)===null&&P===n(h)&&(w?(A(N),N=-1):w=!0,ae(M,H-re))):(P.sortIndex=ye,t(f,P),S||_||(S=!0,L||(L=!0,K()))),P},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(P){var F=y;return function(){var H=y;y=F;try{return P.apply(this,arguments)}finally{y=H}}}})(nm)),nm}var E_;function O4(){return E_||(E_=1,tm.exports=R4()),tm.exports}var rm={exports:{}},Fe={};var S_;function T4(){if(S_)return Fe;S_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function _(k){return k===null||typeof k!="object"?null:(k=y&&k[y]||k["@@iterator"],typeof k=="function"?k:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function R(k,Q,ee){this.props=k,this.context=Q,this.refs=T,this.updater=ee||S}R.prototype.isReactComponent={},R.prototype.setState=function(k,Q){if(typeof k!="object"&&typeof k!="function"&&k!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,k,Q,"setState")},R.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function A(){}A.prototype=R.prototype;function C(k,Q,ee){this.props=k,this.context=Q,this.refs=T,this.updater=ee||S}var O=C.prototype=new A;O.constructor=C,w(O,R.prototype),O.isPureReactComponent=!0;var M=Array.isArray;function L(){}var N={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function z(k,Q,ee){var se=ee.ref;return{$$typeof:e,type:k,key:Q,ref:se!==void 0?se:null,props:ee}}function W(k,Q){return z(k.type,Q,k.props)}function G(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function K(k){var Q={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ee){return Q[ee]})}var j=/\/+/g;function ne(k,Q){return typeof k=="object"&&k!==null&&k.key!=null?K(""+k.key):Q.toString(36)}function ae(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(L,L):(k.status="pending",k.then(function(Q){k.status==="pending"&&(k.status="fulfilled",k.value=Q)},function(Q){k.status==="pending"&&(k.status="rejected",k.reason=Q)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function P(k,Q,ee,se,me){var _e=typeof k;(_e==="undefined"||_e==="boolean")&&(k=null);var be=!1;if(k===null)be=!0;else switch(_e){case"bigint":case"string":case"number":be=!0;break;case"object":switch(k.$$typeof){case e:case t:be=!0;break;case g:return be=k._init,P(be(k._payload),Q,ee,se,me)}}if(be)return me=me(k),be=se===""?"."+ne(k,0):se,M(me)?(ee="",be!=null&&(ee=be.replace(j,"$&/")+"/"),P(me,Q,ee,"",function(Le){return Le})):me!=null&&(G(me)&&(me=W(me,ee+(me.key==null||k&&k.key===me.key?"":(""+me.key).replace(j,"$&/")+"/")+be)),Q.push(me)),1;be=0;var Se=se===""?".":se+":";if(M(k))for(var De=0;De<k.length;De++)se=k[De],_e=Se+ne(se,De),be+=P(se,Q,ee,_e,me);else if(De=_(k),typeof De=="function")for(k=De.call(k),De=0;!(se=k.next()).done;)se=se.value,_e=Se+ne(se,De++),be+=P(se,Q,ee,_e,me);else if(_e==="object"){if(typeof k.then=="function")return P(ae(k),Q,ee,se,me);throw Q=String(k),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return be}function F(k,Q,ee){if(k==null)return k;var se=[],me=0;return P(k,se,"","",function(_e){return Q.call(ee,_e,me++)}),se}function H(k){if(k._status===-1){var Q=k._result;Q=Q(),Q.then(function(ee){(k._status===0||k._status===-1)&&(k._status=1,k._result=ee)},function(ee){(k._status===0||k._status===-1)&&(k._status=2,k._result=ee)}),k._status===-1&&(k._status=0,k._result=Q)}if(k._status===1)return k._result.default;throw k._result}var re=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},ye={map:F,forEach:function(k,Q,ee){F(k,function(){Q.apply(this,arguments)},ee)},count:function(k){var Q=0;return F(k,function(){Q++}),Q},toArray:function(k){return F(k,function(Q){return Q})||[]},only:function(k){if(!G(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Fe.Activity=p,Fe.Children=ye,Fe.Component=R,Fe.Fragment=n,Fe.Profiler=i,Fe.PureComponent=C,Fe.StrictMode=o,Fe.Suspense=f,Fe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Fe.__COMPILER_RUNTIME={__proto__:null,c:function(k){return N.H.useMemoCache(k)}},Fe.cache=function(k){return function(){return k.apply(null,arguments)}},Fe.cacheSignal=function(){return null},Fe.cloneElement=function(k,Q,ee){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var se=w({},k.props),me=k.key;if(Q!=null)for(_e in Q.key!==void 0&&(me=""+Q.key),Q)!D.call(Q,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&Q.ref===void 0||(se[_e]=Q[_e]);var _e=arguments.length-2;if(_e===1)se.children=ee;else if(1<_e){for(var be=Array(_e),Se=0;Se<_e;Se++)be[Se]=arguments[Se+2];se.children=be}return z(k.type,me,se)},Fe.createContext=function(k){return k={$$typeof:c,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:l,_context:k},k},Fe.createElement=function(k,Q,ee){var se,me={},_e=null;if(Q!=null)for(se in Q.key!==void 0&&(_e=""+Q.key),Q)D.call(Q,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(me[se]=Q[se]);var be=arguments.length-2;if(be===1)me.children=ee;else if(1<be){for(var Se=Array(be),De=0;De<be;De++)Se[De]=arguments[De+2];me.children=Se}if(k&&k.defaultProps)for(se in be=k.defaultProps,be)me[se]===void 0&&(me[se]=be[se]);return z(k,_e,me)},Fe.createRef=function(){return{current:null}},Fe.forwardRef=function(k){return{$$typeof:d,render:k}},Fe.isValidElement=G,Fe.lazy=function(k){return{$$typeof:g,_payload:{_status:-1,_result:k},_init:H}},Fe.memo=function(k,Q){return{$$typeof:h,type:k,compare:Q===void 0?null:Q}},Fe.startTransition=function(k){var Q=N.T,ee={};N.T=ee;try{var se=k(),me=N.S;me!==null&&me(ee,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(L,re)}catch(_e){re(_e)}finally{Q!==null&&ee.types!==null&&(Q.types=ee.types),N.T=Q}},Fe.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Fe.use=function(k){return N.H.use(k)},Fe.useActionState=function(k,Q,ee){return N.H.useActionState(k,Q,ee)},Fe.useCallback=function(k,Q){return N.H.useCallback(k,Q)},Fe.useContext=function(k){return N.H.useContext(k)},Fe.useDebugValue=function(){},Fe.useDeferredValue=function(k,Q){return N.H.useDeferredValue(k,Q)},Fe.useEffect=function(k,Q){return N.H.useEffect(k,Q)},Fe.useEffectEvent=function(k){return N.H.useEffectEvent(k)},Fe.useId=function(){return N.H.useId()},Fe.useImperativeHandle=function(k,Q,ee){return N.H.useImperativeHandle(k,Q,ee)},Fe.useInsertionEffect=function(k,Q){return N.H.useInsertionEffect(k,Q)},Fe.useLayoutEffect=function(k,Q){return N.H.useLayoutEffect(k,Q)},Fe.useMemo=function(k,Q){return N.H.useMemo(k,Q)},Fe.useOptimistic=function(k,Q){return N.H.useOptimistic(k,Q)},Fe.useReducer=function(k,Q,ee){return N.H.useReducer(k,Q,ee)},Fe.useRef=function(k){return N.H.useRef(k)},Fe.useState=function(k){return N.H.useState(k)},Fe.useSyncExternalStore=function(k,Q,ee){return N.H.useSyncExternalStore(k,Q,ee)},Fe.useTransition=function(){return N.H.useTransition()},Fe.version="19.2.3",Fe}var w_;function ja(){return w_||(w_=1,rm.exports=T4()),rm.exports}var om={exports:{}},Mn={};var x_;function A4(){if(x_)return Mn;x_=1;var e=ja();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var o={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function l(f,h,g){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:f,containerInfo:h,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Mn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Mn.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,g)},Mn.flushSync=function(f){var h=c.T,g=o.p;try{if(c.T=null,o.p=2,f)return f()}finally{c.T=h,o.p=g,o.d.f()}},Mn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(f,h))},Mn.prefetchDNS=function(f){typeof f=="string"&&o.d.D(f)},Mn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,p=d(g,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,_=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?o.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:_}):g==="script"&&o.d.X(f,{crossOrigin:p,integrity:y,fetchPriority:_,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Mn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);o.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(f)},Mn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,p=d(g,h.crossOrigin);o.d.L(f,g,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Mn.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);o.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(f)},Mn.requestFormReset=function(f){o.d.r(f)},Mn.unstable_batchedUpdates=function(f,h){return f(h)},Mn.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},Mn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Mn.version="19.2.3",Mn}var R_;function ww(){if(R_)return om.exports;R_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),om.exports=A4(),om.exports}var O_;function C4(){if(O_)return Ll;O_=1;var e=O4(),t=ja(),n=ww();function o(r){var a="https://react.dev/errors/"+r;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)a+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var a=r,s=r;if(r.alternate)for(;a.return;)a=a.return;else{r=a;do a=r,(a.flags&4098)!==0&&(s=a.return),r=a.return;while(r)}return a.tag===3?s:null}function c(r){if(r.tag===13){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function d(r){if(r.tag===31){var a=r.memoizedState;if(a===null&&(r=r.alternate,r!==null&&(a=r.memoizedState)),a!==null)return a.dehydrated}return null}function f(r){if(l(r)!==r)throw Error(o(188))}function h(r){var a=r.alternate;if(!a){if(a=l(r),a===null)throw Error(o(188));return a!==r?null:r}for(var s=r,u=a;;){var m=s.return;if(m===null)break;var v=m.alternate;if(v===null){if(u=m.return,u!==null){s=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===s)return f(m),r;if(v===u)return f(m),a;v=v.sibling}throw Error(o(188))}if(s.return!==u.return)s=m,u=v;else{for(var x=!1,I=m.child;I;){if(I===s){x=!0,s=m,u=v;break}if(I===u){x=!0,u=m,s=v;break}I=I.sibling}if(!x){for(I=v.child;I;){if(I===s){x=!0,s=v,u=m;break}if(I===u){x=!0,u=v,s=m;break}I=I.sibling}if(!x)throw Error(o(189))}}if(s.alternate!==u)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?r:a}function g(r){var a=r.tag;if(a===5||a===26||a===27||a===6)return r;for(r=r.child;r!==null;){if(a=g(r),a!==null)return a;r=r.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),C=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function K(r){return r===null||typeof r!="object"?null:(r=G&&r[G]||r["@@iterator"],typeof r=="function"?r:null)}var j=Symbol.for("react.client.reference");function ne(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===j?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case R:return"Profiler";case T:return"StrictMode";case M:return"Suspense";case L:return"SuspenseList";case z:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case C:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case O:var a=r.render;return r=r.displayName,r||(r=a.displayName||a.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case N:return a=r.displayName||null,a!==null?a:ne(r.type)||"Memo";case D:a=r._payload,r=r._init;try{return ne(r(a))}catch{}}return null}var ae=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},re=[],ye=-1;function k(r){return{current:r}}function Q(r){0>ye||(r.current=re[ye],re[ye]=null,ye--)}function ee(r,a){ye++,re[ye]=r.current,r.current=a}var se=k(null),me=k(null),_e=k(null),be=k(null);function Se(r,a){switch(ee(_e,a),ee(me,r),ee(se,null),a.nodeType){case 9:case 11:r=(r=a.documentElement)&&(r=r.namespaceURI)?Bb(r):0;break;default:if(r=a.tagName,a=a.namespaceURI)a=Bb(a),r=Fb(a,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Q(se),ee(se,r)}function De(){Q(se),Q(me),Q(_e)}function Le(r){r.memoizedState!==null&&ee(be,r);var a=se.current,s=Fb(a,r.type);a!==s&&(ee(me,r),ee(se,s))}function Ee(r){me.current===r&&(Q(se),Q(me)),be.current===r&&(Q(be),Cl._currentValue=H)}var ze,Nt;function ve(r){if(ze===void 0)try{throw Error()}catch(s){var a=s.stack.trim().match(/\n( *(at )?)/);ze=a&&a[1]||"",Nt=-1<s.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+ze+r+Nt}var ge=!1;function Re(r,a){if(!r||ge)return"";ge=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(a){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(oe){var te=oe}Reflect.construct(r,[],de)}else{try{de.call()}catch(oe){te=oe}r.call(de.prototype)}}else{try{throw Error()}catch(oe){te=oe}(de=r())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(oe){if(oe&&te&&typeof oe.stack=="string")return[oe.stack,te.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),x=v[0],I=v[1];if(x&&I){var B=x.split(`
|
|
@@ -153,4 +153,4 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
153
153
|
.dark .grecaptcha-badge {
|
|
154
154
|
border-color: var(--input) !important;
|
|
155
155
|
}
|
|
156
|
-
`}),b.jsx(M$,{ref:e,sitekey:t.siteKey,theme:n,hl:o,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:fe(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${o}-${t.provider}`)]}):null}var qV=["/sign-up/email","/sign-in/email","/forget-password"];function Mc({ref:e,localization:t,action:n}){const{captcha:o}=E.useContext(qe);if(!o||n&&!(o.endpoints||qV).includes(n))return null;const{theme:i}=Dv(),l=o.provider==="google-recaptcha-v2-checkbox"||o.provider==="google-recaptcha-v2-invisible",c=o.provider==="google-recaptcha-v3"||o.provider==="google-recaptcha-v2-invisible",d=o.provider==="cloudflare-turnstile",f=o.provider==="hcaptcha",h=o.provider==="captchafox";return b.jsxs(b.Fragment,{children:[l&&b.jsx(GV,{ref:e}),c&&b.jsx(HV,{localization:t}),d&&b.jsx(jT,{className:"mx-auto",ref:e,siteKey:o.siteKey,options:{theme:i,size:"flexible"}}),f&&b.jsx("div",{className:"mx-auto",children:b.jsx(a$,{ref:e,sitekey:o.siteKey,theme:i})}),h&&b.jsx("div",{className:"mx-auto",children:b.jsx(TT,{ref:e,sitekey:o.siteKey,theme:i})})]})}function x0({className:e,containerClassName:t,...n}){return b.jsx($T,{"data-slot":"input-otp",containerClassName:fe("flex items-center gap-2 has-disabled:opacity-50",t),className:fe("disabled:cursor-not-allowed",e),...n})}function Es({className:e,...t}){return b.jsx("div",{"data-slot":"input-otp-group",className:fe("flex items-center",e),...t})}function pn({index:e,className:t,...n}){const o=E.useContext(FT),{char:i,hasFakeCaret:l,isActive:c}=o?.slots[e]??{};return b.jsxs("div",{"data-slot":"input-otp-slot","data-active":c,className:fe("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[i,l&&b.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:b.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function cg({...e}){return b.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:b.jsx(V7,{})})}function R0({otpSeparators:e=0}){return e===0?b.jsxs(Es,{children:[b.jsx(pn,{index:0}),b.jsx(pn,{index:1}),b.jsx(pn,{index:2}),b.jsx(pn,{index:3}),b.jsx(pn,{index:4}),b.jsx(pn,{index:5})]}):e===1?b.jsxs(b.Fragment,{children:[b.jsxs(Es,{children:[b.jsx(pn,{index:0}),b.jsx(pn,{index:1}),b.jsx(pn,{index:2})]}),b.jsx(cg,{}),b.jsxs(Es,{children:[b.jsx(pn,{index:3}),b.jsx(pn,{index:4}),b.jsx(pn,{index:5})]})]}):b.jsxs(b.Fragment,{children:[b.jsxs(Es,{children:[b.jsx(pn,{index:0}),b.jsx(pn,{index:1})]}),b.jsx(cg,{}),b.jsxs(Es,{children:[b.jsx(pn,{index:2}),b.jsx(pn,{index:3})]}),b.jsx(cg,{}),b.jsxs(Es,{children:[b.jsx(pn,{index:4}),b.jsx(pn,{index:5})]})]})}function bw(e){const[t,n]=E.useState();return t?b.jsx(YV,{...e,email:t}):b.jsx(ZV,{...e,setEmail:n})}function ZV({className:e,classNames:t,isSubmitting:n,localization:o,setIsSubmitting:i,setEmail:l}){const c=qo(),{captchaRef:d,getCaptchaHeaders:f}=Ic({localization:o}),{authClient:h,localization:g,toast:p,localizeErrors:y}=E.useContext(qe);o={...g,...o};const _=bn({email:He().email({message:`${o.EMAIL} ${o.IS_INVALID}`})}),S=vo({resolver:yo(_),defaultValues:{email:""}});n=n||S.formState.isSubmitting,E.useEffect(()=>{i?.(S.formState.isSubmitting)},[S.formState.isSubmitting,i]);async function w({email:T}){const R={throw:!0,headers:await f("/email-otp/send-verification-otp")};try{await h.emailOtp.sendVerificationOtp({email:T,type:"sign-in",fetchOptions:R}),p({variant:"success",message:o.EMAIL_OTP_VERIFICATION_SENT}),l(T)}catch(A){p({variant:"error",message:kt({error:A,localization:o,localizeErrors:y})})}}return b.jsx(_o,{...S,children:b.jsxs("form",{onSubmit:S.handleSubmit(w),noValidate:c,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:S.control,name:"email",render:({field:T})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:n,...T})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Mc,{ref:d,localization:o,action:"/email-otp/send-verification-otp"}),b.jsx(St,{type:"submit",disabled:n,className:fe("w-full",t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.EMAIL_OTP_SEND_ACTION})]})})}function YV({className:e,classNames:t,isSubmitting:n,localization:o,otpSeparators:i=0,redirectTo:l,setIsSubmitting:c,email:d}){const{authClient:f,localization:h,toast:g,localizeErrors:p}=E.useContext(qe);o={...h,...o};const{onSuccess:y,isPending:_}=Eo({redirectTo:l}),S=bn({code:He().min(1,{message:`${o.EMAIL_OTP} ${o.IS_REQUIRED}`}).min(6,{message:`${o.EMAIL_OTP} ${o.IS_INVALID}`})}),w=vo({resolver:yo(S),defaultValues:{code:""}});n=n||w.formState.isSubmitting||_,E.useEffect(()=>{c?.(w.formState.isSubmitting||_)},[w.formState.isSubmitting,_,c]);async function T({code:R}){try{await f.signIn.emailOtp({email:d,otp:R,fetchOptions:{throw:!0}}),await y()}catch(A){g({variant:"error",message:kt({error:A,localization:o,localizeErrors:p})}),w.reset()}}return b.jsx(_o,{...w,children:b.jsxs("form",{onSubmit:w.handleSubmit(T),className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:w.control,name:"code",render:({field:R})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.EMAIL_OTP}),b.jsx(nn,{children:b.jsx(x0,{...R,maxLength:6,onChange:A=>{R.onChange(A),A.length===6&&w.handleSubmit(T)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:b.jsx(R0,{otpSeparators:i})})}),b.jsx(un,{className:t?.error})]})}),b.jsx("div",{className:"grid gap-4",children:b.jsxs(St,{type:"submit",disabled:n,className:fe(t?.button,t?.primaryButton),children:[n&&b.jsx(yn,{className:"animate-spin"}),o.EMAIL_OTP_VERIFY_ACTION]})})]})})}function KV({onCancel:e,localization:t,className:n,classNames:o,otpSeparators:i,callbackURL:l,isSubmitting:c,redirectTo:d,setIsSubmitting:f}){const[h,g]=E.useState(!0),[p,y]=E.useState(30),{authClient:_,localization:S,toast:w,localizeErrors:T,navigate:R,basePath:A,viewPaths:C}=E.useContext(qe);t={...S,...t};const O=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:M,isPending:L}=Eo({redirectTo:d}),N=bn({code:He().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),D=vo({resolver:yo(N),defaultValues:{code:""}}),z=c||D.formState.isSubmitting||L;E.useEffect(()=>{f?.(D.formState.isSubmitting||L)},[D.formState.isSubmitting,L,f]),E.useEffect(()=>{if(p>0){const K=setTimeout(()=>y(p-1),1e3);return()=>clearTimeout(K)}else g(!1)},[p]);async function W({code:K}){try{const j=await _.emailOtp.verifyEmail({email:O,otp:K,fetchOptions:{throw:!0}});"token"in j&&j.token?await M():(R(`${A}/${C.SIGN_IN}${window.location.search}`),w({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(j){w({variant:"error",message:kt({error:j,localization:t,localizeErrors:T})}),D.reset()}}async function G(){if(!h){g(!0),y(30);try{await _.emailOtp.sendVerificationOtp({email:O,type:"email-verification",fetchOptions:{throw:!0}}),w({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(K){w({variant:"error",message:kt({error:K,localization:t,localizeErrors:T})}),g(!1),y(0)}}}return O?b.jsx(_o,{...D,children:b.jsxs("form",{onSubmit:D.handleSubmit(W),className:fe("grid w-full gap-6",n,o?.base),children:[b.jsx(Ht,{control:D.control,name:"code",render:({field:K})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:o?.label,children:t.EMAIL_OTP}),b.jsx(nn,{children:b.jsx(x0,{...K,maxLength:6,onChange:j=>{K.onChange(j),j.length===6&&D.handleSubmit(W)()},containerClassName:o?.otpInputContainer,className:o?.otpInput,disabled:z,children:b.jsx(R0,{otpSeparators:i})})}),b.jsx(un,{className:o?.error})]})}),b.jsxs("div",{className:"grid gap-4",children:[b.jsxs(St,{type:"submit",disabled:z,className:fe(o?.button,o?.primaryButton),children:[z&&b.jsx(yn,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),b.jsx(St,{type:"button",variant:"outline",onClick:G,disabled:h||z,className:fe("w-full",o?.button),children:h?`${t.RESEND_VERIFICATION_EMAIL} (${p}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&b.jsx(St,{type:"button",variant:"ghost",onClick:e,disabled:z,className:"w-full",children:t.CANCEL})]})]})}):b.jsx("div",{className:fe("grid w-full gap-6",n),children:b.jsxs("div",{className:"text-center",children:[b.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),b.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function WV({className:e,classNames:t,isSubmitting:n,localization:o,setIsSubmitting:i}){const l=qo(),{captchaRef:c,getCaptchaHeaders:d,resetCaptcha:f}=Ic({localization:o}),{authClient:h,basePath:g,baseURL:p,localization:y,navigate:_,toast:S,viewPaths:w,localizeErrors:T}=E.useContext(qe);o={...y,...o};const R=bn({email:He().email({message:`${o.EMAIL} ${o.IS_INVALID}`}).min(1,{message:`${o.EMAIL} ${o.IS_REQUIRED}`})}),A=vo({resolver:yo(R),defaultValues:{email:""}});n=n||A.formState.isSubmitting,E.useEffect(()=>{i?.(A.formState.isSubmitting)},[A.formState.isSubmitting,i]);async function C({email:O}){try{const M={throw:!0,headers:await d("/forget-password")};await h.requestPasswordReset({email:O,redirectTo:`${p}${g}/${w.RESET_PASSWORD}`,fetchOptions:M}),S({variant:"success",message:o.FORGOT_PASSWORD_EMAIL}),_(`${g}/${w.SIGN_IN}${window.location.search}`)}catch(M){S({variant:"error",message:kt({error:M,localization:o,localizeErrors:T})}),f()}}return b.jsx(_o,{...A,children:b.jsxs("form",{onSubmit:A.handleSubmit(C),noValidate:l,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:A.control,name:"email",render:({field:O})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:n,...O})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Mc,{ref:c,localization:o,action:"/forget-password"}),b.jsx(St,{type:"submit",disabled:n,className:fe("w-full",t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.FORGOT_PASSWORD_ACTION})]})})}function _w({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,redirectTo:l,setIsSubmitting:c}){const d=qo(),{captchaRef:f,getCaptchaHeaders:h,resetCaptcha:g}=Ic({localization:i}),{authClient:p,basePath:y,baseURL:_,persistClient:S,localization:w,redirectTo:T,viewPaths:R,toast:A,localizeErrors:C}=E.useContext(qe);i={...w,...i};const O=E.useCallback(()=>l||Ri("redirectTo")||T,[l,T]),M=E.useCallback(()=>`${_}${n||(S?`${y}/${R.CALLBACK}?redirectTo=${encodeURIComponent(O())}`:O())}`,[n,S,y,R,_,O]),L=bn({email:He().email({message:`${i.EMAIL} ${i.IS_INVALID}`})}),N=vo({resolver:yo(L),defaultValues:{email:""}});o=o||N.formState.isSubmitting,E.useEffect(()=>{c?.(N.formState.isSubmitting)},[N.formState.isSubmitting,c]);async function D({email:z}){try{const W={throw:!0,headers:await h("/sign-in/magic-link")};await p.signIn.magicLink({email:z,callbackURL:M(),fetchOptions:W}),A({variant:"success",message:i.MAGIC_LINK_EMAIL}),N.reset()}catch(W){A({variant:"error",message:kt({error:W,localization:i,localizeErrors:C})}),g()}}return b.jsx(_o,{...N,children:b.jsxs("form",{onSubmit:N.handleSubmit(D),noValidate:d,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:N.control,name:"email",render:({field:z})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{className:t?.input,type:"email",placeholder:i.EMAIL_PLACEHOLDER,disabled:o,...z})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Mc,{ref:f,localization:i,action:"/sign-in/magic-link"}),b.jsx(St,{type:"submit",disabled:o,className:fe("w-full",t?.button,t?.primaryButton),children:o?b.jsx(yn,{className:"animate-spin"}):i.MAGIC_LINK_ACTION})]})})}function QV({className:e,classNames:t,isSubmitting:n,localization:o,redirectTo:i,setIsSubmitting:l}){const{authClient:c,localization:d,toast:f,localizeErrors:h}=E.useContext(qe);o={...d,...o};const{onSuccess:g,isPending:p}=Eo({redirectTo:i}),y=bn({code:He().min(1,{message:o.BACKUP_CODE_REQUIRED})}),_=vo({resolver:yo(y),defaultValues:{code:""}});n=n||_.formState.isSubmitting||p,E.useEffect(()=>{l?.(_.formState.isSubmitting||p)},[_.formState.isSubmitting,p,l]);async function S({code:w}){try{await c.twoFactor.verifyBackupCode({code:w,fetchOptions:{throw:!0}}),await g()}catch(T){f({variant:"error",message:kt({error:T,localization:o,localizeErrors:h})}),_.reset()}}return b.jsx(_o,{..._,children:b.jsxs("form",{onSubmit:_.handleSubmit(S),className:fe("grid gap-6",e,t?.base),children:[b.jsx(Ht,{control:_.control,name:"code",render:({field:w})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.BACKUP_CODE}),b.jsx(nn,{children:b.jsx(Kr,{placeholder:o.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...w})}),b.jsx(un,{className:t?.error})]})}),b.jsx(St,{type:"submit",disabled:n,className:fe(t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.RECOVER_ACCOUNT_ACTION})]})})}function XV({className:e,classNames:t,localization:n,passwordValidation:o}){const i=E.useRef(!1),{authClient:l,basePath:c,credentials:d,localization:f,viewPaths:h,navigate:g,toast:p,localizeErrors:y}=E.useContext(qe),_=d?.confirmPassword,S=d?.passwordValidation;n={...f,...n},o={...S,...o};const w=bn({newPassword:cc(o,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:_?cc(o,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):He().optional()}).refine(C=>!_||C.newPassword===C.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),T=vo({resolver:yo(w),defaultValues:{newPassword:"",confirmPassword:""}}),R=T.formState.isSubmitting;E.useEffect(()=>{if(i.current)return;i.current=!0;const O=new URLSearchParams(window.location.search).get("token");(!O||O==="INVALID_TOKEN")&&(g(`${c}/${h.SIGN_IN}${window.location.search}`),p({variant:"error",message:n.INVALID_TOKEN}))},[c,g,p,h,n]);async function A({newPassword:C}){try{const M=new URLSearchParams(window.location.search).get("token");await l.resetPassword({newPassword:C,token:M,fetchOptions:{throw:!0}}),p({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),g(`${c}/${h.SIGN_IN}${window.location.search}`)}catch(O){p({variant:"error",message:kt({error:O,localization:n,localizeErrors:y})}),T.reset()}}return b.jsx(_o,{...T,children:b.jsxs("form",{onSubmit:T.handleSubmit(A),className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:T.control,name:"newPassword",render:({field:C})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:n.NEW_PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:R,...C})}),b.jsx(un,{className:t?.error})]})}),_&&b.jsx(Ht,{control:T.control,name:"confirmPassword",render:({field:C})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:n.CONFIRM_PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:R,...C})}),b.jsx(un,{className:t?.error})]})}),b.jsx(St,{type:"submit",disabled:R,className:fe("w-full",t?.button,t?.primaryButton),children:R?b.jsx(yn,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function JV({className:e,classNames:t,isSubmitting:n,localization:o,redirectTo:i,setIsSubmitting:l,passwordValidation:c}){const d=qo(),{captchaRef:f,getCaptchaHeaders:h,resetCaptcha:g}=Ic({localization:o}),{authClient:p,basePath:y,credentials:_,localization:S,viewPaths:w,navigate:T,toast:R,Link:A,localizeErrors:C,emailVerification:O}=E.useContext(qe),M=_?.rememberMe,L=_?.username,N=_?.passwordValidation;o={...S,...o},c={...N,...c};const{onSuccess:D,isPending:z}=Eo({redirectTo:i}),W=bn({email:L?He().min(1,{message:`${o.USERNAME} ${o.IS_REQUIRED}`}):He().email({message:`${o.EMAIL} ${o.IS_INVALID}`}),password:cc(c,o),rememberMe:Cv().optional()}),G=vo({resolver:yo(W),defaultValues:{email:"",password:"",rememberMe:!M}});n=n||G.formState.isSubmitting||z,E.useEffect(()=>{l?.(G.formState.isSubmitting||z)},[G.formState.isSubmitting,z,l]);async function K({email:j,password:ne,rememberMe:ae}){var P;try{let F={};if(L&&!m8(j)){const H={throw:!0,headers:await h("/sign-in/username")};F=await p.signIn.username({username:j,password:ne,rememberMe:ae,fetchOptions:H})}else{const H={throw:!0,headers:await h("/sign-in/email")};F=await p.signIn.email({email:j,password:ne,rememberMe:ae,fetchOptions:H})}F.twoFactorRedirect?T(`${y}/${w.TWO_FACTOR}${window.location.search}`):await D()}catch(F){G.resetField("password"),g(),R({variant:"error",message:kt({error:F,localization:o,localizeErrors:C})}),O?.otp&&((P=F?.error)==null?void 0:P.code)==="EMAIL_NOT_VERIFIED"&&T(`${y}/${w.EMAIL_VERIFICATION}?email=${encodeURIComponent(j)}`)}}return b.jsx(_o,{...G,children:b.jsxs("form",{onSubmit:G.handleSubmit(K),noValidate:d,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:G.control,name:"email",render:({field:j})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:L?o.USERNAME:o.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:L?"username":"email",className:t?.input,type:L?"text":"email",placeholder:L?o.SIGN_IN_USERNAME_PLACEHOLDER:o.EMAIL_PLACEHOLDER,disabled:n,...j})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:G.control,name:"password",render:({field:j})=>b.jsxs(Gt,{children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx(qt,{className:t?.label,children:o.PASSWORD}),_?.forgotPassword&&b.jsx(A,{className:fe("text-sm hover:underline",t?.forgotPasswordLink),href:`${y}/${w.FORGOT_PASSWORD}${d?window.location.search:""}`,children:o.FORGOT_PASSWORD_LINK})]}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"current-password",className:t?.input,placeholder:o.PASSWORD_PLACEHOLDER,disabled:n,...j})}),b.jsx(un,{className:t?.error})]})}),M&&b.jsx(Ht,{control:G.control,name:"rememberMe",render:({field:j})=>b.jsxs(Gt,{className:"flex",children:[b.jsx(nn,{children:b.jsx(w0,{checked:j.value,onCheckedChange:j.onChange,disabled:n})}),b.jsx(qt,{children:o.REMEMBER_ME})]})}),b.jsx(Mc,{ref:f,localization:o,action:"/sign-in/email"}),b.jsx(St,{type:"submit",disabled:n,className:fe("w-full",t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.SIGN_IN_ACTION})]})})}function eH({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,redirectTo:l,setIsSubmitting:c,passwordValidation:d}){const f=qo(),{captchaRef:h,getCaptchaHeaders:g,resetCaptcha:p}=Ic({localization:i}),{additionalFields:y,authClient:_,basePath:S,baseURL:w,credentials:T,localization:R,nameRequired:A,persistClient:C,redirectTo:O,signUp:M,viewPaths:L,navigate:N,toast:D,avatar:z,localizeErrors:W,emailVerification:G}=E.useContext(qe),K=T?.confirmPassword,j=T?.username,ne=T?.usernameRequired??!0,ae=T?.passwordValidation,P=M?.fields;i={...R,...i},d={...ae,...d};const F=E.useRef(null),[H,re]=E.useState(null),[ye,k]=E.useState(!1),Q=E.useCallback(()=>l||Ri("redirectTo")||O,[l,O]),ee=E.useCallback(()=>`${w}${n||(C?`${S}/${L.CALLBACK}?redirectTo=${encodeURIComponent(Q())}`:Q())}`,[n,C,S,L,w,Q]),{onSuccess:se,isPending:me}=Eo({redirectTo:l}),_e={email:He().email({message:`${i.EMAIL} ${i.IS_INVALID}`}),password:cc(d,i),name:P?.includes("name")&&A?He().min(1,{message:`${i.NAME} ${i.IS_REQUIRED}`}):He().optional(),image:He().optional(),username:j&&ne?He().min(1,{message:`${i.USERNAME} ${i.IS_REQUIRED}`}):He().optional(),confirmPassword:K?cc(d,{PASSWORD_REQUIRED:i.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:i.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:i.PASSWORD_TOO_LONG,INVALID_PASSWORD:i.INVALID_PASSWORD}):He().optional()},be={};if(P)for(const ge of P){if(ge==="name"||ge==="image")continue;const Re=y?.[ge];if(!Re)continue;let ke;Re.type==="number"?ke=Re.required?h8(et=>et?Number(et):void 0,MR({message:`${Re.label} ${i.IS_INVALID}`})):p8({message:`${Re.label} ${i.IS_INVALID}`}).optional():Re.type==="boolean"?ke=Re.required?$E({message:`${Re.label} ${i.IS_INVALID}`}).refine(et=>et===!0,{message:`${Re.label} ${i.IS_REQUIRED}`}):$E({message:`${Re.label} ${i.IS_INVALID}`}).optional():ke=Re.required?He().min(1,`${Re.label} ${i.IS_REQUIRED}`):He().optional(),be[ge]=ke}const Se=bn(_e).extend(be).refine(ge=>K?ge.password===ge.confirmPassword:!0,{message:i.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),De={email:"",password:"",...K&&{confirmPassword:""},...P?.includes("name")?{name:""}:{},...j?{username:""}:{},...P?.includes("image")&&z?{image:""}:{}};if(P)for(const ge of P){if(ge==="name"||ge==="image")continue;const Re=y?.[ge];Re&&(De[ge]=Re.type==="boolean"?!1:"")}const Le=vo({resolver:yo(Se),defaultValues:De});o=o||Le.formState.isSubmitting||me,E.useEffect(()=>{c?.(Le.formState.isSubmitting||me)},[Le.formState.isSubmitting,me,c]);const Ee=async ge=>{if(z){k(!0);try{const Re=await uV(ge,crypto.randomUUID(),z.size,z.extension);let ke;z.upload?ke=await z.upload(Re):ke=await fV(Re),ke?(re(ke),Le.setValue("image",ke)):(re(null),Le.setValue("image",""))}catch(Re){console.error(Re),D({variant:"error",message:kt({error:Re,localization:i,localizeErrors:W})})}k(!1)}},ze=()=>{re(null),Le.setValue("image","")},Nt=()=>{var ge;return(ge=F.current)==null?void 0:ge.click()};async function ve({email:ge,password:Re,name:ke,username:et,confirmPassword:Ue,image:We,...U}){try{for(const[pe,he]of Object.entries(U)){const xe=y?.[pe];if(xe?.validate&&typeof he=="string"&&!await xe.validate(he)){Le.setError(pe,{message:`${xe.label} ${i.IS_INVALID}`});return}}const q={throw:!0,headers:await g("/sign-up/email")},Z={};et!==void 0&&(!ne&&(et===null||et===""||typeof et=="string"&&et.trim()==="")||(Z.username=et)),We!==void 0&&(Z.image=We);const ue=await _.signUp.email({email:ge,password:Re,name:ke||"",...Z,...U,callbackURL:ee(),fetchOptions:q});"token"in ue&&ue.token?await se():G?.otp?N(`${S}/${L.EMAIL_VERIFICATION}?email=${encodeURIComponent(ge)}`):(N(`${S}/${L.SIGN_IN}${window.location.search}`),D({variant:"success",message:i.SIGN_UP_EMAIL}))}catch(q){D({variant:"error",message:kt({error:q,localization:i,localizeErrors:W})}),Le.resetField("password"),Le.resetField("confirmPassword"),p()}}return b.jsx(_o,{...Le,children:b.jsxs("form",{onSubmit:Le.handleSubmit(ve),noValidate:f,className:fe("grid w-full gap-6",e,t?.base),children:[P?.includes("image")&&z&&b.jsxs(b.Fragment,{children:[b.jsx("input",{ref:F,accept:"image/*",disabled:ye,hidden:!0,type:"file",onChange:ge=>{var Re;const ke=(Re=ge.target.files)==null?void 0:Re.item(0);ke&&Ee(ke),ge.target.value=""}}),b.jsx(Ht,{control:Le.control,name:"image",render:()=>b.jsxs(Gt,{children:[b.jsx(qt,{children:i.AVATAR}),b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsxs(YT,{children:[b.jsx(KT,{asChild:!0,children:b.jsx(St,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:b.jsx(oA,{isPending:ye,className:"size-16",user:H?{name:Le.watch("name"),email:Le.watch("email"),image:H}:null,localization:i})})}),b.jsxs(WT,{align:"start",onCloseAutoFocus:ge=>ge.preventDefault(),children:[b.jsxs(ff,{onClick:Nt,disabled:ye,children:[b.jsx(z7,{}),i.UPLOAD_AVATAR]}),H&&b.jsxs(ff,{onClick:ze,disabled:ye,variant:"destructive",children:[b.jsx(G7,{}),i.DELETE_AVATAR]})]})]}),b.jsxs(St,{type:"button",variant:"outline",onClick:Nt,disabled:ye,children:[ye&&b.jsx(yn,{className:"animate-spin"}),i.UPLOAD]})]}),b.jsx(un,{})]})})]}),P?.includes("name")&&b.jsx(Ht,{control:Le.control,name:"name",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsxs(qt,{className:t?.label,children:[i.NAME,!A&&b.jsx("span",{className:"ml-1 text-muted-foreground",children:i.OPTIONAL_BRACKETS})]}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:"name",className:t?.input,placeholder:i.NAME_PLACEHOLDER,disabled:o,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),j&&b.jsx(Ht,{control:Le.control,name:"username",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsxs(qt,{className:t?.label,children:[i.USERNAME,!ne&&b.jsx("span",{className:"ml-1 text-muted-foreground",children:i.OPTIONAL_BRACKETS})]}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:"username",className:t?.input,placeholder:i.USERNAME_PLACEHOLDER,disabled:o,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:Le.control,name:"email",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:"email",className:t?.input,type:"email",placeholder:i.EMAIL_PLACEHOLDER,disabled:o,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:Le.control,name:"password",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:i.PASSWORD_PLACEHOLDER,disabled:o,enableToggle:!0,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),K&&b.jsx(Ht,{control:Le.control,name:"confirmPassword",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.CONFIRM_PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:i.CONFIRM_PASSWORD_PLACEHOLDER,disabled:o,enableToggle:!0,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),P?.filter(ge=>ge!=="name"&&ge!=="image").map(ge=>{const Re=y?.[ge];return Re?Re.type==="boolean"?b.jsx(Ht,{control:Le.control,name:ge,render:({field:ke})=>b.jsxs(Gt,{className:"flex",children:[b.jsx(nn,{children:b.jsx(w0,{checked:ke.value,onCheckedChange:ke.onChange,disabled:o})}),b.jsx(qt,{className:t?.label,children:Re.label}),b.jsx(un,{className:t?.error})]})},ge):b.jsx(Ht,{control:Le.control,name:ge,render:({field:ke})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:Re.label}),b.jsx(nn,{children:Re.type==="number"?b.jsx(Kr,{className:t?.input,type:"number",placeholder:Re.placeholder||(typeof Re.label=="string"?Re.label:""),disabled:o,...ke,value:ke.value}):Re.multiline?b.jsx(vV,{className:t?.input,placeholder:Re.placeholder||(typeof Re.label=="string"?Re.label:""),disabled:o,...ke,value:ke.value}):b.jsx(Kr,{className:t?.input,type:"text",placeholder:Re.placeholder||(typeof Re.label=="string"?Re.label:""),disabled:o,...ke,value:ke.value})}),b.jsx(un,{className:t?.error})]})},ge):(console.error(`Additional field ${ge} not found`),null)}),b.jsx(Mc,{ref:h,localization:i,action:"/sign-up/email"}),b.jsx(St,{type:"submit",disabled:o,className:fe("w-full",t?.button,t?.primaryButton),children:o?b.jsx(yn,{className:"animate-spin"}):i.SIGN_UP_ACTION})]})})}function tH({className:e,classNames:t,isSubmitting:n,localization:o,otpSeparators:i=0,redirectTo:l,setIsSubmitting:c}){var d;const f=qo(),h=f?Ri("totpURI"):null,g=E.useRef(!1),{authClient:p,basePath:y,hooks:{useSession:_},localization:S,twoFactor:w,viewPaths:T,toast:R,Link:A,localizeErrors:C}=E.useContext(qe);o={...S,...o};const{onSuccess:O,isPending:M}=Eo({redirectTo:l}),{data:L}=_(),N=(d=L?.user)==null?void 0:d.twoFactorEnabled,[D,z]=E.useState(w?.length===1?w[0]:null),[W,G]=E.useState(!1),[K,j]=E.useState(0),ne=bn({code:He().min(1,{message:`${o.ONE_TIME_PASSWORD} ${o.IS_REQUIRED}`}).min(6,{message:`${o.ONE_TIME_PASSWORD} ${o.IS_INVALID}`}),trustDevice:Cv().optional()}),ae=vo({resolver:yo(ne),defaultValues:{code:""}});n=n||ae.formState.isSubmitting||M,E.useEffect(()=>{c?.(ae.formState.isSubmitting||M)},[ae.formState.isSubmitting,M,c]),E.useEffect(()=>{D==="otp"&&K<=0&&!g.current&&(g.current=!0,P())},[D]),E.useEffect(()=>{if(K<=0)return;const H=setTimeout(()=>{j(re=>re-1)},1e3);return()=>clearTimeout(H)},[K]);const P=async()=>{if(!(W||K>0)){try{G(!0),await p.twoFactor.sendOtp({fetchOptions:{throw:!0}}),j(60)}catch(H){R({variant:"error",message:kt({error:H,localization:o,localizeErrors:C})}),H.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}g.current=!1,G(!1)}};async function F({code:H,trustDevice:re}){try{await(D==="totp"?p.twoFactor.verifyTotp:p.twoFactor.verifyOtp)({code:H,trustDevice:re,fetchOptions:{throw:!0}}),await O(),L&&!N&&R({variant:"success",message:o?.TWO_FACTOR_ENABLED})}catch(ye){R({variant:"error",message:kt({error:ye,localization:o,localizeErrors:C})}),ae.reset()}}return b.jsx(_o,{...ae,children:b.jsxs("form",{onSubmit:ae.handleSubmit(F),className:fe("grid w-full gap-6",e,t?.base),children:[w?.includes("totp")&&h&&D==="totp"&&b.jsxs("div",{className:"space-y-3",children:[b.jsx(QT,{className:t?.label,children:o.TWO_FACTOR_TOTP_LABEL}),b.jsx(J$,{className:fe("border shadow-xs",t?.qrCode),value:h})]}),D!==null&&b.jsxs(b.Fragment,{children:[b.jsx(Ht,{control:ae.control,name:"code",render:({field:H})=>b.jsxs(Gt,{children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx(qt,{className:t?.label,children:o.ONE_TIME_PASSWORD}),b.jsx(A,{className:fe("text-sm hover:underline",t?.forgotPasswordLink),href:`${y}/${T.RECOVER_ACCOUNT}${f?window.location.search:""}`,children:o.FORGOT_AUTHENTICATOR})]}),b.jsx(nn,{children:b.jsx(x0,{...H,maxLength:6,onChange:re=>{H.onChange(re),re.length===6&&ae.handleSubmit(F)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:b.jsx(R0,{otpSeparators:i})})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:ae.control,name:"trustDevice",render:({field:H})=>b.jsxs(Gt,{className:"flex",children:[b.jsx(nn,{children:b.jsx(w0,{checked:H.value,onCheckedChange:H.onChange,disabled:n,className:t?.checkbox})}),b.jsx(qt,{className:t?.label,children:o.TRUST_DEVICE})]})})]}),b.jsxs("div",{className:"grid gap-4",children:[D!==null&&b.jsxs(St,{type:"submit",disabled:n,className:fe(t?.button,t?.primaryButton),children:[n&&b.jsx(yn,{className:"animate-spin"}),o.TWO_FACTOR_ACTION]}),D==="otp"&&w?.includes("otp")&&b.jsxs(St,{type:"button",variant:"outline",onClick:P,disabled:K>0||W||n,className:fe(t?.button,t?.outlineButton),children:[W?b.jsx(yn,{className:"animate-spin"}):b.jsx(WE,{className:t?.icon}),o.RESEND_CODE,K>0&&` (${K})`]}),D!=="otp"&&w?.includes("otp")&&b.jsxs(St,{type:"button",variant:"secondary",className:fe(t?.button,t?.secondaryButton),onClick:()=>z("otp"),disabled:n,children:[b.jsx(WE,{className:t?.icon}),o.SEND_VERIFICATION_CODE]}),D!=="totp"&&w?.includes("totp")&&b.jsxs(St,{type:"button",variant:"secondary",className:fe(t?.button,t?.secondaryButton),onClick:()=>z("totp"),disabled:n,children:[b.jsx(H7,{className:t?.icon}),o.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function iA({redirectTo:e}){const t=E.useRef(!1),{authClient:n,basePath:o,viewPaths:i}=E.useContext(qe),{onSuccess:l}=Eo({redirectTo:e||`${o}/${i.SIGN_IN}`});return E.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(l))},[n,l]),b.jsx(yn,{className:"animate-spin"})}function nH({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,pathname:l,redirectTo:c,view:d,otpSeparators:f=0,setIsSubmitting:h}){const{basePath:g,credentials:p,localization:y,magicLink:_,emailOTP:S,signUp:w,twoFactor:T,viewPaths:R,replace:A}=E.useContext(qe),C=!!w;if(i={...y,...i},E.useEffect(()=>{l&&!Ig(R,l)&&(console.error(`Invalid auth view: ${l}`),A(`${g}/${R.SIGN_IN}${window.location.search}`))},[l,R,g,A]),d=d||Ig(R,l)||"SIGN_IN",E.useEffect(()=>{let O=!1;d==="MAGIC_LINK"&&(!_||!p&&!S)&&(O=!0),d==="EMAIL_OTP"&&(!S||!p&&!_)&&(O=!0),d==="SIGN_UP"&&!C&&(O=!0),!p&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(d)&&(O=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(d)&&!T&&(O=!0),O&&A(`${g}/${R.SIGN_IN}${window.location.search}`)},[g,d,R,p,A,S,C,_,T]),d==="SIGN_OUT")return b.jsx(iA,{redirectTo:c});if(d==="CALLBACK")return b.jsx(aA,{redirectTo:c});if(d==="SIGN_IN")return p?b.jsx(JV,{className:e,classNames:t,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h}):_?b.jsx(_w,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h}):S?b.jsx(bw,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h}):null;if(d==="TWO_FACTOR")return b.jsx(tH,{className:e,classNames:t,localization:i,otpSeparators:f,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="RECOVER_ACCOUNT")return b.jsx(QV,{className:e,classNames:t,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="MAGIC_LINK")return b.jsx(_w,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="EMAIL_OTP")return b.jsx(bw,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="EMAIL_VERIFICATION")return b.jsx(KV,{className:e,classNames:t,callbackURL:n,localization:i,otpSeparators:f,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="FORGOT_PASSWORD")return b.jsx(WV,{className:e,classNames:t,localization:i,isSubmitting:o,setIsSubmitting:h});if(d==="RESET_PASSWORD")return b.jsx(XV,{className:e,classNames:t,localization:i});if(d==="SIGN_UP")return C&&b.jsx(eH,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h})}function rH({className:e,classNames:t,localization:n}){const{localization:o,redirectTo:i,replace:l,toast:c}=E.useContext(qe),d=E.useMemo(()=>({...o,...n}),[o,n]),{data:f}=oV(),[h,g]=E.useState(null);return E.useEffect(()=>{const p=Ri("invitationId");if(!p){c({variant:"error",message:d.INVITATION_NOT_FOUND}),l(i);return}g(p)},[d.INVITATION_NOT_FOUND,c,l,i]),!f||!h?b.jsx(sA,{className:e,classNames:t}):b.jsx(oH,{className:e,classNames:t,localization:d,invitationId:h})}function oH({className:e,classNames:t,localization:n,invitationId:o}){var i;const{authClient:l,hooks:{useInvitation:c},localization:d,organization:f,redirectTo:h,replace:g,toast:p,localizeErrors:y}=E.useContext(qe),_=E.useMemo(()=>({...d,...n}),[d,n]),[S,w]=E.useState(!1),[T,R]=E.useState(!1),A=S||T,{data:C,isPending:O}=c({query:{id:o}}),M=E.useCallback(()=>Ri("redirectTo")||h,[h]);E.useEffect(()=>{if(!(O||!o)){if(!C){p({variant:"error",message:_.INVITATION_NOT_FOUND}),g(h);return}(C.status!=="pending"||new Date(C.expiresAt)<new Date)&&(p({variant:"error",message:new Date(C.expiresAt)<new Date?_.INVITATION_EXPIRED:_.INVITATION_NOT_FOUND}),g(h))}},[C,O,o,_,p,g,h]);const L=async()=>{R(!0);try{await l.organization.acceptInvitation({invitationId:o,fetchOptions:{throw:!0}}),p({variant:"success",message:_.INVITATION_ACCEPTED||"Invitation accepted"}),g(M())}catch(G){p({variant:"error",message:kt({error:G,localization:_,localizeErrors:y})}),R(!1)}},N=async()=>{w(!0);try{await l.organization.rejectInvitation({invitationId:o,fetchOptions:{throw:!0}}),p({variant:"success",message:_.INVITATION_REJECTED}),g(h)}catch(G){p({variant:"error",message:kt({error:G,localization:_,localizeErrors:y})}),w(!1)}},W=((i=[...[{role:"owner",label:_.OWNER},{role:"admin",label:_.ADMIN},{role:"member",label:_.MEMBER}],...f?.customRoles||[]].find(G=>G.role===C?.role))==null?void 0:i.label)||C?.role;return C?b.jsxs(Si,{className:fe("w-full max-w-sm",e,t?.base),children:[b.jsxs(Bf,{className:fe("justify-items-center text-center",t?.header),children:[b.jsx(E0,{className:fe("text-lg md:text-xl",t?.title),children:_.ACCEPT_INVITATION}),b.jsx(Ff,{className:fe("text-xs md:text-sm",t?.description),children:_.ACCEPT_INVITATION_DESCRIPTION})]}),b.jsxs($f,{className:fe("flex flex-col gap-6 truncate",t?.content),children:[b.jsxs(Si,{className:fe("flex-row items-center p-4"),children:[b.jsx(rA,{organization:{id:C.organizationId,name:C.organizationName,slug:C.organizationSlug,logo:C.organizationLogo,createdAt:new Date},localization:_}),b.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:W})]}),b.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b.jsxs(St,{variant:"outline",className:fe(t?.button,t?.outlineButton),onClick:N,disabled:A,children:[S?b.jsx(yn,{className:"animate-spin"}):b.jsx(HR,{}),_.REJECT]}),b.jsxs(St,{className:fe(t?.button,t?.primaryButton),onClick:L,disabled:A,children:[T?b.jsx(yn,{className:"animate-spin"}):b.jsx(Lv,{}),_.ACCEPT]})]})]})]}):b.jsx(sA,{className:e,classNames:t})}var sA=({className:e,classNames:t,localization:n})=>b.jsxs(Si,{className:fe("w-full max-w-sm",e,t?.base),children:[b.jsxs(Bf,{className:fe("justify-items-center",t?.header),children:[b.jsx(gr,{className:fe("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),b.jsx(gr,{className:fe("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),b.jsxs($f,{className:fe("flex flex-col gap-6 truncate",t?.content),children:[b.jsxs(Si,{className:fe("flex-row items-center p-4"),children:[b.jsx(rA,{isPending:!0,localization:n}),b.jsx(gr,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),b.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b.jsx(gr,{className:"h-9 w-full"}),b.jsx(gr,{className:"h-9 w-full"})]})]})]});function Ew({className:e,orientation:t="horizontal",decorative:n=!0,...o}){return b.jsx(rV,{"data-slot":"separator",decorative:n,orientation:t,className:fe("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function aH({classNames:e,isSubmitting:t,localization:n,view:o}){var i,l,c,d;const{viewPaths:f,navigate:h,basePath:g}=E.useContext(qe);return b.jsxs(St,{className:fe("w-full",(i=e?.form)==null?void 0:i.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>h(`${g}/${o==="EMAIL_OTP"?f.SIGN_IN:f.EMAIL_OTP}${window.location.search}`),children:[o==="EMAIL_OTP"?b.jsx($R,{className:(c=e?.form)==null?void 0:c.icon}):b.jsx(VR,{className:(d=e?.form)==null?void 0:d.icon}),n.SIGN_IN_WITH," ",o==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function iH({classNames:e,isSubmitting:t,localization:n,view:o}){var i,l,c,d;const{viewPaths:f,navigate:h,basePath:g,credentials:p}=E.useContext(qe);return b.jsxs(St,{className:fe("w-full",(i=e?.form)==null?void 0:i.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>h(`${g}/${o==="MAGIC_LINK"||!p?f.SIGN_IN:f.MAGIC_LINK}${window.location.search}`),children:[o==="MAGIC_LINK"?b.jsx($R,{className:(c=e?.form)==null?void 0:c.icon}):b.jsx(VR,{className:(d=e?.form)==null?void 0:d.icon}),n.SIGN_IN_WITH," ",o==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function sH({localization:e,redirectTo:t}){const{authClient:n,localization:o,toast:i,localizeErrors:l}=E.useContext(qe),c=E.useRef(!1);e=E.useMemo(()=>({...o,...e}),[o,e]);const{onSuccess:d}=Eo({redirectTo:t});return E.useEffect(()=>{if(!c.current){c.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:d}})}catch(f){i({variant:"error",message:kt({error:f,localization:e,localizeErrors:l})})}}},[n,e,l,d,i]),null}function lH({classNames:e,isSubmitting:t,localization:n,redirectTo:o,setIsSubmitting:i}){var l,c;const{authClient:d,localization:f,toast:h,localizeErrors:g}=E.useContext(qe);n={...f,...n};const{onSuccess:p}=Eo({redirectTo:o}),y=async()=>{i?.(!0);try{const _=await d.signIn.passkey({fetchOptions:{throw:!0}});_?.error?(h({variant:"error",message:kt({error:_.error,localization:n,localizeErrors:g})}),i?.(!1)):p()}catch(_){h({variant:"error",message:kt({error:_,localization:n,localizeErrors:g})}),i?.(!1)}};return b.jsxs(St,{className:fe("w-full",(l=e?.form)==null?void 0:l.button,(c=e?.form)==null?void 0:c.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:y,children:[b.jsx($7,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function Sw({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,other:l,provider:c,redirectTo:d,socialLayout:f,setIsSubmitting:h}){var g,p,y,_;const{authClient:S,basePath:w,baseURL:T,persistClient:R,redirectTo:A,viewPaths:C,social:O,genericOAuth:M,toast:L,localizeErrors:N}=E.useContext(qe),D=E.useCallback(()=>d||Ri("redirectTo")||A,[d,A]),z=E.useCallback(()=>`${T}${n||(R?`${w}/${C.CALLBACK}?redirectTo=${encodeURIComponent(D())}`:D())}`,[n,R,w,C,T,D]),W=async()=>{h(!0);try{if(l){const G={providerId:c.provider,callbackURL:z(),fetchOptions:{throw:!0}};M?.signIn?(await M.signIn(G),setTimeout(()=>{h(!1)},1e4)):await S.signIn.oauth2(G)}else{const G={provider:c.provider,callbackURL:z(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(G),setTimeout(()=>{h(!1)},1e4)):await S.signIn.social(G)}}catch(G){L({variant:"error",message:kt({error:G,localization:i,localizeErrors:N})}),h(!1)}};return b.jsxs(St,{className:fe(f==="vertical"?"w-full":"grow",e,(g=t?.form)==null?void 0:g.button,(p=t?.form)==null?void 0:p.outlineButton,(y=t?.form)==null?void 0:y.providerButton),disabled:o,variant:"outline",onClick:W,children:[c.icon&&b.jsx(c.icon,{className:(_=t?.form)==null?void 0:_.icon}),f==="grid"&&c.name,f==="vertical"&&`${i.SIGN_IN_WITH} ${c.name}`]})}function hG({className:e,classNames:t,callbackURL:n,cardHeader:o,cardFooter:i,localization:l,path:c,pathname:d,redirectTo:f,socialLayout:h="auto",view:g,otpSeparators:p=0}){var y,_,S,w,T,R;const A=qo(),{basePath:C,credentials:O,localization:M,magicLink:L,emailOTP:N,oneTap:D,passkey:z,signUp:W,social:G,genericOAuth:K,viewPaths:j,Link:ne}=E.useContext(qe);l={...M,...l};let ae=h;ae==="auto"&&(ae=O&&G?.providers&&G.providers.length>2?"horizontal":"vertical");const P=c??d?.split("/").pop(),F=g||Ig(j,P)||"SIGN_IN",[H,re]=E.useState(!1);if(E.useEffect(()=>{const k=()=>re(!1);return window.addEventListener("pagehide",k),()=>{re(!1),window.removeEventListener("pagehide",k)}},[]),F==="CALLBACK")return b.jsx(aA,{redirectTo:f});if(F==="SIGN_OUT")return b.jsx(iA,{redirectTo:f});if(F==="ACCEPT_INVITATION")return b.jsx(rH,{className:e,classNames:t});const ye=!O&&!L&&!N?l.DISABLED_CREDENTIALS_DESCRIPTION:l[`${F}_DESCRIPTION`];return b.jsxs(Si,{className:fe("w-full max-w-sm",e,t?.base),children:[b.jsx(Bf,{className:t?.header,children:o||b.jsxs(b.Fragment,{children:[b.jsx(E0,{className:fe("text-lg md:text-xl",t?.title),children:l[F]}),ye&&b.jsx(Ff,{className:fe("text-xs md:text-sm",t?.description),children:ye})]})}),b.jsxs($f,{className:fe("grid gap-6",t?.content),children:[D&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(F)&&b.jsx(sH,{localization:l,redirectTo:f}),(O||L||N)&&b.jsxs("div",{className:"grid gap-4",children:[b.jsx(nH,{classNames:t?.form,callbackURL:n,isSubmitting:H,localization:l,otpSeparators:p,view:F,redirectTo:f,setIsSubmitting:re}),L&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(F)||N&&F==="EMAIL_OTP")&&b.jsx(iH,{classNames:t,localization:l,view:F,isSubmitting:H}),N&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(F)||L&&["SIGN_IN","MAGIC_LINK"].includes(F))&&b.jsx(aH,{classNames:t,localization:l,view:F,isSubmitting:H})]}),F!=="RESET_PASSWORD"&&F!=="EMAIL_VERIFICATION"&&(((y=G?.providers)==null?void 0:y.length)||((_=K?.providers)==null?void 0:_.length)||F==="SIGN_IN"&&z)&&b.jsxs(b.Fragment,{children:[(O||L||N)&&b.jsxs("div",{className:fe("flex items-center gap-2",t?.continueWith),children:[b.jsx(Ew,{className:fe("!w-auto grow",t?.separator)}),b.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:l.OR_CONTINUE_WITH}),b.jsx(Ew,{className:fe("!w-auto grow",t?.separator)})]}),b.jsxs("div",{className:"grid gap-4",children:[(((S=G?.providers)==null?void 0:S.length)||((w=K?.providers)==null?void 0:w.length))&&b.jsxs("div",{className:fe("flex w-full items-center justify-between gap-4",ae==="horizontal"&&"flex-wrap",ae==="vertical"&&"flex-col",ae==="grid"&&"grid grid-cols-2"),children:[(T=G?.providers)==null?void 0:T.map(k=>{const Q=FV.find(ee=>ee.provider===k);return Q?b.jsx(Sw,{classNames:t,callbackURL:n,isSubmitting:H,localization:l,provider:Q,redirectTo:f,setIsSubmitting:re,socialLayout:ae},k):null}),(R=K?.providers)==null?void 0:R.map(k=>b.jsx(Sw,{classNames:t,callbackURL:n,isSubmitting:H,localization:l,provider:k,redirectTo:f,setIsSubmitting:re,socialLayout:ae,other:!0},k.provider))]}),z&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(F)&&b.jsx(lH,{classNames:t,isSubmitting:H,localization:l,redirectTo:f,setIsSubmitting:re})]})]})]}),i&&b.jsx(ov,{className:t?.footer,children:i}),O&&W&&b.jsxs(ov,{className:fe("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"?l.DONT_HAVE_AN_ACCOUNT:F==="SIGN_UP"?l.ALREADY_HAVE_AN_ACCOUNT:b.jsx(k7,{className:"size-3"}),F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"||F==="SIGN_UP"?b.jsx(ne,{className:fe("text-foreground underline",t?.footerLink),href:`${C}/${j[F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${A?window.location.search:""}`,children:b.jsx(St,{variant:"link",size:"sm",className:fe("px-0 text-foreground underline",t?.footerLink),children:F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"?l.SIGN_UP:l.SIGN_IN})}):b.jsx(St,{variant:"link",size:"sm",className:fe("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:l.GO_BACK})]})]})}function pG({children:e}){const{hooks:{useSession:t}}=E.useContext(qe),{isPending:n}=t();return n?e:null}function mG({children:e}){const{hooks:{useSession:t}}=E.useContext(qe),{data:n}=t();return n?e:null}function gG({children:e}){const{hooks:{useSession:t}}=E.useContext(qe),{data:n,isPending:o}=t();return!n&&!o?e:null}function cH(e){const t=hf.c(8),{children:n}=e,o=yc();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={basePath:"/",pathMode:"slug"},t[0]=i):i=t[0];let l,c;t[1]!==o?(l=f=>o({to:f}),c=f=>o({to:f,replace:!0}),t[1]=o,t[2]=l,t[3]=c):(l=t[2],c=t[3]);let d;return t[4]!==n||t[5]!==l||t[6]!==c?(d=b.jsx(N7,{authClient:A6,organization:i,navigate:l,replace:c,Link:uH,children:n}),t[4]=n,t[5]=l,t[6]=c,t[7]=d):d=t[7],d}function uH(e){const{href:t,className:n,children:o,...i}=e;return b.jsx(_v,{to:t,className:n,...i,children:o})}const dH=new n3;function fH(e){const t=hf.c(3),{children:n}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(l7,{}),t[0]=o):o=t[0];let i;return t[1]!==n?(i=b.jsxs(o3,{client:dH,children:[o,b.jsx(_3,{children:b.jsx(cH,{children:n})})]}),t[1]=n,t[2]=i):i=t[2],i}const hH=function(){return null};function pH(){const e=hf.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=b.jsx("div",{className:"flex items-center justify-center min-h-screen",children:b.jsx("div",{className:"text-gray-500",children:"Loading..."})}),e[0]=t):t=e[0],t}const Nc=VI({component:()=>b.jsxs(fH,{children:[b.jsx(E.Suspense,{fallback:b.jsx(pH,{}),children:b.jsx(rx,{})}),b.jsx(hH,{})]})}),mH=Tn({getParentRoute:()=>Nc,path:"/login",component:Ln(()=>Dn(()=>import("./login-CJi6KFGq.js"),__vite__mapDeps([0,1,2,3]))),validateSearch:Ba(()=>bn({next:He().optional(),client_id:He().optional(),redirect_uri:He().optional(),response_type:He().optional(),state:He().optional(),scope:He().optional(),code_challenge:He().optional(),code_challenge_method:He().optional()}))}),gH=Tn({getParentRoute:()=>Nc,path:"/auth/$pathname",component:Ln(()=>Dn(()=>import("./auth-catchall-CohlC3Pb.js"),[]))}),zr=Tn({getParentRoute:()=>Nc,id:"shell",component:Ln(()=>Dn(()=>import("./shell-layout-BLjMALRt.js"),__vite__mapDeps([4,5,2,6,7,1,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,3,40])))}),vH=Tn({getParentRoute:()=>zr,path:"/",component:Ln(()=>Dn(()=>import("./home-BzOK0WeX.js"),__vite__mapDeps([41,25,2,40,22,12,1,3,37,38,39,27])))}),yH=Tn({getParentRoute:()=>zr,path:"/$org",component:Ln(()=>Dn(()=>import("./page-DmmG4y1n.js"),__vite__mapDeps([42,6,2,7,1,43,44,15,45,46,35,47,9,48,12,10,20,49,50,21,51,52,53])))}),bH=Tn({getParentRoute:()=>zr,path:"/$org/members",component:Ln(()=>Dn(()=>import("./members-UHyk3Nn4.js"),__vite__mapDeps([54,43,44,1,2,15,7,45,46,55,5,3,56,57,6,58,59,60,61,9,40,52,38,16,13,62,11,12,34,35,39,17,18,25,63,64])))}),_H=Tn({getParentRoute:()=>zr,path:"/$org/mcps",component:Ln(()=>Dn(()=>import("./connections-DoAE9QhX.js"),__vite__mapDeps([65,43,44,1,2,15,7,45,46,55,5,3,56,24,25,6,35,66,19,38,52,16,13,39,63,67,12,34,11,23,17,18,68]))),validateSearch:Ba(()=>bn({action:Of(["create"]).optional()}))}),EH=Tn({getParentRoute:()=>zr,path:"/$org/settings",component:Ln(()=>Dn(()=>import("./settings-UndPSfwX.js"),__vite__mapDeps([69,43,44,1,2,15,7,45,46,39,3,70,13])))}),SH=Tn({getParentRoute:()=>zr,path:"/$org/monitoring",component:Ln(()=>Dn(()=>import("./monitoring-65mgE8O0.js"),__vite__mapDeps([71,6,2,7,1,43,44,15,45,46,55,5,3,35,49,50,21,51,52,18,20,60,47,9,58,72,32,17,33,73]))),validateSearch:Ba(()=>bn({from:He().default("now-24h"),to:He().default("now"),connectionId:Tg(He()).optional().default([]),gatewayId:Tg(He()).optional().default([]),tool:He().default(""),status:Of(["all","success","errors"]).default("all"),search:He().default(""),page:MR().optional(),streaming:Cv().default(!0)}))}),lA=Tn({getParentRoute:()=>zr,path:"/$org/store",component:Ln(()=>Dn(()=>import("./store-CGyOcqhE.js"),__vite__mapDeps([74,61,43,44,1,2,15,7,45,6,75,76,11,5,55,3,25,77,78,17,18,12,24,30,31,8,9])))}),wH=Tn({getParentRoute:()=>lA,path:"/$appName",component:Ln(()=>Dn(()=>import("./store-app-detail-BQ4UUaoG.js"),__vite__mapDeps([79,22,11,1,2,59,6,7,80,18,12,15,26,5,81,9,28,77,44,45,55,3,56,25,82,83,84,52,30,31,47,85,86,68,75,78,29]))),validateSearch:Ba(()=>bn({registryId:He().optional(),serverName:He().optional(),itemId:He().optional()}))}),xH=Tn({getParentRoute:()=>zr,path:"/$org/mcps/$connectionId",component:Ln(()=>Dn(()=>import("./connection-detail-C_uPOJ6z.js"),__vite__mapDeps([87,5,2,35,1,6,7,30,31,88,89,36,67,3,12,34,47,9,28,64,11,82,59,39,17,18,23,20,15,10,90,86,77,68,50,72,91,84,52,44,45,55,25,21,63,66,19,56,76,38,81,83]))),validateSearch:Ba(()=>bn({tab:He().optional()}))}),RH=Tn({getParentRoute:()=>zr,path:"/$org/mcps/$connectionId/$collectionName/$itemId",component:Ln(()=>Dn(()=>import("./collection-detail-Dvc6iyHF.js"),__vite__mapDeps([92,6,2,7,1,14,15,16,13,10,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,35,8,9,39,3,11,12,70,82,59,33,51,62,88,89,36,67,34,47,64,90,86,77,68,50,72,85,45,48,73,52]))),validateSearch:Ba(()=>bn({replayId:He().optional()}))}),OH=Tn({getParentRoute:()=>zr,path:"/$org/gateways",component:Ln(()=>Dn(()=>import("./gateways-BAQA-e5y.js"),__vite__mapDeps([93,43,44,1,2,15,7,45,46,55,5,3,56,24,25,6,35,20,66,19,38,52,10,63,11,34]))),validateSearch:Ba(()=>bn({action:Of(["create"]).optional()}))}),TH=Tn({getParentRoute:()=>zr,path:"/$org/gateways/$gatewayId",component:Ln(()=>Dn(()=>import("./gateway-detail-ZknLelfM.js"),__vite__mapDeps([94,5,2,35,1,6,7,57,58,59,55,3,12,13,20,91,90,21,10,29,11,39,17,18,84,52,75,82]))),validateSearch:Ba(()=>bn({tab:He().optional()}))}),AH=Tn({getParentRoute:()=>Nc,path:"/oauth/callback",component:Ln(()=>Dn(()=>import("./oauth-callback-KqixmXKf.js"),__vite__mapDeps([95,25,2,22,80,11,89,31])))}),CH=lA.addChildren([wH]),IH=zr.addChildren([vH,yH,bH,_H,OH,TH,SH,CH,EH,xH,RH]),MH=Nc.addChildren([IH,mH,gH,AH]),NH=XI({routeTree:MH}),DH=document.getElementById("root");M4.createRoot(DH).render(b.jsx(E.StrictMode,{children:b.jsx(t5,{router:NH})}));export{lB as $,hG as A,Ge as B,Jj as C,aG as D,$ as E,Oi as F,SV as G,lO as H,Lz as I,k2 as J,y3 as K,Dz as L,zH as M,UH as N,Xj as O,Qj as P,bx as Q,Kj as R,pH as S,e9 as T,fG as U,Tg as V,QH as W,Cv as X,r3 as Y,cB as Z,uB as _,A6 as a,Ac as a$,Of as a0,dn as a1,Zo as a2,Qr as a3,Wr as a4,Q2 as a5,iO as a6,Ma as a7,_z as a8,qv as a9,HR as aA,G7 as aB,P2 as aC,V7 as aD,F7 as aE,dG as aF,lP as aG,FH as aH,$P as aI,tG as aJ,eG as aK,Ba as aL,HH as aM,MR as aN,XH as aO,Og as aP,KH as aQ,ZH as aR,Wj as aS,_v as aT,W7 as aU,gM as aV,oT as aW,iT as aX,JU as aY,RB as aZ,K2 as a_,y2 as aa,Zv as ab,dc as ac,c2 as ad,Gv as ae,Hv as af,Ez as ag,Sz as ah,LH as ai,wi as aj,Xw as ak,yf as al,av as am,ja as an,Vo as ao,K4 as ap,z_ as aq,kH as ar,PH as as,g3 as at,f3 as au,er as av,Cn as aw,Dn as ax,nB as ay,ex as az,bv as b,Ec as b0,GH as b1,DR as b2,Av as b3,JH as b4,vP as b5,WH as b6,FP as b7,GP as b8,Iv as b9,m3 as bA,U_ as bB,p3 as bC,d3 as bD,K7 as bE,X7 as bF,Af as bG,Bv as bH,oc as bI,J4 as bJ,Tw as bK,YH as bL,h8 as bM,BE as bN,QL as bO,$H as bP,BH as bQ,p8 as bR,ZP as ba,LM as bb,qH as bc,VH as bd,rG as be,oG as bf,nG as bg,qU as bh,ZU as bi,YU as bj,KU as bk,WU as bl,lG as bm,cG as bn,uG as bo,sG as bp,vc as bq,On as br,dg as bs,Rw as bt,a3 as bu,l3 as bv,h3 as bw,c3 as bx,u3 as by,Qn as bz,hf as c,yv as d,Jn as e,yc as f,iG as g,_k as h,r2 as i,b as j,rV as k,qe as l,pG as m,mG as n,gG as o,v3 as p,rx as q,E as r,bn as s,GE as t,jH as u,He as v,yo as w,vo as x,Sc as y,zt as z};
|
|
156
|
+
`}),b.jsx(M$,{ref:e,sitekey:t.siteKey,theme:n,hl:o,size:t.provider==="google-recaptcha-v2-invisible"?"invisible":"normal",className:fe(t.provider==="google-recaptcha-v2-invisible"?"absolute":"mx-auto h-[76px] w-[302px] overflow-hidden rounded bg-muted")},`${n}-${o}-${t.provider}`)]}):null}var qV=["/sign-up/email","/sign-in/email","/forget-password"];function Mc({ref:e,localization:t,action:n}){const{captcha:o}=E.useContext(qe);if(!o||n&&!(o.endpoints||qV).includes(n))return null;const{theme:i}=Dv(),l=o.provider==="google-recaptcha-v2-checkbox"||o.provider==="google-recaptcha-v2-invisible",c=o.provider==="google-recaptcha-v3"||o.provider==="google-recaptcha-v2-invisible",d=o.provider==="cloudflare-turnstile",f=o.provider==="hcaptcha",h=o.provider==="captchafox";return b.jsxs(b.Fragment,{children:[l&&b.jsx(GV,{ref:e}),c&&b.jsx(HV,{localization:t}),d&&b.jsx(jT,{className:"mx-auto",ref:e,siteKey:o.siteKey,options:{theme:i,size:"flexible"}}),f&&b.jsx("div",{className:"mx-auto",children:b.jsx(a$,{ref:e,sitekey:o.siteKey,theme:i})}),h&&b.jsx("div",{className:"mx-auto",children:b.jsx(TT,{ref:e,sitekey:o.siteKey,theme:i})})]})}function x0({className:e,containerClassName:t,...n}){return b.jsx($T,{"data-slot":"input-otp",containerClassName:fe("flex items-center gap-2 has-disabled:opacity-50",t),className:fe("disabled:cursor-not-allowed",e),...n})}function Es({className:e,...t}){return b.jsx("div",{"data-slot":"input-otp-group",className:fe("flex items-center",e),...t})}function pn({index:e,className:t,...n}){const o=E.useContext(FT),{char:i,hasFakeCaret:l,isActive:c}=o?.slots[e]??{};return b.jsxs("div",{"data-slot":"input-otp-slot","data-active":c,className:fe("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...n,children:[i,l&&b.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:b.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function cg({...e}){return b.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...e,children:b.jsx(V7,{})})}function R0({otpSeparators:e=0}){return e===0?b.jsxs(Es,{children:[b.jsx(pn,{index:0}),b.jsx(pn,{index:1}),b.jsx(pn,{index:2}),b.jsx(pn,{index:3}),b.jsx(pn,{index:4}),b.jsx(pn,{index:5})]}):e===1?b.jsxs(b.Fragment,{children:[b.jsxs(Es,{children:[b.jsx(pn,{index:0}),b.jsx(pn,{index:1}),b.jsx(pn,{index:2})]}),b.jsx(cg,{}),b.jsxs(Es,{children:[b.jsx(pn,{index:3}),b.jsx(pn,{index:4}),b.jsx(pn,{index:5})]})]}):b.jsxs(b.Fragment,{children:[b.jsxs(Es,{children:[b.jsx(pn,{index:0}),b.jsx(pn,{index:1})]}),b.jsx(cg,{}),b.jsxs(Es,{children:[b.jsx(pn,{index:2}),b.jsx(pn,{index:3})]}),b.jsx(cg,{}),b.jsxs(Es,{children:[b.jsx(pn,{index:4}),b.jsx(pn,{index:5})]})]})}function bw(e){const[t,n]=E.useState();return t?b.jsx(YV,{...e,email:t}):b.jsx(ZV,{...e,setEmail:n})}function ZV({className:e,classNames:t,isSubmitting:n,localization:o,setIsSubmitting:i,setEmail:l}){const c=qo(),{captchaRef:d,getCaptchaHeaders:f}=Ic({localization:o}),{authClient:h,localization:g,toast:p,localizeErrors:y}=E.useContext(qe);o={...g,...o};const _=bn({email:He().email({message:`${o.EMAIL} ${o.IS_INVALID}`})}),S=vo({resolver:yo(_),defaultValues:{email:""}});n=n||S.formState.isSubmitting,E.useEffect(()=>{i?.(S.formState.isSubmitting)},[S.formState.isSubmitting,i]);async function w({email:T}){const R={throw:!0,headers:await f("/email-otp/send-verification-otp")};try{await h.emailOtp.sendVerificationOtp({email:T,type:"sign-in",fetchOptions:R}),p({variant:"success",message:o.EMAIL_OTP_VERIFICATION_SENT}),l(T)}catch(A){p({variant:"error",message:kt({error:A,localization:o,localizeErrors:y})})}}return b.jsx(_o,{...S,children:b.jsxs("form",{onSubmit:S.handleSubmit(w),noValidate:c,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:S.control,name:"email",render:({field:T})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:n,...T})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Mc,{ref:d,localization:o,action:"/email-otp/send-verification-otp"}),b.jsx(St,{type:"submit",disabled:n,className:fe("w-full",t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.EMAIL_OTP_SEND_ACTION})]})})}function YV({className:e,classNames:t,isSubmitting:n,localization:o,otpSeparators:i=0,redirectTo:l,setIsSubmitting:c,email:d}){const{authClient:f,localization:h,toast:g,localizeErrors:p}=E.useContext(qe);o={...h,...o};const{onSuccess:y,isPending:_}=Eo({redirectTo:l}),S=bn({code:He().min(1,{message:`${o.EMAIL_OTP} ${o.IS_REQUIRED}`}).min(6,{message:`${o.EMAIL_OTP} ${o.IS_INVALID}`})}),w=vo({resolver:yo(S),defaultValues:{code:""}});n=n||w.formState.isSubmitting||_,E.useEffect(()=>{c?.(w.formState.isSubmitting||_)},[w.formState.isSubmitting,_,c]);async function T({code:R}){try{await f.signIn.emailOtp({email:d,otp:R,fetchOptions:{throw:!0}}),await y()}catch(A){g({variant:"error",message:kt({error:A,localization:o,localizeErrors:p})}),w.reset()}}return b.jsx(_o,{...w,children:b.jsxs("form",{onSubmit:w.handleSubmit(T),className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:w.control,name:"code",render:({field:R})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.EMAIL_OTP}),b.jsx(nn,{children:b.jsx(x0,{...R,maxLength:6,onChange:A=>{R.onChange(A),A.length===6&&w.handleSubmit(T)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:b.jsx(R0,{otpSeparators:i})})}),b.jsx(un,{className:t?.error})]})}),b.jsx("div",{className:"grid gap-4",children:b.jsxs(St,{type:"submit",disabled:n,className:fe(t?.button,t?.primaryButton),children:[n&&b.jsx(yn,{className:"animate-spin"}),o.EMAIL_OTP_VERIFY_ACTION]})})]})})}function KV({onCancel:e,localization:t,className:n,classNames:o,otpSeparators:i,callbackURL:l,isSubmitting:c,redirectTo:d,setIsSubmitting:f}){const[h,g]=E.useState(!0),[p,y]=E.useState(30),{authClient:_,localization:S,toast:w,localizeErrors:T,navigate:R,basePath:A,viewPaths:C}=E.useContext(qe);t={...S,...t};const O=typeof window<"u"&&new URLSearchParams(window.location.search).get("email")||"",{onSuccess:M,isPending:L}=Eo({redirectTo:d}),N=bn({code:He().min(1,{message:`${t.EMAIL_OTP} ${t.IS_REQUIRED}`}).min(6,{message:`${t.EMAIL_OTP} ${t.IS_INVALID}`})}),D=vo({resolver:yo(N),defaultValues:{code:""}}),z=c||D.formState.isSubmitting||L;E.useEffect(()=>{f?.(D.formState.isSubmitting||L)},[D.formState.isSubmitting,L,f]),E.useEffect(()=>{if(p>0){const K=setTimeout(()=>y(p-1),1e3);return()=>clearTimeout(K)}else g(!1)},[p]);async function W({code:K}){try{const j=await _.emailOtp.verifyEmail({email:O,otp:K,fetchOptions:{throw:!0}});"token"in j&&j.token?await M():(R(`${A}/${C.SIGN_IN}${window.location.search}`),w({variant:"success",message:t.EMAIL_VERIFICATION_SUCCESS}))}catch(j){w({variant:"error",message:kt({error:j,localization:t,localizeErrors:T})}),D.reset()}}async function G(){if(!h){g(!0),y(30);try{await _.emailOtp.sendVerificationOtp({email:O,type:"email-verification",fetchOptions:{throw:!0}}),w({variant:"success",message:t.EMAIL_OTP_VERIFICATION_SENT})}catch(K){w({variant:"error",message:kt({error:K,localization:t,localizeErrors:T})}),g(!1),y(0)}}}return O?b.jsx(_o,{...D,children:b.jsxs("form",{onSubmit:D.handleSubmit(W),className:fe("grid w-full gap-6",n,o?.base),children:[b.jsx(Ht,{control:D.control,name:"code",render:({field:K})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:o?.label,children:t.EMAIL_OTP}),b.jsx(nn,{children:b.jsx(x0,{...K,maxLength:6,onChange:j=>{K.onChange(j),j.length===6&&D.handleSubmit(W)()},containerClassName:o?.otpInputContainer,className:o?.otpInput,disabled:z,children:b.jsx(R0,{otpSeparators:i})})}),b.jsx(un,{className:o?.error})]})}),b.jsxs("div",{className:"grid gap-4",children:[b.jsxs(St,{type:"submit",disabled:z,className:fe(o?.button,o?.primaryButton),children:[z&&b.jsx(yn,{className:"animate-spin"}),t.EMAIL_OTP_VERIFY_ACTION]}),b.jsx(St,{type:"button",variant:"outline",onClick:G,disabled:h||z,className:fe("w-full",o?.button),children:h?`${t.RESEND_VERIFICATION_EMAIL} (${p}s)`:t.RESEND_VERIFICATION_EMAIL}),e&&b.jsx(St,{type:"button",variant:"ghost",onClick:e,disabled:z,className:"w-full",children:t.CANCEL})]})]})}):b.jsx("div",{className:fe("grid w-full gap-6",n),children:b.jsxs("div",{className:"text-center",children:[b.jsx("h2",{className:"font-semibold text-destructive text-lg",children:"Invalid Request"}),b.jsx("p",{className:"text-muted-foreground text-sm",children:t.EMAIL_REQUIRED||"Email address is required"})]})})}function WV({className:e,classNames:t,isSubmitting:n,localization:o,setIsSubmitting:i}){const l=qo(),{captchaRef:c,getCaptchaHeaders:d,resetCaptcha:f}=Ic({localization:o}),{authClient:h,basePath:g,baseURL:p,localization:y,navigate:_,toast:S,viewPaths:w,localizeErrors:T}=E.useContext(qe);o={...y,...o};const R=bn({email:He().email({message:`${o.EMAIL} ${o.IS_INVALID}`}).min(1,{message:`${o.EMAIL} ${o.IS_REQUIRED}`})}),A=vo({resolver:yo(R),defaultValues:{email:""}});n=n||A.formState.isSubmitting,E.useEffect(()=>{i?.(A.formState.isSubmitting)},[A.formState.isSubmitting,i]);async function C({email:O}){try{const M={throw:!0,headers:await d("/forget-password")};await h.requestPasswordReset({email:O,redirectTo:`${p}${g}/${w.RESET_PASSWORD}`,fetchOptions:M}),S({variant:"success",message:o.FORGOT_PASSWORD_EMAIL}),_(`${g}/${w.SIGN_IN}${window.location.search}`)}catch(M){S({variant:"error",message:kt({error:M,localization:o,localizeErrors:T})}),f()}}return b.jsx(_o,{...A,children:b.jsxs("form",{onSubmit:A.handleSubmit(C),noValidate:l,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:A.control,name:"email",render:({field:O})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{className:t?.input,type:"email",placeholder:o.EMAIL_PLACEHOLDER,disabled:n,...O})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Mc,{ref:c,localization:o,action:"/forget-password"}),b.jsx(St,{type:"submit",disabled:n,className:fe("w-full",t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.FORGOT_PASSWORD_ACTION})]})})}function _w({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,redirectTo:l,setIsSubmitting:c}){const d=qo(),{captchaRef:f,getCaptchaHeaders:h,resetCaptcha:g}=Ic({localization:i}),{authClient:p,basePath:y,baseURL:_,persistClient:S,localization:w,redirectTo:T,viewPaths:R,toast:A,localizeErrors:C}=E.useContext(qe);i={...w,...i};const O=E.useCallback(()=>l||Ri("redirectTo")||T,[l,T]),M=E.useCallback(()=>`${_}${n||(S?`${y}/${R.CALLBACK}?redirectTo=${encodeURIComponent(O())}`:O())}`,[n,S,y,R,_,O]),L=bn({email:He().email({message:`${i.EMAIL} ${i.IS_INVALID}`})}),N=vo({resolver:yo(L),defaultValues:{email:""}});o=o||N.formState.isSubmitting,E.useEffect(()=>{c?.(N.formState.isSubmitting)},[N.formState.isSubmitting,c]);async function D({email:z}){try{const W={throw:!0,headers:await h("/sign-in/magic-link")};await p.signIn.magicLink({email:z,callbackURL:M(),fetchOptions:W}),A({variant:"success",message:i.MAGIC_LINK_EMAIL}),N.reset()}catch(W){A({variant:"error",message:kt({error:W,localization:i,localizeErrors:C})}),g()}}return b.jsx(_o,{...N,children:b.jsxs("form",{onSubmit:N.handleSubmit(D),noValidate:d,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:N.control,name:"email",render:({field:z})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{className:t?.input,type:"email",placeholder:i.EMAIL_PLACEHOLDER,disabled:o,...z})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Mc,{ref:f,localization:i,action:"/sign-in/magic-link"}),b.jsx(St,{type:"submit",disabled:o,className:fe("w-full",t?.button,t?.primaryButton),children:o?b.jsx(yn,{className:"animate-spin"}):i.MAGIC_LINK_ACTION})]})})}function QV({className:e,classNames:t,isSubmitting:n,localization:o,redirectTo:i,setIsSubmitting:l}){const{authClient:c,localization:d,toast:f,localizeErrors:h}=E.useContext(qe);o={...d,...o};const{onSuccess:g,isPending:p}=Eo({redirectTo:i}),y=bn({code:He().min(1,{message:o.BACKUP_CODE_REQUIRED})}),_=vo({resolver:yo(y),defaultValues:{code:""}});n=n||_.formState.isSubmitting||p,E.useEffect(()=>{l?.(_.formState.isSubmitting||p)},[_.formState.isSubmitting,p,l]);async function S({code:w}){try{await c.twoFactor.verifyBackupCode({code:w,fetchOptions:{throw:!0}}),await g()}catch(T){f({variant:"error",message:kt({error:T,localization:o,localizeErrors:h})}),_.reset()}}return b.jsx(_o,{..._,children:b.jsxs("form",{onSubmit:_.handleSubmit(S),className:fe("grid gap-6",e,t?.base),children:[b.jsx(Ht,{control:_.control,name:"code",render:({field:w})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:o.BACKUP_CODE}),b.jsx(nn,{children:b.jsx(Kr,{placeholder:o.BACKUP_CODE_PLACEHOLDER,autoComplete:"off",className:t?.input,disabled:n,...w})}),b.jsx(un,{className:t?.error})]})}),b.jsx(St,{type:"submit",disabled:n,className:fe(t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.RECOVER_ACCOUNT_ACTION})]})})}function XV({className:e,classNames:t,localization:n,passwordValidation:o}){const i=E.useRef(!1),{authClient:l,basePath:c,credentials:d,localization:f,viewPaths:h,navigate:g,toast:p,localizeErrors:y}=E.useContext(qe),_=d?.confirmPassword,S=d?.passwordValidation;n={...f,...n},o={...S,...o};const w=bn({newPassword:cc(o,{PASSWORD_REQUIRED:n.NEW_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}),confirmPassword:_?cc(o,{PASSWORD_REQUIRED:n.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:n.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:n.PASSWORD_TOO_LONG,INVALID_PASSWORD:n.INVALID_PASSWORD}):He().optional()}).refine(C=>!_||C.newPassword===C.confirmPassword,{message:n.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),T=vo({resolver:yo(w),defaultValues:{newPassword:"",confirmPassword:""}}),R=T.formState.isSubmitting;E.useEffect(()=>{if(i.current)return;i.current=!0;const O=new URLSearchParams(window.location.search).get("token");(!O||O==="INVALID_TOKEN")&&(g(`${c}/${h.SIGN_IN}${window.location.search}`),p({variant:"error",message:n.INVALID_TOKEN}))},[c,g,p,h,n]);async function A({newPassword:C}){try{const M=new URLSearchParams(window.location.search).get("token");await l.resetPassword({newPassword:C,token:M,fetchOptions:{throw:!0}}),p({variant:"success",message:n.RESET_PASSWORD_SUCCESS}),g(`${c}/${h.SIGN_IN}${window.location.search}`)}catch(O){p({variant:"error",message:kt({error:O,localization:n,localizeErrors:y})}),T.reset()}}return b.jsx(_o,{...T,children:b.jsxs("form",{onSubmit:T.handleSubmit(A),className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:T.control,name:"newPassword",render:({field:C})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:n.NEW_PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:n.NEW_PASSWORD_PLACEHOLDER,disabled:R,...C})}),b.jsx(un,{className:t?.error})]})}),_&&b.jsx(Ht,{control:T.control,name:"confirmPassword",render:({field:C})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:n.CONFIRM_PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:n.CONFIRM_PASSWORD_PLACEHOLDER,disabled:R,...C})}),b.jsx(un,{className:t?.error})]})}),b.jsx(St,{type:"submit",disabled:R,className:fe("w-full",t?.button,t?.primaryButton),children:R?b.jsx(yn,{className:"animate-spin"}):n.RESET_PASSWORD_ACTION})]})})}function JV({className:e,classNames:t,isSubmitting:n,localization:o,redirectTo:i,setIsSubmitting:l,passwordValidation:c}){const d=qo(),{captchaRef:f,getCaptchaHeaders:h,resetCaptcha:g}=Ic({localization:o}),{authClient:p,basePath:y,credentials:_,localization:S,viewPaths:w,navigate:T,toast:R,Link:A,localizeErrors:C,emailVerification:O}=E.useContext(qe),M=_?.rememberMe,L=_?.username,N=_?.passwordValidation;o={...S,...o},c={...N,...c};const{onSuccess:D,isPending:z}=Eo({redirectTo:i}),W=bn({email:L?He().min(1,{message:`${o.USERNAME} ${o.IS_REQUIRED}`}):He().email({message:`${o.EMAIL} ${o.IS_INVALID}`}),password:cc(c,o),rememberMe:Cv().optional()}),G=vo({resolver:yo(W),defaultValues:{email:"",password:"",rememberMe:!M}});n=n||G.formState.isSubmitting||z,E.useEffect(()=>{l?.(G.formState.isSubmitting||z)},[G.formState.isSubmitting,z,l]);async function K({email:j,password:ne,rememberMe:ae}){var P;try{let F={};if(L&&!m8(j)){const H={throw:!0,headers:await h("/sign-in/username")};F=await p.signIn.username({username:j,password:ne,rememberMe:ae,fetchOptions:H})}else{const H={throw:!0,headers:await h("/sign-in/email")};F=await p.signIn.email({email:j,password:ne,rememberMe:ae,fetchOptions:H})}F.twoFactorRedirect?T(`${y}/${w.TWO_FACTOR}${window.location.search}`):await D()}catch(F){G.resetField("password"),g(),R({variant:"error",message:kt({error:F,localization:o,localizeErrors:C})}),O?.otp&&((P=F?.error)==null?void 0:P.code)==="EMAIL_NOT_VERIFIED"&&T(`${y}/${w.EMAIL_VERIFICATION}?email=${encodeURIComponent(j)}`)}}return b.jsx(_o,{...G,children:b.jsxs("form",{onSubmit:G.handleSubmit(K),noValidate:d,className:fe("grid w-full gap-6",e,t?.base),children:[b.jsx(Ht,{control:G.control,name:"email",render:({field:j})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:L?o.USERNAME:o.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:L?"username":"email",className:t?.input,type:L?"text":"email",placeholder:L?o.SIGN_IN_USERNAME_PLACEHOLDER:o.EMAIL_PLACEHOLDER,disabled:n,...j})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:G.control,name:"password",render:({field:j})=>b.jsxs(Gt,{children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx(qt,{className:t?.label,children:o.PASSWORD}),_?.forgotPassword&&b.jsx(A,{className:fe("text-sm hover:underline",t?.forgotPasswordLink),href:`${y}/${w.FORGOT_PASSWORD}${d?window.location.search:""}`,children:o.FORGOT_PASSWORD_LINK})]}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"current-password",className:t?.input,placeholder:o.PASSWORD_PLACEHOLDER,disabled:n,...j})}),b.jsx(un,{className:t?.error})]})}),M&&b.jsx(Ht,{control:G.control,name:"rememberMe",render:({field:j})=>b.jsxs(Gt,{className:"flex",children:[b.jsx(nn,{children:b.jsx(w0,{checked:j.value,onCheckedChange:j.onChange,disabled:n})}),b.jsx(qt,{children:o.REMEMBER_ME})]})}),b.jsx(Mc,{ref:f,localization:o,action:"/sign-in/email"}),b.jsx(St,{type:"submit",disabled:n,className:fe("w-full",t?.button,t?.primaryButton),children:n?b.jsx(yn,{className:"animate-spin"}):o.SIGN_IN_ACTION})]})})}function eH({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,redirectTo:l,setIsSubmitting:c,passwordValidation:d}){const f=qo(),{captchaRef:h,getCaptchaHeaders:g,resetCaptcha:p}=Ic({localization:i}),{additionalFields:y,authClient:_,basePath:S,baseURL:w,credentials:T,localization:R,nameRequired:A,persistClient:C,redirectTo:O,signUp:M,viewPaths:L,navigate:N,toast:D,avatar:z,localizeErrors:W,emailVerification:G}=E.useContext(qe),K=T?.confirmPassword,j=T?.username,ne=T?.usernameRequired??!0,ae=T?.passwordValidation,P=M?.fields;i={...R,...i},d={...ae,...d};const F=E.useRef(null),[H,re]=E.useState(null),[ye,k]=E.useState(!1),Q=E.useCallback(()=>l||Ri("redirectTo")||O,[l,O]),ee=E.useCallback(()=>`${w}${n||(C?`${S}/${L.CALLBACK}?redirectTo=${encodeURIComponent(Q())}`:Q())}`,[n,C,S,L,w,Q]),{onSuccess:se,isPending:me}=Eo({redirectTo:l}),_e={email:He().email({message:`${i.EMAIL} ${i.IS_INVALID}`}),password:cc(d,i),name:P?.includes("name")&&A?He().min(1,{message:`${i.NAME} ${i.IS_REQUIRED}`}):He().optional(),image:He().optional(),username:j&&ne?He().min(1,{message:`${i.USERNAME} ${i.IS_REQUIRED}`}):He().optional(),confirmPassword:K?cc(d,{PASSWORD_REQUIRED:i.CONFIRM_PASSWORD_REQUIRED,PASSWORD_TOO_SHORT:i.PASSWORD_TOO_SHORT,PASSWORD_TOO_LONG:i.PASSWORD_TOO_LONG,INVALID_PASSWORD:i.INVALID_PASSWORD}):He().optional()},be={};if(P)for(const ge of P){if(ge==="name"||ge==="image")continue;const Re=y?.[ge];if(!Re)continue;let ke;Re.type==="number"?ke=Re.required?h8(et=>et?Number(et):void 0,MR({message:`${Re.label} ${i.IS_INVALID}`})):p8({message:`${Re.label} ${i.IS_INVALID}`}).optional():Re.type==="boolean"?ke=Re.required?$E({message:`${Re.label} ${i.IS_INVALID}`}).refine(et=>et===!0,{message:`${Re.label} ${i.IS_REQUIRED}`}):$E({message:`${Re.label} ${i.IS_INVALID}`}).optional():ke=Re.required?He().min(1,`${Re.label} ${i.IS_REQUIRED}`):He().optional(),be[ge]=ke}const Se=bn(_e).extend(be).refine(ge=>K?ge.password===ge.confirmPassword:!0,{message:i.PASSWORDS_DO_NOT_MATCH,path:["confirmPassword"]}),De={email:"",password:"",...K&&{confirmPassword:""},...P?.includes("name")?{name:""}:{},...j?{username:""}:{},...P?.includes("image")&&z?{image:""}:{}};if(P)for(const ge of P){if(ge==="name"||ge==="image")continue;const Re=y?.[ge];Re&&(De[ge]=Re.type==="boolean"?!1:"")}const Le=vo({resolver:yo(Se),defaultValues:De});o=o||Le.formState.isSubmitting||me,E.useEffect(()=>{c?.(Le.formState.isSubmitting||me)},[Le.formState.isSubmitting,me,c]);const Ee=async ge=>{if(z){k(!0);try{const Re=await uV(ge,crypto.randomUUID(),z.size,z.extension);let ke;z.upload?ke=await z.upload(Re):ke=await fV(Re),ke?(re(ke),Le.setValue("image",ke)):(re(null),Le.setValue("image",""))}catch(Re){console.error(Re),D({variant:"error",message:kt({error:Re,localization:i,localizeErrors:W})})}k(!1)}},ze=()=>{re(null),Le.setValue("image","")},Nt=()=>{var ge;return(ge=F.current)==null?void 0:ge.click()};async function ve({email:ge,password:Re,name:ke,username:et,confirmPassword:Ue,image:We,...U}){try{for(const[pe,he]of Object.entries(U)){const xe=y?.[pe];if(xe?.validate&&typeof he=="string"&&!await xe.validate(he)){Le.setError(pe,{message:`${xe.label} ${i.IS_INVALID}`});return}}const q={throw:!0,headers:await g("/sign-up/email")},Z={};et!==void 0&&(!ne&&(et===null||et===""||typeof et=="string"&&et.trim()==="")||(Z.username=et)),We!==void 0&&(Z.image=We);const ue=await _.signUp.email({email:ge,password:Re,name:ke||"",...Z,...U,callbackURL:ee(),fetchOptions:q});"token"in ue&&ue.token?await se():G?.otp?N(`${S}/${L.EMAIL_VERIFICATION}?email=${encodeURIComponent(ge)}`):(N(`${S}/${L.SIGN_IN}${window.location.search}`),D({variant:"success",message:i.SIGN_UP_EMAIL}))}catch(q){D({variant:"error",message:kt({error:q,localization:i,localizeErrors:W})}),Le.resetField("password"),Le.resetField("confirmPassword"),p()}}return b.jsx(_o,{...Le,children:b.jsxs("form",{onSubmit:Le.handleSubmit(ve),noValidate:f,className:fe("grid w-full gap-6",e,t?.base),children:[P?.includes("image")&&z&&b.jsxs(b.Fragment,{children:[b.jsx("input",{ref:F,accept:"image/*",disabled:ye,hidden:!0,type:"file",onChange:ge=>{var Re;const ke=(Re=ge.target.files)==null?void 0:Re.item(0);ke&&Ee(ke),ge.target.value=""}}),b.jsx(Ht,{control:Le.control,name:"image",render:()=>b.jsxs(Gt,{children:[b.jsx(qt,{children:i.AVATAR}),b.jsxs("div",{className:"flex items-center gap-4",children:[b.jsxs(YT,{children:[b.jsx(KT,{asChild:!0,children:b.jsx(St,{className:"size-fit rounded-full",size:"icon",variant:"ghost",type:"button",children:b.jsx(oA,{isPending:ye,className:"size-16",user:H?{name:Le.watch("name"),email:Le.watch("email"),image:H}:null,localization:i})})}),b.jsxs(WT,{align:"start",onCloseAutoFocus:ge=>ge.preventDefault(),children:[b.jsxs(ff,{onClick:Nt,disabled:ye,children:[b.jsx(z7,{}),i.UPLOAD_AVATAR]}),H&&b.jsxs(ff,{onClick:ze,disabled:ye,variant:"destructive",children:[b.jsx(G7,{}),i.DELETE_AVATAR]})]})]}),b.jsxs(St,{type:"button",variant:"outline",onClick:Nt,disabled:ye,children:[ye&&b.jsx(yn,{className:"animate-spin"}),i.UPLOAD]})]}),b.jsx(un,{})]})})]}),P?.includes("name")&&b.jsx(Ht,{control:Le.control,name:"name",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsxs(qt,{className:t?.label,children:[i.NAME,!A&&b.jsx("span",{className:"ml-1 text-muted-foreground",children:i.OPTIONAL_BRACKETS})]}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:"name",className:t?.input,placeholder:i.NAME_PLACEHOLDER,disabled:o,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),j&&b.jsx(Ht,{control:Le.control,name:"username",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsxs(qt,{className:t?.label,children:[i.USERNAME,!ne&&b.jsx("span",{className:"ml-1 text-muted-foreground",children:i.OPTIONAL_BRACKETS})]}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:"username",className:t?.input,placeholder:i.USERNAME_PLACEHOLDER,disabled:o,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:Le.control,name:"email",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.EMAIL}),b.jsx(nn,{children:b.jsx(Kr,{autoComplete:"email",className:t?.input,type:"email",placeholder:i.EMAIL_PLACEHOLDER,disabled:o,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:Le.control,name:"password",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:i.PASSWORD_PLACEHOLDER,disabled:o,enableToggle:!0,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),K&&b.jsx(Ht,{control:Le.control,name:"confirmPassword",render:({field:ge})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:i.CONFIRM_PASSWORD}),b.jsx(nn,{children:b.jsx(gc,{autoComplete:"new-password",className:t?.input,placeholder:i.CONFIRM_PASSWORD_PLACEHOLDER,disabled:o,enableToggle:!0,...ge,value:ge.value})}),b.jsx(un,{className:t?.error})]})}),P?.filter(ge=>ge!=="name"&&ge!=="image").map(ge=>{const Re=y?.[ge];return Re?Re.type==="boolean"?b.jsx(Ht,{control:Le.control,name:ge,render:({field:ke})=>b.jsxs(Gt,{className:"flex",children:[b.jsx(nn,{children:b.jsx(w0,{checked:ke.value,onCheckedChange:ke.onChange,disabled:o})}),b.jsx(qt,{className:t?.label,children:Re.label}),b.jsx(un,{className:t?.error})]})},ge):b.jsx(Ht,{control:Le.control,name:ge,render:({field:ke})=>b.jsxs(Gt,{children:[b.jsx(qt,{className:t?.label,children:Re.label}),b.jsx(nn,{children:Re.type==="number"?b.jsx(Kr,{className:t?.input,type:"number",placeholder:Re.placeholder||(typeof Re.label=="string"?Re.label:""),disabled:o,...ke,value:ke.value}):Re.multiline?b.jsx(vV,{className:t?.input,placeholder:Re.placeholder||(typeof Re.label=="string"?Re.label:""),disabled:o,...ke,value:ke.value}):b.jsx(Kr,{className:t?.input,type:"text",placeholder:Re.placeholder||(typeof Re.label=="string"?Re.label:""),disabled:o,...ke,value:ke.value})}),b.jsx(un,{className:t?.error})]})},ge):(console.error(`Additional field ${ge} not found`),null)}),b.jsx(Mc,{ref:h,localization:i,action:"/sign-up/email"}),b.jsx(St,{type:"submit",disabled:o,className:fe("w-full",t?.button,t?.primaryButton),children:o?b.jsx(yn,{className:"animate-spin"}):i.SIGN_UP_ACTION})]})})}function tH({className:e,classNames:t,isSubmitting:n,localization:o,otpSeparators:i=0,redirectTo:l,setIsSubmitting:c}){var d;const f=qo(),h=f?Ri("totpURI"):null,g=E.useRef(!1),{authClient:p,basePath:y,hooks:{useSession:_},localization:S,twoFactor:w,viewPaths:T,toast:R,Link:A,localizeErrors:C}=E.useContext(qe);o={...S,...o};const{onSuccess:O,isPending:M}=Eo({redirectTo:l}),{data:L}=_(),N=(d=L?.user)==null?void 0:d.twoFactorEnabled,[D,z]=E.useState(w?.length===1?w[0]:null),[W,G]=E.useState(!1),[K,j]=E.useState(0),ne=bn({code:He().min(1,{message:`${o.ONE_TIME_PASSWORD} ${o.IS_REQUIRED}`}).min(6,{message:`${o.ONE_TIME_PASSWORD} ${o.IS_INVALID}`}),trustDevice:Cv().optional()}),ae=vo({resolver:yo(ne),defaultValues:{code:""}});n=n||ae.formState.isSubmitting||M,E.useEffect(()=>{c?.(ae.formState.isSubmitting||M)},[ae.formState.isSubmitting,M,c]),E.useEffect(()=>{D==="otp"&&K<=0&&!g.current&&(g.current=!0,P())},[D]),E.useEffect(()=>{if(K<=0)return;const H=setTimeout(()=>{j(re=>re-1)},1e3);return()=>clearTimeout(H)},[K]);const P=async()=>{if(!(W||K>0)){try{G(!0),await p.twoFactor.sendOtp({fetchOptions:{throw:!0}}),j(60)}catch(H){R({variant:"error",message:kt({error:H,localization:o,localizeErrors:C})}),H.error.code==="INVALID_TWO_FACTOR_COOKIE"&&history.back()}g.current=!1,G(!1)}};async function F({code:H,trustDevice:re}){try{await(D==="totp"?p.twoFactor.verifyTotp:p.twoFactor.verifyOtp)({code:H,trustDevice:re,fetchOptions:{throw:!0}}),await O(),L&&!N&&R({variant:"success",message:o?.TWO_FACTOR_ENABLED})}catch(ye){R({variant:"error",message:kt({error:ye,localization:o,localizeErrors:C})}),ae.reset()}}return b.jsx(_o,{...ae,children:b.jsxs("form",{onSubmit:ae.handleSubmit(F),className:fe("grid w-full gap-6",e,t?.base),children:[w?.includes("totp")&&h&&D==="totp"&&b.jsxs("div",{className:"space-y-3",children:[b.jsx(QT,{className:t?.label,children:o.TWO_FACTOR_TOTP_LABEL}),b.jsx(J$,{className:fe("border shadow-xs",t?.qrCode),value:h})]}),D!==null&&b.jsxs(b.Fragment,{children:[b.jsx(Ht,{control:ae.control,name:"code",render:({field:H})=>b.jsxs(Gt,{children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsx(qt,{className:t?.label,children:o.ONE_TIME_PASSWORD}),b.jsx(A,{className:fe("text-sm hover:underline",t?.forgotPasswordLink),href:`${y}/${T.RECOVER_ACCOUNT}${f?window.location.search:""}`,children:o.FORGOT_AUTHENTICATOR})]}),b.jsx(nn,{children:b.jsx(x0,{...H,maxLength:6,onChange:re=>{H.onChange(re),re.length===6&&ae.handleSubmit(F)()},containerClassName:t?.otpInputContainer,className:t?.otpInput,disabled:n,children:b.jsx(R0,{otpSeparators:i})})}),b.jsx(un,{className:t?.error})]})}),b.jsx(Ht,{control:ae.control,name:"trustDevice",render:({field:H})=>b.jsxs(Gt,{className:"flex",children:[b.jsx(nn,{children:b.jsx(w0,{checked:H.value,onCheckedChange:H.onChange,disabled:n,className:t?.checkbox})}),b.jsx(qt,{className:t?.label,children:o.TRUST_DEVICE})]})})]}),b.jsxs("div",{className:"grid gap-4",children:[D!==null&&b.jsxs(St,{type:"submit",disabled:n,className:fe(t?.button,t?.primaryButton),children:[n&&b.jsx(yn,{className:"animate-spin"}),o.TWO_FACTOR_ACTION]}),D==="otp"&&w?.includes("otp")&&b.jsxs(St,{type:"button",variant:"outline",onClick:P,disabled:K>0||W||n,className:fe(t?.button,t?.outlineButton),children:[W?b.jsx(yn,{className:"animate-spin"}):b.jsx(WE,{className:t?.icon}),o.RESEND_CODE,K>0&&` (${K})`]}),D!=="otp"&&w?.includes("otp")&&b.jsxs(St,{type:"button",variant:"secondary",className:fe(t?.button,t?.secondaryButton),onClick:()=>z("otp"),disabled:n,children:[b.jsx(WE,{className:t?.icon}),o.SEND_VERIFICATION_CODE]}),D!=="totp"&&w?.includes("totp")&&b.jsxs(St,{type:"button",variant:"secondary",className:fe(t?.button,t?.secondaryButton),onClick:()=>z("totp"),disabled:n,children:[b.jsx(H7,{className:t?.icon}),o.CONTINUE_WITH_AUTHENTICATOR]})]})]})})}function iA({redirectTo:e}){const t=E.useRef(!1),{authClient:n,basePath:o,viewPaths:i}=E.useContext(qe),{onSuccess:l}=Eo({redirectTo:e||`${o}/${i.SIGN_IN}`});return E.useEffect(()=>{t.current||(t.current=!0,n.signOut().finally(l))},[n,l]),b.jsx(yn,{className:"animate-spin"})}function nH({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,pathname:l,redirectTo:c,view:d,otpSeparators:f=0,setIsSubmitting:h}){const{basePath:g,credentials:p,localization:y,magicLink:_,emailOTP:S,signUp:w,twoFactor:T,viewPaths:R,replace:A}=E.useContext(qe),C=!!w;if(i={...y,...i},E.useEffect(()=>{l&&!Ig(R,l)&&(console.error(`Invalid auth view: ${l}`),A(`${g}/${R.SIGN_IN}${window.location.search}`))},[l,R,g,A]),d=d||Ig(R,l)||"SIGN_IN",E.useEffect(()=>{let O=!1;d==="MAGIC_LINK"&&(!_||!p&&!S)&&(O=!0),d==="EMAIL_OTP"&&(!S||!p&&!_)&&(O=!0),d==="SIGN_UP"&&!C&&(O=!0),!p&&["SIGN_UP","FORGOT_PASSWORD","RESET_PASSWORD","TWO_FACTOR","RECOVER_ACCOUNT"].includes(d)&&(O=!0),["TWO_FACTOR","RECOVER_ACCOUNT"].includes(d)&&!T&&(O=!0),O&&A(`${g}/${R.SIGN_IN}${window.location.search}`)},[g,d,R,p,A,S,C,_,T]),d==="SIGN_OUT")return b.jsx(iA,{redirectTo:c});if(d==="CALLBACK")return b.jsx(aA,{redirectTo:c});if(d==="SIGN_IN")return p?b.jsx(JV,{className:e,classNames:t,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h}):_?b.jsx(_w,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h}):S?b.jsx(bw,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h}):null;if(d==="TWO_FACTOR")return b.jsx(tH,{className:e,classNames:t,localization:i,otpSeparators:f,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="RECOVER_ACCOUNT")return b.jsx(QV,{className:e,classNames:t,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="MAGIC_LINK")return b.jsx(_w,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="EMAIL_OTP")return b.jsx(bw,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="EMAIL_VERIFICATION")return b.jsx(KV,{className:e,classNames:t,callbackURL:n,localization:i,otpSeparators:f,redirectTo:c,isSubmitting:o,setIsSubmitting:h});if(d==="FORGOT_PASSWORD")return b.jsx(WV,{className:e,classNames:t,localization:i,isSubmitting:o,setIsSubmitting:h});if(d==="RESET_PASSWORD")return b.jsx(XV,{className:e,classNames:t,localization:i});if(d==="SIGN_UP")return C&&b.jsx(eH,{className:e,classNames:t,callbackURL:n,localization:i,redirectTo:c,isSubmitting:o,setIsSubmitting:h})}function rH({className:e,classNames:t,localization:n}){const{localization:o,redirectTo:i,replace:l,toast:c}=E.useContext(qe),d=E.useMemo(()=>({...o,...n}),[o,n]),{data:f}=oV(),[h,g]=E.useState(null);return E.useEffect(()=>{const p=Ri("invitationId");if(!p){c({variant:"error",message:d.INVITATION_NOT_FOUND}),l(i);return}g(p)},[d.INVITATION_NOT_FOUND,c,l,i]),!f||!h?b.jsx(sA,{className:e,classNames:t}):b.jsx(oH,{className:e,classNames:t,localization:d,invitationId:h})}function oH({className:e,classNames:t,localization:n,invitationId:o}){var i;const{authClient:l,hooks:{useInvitation:c},localization:d,organization:f,redirectTo:h,replace:g,toast:p,localizeErrors:y}=E.useContext(qe),_=E.useMemo(()=>({...d,...n}),[d,n]),[S,w]=E.useState(!1),[T,R]=E.useState(!1),A=S||T,{data:C,isPending:O}=c({query:{id:o}}),M=E.useCallback(()=>Ri("redirectTo")||h,[h]);E.useEffect(()=>{if(!(O||!o)){if(!C){p({variant:"error",message:_.INVITATION_NOT_FOUND}),g(h);return}(C.status!=="pending"||new Date(C.expiresAt)<new Date)&&(p({variant:"error",message:new Date(C.expiresAt)<new Date?_.INVITATION_EXPIRED:_.INVITATION_NOT_FOUND}),g(h))}},[C,O,o,_,p,g,h]);const L=async()=>{R(!0);try{await l.organization.acceptInvitation({invitationId:o,fetchOptions:{throw:!0}}),p({variant:"success",message:_.INVITATION_ACCEPTED||"Invitation accepted"}),g(M())}catch(G){p({variant:"error",message:kt({error:G,localization:_,localizeErrors:y})}),R(!1)}},N=async()=>{w(!0);try{await l.organization.rejectInvitation({invitationId:o,fetchOptions:{throw:!0}}),p({variant:"success",message:_.INVITATION_REJECTED}),g(h)}catch(G){p({variant:"error",message:kt({error:G,localization:_,localizeErrors:y})}),w(!1)}},W=((i=[...[{role:"owner",label:_.OWNER},{role:"admin",label:_.ADMIN},{role:"member",label:_.MEMBER}],...f?.customRoles||[]].find(G=>G.role===C?.role))==null?void 0:i.label)||C?.role;return C?b.jsxs(Si,{className:fe("w-full max-w-sm",e,t?.base),children:[b.jsxs(Bf,{className:fe("justify-items-center text-center",t?.header),children:[b.jsx(E0,{className:fe("text-lg md:text-xl",t?.title),children:_.ACCEPT_INVITATION}),b.jsx(Ff,{className:fe("text-xs md:text-sm",t?.description),children:_.ACCEPT_INVITATION_DESCRIPTION})]}),b.jsxs($f,{className:fe("flex flex-col gap-6 truncate",t?.content),children:[b.jsxs(Si,{className:fe("flex-row items-center p-4"),children:[b.jsx(rA,{organization:{id:C.organizationId,name:C.organizationName,slug:C.organizationSlug,logo:C.organizationLogo,createdAt:new Date},localization:_}),b.jsx("p",{className:"ml-auto text-muted-foreground text-sm",children:W})]}),b.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b.jsxs(St,{variant:"outline",className:fe(t?.button,t?.outlineButton),onClick:N,disabled:A,children:[S?b.jsx(yn,{className:"animate-spin"}):b.jsx(HR,{}),_.REJECT]}),b.jsxs(St,{className:fe(t?.button,t?.primaryButton),onClick:L,disabled:A,children:[T?b.jsx(yn,{className:"animate-spin"}):b.jsx(Lv,{}),_.ACCEPT]})]})]})]}):b.jsx(sA,{className:e,classNames:t})}var sA=({className:e,classNames:t,localization:n})=>b.jsxs(Si,{className:fe("w-full max-w-sm",e,t?.base),children:[b.jsxs(Bf,{className:fe("justify-items-center",t?.header),children:[b.jsx(gr,{className:fe("my-1 h-5 w-full max-w-32 md:h-5.5 md:w-40",t?.skeleton)}),b.jsx(gr,{className:fe("my-0.5 h-3 w-full max-w-56 md:h-3.5 md:w-64",t?.skeleton)})]}),b.jsxs($f,{className:fe("flex flex-col gap-6 truncate",t?.content),children:[b.jsxs(Si,{className:fe("flex-row items-center p-4"),children:[b.jsx(rA,{isPending:!0,localization:n}),b.jsx(gr,{className:"mt-0.5 ml-auto h-4 w-full max-w-14 shrink-2"})]}),b.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[b.jsx(gr,{className:"h-9 w-full"}),b.jsx(gr,{className:"h-9 w-full"})]})]})]});function Ew({className:e,orientation:t="horizontal",decorative:n=!0,...o}){return b.jsx(rV,{"data-slot":"separator",decorative:n,orientation:t,className:fe("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...o})}function aH({classNames:e,isSubmitting:t,localization:n,view:o}){var i,l,c,d;const{viewPaths:f,navigate:h,basePath:g}=E.useContext(qe);return b.jsxs(St,{className:fe("w-full",(i=e?.form)==null?void 0:i.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>h(`${g}/${o==="EMAIL_OTP"?f.SIGN_IN:f.EMAIL_OTP}${window.location.search}`),children:[o==="EMAIL_OTP"?b.jsx($R,{className:(c=e?.form)==null?void 0:c.icon}):b.jsx(VR,{className:(d=e?.form)==null?void 0:d.icon}),n.SIGN_IN_WITH," ",o==="EMAIL_OTP"?n.PASSWORD:n.EMAIL_OTP]})}function iH({classNames:e,isSubmitting:t,localization:n,view:o}){var i,l,c,d;const{viewPaths:f,navigate:h,basePath:g,credentials:p}=E.useContext(qe);return b.jsxs(St,{className:fe("w-full",(i=e?.form)==null?void 0:i.button,(l=e?.form)==null?void 0:l.secondaryButton),disabled:t,type:"button",variant:"secondary",onClick:()=>h(`${g}/${o==="MAGIC_LINK"||!p?f.SIGN_IN:f.MAGIC_LINK}${window.location.search}`),children:[o==="MAGIC_LINK"?b.jsx($R,{className:(c=e?.form)==null?void 0:c.icon}):b.jsx(VR,{className:(d=e?.form)==null?void 0:d.icon}),n.SIGN_IN_WITH," ",o==="MAGIC_LINK"?n.PASSWORD:n.MAGIC_LINK]})}function sH({localization:e,redirectTo:t}){const{authClient:n,localization:o,toast:i,localizeErrors:l}=E.useContext(qe),c=E.useRef(!1);e=E.useMemo(()=>({...o,...e}),[o,e]);const{onSuccess:d}=Eo({redirectTo:t});return E.useEffect(()=>{if(!c.current){c.current=!0;try{n.oneTap({fetchOptions:{throw:!0,onSuccess:d}})}catch(f){i({variant:"error",message:kt({error:f,localization:e,localizeErrors:l})})}}},[n,e,l,d,i]),null}function lH({classNames:e,isSubmitting:t,localization:n,redirectTo:o,setIsSubmitting:i}){var l,c;const{authClient:d,localization:f,toast:h,localizeErrors:g}=E.useContext(qe);n={...f,...n};const{onSuccess:p}=Eo({redirectTo:o}),y=async()=>{i?.(!0);try{const _=await d.signIn.passkey({fetchOptions:{throw:!0}});_?.error?(h({variant:"error",message:kt({error:_.error,localization:n,localizeErrors:g})}),i?.(!1)):p()}catch(_){h({variant:"error",message:kt({error:_,localization:n,localizeErrors:g})}),i?.(!1)}};return b.jsxs(St,{className:fe("w-full",(l=e?.form)==null?void 0:l.button,(c=e?.form)==null?void 0:c.secondaryButton),disabled:t,formNoValidate:!0,name:"passkey",value:"true",variant:"secondary",onClick:y,children:[b.jsx($7,{}),n.SIGN_IN_WITH," ",n.PASSKEY]})}function Sw({className:e,classNames:t,callbackURL:n,isSubmitting:o,localization:i,other:l,provider:c,redirectTo:d,socialLayout:f,setIsSubmitting:h}){var g,p,y,_;const{authClient:S,basePath:w,baseURL:T,persistClient:R,redirectTo:A,viewPaths:C,social:O,genericOAuth:M,toast:L,localizeErrors:N}=E.useContext(qe),D=E.useCallback(()=>d||Ri("redirectTo")||A,[d,A]),z=E.useCallback(()=>`${T}${n||(R?`${w}/${C.CALLBACK}?redirectTo=${encodeURIComponent(D())}`:D())}`,[n,R,w,C,T,D]),W=async()=>{h(!0);try{if(l){const G={providerId:c.provider,callbackURL:z(),fetchOptions:{throw:!0}};M?.signIn?(await M.signIn(G),setTimeout(()=>{h(!1)},1e4)):await S.signIn.oauth2(G)}else{const G={provider:c.provider,callbackURL:z(),fetchOptions:{throw:!0}};O?.signIn?(await O.signIn(G),setTimeout(()=>{h(!1)},1e4)):await S.signIn.social(G)}}catch(G){L({variant:"error",message:kt({error:G,localization:i,localizeErrors:N})}),h(!1)}};return b.jsxs(St,{className:fe(f==="vertical"?"w-full":"grow",e,(g=t?.form)==null?void 0:g.button,(p=t?.form)==null?void 0:p.outlineButton,(y=t?.form)==null?void 0:y.providerButton),disabled:o,variant:"outline",onClick:W,children:[c.icon&&b.jsx(c.icon,{className:(_=t?.form)==null?void 0:_.icon}),f==="grid"&&c.name,f==="vertical"&&`${i.SIGN_IN_WITH} ${c.name}`]})}function hG({className:e,classNames:t,callbackURL:n,cardHeader:o,cardFooter:i,localization:l,path:c,pathname:d,redirectTo:f,socialLayout:h="auto",view:g,otpSeparators:p=0}){var y,_,S,w,T,R;const A=qo(),{basePath:C,credentials:O,localization:M,magicLink:L,emailOTP:N,oneTap:D,passkey:z,signUp:W,social:G,genericOAuth:K,viewPaths:j,Link:ne}=E.useContext(qe);l={...M,...l};let ae=h;ae==="auto"&&(ae=O&&G?.providers&&G.providers.length>2?"horizontal":"vertical");const P=c??d?.split("/").pop(),F=g||Ig(j,P)||"SIGN_IN",[H,re]=E.useState(!1);if(E.useEffect(()=>{const k=()=>re(!1);return window.addEventListener("pagehide",k),()=>{re(!1),window.removeEventListener("pagehide",k)}},[]),F==="CALLBACK")return b.jsx(aA,{redirectTo:f});if(F==="SIGN_OUT")return b.jsx(iA,{redirectTo:f});if(F==="ACCEPT_INVITATION")return b.jsx(rH,{className:e,classNames:t});const ye=!O&&!L&&!N?l.DISABLED_CREDENTIALS_DESCRIPTION:l[`${F}_DESCRIPTION`];return b.jsxs(Si,{className:fe("w-full max-w-sm",e,t?.base),children:[b.jsx(Bf,{className:t?.header,children:o||b.jsxs(b.Fragment,{children:[b.jsx(E0,{className:fe("text-lg md:text-xl",t?.title),children:l[F]}),ye&&b.jsx(Ff,{className:fe("text-xs md:text-sm",t?.description),children:ye})]})}),b.jsxs($f,{className:fe("grid gap-6",t?.content),children:[D&&["SIGN_IN","SIGN_UP","MAGIC_LINK","EMAIL_OTP"].includes(F)&&b.jsx(sH,{localization:l,redirectTo:f}),(O||L||N)&&b.jsxs("div",{className:"grid gap-4",children:[b.jsx(nH,{classNames:t?.form,callbackURL:n,isSubmitting:H,localization:l,otpSeparators:p,view:F,redirectTo:f,setIsSubmitting:re}),L&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(F)||N&&F==="EMAIL_OTP")&&b.jsx(iH,{classNames:t,localization:l,view:F,isSubmitting:H}),N&&(O&&["FORGOT_PASSWORD","SIGN_UP","SIGN_IN","MAGIC_LINK","EMAIL_OTP"].includes(F)||L&&["SIGN_IN","MAGIC_LINK"].includes(F))&&b.jsx(aH,{classNames:t,localization:l,view:F,isSubmitting:H})]}),F!=="RESET_PASSWORD"&&F!=="EMAIL_VERIFICATION"&&(((y=G?.providers)==null?void 0:y.length)||((_=K?.providers)==null?void 0:_.length)||F==="SIGN_IN"&&z)&&b.jsxs(b.Fragment,{children:[(O||L||N)&&b.jsxs("div",{className:fe("flex items-center gap-2",t?.continueWith),children:[b.jsx(Ew,{className:fe("!w-auto grow",t?.separator)}),b.jsx("span",{className:"flex-shrink-0 text-muted-foreground text-sm",children:l.OR_CONTINUE_WITH}),b.jsx(Ew,{className:fe("!w-auto grow",t?.separator)})]}),b.jsxs("div",{className:"grid gap-4",children:[(((S=G?.providers)==null?void 0:S.length)||((w=K?.providers)==null?void 0:w.length))&&b.jsxs("div",{className:fe("flex w-full items-center justify-between gap-4",ae==="horizontal"&&"flex-wrap",ae==="vertical"&&"flex-col",ae==="grid"&&"grid grid-cols-2"),children:[(T=G?.providers)==null?void 0:T.map(k=>{const Q=FV.find(ee=>ee.provider===k);return Q?b.jsx(Sw,{classNames:t,callbackURL:n,isSubmitting:H,localization:l,provider:Q,redirectTo:f,setIsSubmitting:re,socialLayout:ae},k):null}),(R=K?.providers)==null?void 0:R.map(k=>b.jsx(Sw,{classNames:t,callbackURL:n,isSubmitting:H,localization:l,provider:k,redirectTo:f,setIsSubmitting:re,socialLayout:ae,other:!0},k.provider))]}),z&&["SIGN_IN","MAGIC_LINK","EMAIL_OTP","RECOVER_ACCOUNT","TWO_FACTOR","FORGOT_PASSWORD"].includes(F)&&b.jsx(lH,{classNames:t,isSubmitting:H,localization:l,redirectTo:f,setIsSubmitting:re})]})]})]}),i&&b.jsx(ov,{className:t?.footer,children:i}),O&&W&&b.jsxs(ov,{className:fe("justify-center gap-1.5 text-muted-foreground text-sm",t?.footer),children:[F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"?l.DONT_HAVE_AN_ACCOUNT:F==="SIGN_UP"?l.ALREADY_HAVE_AN_ACCOUNT:b.jsx(k7,{className:"size-3"}),F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"||F==="SIGN_UP"?b.jsx(ne,{className:fe("text-foreground underline",t?.footerLink),href:`${C}/${j[F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"?"SIGN_UP":"SIGN_IN"]}${A?window.location.search:""}`,children:b.jsx(St,{variant:"link",size:"sm",className:fe("px-0 text-foreground underline",t?.footerLink),children:F==="SIGN_IN"||F==="MAGIC_LINK"||F==="EMAIL_OTP"?l.SIGN_UP:l.SIGN_IN})}):b.jsx(St,{variant:"link",size:"sm",className:fe("px-0 text-foreground underline",t?.footerLink),onClick:()=>window.history.back(),children:l.GO_BACK})]})]})}function pG({children:e}){const{hooks:{useSession:t}}=E.useContext(qe),{isPending:n}=t();return n?e:null}function mG({children:e}){const{hooks:{useSession:t}}=E.useContext(qe),{data:n}=t();return n?e:null}function gG({children:e}){const{hooks:{useSession:t}}=E.useContext(qe),{data:n,isPending:o}=t();return!n&&!o?e:null}function cH(e){const t=hf.c(8),{children:n}=e,o=yc();let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={basePath:"/",pathMode:"slug"},t[0]=i):i=t[0];let l,c;t[1]!==o?(l=f=>o({to:f}),c=f=>o({to:f,replace:!0}),t[1]=o,t[2]=l,t[3]=c):(l=t[2],c=t[3]);let d;return t[4]!==n||t[5]!==l||t[6]!==c?(d=b.jsx(N7,{authClient:A6,organization:i,navigate:l,replace:c,Link:uH,children:n}),t[4]=n,t[5]=l,t[6]=c,t[7]=d):d=t[7],d}function uH(e){const{href:t,className:n,children:o,...i}=e;return b.jsx(_v,{to:t,className:n,...i,children:o})}const dH=new n3;function fH(e){const t=hf.c(3),{children:n}=e;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o=b.jsx(l7,{}),t[0]=o):o=t[0];let i;return t[1]!==n?(i=b.jsxs(o3,{client:dH,children:[o,b.jsx(_3,{children:b.jsx(cH,{children:n})})]}),t[1]=n,t[2]=i):i=t[2],i}const hH=function(){return null};function pH(){const e=hf.c(1);let t;return e[0]===Symbol.for("react.memo_cache_sentinel")?(t=b.jsx("div",{className:"flex items-center justify-center min-h-screen",children:b.jsx("div",{className:"text-gray-500",children:"Loading..."})}),e[0]=t):t=e[0],t}const Nc=VI({component:()=>b.jsxs(fH,{children:[b.jsx(E.Suspense,{fallback:b.jsx(pH,{}),children:b.jsx(rx,{})}),b.jsx(hH,{})]})}),mH=Tn({getParentRoute:()=>Nc,path:"/login",component:Ln(()=>Dn(()=>import("./login-CcnR2b1q.js"),__vite__mapDeps([0,1,2,3]))),validateSearch:Ba(()=>bn({next:He().optional(),client_id:He().optional(),redirect_uri:He().optional(),response_type:He().optional(),state:He().optional(),scope:He().optional(),code_challenge:He().optional(),code_challenge_method:He().optional()}))}),gH=Tn({getParentRoute:()=>Nc,path:"/auth/$pathname",component:Ln(()=>Dn(()=>import("./auth-catchall-DqCIX1bA.js"),[]))}),zr=Tn({getParentRoute:()=>Nc,id:"shell",component:Ln(()=>Dn(()=>import("./shell-layout-adVEIdhn.js"),__vite__mapDeps([4,5,2,6,7,1,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,3,41])))}),vH=Tn({getParentRoute:()=>zr,path:"/",component:Ln(()=>Dn(()=>import("./home-heelYyW2.js"),__vite__mapDeps([42,25,2,41,22,12,1,3,38,39,40,27])))}),yH=Tn({getParentRoute:()=>zr,path:"/$org",component:Ln(()=>Dn(()=>import("./page-C8KGQPlY.js"),__vite__mapDeps([43,6,2,7,1,44,45,15,46,47,35,48,9,49,12,10,20,50,51,21,52,53,54])))}),bH=Tn({getParentRoute:()=>zr,path:"/$org/members",component:Ln(()=>Dn(()=>import("./members-D5QtYSzf.js"),__vite__mapDeps([55,44,45,1,2,15,7,46,47,56,5,3,57,58,6,59,60,61,62,9,41,53,39,16,13,63,11,12,34,35,40,17,18,25,64,65])))}),_H=Tn({getParentRoute:()=>zr,path:"/$org/mcps",component:Ln(()=>Dn(()=>import("./connections-CeDc3J_o.js"),__vite__mapDeps([66,44,45,1,2,15,7,46,47,56,5,3,57,24,25,6,35,67,19,39,53,16,13,40,64,68,12,34,11,23,17,18,36]))),validateSearch:Ba(()=>bn({action:Of(["create"]).optional()}))}),EH=Tn({getParentRoute:()=>zr,path:"/$org/settings",component:Ln(()=>Dn(()=>import("./settings-gZFi_2QA.js"),__vite__mapDeps([69,44,45,1,2,15,7,46,47,40,3,70,13])))}),SH=Tn({getParentRoute:()=>zr,path:"/$org/monitoring",component:Ln(()=>Dn(()=>import("./monitoring-Cp92YRPy.js"),__vite__mapDeps([71,6,2,7,1,44,45,15,46,47,56,5,3,35,50,51,21,52,53,18,20,61,48,9,59,72,32,17,33,73]))),validateSearch:Ba(()=>bn({from:He().default("now-24h"),to:He().default("now"),connectionId:Tg(He()).optional().default([]),gatewayId:Tg(He()).optional().default([]),tool:He().default(""),status:Of(["all","success","errors"]).default("all"),search:He().default(""),page:MR().optional(),streaming:Cv().default(!0)}))}),lA=Tn({getParentRoute:()=>zr,path:"/$org/store",component:Ln(()=>Dn(()=>import("./store-DzO4PTg0.js"),__vite__mapDeps([74,62,44,45,1,2,15,7,46,6,75,76,11,5,56,3,25,77,78,17,18,12,30,31,8,9])))}),wH=Tn({getParentRoute:()=>lA,path:"/$appName",component:Ln(()=>Dn(()=>import("./store-app-detail-BIXt1EdE.js"),__vite__mapDeps([79,22,11,1,2,60,6,7,80,18,12,15,26,5,81,9,28,77,45,46,56,3,57,25,82,83,84,53,30,31,48,85,86,36,75,78,29]))),validateSearch:Ba(()=>bn({registryId:He().optional(),serverName:He().optional(),itemId:He().optional()}))}),xH=Tn({getParentRoute:()=>zr,path:"/$org/mcps/$connectionId",component:Ln(()=>Dn(()=>import("./connection-detail-DpiL6xjK.js"),__vite__mapDeps([87,5,2,35,1,6,7,30,31,88,89,37,68,3,12,34,48,9,28,65,11,82,60,40,17,18,23,20,15,10,90,86,77,36,51,72,91,84,53,45,46,56,25,21,64,67,19,57,76,39,81,83]))),validateSearch:Ba(()=>bn({tab:He().optional()}))}),RH=Tn({getParentRoute:()=>zr,path:"/$org/mcps/$connectionId/$collectionName/$itemId",component:Ln(()=>Dn(()=>import("./collection-detail-QGbMDWA7.js"),__vite__mapDeps([92,6,2,7,1,14,15,16,13,10,5,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,35,8,9,40,3,11,12,70,82,60,33,52,63,88,89,37,68,34,48,65,90,86,77,36,51,72,85,46,49,73,53]))),validateSearch:Ba(()=>bn({replayId:He().optional()}))}),OH=Tn({getParentRoute:()=>zr,path:"/$org/gateways",component:Ln(()=>Dn(()=>import("./gateways-DQmZoxNy.js"),__vite__mapDeps([93,44,45,1,2,15,7,46,47,56,5,3,57,24,25,6,35,20,67,19,39,53,10,64,11,34]))),validateSearch:Ba(()=>bn({action:Of(["create"]).optional()}))}),TH=Tn({getParentRoute:()=>zr,path:"/$org/gateways/$gatewayId",component:Ln(()=>Dn(()=>import("./gateway-detail-fCVh3_nF.js"),__vite__mapDeps([94,5,2,35,1,6,7,58,59,60,56,3,12,13,20,91,90,21,10,29,11,40,17,18,84,53,75,82]))),validateSearch:Ba(()=>bn({tab:He().optional()}))}),AH=Tn({getParentRoute:()=>Nc,path:"/oauth/callback",component:Ln(()=>Dn(()=>import("./oauth-callback-1_PgXFG_.js"),__vite__mapDeps([95,25,2,22,80,11,89,31])))}),CH=lA.addChildren([wH]),IH=zr.addChildren([vH,yH,bH,_H,OH,TH,SH,CH,EH,xH,RH]),MH=Nc.addChildren([IH,mH,gH,AH]),NH=XI({routeTree:MH}),DH=document.getElementById("root");M4.createRoot(DH).render(b.jsx(E.StrictMode,{children:b.jsx(t5,{router:NH})}));export{lB as $,hG as A,Ge as B,Jj as C,aG as D,$ as E,Oi as F,SV as G,lO as H,Lz as I,k2 as J,y3 as K,Dz as L,zH as M,UH as N,Xj as O,Qj as P,bx as Q,Kj as R,pH as S,e9 as T,fG as U,Tg as V,QH as W,Cv as X,r3 as Y,cB as Z,uB as _,A6 as a,Ac as a$,Of as a0,dn as a1,Zo as a2,Qr as a3,Wr as a4,Q2 as a5,iO as a6,Ma as a7,_z as a8,qv as a9,HR as aA,G7 as aB,P2 as aC,V7 as aD,F7 as aE,dG as aF,lP as aG,FH as aH,$P as aI,tG as aJ,eG as aK,Ba as aL,HH as aM,MR as aN,XH as aO,Og as aP,KH as aQ,ZH as aR,Wj as aS,_v as aT,W7 as aU,gM as aV,oT as aW,iT as aX,JU as aY,RB as aZ,K2 as a_,y2 as aa,Zv as ab,dc as ac,c2 as ad,Gv as ae,Hv as af,Ez as ag,Sz as ah,LH as ai,wi as aj,Xw as ak,yf as al,av as am,ja as an,Vo as ao,K4 as ap,z_ as aq,kH as ar,PH as as,g3 as at,f3 as au,er as av,Cn as aw,Dn as ax,nB as ay,ex as az,bv as b,Ec as b0,GH as b1,DR as b2,Av as b3,JH as b4,vP as b5,WH as b6,FP as b7,GP as b8,Iv as b9,m3 as bA,U_ as bB,p3 as bC,d3 as bD,K7 as bE,X7 as bF,Af as bG,Bv as bH,oc as bI,J4 as bJ,Tw as bK,YH as bL,h8 as bM,BE as bN,QL as bO,$H as bP,BH as bQ,p8 as bR,ZP as ba,LM as bb,qH as bc,VH as bd,rG as be,oG as bf,nG as bg,qU as bh,ZU as bi,YU as bj,KU as bk,WU as bl,lG as bm,cG as bn,uG as bo,sG as bp,vc as bq,On as br,dg as bs,Rw as bt,a3 as bu,l3 as bv,h3 as bw,c3 as bx,u3 as by,Qn as bz,hf as c,yv as d,Jn as e,yc as f,iG as g,_k as h,r2 as i,b as j,rV as k,qe as l,pG as m,mG as n,gG as o,v3 as p,rx as q,E as r,bn as s,GE as t,jH as u,He as v,yo as w,vo as x,Sc as y,zt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aj as _}from"./index-
|
|
1
|
+
import{aj as _}from"./index-A52jfksK.js";var S={exports:{}},r={};var $;function I(){if($)return r;$=1;var m=Symbol.for("react.element"),y=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),x=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),l=Symbol.for("react.suspense_list"),a=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function t(e){if(typeof e=="object"&&e!==null){var d=e.$$typeof;switch(d){case m:switch(e=e.type,e){case o:case s:case n:case i:case l:return e;default:switch(e=e&&e.$$typeof,e){case x:case f:case u:case p:case a:case c:return e;default:return d}}case y:return d}}}return r.ContextConsumer=f,r.ContextProvider=c,r.Element=m,r.ForwardRef=u,r.Fragment=o,r.Lazy=p,r.Memo=a,r.Portal=y,r.Profiler=s,r.StrictMode=n,r.Suspense=i,r.SuspenseList=l,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(e){return t(e)===f},r.isContextProvider=function(e){return t(e)===c},r.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===m},r.isForwardRef=function(e){return t(e)===u},r.isFragment=function(e){return t(e)===o},r.isLazy=function(e){return t(e)===p},r.isMemo=function(e){return t(e)===a},r.isPortal=function(e){return t(e)===y},r.isProfiler=function(e){return t(e)===s},r.isStrictMode=function(e){return t(e)===n},r.isSuspense=function(e){return t(e)===i},r.isSuspenseList=function(e){return t(e)===l},r.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===o||e===s||e===n||e===i||e===l||e===R||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===a||e.$$typeof===c||e.$$typeof===f||e.$$typeof===u||e.$$typeof===b||e.getModuleId!==void 0)},r.typeOf=t,r}var v;function C(){return v||(v=1,S.exports=I()),S.exports}var g=C();const h=_(g);export{h as R,g as r};
|