1import{j as e,a as p}from"./markdown-heavy-8UV4qH-A.js";import{a as U,b as E,l as k,B as d,P as D,L as g,m as O,c as f}from"./index-hRb6JNK_.js";import{g as j}from"./getInitials-Cu9kaLb3.js";import{D as y,a as C,b as w,d as h,e as P}from"./dropdown-menu-uooolvDV.js";import{A as M,b as T}from"./avatar-jVTd9UgI.js";import{P as I}from"./permissions-DplaG6EH.js";import{u as N}from"./i18n-DgWLzMU8.js";import{aA as L,f as R,aM as _,aN as z,ax as B,aB as G}from"./vendor-ui-BRlh5kVz.js";const ne=()=>{const r=U(),{state:s,signout:a}=E(),{t:n}=N();if(!s.isInitialized)return e.jsx("div",{className:"nav-item ms-2",children:e.jsx("div",{className:"animate-spin h-5 w-5 border-2 border-primary rounded-full border-t-transparent"})});if(s.status==="authenticated"){let i;try{i=k(s.token)}catch(m){return console.error("Error decoding token:",m),e.jsx("div",{children:n("errors.invalidToken",{defaultValue:"Error: Invalid token."})})}const t=i.name,c=i.unique_name,l=j(t)||j(c),o=()=>{a(),r("/")};return e.jsxs(y,{children:[e.jsx(C,{asChild:!0,children:e.jsxs(d,{variant:"outline",className:"flex items-center gap-2",children:[e.jsx(M,{className:"h-6 w-6",children:e.jsx(T,{children:l})}),e.jsx("span",{children:t}),e.jsx(L,{className:"h-4 w-4 opacity-50"})]})}),e.jsxs(w,{align:"end",children:[e.jsxs(D,{permission:I.Admin.AccessPanel,children:[e.jsx(h,{asChild:!0,children:e.jsxs(g,{to:"/admin",className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(R,{className:"h-4 w-4"}),e.jsx("span",{children:"Admin Panel"})]})}),e.jsx(P,{})]}),e.jsxs(h,{onClick:o,className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(_,{className:"h-4 w-4"}),e.jsx("span",{children:n("navigation.logout")})]})]})]})}else return e.jsxs(e.Fragment,{children:[e.jsx(d,{asChild:!0,variant:"outline",children:e.jsxs(g,{to:"/signin",children:[e.jsx(z,{className:"size-4"}),e.jsx("span",{className:"text-nowrap",children:n("auth.login")})]})}),e.jsx(d,{asChild:!0,children:e.jsxs(g,{to:"/signup",children:[e.jsx(B,{className:"size-4"}),e.jsx("span",{className:"text-nowrap",children:n("auth.signup")})]})})]})};function u(){return u=Object.assign?Object.assign.bind():function(r){for(var s=1;s<arguments.length;s++){var a=arguments[s];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(r[n]=a[n])}return r},u.apply(this,arguments)}function K(r,s){if(r==null)return{};var a={},n=Object.keys(r),i,t;for(t=0;t<n.length;t++)i=n[t],!(s.indexOf(i)>=0)&&(a[i]=r[i]);return a}var $=["cdnSuffix","cdnUrl","countryCode","style","svg"],q="https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/",H="svg",V=127397,v=function(s){var a=s.cdnSuffix,n=a===void 0?H:a,i=s.cdnUrl,t=i===void 0?q:i,c=s.
1countryCode,l=s.style,o=s.svg,m=o===void 0?!1:o,x=K(s,$);if(typeof c!="string")return null;if(m){var A=""+t+c.toLowerCase()+"."+n;return p.createElement("img",Object.assign({},x,{src:A,style:u({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var F=c.toUpperCase().replace(/./g,function(S){return String.fromCodePoint(S.charCodeAt(0)+V)});return p.createElement("span",Object.assign({role:"img"},x,{style:u({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),F)};const b={"en-US":{label:"ENG",labelFull:"English",countryCode:"US",direction:"ltr"},"ar-SA":{label:"Ø§ÙØ¹Ø±Ø¨ÙØ©",labelFull:"Ø§ÙØ¹Ø±Ø¨ÙØ©",countryCode:"SA",direction:"rtl"},"ur-PK":{label:"اردÙ",labelFull:"اردÙ",countryCode:"PK",direction:"rtl"}},re=()=>{const{currentLanguage:r,changeLanguage:s,supportedLanguages:a,isRTLMode:n}=O(),{t:i}=N(),t=b[r];return e.jsxs(y,{children:[e.jsx(C,{asChild:!0,children:e.jsxs(d,{variant:"outline",className:f("rounded-md px-4 py-2 flex items-center gap-2 shadow-sm border min-w-[90px] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 transition-all duration-200",n&&"flex-row-reverse"),"aria-label":i("common.switchLanguage"),children:[e.jsx(v,{countryCode:t.countryCode,svg:!0,style:{width:"1.5em",height:"1.5em",borderRadius:"2px"},title:t.labelFull}),e.jsx("span",{className:"font-semibold",children:t.label}),e.jsx(L,{className:"h-4 w-4 ml-1 text-muted-foreground"})]})}),e.jsx(w,{align:n?"start":"end",className:"w-44 p-1 animate-fade-in",style:{direction:t.direction},children:Object.entries(a).map(([c,l])=>{const o=b[l];return e.jsxs(h,{onClick:()=>s(l),className:f("flex items-center gap-2 px-3 py-2 rounded-md cursor-pointer transition-colors",r===l&&"bg-accent font-bold",o.direction==="rtl"&&"flex-row-reverse text-right"),tabIndex:0,"aria-selected":r===l,children:[e.jsx(v,{countryCode:o.countryCode,svg:!0,style:{width:"1.5em",height:"1.5em",borderRadius:"2px"},title:o.labelFull}),e.jsx("span",{className:"flex-1",children:o.labelFull}),r===l&&e.jsx(G,{className:"ml-2 h-4 w-4 text-primary"})]},c)})})]})};export{re as L,ne as U};
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.