"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2367],{21016:(e,t,n)=>{n.d(t,{K:()=>c});var l=n(87485),s=n(46879);function c(e,t,n,c,f,o,i){t.fillStyle=function(e,t){const n=e.length;let s=0,c=0,f=0,o=0;for(const n of e)n===t?s++:"0"===n?o++:"."===n?c++:f++;if(o===n)return"#ccc";{let e;if(s&&(e=(0,l.M)(`hsl(200,50%,${80-s/n*50}%)`)),f){const t=`hsla(0,100%,20%,${f/n})`;e=e?e.mix(t):(0,l.M)(t)}if(c){const t=`hsl(50,50%,50%,${c/n})`;e=e?e.mix(t):(0,l.M)(t)}return e?.toHex()||"black"}}(e,i),t.fillRect(n-s.f2,c-s.f2,f+s.f2,o+s.f2)}},22367:(e,t,n)=>{n.d(t,{makeImageData:()=>r});var l=n(99546),s=n(37347),c=n(46879),f=n(21016),o=n(40171),i=n(85497);async function r({ctx:e,canvasWidth:t,canvasHeight:n,renderArgs:r}){const{renderingMode:a,minorAlleleFrequencyFilter:u,sources:h,features:g,stopToken:p}=r,{statusCallback:d=()=>{}}=r,b=n/h.length;(0,s.SW)(p);const m=(0,i.Cg)(g.values(),u);(0,s.SW)(p);const k=[],w=m.length,S=t/w;return await(0,l.updateStatus)("Drawing variant matrix",d,(()=>{let l=performance.now();for(let i=0;i<w;i++){performance.now()-l>400&&((0,s.SW)(p),l=performance.now());const r=[],{feature:u,mostFrequentAlt:g}=m[i],d=u.get("FORMAT")?.includes("PS");if(d){const l=u.get("samples"),s=i/m.length*t,p=h.length;for(let t=0;t<p;t++){const i=t/p*n,{name:u,HP:d}=h[t],m=l[u];if(m){const t=m.GT?.[0];if(t){r.push(t);const n=t.includes("|");if("phased"===a)if(n){const n=m.PS?.[0],l=t.split("|");(0,o.E)(l,e,s,i,S,b,d,n)}else e.fillStyle="black",e.fillRect(s-c.f2,i-c.f2,S+c.f2,b+c.f2);else{const n=t.split(/[/|]/);(0,f.K)(n,e,s,i,S,b,g)}}}}}else{const l=u.get("genotypes"),s=i/m.length*t,p=h.length;for(let t=0;t<p;t++){const i=t/p*n,{name:u,HP:d}=h[t],m=l[u];if(m){r.push(m);const t=m.includes("|");if("phased"===a)if(t){const t=m.split("|");(0,o.E)(t,e,s,i,S,b,d)}else e.fillStyle="black",e.fillRect(s-c.f2,i-c.f2,S+c.f2,b+c.f2);else{const t=m.split(/[/|]/);(0,f.K)(t,e,s,i,S,b,g)}}}}k.push(r)}})),{mafs:m,arr:k}}},40171:(e,t,n)=>{n.d(t,{E:()=>f});var l=n(40898),s=n(46879),c=n(42268);function f(e,t,n,f,o,i,r,a){t.fillStyle=void 0!==a?function(e,t,n){return+e[t]?(0,c.qH)(+n)||"black":"#ccc"}(e,r,a):function(e,t){const n=+e[t];return n?l.set1[n-1]||"black":"#ccc"}(e,r),t.fillRect(n-s.f2,f-s.f2,o+s.f2,i+s.f2)}},42268:(e,t,n)=>{function l(e){let t=0;for(let n=0;n<e.length;n++)t+=e.charCodeAt(n);return s(10*t)}function s(e){return`hsl(${e%255}, 50%, 50%)`}n.d(t,{XL:()=>l,qH:()=>s})},46879:(e,t,n)=>{n.d(t,{f2:()=>l});const l=.3}}]);
//# sourceMappingURL=2367.8a35ffb2.chunk.js.map