"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[2754],{72896:(e,t,n)=>{n.d(t,{Z:()=>x});var o=n(41867),r=n(90872),s=n(3762),i=n(93524),a=n(80838);const l=e=>{const{color:t="rgb(255,255,255,0.8)"}=e;return(0,a.jsx)("rect",{...e,fill:t})},c=(0,s.observer)((function(e){let{model:t,rowHeight:n,labelWidth:r,exportSVG:s}=e;const{needsCustomLegend:i,needsScalebar:c,needsFullHeightScalebar:h,rowHeightTooSmallForScalebar:d,renderColorBoxes:g,sources:x}=t,m=Math.min(n,12),u=n>11,f=g?15:0,j=r+f+5,w=(s?10:0)||(c&&!d?50:0);return x?(0,a.jsxs)(a.Fragment,{children:[h?(0,a.jsx)(l,{y:0,x:w,width:j,height:(x.length+.25)*n}):null,x.map(((e,t)=>{const r=Math.min(20,n);return(0,a.jsxs)(o.Fragment,{children:[h?null:(0,a.jsx)(l,{y:t*n+1,x:w,width:j,height:r}),e.color?(0,a.jsx)(l,{y:t*n+1,x:w,width:f,height:i?n:r,color:e.color}):null,u?(0,a.jsx)("text",{y:t*n+13,x:w+f+2,fontSize:m,children:e.name}):null]},"".concat(e.name,"-").concat(t))}))]}):null})),h=(0,s.observer)((e=>{let{model:t}=e;const{ticks:n,scaleType:o}=t,{width:s}=(0,r.getContainingView)(t),i="[".concat(null===n||void 0===n?void 0:n.values[0],"-").concat(null===n||void 0===n?void 0:n.values[1],"]")+("log"===o?" (log scale)":""),c=(0,r.measureText)(i,14),h=s-c-25;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l,{y:0,x:h,width:c+6,height:16}),(0,a.jsx)("text",{y:13,x:h,children:i})]})}));var d=n(14846);const g=(0,s.observer)((function(e){let{children:t,model:n,exportSVG:o}=e;if(o)return(0,a.jsx)(a.Fragment,{children:t});{const{height:e}=n;return(0,a.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:e,width:(0,r.getContainingView)(n).width},children:t})}})),x=(0,s.observer)((function(e){const{model:t,orientation:n,exportSVG:o}=e,{stats:s,needsCustomLegend:l,needsFullHeightScalebar:x,rowHeightTooSmallForScalebar:m,rowHeight:u,sources:f,ticks:j}=t,w=Math.min(u,12),p=u>11,{width:v}=(0,r.getContainingView)(t);if(!(s&&f))return null;const b=Math.max(...f.map((e=>(0,r.measureText)(e.name,w))).map((e=>p?e:20))||[0]);return(0,a.jsx)(g,{...e,children:x?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("g",{transform:"translate(".concat(o?0:(0,d.os)(t),",0)"),children:(0,a.jsx)(i.Z,{model:t,orientation:n})}),(0,a.jsx)("g",{transform:"translate(".concat(v-b-100,",0)"),children:(0,a.jsx)(c,{exportSVG:o,model:t,rowHeight:12,labelWidth:b})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c,{exportSVG:o,model:t,rowHeight:t.rowHeight,labelWidth:b}),m||l?(0,a.jsx)(h,{...e}):f.map(((e,o)=>(0,a.jsx)("g",{transform:"translate(0 ".concat(u*o,")"),children:(0,a.jsx)(i.Z,{model:t,orientation:n})},"".concat(JSON.stringify(j),"-").concat(o))))]})})}))},14846:(e,t,n)=>{n.d(t,{A1:()=>s,os:()=>l,vi:()=>i});var o=n(90872),r=n(43800);function s(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const o=t.map((t=>e.findIndex((e=>e.name===t)))).sort(((e,t)=>e-t));let r=0;for(const s of o){const t=Math.max(r,s-n);t>=r&&e.splice(t,0,e.splice(s,1)[0]),r+=1}return e}function i(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const o=t.map((t=>e.findIndex((e=>e.name===t)))).sort(((e,t)=>t-e));let r=e.length-1;for(const s of o){const t=Math.min(r,s+n);t<=r&&e.splice(t,0,e.splice(s,1)[0]),r-=1}return e}const a=12.8;function l(e){const{prefersOffset:t}=e,{trackLabels:n}=(0,o.getContainingView)(e),s=(0,o.getContainingTrack)(e),i=(0,r.getConf)(s,"name");return"overlapping"!==n||t?10:(0,o.measureText)(i,a)+100}},22754:(e,t,n)=>{n.d(t,{renderSvg:()=>a});n(41867);var o=n(90872),r=n(85815),s=n(72896),i=n(80838);async function a(e,t,n){await(0,r.when)((()=>!!e.stats&&!!e.regionCannotBeRenderedText));const{offsetPx:a}=(0,o.getContainingView)(e);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("g",{id:"snpcov",children:await n(t)}),(0,i.jsx)("g",{transform:"translate(".concat(Math.max(-a,0),")"),children:(0,i.jsx)(s.Z,{model:e,orientation:"left",exportSVG:!0})})]})}}}]);
//# sourceMappingURL=2754.fa2f2480.chunk.js.map