"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[150],{20150:(e,r,o)=>{o.r(r),o.d(r,{default:()=>v});var t=o(41867),a=o(71939),n=o(7229),s=o(51590),i=o(23801),c=o(90872),l=o(47192),d=o(3762),p=o(92453),g=o(86708),u=o(42835),h=o(80838);const x=(0,l.ZL)()((e=>({error:{margin:e.spacing(2)},errorHeader:{background:e.palette.error.light,color:e.palette.error.contrastText,padding:e.spacing(2),textAlign:"center"},errorMessage:{padding:e.spacing(2)}})));function j(e){let{error:r}=e;const{classes:o}=x();return(0,h.jsxs)(n.Z,{className:o.error,children:[(0,h.jsxs)("div",{className:o.errorHeader,children:[(0,h.jsx)(u.Z,{color:"inherit",fontSize:"large"}),(0,h.jsx)("div",{children:(0,h.jsx)(s.Z,{variant:"h6",color:"inherit",align:"center",children:"Import error"})})]}),(0,h.jsx)(s.Z,{className:o.errorMessage,children:"".concat(r)})]})}function b(e,r){return o=>r[o[e]]}const m=(0,l.ZL)()((e=>({root:{margin:e.spacing(1)},paper:{display:"flex",flexDirection:"column"},dropZone:{textAlign:"center",margin:e.spacing(2),padding:e.spacing(2),borderWidth:2,borderRadius:2,borderColor:b("isDragActive",{true:e.palette.secondary.light,false:e.palette.divider}),borderStyle:"dashed",backgroundColor:b("isDragActive",{true:(0,a.Fq)(e.palette.text.primary,e.palette.action.hoverOpacity),false:e.palette.background.default}),outline:"none",transition:"border .24s ease-in-out","&:focus":{borderColor:e.palette.secondary.light}},uploadIcon:{color:e.palette.text.secondary}}))),v=(0,d.observer)((function(e){let{model:r}=e;const[o,a]=(0,t.useState)(),{getRootProps:l,getInputProps:d,isDragActive:u}=(0,p.uI)({accept:"application/json",maxSize:536870912,multiple:!1,onDrop:async(e,o)=>{try{if(o.length>0)throw new Error("".concat(o[0].errors.map((e=>"".concat(e))).join(", ")));{var t,n;const o=await e[0].text();null===(t=(n=(0,c.getSession)(r)).setSession)||void 0===t||t.call(n,JSON.parse(o).session)}}catch(s){console.error(s),a(s)}}}),{classes:x}=m({isDragActive:u});return(0,h.jsxs)("div",{className:x.root,children:[(0,h.jsx)(n.Z,{className:x.paper,children:(0,h.jsxs)("div",{...l({className:x.dropZone}),children:[(0,h.jsx)("input",{...d()}),(0,h.jsx)(g.Z,{className:x.uploadIcon,fontSize:"large"}),(0,h.jsx)(s.Z,{color:"textSecondary",align:"center",variant:"body1",children:"Drag and drop files here"}),(0,h.jsx)(s.Z,{color:"textSecondary",align:"center",variant:"body2",children:"or"}),(0,h.jsx)(i.Z,{color:"primary",variant:"contained",children:"Browse Files"})]})}),o?(0,h.jsx)(j,{error:o}):null]})}))}}]);
//# sourceMappingURL=150.aa328d1e.chunk.js.map