import{c as s,u as L,g as P,e as R,h as k,i as M,k as y,j as A,y as S,T as F,z as V}from"./index-DoPpOINE.js";import{r}from"./vendor-DJo4KD8w.js";import{T as j}from"./ToolbarPanels-CjWlSOUC.js";import{u as z}from"./i18n-BbpF47i1.js";import"./routing-o1npPvOW.js";import"./XMarkIcon-KMKD47CF.js";function q(){var c;const{t:h}=z(),e=(o,n)=>h(`AdminExchange.${o}`,n),a=(c=s(L().activeSession$))==null?void 0:c.client,u=P(),t=R(()=>V(u,()=>a.admin.backup(),(o,n)=>a.admin.restore(o,n==null?void 0:n.onProgress))),d=s(t.browse.activePanel$)??null,b=s(t.selectedFile$)??null,g=s(t.preview$)??null,x=s(t.isExporting$)??!1,v=s(t.isImporting$)??!1,E=s(t.importPhase$)??null,f=s(t.importMessage$),C=s(t.importResult$),{theme:I,setTheme:l}=k(),{showLineNumbers:T,toggleLineNumbers:p}=M();y({"settings:theme-changed":r.useCallback(({theme:o})=>l(o),[l]),"settings:line-numbers-toggled":r.useCallback(()=>p(),[p])});const w=r.useCallback(async()=>{const{blob:o,filename:n}=await t.doExport(),m=URL.createObjectURL(o),i=document.createElement("a");i.href=m,i.download=n,i.click(),URL.revokeObjectURL(m)},[t]),$=r.useCallback(async()=>{await t.doImport()},[t]);return A.jsx(S,{onExport:w,isExporting:x,onFileSelected:t.selectFile,onImport:$,onCancelImport:t.cancelImport,selectedFile:b,preview:g,isImporting:v,importPhase:E,importMessage:f,importResult:C,theme:I,showLineNumbers:T,activePanel:d,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:F})}export{q as default};
//# sourceMappingURL=client-DX1ckM1P.js.map
