import{u as L,r as d,j as e,b as F,d as V,m as O,l as W,A as G,e as J,f as q,i as Q,c as X,P as Y,s as Z}from"./logo-BvVs1LL9.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function s(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=s(a);fetch(a.href,i)}})();const tt="_statsCard_lhfl4_1",et="_statItem_lhfl4_12",st="_statLabel_lhfl4_18",nt="_statValue_lhfl4_26",m={statsCard:tt,statItem:et,statLabel:st,statValue:nt},z="AES-GCM",ot=256,E=12;async function at(o){const t=new TextEncoder,s=await crypto.subtle.importKey("raw",t.encode(o),"PBKDF2",!1,["deriveBits","deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:t.encode("sentinax-shield-v1"),iterations:1e5,hash:"SHA-256"},s,{name:z,length:ot},!1,["encrypt","decrypt"])}async function rt(){const o=[navigator.userAgent,navigator.language,new Date().getTimezoneOffset().toString(),chrome.runtime.id].join("|");return at(o)}async function H(o){try{const t=await rt(),s=Uint8Array.from(atob(o),g=>g.charCodeAt(0)),n=s.slice(0,E),a=s.slice(E),i=await crypto.subtle.decrypt({name:z,iv:n},t,a);return new TextDecoder().decode(i)}catch(t){throw console.error("Sentinax: Decryption failed",t),new Error("Decryption failed")}}function P(o){try{return atob(o).length>=E}catch{return!1}}async function k(){const o=await chrome.storage.local.get(null),t=[];for(const[s,n]of Object.entries(o))if(s.startsWith("sentinax_history_")){const a=s.replace("sentinax_history_","");let i=n;if(typeof n=="string"&&P(n))try{const c=await H(n);i=JSON.parse(c)}catch(c){console.error(`Failed to decrypt history for ${a}`,c);continue}t.push({chatId:a,history:i,timestamp:Date.now()})}return t}async function it(){const o=await k(),t=o.reduce((n,a)=>n+a.history.length,0),s={version:"1.1.0",exportDate:new Date().toISOString(),totalChats:o.length,totalMessages:t,chats:o};return JSON.stringify(s,null,2)}async function ct(){const o=await k();let t="=".repeat(60)+`
`;t+=`SENTINAX SHIELD - CONVERSATION HISTORY BACKUP
`,t+=`Export Date: ${new Date().toLocaleString()}
`,t+=`Total Conversations: ${o.length}
`,t+="=".repeat(60)+`

`;for(let s=0;s<o.length;s++){const n=o[s],a=n.chatId.startsWith("session-")?`New Chat (Session ${s+1})`:`Chat ${n.chatId.substring(0,8)}`;t+=`
${"─".repeat(60)}
`,t+=`CONVERSATION: ${a}
`,t+=`ID: ${n.chatId}
`,t+=`Messages: ${n.history.length}
`,t+=`${"─".repeat(60)}

`;for(const i of n.history)t+=`[${i.role}]:
${i.content}

`}return t}async function lt(){const o=await k();let t=`# Sentinax Shield - Conversation History

`;t+=`**Export Date:** ${new Date().toLocaleString()}  
`,t+=`**Total Conversations:** ${o.length}  

`,t+=`---

`;for(let s=0;s<o.length;s++){const n=o[s],a=n.chatId.startsWith("session-")?`New Chat (Session ${s+1})`:`Chat ${n.chatId.substring(0,8)}`;t+=`## ${a}

`,t+=`**ID:** \`${n.chatId}\`  
`,t+=`**Messages:** ${n.history.length}  

`;for(const i of n.history)t+=`### ${i.role}

`,t+=`${i.content}

`;t+=`---

`}return t}async function dt(o){let t,s;switch(o){case"json":t=await it(),s="application/json";break;case"txt":t=await ct(),s="text/plain";break;case"markdown":t=await lt(),s="text/markdown";break;default:throw new Error(`Unsupported format: ${o}`)}return new Blob([t],{type:s})}async function ut(o){const t=await dt(o),s=URL.createObjectURL(t),n=new Date,a=n.toISOString().split("T")[0],i=n.toTimeString().split(" ")[0].replace(/:/g,"-"),g=(await k()).length,h=`sentinax_backup_${a}_${i}_${g}chats.${o==="markdown"?"md":o}`,r=document.createElement("a");r.href=s,r.download=h,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(s)}async function ht(o){try{const t=await o.text(),s=JSON.parse(t);if(!s.version||!s.chats||!Array.isArray(s.chats))return{success:!1,message:"Invalid backup file format",imported:0};let n=0;for(const a of s.chats){const i=`sentinax_history_${a.chatId}`;await chrome.storage.local.set({[i]:a.history}),n++}return{success:!0,message:`Successfully imported ${n} conversations`,imported:n}}catch(t){return console.error("Import failed",t),{success:!1,message:t instanceof Error?t.message:"Import failed",imported:0}}}async function pt(){const o=await k(),t=o.reduce((a,i)=>a+i.history.length,0),s=await chrome.storage.local.get(null),n=JSON.stringify(s).length;return{totalChats:o.length,totalMessages:t,storageUsed:n}}const gt={en:{conversations:"Conversations",messages:"Messages",storage:"Storage",status:"Status",active:"Active"},ru:{conversations:"Разговоры",messages:"Сообщения",storage:"Хранилище",status:"Статус",active:"Активен"}},ft=()=>{const o=L(c=>c.settings.language)||"en",t=gt[o],[s,n]=d.useState({totalChats:0,totalMessages:0,storageUsed:0});d.useEffect(()=>{a()},[]);const a=async()=>{const c=await pt();n(c)},i=c=>c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KB`:`${(c/(1024*1024)).toFixed(1)} MB`;return e.jsxs("div",{className:m.statsCard,children:[e.jsxs("div",{className:m.statItem,children:[e.jsx("div",{className:m.statLabel,children:t.conversations}),e.jsx("div",{className:m.statValue,children:s.totalChats})]}),e.jsxs("div",{className:m.statItem,children:[e.jsx("div",{className:m.statLabel,children:t.messages}),e.jsx("div",{className:m.statValue,children:s.totalMessages})]}),e.jsxs("div",{className:m.statItem,children:[e.jsx("div",{className:m.statLabel,children:t.storage}),e.jsx("div",{className:m.statValue,children:i(s.storageUsed)})]}),e.jsxs("div",{className:m.statItem,children:[e.jsx("div",{className:m.statLabel,children:t.status}),e.jsx("div",{className:m.statValue,style:{fontSize:"14px",color:"#10b981"},children:t.active})]})]})},xt="_historyViewer_f7zbt_1",mt="_searchBar_f7zbt_25",yt="_chatItem_f7zbt_50",_t="_chatHeader_f7zbt_64",bt="_chatId_f7zbt_71",jt="_chatMeta_f7zbt_82",vt="_messageCount_f7zbt_90",Ct="_deleteBtn_f7zbt_97",wt="_chatContent_f7zbt_111",St="_message_f7zbt_90",kt="_messageRole_f7zbt_130",It="_messageContent_f7zbt_139",Nt="_emptyState_f7zbt_144",Tt="_pagination_f7zbt_151",x={historyViewer:xt,searchBar:mt,chatItem:yt,chatHeader:_t,chatId:bt,chatMeta:jt,messageCount:vt,deleteBtn:Ct,chatContent:wt,message:St,messageRole:kt,messageContent:It,emptyState:Nt,pagination:Tt},$t={en:{search:"Search conversations...",loading:"Loading history...",noResults:"No conversations found",noHistory:"No conversation history yet",delete:"Delete",deleteConfirm:"Delete conversation",msgs:"msgs",page:"Page",of:"of",previous:"Previous",next:"Next",id:"ID"},ru:{search:"Поиск разговоров...",loading:"Загрузка истории...",noResults:"Разговоры не найдены",noHistory:"История разговоров пока пуста",delete:"Удалить",deleteConfirm:"Удалить разговор",msgs:"сообщ.",page:"Страница",of:"из",previous:"Назад",next:"Вперед",id:"ID"}},M=10,Bt=()=>{const o=L(l=>l.settings.language)||"en",t=$t[o],[s,n]=d.useState([]),[a,i]=d.useState([]),[c,g]=d.useState(""),[u,h]=d.useState(null),[r,_]=d.useState(1),[C,T]=d.useState(!0);d.useEffect(()=>{I()},[]),d.useEffect(()=>{if(!c.trim()){i(s);return}const l=c.toLowerCase(),f=s.filter(v=>v.chatId.toLowerCase().includes(l)?!0:v.history.some(p=>p.content.toLowerCase().includes(l)||p.role.toLowerCase().includes(l)));i(f),_(1)},[c,s]);const I=async()=>{try{const l=await chrome.storage.local.get(null),f=[],v={};for(const[p,j]of Object.entries(l))if(p.startsWith("sentinax_meta_")){const w=p.replace("sentinax_meta_","");v[w]=j}for(const[p,j]of Object.entries(l))if(p.startsWith("sentinax_history_")){const w=p.replace("sentinax_history_","");let $=j;if(typeof j=="string"&&P(j))try{const B=await H(j);$=JSON.parse(B)}catch(B){console.error(`Failed to decrypt history for ${w}`,B);continue}f.push({chatId:w,history:$,messageCount:$.length,lastUpdated:v[w]?.lastUpdated||0})}f.sort((p,j)=>j.lastUpdated-p.lastUpdated),n(f),i(f)}catch(l){console.error("Failed to load histories",l)}finally{T(!1)}},A=async(l,f)=>{f.stopPropagation(),confirm(`${t.deleteConfirm} ${l}?`)&&(await chrome.storage.local.remove(`sentinax_history_${l}`),await I())},K=l=>{h(u===l?null:l)},N=Math.ceil(a.length/M),D=(r-1)*M,U=D+M,R=a.slice(D,U);return C?e.jsx("div",{className:x.emptyState,children:t.loading}):e.jsxs("div",{children:[e.jsx("div",{className:x.searchBar,children:e.jsx("input",{type:"text",placeholder:t.search,value:c,onChange:l=>g(l.target.value)})}),R.length===0?e.jsx("div",{className:x.emptyState,children:c?t.noResults:t.noHistory}):e.jsx("div",{className:x.historyViewer,children:R.map(l=>{let f="Sentinax Conversation";const v=l.history.find(p=>p.role==="user"||p.role==="User");if(v){let p=v.originalMessage||v.content;p=p.replace(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,"").trim(),f=p.replace(/^(hello|hi|hey|привет|здравствуй|добрый день|greetings|dear)\s*,?\s*/i,"").trim(),f||(f="New Conversation"),f.length>35&&(f=f.substring(0,32)+"...")}return e.jsxs("div",{className:x.chatItem,children:[e.jsxs("div",{className:x.chatHeader,onClick:()=>K(l.chatId),children:[e.jsxs("div",{className:x.chatId,children:[e.jsx("strong",{children:f}),e.jsxs("small",{style:{display:"block",fontSize:"10px",opacity:.6,marginTop:"2px"},children:[t.id,": ",l.chatId]})]}),e.jsxs("div",{className:x.chatMeta,children:[e.jsxs("span",{className:x.messageCount,children:[l.messageCount," ",t.msgs]}),e.jsx("button",{className:x.deleteBtn,onClick:p=>A(l.chatId,p),children:t.delete})]})]}),u===l.chatId&&e.jsx("div",{className:x.chatContent,children:l.history.map((p,j)=>e.jsxs("div",{className:x.message,children:[e.jsx("div",{className:x.messageRole,children:p.role}),e.jsx("div",{className:x.messageContent,children:p.content})]},j))})]},l.chatId)})}),N>1&&e.jsxs("div",{className:x.pagination,children:[e.jsx("button",{onClick:()=>_(l=>Math.max(1,l-1)),disabled:r===1,children:t.previous}),e.jsxs("span",{children:[t.page," ",r," ",t.of," ",N]}),e.jsx("button",{onClick:()=>_(l=>Math.min(N,l+1)),disabled:r===N,children:t.next})]})]})},Mt="_backupPanel_ct882_1",Et="_section_ct882_7",Lt="_sectionTitle_ct882_13",Dt="_buttonGroup_ct882_22",Rt="_exportBtn_ct882_28",Ot="_importBtn_ct882_51",zt="_message_ct882_71",Ht="_fadeIn_ct882_1",Pt="_success_ct882_79",At="_error_ct882_84",Kt="_hiddenInput_ct882_100",y={backupPanel:Mt,section:Et,sectionTitle:Lt,buttonGroup:Dt,exportBtn:Rt,importBtn:Ot,message:zt,fadeIn:Ht,success:Pt,error:At,hiddenInput:Kt},Ut=()=>{const[o,t]=d.useState(null),[s,n]=d.useState(!1),a=d.useRef(null),i=async u=>{try{n(!0),t(null),await ut(u),t({type:"success",text:`Exported as ${u.toUpperCase()}`})}catch{t({type:"error",text:"Export failed"})}finally{n(!1),setTimeout(()=>t(null),3e3)}},c=()=>{a.current?.click()},g=async u=>{const h=u.target.files?.[0];if(h)try{n(!0),t(null);const r=await ht(h);r.success?(t({type:"success",text:r.message}),setTimeout(()=>window.location.reload(),1500)):t({type:"error",text:r.message})}catch{t({type:"error",text:"Import failed"})}finally{n(!1),a.current&&(a.current.value="")}};return e.jsxs("div",{className:y.backupPanel,children:[e.jsxs("div",{className:y.section,children:[e.jsx("div",{className:y.sectionTitle,children:"Export Backup"}),e.jsxs("div",{className:y.buttonGroup,children:[e.jsx("button",{className:y.exportBtn,onClick:()=>i("json"),disabled:s,children:"📄 JSON"}),e.jsx("button",{className:y.exportBtn,onClick:()=>i("txt"),disabled:s,children:"📝 TXT"}),e.jsx("button",{className:y.exportBtn,onClick:()=>i("markdown"),disabled:s,children:"📋 MD"})]})]}),e.jsxs("div",{className:y.section,children:[e.jsx("div",{className:y.sectionTitle,children:"Import Backup"}),e.jsx("button",{className:y.importBtn,onClick:c,disabled:s,children:s?"⏳ Processing...":"📥 Import from JSON"}),e.jsx("input",{ref:a,type:"file",accept:".json",onChange:g,className:y.hiddenInput})]}),o&&e.jsx("div",{className:`${y.message} ${y[o.type]}`,children:o.text})]})},Ft="_toastContainer_1j41d_1",Vt="_toast_1j41d_1",Wt="_slideIn_1j41d_1",Gt="_success_1j41d_26",Jt="_toastIcon_1j41d_29",qt="_error_1j41d_32",Qt="_info_1j41d_38",Xt="_warning_1j41d_44",Yt="_exiting_1j41d_50",Zt="_slideOut_1j41d_1",te="_toastContent_1j41d_54",ee="_toastBody_1j41d_66",se="_toastTitle_1j41d_73",ne="_toastMessage_1j41d_80",oe="_toastClose_1j41d_86",ae="_toastProgress_1j41d_103",re="_progress_1j41d_1",b={toastContainer:Ft,toast:Vt,slideIn:Wt,success:Gt,toastIcon:Jt,error:qt,info:Qt,warning:Xt,exiting:Yt,slideOut:Zt,toastContent:te,toastBody:ee,toastTitle:se,toastMessage:ne,toastClose:oe,toastProgress:ae,progress:re},ie=({toast:o,onClose:t})=>{const[s,n]=d.useState(!1);d.useEffect(()=>{const c=o.duration||3e3,g=setTimeout(()=>{a()},c);return()=>clearTimeout(g)},[o.id]);const a=()=>{n(!0),setTimeout(()=>{t(o.id)},200)},i=()=>{switch(o.type){case"success":return"✓";case"error":return"✕";case"info":return"ℹ";case"warning":return"⚠";default:return"ℹ"}};return e.jsxs("div",{className:`${b.toast} ${b[o.type]} ${s?b.exiting:""}`,children:[e.jsxs("div",{className:b.toastContent,children:[e.jsx("div",{className:b.toastIcon,children:i()}),e.jsxs("div",{className:b.toastBody,children:[e.jsx("div",{className:b.toastTitle,children:o.title}),o.message&&e.jsx("div",{className:b.toastMessage,children:o.message})]})]}),e.jsx("button",{className:b.toastClose,onClick:a,children:"×"}),e.jsx("div",{className:b.toastProgress})]})},ce=({toasts:o,onClose:t})=>o.length===0?null:F.createPortal(e.jsx("div",{className:b.toastContainer,children:o.map(s=>e.jsx(ie,{toast:s,onClose:t},s.id))}),document.body),le="_tooltip_1rl23_1",de="_tooltipContent_1rl23_6",ue="_visible_1rl23_22",he="_top_1rl23_25",pe="_bottom_1rl23_39",ge="_left_1rl23_53",fe="_right_1rl23_67",xe="_kbd_1rl23_82",S={tooltip:le,tooltipContent:de,visible:ue,top:he,bottom:pe,left:ge,right:fe,kbd:xe},me=({content:o,position:t="top",delay:s=500,shortcut:n,children:a})=>{const[i,c]=d.useState(!1),g=d.useRef(void 0),u=()=>{g.current=window.setTimeout(()=>{c(!0)},s)},h=()=>{g.current&&window.clearTimeout(g.current),c(!1)};return d.useEffect(()=>()=>{g.current&&window.clearTimeout(g.current)},[]),e.jsxs("div",{className:S.tooltip,onMouseEnter:u,onMouseLeave:h,children:[a,i&&e.jsxs("div",{className:`${S.tooltipContent} ${S[t]} ${S.visible}`,children:[o,n&&e.jsx("span",{className:S.kbd,children:n})]})]})};let ye=0;function _e(){const[o,t]=d.useState([]),s=d.useCallback((u,h,r,_)=>{const C=`toast-${++ye}`,T={id:C,type:u,title:h,message:r,duration:_||3e3};return t(I=>[...I,T]),C},[]),n=d.useCallback((u,h)=>s("success",u,h),[s]),a=d.useCallback((u,h)=>s("error",u,h),[s]),i=d.useCallback((u,h)=>s("info",u,h),[s]),c=d.useCallback((u,h)=>s("warning",u,h),[s]),g=d.useCallback(u=>{t(h=>h.filter(r=>r.id!==u))},[]);return{toasts:o,showToast:s,success:n,error:a,info:i,warning:c,closeToast:g}}function be(o){d.useEffect(()=>{const t=s=>{for(const n of o){const a=n.ctrl?s.ctrlKey||s.metaKey:!s.ctrlKey&&!s.metaKey,i=n.shift?s.shiftKey:!s.shiftKey,c=n.alt?s.altKey:!s.altKey,g=s.key.toLowerCase()===n.key.toLowerCase();if(a&&i&&c&&g){s.preventDefault(),n.callback();break}}};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[o])}const je={en:{title:"Sentinax Shield",status:"Active",modeLabel:"Context Mode",fileMode:"File Attachment",textMode:"Text Injection",fileDesc:"Conversation history is attached as a file. Best for long conversations.",textDesc:"History is added directly to your message. Fast and simple.",langLabel:"Language",resetBtn:"Clear History",resetConfirm:"Clear all conversation history? This cannot be undone.",resetSuccess:"History cleared successfully.",version:"v1.1",tabSettings:"Settings",tabHistory:"History",tabBackup:"Backup"},ru:{title:"Sentinax Shield",status:"Активен",modeLabel:"Режим контекста",fileMode:"Файл",textMode:"Текст",fileDesc:"История разговора прикрепляется файлом. Лучше для длинных диалогов.",textDesc:"История добавляется прямо в сообщение. Быстро и просто.",langLabel:"Язык",resetBtn:"Очистить историю",resetConfirm:"Очистить всю историю разговоров? Это нельзя отменить.",resetSuccess:"История успешно очищена.",version:"v1.1",tabSettings:"Настройки",tabHistory:"История",tabBackup:"Бэкап"}},ve=({children:o,style:t})=>e.jsx("div",{style:{background:"rgba(255, 255, 255, 0.03)",backdropFilter:"blur(10px)",border:"1px solid rgba(255, 255, 255, 0.08)",borderRadius:"16px",padding:"16px",...t},children:o});function Ce(){const o=V(),{injectionMode:t,language:s}=L(r=>r.settings),n=je[s||"en"],[a,i]=d.useState("settings"),c=_e();be([{key:"h",ctrl:!0,shift:!0,callback:()=>i("history")},{key:"b",ctrl:!0,shift:!0,callback:()=>i("backup")},{key:"s",ctrl:!0,shift:!0,callback:()=>i("settings")}]);const g=r=>{o(q(r)),c.success("Mode updated",`Switched to ${r==="file"?"File Attachment":"Text Injection"}`)},u=r=>{o(J(r)),c.success("Language updated",`Switched to ${r.toUpperCase()}`)},h=async()=>{if(window.confirm(n.resetConfirm))try{try{await fetch("https://sentinax-production.up.railway.app/reset",{method:"POST",signal:AbortSignal.timeout(2e3)}),console.log("Sentinax: Backend history cleared")}catch{console.warn("Sentinax: Backend not available, skipping backend reset")}if(typeof chrome<"u"&&chrome.storage){const r=await chrome.storage.local.get(null),_=Object.keys(r).filter(C=>C.startsWith("sentinax_history_"));_.length>0&&(await chrome.storage.local.remove(_),console.log(`Sentinax: Cleared ${_.length} history entries`))}c.success("History cleared","All conversation history has been deleted"),setTimeout(()=>{window.location.reload()},1500)}catch(r){console.error("Sentinax: Reset failed",r),c.error("Reset failed","Please try again")}};return e.jsxs("div",{style:{width:"340px",padding:"20px",fontFamily:"'Outfit', 'Inter', sans-serif",backgroundColor:"#05070a",color:"#e2e8f0",minHeight:"600px",maxHeight:"600px",display:"flex",flexDirection:"column",gap:"20px",position:"relative",overflow:"hidden"},children:[e.jsx("div",{style:{position:"absolute",top:"-50px",right:"-50px",width:"150px",height:"150px",background:"radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%)",zIndex:0}}),e.jsxs("header",{style:{display:"flex",alignItems:"center",gap:"14px",zIndex:1},children:[e.jsx(O.div,{whileHover:{scale:1.05},style:{width:"48px",height:"48px",background:"linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%)",borderRadius:"14px",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"0 8px 16px rgba(59, 130, 246, 0.25)"},children:e.jsx("img",{src:W,alt:"S",style:{width:"30px",height:"30px",filter:"brightness(1.2)"}})}),e.jsxs("div",{children:[e.jsx("h1",{style:{fontSize:"20px",margin:0,fontWeight:800,letterSpacing:"-0.03em",color:"#fff"},children:n.title}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",marginTop:"2px"},children:[e.jsx("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:"#10b981",boxShadow:"0 0 8px #10b981"}}),e.jsx("span",{style:{fontSize:"11px",color:"#10b981",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em"},children:n.status})]})]})]}),e.jsx("div",{style:{zIndex:1},children:e.jsx(ft,{})}),e.jsx("div",{style:{display:"flex",gap:"6px",zIndex:1,background:"rgba(255, 255, 255, 0.02)",padding:"4px",borderRadius:"12px",border:"1px solid rgba(255, 255, 255, 0.05)"},children:["settings","history","backup"].map(r=>{const _={settings:"Ctrl+Shift+S",history:"Ctrl+Shift+H",backup:"Ctrl+Shift+B"};return e.jsx(me,{content:n[`tab${r.charAt(0).toUpperCase()+r.slice(1)}`],shortcut:_[r],children:e.jsx("button",{onClick:()=>i(r),style:{flex:1,padding:"8px",borderRadius:"8px",border:"none",backgroundColor:a===r?"rgba(59, 130, 246, 0.2)":"transparent",color:a===r?"#60a5fa":"rgba(255, 255, 255, 0.4)",fontSize:"11px",fontWeight:700,cursor:"pointer",textTransform:"uppercase",transition:"all 0.2s"},children:n[`tab${r.charAt(0).toUpperCase()+r.slice(1)}`]})},r)})}),e.jsxs("div",{style:{flex:1,zIndex:1,overflow:"auto",display:"flex",flexDirection:"column",gap:"16px"},children:[a==="settings"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{display:"flex",gap:"6px"},children:["en","ru"].map(r=>e.jsx("button",{onClick:()=>u(r),style:{flex:1,padding:"8px",borderRadius:"10px",border:"1px solid",borderColor:s===r?"rgba(59, 130, 246, 0.4)":"transparent",backgroundColor:s===r?"rgba(59, 130, 246, 0.1)":"rgba(255, 255, 255, 0.03)",color:s===r?"#60a5fa":"rgba(255, 255, 255, 0.4)",fontSize:"11px",fontWeight:700,cursor:"pointer",textTransform:"uppercase",transition:"all 0.2s"},children:r},r))}),e.jsxs("section",{children:[e.jsx("h3",{style:{fontSize:"11px",color:"rgba(255, 255, 255, 0.4)",marginBottom:"12px",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:n.modeLabel}),e.jsx("div",{style:{display:"flex",backgroundColor:"rgba(255, 255, 255, 0.02)",padding:"4px",borderRadius:"14px",border:"1px solid rgba(255, 255, 255, 0.05)"},children:["file","text"].map(r=>e.jsx("button",{onClick:()=>g(r),style:{flex:1,padding:"12px",borderRadius:"10px",border:"none",backgroundColor:t===r?"#1d4ed8":"transparent",color:t===r?"#fff":"rgba(255, 255, 255, 0.4)",fontWeight:700,fontSize:"13px",cursor:"pointer",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)",boxShadow:t===r?"0 4px 12px rgba(29, 78, 216, 0.4)":"none"},children:r==="file"?n.fileMode:n.textMode},r))})]}),e.jsx(ve,{style:{flex:1,minHeight:"80px"},children:e.jsx(G,{mode:"wait",children:e.jsx(O.p,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},style:{fontSize:"13px",color:"rgba(255, 255, 255, 0.7)",lineHeight:"1.6",margin:0},children:t==="file"?n.fileDesc:n.textDesc},`${t}-${s}`)})})]}),a==="history"&&e.jsx(Bt,{}),a==="backup"&&e.jsx(Ut,{})]}),e.jsxs("footer",{style:{marginTop:"auto",display:"flex",flexDirection:"column",gap:"12px",zIndex:1},children:[e.jsx("button",{onClick:h,style:{padding:"12px",borderRadius:"12px",border:"1px solid rgba(239, 68, 68, 0.2)",backgroundColor:"rgba(239, 68, 68, 0.05)",color:"#ef4444",fontSize:"12px",fontWeight:700,cursor:"pointer",transition:"all 0.2s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:e.jsx("span",{children:n.resetBtn})}),e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e.jsx("span",{style:{fontSize:"11px",color:"rgba(255, 255, 255, 0.3)",fontWeight:600},children:n.version}),e.jsx("div",{style:{display:"flex",gap:"4px"},children:[1,2,3].map(r=>e.jsx("div",{style:{width:"4px",height:"4px",borderRadius:"50%",backgroundColor:"rgba(255,255,255,0.1)"}},r))})]})]}),e.jsx(ce,{toasts:c.toasts,onClose:c.closeToast})]})}Q().then(()=>{X.createRoot(document.getElementById("root")).render(e.jsx(d.StrictMode,{children:e.jsx(Y,{store:Z,children:e.jsx(Ce,{})})}))});
