"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[1842],{74409:function(n,e,t){t.d(e,{Z:function(){return g}});var r=t(33028),o=t(68079),i=t(30969),a=t(81073),s=t(90550),c=t(70765),l=t(37574),u=function(n){var e=n.color,t=void 0===e?"rgb(255,255,255,0.8)":e;return(0,l.jsx)("rect",(0,r.Z)((0,r.Z)({},n),{},{fill:t}))},h=(0,s.observer)((function(n){var e=n.model,t=n.rowHeight,r=n.labelWidth,o=n.exportSVG,a=e.needsCustomLegend,s=e.needsScalebar,c=e.needsFullHeightScalebar,h=e.rowHeightTooSmallForScalebar,d=e.renderColorBoxes,f=e.sources,x=Math.min(t,12),g=t>11,m=d?15:0,v=r+m+5,p=(o?10:0)||(s&&!h?50:0);return f?(0,l.jsxs)(l.Fragment,{children:[c?(0,l.jsx)(u,{y:0,x:p,width:v,height:(f.length+.25)*t}):null,f.map((function(n,e){var r=Math.min(20,t);return(0,l.jsxs)(i.Fragment,{children:[c?null:(0,l.jsx)(u,{y:e*t+1,x:p,width:v,height:r}),n.color?(0,l.jsx)(u,{y:e*t+1,x:p,width:m,height:a?t:r,color:n.color}):null,g?(0,l.jsx)("text",{y:e*t+13,x:p+m+2,fontSize:x,children:n.name}):null]},"".concat(n.name,"-").concat(e))}))]}):null})),d=(0,s.observer)((function(n){var e=n.model,t=e.ticks,r=e.scaleType,o=(0,a.getContainingView)(e).width,i="[".concat(null===t||void 0===t?void 0:t.values[0],"-").concat(null===t||void 0===t?void 0:t.values[1],"]")+("log"===r?" (log scale)":""),s=(0,a.measureText)(i,14),c=o-s-25;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u,{y:0,x:c,width:s+6,height:16}),(0,l.jsx)("text",{y:13,x:c,children:i})]})})),f=t(29477),x=(0,s.observer)((function(n){var e=n.children,t=n.model;if(n.exportSVG)return(0,l.jsx)(l.Fragment,{children:e});var r=t.height;return(0,l.jsx)("svg",{style:{position:"absolute",top:0,left:0,pointerEvents:"none",height:r,width:(0,a.getContainingView)(t).width},children:e})})),g=(0,s.observer)((function(n){var e=n.model,t=n.orientation,i=n.exportSVG,s=e.stats,u=e.needsCustomLegend,g=e.needsFullHeightScalebar,m=e.rowHeightTooSmallForScalebar,v=e.rowHeight,p=e.sources,j=e.ticks,w=Math.min(v,12),b=v>11,y=(0,a.getContainingView)(e).width;if(!(s&&p))return null;var S=Math.max.apply(Math,(0,o.Z)(p.map((function(n){return(0,a.measureText)(n.name,w)})).map((function(n){return b?n:20}))||[0]));return(0,l.jsx)(x,(0,r.Z)((0,r.Z)({},n),{},{children:g?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("g",{transform:"translate(".concat(i?0:(0,f.os)(e),",0)"),children:(0,l.jsx)(c.Z,{model:e,orientation:t})}),(0,l.jsx)("g",{transform:"translate(".concat(y-S-100,",0)"),children:(0,l.jsx)(h,{exportSVG:i,model:e,rowHeight:12,labelWidth:S})})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h,{exportSVG:i,model:e,rowHeight:e.rowHeight,labelWidth:S}),m||u?(0,l.jsx)(d,(0,r.Z)({},n)):p.map((function(n,r){return(0,l.jsx)("g",{transform:"translate(0 ".concat(v*r,")"),children:(0,l.jsx)(c.Z,{model:e,orientation:t})},"".concat(JSON.stringify(j),"-").concat(r))}))]})}))}))},29477:function(n,e,t){t.d(e,{A1:function(){return a},os:function(){return l},vi:function(){return s}});var r=t(41361),o=t(81073),i=t(9077);function a(n,e){var t,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e.map((function(e){return n.findIndex((function(n){return n.name===e}))})).sort((function(n,e){return n-e})),a=0,s=(0,r.Z)(i);try{for(s.s();!(t=s.n()).done;){var c=t.value,l=Math.max(a,c-o);l>=a&&n.splice(l,0,n.splice(c,1)[0]),a+=1}}catch(u){s.e(u)}finally{s.f()}return n}function s(n,e){var t,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=e.map((function(e){return n.findIndex((function(n){return n.name===e}))})).sort((function(n,e){return e-n})),a=n.length-1,s=(0,r.Z)(i);try{for(s.s();!(t=s.n()).done;){var c=t.value,l=Math.min(a,c+o);l<=a&&n.splice(l,0,n.splice(c,1)[0]),a-=1}}catch(u){s.e(u)}finally{s.f()}return n}var c=12.8;function l(n){var e=n.prefersOffset,t=(0,o.getContainingView)(n).trackLabels,r=(0,o.getContainingTrack)(n),a=(0,i.getConf)(r,"name");return"overlapping"!==t||e?10:(0,o.measureText)(a,c)+100}},11842:function(n,e,t){t.r(e),t.d(e,{renderSvg:function(){return l}});var r=t(32723),o=t(34795),i=(t(30969),t(81073)),a=t(90689),s=t(74409),c=t(37574);function l(n,e,t){return u.apply(this,arguments)}function u(){return(u=(0,o.Z)((0,r.Z)().mark((function n(e,t,o){var l,u;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,a.when)((function(){return!!e.stats&&!!e.regionCannotBeRenderedText}));case 2:return l=(0,i.getContainingView)(e),u=l.offsetPx,n.t0=c.jsxs,n.t1=c.Fragment,n.t2=c.jsx,n.next=8,o(t);case 8:return n.t3=n.sent,n.t4={id:"snpcov",children:n.t3},n.t5=(0,n.t2)("g",n.t4),n.t6=(0,c.jsx)("g",{transform:"translate(".concat(Math.max(-u,0),")"),children:(0,c.jsx)(s.Z,{model:e,orientation:"left",exportSVG:!0})}),n.t7=[n.t5,n.t6],n.t8={children:n.t7},n.abrupt("return",(0,n.t0)(n.t1,n.t8));case 15:case"end":return n.stop()}}),n)})))).apply(this,arguments)}}}]);
//# sourceMappingURL=1842.ef0d050b.chunk.js.map