"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[7019],{17019:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var o=n(41867),i=n(5404),s=n(90872),r=n(99512),a=n(25217),c=n.n(a),l=n(62877),f=n.n(l),u=n(23801),g=n(47192),d=n(43800),b=n(44047),C=n(51590),p=n(28164),j=n(80838);function h(e){let{config:t}=e;const[n,i]=(0,o.useState)(),[r,a]=(0,o.useState)(),c=(0,s.getSession)(t),{rpcManager:l}=c;(0,o.useEffect)((()=>{const e=new AbortController,{signal:n}=e;let o=!1;return(async()=>{try{const e=(0,d.readConfObject)(t,"adapter"),i=await l.call(t.trackId,"CoreGetInfo",{adapterConfig:e,signal:n});o||a(i)}catch(e){o||(console.error(e),i(e))}})(),()=>{e.abort(),o=!0}}),[t,l]);const f="string"===typeof r?{header:"<pre>".concat(r.replaceAll("<","&lt;").replaceAll(">","&gt;"),"</pre>")}:r||{};return null!==r?(0,j.jsx)(b.BaseCard,{title:"File info",children:n?(0,j.jsx)(C.Z,{color:"error",children:"".concat(n)}):void 0===r?(0,j.jsx)(p.Z,{message:"Loading file data"}):(0,j.jsx)(b.Attributes,{attributes:f})}):null}const x=(0,g.ZL)()({content:{minWidth:800}});function m(e,t){for(const n in e)n===t?delete e[n]:"object"===typeof e[n]&&m(e[n],t);return e}function A(e){let{config:t}=e;const[n,i]=(0,o.useState)(!1),r=(0,d.readConfObject)(t),a=(0,s.getSession)(t),{classes:l}=x(),g=(0,d.getConf)(a,["formatAbout","hideUris"])||(0,d.readConfObject)(t,["formatAbout","hideUris"]),{pluginManager:C}=(0,s.getEnv)(a),p=C.evaluateExtensionPoint("Core-customizeAbout",{config:{...r,...(0,d.getConf)(a,["formatAbout","config"],{config:r}),...(0,d.readConfObject)(t,["formatAbout","config"],{config:r})}},{session:a,config:t}),A=C.evaluateExtensionPoint("Core-extraAboutPanel",null,{session:a,config:t});return(0,j.jsxs)("div",{className:l.content,children:[(0,j.jsxs)(b.BaseCard,{title:"Configuration",children:[g?null:(0,j.jsx)(u.Z,{variant:"contained",style:{float:"right"},onClick:()=>{const e=m(c()(r),"baseUri");f()(JSON.stringify(e,null,2)),i(!0),setTimeout((()=>i(!1)),1e3)},children:n?"Copied to clipboard!":"Copy config"}),(0,j.jsx)(b.Attributes,{attributes:p,omit:["displays","baseUri","refNames","formatAbout"],hideUris:g})]}),A?(0,j.jsx)(b.BaseCard,{title:A.name,children:(0,j.jsx)(A.Component,{config:t})}):null,(0,j.jsx)(h,{config:t})]})}function v(e){let{config:t,handleClose:n}=e;const o=(0,s.getSession)(t),a=(0,r.getTrackName)(t,o),{pluginManager:c}=(0,s.getEnv)(o),l=c.evaluateExtensionPoint("Core-replaceAbout",A,{session:o,config:t});return(0,j.jsx)(i.Z,{open:!0,onClose:n,title:a,maxWidth:"xl",children:(0,j.jsx)(l,{config:t})})}}}]);
//# sourceMappingURL=7019.61923811.chunk.js.map