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