"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[3990],{23990:(e,s,n)=>{n.r(s),n.d(s,{default:()=>f});var r=n(41867),a=n(93764),t=n(51590),l=n(47409),i=n(49133),o=n(59231),c=n(96614),h=n(83171),u=n(27768),d=n(23801),j=n(35421),m=n(90872),x=n(80838);function g(){return(0,x.jsxs)("div",{children:[(0,x.jsx)(a.Z,{size:20,style:{marginRight:20}}),(0,x.jsx)(t.Z,{display:"inline",children:"Creating SVG"})]})}function b(e,s){return(0,m.useLocalStorage)("svg-"+e,s)}function f(e){let{model:s,handleClose:n}=e;const a=(0,m.getSession)(s),f="undefined"!==typeof OffscreenCanvas,[v,p]=(0,r.useState)(f),[y,C]=(0,r.useState)(!1),[Z,w]=(0,r.useState)(),[S,k]=b("file","jbrowse.svg"),[z,T]=b("theme",a.themeName||"default");return(0,x.jsxs)(j.Dialog,{open:!0,onClose:n,title:"Export SVG",children:[(0,x.jsxs)(l.Z,{children:[Z?(0,x.jsx)(j.ErrorMessage,{error:Z}):y?(0,x.jsx)(g,{}):null,(0,x.jsx)(i.Z,{helperText:"filename",value:S,onChange:e=>k(e.target.value)}),(0,x.jsx)("br",{}),a.allThemes?(0,x.jsx)(i.Z,{select:!0,label:"Theme",value:z,onChange:e=>T(e.target.value),children:Object.entries(a.allThemes()).map((e=>{let[s,n]=e;return(0,x.jsx)(o.Z,{value:s,children:n.name||"(Unknown name)"},s)}))}):null,f?(0,x.jsx)(c.Z,{control:(0,x.jsx)(h.Z,{checked:v,onChange:()=>p((e=>!e))}),label:"Rasterize canvas based tracks? File may be much larger if this is turned off"}):(0,x.jsx)(t.Z,{children:"Note: rasterizing layers not yet supported in this browser, so SVG size may be large"})]}),(0,x.jsxs)(u.Z,{children:[(0,x.jsx)(d.Z,{variant:"contained",color:"secondary",onClick:()=>n(),children:"Cancel"}),(0,x.jsx)(d.Z,{variant:"contained",color:"primary",type:"submit",onClick:async()=>{C(!0),w(void 0);try{await s.exportSvg({rasterizeLayers:v,filename:S,themeName:z}),n()}catch(e){console.error(e),w(e),C(!1)}},children:"Submit"})]})]})}}}]);
//# sourceMappingURL=3990.3dd72283.chunk.js.map