import{j as w}from"./query-ATBhtd3K.js";import{r as o}from"./vendor-EnoIVk-c.js";import{d as z,e as D,f as F,g as y,D as A,L as B,T as R}from"./en-IUV4ZXKH-BjYNERUx.js";import{T as N}from"./ToolbarPanels-tcvPzqNN.js";import{u as j}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:h}=j(),e=(t,M)=>h(`ModerationLinkedData.${t}`,M),{activePanel:g}=z(),{theme:b,setTheme:p}=D(),{showLineNumbers:C,toggleLineNumbers:m}=F(),x=o.useCallback(({theme:t})=>{p(t)},[p]),f=o.useCallback(()=>{m()},[m]);y({"settings:theme-changed":x,"settings:line-numbers-toggled":f});const u=A(),i=u.exchange.export.useMutation(),l=u.exchange.import.useMutation(),[s,c]=o.useState(null),[v,d]=o.useState(null),[I,n]=o.useState(null),[T,a]=o.useState(),[P,r]=o.useState(),k=o.useCallback(()=>{i.mutate({})},[i]),S=o.useCallback(async t=>{c(t),n(null),a(void 0),r(void 0),d({format:t.name.endsWith(".tar.gz")||t.name.endsWith(".gz")?"semiont-linked-data":"unknown",version:1,sourceUrl:"",stats:{}})},[]),E=o.useCallback(()=>{s&&(n("started"),a(void 0),r(void 0),l.mutate({file:s,onProgress:t=>{n(t.phase),a(t.message),t.result&&r(t.result)}}))},[s,l]),L=o.useCallback(()=>{c(null),d(null),n(null),a(void 0),r(void 0)},[]);return w.jsx(B,{onExport:k,isExporting:i.isPending,onFileSelected:S,onImport:E,onCancelImport:L,selectedFile:s,preview:v,isImporting:l.isPending,importPhase:I,importMessage:T,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:N,Toolbar:R})}export{Q as default};
//# sourceMappingURL=client-BZBaSaZ0.js.map
