"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[1531],{40474:(e,t,n)=>{n.d(t,{A:()=>m});var o=n(99546),r=n(68446),s=n(69500);const i=e=>{const{color:t="rgb(255,255,255,0.8)"}=e;return(0,s.jsx)("rect",{...e,...(0,o.getFillProps)(t)})},l=function({source:e,idx:t,rowHeight:n,labelWidth:o,model:r,exportSVG:l}){const a=Math.min(20,n),{needsCustomLegend:c,graphType:h,needsFullHeightScalebar:d,rowHeightTooSmallForScalebar:g,renderColorBoxes:x}=r,u=Math.min(n,12),m=n>11,p=x?15:0,w=o+p+5,j=(l?10:0)||(h&&!g?50:0);return(0,s.jsxs)(s.Fragment,{children:[d?null:(0,s.jsx)(i,{y:t*n+1,x:j,width:w,height:a}),e.color?(0,s.jsx)(i,{y:t*n+1,x:j,width:p,height:c?n:a,color:e.color}):null,m?(0,s.jsx)("text",{y:t*n+13,x:j+p+2,fontSize:u,children:e.name}):null]})},a=(0,r.observer)((function({model:e,rowHeight:t,exportSVG:n}){const{graphType:o,needsFullHeightScalebar:r,rowHeightTooSmallForScalebar:a,renderColorBoxes:c,sources:h,labelWidth:d}=e,g=d+(c?15:0)+5,x=(n?10:0)||(o&&!a?50:0);return h?(0,s.jsxs)(s.Fragment,{children:[r?(0,s.jsx)(i,{y:0,x,width:g,height:(h.length+.25)*t}):null,h.map(((o,r)=>(0,s.jsx)(l,{source:o,idx:r,model:e,rowHeight:t,exportSVG:n,labelWidth:d},`${o.name}-${r}`)))]}):null}));var c=n(58474),h=n(90461);const d=(0,r.observer)((function({model:e,orientation:t,exportSVG:n}){const{labelWidth:r}=e,{width:i}=(0,o.getContainingView)(e);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("g",{transform:`translate(${n?0:(0,c.A3)(e)},0)`,children:(0,s.jsx)(h.A,{model:e,orientation:t})}),(0,s.jsx)("g",{transform:`translate(${i-r-100},0)`,children:(0,s.jsx)(a,{exportSVG:n,model:e,rowHeight:12})})]})})),g=(0,r.observer)((({model:e})=>{const{ticks:t,scaleType:n}=e,{width:r}=(0,o.getContainingView)(e),l=`[${t?.values[0]}-${t?.values[1]}]${"log"===n?" (log scale)":""}`,a=(0,o.measureText)(l,14),c=r-a-25;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i,{y:0,x:c,width:a+6,height:16}),(0,s.jsx)("text",{y:13,x:c,children:l})]})})),x=(0,r.observer)((function({model:e,orientation:t,exportSVG:n}){const{sources:o,rowHeight:r,rowHeightTooSmallForScalebar:i,needsCustomLegend:l,ticks:c}=e;return o?.length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{exportSVG:n,model:e,rowHeight:e.rowHeight}),i||l?(0,s.jsx)(g,{model:e}):o.map(((n,o)=>(0,s.jsx)("g",{transform:`translate(0 ${r*o})`,children:(0,s.jsx)(h.A,{model:e,orientation:t})},`${JSON.stringify(c)}-${o}`)))]}):null})),u=(0,r.observer)((function({children:e,model:t,exportSVG:n}){const{height:r}=t;return n?e:(0,s.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:r,width:(0,o.getContainingView)(t).width},children:e})})),m=(0,r.observer)((function(e){const{model:t,orientation:n,exportSVG:o}=e,{showSidebar:r,stats:i,needsFullHeightScalebar:l,sources:a}=t;return i&&a?(0,s.jsx)(u,{...e,children:r?l?(0,s.jsx)(d,{model:t,orientation:n,exportSVG:o}):(0,s.jsx)(x,{model:t,orientation:n,exportSVG:o}):null}):null}))},51531:(e,t,n)=>{n.d(t,{renderSvg:()=>l});var o=n(99546),r=n(42489),s=n(40474),i=n(69500);async function l(e,t,n){await(0,r.when)((()=>!!e.stats&&!!e.regionCannotBeRenderedText));const{offsetPx:l}=(0,o.getContainingView)(e);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("g",{children:await n(t)}),(0,i.jsx)("g",{transform:`translate(${Math.max(-l,0)})`,children:(0,i.jsx)(s.A,{model:e,orientation:"left",exportSVG:!0})})]})}},58474:(e,t,n)=>{n.d(t,{A3:()=>a,BO:()=>s,oJ:()=>i});var o=n(68584),r=n(99546);function s(e,t,n=1){const o=t.map((t=>e.findIndex((e=>e.name===t)))).sort(((e,t)=>e-t));let r=0;for(const t of o){const o=Math.max(r,t-n);o>=r&&e.splice(o,0,e.splice(t,1)[0]),r+=1}return e}function i(e,t,n=1){const o=t.map((t=>e.findIndex((e=>e.name===t)))).sort(((e,t)=>t-e));let r=e.length-1;for(const t of o){const o=Math.min(r,t+n);o<=r&&e.splice(o,0,e.splice(t,1)[0]),r-=1}return e}const l=12.8;function a(e){const{prefersOffset:t}=e,{trackLabels:n}=(0,r.getContainingView)(e),s=(0,r.getContainingTrack)(e),i=(0,o.getConf)(s,"name");return"overlapping"!==n||t?10:(0,r.measureText)(i,l)+100}}}]);
//# sourceMappingURL=1531.ccc37d5c.chunk.js.map