"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[8528],{98528:(e,n,l)=>{l.r(n),l.d(n,{default:()=>y});var a=l(67758),s=l(7552),r=l(67112),t=l(99546),i=l(44928),o=l(61282),c=l(93062),h=l(76218),d=l(10240),u=l(7946),j=l(22762),f=l(30698),v=l(69092),x=l(69500);function m(){const e=(0,a.c)(1);let n;return e[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,x.jsxs)("div",{children:[(0,x.jsx)(i.A,{size:20,style:{marginRight:20}}),(0,x.jsx)(o.A,{display:"inline",children:"Creating SVG"})]}),e[0]=n):n=e[0],n}function b(e,n){return(0,t.useLocalStorage)(`svg-${e}`,n)}function g(e){const n=(0,a.c)(6);let l,s,r;return n[0]!==e?(({children:l,...s}=e),n[0]=e,n[1]=l,n[2]=s):(l=n[1],s=n[2]),n[3]!==l||n[4]!==s?(r=(0,x.jsx)("div",{children:(0,x.jsx)(c.A,{...s,children:l})}),n[3]=l,n[4]=s,n[5]=r):r=n[5],r}function y({model:e,handleClose:n}){const l=(0,t.getSession)(e),a="undefined"!=typeof OffscreenCanvas,[i,c]=(0,s.useState)(a),[y,p]=(0,s.useState)(!1),[A,C]=(0,s.useState)(),[k,w]=b("file","jbrowse.svg"),[S,T]=b("tracklabels","offset"),[_,z]=b("theme",l.themeName||"default");return(0,x.jsxs)(r.Dialog,{open:!0,onClose:n,title:"Export SVG",children:[(0,x.jsxs)(h.A,{children:[A?(0,x.jsx)(r.ErrorMessage,{error:A}):y?(0,x.jsx)(m,{}):null,(0,x.jsx)(g,{helperText:"filename",value:k,onChange:e=>{w(e.target.value)}}),(0,x.jsxs)(g,{select:!0,label:"Track label positioning",variant:"outlined",style:{width:150},value:S,onChange:e=>{T(e.target.value)},children:[(0,x.jsx)(d.A,{value:"offset",children:"Offset"}),(0,x.jsx)(d.A,{value:"overlay",children:"Overlay"}),(0,x.jsx)(d.A,{value:"left",children:"Left"}),(0,x.jsx)(d.A,{value:"none",children:"None"})]}),l.allThemes?(0,x.jsx)(g,{select:!0,label:"Theme",variant:"outlined",value:_,onChange:e=>{z(e.target.value)},children:Object.entries(l.allThemes()).map(([e,n])=>(0,x.jsx)(d.A,{value:e,children:n.name||"(Unknown name)"},e))}):null,a?(0,x.jsx)(u.A,{control:(0,x.jsx)(j.A,{checked:i,onChange:()=>{c(e=>!e)}}),label:"Rasterize canvas based tracks? File may be much larger if this is turned off"}):(0,x.jsx)(o.A,{children:"Note: rasterizing layers not yet supported in this browser, so SVG size may be large"})]}),(0,x.jsxs)(f.A,{children:[(0,x.jsx)(v.A,{variant:"contained",color:"secondary",onClick:()=>{n()},children:"Cancel"}),(0,x.jsx)(v.A,{variant:"contained",color:"primary",type:"submit",onClick:async()=>{p(!0),C(void 0);try{await e.exportSvg({rasterizeLayers:i,filename:k,trackLabels:S,themeName:_}),n()}catch(e){console.error(e),C(e)}finally{p(!1)}},children:"Submit"})]})]})}}}]);
//# sourceMappingURL=8528.2691d664.chunk.js.map