import{j as M}from"./query-ATBhtd3K.js";import{r as s}from"./vendor-EnoIVk-c.js";import{d as z,e as R,f as B,g as F,w as L,z as y,T as N}from"./en-IUV4ZXKH-BjYNERUx.js";import{T as j}from"./ToolbarPanels-tcvPzqNN.js";import{u as D}from"./i18n-BYxb14hm.js";import"./index-D4SjcYxX.js";import"./useAuth-CqtZE9nt.js";import"./AuthContext-CYne_gJM.js";import"./routing-nZgBtxly.js";import"./KnowledgeBaseContext-CgnF8K-_.js";import"./PlusIcon-qGFPUzg0.js";function Q(){const{t:d}=D(),e=(t,w)=>d(`AdminExchange.${t}`,w),{activePanel:g}=z(),{theme:b,setTheme:p}=R(),{showLineNumbers:C,toggleLineNumbers:m}=B(),x=s.useCallback(({theme:t})=>{p(t)},[p]),f=s.useCallback(()=>{m()},[m]);F({"settings:theme-changed":x,"settings:line-numbers-toggled":f});const c=L(),i=c.exchange.backup.useMutation(),l=c.exchange.restore.useMutation(),[o,u]=s.useState(null),[v,h]=s.useState(null),[T,n]=s.useState(null),[I,a]=s.useState(),[P,r]=s.useState(),E=s.useCallback(()=>{i.mutate()},[i]),k=s.useCallback(async t=>{u(t),n(null),a(void 0),r(void 0),h({format:t.name.endsWith(".tar.gz")||t.name.endsWith(".gz")?"semiont-backup":"unknown",version:1,sourceUrl:"",stats:{}})},[]),S=s.useCallback(()=>{o&&(n("started"),a(void 0),r(void 0),l.mutate({file:o,onProgress:t=>{n(t.phase),a(t.message),t.result&&r(t.result)}}))},[o,l]),A=s.useCallback(()=>{u(null),h(null),n(null),a(void 0),r(void 0)},[]);return M.jsx(y,{onExport:E,isExporting:i.isPending,onFileSelected:k,onImport:S,onCancelImport:A,selectedFile:o,preview:v,isImporting:l.isPending,importPhase:T,importMessage:I,importResult:P,theme:b,showLineNumbers:C,activePanel:g,translations:{title:e("title"),subtitle:e("subtitle"),export:{title:e("exportTitle"),description:e("exportDescription"),exportButton:e("exportButton"),exporting:e("exporting")},import:{title:e("importTitle"),description:e("importDescription"),dropzoneLabel:e("dropzoneLabel"),dropzoneActive:e("dropzoneActive"),detectedFormat:e("detectedFormat"),statsPreview:e("statsPreview"),importButton:e("importButton"),importing:e("importing"),importConfirmTitle:e("importConfirmTitle"),importConfirmMessage:e("importConfirmMessage"),confirmImport:e("confirmImport"),cancelImport:e("cancelImport")},progress:{phaseStarted:e("phaseStarted"),phaseEntityTypes:e("phaseEntityTypes"),phaseResources:e("phaseResources"),phaseAnnotations:e("phaseAnnotations"),phaseComplete:e("phaseComplete"),phaseError:e("phaseError"),hashChainValid:e("hashChainValid"),hashChainInvalid:e("hashChainInvalid"),streams:e("streams"),events:e("events"),blobs:e("blobs")}},ToolbarPanels:j,Toolbar:N})}export{Q as default};
//# sourceMappingURL=client-DWcJNpII.js.map
