vendor: 13,879 bytes, lines 1-11
1import{r as g,j as e,R as w,L as A,k as pe,u as X,O as ge}from"./react-BVqF6wkN.js";import{c as Z,a as p,B as N,X as fe,n as be,o as je,T as ve,p as ye,q as Ne,e as J,r as I,v as E,w as we,x as W,C as M,y as ke,S as C,l as ee,z as Ce,E as Se,D as ze,t as Ae,F as Le,A as Me}from"./index-DBhDrNME.js";import{c as De}from"./useAuth-ISbwCCtf.js";import{u as ae}from"./useSubscription-BtF0tOYf.js";import{r as Ee,A as F,a as U,b as $}from"./referralService-DPGjU37X.js";import{D as te,a as se,b as ne,c as re,d as D,e as _,f as G}from"./dropdown-menu-Cov-FZPs.js";import{R as Re,C as Te,a as Ie,T as _e,D as Oe,P as We,O as Pe,b as P,c as Be,d as B,e as ie,f as le,g as oe,h as de}from"./dialog-D67JDdFp.js";import{A as Fe}from"./alert-XosN1OS1.js";import{R as Ue}from"./assets--OE6x10G.js";import{G as $e}from"./gift-AoZ43qEJ.js";import{C as ce}from"./check-BK_3A3pj.js";import{C as Ge,u as He,a as Ve,b as Ke,c as qe,d as Ye}from"./useNotifications-Cb9PVBIy.js";import{A as H,E as Qe,g as Xe}from"./AddLanguageModal-BsGLWu4j.js";import{S as V}from"./sparkles-DtY5tdZI.js";import{A as Ze}from"./arrow-right-D70fi8xO.js";import{u as Je,C as ea,P as aa}from"./usePlanDetails-rzjZGt73.js";import{L as ta}from"./languageFlags-DLcXcekU.js";import{u as sa,a as na,b as ra}from"./useWebsites-B3RvPniZ.js";import{I as ia}from"./input-CF6oAZBA.js";import{S as la,a as oa,b as da,c as ca,d as ma,e as xa}from"./select-CQrWyJAD.js";import{L as ua}from"./LanguageFlag-C_bTb3S2.js";import{G as O}from"./globe-Df5_qH6X.js";import{S as ha}from"./search-_OANUNRS.js";import{C as pa}from"./calendar-BOaZmxrf.js";import{Z as ga}from"./zap-BNsZ_Ud-.js";import{T as fa}from"./triangle-alert-mRfokR17.js";import{T as ba}from"./trash-2-CWT7eiOt.js";import{P as ja}from"./plus-CkFTUlbv.js";import{L as va}from"./log-out-DB2akEp3.js";import"./index-BWrdd57G.js";import"./index-C5-vr26R.js";import"./index-CowZngIO.js";import"./index-oEU1U2mS.js";import"./index-Bj21RNpY.js";import"./index-CI-Tts0V.js";import"./schemas-B7OrOCFJ.js";import"./stripeService-Df_GWx62.js";import"./useStripePortal-B0-zgF61.js";import"./useLanguages-B-XKiBk0.js";import"./index-BdQq_4o_.js";/** 2 * @license lucide-react v0.453.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ya=Z("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 7 * @license lucide-react v0.453.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Na=Z("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),R=768;function wa(){const[a,t]=g.useState(void 0);return g.useEffect(()=>{const s=window.matchMedia(`(max-width: ${R-1}px)`),n=()=>{t(window.innerWidth<R)};return s.addEventListener("change",n),t(window.innerWidth<R),()=>s.removeEventListener("change",n)},[]),!!a}function ka({...a}){return e.jsx(Re,{...a})}function Ca({...a}){return e.jsx(We,{...a})}function Sa({className:a,...t}){return e.jsx(Pe,{className:p("fixed inset-0 z-50 bg-black/10 duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 supports-backdrop-filter:backdrop-blur-xs",a),...t})}function za({className:a,children:t,side:s="right",showCloseButton:n=!0,...r}){return e.jsxs(Ca,{children:[e.jsx(Sa,{}),e.jsxs(Te,{"data-side":s,className:p("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[side=bottom]:data-[state=closed]:slide-out-to-bottom-10 data-[side=left]:data-[state=closed]:slide-out-to-left-10 data-[side=right]:data-[state=closed]:slide-out-to-right-10 data-[side=top]:data-[state=closed]:slide-out-to-top-10 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[side=bottom]:data-[state=open]:slide-in-from-bottom-10 data-[side=left]:data-[state=open]:slide-in-from-left-10 data-[side=right]:data-[state=open]:slide-in-from-right-10 data-[side=top]:data-[state=open]:slide-in-from-top-10 data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",a),...r,children:[t,n&&e.jsx(Ie,{asChild:!0,children:e.jsxs(N,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm",children:[e.jsx(fe,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})})]})]})}function Aa({className:a,...t}){return e.jsx("div",{className:p("flex flex-col gap-0.5 p-4",a),...t})}function La({className:a,...t}){return e.jsx(_e,{className:p("cn-font-heading text-base font-medium text-foreground",a),...t})}function Ma({className:a,...t}){return e.jsx(Oe,{className:p("text-sm text-muted-foreground",a),...t})}const Da="sidebar_state",Ea=60*60*24*7,Ra="16rem",Ta="16rem",Ia="69px",_a="b",me=w.createContext(null);function S(){const a=w.useContext(me);if(!a)throw new Error("useSidebar must be used within a SidebarProvider.");return a}function Oa({defaultOpen:a=!0,open:t,onOpenChange:s,className:n,style:r,children:m,...d}){const i=wa(),[c,h]=w.useState(!1),[x,o]=w.useState(a),l=t??x,f=w.useCallback(b=>{const j=typeof b=="function"?b(l):b;s?s(j):o(j),document.cookie=`${Da}=${j}; path=/; max-age=${Ea}`},[s,l]),u=w.useCallback(()=>i?h(b=>!b):f(b=>!b),[i,f,h]);w.useEffect(()=>{const b=j=>{j.key===_a&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),u())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[u]);const y=l?"expanded":"collapsed",z=w.useMemo(()=>({state:y,open:l,setOpen:f,isMobile:i,openMobile:c,setOpenMobile:h,toggleSidebar:u}),[y,l,f,i,c,h,u]);return e.jsx(me.Provider,{value:z,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Ra,"--sidebar-width-icon":Ia,...r},className:p("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...d,children:m})})}function Wa({side:a="left",variant:t="sidebar",collapsible:s="offcanvas",className:n,children:r,dir:m,...d}){const{isMobile:i,state:c,openMobile:h,setOpenMobile:x}=S();return s==="none"?e.jsx("div",{"data-slot":"sidebar",className:p("flex h-full w-(--sidebar-width) flex-col bg-background text-foreground",n),...d,children:r}):i?e.jsx(ka,{open:h,onOpenChange:x,...d,children:e.jsxs(za,{dir:m,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-background p-0 text-foreground [&>button]:hidden",style:{"--sidebar-width":Ta},side:a,children:[e.jsxs(Aa,{className:"sr-only",children:[e.jsx(La,{children:"Sidebar"}),e.jsx(Ma,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:r})]})}):e.jsxs("aside",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?s:"","data-variant":t,"data-side":a,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:p("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container","data-side":a,className:p("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...d,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border flex size-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1",children:r})})]})}function xe({className:a,onClick:t,...s}){const{toggleSidebar:n}=S();return e.jsxs(N,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:p("rounded-lg",a),onClick:r=>{t==null||t(r),n()},...s,children:[e.jsx("svg",{className:"size-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Pa({className:a,...t}){return e.jsx("div",{"data-slot":"sidebar-inset",className:p("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",a),...t})}function Ba({className:a,...t}){const{state:s}=S();return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:p("flex items-center justify-between p-3",s==="collapsed"&&"px-3.5 [&_a]:hidden",a),...t})}function Fa({className:a,...t}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:p("flex flex-col gap-2 p-3",a),...t})}function Ua({className:a,...t}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:p("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",a),...t})}function K({className:a,...t}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:p("relative flex w-full min-w-0 flex-col p-2",a),...t})}function q({className:a,...t}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:p("w-full text-sm",a),...t})}function $a({className:a,...t}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:p("flex w-full min-w-0 flex-col gap-0",a),...t})}function Ga({className:a,...t}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:p("group/menu-item relative",a),...t})}const Ha=je(["peer/menu-button group/menu-button flex w-full items-center gap-3 overflow-hidden rounded-lg px-3 py-2.5 text-left text-sm font-medium outline-hidden transition-[width,height,padding]","group-data-[collapsible=icon]:size-11 group-data-[collapsible=icon]:p-3 group-data-[collapsible=icon]:[&_svg]:size-5","data-[active=true]:bg-blue data-[active=true]:font-semibold data-[active=true]:text-white","disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50","[&_svg]:size-4.5 [&_svg]:shrink-0 [&>span:last-child]:truncate","group-has-data-[sidebar=menu-action]/menu-item:pr-8"],{variants:{variant:{default:"hover:bg-gray-200",outline:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-10 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Y({asChild:a=!1,isActive:t=!1,variant:s="default",size:n="default",tooltip:r,className:m,...d}){const i=a?be:"button",{isMobile:c,state:h}=S(),x=e.jsx(i,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":t,className:p(Ha({variant:s,size:n}),m),...d});return r?(typeof r=="string"&&(r={children:r}),e.jsxs(ve,{children:[e.jsx(ye,{asChild:!0,children:x}),e.jsx(Ne,{side:"right",align:"center",hidden:h!=="collapsed"||c,...r})]})):x}const Va=()=>{const{isPastDueInGrace:a,isShopifyBilled:t,pastDueDaysRemaining:s}=ae();return a?e.jsxs(Fe,{variant:"warn",className:"mb-6 flex flex-col items-start justify-between gap-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:"Your payment is past due"}),e.jsxs("p",{className:"mt-0.5 text-sm",children:[t?"Update your payment method in your Shopify admin under Apps â Rankpilot within ":"Update your billing details within ",s," day",s===1?"":"s"," to avoid service interruption. Everything keeps running as normal until then."]})]}),!t&&e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"shrink-0",children:e.jsx(A,{to:"/dashboard/profile",children:"Update billing"})})]}):null},Ka=a=>{const t="Give a month, get a month on RankPilot â join with my link and we both get a free month of AI SEO content:",s=encodeURIComponent(a),n=encodeURIComponent(t);return[{label:"LinkedIn",href:`https://www.linkedin.com/sharing/share-offsite/?url=${s}
11`,icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4","aria-hidden":!0,children:e.jsx("path",{d:"M4.98 3.5a2.5 2.5 0 11-.02 5 2.5 2.5 0 01.02-5zM3 9h4v12H3zM10 9h3.8v1.7h.05c.53-1 1.83-2.05 3.77-2.05 4.03 0 4.78 2.65 4.78 6.1V21H16.4v-5.4c0-1.3-.02-2.95-1.8-2.95-1.8 0-2.08 1.4-2.08 2.85V21H10z"})})},{label:"X",href:`https://twitter.com/intent/tweet?text=${n}&url=${s}`,icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4","aria-hidden":!0,children:e.jsx("path",{d:"M18.244 2H21.5l-7.5 8.57L23 22h-6.844l-5.36-7.01L4.7 22H1.44l8.02-9.17L1 2h7.02l4.84 6.4L18.244 2zm-1.2 18h1.9L7.03 4H5.02l12.02 16z"})})},{label:"WhatsApp",href:`https://wa.me/?text=${n}%20${s}`,icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-4 w-4","aria-hidden":!0,children:e.jsx("path",{d:"M12.04 2a9.9 9.9 0 00-8.5 15l-1.3 4.7 4.83-1.27A9.9 9.9 0 1012.04 2zm0 1.8a8.1 8.1 0 11-4.13 15.06l-.3-.18-2.86.75.76-2.79-.19-.3A8.1 8.1 0 0112.04 3.8zm4.68 10.2c-.26-.13-1.5-.74-1.73-.82-.23-.09-.4-.13-.57.13-.17.26-.66.82-.8.99-.15.17-.3.19-.55.06-.26-.13-1.08-.4-2.06-1.27-.76-.68-1.27-1.51-1.42-1.77-.15-.26-.02-.4.11-.53.11-.11.26-.3.39-.44.13-.15.17-.26.26-.43.09-.17.04-.32-.02-.45-.06-.13-.57-1.38-.79-1.89-.2-.49-.41-.42-.57-.43h-.48c-.17 0-.44.06-.67.32-.23.26-.88.86-.88 2.1 0 1.24.9 2.44 1.03 2.61.13.17 1.77 2.7 4.3 3.79.6.26 1.07.41 1.44.53.6.19 1.15.16 1.58.1.48-.07 1.5-.61 1.71-1.2.21-.59.21-1.1.15-1.2-.06-.11-.23-.17-.49-.3z"})})},{label:"Email",href:`mailto:?subject=${encodeURIComponent("Give a month, get a month on RankPilot")}&body=${n}%20${s}`,icon:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"h-4 w-4","aria-hidden":!0,children:[e.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),e.jsx("path",{d:"m3 7 9 6 9-6"})]})}]},qa=()=>{const[a,t]=g.useState(!1),[s,n]=g.useState(!1),[r,m]=g.useState(!1),{data:d,isLoading:i,isError:c}=J({queryKey:["referral","link"],queryFn:()=>Ee.getLink(),enabled:a,staleTime:5*60*1e3}),h=async()=>{if(d!=null&&d.url)try{await navigator.clipboard.writeText(d.url),n(!0),I.success("Referral link copied"),setTimeout(()=>n(!1),2e3)}catch{I.error("Could not copy link")}};return e.jsxs(P,{open:a,onOpenChange:t,children:[e.jsx(Be,{asChild:!0,children:e.jsxs("button",{type:"button",className:"hidden items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-sm font-medium text-gray-600 transition-colors hover:bg-gray-100 hover:text-gray-900 md:inline-flex",children:[e.jsx(Na,{className:"size-4"}),"Invite a friend"]})}),e.jsxs(B,{className:"overflow-hidden p-0 sm:max-w-sm",children:[e.jsxs("div",{className:"bg-blue px-8 pt-8 pb-6 text-center text-white",children:[e.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-white/20",children:e.jsx($e,{className:"h-6 w-6"})}),e.jsx("h2",{className:"text-2xl font-bold",children:"Give a month, get a month"}),e.jsx("p",{className:"mx-auto mt-2 max-w-xs text-sm text-white/90",children:"Invite a friend. When they join, you both get 30 days free."})]}),e.jsxs("div",{className:"px-8 py-6",children:[e.jsxs(N,{onClick:h,disabled:i||c||!(d!=null&&d.url),className:"h-12 w-full gap-2 rounded-full text-base",children:[s?e.jsx(ce,{className:"h-5 w-5"}):e.jsx(Ge,{className:"h-5 w-5"}),s?"Copied":"Copy your link"]}),c&&e.jsx("p",{className:"mt-3 text-center text-sm text-red-500",children:"Could not load your referral link. Please try again."}),e.jsx("div",{className:"mt-4 flex items-center justify-center gap-3",children:(d==null?void 0:d.url)&&Ka(d.url).map(x=>e.jsx("a",{href:x.href,target:"_blank",rel:"noopener noreferrer","aria-label":`Share on ${x.label}`,className:"flex h-10 w-10 items-center justify-center rounded-lg border border-gray-200 text-gray-700 transition-colors hover:border-blue hover:text-blue",children:x.icon},x.label))}),e.jsx("button",{type:"button",onClick:()=>m(x=>!x),className:"mx-auto mt-4 block text-sm font-medium text-gray-500 hover:text-gray-700",children:"How it works"}),r&&e.jsxs("ul",{className:"mt-2 list-disc space-y-1.5 rounded-xl bg-gray-50 p-4 pl-8 text-xs leading-snug text-gray-600",children:[e.jsx("li",{children:"You both get one free month â a credit worth one month's base price on your next invoice."}),e.jsx("li",{children:"Earned when your friend's first real payment clears, after any free trial."}),e.jsx("li",{children:"Add-ons (extra websites, languages) aren't covered."}),e.jsx("li",{children:"On a trial yourself? Your credit applies once you're billed."}
11),e.jsx("li",{children:"Reversed if that payment is refunded or disputed."})]})]})]})]})},Ya=a=>a>=1e3?`${(a/1e3).toFixed(1)}K`:a.toLocaleString(),Qa=()=>{const{activeWebsite:a}=E(),{languages:t}=we(),{isTeamContext:s}=W(),{state:n}=S(),[r,m]=g.useState(!1),d=new Set(t.map(l=>l.languageCode)),i=M.filter(l=>!d.has(l)),c=J({queryKey:["languages","reach",a==null?void 0:a.id,i.join(",")],queryFn:()=>ke.reach(a.id,i),enabled:!!(a!=null&&a.id)&&i.length>0,staleTime:5*60*1e3,retry:!1}),h=g.useMemo(()=>c.data?Object.values(c.data).reduce((l,f)=>l+(f||0),0):0,[c.data]);if(s||!a||i.length===0)return null;const x=h>0?`Reach ${Ya(h)} more customers`:"Reach more customers";return n==="collapsed"?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>m(!0),title:x,className:"mx-auto flex size-9 items-center justify-center rounded-lg bg-blue text-white shadow-sm transition-all hover:bg-blue/90 hover:shadow-md",children:e.jsx(V,{className:"size-4"})}),e.jsx(H,{open:r,onOpenChange:m})]}):e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>m(!0),className:p("group w-full rounded-xl border border-blue/20 bg-gradient-to-br from-blue/5 to-blue/10 p-3 text-left transition-all","hover:border-blue/40 hover:from-blue/10 hover:to-blue/15"),children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-bold tracking-wider text-blue uppercase",children:[e.jsx(V,{className:"size-3"}),"Unlock more"]}),e.jsx("div",{className:"mt-1 text-sm leading-snug font-bold text-gray-900",children:x}),e.jsxs("div",{className:"mt-2 inline-flex items-center gap-1 text-xs font-semibold text-blue",children:["Unlock languages",e.jsx(Ze,{className:"size-3 transition-transform group-hover:translate-x-0.5"})]})]}),e.jsx(H,{open:r,onOpenChange:m})]})},Xa=({user:a})=>{var o;const t=pe(),s=g.useRef(null),[n,r]=g.useState(!1);He(!!a);const m=Ve(),d=Ke(),{data:i}=qe(),{data:c,isLoading:h}=Ye({page:1,limit:5},n);g.useEffect(()=>{if(!n)return;const l=f=>{s.current&&f.target instanceof Node&&!s.current.contains(f.target)&&r(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[n]);const x=l=>{l.readAt||m.mutate(l._id),l.link&&t(l.link),r(!1)};return e.jsx("div",{className:"flex items-center gap-4",children:e.jsxs("div",{className:"relative",ref:s,children:[e.jsxs("button",{"aria-label":"Toggle notifications",className:"relative cursor-pointer rounded-lg p-2 text-gray-600 hover:bg-gray-100",onClick:()=>r(l=>!l),children:[e.jsx("svg",{className:"h-6 w-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),i!=null&&i.count?e.jsx("span",{className:"absolute -top-1 -right-1 flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-red-500 px-1 text-[10px] text-white",children:i.count>9?"9+":i.count}):null]}),n&&e.jsxs("div",{className:"absolute right-0 z-50 mt-2 w-80 rounded-xl border border-gray-200 bg-white shadow-lg",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 px-4 py-3",children:[e.jsx("div",{className:"text-sm font-semibold",children:"Notifications"}),e.jsx("button",{className:"cursor-pointer text-xs font-medium text-blue",onClick:()=>d.mutate(),disabled:d.isPending,children:"Mark all read"})]}),e.jsx("div",{className:"max-h-80 overflow-y-auto",children:h?e.jsx("div",{className:"flex items-center justify-center px-4 py-10",children:e.jsx(C,{className:"size-6"})}):(o=c==null?void 0:c.items)!=null&&o.length?c.items.map(l=>e.jsx("button",{onClick:()=>x(l),className:p("w-full border-b border-gray-200 px-4 py-3 text-left hover:bg-gray-50",l.readAt?"bg-white":"bg-blue/5"),children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:p("mt-1 size-2 rounded-full",l.readAt?"bg-gray-300":"bg-blue")}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-medium",children:l.title}),e.jsx("div",{className:"text-xs text-gray-600",children:l.body}),l.createdAt?e.jsx("div",{className:"mt-1 text-[11px] text-gray-400",children:new Date(l.createdAt).toLocaleStr
11ing()}):null]})]})},l._id)):e.jsx("div",{className:"flex items-center justify-center px-4 py-10 text-sm text-gray-600",children:"No notifications yet"})}),e.jsx("div",{className:"px-4 py-3 text-xs text-gray-600",children:"Updates appear here when events occur."})]})]})})},T=(a,t)=>{try{return new Intl.NumberFormat(void 0,{style:"currency",currency:(t||"usd").toUpperCase()}).format((a||0)/100)}catch{return`$${((a||0)/100).toFixed(2)}`}},Za=({open:a,onOpenChange:t})=>{var j;const[s,n]=g.useState(""),[r,m]=g.useState(M[0]),[d,i]=g.useState(null),{activeWebsite:c,refetch:h}=E(),x=sa(),o=na(a),[l,f]=g.useState(null);g.useEffect(()=>{a||f(null)},[a]);const u=l??((j=o.data)!=null&&j.trialGate.required?o.data.trialGate.limit:null),y=async()=>{i(null);try{await x.mutateAsync({domain:s.trim(),contentLanguage:r}),h(),n(""),m((c==null?void 0:c.contentLanguage)||M[0]),t(!1)}catch(v){const k=Xe(v);if(k.code==="TRIAL_LIMIT_REACHED"&&k.limit!==null){f(k.limit);return}i(v instanceof ee?v.message:"Could not add the website. Please try again.")}},z=o.isSuccess&&!!o.data,b=s.trim().length>3&&z&&!x.isPending;return e.jsx(P,{open:a,onOpenChange:t,children:e.jsxs(B,{className:"sm:max-w-lg",children:[e.jsxs(ie,{children:[e.jsxs("div",{className:"mb-1 flex items-center gap-2 text-xs font-semibold tracking-wide text-indigo-600 uppercase",children:[e.jsx(O,{className:"size-4"})," Add another website"]}),e.jsx(le,{className:"text-2xl",children:"Manage all your stores from one dashboard"}),e.jsx(oe,{children:"One login, one calendar, articles going live on every site you own."})]}),o.isLoading?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[e.jsx(C,{className:"size-8 text-indigo-600 mb-3"}),e.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Checking account planâ¦"})]}):u!==null?e.jsx(Qe,{resource:"website",limit:u,onEnded:()=>f(null),onCancel:()=>t(!1)}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{htmlFor:"add-website-domain",className:"text-sm font-medium",children:"Website URL"}),e.jsx(ia,{id:"add-website-domain",placeholder:"mystore.com",value:s,onChange:v=>n(v.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("label",{htmlFor:"add-website-language",className:"text-sm font-medium",children:"Content language"}),e.jsxs(la,{value:r,onValueChange:m,children:[e.jsx(oa,{id:"add-website-language",children:e.jsx(da,{placeholder:"Select language"})}),e.jsx(ca,{children:e.jsx(ma,{children:M.map(v=>{var k;return e.jsx(xa,{value:v,children:e.jsxs("span",{className:"inline-flex items-center gap-2",children:[e.jsx(ua,{country:(k=ta[v])==null?void 0:k.country})," ",v]})},v)})})})]}),e.jsx("p",{className:"text-xs text-gray-500",children:"Every article and calendar entry for this site is written in this language."})]}),e.jsxs("div",{className:"rounded-xl bg-gray-50 p-4",children:[e.jsx("div",{className:"mb-2 text-xs font-semibold tracking-wide text-gray-500 uppercase",children:"What you unlock"}),e.jsxs("ul",{className:"space-y-2 text-sm text-gray-700",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ha,{className:"size-4 text-indigo-500"})," Keyword research tuned to this store"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(pa,{className:"size-4 text-indigo-500"})," Its own content calendar, published on its own schedule"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(ga,{className:"size-4 text-indigo-500"})," Same login, same dashboard, both sites side by side"]})]})]}),e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4 text-sm",children:[o.isLoading&&e.jsxs("div",{className:"flex items-center gap-2 text-gray-500",children:[e.jsx(C,{className:"size-4"})," Loading exact priceâ¦"]}),o.isError&&e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-red-600",children:"Couldn't load the price. Please retry."}),e.jsx(N,{variant:"outline",size:"sm",onClick:()=>o.refetch(),children:"Retry"})]}),z&&o.data&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-600",children:o.data.isTrialing?"Charged today (during trial)":"Charged today (prorated)"}),e.jsx("span",{className:"font-semibold",children:T(o.data.amountDue,o.data.currency)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-gray-600",children:"The
11n each month"}),e.jsxs("span",{className:"font-semibold",children:[T(o.data.nextRecurringAmount,o.data.currency),"/mo per site"]})]})]})]}),d&&e.jsx("p",{className:"text-sm text-red-600",children:d})]}),e.jsxs(de,{className:"items-center justify-between sm:justify-between",children:[e.jsx("span",{className:"text-xs text-gray-500",children:z&&o.data?`Added to your plan · ${T(o.data.nextRecurringAmount,o.data.currency)}/mo per site`:"Added to your plan"}),e.jsx(N,{onClick:y,disabled:!b,children:x.isPending?e.jsxs(e.Fragment,{children:[e.jsx(C,{className:"size-4"})," Addingâ¦"]}):"Add website"})]})]})]})})},Ja=({website:a,open:t,onOpenChange:s})=>{const[n,r]=g.useState(null),{activeWebsite:m,setActiveWebsite:d,websites:i}=E(),c=ra(),h=(a==null?void 0:a.status)==="analyzing",x=async()=>{if(a){r(null);try{const o=await c.mutateAsync(a.id);if(h&&I[o!=null&&o.refunded?"success":"warning"](o!=null&&o.refunded?"Website removed and your charge has been refunded.":"Website removed. We couldn't reverse the charge automatically â contact support and we'll refund it."),(m==null?void 0:m.id)===a.id){const l=i.find(f=>f.id!==a.id);l&&d(l.id)}s(!1)}catch(o){r(o instanceof ee?o.message:"Could not remove the website. Please try again.")}}};return e.jsx(P,{open:t,onOpenChange:s,children:e.jsxs(B,{className:"sm:max-w-md",children:[e.jsxs(ie,{children:[e.jsxs(le,{children:["Remove ",(a==null?void 0:a.name)||(a==null?void 0:a.domain),"?"]}),e.jsxs(oe,{children:["Are you sure you want to remove ",e.jsx("strong",{className:"text-gray-900",children:(a==null?void 0:a.name)||(a==null?void 0:a.domain)}),"?",h?" Setup was incomplete, so this website will be removed and any pending charge refunded.":" All associated data, calendar entries, and scheduled posts for this website will be permanently removed."]})]}),n&&e.jsx("p",{className:"text-sm text-red-600",children:n}),e.jsxs(de,{className:"mt-2",children:[e.jsx(N,{variant:"outline",onClick:()=>s(!1),disabled:c.isPending,children:"Cancel"}),e.jsx(N,{onClick:x,disabled:c.isPending,className:"bg-red-600 hover:bg-red-700",children:c.isPending?e.jsx(C,{className:"size-4"}):"Remove Website"})]})]})})},et=({website:a})=>{var r;const t=(r=a.languages)!=null&&r.length?a.languages:[];if(t.length===0)return null;const s=t.slice(0,3),n=t.length-s.length;return e.jsxs("span",{className:"flex items-center gap-1",children:[s.map(m=>e.jsx("span",{className:"rounded bg-gray-100 px-1 text-[10px] font-medium uppercase text-gray-600",children:m.languageCode.slice(0,2)},m.id)),n>0&&e.jsxs("span",{className:"text-[10px] text-gray-500",children:["+",n]})]})},at=()=>{var f;const{websites:a,activeWebsite:t,setActiveWebsite:s,isLoading:n}=E(),{isTeamContext:r}=W(),m=Je(),[d,i]=g.useState(!1),[c,h]=g.useState(null);if(n)return e.jsx("div",{className:"h-12 w-full animate-pulse rounded-lg border border-gray-200 bg-gray-50"});if(!t)return null;const x=u=>u.name||u.domain||u.websiteUrl||"Your website",o=a.length>1&&!r,l=((f=m.data)==null?void 0:f.unitAmount)!=null?`$${(m.data.unitAmount/100).toFixed(0)}/mo`:null;return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-lg border border-gray-200 bg-white px-2.5 py-2 text-left hover:bg-gray-50",children:[e.jsx("span",{className:"flex size-8 items-center justify-center rounded-md bg-indigo-50 text-indigo-600",children:e.jsx(O,{className:"size-4"})}),e.jsxs("span",{className:"grid flex-1 leading-tight",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:x(t)}),e.jsxs("span",{className:"truncate text-xs text-gray-500",children:[a.length," ",a.length===1?"site":"sites"]})]}),e.jsx(ea,{className:"size-4 text-gray-400"})]})}),e.jsxs(ne,{align:"start",className:"w-(--radix-dropdown-menu-trigger-width) min-w-64",children:[e.jsx(re,{className:"text-xs uppercase tracking-wide text-gray-500",children:"Your sites"}),a.map(u=>e.jsxs(D,{onSelect:y=>{u.status==="analyzing"?y.preventDefault():s(u.id)},className:`flex items-center gap-2 ${u.status==="analyzing"?"opacity-70":""}`,children:[e.jsx("span",{className:"flex size-6 items-center justify-center rounded bg-gray-100 text-gray-500",children:e.jsx(O,{className:"size-3.5"})}),e.jsxs("span",{className:"grid flex-1 leading-tight",children:[e.jsx("span",{className:"truncate text-sm",children:x(u)}),e.jsx("span",{className:"flex items-center gap-1",children:u.status==="analyzing"&&u.analysisStatus==="failed"?e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-red-600",children:[e.jsx(fa,{className:"size-3"})," Setup failed â remove it"]}):u.status==="analyzing"?e.jsx("span",{className:"text-[10px] text-amber-600",children:"Analyzingâ¦"}):e.jsx(et,{website:u})})]}),t.id===u.id&&e.jsx(ce,{className:"size-4 text-indigo-600"}),o&&!u.isDefault&&e.jsx("button",{type:"button","aria-label":`Remove ${x(u)}`,className:"ml-1 rounded p-1 text-gray-400 hover:bg-red-50 hover:text-red-600",onClick:y=>{y.preventDefault(),y.stopPropagation(),h(u)},children:e.jsx(ba,{className:"size-3.5"})})]},u.id)),!r&&e.jsxs(e.Fragment,{children:[e.jsx(_,{}),e.jsxs(D,{onClick:()=>i(!0),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex size-6 items-center justify-center rounded bg-indigo-50 text-indigo-600",children:e.jsx(ja,{className:"size-3.5"})}),e.jsxs("span",{className:"grid flex-1 leading-tight",children:[e.jsx("span",{className:"text-sm font-medium",children:"Add website"}),e.jsxs("span",{className:"text-xs text-gray-500",children:["Manage another store",l?` · ${l}`:""]})]})]})]})]})]}),!r&&e.jsxs(e.Fragment,{children:[e.jsx(Za,{open:d,onOpenChange:i}),e.jsx(Ja,{website:c,open:!!c,onOpenChange:u=>!u&&h(null)})]})]})},ue=[{label:"Dashboard",href:"/dashboard",icon:e.jsx("svg",{className:"size-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})})},{label:"Analytics",href:"/dashboard/analytics",icon:e.jsx("svg",{className:"size-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})},{label:"Content",href:"/dashboard/content",icon:e.jsx("svg",{className:"size-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})},{label:"Keywords",href:"/dashboard/keywords",icon:e.jsx("svg",{className:"size-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})},{label:"Brand",href:"/dashboard/brand",icon:e.jsx("svg",{className:"size-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.59 13.41L11 3.83A2 2 0 009.59 3.24L4 3a1 1 0 00-1 1l.24 5.59a2 2 0 00.59 1.41l9.58 9.58a2 2 0 002.83 0l4.35-4.35a2 2 0 000-2.82zM7.5 8.5a1 1 0 110-2 1 1 0 010 2z"})})}],he=[{label:"Profile",href:"/dashboard/profile",icon:e.jsx("svg",{className:"size-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})},{label:"Settings",href:"/dashboard/settings",icon:e.jsxs("svg",{className:"size-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}],Ht=()=>{const{user:a}=ae();return e.jsxs(Oa,{children:[e.jsx(nt,{user:a}),e.jsx(tt,{user:a})]})},tt=({user:a})=>{var s,n;const{pathname:t}=X();return e.jsxs(Pa,{children:[e.jsxs("header",{className:"sticky top-0 z-10 flex h-16 items-center justify-between border-b border-gray-200 bg-white px-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(xe,{className:"md:hidden"}),e.jsx("h1",{className:"text-xl font-semibold",children:((s=ue.find(r=>t.endsWith(r.href)))==null?void 0:s.label)||((n=he.find(r=>t.endsWith(r.href)))==null?void 0:n.label)||(t.endsWith("/dashboard/profile")?"Profile":"Dashboard")})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(qa,{}),e.jsx(Xa,{user:a})]})]}),e.jsxs("main",{className:"flex flex-1 flex-col gap-6 p-6",children:[e.jsx(Va,{}),e.jsx(st,{}),e.jsx(Se,{children:e.jsx(g.Suspense,{fallback:e.jsx("div",{className:"flex items-center justify-center p-6",children:e.jsx(C,{className:"size-8"})}),children:e.jsx(ge,{})})})]})]})},st=()=>{const{data:a,isLoading:t}=ze(),{isTeamContext:s}=W();if(s||t||!a||a.onboardingCompleted)return null;const n=a.lastCompletedStep??0,r=n>0;return e.jsx("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 px-5 py-4",children:e.jsxs("div",{className:"flex flex-col items-start justify-between gap-4 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-11 w-11 items-center justify-center rounded-xl bg-amber-100 text-amber-700",children:e.jsx(ya,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-lg font-semibold text-amber-900",children:"Finish setting up Rankpilot"}),e.jsx("div",{className:"text-sm text-amber-800",children:r?`You're on step ${Math.min(n+1,3)} of 3. We start writing and publishing once setup is done.`:"Tell us about your website so we can plan, write and publish your content automatically."})]})]}),e.jsx(N,{asChild:!0,className:"h-10 px-5",children:e.jsx(A,{to:"/onboarding",children:r?"Continue onboarding":"Start onboarding"})})]})})},L=a=>
11[a.firstName,a.lastName].filter(Boolean).join(" ")||a.email,Q=a=>{var t,s,n;return a.firstName||a.lastName?`${((t=a.firstName)==null?void 0:t.charAt(0))??""}${((s=a.lastName)==null?void 0:s.charAt(0))??""}`:((n=a.email)==null?void 0:n.charAt(0).toUpperCase())??"U"},nt=({user:a})=>{const t=Ce(),s=De(),{pathname:n}=X(),{isMobile:r,toggleSidebar:m}=S(),d=async()=>{try{await s.mutateAsync(),t.removeQueries({queryKey:["auth","me"]})}finally{Ae(Me.LOGGED_OUT),Le(),window.location.href="/login"}};return e.jsxs(Wa,{collapsible:"icon",className:"gap-0",children:[e.jsxs(Ba,{className:"md:h-16 md:border-b",children:[e.jsx(A,{to:"/dashboard",children:e.jsx("img",{className:"h-10 w-auto",alt:"Rankpilot",src:Ue})}),e.jsx(xe,{})]}),e.jsxs(Ua,{children:[e.jsx(K,{className:"p-3 pb-0 group-data-[collapsible=icon]:hidden",children:e.jsx(q,{children:e.jsx(at,{})})}),e.jsx(K,{className:"p-3",children:e.jsx(q,{children:e.jsx($a,{className:"gap-1",children:ue.map(i=>e.jsx(Ga,{children:e.jsx(Y,{tooltip:i.label,isActive:n.endsWith(i.href),asChild:!0,children:e.jsxs(A,{to:i.href,onClick:()=>r&&m(),children:[i.icon,e.jsx("span",{children:i.label})]})})},i.href))})})}),e.jsx("div",{className:"mt-auto p-3 group-data-[collapsible=icon]:p-2",children:e.jsx(Qa,{})})]}),a&&e.jsxs(Fa,{children:[e.jsx("div",{className:"px-1 pb-1 group-data-[collapsible=icon]:hidden",children:e.jsx(aa,{})}),e.jsxs(te,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(Y,{size:"lg",className:"group-data-[collapsible=icon]:p-0! group-data-[collapsible=icon]:[&_span]:size-11! group-data-[collapsible=icon]:[&_span]:rounded-lg!",children:[e.jsxs(F,{className:"size-9",children:[e.jsx(U,{src:a.avatarUrl??void 0,alt:L(a)}),e.jsx($,{children:Q(a)})]}),e.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[e.jsx("span",{className:"truncate font-medium",children:L(a)}),e.jsx("span",{className:"truncate text-xs text-gray-600",children:a.email})]})]})}),e.jsxs(ne,{className:"w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",sideOffset:4,children:[e.jsx(re,{className:"p-0 font-normal",children:e.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[e.jsxs(F,{className:"size-8",children:[e.jsx(U,{src:a.avatarUrl??void 0,alt:L(a)}),e.jsx($,{children:Q(a)})]}),e.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[e.jsx("span",{className:"truncate font-medium",children:L(a)}),e.jsx("span",{className:"truncate text-xs text-gray-600",children:a.email})]})]})}),e.jsx(_,{}),e.jsx(G,{children:he.map(i=>e.jsx(D,{asChild:!0,children:e.jsxs(A,{to:i.href,children:[i.icon,e.jsx("span",{children:i.label})]})},i.href))}),e.jsx(_,{}),e.jsx(G,{children:e.jsxs(D,{onClick:d,className:"text-red-500 hover:bg-red-500/10 hover:text-red-500",children:[e.jsx(va,{className:"size-4"}),e.jsx("span",{children:"Log out"})]})})]})]})]})]})};export{Ht as DashboardLayout};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.