"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[8531],{38531:function(e,r,n){n.r(r),n.d(r,{default:function(){return S}});var t=n(33028),a=n(32723),o=n(34795),s=n(96234),i=n(30969),c=n(74262),l=n(46672),d=n(33359),p=n(72097),u=n(81073),g=n(53276),h=n(90550),x=n(74336),f=n(75387),v=n(60680),b=n(37574),Z=(0,g.ZL)()((function(e){return{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){var r=e.error,n=Z().classes;return(0,b.jsxs)(l.Z,{className:n.error,children:[(0,b.jsxs)("div",{className:n.errorHeader,children:[(0,b.jsx)(v.Z,{color:"inherit",fontSize:"large"}),(0,b.jsx)("div",{children:(0,b.jsx)(d.Z,{variant:"h6",color:"inherit",align:"center",children:"Import error"})})]}),(0,b.jsx)(d.Z,{className:n.errorMessage,children:"".concat(r)})]})}var m=512*Math.pow(1024,2);function y(e,r){return function(n){return r[n[e]]}}var w=(0,g.ZL)()((function(e){return{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:y("isDragActive",{true:e.palette.secondary.light,false:e.palette.divider}),borderStyle:"dashed",backgroundColor:y("isDragActive",{true:(0,c.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}}})),k=(0,h.observer)((function(e){var r=e.model,n=(0,i.useState)(),c=(0,s.Z)(n,2),g=c[0],h=c[1],v=(0,x.uI)({accept:"application/json",maxSize:m,multiple:!1,onDrop:function(){var e=(0,o.Z)((0,a.Z)().mark((function e(n,t){var o,s,i;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(t.length>0)){e.next=5;break}throw new Error("".concat(t[0].errors.map((function(e){return"".concat(e)})).join(", ")));case 5:return e.next=7,n[0].text();case 7:i=e.sent,null===(o=(s=(0,u.getSession)(r)).setSession)||void 0===o||o.call(s,JSON.parse(i).session);case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0),h(e.t0);case 15:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(r,n){return e.apply(this,arguments)}}()}),Z=v.getRootProps,y=v.getInputProps,k=v.isDragActive,S=w({isDragActive:k}).classes;return(0,b.jsxs)("div",{className:S.root,children:[(0,b.jsx)(l.Z,{className:S.paper,children:(0,b.jsxs)("div",(0,t.Z)((0,t.Z)({},Z({className:S.dropZone})),{},{children:[(0,b.jsx)("input",(0,t.Z)({},y())),(0,b.jsx)(f.Z,{className:S.uploadIcon,fontSize:"large"}),(0,b.jsx)(d.Z,{color:"textSecondary",align:"center",variant:"body1",children:"Drag and drop files here"}),(0,b.jsx)(d.Z,{color:"textSecondary",align:"center",variant:"body2",children:"or"}),(0,b.jsx)(p.Z,{color:"primary",variant:"contained",children:"Browse Files"})]}))}),g?(0,b.jsx)(j,{error:g}):null]})})),S=k}}]);
//# sourceMappingURL=8531.091d0f0d.chunk.js.map