(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66915],{11009:function(e,i,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/getting-started/providers/todoist",function(){return s(19934)}])},59371:function(e,i,s){"use strict";s.d(i,{E:function(){return u}});var t=s(651),n=s(58354),r=s(15008),a=s(14745),l=s(92379);let d="authjs.codeTab.framework";u.Next=k,u.NextClient=p,u.Svelte=x,u.Express=E,u.Qwik=g;let h={[k.name]:"Next.js",[g.name]:"Qwik",[x.name]:"SvelteKit",[E.name]:"Express"},o={[k.name]:"Next.js",[p.name]:"Next.js (Client)",[g.name]:"Qwik",[x.name]:"SvelteKit",[E.name]:"Express"},c=(e,i)=>Object.values(e).findIndex(e=>e.toLowerCase()===i.toLowerCase());function u(e){let{children:i}=e,s=(0,n.useRouter)(),{query:{framework:u}}=s,k=l.Children.toArray(i),{project:x}=(0,r.LU)(),E=k.some(e=>e&&e.type.name===p.name)?o:h,[g,j]=(0,l.useState)(0);return(0,l.useEffect)(()=>{let e=Number(window.localStorage.getItem(d));u?(window.localStorage.setItem(d,String(c(E,u))),j(c(E,u))):e&&j(e)},[u,E]),(0,t.jsx)("div",{className:"[&_div[role='tablist']]:!pb-0",children:(0,t.jsx)(a.m,{storageKey:d,items:Object.values(E),selectedIndex:g,children:Object.keys(E).map(e=>{var i;let n=k.find(i=>{var s;return(null==i?void 0:null===(s=i.type)||void 0===s?void 0:s.name)===e});return Object.keys(null!==(i=null==n?void 0:n.props)&&void 0!==i?i:{}).length?n:(0,t.jsx)(a.m.Tab,{children:(0,t.jsxs)("p",{className:"rounded-lg bg-slate-100 p-6 font-semibold dark:bg-neutral-950",children:[E[e]," not documented yet. Help us by contributing"," ",(0,t.jsx)("a",{className:"underline",target:"_blank",href:"".concat(x.link,"/edit/main/docs/pages").concat(s.pathname,".mdx"),rel:"noreferrer",children:"here"}),"."]})},e)})})})}function p(e){let{children:i}=e;return(0,t.jsx)(a.m.Tab,{children:i})}function k(e){let{children:i}=e;return(0,t.jsx)(a.m.Tab,{children:i})}function x(e){let{children:i}=e;return(0,t.jsx)(a.m.Tab,{children:i})}function E(e){let{children:i}=e;return(0,t.jsx)(a.m.Tab,{children:i})}function g(e){let{children:i}=e;return(0,t.jsx)(a.m.Tab,{children:i})}},19934:function(e,i,s){"use strict";s.r(i),s.d(i,{useTOC:function(){return h}});var t=s(651),n=s(64464),r=s(46635),a=s(19829),l=s(59371),d=s(74661);function h(e){return[{value:"Resources",id:"resources",depth:2},{value:"Setup",id:"setup",depth:2},{value:"Callback URL",id:"callback-url",depth:3},{value:"Environment Variables",id:"environment-variables",depth:3},{value:"Configuration",id:"configuration",depth:3}]}function o(e,i){throw Error("Expected "+(i?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}i.default=(0,n.c)(function(e){let{toc:i=h(e)}=e,s={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",pre:"pre",span:"span",ul:"ul",...(0,a.a)(),...e.components};return l.E||o("Code",!1),l.E.Express||o("Code.Express",!0),l.E.Next||o("Code.Next",!0),l.E.Qwik||o("Code.Qwik",!0),l.E.Svelte||o("Code.Svelte",!0),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("img",{align:"right",src:"/img/providers/todoist.svg",height:"64",width:"64"}),"\n",(0,t.jsx)(s.h1,{children:"Todoist Provider"}),"\n",(0,t.jsx)(s.h2,{id:i[0].id,children:i[0].value}),"\n",(0,t.jsxs)(s.ul,{children:["\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"https://developer.todoist.com/guides/#oauth",children:"Todoist OAuth documentation"})}),"\n",(0,t.jsx)(s.li,{children:(0,t.jsx)(s.a,{href:"https://developer.todoist.com/appconsole.html",children:"Todoist configuration"})}),"\n"]}),"\n",(0,t.jsx)(s.h2,{id:i[1].id,children:i[1].value}),"\n",(0,t.jsx)(s.h3,{id:i[2].id,children:i[2].value}),"\n",(0,t.jsxs)(l.E,{children:[(0,t.jsx)(l.E.Next,{children:(0,t.jsx)(s.pre,{icon:d.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,t.jsx)(s.code,{children:(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"https://example.com/api/auth/callback/todoist"})})})})}),(0,t.jsx)(l.E.Qwik,{children:(0,t.jsx)(s.pre,{icon:d.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,t.jsx)(s.code,{children:(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"https://example.com/auth/callback/todoist"})})})})}),(0,t.jsx)(l.E.Svelte,{children:(0,t.jsx)(s.pre,{icon:d.Fx,tabIndex:"0","data-language":"bash","data-word-wrap":"","data-copy":"",children:(0,t.jsx)(s.code,{children:(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"https://example.com/auth/callback/todoist"})})})})})]}),"\n",(0,t.jsx)(s.h3,{id:i[3].id,children:i[3].value}),"\n",(0,t.jsx)(s.pre,{tabIndex:"0","data-language":"plaintext","data-word-wrap":"","data-copy":"",children:(0,t.jsxs)(s.code,{children:[(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{children:"AUTH_TODOIST_ID"})}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{children:"AUTH_TODOIST_SECRET"})})]})}),"\n",(0,t.jsx)(s.h3,{id:i[4].id,children:i[4].value}),"\n",(0,t.jsxs)(l.E,{children:[(0,t.jsx)(l.E.Next,{children:(0,t.jsx)(s.pre,{icon:d.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"/auth.ts","data-copy":"",children:(0,t.jsxs)(s.code,{children:[(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" NextAuth "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "next-auth"'})]}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Todoist "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "next-auth/providers/todoist"'})]}),"\n",(0,t.jsx)(s.span,{children:" "}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"export"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" const"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"handlers"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"auth"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"signIn"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"signOut"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" } "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" NextAuth"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  providers: [Todoist],"})}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"})"})})]})})}),(0,t.jsx)(l.E.Qwik,{children:(0,t.jsx)(s.pre,{icon:d.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"/src/routes/plugin@auth.ts","data-copy":"",children:(0,t.jsxs)(s.code,{children:[(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { QwikAuth$ } "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@auth/qwik"'})]}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Todoist "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@auth/qwik/providers/todoist"'})]}),"\n",(0,t.jsx)(s.span,{children:" "}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"export"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" const"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"onRequest"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"useSession"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"useSignIn"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"useSignOut"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" } "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" QwikAuth$"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("})]}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  () "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"=>"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" ({"})]}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"    providers: [Todoist],"})}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  })"})}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:")"})})]})})}),(0,t.jsx)(l.E.Svelte,{children:(0,t.jsx)(s.pre,{icon:d.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"/src/auth.ts","data-copy":"",children:(0,t.jsxs)(s.code,{children:[(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { SvelteKitAuth } "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@auth/sveltekit"'})]}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Todoist "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@auth/sveltekit/providers/todoist"'})]}),"\n",(0,t.jsx)(s.span,{children:" "}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"export"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:" const"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"handle"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"signIn"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"signOut"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" } "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" SvelteKitAuth"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({"})]}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"  providers: [Todoist],"})}),"\n",(0,t.jsx)(s.span,{children:(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"})"})})]})})}),(0,t.jsx)(l.E.Express,{children:(0,t.jsx)(s.pre,{icon:d.KP,tabIndex:"0","data-language":"ts","data-word-wrap":"","data-filename":"/src/app.ts","data-copy":"",children:(0,t.jsxs)(s.code,{children:[(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" { ExpressAuth } "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@auth/express"'})]}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"import"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:" Todoist "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"from"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:' "@auth/express/providers/todoist"'})]}),"\n",(0,t.jsx)(s.span,{children:" "}),"\n",(0,t.jsxs)(s.span,{children:[(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"app."}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"use"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"("}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:'"/auth/*"'}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:", "}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"ExpressAuth"}),(0,t.jsx)(s.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"({ providers: [Todoist] }))"})]})]})})})]})]})},"/getting-started/providers/todoist",{filePath:"pages/getting-started/providers/todoist.mdx",timestamp:1725440829e3,pageMap:r.v,frontMatter:{},title:"Todoist Provider"},"undefined"==typeof RemoteContent?h:RemoteContent.useTOC)},14745:function(e,i,s){"use strict";let t,n,r;s.d(i,{m:function(){return q}});var a=s(651),l=s(11263),d=s(68662),h=s(92379),o=s(85567),c=s(82417),u=s(47141),p=s(58954),k=s(59581),x=s(60342),E=s(45389);function g({onFocus:e}){let i;let[s,t]=(0,h.useState)(!0),n=(i=(0,h.useRef)(!1),(0,u.e)(()=>(i.current=!0,()=>{i.current=!1}),[]),i);return s?h.createElement(E._,{as:"button",type:"button",features:E.x.Focusable,onFocus:i=>{i.preventDefault();let s,r=50;s=requestAnimationFrame(function i(){if(r--<=0){s&&cancelAnimationFrame(s);return}if(e()){if(cancelAnimationFrame(s),!n.current)return;t(!1);return}s=requestAnimationFrame(i)})}}):null}var j=s(9630),f=s(97496),y=s(85018),b=s(66782),m=s(79026);let v=h.createContext(null);function F({children:e}){let i=h.useRef({groups:new Map,get(e,i){var s;let t=this.groups.get(e);t||(t=new Map,this.groups.set(e,t));let n=null!=(s=t.get(i))?s:0;return t.set(i,n+1),[Array.from(t.keys()).indexOf(i),function(){let e=t.get(i);e>1?t.set(i,e-1):t.delete(i)}]}});return h.createElement(v.Provider,{value:i},e)}function T(e){let i=h.useContext(v);if(!i)throw Error("You must wrap your component in a <StableCollection>");let s=h.useId(),[t,n]=i.current.get(e,s);return h.useEffect(()=>n,[]),t}var w=s(22898),C=((t=C||{})[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t),A=((n=A||{})[n.Less=-1]="Less",n[n.Equal=0]="Equal",n[n.Greater=1]="Greater",n),I=((r=I||{})[r.SetSelectedIndex=0]="SetSelectedIndex",r[r.RegisterTab=1]="RegisterTab",r[r.UnregisterTab=2]="UnregisterTab",r[r.RegisterPanel=3]="RegisterPanel",r[r.UnregisterPanel=4]="UnregisterPanel",r);let _={0(e,i){var s;let t=(0,j.z2)(e.tabs,e=>e.current),n=(0,j.z2)(e.panels,e=>e.current),r=t.filter(e=>{var i;return!(null!=(i=e.current)&&i.hasAttribute("disabled"))}),a={...e,tabs:t,panels:n};if(i.index<0||i.index>t.length-1){let s=(0,f.E)(Math.sign(i.index-e.selectedIndex),{[-1]:()=>1,0:()=>(0,f.E)(Math.sign(i.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(0===r.length)return a;let n=(0,f.E)(s,{0:()=>t.indexOf(r[0]),1:()=>t.indexOf(r[r.length-1])});return{...a,selectedIndex:-1===n?e.selectedIndex:n}}let l=t.slice(0,i.index),d=[...t.slice(i.index),...l].find(e=>r.includes(e));if(!d)return a;let h=null!=(s=t.indexOf(d))?s:e.selectedIndex;return -1===h&&(h=e.selectedIndex),{...a,selectedIndex:h}},1(e,i){if(e.tabs.includes(i.tab))return e;let s=e.tabs[e.selectedIndex],t=(0,j.z2)([...e.tabs,i.tab],e=>e.current),n=e.selectedIndex;return e.info.current.isControlled||-1===(n=t.indexOf(s))&&(n=e.selectedIndex),{...e,tabs:t,selectedIndex:n}},2:(e,i)=>({...e,tabs:e.tabs.filter(e=>e!==i.tab)}),3:(e,i)=>e.panels.includes(i.panel)?e:{...e,panels:(0,j.z2)([...e.panels,i.panel],e=>e.current)},4:(e,i)=>({...e,panels:e.panels.filter(e=>e!==i.panel)})},P=(0,h.createContext)(null);function S(e){let i=(0,h.useContext)(P);if(null===i){let i=Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,S),i}return i}P.displayName="TabsDataContext";let D=(0,h.createContext)(null);function O(e){let i=(0,h.useContext)(D);if(null===i){let i=Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,O),i}return i}function N(e,i){return(0,f.E)(i.type,_,e,i)}D.displayName="TabsActionsContext";let B=m.VN.RenderStrategy|m.VN.Static,R=(0,m.yV)(function(e,i){var s,t;let n=(0,h.useId)(),{id:r=`headlessui-tabs-tab-${n}`,disabled:a=!1,autoFocus:p=!1,...E}=e,{orientation:g,activation:v,selectedIndex:F,tabs:C,panels:A}=S("Tab"),I=O("Tab"),_=S("Tab"),[P,D]=(0,h.useState)(null),N=(0,h.useRef)(null),B=(0,x.T)(N,i,D);(0,u.e)(()=>I.registerTab(N),[I,N]);let R=T("tabs"),z=C.indexOf(N);-1===z&&(z=R);let M=z===F,L=(0,c.z)(e=>{var i;let s=e();if(s===j.fE.Success&&"auto"===v){let e=null==(i=(0,b.r)(N))?void 0:i.activeElement,s=_.tabs.findIndex(i=>i.current===e);-1!==s&&I.change(s)}return s}),V=(0,c.z)(e=>{let i=C.map(e=>e.current).filter(Boolean);if(e.key===w.R.Space||e.key===w.R.Enter){e.preventDefault(),e.stopPropagation(),I.change(z);return}switch(e.key){case w.R.Home:case w.R.PageUp:return e.preventDefault(),e.stopPropagation(),L(()=>(0,j.jA)(i,j.TO.First));case w.R.End:case w.R.PageDown:return e.preventDefault(),e.stopPropagation(),L(()=>(0,j.jA)(i,j.TO.Last))}if(L(()=>(0,f.E)(g,{vertical:()=>e.key===w.R.ArrowUp?(0,j.jA)(i,j.TO.Previous|j.TO.WrapAround):e.key===w.R.ArrowDown?(0,j.jA)(i,j.TO.Next|j.TO.WrapAround):j.fE.Error,horizontal:()=>e.key===w.R.ArrowLeft?(0,j.jA)(i,j.TO.Previous|j.TO.WrapAround):e.key===w.R.ArrowRight?(0,j.jA)(i,j.TO.Next|j.TO.WrapAround):j.fE.Error}))===j.fE.Success)return e.preventDefault()}),K=(0,h.useRef)(!1),U=(0,c.z)(()=>{var e;K.current||(K.current=!0,null==(e=N.current)||e.focus({preventScroll:!0}),I.change(z),(0,y.Y)(()=>{K.current=!1}))}),Q=(0,c.z)(e=>{e.preventDefault()}),{isFocusVisible:q,focusProps:G}=(0,l.F)({autoFocus:p}),{isHovered:Y,hoverProps:$}=(0,d.X)({isDisabled:a}),{pressed:H,pressProps:W}=(0,o.x)({disabled:a}),X=(0,h.useMemo)(()=>({selected:M,hover:Y,active:H,focus:q,autofocus:p,disabled:a}),[M,Y,q,H,p,a]),Z=(0,m.dG)({ref:B,onKeyDown:V,onMouseDown:Q,onClick:U,id:r,role:"tab",type:(0,k.f)(e,P),"aria-controls":null==(t=null==(s=A[z])?void 0:s.current)?void 0:t.id,"aria-selected":M,tabIndex:M?0:-1,disabled:a||void 0,autoFocus:p},G,$,W);return(0,m.sY)({ourProps:Z,theirProps:E,slot:X,defaultTag:"button",name:"Tabs.Tab"})}),z=(0,m.yV)(function(e,i){let{defaultIndex:s=0,vertical:t=!1,manual:n=!1,onChange:r,selectedIndex:a=null,...l}=e,d=t?"vertical":"horizontal",o=n?"manual":"auto",k=null!==a,E=(0,p.E)({isControlled:k}),f=(0,x.T)(i),[y,b]=(0,h.useReducer)(N,{info:E,selectedIndex:null!=a?a:s,tabs:[],panels:[]}),v=(0,h.useMemo)(()=>({selectedIndex:y.selectedIndex}),[y.selectedIndex]),T=(0,p.E)(r||(()=>{})),w=(0,p.E)(y.tabs),C=(0,h.useMemo)(()=>({orientation:d,activation:o,...y}),[d,o,y]),A=(0,c.z)(e=>(b({type:1,tab:e}),()=>b({type:2,tab:e}))),I=(0,c.z)(e=>(b({type:3,panel:e}),()=>b({type:4,panel:e}))),_=(0,c.z)(e=>{S.current!==e&&T.current(e),k||b({type:0,index:e})}),S=(0,p.E)(k?e.selectedIndex:y.selectedIndex),O=(0,h.useMemo)(()=>({registerTab:A,registerPanel:I,change:_}),[]);return(0,u.e)(()=>{b({type:0,index:null!=a?a:s})},[a]),(0,u.e)(()=>{if(void 0===S.current||y.tabs.length<=0)return;let e=(0,j.z2)(y.tabs,e=>e.current);e.some((e,i)=>y.tabs[i]!==e)&&_(e.indexOf(y.tabs[S.current]))}),h.createElement(F,null,h.createElement(D.Provider,{value:O},h.createElement(P.Provider,{value:C},C.tabs.length<=0&&h.createElement(g,{onFocus:()=>{var e,i;for(let s of w.current)if((null==(e=s.current)?void 0:e.tabIndex)===0)return null==(i=s.current)||i.focus(),!0;return!1}}),(0,m.sY)({ourProps:{ref:f},theirProps:l,slot:v,defaultTag:"div",name:"Tabs"}))))}),M=(0,m.yV)(function(e,i){let{orientation:s,selectedIndex:t}=S("Tab.List"),n=(0,x.T)(i),r=(0,h.useMemo)(()=>({selectedIndex:t}),[t]);return(0,m.sY)({ourProps:{ref:n,role:"tablist","aria-orientation":s},theirProps:e,slot:r,defaultTag:"div",name:"Tabs.List"})}),L=(0,m.yV)(function(e,i){let{selectedIndex:s}=S("Tab.Panels"),t=(0,x.T)(i),n=(0,h.useMemo)(()=>({selectedIndex:s}),[s]);return(0,m.sY)({ourProps:{ref:t},theirProps:e,slot:n,defaultTag:"div",name:"Tabs.Panels"})}),V=(0,m.yV)(function(e,i){var s,t,n,r;let a=(0,h.useId)(),{id:d=`headlessui-tabs-panel-${a}`,tabIndex:o=0,...c}=e,{selectedIndex:p,tabs:k,panels:g}=S("Tab.Panel"),j=O("Tab.Panel"),f=(0,h.useRef)(null),y=(0,x.T)(f,i);(0,u.e)(()=>j.registerPanel(f),[j,f]);let b=T("panels"),v=g.indexOf(f);-1===v&&(v=b);let F=v===p,{isFocusVisible:w,focusProps:C}=(0,l.F)(),A=(0,h.useMemo)(()=>({selected:F,focus:w}),[F,w]),I=(0,m.dG)({ref:y,id:d,role:"tabpanel","aria-labelledby":null==(t=null==(s=k[v])?void 0:s.current)?void 0:t.id,tabIndex:F?o:-1},C);return F||null!=(n=c.unmount)&&!n||null!=(r=c.static)&&r?(0,m.sY)({ourProps:I,theirProps:c,slot:A,defaultTag:"div",features:B,visible:F,name:"Tabs.Panel"}):h.createElement(E._,{"aria-hidden":"true",...I})}),K=Object.assign(R,{Group:z,List:M,Panels:L,Panel:V});var U=s(69577);function Q(e){return!!e&&"object"==typeof e&&"label"in e}let q=Object.assign(function({items:e,selectedIndex:i,defaultIndex:s=0,onChange:t,children:n,storageKey:r}){let[l,d]=(0,h.useState)(s);(0,h.useEffect)(()=>{void 0!==i&&d(i)},[i]),(0,h.useEffect)(()=>{if(!r)return;function e(e){e.key===r&&d(Number(e.newValue))}let i=Number(localStorage.getItem(r));return d(Number.isNaN(i)?0:i),window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[]);let o=(0,h.useCallback)(e=>{if(r){let i=String(e);localStorage.setItem(r,i),window.dispatchEvent(new StorageEvent("storage",{key:r,newValue:i}));return}d(e),t?.(e)},[]);return(0,a.jsxs)(z,{selectedIndex:l,defaultIndex:s,onChange:o,tabIndex:-1,children:[(0,a.jsx)(M,{className:(0,U.Z)("nextra-scrollbar _overflow-x-auto _overscroll-x-contain _overflow-y-hidden","_mt-4 _flex _w-full _gap-2 _border-b _border-gray-200 _pb-px dark:_border-neutral-800"),children:e.map((e,i)=>(0,a.jsx)(K,{disabled:Q(e)&&e.disabled,className:(0,U.Z)("_ring-inset","_rounded-t _p-2 _font-medium _leading-5 _transition-colors","_-mb-0.5 _select-none _border-b-2","data-[selected]:!_border-current data-[selected]:!_text-primary-600","_border-transparent _text-gray-600 hover:_border-gray-200 hover:_text-black dark:_text-gray-200 dark:hover:_border-neutral-800 dark:hover:_text-white","disabled:_pointer-events-none disabled:_text-gray-400 disabled:dark:_text-neutral-600"),children:Q(e)?e.label:e},i))}),(0,a.jsx)(L,{children:n})]})},{displayName:"Tabs",Tab:function({children:e,unmount:i=!1,...s}){return(0,a.jsx)(V,{...s,unmount:i,className:"_rounded _mt-6",children:e})}})}},function(e){e.O(0,[64464,46635,92888,49774,40179],function(){return e(e.s=11009)}),_N_E=e.O()}]);