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