igv 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/igv.esm.js +15 -4
- package/dist/igv.esm.min.js +3 -3
- package/dist/igv.esm.min.js.map +1 -1
- package/dist/igv.js +15 -4
- package/dist/igv.min.js +3 -3
- package/dist/igv.min.js.map +1 -1
- package/package.json +1 -1
package/dist/igv.esm.min.js
CHANGED
|
@@ -22,7 +22,7 @@ function e(e){const t=document.createElement("div");return t.innerHTML=e,t.first
|
|
|
22
22
|
* Kerry Liu
|
|
23
23
|
*
|
|
24
24
|
* Copyright (c) 2014 Gliffy Inc.
|
|
25
|
-
*/function mh(e,t){var i,n=Object.keys(t);for(i=0;i<n.length;i++)e=e.replace(new RegExp("\\{"+n[i]+"\\}","gi"),t[n[i]]);return e}function wh(e){var t,i,n;if(!e)throw new Error("cannot create a random attribute name for an undefined object");t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="";do{for(i="",n=0;n<12;n++)i+=t[Math.floor(51*Math.random())]}while(e[i]);return i}function bh(e){var t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[e]||t.alphabetic}function Fh(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}const vh=function(e,t){var i,n,r,s={};for(e=e.split(","),t=t||10,i=0;i<e.length;i+=2)n="&"+e[i+1]+";",r=parseInt(e[i],t),s[n]="&#"+r+";";return s["\\xa0"]=" ",s}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),yh={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class Ah{constructor(e,t){this.__root=e,this.__ctx=t}addColorStop(e,t){var i,n=this.__ctx.__createElement("stop");n.setAttribute("offset",e),t&&-1!==t.indexOf("rgba")?(i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t),n.setAttribute("stop-color",mh("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),n.setAttribute("stop-opacity",i[4])):n.setAttribute("stop-color",t),this.__root.appendChild(n)}}class Ch{constructor(e,t){this.__root=e,this.__ctx=t}}class _h{constructor(e){if(!(this instanceof _h))return new _h(e);if(this.config=e,this.width=e.width,this.height=e.height,this.enableMirroring=e.enableMirroring||!1,this.canvas=this,this.__document=document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.isSVG=!0,this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__createElement("svg"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__root.setAttribute("overflow","visible"),e.viewbox){const t=e.viewbox.x+" "+e.viewbox.y+" "+e.viewbox.width+" "+e.viewbox.height;this.__root.setAttribute("viewBox",t),this.viewbox=e.viewbox}this.__ids={},this.__defs=this.__createElement("defs"),this.__root.appendChild(this.__defs),this.multiLocusGap=e.multiLocusGap;let t={id:"svg_output_backdrop",width:"100%",height:"100%",fill:e.backdropColor||"white"},i=this.__createElement("rect",t);this.__root.appendChild(i),this.__rootGroup=this.__createElement("g",{id:"root-group"}),this.__root.appendChild(this.__rootGroup),this.__currentElement=this.__rootGroup}setWidth(e){this.width=e,this.__root.setAttribute("width",this.width);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+e+" "+this.config.viewbox.height;this.__root.setAttribute("viewBox",t)}setHeight(e){this.height=e,this.__root.setAttribute("height",this.height);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+this.config.viewbox.width+" "+e;this.__root.setAttribute("viewBox",t)}__createElement(e,t,i){void 0===t&&(t={});let n=this.__document.createElementNS("http://www.w3.org/2000/svg",e);i&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let e of Object.keys(t))n.setAttribute(e,t[e]);return n}__setDefaultStyles(){var e,t,i=Object.keys(yh);for(e=0;e<i.length;e++)this[t=i[e]]=yh[t].canvas}__applyStyleState(e){var t,i,n=Object.keys(e);for(t=0;t<n.length;t++)this[i=n[t]]=e[i]}__getStyleState(){var e,t,i={},n=Object.keys(yh);for(e=0;e<n.length;e++)i[t=n[e]]=this[t];return i}__applyStyleToCurrentElement(e){var t=this.__currentElement,i=this.__currentElementsToStyle;i&&(t.setAttribute(e,""),t=i.element,i.children.forEach((function(t){t.setAttribute(e,"")})));var n,r,s,o,a,c=Object.keys(yh);for(n=0;n<c.length;n++)if(r=yh[c[n]],s=this[c[n]],r.apply)if(s instanceof Ch){if(s.__ctx)for(;s.__ctx.__defs.childNodes.length;)o=s.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[o]=o,this.__defs.appendChild(s.__ctx.__defs.childNodes[0]);t.setAttribute(r.apply,mh("url(#{id})",{id:s.__root.getAttribute("id")}))}else if(s instanceof Ah)t.setAttribute(r.apply,mh("url(#{id})",{id:s.__root.getAttribute("id")}));else if(r&&-1!==r.apply.indexOf(e)&&r.svg!==s)if("stroke"!==r.svgAttr&&"fill"!==r.svgAttr||!s||-1===s.indexOf("rgba")){var l=r.svgAttr;if("globalAlpha"===c[n]&&(l=e+"-"+r.svgAttr,t.getAttribute(l)))continue;t.setAttribute(l,s)}else{a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(s),t.setAttribute(r.svgAttr,mh("rgb({r},{g},{b})",{r:a[1],g:a[2],b:a[3]}));var h=a[4],d=this.globalAlpha;null!=d&&(h*=d),t.setAttribute(r.svgAttr+"-opacity",h)}}__closestGroupOrSvg(e){return"g"===(e=e||this.__currentElement).nodeName||"svg"===e.nodeName?e:this.__closestGroupOrSvg(e.parentNode)}getSerializedSvg(e){var t,i,n,r,s,o=(new XMLSerializer).serializeToString(this.__root);if(e)for(t=Object.keys(vh),i=0;i<t.length;i++)n=t[i],r=vh[n],(s=new RegExp(n,"gi")).test(o)&&(o=o.replace(s,r));return o}getSvg(){return this.__root}saveWithTranslationAndClipRect(e,t,i,n,r,s){const o=`${e}_clip_rect`;let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a);const c={x:"0",y:s.toString(),width:n.toString(),height:r.toString()};a.appendChild(this.__createElement("rect",c));const l=this.__createElement("g");l.setAttribute("transform",mh("translate({x},{y})",{x:t,y:i})),l.setAttribute("clip-path",mh("url(#{id})",{id:o}));const h=this.__closestGroupOrSvg();h.appendChild(l),this.__groupStack.push(h),this.__currentElement=l,this.__stack.push(this.__getStyleState())}save(){var e=this.__createElement("g"),t=this.__closestGroupOrSvg();this.__groupStack.push(t),t.appendChild(e),this.__currentElement=e,this.__stack.push(this.__getStyleState())}restore(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var e=this.__stack.pop();this.__applyStyleState(e)}__addTransform(e){var t=this.__closestGroupOrSvg();if(t.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:t,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var i=this.__createElement("g");t.appendChild(i),this.__currentElement=i}var n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=e,this.__currentElement.setAttribute("transform",n)}addTrackGroupWithTranslationAndClipRect(e,t,i,n,r,s){const o=e+"_clip_rect";let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a),a.appendChild(this.__createElement("rect",{x:"0",y:s.toString(),width:n.toString(),height:r.toString()}));let c=this.__createElement("g");this.__rootGroup.appendChild(c),c.setAttribute("transform",mh("translate({x},{y})",{x:t,y:i})),c.setAttribute("id",e+"_group"),c.setAttribute("clip-path",mh("url(#{id})",{id:o})),this.__currentElement=c}scale(e,t){void 0===t&&(t=e),this.__addTransform(mh("scale({x},{y})",{x:e,y:t}))}rotate(e){var t=180*e/Math.PI;this.__addTransform(mh("rotate({angle},{cx},{cy})",{angle:t,cx:0,cy:0}))}translate(e,t){this.__addTransform(mh("translate({x},{y})",{x:e,y:t}))}transform(e,t,i,n,r,s){this.__addTransform(mh("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:t,c:i,d:n,e:r,f:s}))}beginPath(){var e;this.__currentDefaultPath="",this.__currentPosition={},e=this.__createElement("path",{},!0),this.__closestGroupOrSvg().appendChild(e),this.__currentElement=e}__applyCurrentDefaultPath(){var e=this.__currentElement;"path"===e.nodeName?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)}__addPathCommand(e){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=e}moveTo(e,t){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:t},this.__addPathCommand(mh("M {x} {y}",{x:e,y:t}))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(e,t){this.__currentPosition={x:e,y:t},this.__currentDefaultPath&&this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(mh("L {x} {y}",{x:e,y:t})):this.__addPathCommand(mh("M {x} {y}",{x:e,y:t}))}bezierCurveTo(e,t,i,n,r,s){this.__currentPosition={x:r,y:s},this.__addPathCommand(mh("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:t,cp2x:i,cp2y:n,x:r,y:s}))}quadraticCurveTo(e,t,i,n){this.__currentPosition={x:i,y:n},this.__addPathCommand(mh("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:t,x:i,y:n}))}arcTo(e,t,i,n,r){var s=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(void 0!==s&&void 0!==o){if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(s===e&&o===t||e===i&&t===n||0===r)this.lineTo(e,t);else{var a=Fh([s-e,o-t]),c=Fh([i-e,n-t]);if(a[0]*c[1]!=a[1]*c[0]){var l=a[0]*c[0]+a[1]*c[1],h=Math.acos(Math.abs(l)),d=Fh([a[0]+c[0],a[1]+c[1]]),u=r/Math.sin(h/2),f=e+u*d[0],p=t+u*d[1],g=[-a[1],a[0]],m=[c[1],-c[0]],w=function(e){var t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)},b=w(g),F=w(m);this.lineTo(f+g[0]*r,p+g[1]*r),this.arc(f,p,r,b,F)}else this.lineTo(e,t)}}}stroke(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(e,t,i,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.lineTo(e,t),this.closePath()}fillRect(e,t,i,n){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var r,s,o,a={x:e,y:t,width:i,height:n};(!this.viewbox||(r=this.viewbox,s=a,r.x<s.x+s.width&&r.x+r.width>s.x&&r.y<s.y+s.height&&r.y+r.height>s.y))&&(o=this.__createElement("rect",a,!0),this.__closestGroupOrSvg().appendChild(o),this.__currentElement=o,this.__applyStyleToCurrentElement("fill"))}strokeRect(e,t,i,n){var r;r=this.__createElement("rect",{x:e,y:t,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}strokeEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"stroke")}fillEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"fill")}__ellipse(e,t,i,n,r,s,o,a,c){const l={cx:e,cy:t,rx:i,ry:n},h=this.__createElement("ellipse",l,!0);this.__closestGroupOrSvg().appendChild(h),this.__currentElement=h,this.__applyStyleToCurrentElement(c)}__clearCanvas(){for(var e=this.__closestGroupOrSvg().getAttribute("transform"),t=this.__root.childNodes[1],i=t.childNodes,n=i.length-1;n>=0;n--)i[n]&&t.removeChild(i[n]);this.__currentElement=t,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(e,t,i,n){if(0!==e||0!==t||i!==this.width||n!==this.height){var r,s=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:e,y:t,width:i,height:n,fill:"#FFFFFF"},!0),s.appendChild(r)}else this.__clearCanvas()}createLinearGradient(e,t,i,n){var r=this.__createElement("linearGradient",{id:wh(this.__ids),x1:e+"px",x2:i+"px",y1:t+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(r),new Ah(r,this)}createRadialGradient(e,t,i,n,r,s){var o=this.__createElement("radialGradient",{id:wh(this.__ids),cx:n+"px",cy:r+"px",r:s+"px",fx:e+"px",fy:t+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new Ah(o,this)}__parseFont(){var e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i.exec(this.font),t={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(t.decoration="underline"),this.__fontHref&&(t.href=this.__fontHref),t}__wrapTextLink(e,t){if(e.href){var i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.href),i.appendChild(t),i}return t}__applyText(e,t,i,n){var r,s,o=this.__parseFont(),a=this.__closestGroupOrSvg(),c=this.__createElement("text",{"font-family":o.family,"font-size":o.size,"font-style":o.style,"font-weight":o.weight,"text-decoration":o.decoration,x:t,y:i,"text-anchor":(r=this.textAlign,s={left:"start",right:"end",center:"middle",start:"start",end:"end"},s[r]||s.start),"dominant-baseline":bh(this.textBaseline)},!0);c.appendChild(this.__document.createTextNode(e)),this.__currentElement=c,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(o,c))}fillText(e,t,i){this.__applyText(e,t,i,"fill")}strokeText(e,t,i){this.__applyText(e,t,i,"stroke")}measureText(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)}arc(e,t,i,n,r,s){if(n!==r){(n%=2*Math.PI)===(r%=2*Math.PI)&&(r=(r+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var o=e+i*Math.cos(r),a=t+i*Math.sin(r),c=e+i*Math.cos(n),l=t+i*Math.sin(n),h=s?0:1,d=0,u=r-n;u<0&&(u+=2*Math.PI),d=s?u>Math.PI?0:1:u>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(mh("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:d,sweepFlag:h,endX:o,endY:a})),this.__currentPosition={x:o,y:a}}}clip(){var e=this.__closestGroupOrSvg(),t=this.__createElement("clipPath"),i=wh(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),t.setAttribute("id",i),t.appendChild(this.__currentElement),this.__defs.appendChild(t),e.setAttribute("clip-path",mh("url(#{id})",{id:i})),e.appendChild(n),this.__currentElement=n}drawImage(){var e,t,i,n,r,s,o,a,c,l,h,d,u,f=Array.prototype.slice.call(arguments),p=f[0],g=0,m=0;if(3===f.length)e=f[1],t=f[2],i=r=p.width,n=s=p.height;else if(5===f.length)e=f[1],t=f[2],i=f[3],n=f[4],r=p.width,s=p.height;else{if(9!==f.length)throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);g=f[1],m=f[2],r=f[3],s=f[4],e=f[5],t=f[6],i=f[7],n=f[8]}o=this.__closestGroupOrSvg(),this.__currentElement;var w="translate("+e+", "+t+")";if(p instanceof _h){if((a=p.getSvg().cloneNode(!0)).childNodes&&a.childNodes.length>1){for(c=a.childNodes[0];c.childNodes.length;)u=c.childNodes[0].getAttribute("id"),this.__ids[u]=u,this.__defs.appendChild(c.childNodes[0]);if(l=a.childNodes[1]){var b,F=l.getAttribute("transform");b=F?F+" "+w:w,l.setAttribute("transform",b),o.appendChild(l)}}}else"CANVAS"!==p.nodeName&&"IMG"!==p.nodeName||((h=this.__createElement("image")).setAttribute("width",i),h.setAttribute("height",n),h.setAttribute("preserveAspectRatio","none"),(g||m||r!==p.width||s!==p.height)&&((d=this.__document.createElement("canvas")).width=i,d.height=n,d.getContext("2d").drawImage(p,g,m,r,s,0,0,i,n),p=d),h.setAttribute("transform",w),h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===p.nodeName?p.toDataURL():p.getAttribute("src")),o.appendChild(h))}createPattern(e,t){let i,n=this.__document.__createElement("pattern"),r=wh(this.__ids);return n.setAttribute("id",r),n.setAttribute("width",e.width),n.setAttribute("height",e.height),"CANVAS"===e.nodeName||"IMG"===e.nodeName?(i=this.__createElement("image"),i.setAttribute("width",e.width),i.setAttribute("height",e.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===e.nodeName?e.toDataURL():e.getAttribute("src")),n.appendChild(i),this.__defs.appendChild(n)):e instanceof _h&&(n.appendChild(e.__root.childNodes[1]),this.__defs.appendChild(n)),new Ch(n,this)}setLineDash(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}function xh(e){if(e.startsWith("GCF")||e.startsWith("GCA")&&e.length>=13){return"https://hgdownload.soe.ucsc.edu/hubs/"+e.substring(0,3)+"/"+e.substring(4,7)+"/"+e.substring(7,10)+"/"+e.substring(10,13)+"/"+e+"/hub.txt"}}class kh{static supportedTypes=new Set(["bigBed","bigWig","bigGenePred","vcfTabix"]);static filterTracks=new Set(["cytoBandIdeo","assembly","gap","gapOverlap","allGaps","cpgIslandExtUnmasked","windowMasker"]);static async loadHub(e){const t=e.lastIndexOf("/"),i=e.substring(0,t+1),n=await Eh(e);let r;if("genome"===n[1].type){const e=n[1];if(e.hasProperty("groups")){const t=i+e.getProperty("groups");r=await Eh(t)}if(e.hasProperty("chromSizes")){const t=i+e.getProperty("chromSizes"),n=await async function(e){try{const t=(await fetch(e,{method:"HEAD"})).headers;return t.has("content-length")?t.get("content-length"):null}catch(e){return null}}(t);null!==n&&Number.parseInt(n)<1e6&&e.setProperty("chromSizesURL",t)}}return new kh(e,n,r)}constructor(e,t,i){this.url=e;const n=e.lastIndexOf("/");if(this.baseURL=e.substring(0,n+1),"hub"!==t[0].type)throw Error("Unexpected hub.txt file -- does the first line start with 'hub'?");if(this.hubStanza=t[0],"on"!==this.hubStanza.getProperty("useOneFile"))throw Error("Only 'useOneFile' hubs are currently supported");if(t.length<2)throw Error("Expected at least 2 stanzas, hub and genome");if("genome"!==t[1].type)throw Error(`Unexpected hub file -- expected "genome" stanza but found "${t[1].type}"`);this.genomeStanza=t[1],this.trackStanzas=[];for(let e=2;e<t.length;e++)"track"===t[e].type&&this.trackStanzas.push(t[e]);if(i){this.groupStanzas=i,this.groupPriorityMap=new Map;for(let e of i)e.hasProperty("priority")&&this.groupPriorityMap.set(e.getProperty("name"),10*Number.parseInt(e.getProperty("priority")))}}getDefaultPosition(){return this.genomeStanza.getProperty("defaultPos")}getGenomeConfig(e={}){const t=this.genomeStanza.getProperty("genome"),i=this.hubStanza.getProperty("shortLabel")||this.genomeStanza.getProperty("scientificName")||this.genomeStanza.getProperty("organism")||this.genomeStanza.getProperty("description"),n=i+(i?` (${t})`:` ${t}`),r={hubURL:this.url,id:t,name:n,twoBitURL:this.baseURL+this.genomeStanza.getProperty("twoBitPath"),nameSet:"ucsc"};if(this.genomeStanza.hasProperty("chromSizesURL")?r.chromSizesURL=this.genomeStanza.getProperty("chromSizesURL"):(r.wholeGenomeView=!1,r.showChromosomeWidget=!1),this.genomeStanza.hasProperty("defaultPos")){const e=this.genomeStanza.getProperty("defaultPos");if(e){const t=e.lastIndexOf(":");r.locus=t>0?e.substring(0,t):e}}this.genomeStanza.hasProperty("blat")&&(r.blat=this.baseURL+this.genomeStanza.getProperty("blat")),this.genomeStanza.hasProperty("chromAliasBb")&&(r.chromAliasBbURL=this.baseURL+this.genomeStanza.getProperty("chromAliasBb")),this.genomeStanza.hasProperty("chromAlias")&&(r.aliasURL=this.baseURL+this.genomeStanza.getProperty("chromAlias")),this.genomeStanza.hasProperty("twoBitBptURL")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptURL")),this.genomeStanza.hasProperty("twoBitBptUrl")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptUrl")),e.includeChromSizes&&this.genomeStanza.hasProperty("chromSizes")&&(r.chromSizesURL=this.baseURL+this.genomeStanza.getProperty("chromSizes")),this.hubStanza.hasProperty("longLabel")?r.description=this.hubStanza.getProperty("longLabel").replace("/","\n"):(r.description=r.id,this.genomeStanza.hasProperty("description")&&(r.description+=`\n${this.genomeStanza.getProperty("description")}`),this.genomeStanza.hasProperty("organism")&&(r.description+=`\n${this.genomeStanza.getProperty("organism")}`),this.genomeStanza.hasProperty("scientificName")&&(r.description+=`\n${this.genomeStanza.getProperty("scientificName")}`),this.genomeStanza.hasProperty("htmlPath")&&(r.infoURL=this.baseURL+this.genomeStanza.getProperty("htmlPath")));const s=this.trackStanzas.filter((e=>"cytoBandIdeo"===e.name&&e.hasProperty("bigDataUrl")));s.length>0&&(r.cytobandBbURL=this.baseURL+s[0].getProperty("bigDataUrl"));return r.tracks=this.#g((e=>!kh.filterTracks.has(e.name)&&"hide"!==e.getProperty("visibility"))),r}getGroupedTrackConfigurations(){const e=new Map;for(let t of this.#g()){if("cytoBandIdeo"===t.name)continue;const i=t.group||"other";e.has(i)?e.get(i).push(t):e.set(i,[t])}const t=this.groupStanzas?new Map(this.groupStanzas.map((e=>[e.getProperty("name"),e]))):new Map;return Array.from(e.keys()).map((i=>({label:t.has(i)?t.get(i).getProperty("label"):i,tracks:e.get(i)})))}#g(e){return this.trackStanzas.filter((t=>kh.supportedTypes.has(t.format)&&t.hasProperty("bigDataUrl")&&(!e||e(t)))).map((e=>this.#m(e)))}#m(e){const t=e.format,i={id:e.getProperty("track"),name:e.getProperty("shortLabel"),format:t,url:this.baseURL+e.getProperty("bigDataUrl"),displayMode:e.displayMode};if("vcfTabix"===t&&(i.indexURL=i.url+".tbi"),e.hasProperty("longLabel")&&e.hasProperty("html")?(i.description&&(i.description+="<br/>"),i.description=`<a target="_blank" href="${this.baseURL+e.getProperty("html")}">${e.getProperty("longLabel")}</a>`):e.hasProperty("longLabel")&&(i.description=e.getProperty("longLabel")),e.hasProperty("autoScale")&&(i.autoscale="on"===e.getProperty("autoScale").toLowerCase()),e.hasProperty("maxHeightPixels")){const t=e.getProperty("maxHeightPixels").split(":");i.maxHeight=Number.parseInt(t[0]),i.height=Number.parseInt(t[1]),i.minHeight=Number.parseInt(t[2])}if(e.hasProperty("color")){const t=e.getProperty("color");i.color=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("altColor")){const t=e.getProperty("altColor");i.altColor=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("viewLimits")){const t=e.getProperty("viewLimits").split(":");let n,r;t.length>1&&(n=Number.parseInt(t[0]),r=Number.parseInt(t[1])),Number.isNaN(r)||Number.isNaN(n)?console.warn(`Unexpected viewLimits value in track line: ${properties.viewLimits}`):(i.min=n,i.max=r)}if(e.hasProperty("itemRgb"),"hide"===e.getProperty("visibility")&&(i.visible=!1),e.hasProperty("url")&&(i.infoURL=e.getProperty("url")),e.hasProperty("searchIndex")&&(i.searchIndex=e.getProperty("searchIndex")),e.hasProperty("searchTrix")&&(i.trixURL=this.baseURL+e.getProperty("searchTrix")),e.hasProperty("group")&&(i.group=e.getProperty("group"),this.groupPriorityMap&&this.groupPriorityMap.has(i.group))){const e=this.groupPriorityMap.get(i.group)+1;i.order=e,this.groupPriorityMap.set(i.group,e)}return i}}function Ih(e){const t=e.indexOf(" ");return t>0?e.substring(0,t):e}class Sh{properties=new Map;constructor(e,t){this.type=e,this.name=t}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.has(e)?this.properties.get(e):this.parent?this.parent.getProperty(e):void 0}hasProperty(e){return!!this.properties.has(e)||!!this.parent&&this.parent.hasProperty(e)}get format(){const e=this.getProperty("type");if(e)return Ih(e)}get displayMode(){let e=this.getProperty("visibility");if(!e)return"COLLAPSED";switch(e=e.toLowerCase(),e){case"dense":default:return"COLLAPSED";case"pack":return"EXPANDED";case"squish":return"SQUISHED"}}}async function Eh(e){const t=await fetch(e),i=(await t.text()).split(/\n|\r\n|\r/g),n=[];let r,s=!0;for(let e of i){const t=Nh(e),i=e.indexOf(" ",t);if(i<0)s=!0;else{const o=e.substring(t,i).trim();if(o.startsWith("#"))continue;const a=e.substring(i+1).trim();if(s){const e=new Sh(o,a);n.push(e),r=e,s=!1}r.setProperty(o,a)}}return function(e){const t=new Map;for(let i of e)t.set(i.name,i);for(let i of e)if(i.properties.has("parent")){const e=Ih(i.properties.get("parent"));i.parent=t.get(e)}return e}(n)}function Nh(e){let t=0;for(t=0;t<e.length;t++){const i=e.charAt(t);if(" "!==i&&"\t"!==i)break}return t}const Mh={initializeGenomes:async function(e){if(!Mh.KNOWN_GENOMES){const t={};if(!1!==e.loadDefaultGenomes){const r="https://igv.org/genomes/genomes.json";n(await Mn.loadJson(r,{timeout:5e3}))}const i=e.genomeList||e.genomes;if(i)if("string"==typeof i){n(await Mn.loadJson(i,{}))}else n(i);function n(e){return e.forEach((function(e){t[e.id]=e})),t}Mh.KNOWN_GENOMES=t}},isWholeGenomeView:function(e){return"all"===e.toLowerCase()},expandReference:async function(e,t){if(b(t)&&t.startsWith("{"))try{t=JSON.parse(t)}catch(e){}let i;if(b(t)?i=t:t.genome?i=t.genome:void 0===t.id||t.fastaURL||t.twobitURL||(i=t.id),i){let t=Mh.KNOWN_GENOMES[i];if(!t){if((i.startsWith("GCA_")||i.startsWith("GCF_"))&&i.length>=13)try{const e=xh(i);t=(await kh.loadHub(e)).getGenomeConfig()}catch(e){console.error(e)}t||e.present(new Error(`Unknown genome id: ${i}`),void 0)}return t}return t}};let Rh,Bh,Dh=0,Th=0,zh=[];class Lh extends gh{constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.spinnerElement=document.createElement("div"),this.spinnerElement.className="igv-loading-spinner-container",this.viewportElement.appendChild(this.spinnerElement);const e=document.createElement("div");this.spinnerElement.appendChild(e);const t=this.trackView.track;"sequence"!==t.type&&(this.zoomInNoticeElement=Lh.createZoomInNotice(this.viewportElement)),"sequence"!==t.id&&(this.trackLabelElement=document.createElement("div"),this.trackLabelElement.className="igv-track-label",this.viewportElement.appendChild(this.trackLabelElement),this.setTrackLabel(t.name||""),!1===this.browser.doShowTrackLabels&&(this.trackLabelElement.style.display="none"),this.trackView.track.height&&this.setHeight(this.trackView.track.height)),this.stopSpinner(),this.addMouseHandlers()}setContentHeight(e){super.setContentHeight(e),this.featureCache&&(this.featureCache.redraw=!0)}setTrackLabel(e){this.trackLabelElement.innerHTML="",this.trackLabelElement.innerHTML=e;const t=this.trackLabelElement.textContent;this.trackLabelElement.setAttribute("title",t)}startSpinner(){this.spinnerElement&&(this.spinnerElement.style.display="flex")}stopSpinner(){this.spinnerElement&&(this.spinnerElement.style.display="none")}checkZoomIn(){if(this.trackView.track&&"sequence"===this.trackView.track.type&&this.referenceFrame.bpPerPixel>10)return this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=void 0,!1;if(!this.viewIsReady())return!1;if((()=>{if("all"===this.referenceFrame.chr.toLowerCase())return!this.trackView.track.supportsWholeGenome;{const e=this.trackView.track.visibilityWindow;return void 0!==e&&e>0&&this.referenceFrame.bpPerPixel*this.viewportElement.clientWidth>e}})()){if(this.canvas&&this.canvas.parentNode&&(this.canvas.parentNode.removeChild(this.canvas),this.canvas=void 0),this.trackView.track.autoHeight){const e=this.trackView.minHeight||0;this.setContentHeight(e)}return this.zoomInNoticeElement&&(this.zoomInNoticeElement.style.display="flex"),!1}return this.zoomInNoticeElement&&(this.zoomInNoticeElement.style.display="none"),!0}shift(){const e=this.referenceFrame;this.canvas&&this.canvas._data&&this.canvas._data.referenceFrame.chr===this.referenceFrame.chr&&this.canvas._data.bpPerPixel===e.bpPerPixel&&(this.canvas._data.pixelShift=Math.round((this.canvas._data.bpStart-e.start)/e.bpPerPixel),this.canvas.style.left=this.canvas._data.pixelShift+"px")}genomicRange(){return{start:this.referenceFrame.start,end:this.referenceFrame.start+this.referenceFrame.bpPerPixel*this.viewportElement.clientWidth}}setTop(e){if(super.setTop(e),this.canvas){const t=this.viewportElement.clientHeight,i=e+this.canvas._data.pixelTop,n=i+this.canvas._data.pixelHeight;(i>0||n<t)&&this.repaint()}else this.repaint();if(this.canvas&&this.canvas._data){let t=e+this.canvas._data.pixelTop;this.canvas.style.top=`${t}px`}}setHeight(e){super.setHeight(e);const t=this.viewportElement.querySelector(".igv-track-label");t&&(e<30?(t.style.margin=0,t.style.top="50%",t.style.transform="translateY(-50%)",t.style["-ms-transform"]="translateY(-50%)"):(t.style.removeProperty("margin"),t.style.removeProperty("top"),t.style.removeProperty("transform"),t.style.removeProperty("-ms-transform")))}async loadFeatures(){try{const e=this.referenceFrame,t=e.chr,i=await this.browser.genome.loadChromosome(t),n=i?i.bpLength:Number.MAX_SAFE_INTEGER,r=this.viewportElement.clientWidth*e.bpPerPixel,s=Math.floor(Math.max(0,e.start-r)),o=Math.ceil(Math.min(n,e.start+r+r));if(this.loading&&this.loading.start===s&&this.loading.end===o)return;this.loading={start:s,end:o},this.startSpinner();const a=this.trackView.track,c=await this.getFeatures(a,t,s,o,e.bpPerPixel);if(c){let i=[];if(a.roiSets&&a.roiSets.length>0)for(let n of a.roiSets){const r=await n.getFeatures(t,s,o,e.bpPerPixel);i.push({track:n,features:r})}const n=a&&a.resolutionAware,r=this.windowFunction;return this.featureCache=new Hh(t,s,o,e.bpPerPixel,c,i,n,r),this.loading=!1,this.hideMessage(),this.stopSpinner(),this.browser.fireEvent("featuresloaded",[this]),this.featureCache}}catch(e){this.trackView&&!0!==this.trackView.disposed&&(this.showMessage("Error loading track data"),this.browser.alert.present(e),console.error(e))}finally{this.loading=!1,this.stopSpinner()}}get track(){return this.trackView.track}get windowFunction(){return this.track?this.track.windowFunction:void 0}repaintDimensions(){const e=Mh.isWholeGenomeView(this.referenceFrame.chr),t=e?this.viewportElement.clientWidth:3*this.viewportElement.clientWidth,i=this.referenceFrame.bpPerPixel;return{bpStart:this.referenceFrame.start-(e?0:this.viewportElement.clientWidth*i),bpEnd:e?Number.MAX_SAFE_INTEGER:this.referenceFrame.start+2*this.viewportElement.clientWidth*i+1,pixelWidth:t}}repaint(){if(void 0===this.featureCache)return;const{features:e,roiFeatures:t}=this.featureCache,{bpStart:i,bpEnd:n,pixelWidth:r}=this.repaintDimensions(),s=this.viewportElement.clientHeight,o=this.getContentHeight(),a=t?Math.max(o,s):o,c=Math.min(a,3*s);if(0===r||0===c)return void(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas));const l=Math.max(0,-this.contentTop-Math.floor(c/3)),h=this.referenceFrame.bpPerPixel,d=Math.round((i-this.referenceFrame.start)/h),u=(this.contentTop||0)+l,f=document.createElement("canvas");f.style.position="relative",f.style.display="block",f.style.width=r+"px",f.style.height=c+"px",f.style.left=d+"px",f.style.top=u+"px";const p="FILL"===this.trackView.track.displayMode||!1!==this.trackView.track.supportHiDPI?window.devicePixelRatio:1;f.width=p*r,f.height=p*c;const g=f.getContext("2d");g.scale(p,p),g.translate(0,-l);const m={context:g,pixelXOffset:d,pixelWidth:r,pixelHeight:c,pixelTop:l,bpStart:i,bpEnd:n,bpPerPixel:h,pixelShift:d,windowFunction:this.windowFunction,referenceFrame:this.referenceFrame,selection:this.selection,viewport:this,viewportWidth:this.viewportElement.clientWidth};this.draw(m,e,t),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),f._data=m,this.canvas=f,this.viewportElement.appendChild(f)}refresh(){if(!this.canvas||!this.featureCache)return;const e=this.canvas._data;e.context.clearRect(0,0,this.canvas.width,this.canvas.height);const{features:t,roiFeatures:i}=this.featureCache;this.draw(e,t,i)}draw(e,t,i){if(t&&(e.features=t,this.trackView.track.draw(e)),i&&i.length>0)for(let t of i)e.features=t.features,t.track.draw(e)}containsPosition(e,t){return this.referenceFrame.chr===e&&t>=this.referenceFrame.start&&t<=this.referenceFrame.calculateEnd(this.getWidth())}isLoading(){return this.loading}savePNG(){if(!this.canvas)return;const e=this.viewportElement.clientWidth*window.devicePixelRatio,t=this.viewportElement.clientHeight*window.devicePixelRatio,i=-this.canvas.offsetLeft*window.devicePixelRatio,n=this.canvas._data,r=n?n.pixelTop:0,s=(-this.contentTop-r)*window.devicePixelRatio,o=this.canvas.getContext("2d").getImageData(i,s,e,t),a=document.createElement("canvas"),c=a.getContext("2d");a.width=o.width,a.height=o.height,c.putImageData(o,0,0);x((this.trackLabelElement&&this.trackLabelElement.textContent?this.trackLabelElement.textContent:"image")+".png",a.toDataURL("image/png"))}saveSVG(){let{width:e,height:t}=this.browser.columnContainer.getBoundingClientRect();const i=new _h({width:e,height:8e3,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:e,height:8e3}}),n={deltaX:32,deltaY:32};this.renderSVGContext(i,n,!1),i.setHeight(t);const r=(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,""),s=this.browser.referenceFrameList.indexOf(this.referenceFrame),a=i.getSerializedSvg(!0),c=URL.createObjectURL(new Blob([a],{type:"application/octet-stream"}));x(`${`${r}_referenceFrame_${s}_guid_${o()}`}.svg`,c)}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){if(!(this.zoomInNoticeElement&&"flex"!==this.zoomInNoticeElement.style.display)){const{width:n,height:r}=this.viewportElement.getBoundingClientRect(),s=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${o()}`,a=t,c=i+this.contentTop,l=-this.contentTop;e.saveWithTranslationAndClipRect(s,a,c,n,r,l);const{start:h,bpPerPixel:d}=this.referenceFrame,u=Math.round((h-this.referenceFrame.start)/d),f={context:e,viewport:this,referenceFrame:this.referenceFrame,top:l,pixelTop:l,pixelWidth:n,pixelHeight:r,pixelXOffset:u,pixelShift:u,bpStart:h,bpEnd:h+n*d,bpPerPixel:d,viewportWidth:n,selection:this.selection},p=this.featureCache?this.featureCache.features:void 0,g=this.featureCache?this.featureCache.roiFeatures:void 0;this.draw(f,p,g),e.restore()}if(n&&this.trackLabelElement&&this.browser.doShowTrackLabels){const{x:n,y:r,width:s,height:o}=this.viewportElement.getBoundingClientRect(),{x:a,y:c,width:l,height:h}=this.trackLabelElement.getBoundingClientRect(),d=a-n,u=c-r,f=l,p=h;this.renderTrackLabelSVG(e,t+d,i+u,f,p)}}renderTrackLabelSVG(e,t,i,n,r){const s=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_track_label_guid_${o()}`;e.saveWithTranslationAndClipRect(s,t,i,n,r,0),e.fillStyle="white",e.fillRect(0,0,n,r),e.font="12px Arial",e.fillStyle="rgb(68, 68, 68)";const a=.25*(n-e.measureText(this.trackLabelElement.textContent).width),c=.7*(r-12);e.fillText(this.trackLabelElement.textContent,a,r-c),e.strokeStyle="rgb(68, 68, 68)",e.strokeRect(0,0,n,r),e.restore()}get cachedFeatures(){return this.featureCache?this.featureCache.features:[]}clearCache(){this.featureCache=void 0,this.canvas&&(this.canvas._data=void 0)}async getFeatures(e,t,i,n,r){if(this.featureCache&&this.featureCache.containsRange(t,i,n,r,this.windowFunction))return this.featureCache.features;if("function"==typeof e.getFeatures){const s=await e.getFeatures(t,i,n,r,this);return this.checkContentHeight(s),s}}needsRepaint(){if(!this.canvas)return!0;const e=this.canvas._data;return!e||this.referenceFrame.start<e.bpStart||this.referenceFrame.end>e.bpEnd||this.referenceFrame.chr!==e.referenceFrame.chr||this.referenceFrame.bpPerPixel!==e.bpPerPixel||this.windowFunction!==e.windowFunction}needsReload(){if(!this.featureCache)return!0;const{chr:e,bpPerPixel:t}=this.referenceFrame,{bpStart:i,bpEnd:n}=this.repaintDimensions();return!this.featureCache.containsRange(e,i,n,t,this.windowFunction)}static createZoomInNotice(e){const t=document.createElement("div");t.className="igv-zoom-in-notice-container",e.appendChild(t);const i=document.createElement("div");return t.appendChild(i),i.textContent="Zoom in to see features",t.style.display="none",t}viewIsReady(){return this.browser&&this.browser.referenceFrameList&&this.referenceFrame}addMouseHandlers(){this.addViewportContextMenuHandler(this.viewportElement);const e=e=>{this.enableClick=!0,this.browser.mouseDownOnViewport(e,this),s(e)};this.viewportElement.addEventListener("mousedown",e),this.viewportElement.addEventListener("touchstart",e);const t=e=>{this.browser.dragObject||this.browser.isScrolling?(this.browser.cancelTrackPan(),this.enableClick=!1):(this.browser.cancelTrackPan(),this.browser.endTrackDrag())};this.viewportElement.addEventListener("mouseup",t),this.viewportElement.addEventListener("touchend",t),"function"==typeof this.trackView.track.hoverText&&this.viewportElement.addEventListener("mousemove",(e=>{if(0===e.buttons&&Date.now()-Th>100){Th=Date.now();const t=this.createClickState(e);if(t){const e=this.trackView.track.hoverText(t);e?this.viewportElement.setAttribute("title",e):this.viewportElement.removeAttribute("title")}}})),this.addViewportClickHandler(this.viewportElement),this.trackView.track.name&&"sequence"!==this.trackView.track.config.type&&this.addTrackLabelClickHandler(this.trackLabelElement)}addViewportContextMenuHandler(e){e.addEventListener("contextmenu",(e=>{if(this.browser.dragObject)return!1;const t=this.createClickState(e);if(void 0===t)return!1;e.preventDefault();let i=[];if("function"==typeof this.trackView.track.contextMenuItemList){const e=this.trackView.track.contextMenuItemList(t);e&&(i=e)}i.length>0&&i.push({label:document.createElement("hr")}),i.push({label:"Save Image (PNG)",click:()=>this.savePNG()}),i.push({label:"Save Image (SVG)",click:()=>this.saveSVG()}),this.browser.menuPopup.presentTrackContextMenu(e,i)}))}addViewportClickHandler(e){e.addEventListener("click",(e=>{if(this.enableClick&&this.canvas){if(3===e.which||e.ctrlKey)return;if(this.browser.dragObject||this.browser.isScrolling)return;e.preventDefault();const t=a(e,this.viewportElement).x,i=a(e,this.canvas).x,n=this.referenceFrame;Math.floor(n.start+n.toBP(i));const r=Date.now();if(r-Dh<this.browser.constants.doubleClickDelay){Rh&&(window.clearTimeout(Rh),Rh=void 0);const e=Math.round(n.start+n.toBP(t));let i;if("all"===this.referenceFrame.chr.toLowerCase()){const t=this.browser.genome.getChromosomeCoordinate(e).chr;if(1===this.browser.referenceFrameList.length)i=t;else{const e=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));e[this.browser.referenceFrameList.indexOf(this.referenceFrame)]=t,i=e.join(" ")}this.browser.search(i)}else this.browser.zoomWithScaleFactor(.5,e,this.referenceFrame)}else"function"==typeof this.trackView.track.popupData&&(Rh=setTimeout((()=>{const t=this.getPopupContent(e);if(t)if(!1===e.shiftKey){if(Bh&&Bh.dispose(),zh.length>0){for(const e of zh)e.dispose();zh.length=0}Bh=new io(this.viewportElement.parentElement,!0,void 0,(()=>{Bh.dispose()})),Bh.presentContentWithEvent(e,t)}else{let i=new io(this.viewportElement.parentElement,!0,void 0,(()=>{const e=zh.indexOf(i);zh.splice(e,1),i.dispose()}));zh.push(i),i.presentContentWithEvent(e,t)}window.clearTimeout(Rh),Rh=void 0}),this.browser.constants.doubleClickDelay));Dh=r}}))}addTrackLabelClickHandler(e){e.addEventListener("click",(e=>{e.stopPropagation();const{track:t}=this.trackView;let i;"function"==typeof t.description?i=t.description():t.description&&(i=`<div>${t.description}</div>`),i&&(void 0===this.popover&&(this.popover=new io(this.browser.columnContainer,!0,t.name||"",void 0)),this.popover.presentContentWithEvent(e,i))}))}createClickState(e){if(!this.canvas)return;const t=this.referenceFrame,i=a(e,this.viewportElement),n=a(e,this.canvas),r=t.start+t.toBP(i.x);return{event:e,viewport:this,referenceFrame:t,genomicLocation:r,y:i.y-this.contentTop,canvasX:n.x,canvasY:n.y}}getPopupContent(e){const t=this.createClickState(e);if(void 0===t)return;let i=this.trackView.track;const n=i.popupData(t),r=this.browser.fireEvent("trackclick",[i,n]);let s;return void 0===r||!0===r?n&&n.length>0&&(s=n.map((e=>{if(e.name){const t=`<span>${e.name}</span>   ${e.value}`;return`<div title="${e.value}">${t}</div>`}return"<hr>"===e?e:e.html?e.html:`<div title="${e}">${e}</div>`})).join("")):"string"==typeof r&&(s=r),s}dispose(){this.popover&&this.popover.dispose(),super.dispose()}}class Hh{constructor(e,t,i,n,r,s,o,a){this.chr=e,this.bpStart=t,this.bpEnd=i,this.bpPerPixel=n,this.features=r,this.roiFeatures=s,this.multiresolution=o,this.windowFunction=a}containsRange(e,t,i,n,r){if(r&&r!==this.windowFunction)return!1;const s=this.multiresolution?this.bpPerPixel/n:1;return t>=this.bpStart&&i<=this.bpEnd&&e===this.chr&&s>.5&&s<2}overlapsRange(e,t,i){return this.chr===e&&i>=this.bpStart&&t<=this.bpEnd}}const Ph=1/16,Oh=function(e,t){const{r:i,g:n,b:r}=Gn[e];return`rgba(${i},${n},${r},${t})`}("nickel",Ph),Vh=Oh;class qh{constructor(e,t){if(this.url=e.url,e.name&&(this.name=e.name),this.isUserDefined=e.isUserDefined,e.featureSource)this.featureSource=e.featureSource;else if(e.features)this.featureSource=new Uh(e.features,t);else{if(!e.format)throw Error("ROI configuration must define either features or file format");this.featureSource=Hl(e,t)}if(e.color&&!e.color.startsWith("rgba")&&(e.color=un.addAlpha(e.color,Ph)),!0===this.isUserDefined)this.color=e.color||Vh,this.headerColor="rgba(155,185,129)";else{this.color=e.color||Oh,this.headerColor="rgb(190,190,190)";const[t,i,n,r]=function(e){if(e.startsWith("rgba(")){const[t,i]=e.split("("),[n]=i.split(")");return n.split(",").map(((e,t)=>t<3?parseInt(e):parseFloat(e)))}}(this.color);this.headerColor=`rgba(${t},${i},${n},1)`}delete e.isVisible}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}async getAllFeatures(){return"function"==typeof this.featureSource.getAllFeatures?await this.featureSource.getAllFeatures():{}}addFeature(e){this.featureSource.addFeature(e)}removeFeature(e){this.featureSource.removeFeature(e)}toJSON(){if(this.url)return{name:this.name,color:this.color,url:this.url,isUserDefined:this.isUserDefined,isVisible:this.isVisible};{const e=this.featureSource.getAllFeatures(),t=[];for(let i of Object.keys(e))for(let n of e[i])t.push(n);return{name:this.name,color:this.color,features:t,isUserDefined:this.isUserDefined,isVisible:this.isVisible}}}dispose(){for(let e of Object.keys(this))this[e]=void 0}}function Qh(e,t,i,n){let r=Math.round((e-i)/n);let s=Math.round((t-i)/n)-r;return s<3&&(s=3,r-=1),{x:r,width:s}}class Uh{constructor(e,t){this.featureMap={},this.genome=t;for(let i of e){const e=t?t.getChromosomeName(i.chr):i.chr;let n=this.featureMap[e];n||(n=[],this.featureMap[e]=n),n.push(i)}for(let e of Object.keys(this.featureMap))this.featureMap[e].sort(((e,t)=>e.start-t.start))}async getFeatures({chr:e,start:t,end:i}){if("all"===e.toLowerCase())return La(this.featureMap,this.genome);{const n=this.featureMap[e];return n?n.filter((e=>e.end>t&&e.start<i)):[]}}getAllFeatures(){return this.featureMap}supportsWholeGenome(){return!0}addFeature(e){let t=this.featureMap[e.chr];t||(t=[],this.featureMap[e.chr]=t),t.push(e),t.sort(((e,t)=>e.start-t.start))}removeFeature({chr:e,start:t,end:i}){if(this.featureMap[e]){const n=`${e}-${t}-${i}`;this.featureMap[e]=this.featureMap[e].filter((e=>n!==`${e.chr}-${e.start}-${e.end}`)),0===this.featureMap[e].length&&delete this.featureMap[e]}}}class jh{constructor(e,i,n,r){this.rulerViewport=e,this.rulerSweeper=t({class:"igv-ruler-sweeper"}),i.appendChild(this.rulerSweeper),this.browser=n,this.referenceFrame=r,this.isMouseHandlers=void 0,this.addBrowserObserver()}addBrowserObserver(){this.boundObserverHandler=(()=>{this.referenceFrame&&(Mh.isWholeGenomeView(this.referenceFrame.chr)?this.removeMouseHandlers():this.addMouseHandlers())}).bind(this),this.browser.on("locuschange",this.boundObserverHandler)}removeBrowserObserver(){this.browser.off("locuschange",this.boundObserverHandler)}addMouseHandlers(){if(!0===this.isMouseHandlers)return;let e,t,i,n,r,s;this.boundContentMouseDownHandler=function(s){e=!0,t=!0;const{x:o}=a(s,this.rulerViewport.contentDiv);n=i=o,r=1,this.rulerSweeper.style.display="block",this.rulerSweeper.style.backgroundColor=!0===s.shiftKey?Vh:"rgba(68, 134, 247, 0.25)",this.rulerSweeper.style.left=`${n}px`,this.rulerSweeper.style.width=`${r}px`}.bind(this),this.rulerViewport.contentDiv.addEventListener("mousedown",this.boundContentMouseDownHandler),this.boundDocumentMouseMoveHandler=function(o){let c;if(e&&t){const{x:e}=a(o,this.rulerViewport.contentDiv);c=Math.max(Math.min(e,this.rulerViewport.contentDiv.clientWidth),0),s=c-i,r=Math.abs(s),this.rulerSweeper.style.width=`${r}px`,s<0&&(n=i+s,this.rulerSweeper.style.left=`${n}px`)}}.bind(this),document.addEventListener("mousemove",this.boundDocumentMouseMoveHandler),this.boundDocumentMouseUpHandler=function(i){let s;if(!0===e&&!0===t&&(e=t=void 0,this.rulerSweeper.style.display="none",r>1)){s={start:Math.floor(this.referenceFrame.calculateEnd(n)),end:Math.floor(this.referenceFrame.calculateEnd(n+r))};!0===i.shiftKey?this.browser.roiManager.updateUserDefinedROISet(Object.assign({chr:this.referenceFrame.chr},s)):(Ws(this.browser.genome.getChromosome(this.referenceFrame.chr).bpLength,s,this.browser.minimumBases()),function(e,t,i){e.start=Math.round(t.start),e.end=Math.round(t.end),e.bpPerPixel=(e.end-e.start)/i}(this.referenceFrame,s,this.rulerViewport.contentDiv.clientWidth),this.browser.updateViews(this.referenceFrame))}}.bind(this),document.addEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!0}removeMouseHandlers(){this.rulerViewport.contentDiv.removeEventListener("mousedown",this.boundContentMouseDownHandler),document.removeEventListener("mousemove",this.boundDocumentMouseMoveHandler),document.removeEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!1}dispose(){this.removeBrowserObserver(),this.removeMouseHandlers(),this.rulerSweeper.remove()}}function Gh(e){if(Wh[e])return Wh[e];if(Wh["chr"+e]){const t=Wh["chr"+e];return Wh[e]=t,t}{const t=un.randomRGB(0,255);return Wh[e]=t,t}}const Wh={chrX:"rgb(204, 153, 0)",chrY:"rgb(153, 204, 0)",chrUn:"rgb(50, 50, 50)",chr1:"rgb(80, 80, 255)",chrI:"rgb(139, 155, 187)",chr2:"rgb(206, 61, 50)",chrII:"rgb(206, 61, 50)",chr2a:"rgb(216, 71, 60)",chr2b:"rgb(226, 81, 70)",chr3:"rgb(116, 155, 88)",chrIII:"rgb(116, 155, 88)",chr4:"rgb(240, 230, 133)",chrIV:"rgb(240, 230, 133)",chr5:"rgb(70, 105, 131)",chr6:"rgb(186, 99, 56)",chr7:"rgb(93, 177, 221)",chr8:"rgb(128, 34, 104)",chr9:"rgb(107, 215, 107)",chr10:"rgb(213, 149, 167)",chr11:"rgb(146, 72, 34)",chr12:"rgb(131, 123, 141)",chr13:"rgb(199, 81, 39)",chr14:"rgb(213, 143, 92)",chr15:"rgb(122, 101, 165)",chr16:"rgb(228, 175, 105)",chr17:"rgb(59, 27, 83)",chr18:"rgb(205, 222, 183)",chr19:"rgb(97, 42, 121)",chr20:"rgb(174, 31, 99)",chr21:"rgb(231, 199, 111)",chr22:"rgb(90, 101, 94)",chr23:"rgb(204, 153, 0)",chr24:"rgb(153, 204, 0)",chr25:"rgb(51, 204, 0)",chr26:"rgb(0, 204, 51)",chr27:"rgb(0, 204, 153)",chr28:"rgb(0, 153, 204)",chr29:"rgb(10, 71, 255)",chr30:"rgb(71, 117, 255)",chr31:"rgb(255, 194, 10)",chr32:"rgb(255, 209, 71)",chr33:"rgb(153, 0, 51)",chr34:"rgb(153, 26, 0)",chr35:"rgb(153, 102, 0)",chr36:"rgb(128, 153, 0)",chr37:"rgb(51, 153, 0)",chr38:"rgb(0, 153, 26)",chr39:"rgb(0, 153, 102)",chr40:"rgb(0, 128, 153)",chr41:"rgb(0, 51, 153)",chr42:"rgb(26, 0, 153)",chr43:"rgb(102, 0, 153)",chr44:"rgb(153, 0, 128)",chr45:"rgb(214, 0, 71)",chr46:"rgb(255, 20, 99)",chr47:"rgb(0, 214, 143)",chr48:"rgb(20, 255, 177)"};let $h,Kh;class Yh extends Lh{constructor(e,t,i,n){super(e,t,i,n)}get contentDiv(){return this.viewportElement}initializationHelper(){this.multiLocusCloseButton=document.createElement("div"),this.multiLocusCloseButton.className="igv-multi-locus-close-button",this.viewportElement.appendChild(this.multiLocusCloseButton);const e=l("times-circle");this.multiLocusCloseButton.appendChild(e),this.multiLocusCloseButton.addEventListener("click",(()=>{this.browser.removeMultiLocusPanel(this.referenceFrame)})),this.rulerLabel=document.createElement("div"),this.rulerLabel.className="igv-multi-locus-ruler-label",this.viewportElement.appendChild(this.rulerLabel);const t=document.createElement("div");this.rulerLabel.appendChild(t),this.rulerLabel.addEventListener("click",(async e=>{e.stopPropagation(),await this.browser.gotoMultilocusPanel(this.referenceFrame)})),this.tooltip=document.createElement("div"),this.tooltip.className="igv-ruler-tooltip",this.tooltip.style.height=`${this.viewportElement.clientHeight}px`,this.viewportElement.appendChild(this.tooltip),this.tooltipContent=document.createElement("div"),this.tooltip.appendChild(this.tooltipContent),this.rulerSweeper=new jh(this,this.viewportElement.parentElement,this.browser,this.referenceFrame),this.attachMouseHandlers(Mh.isWholeGenomeView(this.referenceFrame.chr)),this.tooltip.style.display="none",this.dismissLocusLabel()}presentLocusLabel(e){this.multiLocusCloseButton.style.display="block",this.rulerLabel.style.display="block",this.rulerLabel.style.backgroundColor=Gh(this.referenceFrame.chr);const t=this.rulerLabel.querySelector("div"),{width:i}=this.rulerLabel.getBoundingClientRect();t.innerHTML=`${this.referenceFrame.getMultiLocusLabel(e)}`;const{width:n}=t.getBoundingClientRect();n/i>.5&&(t.innerHTML=`${this.referenceFrame.getMultiLocusLabelBPLengthOnly(e)}`)}dismissLocusLabel(){this.rulerLabel.style.display="none",this.multiLocusCloseButton.style.display="none"}attachMouseHandlers(e){!0===e?(this.viewportElement.addEventListener("click",(e=>{const{x:t}=a(e,this.viewportElement),i=Math.round(this.referenceFrame.start+this.referenceFrame.toBP(t));let n;const{chr:r}=this.browser.genome.getChromosomeCoordinate(i);if(1===this.browser.referenceFrameList.length)n=r;else{const e=this.browser.referenceFrameList.indexOf(this.referenceFrame),t=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));t[e]=r,n=t.join(" ")}this.browser.search(n)})),this.viewportElement.style.cursor="pointer"):this.viewportElement.style.cursor="default"}mouseMove(e){if(this.browser.doShowCursorGuide){void 0===Kh?(Kh=this,this.tooltip.style.display="block"):Kh.guid!==this.guid?(Kh.tooltip&&(Kh.tooltip.style.display="none"),this.tooltip.style.display="block",Kh=this):this.tooltip.style.display="block";if(this.browser.isMultiLocusWholeGenomeView()||Mh.isWholeGenomeView(this.referenceFrame.chr))return void(this.tooltip.style.display="none");const{x:t}=a(e,this.viewportElement),{start:i,end:n,bpPerPixel:r}=this.referenceFrame,s=Math.round(.5+i+Math.max(0,t)*r);this.tooltipContent.textContent=F(s);const o=this.tooltipContent.getBoundingClientRect(),c=this.viewportElement.getBoundingClientRect(),l=cn(t,0,c.width-o.width);return this.tooltip.style.left=`${l}px`,clearTimeout($h),$h=setTimeout((()=>{this.tooltip&&(this.tooltip.style.display="none")}),1e4),{start:i,bp:s,end:n}}}startSpinner(){}stopSpinner(){}dispose(){this.rulerSweeper.dispose(),super.dispose()}}let Xh;class Zh extends Lh{featureCache=new Jh;constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.canvas=document.createElement("canvas"),this.canvas.className="igv-ideogram-canvas",this.viewportElement.appendChild(this.canvas),this.ideogram_ctx=this.canvas.getContext("2d"),this.tooltip=document.createElement("div"),this.tooltip.className="igv-cytoband-tooltip",this.tooltip.style.height=`${this.viewportElement.clientHeight}px`,this.viewportElement.appendChild(this.tooltip),this.tooltipContent=document.createElement("div"),this.tooltip.appendChild(this.tooltipContent),this.tooltip.style.display="none",this.addMouseHandlers()}async getFeatures(e,t,i,n){return this.featureCache.containsRange(e)?this.featureCache.get(e):this.loadFeatures()}async loadFeatures(){const e=this.referenceFrame.chr,t=await this.referenceFrame.genome.getCytobands(e);return this.featureCache.set(e,t),t}repaint(){if(void 0===this.featureCache)return;const{width:e,height:t}=this.viewportElement.getBoundingClientRect();fr.configureHighDPICanvas(this.ideogram_ctx,e,t);const i=this.referenceFrame.chr,n=this.featureCache.get(i),r={context:this.ideogram_ctx,pixelWidth:e,pixelHeight:t,referenceFrame:this.referenceFrame,features:n};this.trackView.track.draw(r)}addMouseHandlers(){this.addViewportClickHandler(this.viewportElement),this.trackView.track.showCytobandNames&&(this.viewportElement.addEventListener("mousemove",this.mouseMove.bind(this)),this.viewportElement.addEventListener("mouseleave",this.mouseLeave.bind(this)))}mouseMove(e){const{x:t}=a(e,this.viewportElement),i=this.featureCache.get(this.referenceFrame.chr);if(i){const{width:e}=this.viewportElement.getBoundingClientRect(),n=e/i[i.length-1].end;let r=!1;for(let s=0;s<i.length;s++){const o=i[s],a=o.start*n,c=o.end*n;if(t>=a&&t<=c){this.tooltipContent.textContent=o.name;const{width:t}=this.tooltipContent.getBoundingClientRect();const i=cn((a+c)/2-t/2,0,e-t);this.tooltip.style.left=`${i}px`,clearTimeout(Xh),Xh=setTimeout((()=>{this.tooltip&&(this.tooltip.style.display="none")}),1e4),this.tooltip.style.display="block",r=!0;break}}if(r)return}this.tooltip.style.display="none"}mouseLeave(e){this.tooltip.style.display="none"}addViewportClickHandler(e){this.boundClickHandler=function(e){const{xNormalized:t,width:i}=a(e,this.ideogram_ctx.canvas),{bpLength:n}=this.browser.genome.getChromosome(this.referenceFrame.chr),r=this.referenceFrame.bpPerPixel*i/n;let s=t;s-r/2<0&&(s=r/2);s+r/2>1&&(s=1-r/2);const o=Math.round((s-r/2)*n),c=Math.round((s+r/2)*n);this.referenceFrame.start=o,this.referenceFrame.end=c,this.referenceFrame.bpPerPixel=(c-o)/i,this.browser.updateViews(this.referenceFrame,this.browser.trackViews,!0)}.bind(this),e.addEventListener("click",this.boundClickHandler)}setWidth(e){this.viewportElement.style.width=e+"px"}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){const{width:r,height:s}=this.viewportElement.getBoundingClientRect(),a=`ideogram_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${o()}`,c=t,l=i+this.contentTop,h=-this.contentTop;e.saveWithTranslationAndClipRect(a,c,l,r,s,h),this.trackView.track.draw({context:e,pixelWidth:r,pixelHeight:s,referenceFrame:this.referenceFrame,features:this.featureCache.get(this.referenceFrame.chr)}),e.restore()}startSpinner(){}stopSpinner(){}}class Jh{features=new Map;containsRange(e){return this.features.has(e)}set(e,t){this.features.set(e,t)}get(e){return this.features.get(e)}}function ed(e,t,i,n){if("ruler"===e.track.type)return new Yh(e,t,i,n);if("ideogram"===e.track.id)return new Zh(e,t,i,n);{const r=new Lh(e,t,i,n);return i.viewport=r,r}}const td=["rgb(255, 0, 0)","rgb(0, 255, 0)","rgb(0, 0, 255)","rgb(255, 0, 255)","rgb(0, 255, 255)","rgb(128, 0, 128)","rgb(255, 165, 0)","rgb(255, 105, 180)","rgb(255, 127, 80)","rgb(220, 20, 60)","rgb(255, 99, 71)","rgb(173, 216, 230)","rgb(144, 238, 144)","rgb(224, 255, 255)","rgb(250, 250, 210)","rgb(152, 251, 152)","rgb(70, 130, 180)","rgb(102, 205, 170)"].map((e=>{const[t,i,n]=e.split(","),[r,s]=t.split("("),[o,a]=n.split(")");return[s,i,o]})),id=Wn("magnesium"),nd=["#sampleTable","#sampleMapping","#colors"];class rd{static emptySpaceReplacement="|";sampleDictionary={};attributeNames=[];sampleMappingDictionary={};colorDictionary={};attributeRangeLUT={};constructor(e){e.tracks.some((e=>"function"==typeof e.getSamples)).length>0&&e.sampleInfoControl.setButtonVisibility(!0),this.initialize()}initialize(){this.sampleInfoFiles=[],this.attributeNames=[],this.sampleDictionary={},this.sampleMappingDictionary={},this.colorDictionary={},this.attributeRangeLUT={},this.initialized=!1}get attributeCount(){return this.attributeNames?this.attributeNames.length:0}isInitialized(){return this.initialized}hasAttributes(){return this.attributeCount>0}getAttributes(e){const t=0===Object.keys(this.sampleMappingDictionary)?e:this.sampleMappingDictionary[e]||e;return this.sampleDictionary[t]}async loadSampleInfoFile(e){try{const t=await Mn.loadString(e);this.#w(t),this.sampleInfoFiles.push(e)}catch(e){console.error(e.message)}}#w(e){const t=function(e){const t={},i=e.split(/\r?\n|\r/).map((e=>e.trim())).filter((e=>""!==e));let n;nd.includes(i[0])||(n="#sampleTable",t[n]=[]);for(const e of i)nd.includes(e)?(n=e,t[n]=[]):n&&!1===e.startsWith("#")&&t[n].push(e);return t}(e);for(const[e,i]of Object.entries(t))switch(e){case"#sampleTable":this.#b(i);break;case"#sampleMapping":this.#F(i);break;case"#colors":this.#v(i)}this.initialized=!0}getAttributeColor(e,t){let i;if("-"===t)i=Wn("snow");else if("string"==typeof t&&this.colorDictionary[t])i=this.colorDictionary[t]();else if(this.colorDictionary[e])i=this.colorDictionary[e](t);else if("string"==typeof t)i="NA"===t?id:function(e){let t=0;for(let i=0;i<e.length;i++)t=e.charCodeAt(i)+((t<<5)-t);let i=[];for(let e=0;e<3;e++){const n=t>>8*e&255;i.push(n)}return`rgb(${i.join(", ")})`}(t);else{const[n,r]=this.attributeRangeLUT[e],s=.2,o=Math.max((t-n)/(r-n),s),[a,c,l]=td[Object.keys(this.attributeRangeLUT).indexOf(e)];i=`rgba(${a},${c},${l},${o})`}return i}getSortedSampleKeysByAttribute(e,t,i){i=i||1;const n=e.filter((e=>"number"==typeof this.getAttributes(e)[t])),r=e.filter((e=>"string"==typeof this.getAttributes(e)[t])),s=(e,n)=>{const r=this.getAttributes(e)[t],s=this.getAttributes(n)[t];return"string"==typeof r&&"string"==typeof s?i*r.localeCompare(s):"number"==typeof r&&"number"==typeof s?i*(r-s):void 0};return n.sort(s),r.sort(s),-1===i?[...n,...r]:[...r,...n]}toJSON(){const e=[];for(const t of this.sampleInfoFiles){const i={url:t},n=Pa.localFileInspection(i);e.push(n)}return e}#b(e){const t=e.shift().split("\t").filter((e=>e.length>0));t.shift();const i=t.map((e=>e.split(" ").join(rd.emptySpaceReplacement))),n=e.filter((e=>e.length>0));let r;for(const e of n){const t=e.split("\t"),n=t.shift();void 0===r&&(r={}),r[n]={};for(let e=0;e<t.length;e++){const s={};""===t[e]?s[i[e]]="-":s[i[e]]=t[e],Object.assign(r[n],s)}}for(const[e,t]of Object.entries(r))r[e]=od(t);const s=function(e,t){const i={};for(const n of Object.values(t))for(const t of e){let e=n[t];void 0===i[t]&&(i[t]=[]),i[t].push(e)}const n=e=>"number"==typeof e,r=e=>"string"==typeof e;for(const e of Object.keys(i)){const t=i[e],s=new Set(t),o=Array.from(s);if(!0===o.some(r)&&!0===o.some(n)?i[e]=o.filter((e=>!r(e))):i[e]=o,!i[e].some(r)){const t=i[e].slice();i[e]=[Math.min(...t),Math.max(...t)]}}return i}(i,r);sd(this.attributeRangeLUT,s);const o=new Set(this.attributeNames);for(const e of i)o.has(e)||this.attributeNames.push(e);sd(this.sampleDictionary,r)}#F(e){for(const t of e){const[e,i]=t.split("\t");this.sampleMappingDictionary[e]=i}}#v(e){const t=(e,t,i)=>{let n;switch(t){case 0:n=e.split(" ").join(rd.emptySpaceReplacement);break;case 1:n=e.includes(":")?e.split(":").map((e=>parseFloat(e))):e;break;case 2:case 3:n=`rgb(${e})`}return n},i=e.map((e=>e.split("\t").map(t))),n=i.filter((e=>3===e.length&&!e.includes("*"))).filter((([e,t,i])=>!Array.isArray(t))),r={};for(const e of n){const[t,i,n]=e;void 0===r[t]&&(r[t]={}),r[t][i.toUpperCase()]=n}for(const[e,t]of Object.entries(r)){const i=Object.assign({},t);this.colorDictionary[e]=e=>{const t=e.toUpperCase();return i[t]||Wn("snow")}}const s=i.filter((e=>Array.isArray(e[1])));for(const e of s){const[t,i]=e[1],n=e[0];if(3===e.length){const[r,s,o]=er(e[2]);this.colorDictionary[n]=e=>{e=cn(e,t,i);return Zn(r,s,o,(e-t)/(i-t))}}else if(4===e.length){const[t,i]=e[1],[n,r,s,o]=e;this.colorDictionary[n]=e=>{e=cn(e,t,i);return tr(s,o,(e-t)/(i-t))}}}const o=i.filter((e=>3===e.length&&e.includes("*")));for(const e of o)if("*"===e[1]){const[t,i,n]=e;this.colorDictionary[t]=e=>{if("NA"===e)return id;{const[i,r]=this.attributeRangeLUT[t],s=(e-i)/(r-i),[o,a,c]=er(n);return Zn(o,a,c,s)}}}else if("*"===e[0]){const[t,i,n]=e;this.colorDictionary[i]=()=>n}}}function sd(e,t){for(const[i,n]of Object.entries(t))i in e&&e[i]===n||(e[i]=n)}function od(e){const t=Object.assign({},e);for(const[e,i]of Object.entries(t))"string"!=typeof i||isNaN(i)||(t[e]=Number(i));return t}const ad=16,cd=F;class ld{constructor(e){this.browser=e,this.height=40,this.name="",this.disableButtons=!0,this.ignoreTrackMenu=!0,this.order=.01*Number.MIN_SAFE_INTEGER,this.removable=!1,this.type="ruler",this.id="ruler"}async getFeatures(e,t,i){return[]}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpPerPixel:r,bpStart:s}){Mh.isWholeGenomeView(t.chr)?this.drawWholeGenome({context:e,pixelWidth:i,pixelHeight:n,bpPerPixel:r}):this.doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:s})}drawWholeGenome({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n}){e.save(),fr.fillRect(e,0,0,t,i,{fillStyle:"white"});for(let t of this.browser.genome.wgChromosomeNames){let r=this.browser.genome.getCumulativeOffset(t),s=this.browser.genome.getChromosome(t).bpLength,o=Math.round(r/n),a=Math.round(s/n);this.renderChromosomeRect(e,o,0,a,i,t)}e.restore()}doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:r}){e.clearRect(0,0,i,n);const s=function(e,t){if(e<10)return new hd(1,"bp",1);const i=Math.floor(Math.log10(e));let n="bp",r=1;i>9?(n="gb",r=1e9):i>6?(n="mb",r=1e6):i>3&&(n="kb",r=1e3);const s=Math.pow(10,i-1),o=e/s,a=75,c=Math.pow(10,i-1),l=Math.pow(10,i)/2;return new hd(o<a&&!0!==t?c:l,n,r)}(Math.floor(t.toBP(i)),e.isSVG);let o=Math.floor(r/s.majorTick)-1;const{tickDelta:a,labelLength:c}=function(e,t,i,n,r){const s=l(t,c(1+n,r),i)-l(t,c(n,r),i),o=`${F(Math.floor(c(n,r)/r.unitMultiplier))} ${r.majorUnit}`,a=Math.floor(e.measureText(o).width);return{tickDelta:s,labelLength:a};function c(e,t){return Math.floor(e*t.majorTick)}function l(e,t,i){return Math.round(e.toPixels(t-1-i+.5))}}(e,t,r,o,s);let l,h;this.browser.referenceFrameList.indexOf(t);let d=a;const u=.25*c;do{h=Math.floor(o*s.majorTick);const i=`${F(Math.floor(h/s.unitMultiplier))} ${s.majorUnit}`;l=Math.round(t.toPixels(h-1-r+.5));const n=Math.round(l-e.measureText(i).width/2);n>0&&u+c<=d&&(fr.fillText(e,i,n,this.height-8),d=0),l>0&&fr.strokeLine(e,l,this.height-6,l,this.height-2),h=Math.floor((1+o)*s.majorTick);let f=l+(Math.round(t.toPixels(h-1-r+.5))-l)/2;f>0&&fr.strokeLine(e,f,this.height-6,f,this.height-2),++o,d+=a}while(l<i);fr.strokeLine(e,0,this.height-2,i,this.height-2)}renderChromosomeRect(e,t,i,n,r,s){e.textAlign="center",e.textBaseline="middle",e.font="12px sans-serif",fr.strokeLine(e,t+n,i,t+n,i+r,{strokeStyle:un.greyScale(191)});const o=(s=this.browser.genome.getChromosomeDisplayName(s)).startsWith("chr")?s.substring(3):s;n>e.measureText(o).width&&fr.fillText(e,o,t+n/2,i+r/2,{fillStyle:un.greyScale(68)})}get supportsWholeGenome(){return!0}dispose(){}}class hd{constructor(e,t,i){this.majorTick=e,this.minorTick=e/10,this.majorUnit=t,this.unitMultiplier=i}description(e){console.log((e||"")+" tick "+cd(this.majorTick)+" label width "+cd(this.labelWidthBP)+" multiplier "+this.unitMultiplier)}}class dd{constructor(e,i,n){this.guid=o(),this.trackView=e,this.browser=e.browser,this.viewport=t({class:"igv-viewport"}),i.appendChild(this.viewport),this.viewport.style.height=`${e.track.height}px`,null===this.viewport.previousElementSibling&&(this.viewport.style.zIndex=16,this.viewport.style.overflow="visible"),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.ctx.font="10px verdana",this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(n),this.addMouseHandlers()}resizeCanvas(){const e=window.devicePixelRatio,t=this.browser.getSampleInfoViewportWidth();let i;if(this.browser.trackViews.length>1&&null===this.viewport.previousElementSibling){const[e,t]=[this.browser.ideogramTrackView.track,this.browser.rulerTrackView.track];i=e.height+t.height}else i=this.viewport.clientHeight;if(this.canvas.width!==t*e||this.canvas.height!==i*e){const n=this.canvas;n.width=t*e,n.height=i*e,n.style.width=`${t}px`,n.style.height=`${i}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(e,e),null===this.viewport.previousElementSibling&&fr.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:Wn("snow")})}}setTop(e){"function"==typeof this.trackView.track.getSamples&&(this.contentTop=e,this.repaint())}setWidth(e){this.viewport.innerWidth=e,this.resizeCanvas()}setHeight(e){const t=this.browser.getSampleInfoViewportWidth();this.viewport.style.width=`${t}px`,this.viewport.style.height=`${e}px`;const i=window.devicePixelRatio;this.canvas.width=t*i,this.canvas.height=e*i,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(i,i),null===this.viewport.previousElementSibling&&fr.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:Wn("snow")})}async repaint(){if(this.resizeCanvas(),"function"==typeof this.trackView.track.getSamples){const e=this.trackView.track.getSamples();e.names&&e.names.length>0&&this.draw({context:this.ctx,samples:e})}else null===this.viewport.previousElementSibling&&(this.browser.rulerTrackView&&this.browser.rulerTrackView.setTrackHeight(!0===this.browser.sampleInfoControl.showSampleInfo?this.calculateSampleInfoColumnHeight():40,!0),this.renderSampleInfoColumns(this.ctx))}calculateSampleInfoColumnHeight(){const e=this.browser.sampleInfo.attributeNames.map((e=>this.ctx.measureText(e).width));return 4+Math.min(Math.max(...e),128)}draw({context:e,samples:t}){if(e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillStyle=Wn("snow"),e.fillRect(0,0,e.canvas.width,e.canvas.height),t&&t.names.length>0){const i=this.browser.sampleInfo.attributeNames,n=this.viewport.getBoundingClientRect().height;let r=1;const s=t.height;r=s-2*r<=1?0:1;let o=this.contentTop+t.yOffset;this.hitList={};for(const a of t.names){if(o>n)break;if(o+s>0){const t=this.browser.sampleInfo.getAttributes(a);if(t){const n=Object.entries(t);for(const t of n){const[n,a]=t;e.fillStyle=this.browser.sampleInfo.getAttributeColor(n,a);const c=8+i.indexOf(n)*ad,l=o+r,h=s-2*r;e.fillRect(c,l,15,h);const d=`${Math.floor(c)}#${Math.floor(l)}#16#${Math.ceil(h)}`;this.hitList[d]=`${n}#${a}`}}}o+=s}}}renderSampleInfoColumns(e){const t=(e,t,i,n,r,s)=>{e.save(),e.font="10px verdana",e.translate(i+r/2,n+s),e.rotate(-Math.PI/2),e.textAlign="left",e.fillStyle=Wn("lead"),e.fillText(t,2,2),e.restore()},i=this.browser.sampleInfo.attributeNames;this.hitList={};for(let n=0;n<i.length;n++){const r=8+n*ad,s=15,o=Math.round(e.canvas.height/window.devicePixelRatio);fr.fillRect(e,r,0,s,o,{fillStyle:Wn("snow")}),t(e,i[n],r,0,s,o);const a=`${Math.floor(r)}#0#${s}#${Math.ceil(o)}`;this.hitList[a]=`${i[n]}`}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:s,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${o()}`;e.saveWithTranslationAndClipRect(c,t,i+r,s,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.addMouseMoveHandler()}addMouseMoveHandler(){this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList);if(null===this.viewport.previousElementSibling){const i=(t,i)=>{const{marginTop:n}=window.getComputedStyle(i),{x:r,y:s}=a(e,this.browser.columnContainer.querySelector(".igv-sample-info-column"));return{x:Math.floor(r),y:Math.floor(s-parseInt(n,10))}},n=this.browser.columnContainer.querySelector(".igv-sample-info-column"),{x:r,y:s}=i(n,this.viewport);n.setAttribute("title","");for(const[e,i]of t){const[t,o,a,c]=e.split("#").map((e=>parseInt(e,10)));if(!(r<t||r>t+a||s<o||s>o+c)){n.setAttribute("title",`${i}`);break}}}else{const{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){const[e,t]=r.split("#");this.viewport.setAttribute("title",`${e.split(rd.emptySpaceReplacement).join(" ")}: ${"-"===t?"":t}`);break}}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}show(){this.viewport.style.display="block"}hide(){this.viewport.style.display="none"}}class ud{constructor(e,i,n,r){this.guid=o(),this.trackView=e,this.browser=e.browser,this.viewport=t({class:"igv-viewport"}),i.appendChild(this.viewport),e.track.height&&(this.viewport.style.height=`${e.track.height}px`),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.trackScrollDelta=0,this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(r),this.addMouseHandlers()}checkCanvas(){const e=this.browser.sampleNameViewportWidth||0;this.ctx.canvas.width=e*window.devicePixelRatio,this.ctx.canvas.style.width=`${e}px`,this.ctx.canvas.height=this.viewport.clientHeight*window.devicePixelRatio,this.ctx.canvas.style.height=`${this.viewport.clientHeight}px`,this.ctx.scale(window.devicePixelRatio,window.devicePixelRatio)}setTop(e){if("function"==typeof this.trackView.track.getSamples){this.contentTop=e;const t=this.trackView.track.getSamples();this.repaint(t)}}setWidth(e){this.viewport.innerWidth=e,this.checkCanvas()}async repaint(e){if(e.names.length>0&&!0===this.browser.showSampleNames&&(this.checkCanvas(),this.draw({context:this.ctx,samples:e}),void 0===this.browser.sampleNameViewportWidth)){const t=e.names.map((e=>this.ctx.measureText(e).width));this.browser.sampleNameViewportWidth=Math.min(200,4+Math.ceil(Math.max(...t))),this.browser.layoutChange()}}draw({context:e,samples:t}){if(fr.fillRect(e,0,0,e.canvas.width,t.height,{fillStyle:Wn("snow")}),t&&t.names.length>0){const i=this.viewport.getBoundingClientRect().height,n=t.height,r=n-2<=1?0:1;let s=this.contentTop+t.yOffset;this.hitList={};for(const o of t.names){if(s>i)break;if(s+n>0){const t=n-2*r;fd(e,o,0+2,s+r,e.canvas.width,t)}s+=n}}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:s,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${o()}`;e.saveWithTranslationAndClipRect(c,t,i+r,s,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.boundClickHandler=function(e){e.preventDefault();const t={label:"Name Panel Width",value:this.browser.sampleNameViewportWidth,callback:e=>{this.browser.sampleNameViewportWidth=parseInt(e),this.browser.layoutChange()}};this.browser.inputDialog.present(t,e)}.bind(this),this.viewport.addEventListener("contextmenu",this.boundClickHandler),this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList),{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){this.viewport.setAttribute("title",`${r}`);break}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("contextmenu",this.boundClickHandler),this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}}function fd(e,t,i,n,r,s){const o=Math.min(s,10);e.font=`${o}px sans-serif`,e.textAlign="start",e.fillStyle=Wn("lead");const a=i,c=e.measureText(t),l=n+s/2+(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent)/2;e.fillText(t,a,l)}class pd{constructor(e){this.popover=t({class:"igv-menu-popup"}),e.appendChild(this.popover),this.parent=e;const i=t({class:"igv-menu-popup-header"});this.popover.appendChild(i),u(i,(()=>this.popover.style.display="none")),this.popoverContent=t(),this.popover.appendChild(this.popoverContent),p(this.popover,i),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()})),this.popover.style.display="none"}presentMenuList(e,t){if(gd(this.parent),t.length>0){this.popoverContent.innerHTML="";const i=this.parseMenuList(e,t);for(let e of i)e.init&&e.init(),0===i.indexOf(e)&&e.element.classList.remove("igv-track-menu-border-top"),e.element.classList.contains("igv-track-menu-border-top")||e.element.classList.contains("igv-menu-popup-check-container")||"div"===e.element.tagName.toLowerCase()&&e.element.classList.add("igv-menu-popup-shim"),this.popoverContent.appendChild(e.element);this.popover.style.display="flex";const{width:n}=this.popover.getBoundingClientRect();this.popover.style.left=-n+"px",this.popover.style.top="0px"}}parseMenuList(e,t){return t.map(((t,i)=>{let n;if(t.name)n=document.createElement("div"),n.textContent=t.name;else if(t.element)n=t.element;else if("string"==typeof t.label)n=document.createElement("div"),n.innerHTML=t.label;else if("string"==typeof t)if(t.startsWith("<")){const e=document.createElement("div");e.innerHTML=t,n=e.firstChild}else n=document.createElement("div"),n.textContent=t;if(0===i&&n.classList.add("igv-track-menu-border-top"),t.click||t.dialog){const i=i=>{if(i.preventDefault(),i.stopPropagation(),t.click)if(e.track.selected){const n=e.browser.getSelectedTrackViews();if(!0===t.doAllMultiSelectedTracks)t.click.call(e.track,i);else if("removeTrack"===t.menuItemType){const r=()=>{e.browser.overlayTrackButton.setVisibility(!1);for(const{track:e}of n)t.click.call(e,i)},s={html:`Are you sure you want to delete ${n.length} tracks?`,callback:r};e.browser.menuUtils.dialog.present(s,i)}else for(const{track:e}of n)t.click.call(e,i)}else t.click.call(e.track,i);else t.dialog&&t.dialog.call(e.track,i);this.popover.style.display="none"};void 0===n&&console.log("element is undefined"),n.addEventListener("click",i),n.addEventListener("touchend",(e=>i(e))),n.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}return{element:n,init:t.init||void 0}}))}presentTrackContextMenu(e,i){this.popoverContent.innerHTML="";const r=function(e,i){return e.map((e=>{let r;if("string"==typeof e&&"<hr/>"===e)r=document.createElement("hr");else if("string"==typeof e)r=t({class:"context-menu"}),r.innerHTML=e;else if("Node"==typeof e)r=e;else if("function"==typeof e.init&&e.init(),"checkbox"===e.type?r=Ta("Show all bases",e.value):(r=t({class:"context-menu"}),"string"==typeof e.label&&(r.innerHTML=e.label)),e.click&&"color"!==e.type){function s(t){e.click(),n(i),t.preventDefault(),t.stopPropagation()}r.addEventListener("click",s),r.addEventListener("touchend",s),r.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}return{el:r,init:e.init}}))}(i,this.popover);for(let{el:e}of r)this.popoverContent.appendChild(e);!function(e,t){t.style.display="flex";const{x:i,y:n}=a(e,t.parentNode),{width:r}=t.getBoundingClientRect(),s=i+r,{width:o}=t.parentNode.getBoundingClientRect();t.style.left=`${s>o?i-(s-o):i}px`,t.style.top=`${n}px`}(e,this.popover)}hide(){this.popover.style.display="none"}dispose(){this.popoverContent.innerHTML="",this.popover.innerHTML="",Object.keys(this).forEach((function(e){this[e]=void 0}))}}const gd=e=>{const t=e.querySelectorAll(".igv-menu-popup");for(const e of t)e.style.display="none"};class md{constructor(e,i,n,r,s,o,a){this.browser=i,this.button=t({class:"igv-navbar-text-button"}),e.appendChild(this.button),Array.isArray(n)?(this.textContent=n[0],this.title=n[1]):this.textContent=this.title=n,this.buttonLabel=r,this.imageDictionary={image:`url("data:image/svg+xml,${encodeURIComponent(s)}")`,imageHover:`url("data:image/svg+xml,${encodeURIComponent(o)}")`},this.responsiveKey="text",this.configureButton(this.textContent,this.title),this.setState(a),i.on("navbar-resize",(e=>{this.navbarResizeHandler(e)}))}navbarResizeHandler(e){const t="igv-navbar-icon-button"===e?"image":"text";t!==this.responsiveKey&&(this.responsiveKey=t,this.configureButton(this.textContent,this.title),this.setState(void 0))}configureButton(e,t){this.groupElement=void 0,this.button.title=t,this.button.innerHTML="",this.button.style.backgroundImage="none",this.button.classList.remove("igv-navbar-icon-button"),this.button.classList.remove("igv-navbar-text-button"),"text"===this.responsiveKey?this.configureTextButton(e):this.configureIconButton()}configureTextButton(e){this.button.classList.add("igv-navbar-text-button");const t=document.createElement("div");t.innerHTML=this.buttonLabel;const i=t.firstChild;this.button.appendChild(i),this.groupElement=i.querySelector("#igv-navbar-button-group");i.querySelector("#igv-navbar-button-label").textContent=e}configureIconButton(){this.button.classList.add("igv-navbar-icon-button")}setState(e){void 0!==e&&(this.doHover=e),"text"===this.responsiveKey?this.setTextButtonState(this.doHover):this.setIconButtonState(this.doHover)}setTextButtonState(e){this.groupElement.classList.remove(...this.groupElement.classList);const t=!0===e?"igv-navbar-text-button-svg-hover":"igv-navbar-text-button-svg-inactive";this.groupElement.classList.add(t)}setIconButtonState(e){this.button.style.backgroundImage=!0===e?this.imageDictionary.imageHover:this.imageDictionary.image}show(){this.button.style.display="flex"}hide(){this.button.style.display="none"}setVisibility(e){!0===e?this.show():this.hide()}}const wd='<svg width="80px" height="18px" viewBox="0 0 80 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="79" height="17" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>';class bd extends Pa{static defaults={autoscale:void 0,alpha:.5,height:50};constructor(e,t,i){super(e,t),this.type="merged",this.paintAxis=hl,this.graphType=e.graphType,this.tracks=i||[]}async postInit(){if(this.config.tracks){for(let e of this.config.tracks){const t=await this.browser.createTrack(e);t?this.tracks.push(t):console.warn("Could not create track "+e),"function"==typeof t.postInit&&await t.postInit()}this.config.tracks.every((e=>void 0!==e.autoscale||void 0!==e.max))||(this.config.autoscale=void 0===this.config.max)}for(let e of this.tracks)e.isMergedTrack=!0;if(this.config.autoscale?this.autoscale=this.config.autoscale:void 0!==this.config.max&&this.setDataRange({min:this.config.min||0,max:this.config.max}),void 0!==this.config.flipAxis)for(let e of this.tracks)e.flipAxis=this.config.flipAxis;if(void 0!==this.config.logScale)for(let e of this.tracks)e.logScale=this.config.logScale;this.resolutionAware=this.tracks.some((e=>e.resolutionAware))}set flipAxis(e){this.config.flipAxis=e;for(let t of vd(this.tracks))t.flipAxis=e}get flipAxis(){return vd(this.tracks).every((e=>e.flipAxis))}set logScale(e){this.config.logScale=e;for(let t of vd(this.tracks))t.logScale=e}get logScale(){return vd(this.tracks).every((e=>e.logScale))}get height(){return this._height}set height(e){if(this.config.height=e,this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}set autoscale(e){if(this._autoscale=e,!1===e&&this.tracks)for(let e of this.tracks)e.autoscale=!1}get autoscale(){return this._autoscale}set autoscaleGroup(e){if(this.tracks)for(let t of this.tracks)t.autoscaleGroup=e}get autoscaleGroup(){if(this.tracks&&this.tracks.length>0){const e=this.tracks[0].autoscaleGroup;return this.tracks.some((t=>e!==t.autoscaleGroup))?void 0:e}}setDataRange({min:e,max:t}){this.autoscale=!1;for(const i of vd(this.tracks))i.dataRange={min:e,max:t},i.autoscale=!1,i.autoscaleGroup=!1}set dataRange({min:e,max:t}){for(const i of vd(this.tracks))i.dataRange={min:e,max:t}}get dataRange(){if(this.tracks){const e=vd(this.tracks);if(e.length>0){const t=e[0].dataRange;if(e.every((e=>e.dataRange&&e.dataRange.min===t.min&&e.dataRange.max===t.max)))return t}}}menuItemList(){const e=[];return vd(this.tracks).length>0&&(void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e.push(...this.numericDataMenuItems())),e.push("<hr/>"),e.push(this.overlayTrackAlphaAdjustmentMenuItem()),e.push(this.trackSeparationMenuItem()),e}async getFeatures(e,t,i,n){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n))),s=await Promise.all(r);if(s.every((e=>0===e.length)))return new Fd([],[]);{const e=this.tracks.map((e=>e.name));return new Fd(s,e)}}draw(e){const t=e.features;for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t.featureArrays[i],n.alpha=this.alpha,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}}popupData(e){const t=this.clickedFeatures(e);if(t&&t.length===this.tracks.length){const i=[];let n=!0;for(let r=0;r<t.length;r++)if(r>0&&i.push("<hr/>"),i.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${t[r].trackName}</div>`),t[r].features.length>0){n=!1;const s=this.tracks[r].popupData(e,t[r].features);i.push(...s)}else i.push("Missing or 0 value(s)");return!0===n?[]:i}}clickedFeatures(e){const t=e.viewport.cachedFeatures;if(!t||!t.featureArrays||!Array.isArray(t.featureArrays)||0===t.featureArrays.length)return[];const i=e.genomicLocation,n=[],r=e.referenceFrame.bpPerPixel>.2?3*e.referenceFrame.bpPerPixel:.2,s=i-r,o=i+r;for(let e=0;e<t.featureArrays.length;e++){const i=Qn(t.featureArrays[e],s,o);n.push({trackName:t.trackNames[e],features:i})}return n}get supportsWholeGenome(){return this.tracks.every((e=>e.supportsWholeGenome))}getState(){const e=super.getState(),t=[];for(let e of this.tracks)t.push(e.getState());return e.tracks=t,e}updateScales(e){let t;if(this.autoscale){t=!0;let i=[];for(let t of e){if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,r=n+e.toBP(t.getWidth()),s=t.featureCache.features;this.autoscale&&(i.push({value:s.getMax(n,r)}),i.push({value:s.getMin(n,r)}))}const e=Gs(i);for(const t of vd(this.tracks))t.dataRange=e}}else{let i=-1;for(let n of this.tracks)if(++i,n.autoscale){t=!0;let r=[];for(let t of e)if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,s=n+e.toBP(t.getWidth()),o=t.featureCache.features.featureArrays[i];if(o)for(let e of o)if(!(e.end<n)){if(e.start>s)break;r.push(e)}}n.dataRange=Gs(r)}}return t}overlayTrackAlphaAdjustmentMenuItem(){const e=t();return e.innerText="Set transparency",{element:e,dialog:function(e){const t={label:"Transparency",value:this.alpha,min:0,max:1,scaleFactor:1e3,callback:e=>{this.alpha=Math.max(.001,e),this.repaintViews()}};this.browser.sliderDialog.present(t,e)}}}trackSeparationMenuItem(){let e=document.createElement("div");return e.textContent="Separate tracks",{element:e,click:function(e){const t=this.autoscale,i=this.name,n=this.tracks,r=this.browser,s=this.order;r.removeTrack(this);for(let e of n)e.order=s,t&&(e.autoscaleGroup=i),e.isMergedTrack=!1,r.addTrack(e.config,e);r.updateViews()}}}}class Fd{constructor(e,t){this.featureArrays=e,this.trackNames=t}getMax(e,t){let i=-Number.MAX_VALUE;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(!(void 0===r.value||Number.isNaN(r.value)||r.end<e)){if(r.start>t)break;i=Math.max(i,r.value)}return i!==-Number.MAX_VALUE?i:100}getMin(e,t){let i=0;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(void 0!==r.value&&!Number.isNaN(r.value)){if(r.end<e)continue;if(r.start>t)break;i=Math.min(i,r.value)}return i}}const vd=e=>e?e.filter((e=>void 0!==e.dataRange||void 0!==e.autoscale||void 0!==e.autoscaleGroup)):[];class yd extends md{constructor(e,t){super(e,t,"Overlay Tracks",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks">\n <rect id="backdrop" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#737373" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#737373" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#737373" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks Hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks-Hover">\n <rect id="backdrop-copy" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#FFFFFF" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#FFFFFF" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#FFFFFF" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border-copy" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>this.setState(!1)));this.boundMouseClickHandler=(()=>{this.setVisibility(!1),Ad.call(this)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(!0)}}function Ad(e){if(!0===Cd(this.browser)){const e=this.browser.getSelectedTrackViews().map((({track:e})=>e));for(const t of e)t.selected=!1;const t=[];for(let i of e)"merged"===i.type?t.push(...i.tracks):t.push(i);const i={name:"Overlay",type:"merged",autoscale:!1,alpha:.5,height:Math.max(...e.map((({height:e})=>e))),order:Math.min(...e.map((({order:e})=>e)))},n=new bd(i,this.browser,t);for(const t of e){const e=this.browser.trackViews.indexOf(t.trackView);this.browser.trackViews.splice(e,1),t.trackView.dispose()}this.browser.addTrack(i,n),n.trackView.updateViews()}}function Cd(e){const t=e.getSelectedTrackViews();if(t&&t.length>1){const e=new Set(["wig","merged"]);return t.filter((({track:t})=>e.has(t.type))).length>1}return!1}const _d=new Set(["sequence","ruler","ideogram"]),xd=new Set(["ruler","sequence","ideogram"]);class kd{constructor(e,t,i){this.namespace=`trackview-${o()}`,this.browser=e,this.track=i,i.trackView=this,this.addDOMToColumnContainer(e,t,e.referenceFrameList)}startSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].startSpinner()}stopSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].stopSpinner()}addDOMToColumnContainer(e,t,i){this.axis=this.createAxis(e,this.track),this.createViewports(e,t,i),this.sampleInfoViewport=new dd(this,e.columnContainer.querySelector(".igv-sample-info-column"),e.getSampleInfoViewportWidth()),this.sampleNameViewport=new ud(this,e.columnContainer.querySelector(".igv-sample-name-column"),void 0,e.getSampleNameViewportWidth()),this.createTrackScrollbar(e),this.createTrackDragHandle(e),this.createTrackGearPopup(e)}createViewports(e,t,i){this.viewports=[];const n=e.calculateViewportWidth(i.length),r=t.querySelectorAll(".igv-column");for(let e=0;e<r.length;e++){const t=ed(this,r[e],i[e],n);this.viewports.push(t)}}createAxis(e,i){const n=t();if(this.axis=n,e.columnContainer.querySelector(".igv-axis-column").appendChild(n),n.dataset.tracktype=i.type,n.style.height=`${i.height}px`,"function"==typeof i.paintAxis){const{width:e,height:t}=n.getBoundingClientRect();this.axisCanvas=document.createElement("canvas"),this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`,n.appendChild(this.axisCanvas)}if(!1===rr.has(this.track.type)){this.trackSelectionContainer=t(),n.appendChild(this.trackSelectionContainer);const e='<input type="checkbox" name="track-select">',i=document.createRange().createContextualFragment(e).firstChild;this.trackSelectionContainer.appendChild(i),i.checked=this.track.selected||!1,i.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation(),this.track.selected=e.target.checked,this.setDragHandleSelectionState(e.target.checked),this.browser.overlayTrackButton.setVisibility(Cd(this.browser))})),this.enableTrackSelection(!1)}return n}resizeAxisCanvas(e,t){this.axis.style.width=`${e}px`,this.axis.style.height=`${t}px`,"function"==typeof this.track.paintAxis&&(this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`)}renderSVGContext(e,{deltaX:t,deltaY:i}){!function(e,t,i,n,r){if("function"==typeof t.paintAxis){const{y:s,width:a,height:c}=i.getBoundingClientRect(),l=`${(t.name||t.id).replace(/\W/g,"")}_axis_guid_${o()}`;e.saveWithTranslationAndClipRect(l,n,s+r,a,c,0),t.paintAxis(e,a,c),e.restore()}}(e,this.track,this.axisCanvas,t,i);const{width:n}=this.axis.getBoundingClientRect(),{y:r}=this.viewports[0].viewportElement.getBoundingClientRect();let s={deltaX:n+t,deltaY:r+i};for(let t of this.viewports){t.renderSVGContext(e,s);const{width:i}=t.viewportElement.getBoundingClientRect();s.deltaX+=i}if(!0===this.browser.sampleInfo.isInitialized()&&!0===this.browser.sampleInfoControl.showSampleInfo){this.sampleInfoViewport.renderSVGContext(e,s);const{width:t}=this.sampleInfoViewport.viewport.getBoundingClientRect();s.deltaX+=t}!0===this.browser.showSampleNames&&this.sampleNameViewport.renderSVGContext(e,s)}presentColorPicker(e,t){if(!1===xd.has(this.track.type)){let i,n;i="color"===e?this.track._initialColor||this.track.constructor.defaultColor:this.track._initialAltColor||this.track.constructor.defaultColor;const r=this.browser.getSelectedTrackViews();n=r.length>0&&new Set(r).has(this)?{color:e=>{for(const t of r)t.track.color=e,t.repaintViews()},altColor:e=>{for(const t of r)t.track.altColor=e,t.repaintViews()}}:{color:e=>{this.track.color=Un(e),this.repaintViews()},altColor:e=>{this.track.altColor=Un(e),this.repaintViews()}};const s="color"===e?this.track.color||this.track.constructor.defaultColor:this.track.altColor||this.track.constructor.defaultColor;this.browser.genericColorPicker.configure(i,n[e],s),this.browser.genericColorPicker.present(t)}}setTrackHeight(e,t){t||(this.track.minHeight&&(e=Math.max(this.track.minHeight,e)),this.track.maxHeight&&(e=Math.min(this.track.maxHeight,e))),this.track.height=e,this.resizeAxisCanvas(this.axis.clientWidth,this.track.height),"function"==typeof this.track.paintAxis&&this.paintAxis();for(let t of this.viewports)t.setHeight(e);if(this.sampleInfoViewport.setHeight(e),this.sampleNameViewport.viewport.style.height=`${e}px`,"function"!=typeof this.track.computePixelHeight)for(let t of this.viewports)t.setContentHeight(e);this.repaintViews(),this.updateScrollbar(),this.dragHandle.style.height=`${e}px`,this.gearContainer.style.height=`${e}px`}updateScrollbar(){const e=this.viewports[0].viewportElement.clientHeight;if(this.outerScroll.style.height=`${e}px`,!1===_d.has(this.track.type)){const t=this.maxViewportContentHeight(),i=Math.round(e/t*e);t>e?(this.innerScroll.style.display="block",this.innerScroll.style.height=`${i}px`):this.innerScroll.style.display="none"}}moveScroller(e){const t=this.innerScroll.offsetTop+e,i=Math.min(Math.max(0,t),this.outerScroll.clientHeight-this.innerScroll.clientHeight);this.innerScroll.style.top=`${i}px`;const n=this.maxViewportContentHeight(),r=-Math.round(i*(n/this.viewports[0].viewportElement.clientHeight));for(let e of this.viewports)e.setTop(r);this.sampleInfoViewport.setTop(r),this.sampleNameViewport.trackScrollDelta=e,this.sampleNameViewport.setTop(r)}isLoading(){for(let e of this.viewports)if(e.isLoading())return!0}repaintViews(){for(let e of this.viewports)e.isVisible()&&e.repaint();"function"==typeof this.track.paintAxis&&this.paintAxis(),this.repaintSampleInfo(),this.repaintSamples()}repaintSampleInfo(){this.sampleInfoViewport.repaint()}repaintSamples(){if("function"==typeof this.track.getSamples){const e=this.track.getSamples();e.names&&e.names.length>0&&this.sampleNameViewport.repaint(e)}}setTrackLabelName(e){this.viewports.forEach((t=>t.setTrackLabel(e)))}resize(e){for(let t of this.viewports)t.setWidth(e)}async updateViews(){if(!this.browser||!this.browser.referenceFrameList)return;const e=this.viewports.filter((e=>e.isVisible()));if(e.forEach((e=>e.shift())),this.browser.dragObject)return;const t=e.filter((e=>e.needsRepaint())).filter((e=>e.checkZoomIn())),i=e.filter((e=>e.checkZoomIn())).filter((e=>e.needsReload()));for(let e of i)await e.loadFeatures();if(this.disposed)return;if(this.track&&"function"==typeof this.track.variantRowCount&&i.length>0){let e=0;for(let t of this.viewports)t.featureCache&&t.featureCache.features&&(e=Math.max(e,t.featureCache.features.reduce(((e,t)=>Math.max(e,t.row||0)),0)));if(this.track.nVariantRows!==e+1){this.track.variantRowCount(e+1);for(let e of this.viewports)e.checkContentHeight()}}let n;if("merged"===this.track.type)n=this.track.updateScales(e);else if(this.track.autoscale){let t=[];for(let i of e){const e=i.referenceFrame,n=e.start,r=n+e.toBP(i.getWidth());if(i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const e=i.featureCache.features.getMax(n,r);if(t.push({value:e}),"function"==typeof i.featureCache.features.getMin){const e=i.featureCache.features.getMin(n,r);t.push({value:e})}}else{const e=Qn(i.featureCache.features,n,r);for(let i of e)t.push(i)}}"function"==typeof this.track.doAutoscale?this.track.dataRange=this.track.doAutoscale(t):this.track.dataRange=Gs(t)}const r=this.track.autoscale||this.track.autoscaleGroup||"ruler"===this.track.type||n||this.track.groupBy;for(let i of e)t.includes(i)?i.repaint():r&&i.refresh();this.adjustTrackHeight(),this.repaintSampleInfo(),this.repaintSamples(),this.updateRulerViewportLabels()}clearCachedFeatures(){for(let e of this.viewports)e.clearCache()}updateRulerViewportLabels(){const e=this.browser.calculateViewportWidth(this.viewports.length);for(let t of this.viewports)"ruler"===this.track.type&&(this.viewports.length>1?t.presentLocusLabel(e):t.dismissLocusLabel())}async getInViewFeatures(){if(!this.browser||!this.browser.referenceFrameList)return[];let e=[];const t=this.viewports.filter((e=>e.isVisible()));for(let i of t){const t=i.referenceFrame,{chr:n,start:r,bpPerPixel:s}=i.referenceFrame,o=r+t.toBP(i.getWidth());if((!i.featureCache||!i.featureCache.containsRange(n,r,o,s))&&await i.loadFeatures(),i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const t=i.featureCache.features.getMax(r,o);e.push({value:t})}else{const t="function"==typeof i.featureCache.queryFeatures?i.featureCache.queryFeatures(n,r,o):Qn(i.featureCache.features,r,o);e=e.concat(t)}}return e}checkContentHeight(){for(let e of this.viewports)e.checkContentHeight();this.adjustTrackHeight()}adjustTrackHeight(){var e=this.maxViewportContentHeight();if(this.track.autoHeight?this.setTrackHeight(e,!1):this.track.paintAxis&&this.paintAxis(),!1===_d.has(this.track.type)){const t=this.viewports[0].getContentTop(),i=this.viewports[0].viewportElement.clientHeight,n=Math.min(0,i-e);if(t<n)for(let e of this.viewports)e.setTop(n);this.updateScrollbar()}}createTrackScrollbar(e){const i=t();if(e.columnContainer.querySelector(".igv-scrollbar-column").appendChild(i),i.style.height=`${this.track.height}px`,this.outerScroll=i,!1===_d.has(this.track.type)){const n=t();i.appendChild(n),this.innerScroll=n,this.addTrackScrollMouseHandlers(e)}}createTrackDragHandle(e){"sequence"!==this.track.type&&!0===rr.has(this.track.type)?this.dragHandle=t({class:"igv-track-drag-shim"}):(this.dragHandle=t({class:"igv-track-drag-handle"}),this.dragHandle.classList.add("igv-track-drag-handle-color")),e.columnContainer.querySelector(".igv-track-drag-column").appendChild(this.dragHandle),this.dragHandle.style.height=`${this.track.height}px`,this.addTrackDragMouseHandlers(e)}createTrackGearPopup(e){if(this.gearContainer=t(),e.columnContainer.querySelector(".igv-gear-menu-column").appendChild(this.gearContainer),this.gearContainer.style.height=`${this.track.height}px`,!0===this.track.ignoreTrackMenu);else{function i(t){if(t.preventDefault(),t.stopPropagation(),"none"===this.trackGearPopup.popover.style.display){for(const t of e.trackViews.filter((e=>e!==this&&void 0!==e.trackGearPopup)))t.trackGearPopup.popover.style.display="none";this.trackGearPopup.presentMenuList(this,e.menuUtils.trackMenuItemList(this))}else this.trackGearPopup.popover.style.display="none"}this.gear=t(),this.gearContainer.appendChild(this.gear),this.gear.appendChild(l("cog")),this.trackGearPopup=new pd(this.gear),this.boundTrackGearClickHandler=i.bind(this),this.gear.addEventListener("click",this.boundTrackGearClickHandler)}}addTrackScrollMouseHandlers(e){this.boundTrackScrollMouseDownHandler=function(t){t.stopPropagation();const{y:i}=s(t);this.innerScroll.dataset.yDown=i.toString(),this.boundColumnContainerMouseMoveHandler=function(e){e.stopPropagation();const{y:t}=s(e);this.moveScroller(t-parseInt(this.innerScroll.dataset.yDown)),this.innerScroll.dataset.yDown=t.toString()}.bind(this),e.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),this.innerScroll.addEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.boundColumnContainerMouseUpHandler=function(t){e.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),e.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),e.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseUpHandler)}removeTrackScrollMouseHandlers(){!1===_d.has(this.track.type)&&(this.innerScroll.removeEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.browser.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.browser.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.browser.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseMoveHandler))}addTrackDragMouseHandlers(e){if("sequence"===this.track.type||!1===rr.has(this.track.type)){let t;function i(i){i.preventDefault(),t=i.target,!1!==this.track.selected&&"sequence"!==this.track.type||(t.classList.remove("igv-track-drag-handle-color"),t.classList.add("igv-track-drag-handle-hover-color")),e.startTrackDrag(this)}function n(i){e.endTrackDrag(),t&&i.target!==t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-color"))),t=void 0}function r(i){i.preventDefault(),void 0===t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(i.target.classList.remove("igv-track-drag-handle-color"),i.target.classList.add("igv-track-drag-handle-hover-color"))),e.updateTrackDrag(this)}function s(e){e.preventDefault(),void 0===t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color")))}this.boundTrackDragMouseDownHandler=i.bind(this),this.dragHandle.addEventListener("mousedown",this.boundTrackDragMouseDownHandler),this.boundDocumentTrackDragMouseUpHandler=n.bind(this),document.addEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.boundTrackDragMouseEnterHandler=r.bind(this),this.dragHandle.addEventListener("mouseenter",this.boundTrackDragMouseEnterHandler),this.dragHandle.addEventListener("mouseout",(e=>{e.preventDefault(),void 0===t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color")))})),this.boundTrackDragMouseOutHandler=s.bind(this),this.dragHandle.addEventListener("mouseout",this.boundTrackDragMouseOutHandler)}}removeTrackDragMouseHandlers(){"ideogram"===this.track.type||"ruler"===this.track.type||(this.dragHandle.removeEventListener("mousedown",this.boundTrackDragMouseDownHandler),document.removeEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.dragHandle.removeEventListener("mouseup",this.boundTrackDragMouseEnterHandler),this.dragHandle.removeEventListener("mouseout",this.boundTrackDragMouseOutHandler))}removeTrackGearMouseHandlers(){!0===this.track.ignoreTrackMenu||this.gear.removeEventListener("click",this.boundTrackGearClickHandler)}removeDOMFromColumnContainer(){this.axis.remove(),this.removeViewportsFromColumnContainer(),this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove()}removeViewportsFromColumnContainer(){for(let e of this.viewports)e.viewportElement.remove()}dispose(){this.axis.remove();for(let e of this.viewports)e.dispose();this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove(),"function"==typeof this.track.dispose&&this.track.dispose();for(let e of Object.keys(this))this[e]=void 0;this.alert&&this.alert.container.remove(),this.disposed=!0}paintAxis(){if("function"==typeof this.track.paintAxis){const{width:e,height:t}=this.axisCanvas.getBoundingClientRect(),i=window.devicePixelRatio||1;this.axisCanvas.height=i*t,this.axisCanvas.width=i*e;const n=this.axisCanvas.getContext("2d");if(n.scale(i,i),this.track.autoscaleGroup){if(void 0===sr[this.track.autoscaleGroup]){const e=$n.Dark2,t=Math.floor(Math.random()*$n.Dark2.length);sr[this.track.autoscaleGroup]=e[t]}const i=un.addAlpha(sr[this.track.autoscaleGroup],.75);this.track.paintAxis(n,e,t,i)}else this.track.paintAxis(n,e,t,void 0)}}maxViewportContentHeight(){return Math.max(...this.viewports.map((e=>e.getContentHeight())))}enableTrackSelection(e){const t=this.trackSelectionContainer;if(t&&!rr.has(this.track.type))if(!1!==e)t.style.display="grid";else{this.track.selected=!1;t.querySelector("[name=track-select]").checked=this.track.selected,this.dragHandle&&this.setDragHandleSelectionState(!1),t.style.display="none"}}setDragHandleSelectionState(e){const t=this.dragHandle;e?(t.classList.remove("igv-track-drag-handle-color"),t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-selected-color")):(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.remove("igv-track-drag-handle-selected-color"),t.classList.add("igv-track-drag-handle-color"))}}const Id={threshold:2e3,r:0,g:0,b:255};class Sd{constructor(e){e=e||Id,this.threshold=e.threshold,this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[],this.nbins=2e3,this.binsize=this.threshold/this.nbins}setThreshold(e){this.threshold=e,this.cache=[],this.binsize=this.threshold/this.nbins}getThreshold(){return this.threshold}setColorComponents(e){this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[]}getColorComponents(){return{r:this.r,g:this.g,b:this.b}}equals(e){return JSON.stringify(this)===JSON.stringify(e)}getColor(e){const t=Math.floor(Math.min(this.threshold,e)/this.binsize);if(void 0===this.cache[t]){const i=(cn(e,0,this.threshold)-0)/(this.threshold-0);this.cache[t]=`rgba(${this.r},${this.g},${this.b}, ${i})`}return this.cache[t]}stringify(){return this.threshold+","+this.r+","+this.g+","+this.b}static parse(e){var t,i;return e.startsWith("R:")?(t=e.substring(2).split(":"),(i=new RatioColorScale(Number.parseFloat(t[0]))).positiveScale=n(t[1]),i.negativeScale=n(t[2]),i):n(e);function n(e){var t,i;return t={threshold:(i=e.split(","))[0],r:i[1],g:i[2],b:i[3]},new Sd(t)}}}class Ed{constructor(e){this.config=e,this.url=e.path||e.url}async read(e,t){const i={start:e,size:t};return Mn.loadArrayBuffer(this.url,{range:i})}}class Nd{constructor(e){this.file=e}async read(e,t){const i=this.file;return void 0!==e?i.slice(e,e+t).arrayBuffer():i.arrayBuffer()}}class Md{constructor(e,t){this.file=e,this.rateLimiter=t}async read(e,t){const i=this.file,n=this.rateLimiter;return new Promise((function(r,s){n.limiter((async function(i){try{const n=await i.read(e,t);r(n)}catch(e){s(e)}}))(i)}))}}class Rd{constructor(e){this.file=e.file,this.size=e.size||64e3,this.position=0,this.bufferStart=0,this.bufferLength=0,this.buffer=void 0}async read(e,t){const i=e,n=e+t,r=this.bufferStart,s=this.bufferStart+this.bufferLength;if(t>this.size)return this.buffer=void 0,this.bufferStart=0,this.bufferLength=0,this.file.read(e,t);if(i>=r&&n<=s){const e=i-r,n=e+t;return this.buffer.slice(e,n)}if(i<r&&n>r){const n=r-i,s=await this.file.read(e,n),o=t-n;if(o>0){const e=this.buffer.slice(0,o);return Bd(s,e)}return s}if(!(i<s&&n>s))return this.buffer=await this.file.read(e,this.size),this.bufferStart=e,this.bufferLength=this.buffer.byteLength,this.buffer.slice(0,t);{const e=s-i,n=this.bufferLength-e,r=this.buffer.slice(n,this.bufferLength),o=t-e;if(!(o>0))return r;try{this.buffer=await this.file.read(s,this.size),this.bufferStart=s,this.bufferLength=this.buffer.byteLength;const e=this.buffer.slice(0,o);return Bd(r,e)}catch(e){if(e.code&&416===e.code)return r;throw e}}}}var Bd=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer};const Dd=function(e,t){this.littleEndian=void 0===t||t,this.position=0,this.view=e,this.length=e.byteLength};function Td(e,t){this.block=e,this.offset=t}Dd.prototype.available=function(){return this.length-this.position},Dd.prototype.remLength=function(){return this.length-this.position},Dd.prototype.hasNext=function(){return this.position<this.length-1},Dd.prototype.getByte=function(){var e=this.view.getUint8(this.position,this.littleEndian);return this.position++,e},Dd.prototype.getShort=function(){var e=this.view.getInt16(this.position,this.littleEndian);return this.position+=2,e},Dd.prototype.getUShort=function(){var e=this.view.getUint16(this.position,this.littleEndian);return this.position+=2,e},Dd.prototype.getInt=function(){var e=this.view.getInt32(this.position,this.littleEndian);return this.position+=4,e},Dd.prototype.getUInt=function(){var e=this.view.getUint32(this.position,this.littleEndian);return this.position+=4,e},Dd.prototype.getLong=function(){var e=[];e[0]=this.view.getUint8(this.position),e[1]=this.view.getUint8(this.position+1),e[2]=this.view.getUint8(this.position+2),e[3]=this.view.getUint8(this.position+3),e[4]=this.view.getUint8(this.position+4),e[5]=this.view.getUint8(this.position+5),e[6]=this.view.getUint8(this.position+6),e[7]=this.view.getUint8(this.position+7);var t=0;if(this.littleEndian)for(var i=e.length-1;i>=0;i--)t=256*t+e[i];else for(i=0;i<e.length;i++)t=256*t+e[i];return this.position+=8,t},Dd.prototype.getString=function(e){for(var t,i="";0!=(t=this.view.getUint8(this.position++))&&(i+=String.fromCharCode(t),!e||i.length!=e););return i},Dd.prototype.getFixedLengthString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>0&&(n+=String.fromCharCode(i));return n},Dd.prototype.getFixedLengthTrimmedString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>32&&(n+=String.fromCharCode(i));return n},Dd.prototype.getFloat=function(){var e=this.view.getFloat32(this.position,this.littleEndian);return this.position+=4,e},Dd.prototype.getDouble=function(){var e=this.view.getFloat64(this.position,this.littleEndian);return this.position+=8,e},Dd.prototype.skip=function(e){return this.position+=e,this.position},Dd.prototype.getVPointer=function(){var e=this.position,t=this.view.getUint8(e+1)<<8|this.view.getUint8(e),i=4294967296*(255&this.view.getUint8(e+6))+16777216*(255&this.view.getUint8(e+5))+65536*(255&this.view.getUint8(e+4))+256*(255&this.view.getUint8(e+3))+(255&this.view.getUint8(e+2));return this.position+=8,new Td(i,t)},Td.prototype.isLessThan=function(e){return this.block<e.block||this.block===e.block&&this.offset<e.offset},Td.prototype.isGreaterThan=function(e){return this.block>e.block||this.block===e.block&&this.offset>e.offset},Td.prototype.print=function(){return this.block+":"+this.offset};class zd{constructor(e,t){this.chr1=e,this.chr2=t}getKey(){return this.chr1.name+"_"+this.chr2.name+"_"+this.zoom.unit+"_"+this.zoom.binSize}getBlockNumbers(e,t,i){if(e.chr==this.chr2&&t.chr===this.chr1){const i=e;e=t,t=i}const n=this.chr1===this.chr2,r=this.zoom.binSize,s=this.blockBinCount,o=this.blockColumnCount;return i<9||!n?function(){const i=e.start/r,a=e.end/r,c=t.start/r,l=t.end/r,h=Math.floor(i/s),d=Math.floor((a-1)/s),u=Math.floor(c/s),f=Math.floor((l-1)/s),p=[];for(let e=u;e<=f;e++)for(let t=h;t<=d;t++){let i;i=n&&e<t?t*o+e:e*o+t,p.includes(i)||p.push(i)}return p}():function(){const i=e.start/r,n=e.end/r,a=t.start/r,c=t.end/r,l=Math.floor((i+a)/2/s),h=Math.floor((n+c)/2/s),d=Math.floor(Math.log2(1+Math.abs(i-c)/Math.sqrt(2)/s)),u=Math.floor(Math.log2(1+Math.abs(n-a)/Math.sqrt(2)/s)),f=(n-a)*(i-c)<0?0:Math.min(d,u),p=Math.max(d,u),g=[];for(let e=f;e<=p;e++)for(let t=l;t<=h;t++){const i=e*o+t;g.push(i)}return g}()}static parseMatrixZoomData(e,t,i){const n=new zd(e,t),r=i.getString(),s=i.getInt(),o=i.getFloat(),a=i.getFloat(),c=i.getFloat(),l=i.getFloat(),h=i.getInt();n.blockBinCount=i.getInt(),n.blockColumnCount=i.getInt();const d=i.getInt();n.zoom={index:s,unit:r,binSize:h},n.blockIndex=new Ld(d,i);const u=o/(e.size/h)/(t.size/h);return n.averageCount=u,n.sumCounts=o,n.stdDev=c,n.occupiedCellCount=a,n.percent95=l,n}}class Ld{constructor(e,t){for(this.blockIndex={};e-- >0;){const e=t.getInt(),i=t.getLong(),n=t.getInt();this.blockIndex[e]={filePosition:i,size:n}}}getBlockIndexEntry(e){return this.blockIndex[e]}}class Hd{constructor(e,t,i){this.chr1=e,this.chr2=t,this.bpZoomData=[],this.fragZoomData=[];for(let e of i)"BP"===e.zoom.unit?this.bpZoomData.push(e):this.fragZoomData.push(e)}findZoomForResolution(e,t){const i="FRAG"===t?this.fragZoomData:this.bpZoomData;for(let t=1;t<i.length;t++){if(i[t].zoom.binSize<e)return t-1}return i.length-1}getZoomData(e,t){const i="BP"===(t=t||"BP")?this.bpZoomData:this.fragZoomData;for(let t=0;t<i.length;t++){var n=i[t];if(e===n.zoom.binSize)return n}}getZoomDataByIndex(e,t){return("FRAG"===t?this.fragZoomData:this.bpZoomData)[e]}static getKey(e,t){if(e>t){const i=e;e=t,t=i}return`${e}_${t}`}static parseMatrix(e,t){const i=new Dd(new DataView(e)),n=i.getInt(),r=i.getInt(),s=t[n],o=t[r];let a=i.getInt();const c=[];for(;a-- >0;){const e=zd.parseMatrixZoomData(s,o,i);c.push(e)}return new Hd(n,r,c)}}class Pd{constructor(e,t,i){this.bin1=e,this.bin2=t,this.counts=i}getKey(){return this.bin1+"_"+this.bin2}}class Od{constructor(e=10){this.max=e,this.map=new Map}get(e){let t=this.map.get(e);return t&&(this.map.delete(e),this.map.set(e,t)),t}set(e,t){this.map.has(e)?this.map.delete(e):this.map.size===this.max&&this.map.delete(this.first()),this.map.set(e,t)}has(e){return this.map.has(e)}clear(){this.map.clear()}first(){return this.map.keys().next().value}}class Vd{constructor(e,t,i,n){this.file=e,this.filePosition=t,this.nValues=i,this.dataType=n,this.cache=void 0}async getValues(e,t){if(!this.cache||e<this.cache.start||t>this.cache.end){const i=Math.max(0,e-1e3),n=Math.min(this.nValues,t+1e3),r=this.filePosition+i*this.dataType,s=n-i,o=s*this.dataType,a=await this.file.read(r,o);if(!a)return;const c=new Dd(new DataView(a)),l=[];for(let e=0;e<s;e++)l[e]=8===this.dataType?c.getDouble():c.getFloat();this.cache={start:i,end:n,values:l}}const i=e-this.cache.start,n=i+(t-e);return this.cache.values.slice(i,n)}getKey(){return Vd.getKey(this.type,this.chrIdx,this.unit,this.resolution)}static getNormalizationVectorKey(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}}var qd={"hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined.hic":"54386046426,55860","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fprimary.hic":"33860030033,37504","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Freplicate.hic":"30849652794,55832","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fmaternal.hic":"1380542661,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fpaternal.hic":"1389001777,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2Fcombined.hic":"13433880319,35723","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC001.hic":"3409347253,35975","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC002.hic":"4529947083,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC003.hic":"6894962500,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC004.hic":"3395593338,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC005.hic":"5204128636,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC006.hic":"3278363811,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC007.hic":"3585547340,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC008.hic":"4134197273,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC009.hic":"2851728310,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC010.hic":"1754216102,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC011.hic":"1716829574,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC012.hic":"4367980375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC013.hic":"2309654671,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC014.hic":"5324950266,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC015.hic":"3132333594,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC016.hic":"3159154704,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC017.hic":"3262554627,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC018.hic":"3014216364,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC019.hic":"5025753246,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC020.hic":"5861584507,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC021.hic":"3542263275,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC022.hic":"5061949378,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC023.hic":"4816423919,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC024.hic":"2683781104,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC025.hic":"6522701781,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC026.hic":"6748846520,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC027.hic":"5642693007,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC028.hic":"2098921691,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC029.hic":"3886454027,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC030.hic":"2288984204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC031.hic":"2115342419,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fpellet%2FHIC032.hic":"2063314324,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fsupernatant%2FHIC033.hic":"1933908457,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC034.hic":"13555514595,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC035.hic":"6129650900,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC036.hic":"4307445019,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC037.hic":"9375139867,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2Fcombined.hic":"11664249584,33929","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_DpnII.hic":"7003537290,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC038.hic":"2099825544,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC039.hic":"2096900138,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC040.hic":"2593642141,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC041.hic":"2263919098,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC042.hic":"2684774693,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_noXlink.hic":"5574807456,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC043.hic":"2986114347,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC044.hic":"1916378621,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC045.hic":"746463126,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC046.hic":"2338476164,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC047.hic":"1167496250,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC048.hic":"2231690794,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC049.hic":"2782308678,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC050.hic":"3633531346,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC051.hic":"4063486444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC052.hic":"929756278,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC053.hic":"2489657204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC054.hic":"4036419444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC055.hic":"4284185549,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC056.hic":"4410546240,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fdilution%2FHIC057.hic":"1491998259,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2Fcombined.hic":"7266425111,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC058.hic":"6532635593,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC059.hic":"400684530,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC060.hic":"645352187,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC061.hic":"736291871,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC062.hic":"762731037,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC063.hic":"682917431,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fdilution%2FHIC064.hic":"4550171307,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2Fcombined.hic":"11897184911,35789","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC065.hic":"5425943567,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC066.hic":"5942869818,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC067.hic":"5191049261,35647","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fdilution%2FHIC068.hic":"2713318801,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2Fcombined.hic":"12641555389,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC069.hic":"5630177461,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC070.hic":"5926611269,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC071.hic":"2486191351,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC072.hic":"2281343366,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC073.hic":"2173074239,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC074.hic":"2463700999,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2Fcombined.hic":"14661922519,35639","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC075.hic":"3685310515,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC076.hic":"5833658487,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC077.hic":"2406346486,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC078.hic":"5241454987,35919","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC079.hic":"6297234263,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2Fcombined.hic":"9193858096,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC080.hic":"5171405536,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC081.hic":"3489767688,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC082.hic":"4243339375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fdilution%2FHIC083.hic":"1497495406,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2Fcombined.hic":"7923332224,35593","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC084.hic":"867699123,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC085.hic":"3669518514,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC086.hic":"5306474712,35595","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC087.hic":"1490963755,36397","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2Fcombined.hic":"8956382853,50248","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC088.hic":"1874185366,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC089.hic":"1301165236,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC090.hic":"1105246282,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC091.hic":"1338325770,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC092.hic":"1307918730,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC093.hic":"755136918,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC094.hic":"1606583694,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC095.hic":"2039711245,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC096.hic":"1909573053,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC097.hic":"1826710712,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC098.hic":"1998793575,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC099.hic":"1007740962,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC100.hic":"736464120,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC101.hic":"980505082,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC102.hic":"1116083646,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC103.hic":"1096994310,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC104.hic":"841063882,32102","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC105.hic":"107742864,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC106.hic":"134295912,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC107.hic":"110228014,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC108.hic":"102761401,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC109.hic":"100461491,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC110.hic":"88828472,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC111.hic":"81471064,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC112.hic":"92297035,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC113.hic":"65503916,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC114.hic":"49181188,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC115.hic":"46471102,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC116.hic":"64284432,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC117.hic":"60434076,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC118.hic":"45248563,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC119.hic":"60288782,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC120.hic":"136888414,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC121.hic":"125009003,33681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC122.hic":"154011688,34127","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC123.hic":"177663372,35293","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC124.hic":"382186226,35245","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC125.hic":"158160717,35271","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC127.hic":"110261177,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC128.hic":"246131875,35509","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC129.hic":"260160119,35667","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC130.hic":"117479562,34681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC131.hic":"81508929,34673","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC132.hic":"105959102,34895","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC133.hic":"91504812,33451","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC134.hic":"52222546,33737","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC135.hic":"57763085,34159","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC136.hic":"50618489,33731","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC137.hic":"193163606,33363","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC138.hic":"229876152,33777","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC139.hic":"201783666,33571","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC140.hic":"281163862,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC141.hic":"275969727,33935","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC142.hic":"275020431,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC144.hic":"223834810,34177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC145.hic":"296632653,33937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC146.hic":"290945216,33961","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC147.hic":"234459964,34231","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC148.hic":"295457850,34039","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC149.hic":"113569632,35695","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC150.hic":"304381897,33963","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC151.hic":"289314545,33805","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC152.hic":"284320182,33803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC153.hic":"401393947,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC154.hic":"188065488,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC155.hic":"299157119,33967","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC156.hic":"279289244,33787","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC157.hic":"254852119,33917","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC158.hic":"195969660,33477","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC159.hic":"185720388,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC160.hic":"227709279,33599","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC161.hic":"157225076,33209","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC162.hic":"105703444,32033","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC163.hic":"122665658,32121","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC164.hic":"228048231,33761","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC165.hic":"114440819,32011","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC166.hic":"285147558,33891","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC167.hic":"363116754,33943","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC168.hic":"119592158,31937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC169.hic":"236853872,33785","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC170.hic":"195187639,33395","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC171.hic":"208044058,33309","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC172.hic":"144645916,32877","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC173.hic":"119115941,32203","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC175.hic":"178030481,33525","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC176.hic":"117220136,32169","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC177.hic":"128586196,32659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC178.hic":"191419141,33629","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC179.hic":"141556748,32959","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC180.hic":"199825102,33185","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC181.hic":"301022688,33783","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC182.hic":"185384453,33205","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC183.hic":"202189264,36367","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC184.hic":"37464475,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC185.hic":"161938278,36099","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC186.hic":"133853166,36179","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC188.hic":"128068030,36237","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC189.hic":"148053886,36177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC190.hic":"198946958,35803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC191.hic":"226584564,36063","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC192.hic":"194412797,36341","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC193.hic":"176408194,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC194.hic":"207215649,36055","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC195.hic":"175185530,36315","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC196.hic":"168969337,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC197.hic":"121231252,36339","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC198.hic":"92713752,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC199.hic":"105130500,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC200.hic":"114526350,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC201.hic":"122689717,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhap1%2Fin-situ%2Fcombined.hic":"9614983328,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fctbp_8_4_17%2Fall_intra_megabase_michrom.hic":"154205644,10960","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xa-combined.hic":"8843305329,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXa-chrX-diploid.hic":"11173520,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-combined.hic":"13365182403,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-chrX-diploid.hic":"17343459,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC002.hic":"4279298739,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC003.hic":"3027365532,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC004.hic":"2896130835,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC005.hic":"4717830071,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC006.hic":"5066210154,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC007.hic":"3069516128,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xi-combined.hic":"14551096423,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXi-chrX-diploid.hic":"17362477,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC008.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC009.hic":"2935931663,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC010.hic":"2019085070,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC011.hic":"6087610814,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC012.hic":"2809618194,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC013.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fcombined.hic":"6950423609,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fpaternal.hic":"220592749,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fmaternal.hic":"323233095,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC014.hic":"3183235800,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC015.hic":"1739539801,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC016.hic":"1105912758,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC017.hic":"1060773319,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC018.hic":"1203679874,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC019.hic":"3321955269,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Frhesus%2FDarrowHuntley-2015%2FHIC020.hic":"7108980626,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fcola%2FDarrowHuntley-2015%2FHIC021.hic":"3906448676,34955","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Faedes%2Fcombined.hic":"390780490,2245","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Fhs2-hic.hic":"1960284186,33561","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2FCpipJ3.hic":"766279097,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2Fupdated_O%2FSnyder_O.hic":"8046980555,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2FA_inter.hic":"10986005145,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2Fcombined.hic":"30439217680,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2Fcombined.hic":"33255540403,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F20min_withdraw_combined.hic":"11078436933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F40min_withdraw_combined.hic":"11031830038,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F60min_withdraw_combined.hic":"10312725340,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F180min_withdraw_combined.hic":"10038610214,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC001.hic":"8004335785,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC002.hic":"8453215933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC003.hic":"9118406189,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC004.hic":"5973342894,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC005.hic":"6846576837,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC006.hic":"6075148017,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC007.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC008.hic":"6844159653,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC009.hic":"7282063059,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC010.hic":"10410578833,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC011.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC012.hic":"7223422850,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC013.hic":"7435986997,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC014.hic":"9120113605,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2Fcombined.hic":"4170577904,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC015.hic":"1504084990,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC016.hic":"1686244500,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC017.hic":"1804802410,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC018.hic":"1533942067,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2Fcombined.hic":"4572390198,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC019.hic":"1543609666,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC020.hic":"1814133288,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC021.hic":"1942698243,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC022.hic":"1873587413,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC049.hic":"405127557,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC060.hic":"326681741,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC061.hic":"300908673,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC050.hic":"481758242,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC051.hic":"417577401,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC052.hic":"419353227,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC053.hic":"411554953,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC054.hic":"386655891,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC055.hic":"402170701,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_240min%2FRao-2017-HIC057.hic":"735906308,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC058.hic":"443789827,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC059.hic":"491422615,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC062.hic":"320261375,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC063.hic":"306590499,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC032S.hic":"367051742,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC033S.hic":"344555339,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC036S.hic":"349392947,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC037S.hic":"317714554,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC040S.hic":"266786397,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC041S.hic":"279445530,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC044S.hic":"898418269,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC045S.hic":"961006347,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC064.hic":"833576408,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC065.hic":"840881418,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC066.hic":"980958864,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC067.hic":"882023129,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC068.hic":"1110292630,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC069.hic":"1001747023,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FCP190_HiChIP.hic":"144107588,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27ac_HiChIP_combined.hic":"43171370,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27me3_HiChIP_combined.hic":"42906472,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2_ChIAPET.hic":"41992430,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2S2_HiChIP.hic":"145842743,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FArabidopsis_Wang2015_Liu2016.hic":"1134391078,4984","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FElegans_Crane2015.hic":"387127568,8758","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FNcrassa_Galazka2016.hic":"26555511,27725","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPfalciparum_trophozoite_Ay2014.hic":"15640893,13948","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-A.hic":"6897251,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-B.hic":"4959088,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-A.hic":"5232286,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-B.hic":"5105292,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-A.hic":"6900072,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-B.hic":"8653258,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-A.hic":"7999058,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-B.hic":"8774657,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc.hic":"23671753603,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep1.hic":"23671754721,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep2.hic":"22269909910,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fhffc6_rep1.hic":"19016661622,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_NcoI.hic":"480725203,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2F302NH.hic":"99948617,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FK562.hic":"470263605,36151","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_HindIII.hic":"293706559,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_rep_HindIII.hic":"309673862,36087","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep1.hic":"1531151371,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep2.hic":"2851437676,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmouse-rep1.hic":"582052544,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep1.hic":"698509182,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep2.hic":"461410393,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep1.hic":"691045338,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep2.hic":"668888336,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Fsexton%2Fcombined.hic":"50650087,4486","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-hindiii.hic":"1071142023,16500","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-mboi.hic":"1508851093,16448","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Fnon-tcc-hindiii.hic":"395179229,36093","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-combined.hic":"1050423847,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-hindiii%2Fsplit-read-run.hic":"9599984876,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fhesc-hindiii.hic":"1952555632,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fimr90-hindiii.hic":"9691260435,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-cortex.hic":"3712072953,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr18.hic":"2083350075,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr2.hic":"3362049644,16360","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr7.hic":"1658399854,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr15.hic":"866691249,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr2.hic":"3304782795,16386","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-1.hic":"23673506,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-2.hic":"26873280,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-3.hic":"31066362,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-4.hic":"16807724,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-5.hic":"28665065,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-6.hic":"13124158,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-7.hic":"15118945,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-8.hic":"68316814,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-9.hic":"18965101,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-10.hic":"17020666,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Fcombined.hic":"6526601242,36427","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep1.hic":"1861562891,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep2.hic":"3061013635,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep3.hic":"1564588211,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep4.hic":"1255543175,36153","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep5.hic":"974683253,36179","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep6.hic":"1040805629,36053","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Fcombined.hic":"8424080116,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep1.hic":"2697976702,36295","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep3.hic":"1718610467,36159","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep4.hic":"2029519405,36101","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep5.hic":"985310855,36069","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep6.hic":"1418750480,35967","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fmhh-call-4-cell-line.hic":"538380253,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fprimary-b-all.hic":"773764191,35793","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fnormal-b-cell-line.hic":"336271459,35005","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Frl-cell-line.hic":"484807998,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-biorep.hic":"135932435,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep1.hic":"160355961,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep2.hic":"188809887,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fpre-prob-egs.hic":"2237792858,15483","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-egs.hic":"5744720377,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-fa.hic":"2174866215,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhct116-rnapii-pilot.hic":"396366166,35999","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhela-rnapii-pilot.hic":"882516759,35107","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-pilot.hic":"1131576189,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-saturated.hic":"571583828,36291","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fmcf7-rnapii-saturated.hic":"1282547841,36035","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fnb4-rnapii-pilot.hic":"761614686,34861","hicfiles.s3.amazonaws.com%2Fexternal%2Fjung%2Fmouse_sperm.hic":"1730231642,29184","hicfiles.s3.amazonaws.com%2Fexternal%2Ftang%2Fgm12878.hic":"1953518212,20505","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791299.hic":"5723484,11956","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791297.hic":"16534743,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv.hic":"5094525579,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep1.hic":"2574358912,36373","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep2.hic":"3417099433,36243","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev.hic":"4785157552,36323","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep1.hic":"2648268465,36321","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep2.hic":"2994727980,36107","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf.hic":"5391791815,36063","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep1.hic":"3325842095,36269","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep2.hic":"3096215920,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl.hic":"3830902383,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl-rep1.hic":"1346712252,36079","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl_rep2.hic":"3098067367,36271","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-0h-hiseq.hic":"38174042,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq.hic":"26506099,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq-non-crosslinked_control.hic":"3545496,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-36h-hiseq.hic":"70754194,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fg1mid-r1.hic":"200863476,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r1.hic":"249021190,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r2.hic":"212341157,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-0-25fa.hic":"583572265,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-1fa.hic":"354502306,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-0-25fa.hic":"149308791,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-98percent.hic":"778175225,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-1fa.hic":"158091047,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-ns-r1.hic":"801670039,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-m-r1.hic":"875922086,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r1.hic":"130959943,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r2.hic":"237861106,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT.hic":"496104039,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT-adv-cre.hic":"438608517,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep1.hic":"446205712,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep2.hic":"386354767,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep1.hic":"621998722,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep2.hic":"583840829,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep1.hic":"801290988,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep2.hic":"819406658,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep1.hic":"792825269,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep2.hic":"746189884,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT.hic":"309353372,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT-OHT.hic":"274229679,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R1.hic":"1490362251,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R3.hic":"2403664421,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R1.hic":"1377124538,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R3.hic":"2646201369,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2Fcrh6-mutant.hic":"105261071,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2FWT.hic":"127506388,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2FCol.hic":"153638500,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn1.hic":"211213220,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn4.hic":"134236837,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fxie%2Fprimary.hic":"92936173,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt337.hic":"318737891,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt67.hic":"348123956,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt337.hic":"251107279,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt67.hic":"351840994,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2FCol0.hic":"345969497,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fclf28-swn7.hic":"299585025,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fcmt3-11.hic":"253427706,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fddm1-2.hic":"303626924,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fmet1-3.hic":"347697973,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fsuvh4-suvh5-suvh6.hic":"263122019,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNase-HiC-WG-K562.hic":"892955840,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNaseHiC-WG-H1.hic":"696922695,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-K562-rep1.hic":"341917716,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargeredDNaseHiC-lincRNA-K562-rep2.hic":"214841185,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep1.hic":"616326137,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep2.hic":"579654013,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-H1-rep1.hic":"519810544,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-K562-rep1.hic":"199553123,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII.hic":"1319373594,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_HinfI.hic":"1465493873,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII_HinfI_combo.hic":"753062558,5814","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-10A.hic":"2784956115,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-7.hic":"2700457411,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbatullin%2Fsperm.hic":"501052169,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep1.hic":"1450697530,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep2.hic":"1189371558,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Fcombined.hic":"2262007875,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Finactive.hic":"4444564,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Factive.hic":"3993495,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep1.hic":"1650838357,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep2.hic":"1258038606,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski.hic":"499827296,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_dnase.hic":"4298088401,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_in_situ_dnase.hic":"609321852,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain.hic":"1028196506,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep1.hic":"1283306,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep2.hic":"1263227,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FNcoI_rep1.hic":"4380906,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined.hic":"1829549643,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined_randomized.hic":"1859742654,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_GM_cohesin.hic":"1231264781,17932","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_cohesin_all.hic":"1152008628,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_Oct4.hic":"912828146,16438","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FSCC4KO.hic":"1767906138,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FDKO.hic":"1487228787,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_1.14.hic":"1189751862,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_3.3.hic":"1155057696,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWT.hic":"1522401568,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2Fmega_Liverpool%2Fmega.hic":"2612171975,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2836_Liverpool1%2FLiverpool1.hic":"191729195,2245","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2861_Liverpool2%2FLiverpool2.hic":"1637096030,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2862_Liverpool3%2FLiverpool3.hic":"1160045602,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC.hic":"11857786247,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC_CanyonDel.hic":"8139168836,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Ftcell.hic":"9871547081,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Fep.hic":"17479335373,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2FTh1_ensemble.hic":"1690592868,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FES_mapq30.hic":"32930498831,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FNPC_mapq30.hic":"55053730986,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FCN_mapq30.hic":"53138031154,32386","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_72_hours_WT.hic":"16492991184,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_WT.hic":"23057795398,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_MYC_KO.hic":"21245554876,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_TSA.hic":"13933346059,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_oligomycin.hic":"21902506832,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-mES_WT.hic":"9451969795,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_WT.hic":"3600188564,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_WT.hic":"1309503359,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_HU_treated.hic":"1477252396,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_flavopiridol.hic":"15711773490,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FPGP1F_mega_090118%2FPGP1F_mega_090118_30.hic":"24786676166,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7145%2FHIC7145_30.hic":"4554644616,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7146%2FHIC7146_30.hic":"4174848944,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7147%2FHIC7147_30.hic":"5062229182,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7862%2FHIC7862_30.hic":"4520990620,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7863%2FHIC7863_30.hic":"4330354773,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7864%2FHIC7864_30.hic":"5880640268,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7865%2FHIC7865_30.hic":"4431632469,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7866%2FHIC7866_30.hic":"4686000222,36479","encode-public.s3.amazonaws.com%2F2018%2F10%2F19%2Fb122542b-306c-4631-bdc3-2e155e89af55%2FENCFF718AWL.hic":"39544267907,58932","encode-public.s3.amazonaws.com%2F2019%2F02%2F15%2F8e787cd8-e388-4bc2-a236-7a5e6f39e0c0%2FENCFF999YXX.hic":"9255069996,56883","encode-public.s3.amazonaws.com%2F2019%2F02%2F08%2Ffc1d9d5d-8fa0-4e29-9080-3da674d9490d%2FENCFF543USQ.hic":"5005263062,36479","s3.us-east-1.wasabisys.com%2Fhicfiles%2Finternal%2FLCL_mega_42B_500bp_30.hic":"106482584851,22829","www.encodeproject.org%2Ffiles%2FENCFF925QIF%2F%40%40download%2FENCFF925QIF.hic":"51712684396,54779","www.encodeproject.org%2Ffiles%2FENCFF259YUS%2F%40%40download%2FENCFF259YUS.hic":"24640030444,54779","www.encodeproject.org%2Ffiles%2FENCFF783KQI%2F%40%40download%2FENCFF783KQI.hic":"27209249856,54779","www.encodeproject.org%2Ffiles%2FENCFF318JAP%2F%40%40download%2FENCFF318JAP.hic":"28636979242,54779","www.encodeproject.org%2Ffiles%2FENCFF512PQA%2F%40%40download%2FENCFF512PQA.hic":"28124104361,54779","www.encodeproject.org%2Ffiles%2FENCFF591MHA%2F%40%40download%2FENCFF591MHA.hic":"37373387202,54779","www.encodeproject.org%2Ffiles%2FENCFF197OWW%2F%40%40download%2FENCFF197OWW.hic":"41826180893,54779","www.encodeproject.org%2Ffiles%2FENCFF317OIA%2F%40%40download%2FENCFF317OIA.hic":"34741636038,54779","www.encodeproject.org%2Ffiles%2FENCFF522YLZ%2F%40%40download%2FENCFF522YLZ.hic":"24064692329,54779","www.encodeproject.org%2Ffiles%2FENCFF420JTA%2F%40%40download%2FENCFF420JTA.hic":"21202405177,54779","www.encodeproject.org%2Ffiles%2FENCFF871ZDJ%2F%40%40download%2FENCFF871ZDJ.hic":"10124815680,18679","www.encodeproject.org%2Ffiles%2FENCFF349RZY%2F%40%40download%2FENCFF349RZY.hic":"4446702705,36479","www.encodeproject.org%2Ffiles%2FENCFF738YON%2F%40%40download%2FENCFF738YON.hic":"3338049584,35947","www.encodeproject.org%2Ffiles%2FENCFF406KJN%2F%40%40download%2FENCFF406KJN.hic":"4132875306,36479","www.encodeproject.org%2Ffiles%2FENCFF081NPN%2F%40%40download%2FENCFF081NPN.hic":"34495587443,54779","www.encodeproject.org%2Ffiles%2FENCFF946RZW%2F%40%40download%2FENCFF946RZW.hic":"34571955193,54779","www.encodeproject.org%2Ffiles%2FENCFF602CHT%2F%40%40download%2FENCFF602CHT.hic":"30674798032,54779","www.encodeproject.org%2Ffiles%2FENCFF150DKS%2F%40%40download%2FENCFF150DKS.hic":"12618769864,36479","www.encodeproject.org%2Ffiles%2FENCFF614IPZ%2F%40%40download%2FENCFF614IPZ.hic":"42450060331,54779","www.encodeproject.org%2Ffiles%2FENCFF571ZQR%2F%40%40download%2FENCFF571ZQR.hic":"15230068871,47429","www.encodeproject.org%2Ffiles%2FENCFF705MKK%2F%40%40download%2FENCFF705MKK.hic":"38686554702,54779","www.encodeproject.org%2Ffiles%2FENCFF658KTB%2F%40%40download%2FENCFF658KTB.hic":"13195884405,47429","www.encodeproject.org%2Ffiles%2FENCFF435JYN%2F%40%40download%2FENCFF435JYN.hic":"17192139674,54779","www.encodeproject.org%2Ffiles%2FENCFF016JKX%2F%40%40download%2FENCFF016JKX.hic":"37266736642,54779","www.encodeproject.org%2Ffiles%2FENCFF294GFP%2F%40%40download%2FENCFF294GFP.hic":"36389843399,54779","www.encodeproject.org%2Ffiles%2FENCFF700CYI%2F%40%40download%2FENCFF700CYI.hic":"60482012152,54779","www.encodeproject.org%2Ffiles%2FENCFF962EDB%2F%40%40download%2FENCFF962EDB.hic":"39394328182,54779","www.encodeproject.org%2Ffiles%2FENCFF467OGP%2F%40%40download%2FENCFF467OGP.hic":"35572788855,54779","www.encodeproject.org%2Ffiles%2FENCFF556RLR%2F%40%40download%2FENCFF556RLR.hic":"34826921187,54779","www.encodeproject.org%2Ffiles%2FENCFF309UNV%2F%40%40download%2FENCFF309UNV.hic":"48510618174,54779","www.encodeproject.org%2Ffiles%2FENCFF653HCO%2F%40%40download%2FENCFF653HCO.hic":"41079007620,54779","www.encodeproject.org%2Ffiles%2FENCFF120DSV%2F%40%40download%2FENCFF120DSV.hic":"12790195576,47429","www.encodeproject.org%2Ffiles%2FENCFF284OEA%2F%40%40download%2FENCFF284OEA.hic":"46007570339,54779","www.encodeproject.org%2Ffiles%2FENCFF035BLF%2F%40%40download%2FENCFF035BLF.hic":"63868871985,54779","www.encodeproject.org%2Ffiles%2FENCFF094KKX%2F%40%40download%2FENCFF094KKX.hic":"42151419971,54779","www.encodeproject.org%2Ffiles%2FENCFF965BPU%2F%40%40download%2FENCFF965BPU.hic":"42717376107,54779","www.encodeproject.org%2Ffiles%2FENCFF842DUO%2F%40%40download%2FENCFF842DUO.hic":"39553892515,54779","www.encodeproject.org%2Ffiles%2FENCFF417GBZ%2F%40%40download%2FENCFF417GBZ.hic":"45544785452,54779","www.encodeproject.org%2Ffiles%2FENCFF499BVX%2F%40%40download%2FENCFF499BVX.hic":"40900674170,54779","www.encodeproject.org%2Ffiles%2FENCFF136XCV%2F%40%40download%2FENCFF136XCV.hic":"47700392974,54779","www.encodeproject.org%2Ffiles%2FENCFF224HKR%2F%40%40download%2FENCFF224HKR.hic":"40426005932,54779","www.encodeproject.org%2Ffiles%2FENCFF711XSR%2F%40%40download%2FENCFF711XSR.hic":"41434581949,54779","www.encodeproject.org%2Ffiles%2FENCFF660JWA%2F%40%40download%2FENCFF660JWA.hic":"54201632697,54779","www.encodeproject.org%2Ffiles%2FENCFF081PMO%2F%40%40download%2FENCFF081PMO.hic":"53428285130,54779","www.encodeproject.org%2Ffiles%2FENCFF799QGA%2F%40%40download%2FENCFF799QGA.hic":"1228682189,36479","www.encodeproject.org%2Ffiles%2FENCFF473CAA%2F%40%40download%2FENCFF473CAA.hic":"1077514950,36479","www.encodeproject.org%2Ffiles%2FENCFF663FRL%2F%40%40download%2FENCFF663FRL.hic":"39843938245,54779","www.encodeproject.org%2Ffiles%2FENCFF341WOY%2F%40%40download%2FENCFF341WOY.hic":"34792598619,54779","www.encodeproject.org%2Ffiles%2FENCFF515ZBF%2F%40%40download%2FENCFF515ZBF.hic":"41779230923,54779","www.encodeproject.org%2Ffiles%2FENCFF545GBW%2F%40%40download%2FENCFF545GBW.hic":"38351980358,54779","www.encodeproject.org%2Ffiles%2FENCFF252ANV%2F%40%40download%2FENCFF252ANV.hic":"37668839771,54779","www.encodeproject.org%2Ffiles%2FENCFF912NDK%2F%40%40download%2FENCFF912NDK.hic":"21196851956,54779","www.encodeproject.org%2Ffiles%2FENCFF683PLM%2F%40%40download%2FENCFF683PLM.hic":"21849338763,54779","www.encodeproject.org%2Ffiles%2FENCFF355NFJ%2F%40%40download%2FENCFF355NFJ.hic":"47880627268,54779","www.encodeproject.org%2Ffiles%2FENCFF507WEW%2F%40%40download%2FENCFF507WEW.hic":"35777782924,54779","www.encodeproject.org%2Ffiles%2FENCFF241MSL%2F%40%40download%2FENCFF241MSL.hic":"22507408288,54779","www.encodeproject.org%2Ffiles%2FENCFF135MUT%2F%40%40download%2FENCFF135MUT.hic":"24168734040,54779","www.encodeproject.org%2Ffiles%2FENCFF459FRB%2F%40%40download%2FENCFF459FRB.hic":"37166770103,54779","www.encodeproject.org%2Ffiles%2FENCFF705YZH%2F%40%40download%2FENCFF705YZH.hic":"44679182442,54779","www.encodeproject.org%2Ffiles%2FENCFF395INO%2F%40%40download%2FENCFF395INO.hic":"56727346538,54779","www.encodeproject.org%2Ffiles%2FENCFF736ITL%2F%40%40download%2FENCFF736ITL.hic":"49036286185,54779","www.encodeproject.org%2Ffiles%2FENCFF546TZN%2F%40%40download%2FENCFF546TZN.hic":"33195126348,54779","www.encodeproject.org%2Ffiles%2FENCFF706SFK%2F%40%40download%2FENCFF706SFK.hic":"3271831702,36479","www.encodeproject.org%2Ffiles%2FENCFF922ERE%2F%40%40download%2FENCFF922ERE.hic":"12476647122,36479","www.encodeproject.org%2Ffiles%2FENCFF876OWE%2F%40%40download%2FENCFF876OWE.hic":"1538692704,47429","www.encodeproject.org%2Ffiles%2FENCFF227XJZ%2F%40%40download%2FENCFF227XJZ.hic":"1925617685,36479","www.encodeproject.org%2Ffiles%2FENCFF053BXY%2F%40%40download%2FENCFF053BXY.hic":"1032237652,36479","www.encodeproject.org%2Ffiles%2FENCFF014VMM%2F%40%40download%2FENCFF014VMM.hic":"1564021703,36479","www.encodeproject.org%2Ffiles%2FENCFF563XES%2F%40%40download%2FENCFF563XES.hic":"1489180508,36479","www.encodeproject.org%2Ffiles%2FENCFF482LGO%2F%40%40download%2FENCFF482LGO.hic":"1208778887,36479","www.encodeproject.org%2Ffiles%2FENCFF216QQM%2F%40%40download%2FENCFF216QQM.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF256UOW%2F%40%40download%2FENCFF256UOW.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF791UZC%2F%40%40download%2FENCFF791UZC.hic":"37029615181,54779","www.encodeproject.org%2Ffiles%2FENCFF911AHQ%2F%40%40download%2FENCFF911AHQ.hic":"34246649165,54779","www.encodeproject.org%2Ffiles%2FENCFF491AOR%2F%40%40download%2FENCFF491AOR.hic":"558663570,36479","www.encodeproject.org%2Ffiles%2FENCFF307PDL%2F%40%40download%2FENCFF307PDL.hic":"525321519,36479","www.encodeproject.org%2Ffiles%2FENCFF773ITV%2F%40%40download%2FENCFF773ITV.hic":"295464771,36479","www.encodeproject.org%2Ffiles%2FENCFF198SSL%2F%40%40download%2FENCFF198SSL.hic":"500142476,36479","www.encodeproject.org%2Ffiles%2FENCFF251UEF%2F%40%40download%2FENCFF251UEF.hic":"567443575,36479","www.encodeproject.org%2Ffiles%2FENCFF942LTN%2F%40%40download%2FENCFF942LTN.hic":"4430960222,36479","www.encodeproject.org%2Ffiles%2FENCFF543USQ%2F%40%40download%2FENCFF543USQ.hic":"5005263062,36479","www.encodeproject.org%2Ffiles%2FENCFF434XQU%2F%40%40download%2FENCFF434XQU.hic":"25506511674,54779","www.encodeproject.org%2Ffiles%2FENCFF318GOM%2F%40%40download%2FENCFF318GOM.hic":"44750824314,54779","www.encodeproject.org%2Ffiles%2FENCFF004TKY%2F%40%40download%2FENCFF004TKY.hic":"20705661833,54779","www.encodeproject.org%2Ffiles%2FENCFF493YNC%2F%40%40download%2FENCFF493YNC.hic":"53407154984,54779","www.encodeproject.org%2Ffiles%2FENCFF334XXU%2F%40%40download%2FENCFF334XXU.hic":"14341194962,47429","www.encodeproject.org%2Ffiles%2FENCFF569RJM%2F%40%40download%2FENCFF569RJM.hic":"1922066634,36479","www.encodeproject.org%2Ffiles%2FENCFF076LWH%2F%40%40download%2FENCFF076LWH.hic":"39406255845,54779","www.encodeproject.org%2Ffiles%2FENCFF977XWK%2F%40%40download%2FENCFF977XWK.hic":"20563512962,54779","www.encodeproject.org%2Ffiles%2FENCFF127TPS%2F%40%40download%2FENCFF127TPS.hic":"21032070512,54779","www.encodeproject.org%2Ffiles%2FENCFF480KLP%2F%40%40download%2FENCFF480KLP.hic":"33115569647,54779","www.encodeproject.org%2Ffiles%2FENCFF281ILS%2F%40%40download%2FENCFF281ILS.hic":"28236353584,54779","www.encodeproject.org%2Ffiles%2FENCFF129LMU%2F%40%40download%2FENCFF129LMU.hic":"35247096013,54779","www.encodeproject.org%2Ffiles%2FENCFF759YCW%2F%40%40download%2FENCFF759YCW.hic":"16058537743,32102","www.encodeproject.org%2Ffiles%2FENCFF045YOM%2F%40%40download%2FENCFF045YOM.hic":"19775445828,32102","www.encodeproject.org%2Ffiles%2FENCFF013TGD%2F%40%40download%2FENCFF013TGD.hic":"4208420532,36479","www.encodeproject.org%2Ffiles%2FENCFF929RPW%2F%40%40download%2FENCFF929RPW.hic":"1974260276,36479","www.encodeproject.org%2Ffiles%2FENCFF996XEO%2F%40%40download%2FENCFF996XEO.hic":"2072918865,36479","www.encodeproject.org%2Ffiles%2FENCFF097SKJ%2F%40%40download%2FENCFF097SKJ.hic":"1983524001,36479","www.encodeproject.org%2Ffiles%2FENCFF464KRA%2F%40%40download%2FENCFF464KRA.hic":"1957300131,36479","www.encodeproject.org%2Ffiles%2FENCFF406HHC%2F%40%40download%2FENCFF406HHC.hic":"3854527235,36479","www.encodeproject.org%2Ffiles%2FENCFF080DPJ%2F%40%40download%2FENCFF080DPJ.hic":"19953768024,47429","www.encodeproject.org%2Ffiles%2FENCFF621AIY%2F%40%40download%2FENCFF621AIY.hic":"26781700010,54779","www.encodeproject.org%2Ffiles%2FENCFF366ERB%2F%40%40download%2FENCFF366ERB.hic":"1049184239,36479","www.encodeproject.org%2Ffiles%2FENCFF997RGL%2F%40%40download%2FENCFF997RGL.hic":"2521167549,36479","www.encodeproject.org%2Ffiles%2FENCFF029MPB%2F%40%40download%2FENCFF029MPB.hic":"1854711185,36479","www.encodeproject.org%2Ffiles%2FENCFF043EEE%2F%40%40download%2FENCFF043EEE.hic":"2924133032,36479","www.encodeproject.org%2Ffiles%2FENCFF920CJR%2F%40%40download%2FENCFF920CJR.hic":"3011577886,36479","www.encodeproject.org%2Ffiles%2FENCFF928NJV%2F%40%40download%2FENCFF928NJV.hic":"2778936244,36479","www.encodeproject.org%2Ffiles%2FENCFF894GLR%2F%40%40download%2FENCFF894GLR.hic":"2831733099,36479","www.encodeproject.org%2Ffiles%2FENCFF303PCK%2F%40%40download%2FENCFF303PCK.hic":"688704435,36479","www.encodeproject.org%2Ffiles%2FENCFF999YXX%2F%40%40download%2FENCFF999YXX.hic":"9255069996,56883","www.encodeproject.org%2Ffiles%2FENCFF685BLG%2F%40%40download%2FENCFF685BLG.hic":"16797022992,47429","www.encodeproject.org%2Ffiles%2FENCFF188SSH%2F%40%40download%2FENCFF188SSH.hic":"16797023050,47429","www.encodeproject.org%2Ffiles%2FENCFF465ESX%2F%40%40download%2FENCFF465ESX.hic":"13489465953,32102","www.encodeproject.org%2Ffiles%2FENCFF493SFI%2F%40%40download%2FENCFF493SFI.hic":"30033046818,54779","www.encodeproject.org%2Ffiles%2FENCFF235LCO%2F%40%40download%2FENCFF235LCO.hic":"38572174589,54779","www.encodeproject.org%2Ffiles%2FENCFF625VNK%2F%40%40download%2FENCFF625VNK.hic":"45202258438,54779","www.encodeproject.org%2Ffiles%2FENCFF304HMS%2F%40%40download%2FENCFF304HMS.hic":"36994445315,54779","www.encodeproject.org%2Ffiles%2FENCFF605CEN%2F%40%40download%2FENCFF605CEN.hic":"40358346301,54779","www.encodeproject.org%2Ffiles%2FENCFF086ORS%2F%40%40download%2FENCFF086ORS.hic":"22650781304,54779","www.encodeproject.org%2Ffiles%2FENCFF237UKR%2F%40%40download%2FENCFF237UKR.hic":"41516707246,54779","www.encodeproject.org%2Ffiles%2FENCFF004YZQ%2F%40%40download%2FENCFF004YZQ.hic":"71900665326,54779","www.encodeproject.org%2Ffiles%2FENCFF104THR%2F%40%40download%2FENCFF104THR.hic":"15172410632,54779","www.encodeproject.org%2Ffiles%2FENCFF807IRK%2F%40%40download%2FENCFF807IRK.hic":"17346637451,54779","www.encodeproject.org%2Ffiles%2FENCFF193CQL%2F%40%40download%2FENCFF193CQL.hic":"55726903245,54779","www.encodeproject.org%2Ffiles%2FENCFF700DEX%2F%40%40download%2FENCFF700DEX.hic":"20231399798,54779","www.encodeproject.org%2Ffiles%2FENCFF234MDO%2F%40%40download%2FENCFF234MDO.hic":"24635312640,54779","www.encodeproject.org%2Ffiles%2FENCFF181ROW%2F%40%40download%2FENCFF181ROW.hic":"26883606497,54779","www.encodeproject.org%2Ffiles%2FENCFF896OFN%2F%40%40download%2FENCFF896OFN.hic":"36952196833,54779","www.encodeproject.org%2Ffiles%2FENCFF573OPJ%2F%40%40download%2FENCFF573OPJ.hic":"36685546919,54779","www.encodeproject.org%2Ffiles%2FENCFF028RXH%2F%40%40download%2FENCFF028RXH.hic":"31053919206,54779","www.encodeproject.org%2Ffiles%2FENCFF156GGD%2F%40%40download%2FENCFF156GGD.hic":"35284134289,54779","www.encodeproject.org%2Ffiles%2FENCFF496GEU%2F%40%40download%2FENCFF496GEU.hic":"44659660933,54779","www.encodeproject.org%2Ffiles%2FENCFF945TUH%2F%40%40download%2FENCFF945TUH.hic":"3898570191,35639","www.encodeproject.org%2Ffiles%2FENCFF698KFV%2F%40%40download%2FENCFF698KFV.hic":"4427896684,35751","www.encodeproject.org%2Ffiles%2FENCFF239BHZ%2F%40%40download%2FENCFF239BHZ.hic":"1718552021,36479","www.encodeproject.org%2Ffiles%2FENCFF277LAN%2F%40%40download%2FENCFF277LAN.hic":"4542391336,36479","www.encodeproject.org%2Ffiles%2FENCFF397CMD%2F%40%40download%2FENCFF397CMD.hic":"2832016430,36479","www.encodeproject.org%2Ffiles%2FENCFF778OYA%2F%40%40download%2FENCFF778OYA.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF775VSU%2F%40%40download%2FENCFF775VSU.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF812THZ%2F%40%40download%2FENCFF812THZ.hic":"9667720429,36479","www.encodeproject.org%2Ffiles%2FENCFF777KBU%2F%40%40download%2FENCFF777KBU.hic":"5058284320,36479","www.encodeproject.org%2Ffiles%2FENCFF688KOY%2F%40%40download%2FENCFF688KOY.hic":"4198695833,36479","www.encodeproject.org%2Ffiles%2FENCFF223UBX%2F%40%40download%2FENCFF223UBX.hic":"1206064037,36479","www.encodeproject.org%2Ffiles%2FENCFF273XBU%2F%40%40download%2FENCFF273XBU.hic":"44085607579,54779","www.encodeproject.org%2Ffiles%2FENCFF952JZV%2F%40%40download%2FENCFF952JZV.hic":"44728845246,54779","www.encodeproject.org%2Ffiles%2FENCFF643NDM%2F%40%40download%2FENCFF643NDM.hic":"35877886780,54779","www.encodeproject.org%2Ffiles%2FENCFF586MQY%2F%40%40download%2FENCFF586MQY.hic":"71158037547,54779","www.encodeproject.org%2Ffiles%2FENCFF251VFA%2F%40%40download%2FENCFF251VFA.hic":"40089479399,54779","www.encodeproject.org%2Ffiles%2FENCFF033WGK%2F%40%40download%2FENCFF033WGK.hic":"30802023728,54779","www.encodeproject.org%2Ffiles%2FENCFF649OHR%2F%40%40download%2FENCFF649OHR.hic":"28203184265,54779","www.encodeproject.org%2Ffiles%2FENCFF782WVZ%2F%40%40download%2FENCFF782WVZ.hic":"37248221674,54779","www.encodeproject.org%2Ffiles%2FENCFF579CAR%2F%40%40download%2FENCFF579CAR.hic":"39662025395,54779","www.encodeproject.org%2Ffiles%2FENCFF514XWQ%2F%40%40download%2FENCFF514XWQ.hic":"1319613701,36479","www.encodeproject.org%2Ffiles%2FENCFF666USK%2F%40%40download%2FENCFF666USK.hic":"15051670107,32102","www.encodeproject.org%2Ffiles%2FENCFF047SDP%2F%40%40download%2FENCFF047SDP.hic":"1357076705,16438","www.encodeproject.org%2Ffiles%2FENCFF584LEP%2F%40%40download%2FENCFF584LEP.hic":"9314176858,36479","www.encodeproject.org%2Ffiles%2FENCFF671SOE%2F%40%40download%2FENCFF671SOE.hic":"3273732256,16438","www.encodeproject.org%2Ffiles%2FENCFF702LAP%2F%40%40download%2FENCFF702LAP.hic":"1800427500,31682","www.encodeproject.org%2Ffiles%2FENCFF339PON%2F%40%40download%2FENCFF339PON.hic":"5394351199,31514","www.encodeproject.org%2Ffiles%2FENCFF741QPR%2F%40%40download%2FENCFF741QPR.hic":"4271510019,30139","www.encodeproject.org%2Ffiles%2FENCFF103ANX%2F%40%40download%2FENCFF103ANX.hic":"4439745804,30083","www.encodeproject.org%2Ffiles%2FENCFF395SBC%2F%40%40download%2FENCFF395SBC.hic":"1596732351,31850","www.encodeproject.org%2Ffiles%2FENCFF289WNN%2F%40%40download%2FENCFF289WNN.hic":"8632980535,32102","www.encodeproject.org%2Ffiles%2FENCFF381EAU%2F%40%40download%2FENCFF381EAU.hic":"1702476311,36479","www.encodeproject.org%2Ffiles%2FENCFF976FEY%2F%40%40download%2FENCFF976FEY.hic":"1448279040,36479","www.encodeproject.org%2Ffiles%2FENCFF485LVS%2F%40%40download%2FENCFF485LVS.hic":"1593610856,36479","www.encodeproject.org%2Ffiles%2FENCFF143VJV%2F%40%40download%2FENCFF143VJV.hic":"1422312076,36479","www.encodeproject.org%2Ffiles%2FENCFF588NHX%2F%40%40download%2FENCFF588NHX.hic":"3943637009,36479","www.encodeproject.org%2Ffiles%2FENCFF768UBD%2F%40%40download%2FENCFF768UBD.hic":"24786676166,36479","www.encodeproject.org%2Ffiles%2FENCFF965PEE%2F%40%40download%2FENCFF965PEE.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF702IFC%2F%40%40download%2FENCFF702IFC.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF288DNV%2F%40%40download%2FENCFF288DNV.hic":"10313429504,36479","www.encodeproject.org%2Ffiles%2FENCFF698HWZ%2F%40%40download%2FENCFF698HWZ.hic":"10962849269,47429","www.encodeproject.org%2Ffiles%2FENCFF355OWW%2F%40%40download%2FENCFF355OWW.hic":"3219571601,36479","www.encodeproject.org%2Ffiles%2FENCFF177TYX%2F%40%40download%2FENCFF177TYX.hic":"10325679706,36479","www.encodeproject.org%2Ffiles%2FENCFF542BHD%2F%40%40download%2FENCFF542BHD.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF684IFW%2F%40%40download%2FENCFF684IFW.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF592UHE%2F%40%40download%2FENCFF592UHE.hic":"21363948089,32102","www.encodeproject.org%2Ffiles%2FENCFF779XIS%2F%40%40download%2FENCFF779XIS.hic":"9517383271,36479","www.encodeproject.org%2Ffiles%2FENCFF518PSL%2F%40%40download%2FENCFF518PSL.hic":"7500581463,36479","www.encodeproject.org%2Ffiles%2FENCFF275GBB%2F%40%40download%2FENCFF275GBB.hic":"7889407162,36479","www.encodeproject.org%2Ffiles%2FENCFF634KXI%2F%40%40download%2FENCFF634KXI.hic":"6430702966,36479","www.encodeproject.org%2Ffiles%2FENCFF337QPM%2F%40%40download%2FENCFF337QPM.hic":"8529733887,36479","www.encodeproject.org%2Ffiles%2FENCFF162KMP%2F%40%40download%2FENCFF162KMP.hic":"5615896908,36479","www.encodeproject.org%2Ffiles%2FENCFF992VTE%2F%40%40download%2FENCFF992VTE.hic":"7328975027,36479","www.encodeproject.org%2Ffiles%2FENCFF464WXY%2F%40%40download%2FENCFF464WXY.hic":"5715339664,36479","www.encodeproject.org%2Ffiles%2FENCFF752EGH%2F%40%40download%2FENCFF752EGH.hic":"1733758743,36479","www.encodeproject.org%2Ffiles%2FENCFF474UJM%2F%40%40download%2FENCFF474UJM.hic":"222309548,18679","www.encodeproject.org%2Ffiles%2FENCFF531UPZ%2F%40%40download%2FENCFF531UPZ.hic":"1827756846,36479","www.encodeproject.org%2Ffiles%2FENCFF022VHA%2F%40%40download%2FENCFF022VHA.hic":"244983451,18679","www.encodeproject.org%2Ffiles%2FENCFF732NGR%2F%40%40download%2FENCFF732NGR.hic":"1679484567,36479","www.encodeproject.org%2Ffiles%2FENCFF513VSF%2F%40%40download%2FENCFF513VSF.hic":"28397932940,36479","www.encodeproject.org%2Ffiles%2FENCFF750AOC%2F%40%40download%2FENCFF750AOC.hic":"36471430712,47429","www.encodeproject.org%2Ffiles%2FENCFF219YOB%2F%40%40download%2FENCFF219YOB.hic":"2859767211,26979","www.encodeproject.org%2Ffiles%2FENCFF604YDD%2F%40%40download%2FENCFF604YDD.hic":"3549694085,26979","www.encodeproject.org%2Ffiles%2FENCFF746AMV%2F%40%40download%2FENCFF746AMV.hic":"2954867135,26979","www.encodeproject.org%2Ffiles%2FENCFF845ZEB%2F%40%40download%2FENCFF845ZEB.hic":"2763039282,26979","www.encodeproject.org%2Ffiles%2FENCFF570LWS%2F%40%40download%2FENCFF570LWS.hic":"2861588289,26979","www.encodeproject.org%2Ffiles%2FENCFF883YVR%2F%40%40download%2FENCFF883YVR.hic":"2433679887,26979","www.encodeproject.org%2Ffiles%2FENCFF056VLK%2F%40%40download%2FENCFF056VLK.hic":"2502986910,26979","www.encodeproject.org%2Ffiles%2FENCFF532DUQ%2F%40%40download%2FENCFF532DUQ.hic":"3172615899,26979","www.encodeproject.org%2Ffiles%2FENCFF723PYJ%2F%40%40download%2FENCFF723PYJ.hic":"10292839095,36479","www.encodeproject.org%2Ffiles%2FENCFF991SGJ%2F%40%40download%2FENCFF991SGJ.hic":"13072407683,32102","www.encodeproject.org%2Ffiles%2FENCFF885UZI%2F%40%40download%2FENCFF885UZI.hic":"1201881201,16438","www.encodeproject.org%2Ffiles%2FENCFF287KXA%2F%40%40download%2FENCFF287KXA.hic":"14705801988,32102","www.encodeproject.org%2Ffiles%2FENCFF335HYI%2F%40%40download%2FENCFF335HYI.hic":"20366756545,32102","www.encodeproject.org%2Ffiles%2FENCFF121YPY%2F%40%40download%2FENCFF121YPY.hic":"2760104016,26979","www.encodeproject.org%2Ffiles%2FENCFF675SJE%2F%40%40download%2FENCFF675SJE.hic":"3751779995,26979","www.encodeproject.org%2Ffiles%2FENCFF876LAW%2F%40%40download%2FENCFF876LAW.hic":"4032376256,26979","www.encodeproject.org%2Ffiles%2FENCFF740KVX%2F%40%40download%2FENCFF740KVX.hic":"3202490322,26979","www.encodeproject.org%2Ffiles%2FENCFF977OQV%2F%40%40download%2FENCFF977OQV.hic":"2919735477,26979","www.encodeproject.org%2Ffiles%2FENCFF525EFN%2F%40%40download%2FENCFF525EFN.hic":"2394748073,26979","www.encodeproject.org%2Ffiles%2FENCFF690QRC%2F%40%40download%2FENCFF690QRC.hic":"3183023394,26979","www.encodeproject.org%2Ffiles%2FENCFF452FWS%2F%40%40download%2FENCFF452FWS.hic":"2951805127,26979","www.encodeproject.org%2Ffiles%2FENCFF089KBG%2F%40%40download%2FENCFF089KBG.hic":"2531936700,26979","www.encodeproject.org%2Ffiles%2FENCFF939ARM%2F%40%40download%2FENCFF939ARM.hic":"3066385212,26979","www.encodeproject.org%2Ffiles%2FENCFF401ZAN%2F%40%40download%2FENCFF401ZAN.hic":"3008677144,26979","www.encodeproject.org%2Ffiles%2FENCFF378RZT%2F%40%40download%2FENCFF378RZT.hic":"2830232168,26979","www.encodeproject.org%2Ffiles%2FENCFF304AVD%2F%40%40download%2FENCFF304AVD.hic":"6164439305,50358","www.encodeproject.org%2Ffiles%2FENCFF453DBX%2F%40%40download%2FENCFF453DBX.hic":"6775246670,36479","www.encodeproject.org%2Ffiles%2FENCFF590VOM%2F%40%40download%2FENCFF590VOM.hic":"6443478922,36479","www.encodeproject.org%2Ffiles%2FENCFF246DOF%2F%40%40download%2FENCFF246DOF.hic":"6837914659,36479","www.encodeproject.org%2Ffiles%2FENCFF125FXX%2F%40%40download%2FENCFF125FXX.hic":"9736232550,36479","www.encodeproject.org%2Ffiles%2FENCFF241RAY%2F%40%40download%2FENCFF241RAY.hic":"7686758397,36479","www.encodeproject.org%2Ffiles%2FENCFF415XWQ%2F%40%40download%2FENCFF415XWQ.hic":"6973092068,36479","www.encodeproject.org%2Ffiles%2FENCFF374EBH%2F%40%40download%2FENCFF374EBH.hic":"8557459058,36479","www.encodeproject.org%2Ffiles%2FENCFF263YWR%2F%40%40download%2FENCFF263YWR.hic":"331586820,18679","www.encodeproject.org%2Ffiles%2FENCFF280CGS%2F%40%40download%2FENCFF280CGS.hic":"1743569614,36479","www.encodeproject.org%2Ffiles%2FENCFF553ZNS%2F%40%40download%2FENCFF553ZNS.hic":"1717253636,36479","www.encodeproject.org%2Ffiles%2FENCFF451VOI%2F%40%40download%2FENCFF451VOI.hic":"1626927468,36479","www.encodeproject.org%2Ffiles%2FENCFF420MQO%2F%40%40download%2FENCFF420MQO.hic":"31055961677,36479","www.encodeproject.org%2Ffiles%2FENCFF301BWY%2F%40%40download%2FENCFF301BWY.hic":"38902429246,47429","www.encodeproject.org%2Ffiles%2FENCFF606XNW%2F%40%40download%2FENCFF606XNW.hic":"1009699327,36479","www.encodeproject.org%2Ffiles%2FENCFF439ZOU%2F%40%40download%2FENCFF439ZOU.hic":"12381714313,36479","www.encodeproject.org%2Ffiles%2FENCFF499SYK%2F%40%40download%2FENCFF499SYK.hic":"13182654663,47429","www.encodeproject.org%2Ffiles%2FENCFF532LFI%2F%40%40download%2FENCFF532LFI.hic":"8286030286,36479","www.encodeproject.org%2Ffiles%2FENCFF020DPP%2F%40%40download%2FENCFF020DPP.hic":"23521952420,47429","www.encodeproject.org%2Ffiles%2FENCFF306VTV%2F%40%40download%2FENCFF306VTV.hic":"23521952480,47429","www.encodeproject.org%2Ffiles%2FENCFF399IHE%2F%40%40download%2FENCFF399IHE.hic":"10216571232,36479","www.encodeproject.org%2Ffiles%2FENCFF944AII%2F%40%40download%2FENCFF944AII.hic":"12567308552,47429","www.encodeproject.org%2Ffiles%2FENCFF230HVV%2F%40%40download%2FENCFF230HVV.hic":"8629849711,36479","www.encodeproject.org%2Ffiles%2FENCFF174LAF%2F%40%40download%2FENCFF174LAF.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF898HRO%2F%40%40download%2FENCFF898HRO.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF429MOR%2F%40%40download%2FENCFF429MOR.hic":"1455757398,36479","www.encodeproject.org%2Ffiles%2FENCFF061NXV%2F%40%40download%2FENCFF061NXV.hic":"1710915891,36479","www.encodeproject.org%2Ffiles%2FENCFF434PYS%2F%40%40download%2FENCFF434PYS.hic":"1832274903,36479","www.encodeproject.org%2Ffiles%2FENCFF704HHX%2F%40%40download%2FENCFF704HHX.hic":"1768142834,36479","www.encodeproject.org%2Ffiles%2FENCFF349DPM%2F%40%40download%2FENCFF349DPM.hic":"4316041260,36479","www.encodeproject.org%2Ffiles%2FENCFF718AWL%2F%40%40download%2FENCFF718AWL.hic":"39544267907,58932","www.encodeproject.org%2Ffiles%2FENCFF065LSP%2F%40%40download%2FENCFF065LSP.hic":"24929805283,55874","www.encodeproject.org%2Ffiles%2FENCFF632MFV%2F%40%40download%2FENCFF632MFV.hic":"22333105467,55798","www.encodeproject.org%2Ffiles%2FENCFF179HVU%2F%40%40download%2FENCFF179HVU.hic":"2659219603,36479","www.encodeproject.org%2Ffiles%2FENCFF791SPZ%2F%40%40download%2FENCFF791SPZ.hic":"2537491657,36479","www.encodeproject.org%2Ffiles%2FENCFF211ZWF%2F%40%40download%2FENCFF211ZWF.hic":"3512141227,36479","www.encodeproject.org%2Ffiles%2FENCFF614BNU%2F%40%40download%2FENCFF614BNU.hic":"5252155462,36479","www.encodeproject.org%2Ffiles%2FENCFF891DLM%2F%40%40download%2FENCFF891DLM.hic":"2549095612,36479","www.encodeproject.org%2Ffiles%2FENCFF056EXT%2F%40%40download%2FENCFF056EXT.hic":"2219014704,36479","www.encodeproject.org%2Ffiles%2FENCFF776DSS%2F%40%40download%2FENCFF776DSS.hic":"3920308353,36479","www.encodeproject.org%2Ffiles%2FENCFF814LQF%2F%40%40download%2FENCFF814LQF.hic":"1349480197,36479","www.encodeproject.org%2Ffiles%2FENCFF513ZNA%2F%40%40download%2FENCFF513ZNA.hic":"2638868195,36479","www.encodeproject.org%2Ffiles%2FENCFF692IOL%2F%40%40download%2FENCFF692IOL.hic":"3106768498,36479","www.encodeproject.org%2Ffiles%2FENCFF294WZY%2F%40%40download%2FENCFF294WZY.hic":"2211089761,36479","www.encodeproject.org%2Ffiles%2FENCFF339UWS%2F%40%40download%2FENCFF339UWS.hic":"2142759055,36479","www.encodeproject.org%2Ffiles%2FENCFF835FSK%2F%40%40download%2FENCFF835FSK.hic":"3919821739,36479","www.encodeproject.org%2Ffiles%2FENCFF328BMB%2F%40%40download%2FENCFF328BMB.hic":"2550686152,36479","www.encodeproject.org%2Ffiles%2FENCFF897RTY%2F%40%40download%2FENCFF897RTY.hic":"1323294397,36479","www.encodeproject.org%2Ffiles%2FENCFF306MWH%2F%40%40download%2FENCFF306MWH.hic":"1665386199,36479","www.encodeproject.org%2Ffiles%2FENCFF039YUJ%2F%40%40download%2FENCFF039YUJ.hic":"2335679939,36479","www.encodeproject.org%2Ffiles%2FENCFF468QIN%2F%40%40download%2FENCFF468QIN.hic":"3352516594,36479","www.encodeproject.org%2Ffiles%2FENCFF364WXU%2F%40%40download%2FENCFF364WXU.hic":"3959043175,36479","www.encodeproject.org%2Ffiles%2FENCFF373MSH%2F%40%40download%2FENCFF373MSH.hic":"4429550624,36479","www.encodeproject.org%2Ffiles%2FENCFF959EGQ%2F%40%40download%2FENCFF959EGQ.hic":"2475218228,36479","www.encodeproject.org%2Ffiles%2FENCFF624XMK%2F%40%40download%2FENCFF624XMK.hic":"3527855681,36479","www.encodeproject.org%2Ffiles%2FENCFF445OKS%2F%40%40download%2FENCFF445OKS.hic":"3369125589,36479","www.encodeproject.org%2Ffiles%2FENCFF239QDV%2F%40%40download%2FENCFF239QDV.hic":"1960069888,36479","www.encodeproject.org%2Ffiles%2FENCFF645AVM%2F%40%40download%2FENCFF645AVM.hic":"4969006589,36479","www.encodeproject.org%2Ffiles%2FENCFF494IPI%2F%40%40download%2FENCFF494IPI.hic":"1565483792,36479","www.encodeproject.org%2Ffiles%2FENCFF753IXE%2F%40%40download%2FENCFF753IXE.hic":"2892400648,36479","www.encodeproject.org%2Ffiles%2FENCFF731GXX%2F%40%40download%2FENCFF731GXX.hic":"5131381303,36479","www.encodeproject.org%2Ffiles%2FENCFF369CAQ%2F%40%40download%2FENCFF369CAQ.hic":"4236629448,36479","www.encodeproject.org%2Ffiles%2FENCFF053VBX%2F%40%40download%2FENCFF053VBX.hic":"54305946375,47429","www.encodeproject.org%2Ffiles%2FENCFF555ISR%2F%40%40download%2FENCFF555ISR.hic":"54305946434,47429","www.encodeproject.org%2Ffiles%2FENCFF964RSP%2F%40%40download%2FENCFF964RSP.hic":"12065485229,36479","www.encodeproject.org%2Ffiles%2FENCFF234MZQ%2F%40%40download%2FENCFF234MZQ.hic":"17507142760,47429","www.encodeproject.org%2Ffiles%2FENCFF994CEG%2F%40%40download%2FENCFF994CEG.hic":"17507142760,47429","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb068e787-bbdd-49e2-9f6d-7a0e9f065d6e%2F4DNFIHSUIRFY.hic":"2701182442,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3768b89a-e124-40eb-8acd-94a4fdd35807%2F4DNFIXTAS6EE.hic":"3283740601,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9c513602-5abb-4088-8415-c827c381ab0d%2F4DNFIC3JD6O2.hic":"4896075767,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde954dad-1849-4c23-beb4-bf893b7d76c9%2F4DNFIGY85S4W.hic":"3364151996,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe1befa6e-8067-4296-8db2-67d2a2458985%2F4DNFI2LTNXME.hic":"3699291418,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbb3307fd-7162-477a-87c5-52f12d03befc%2F4DNFID162B9J.hic":"3576428773,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8597cdae-8319-42d9-9175-3f77aaee34e1%2F4DNFIQWS3632.hic":"4022561190,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F327f091d-6a63-47c4-9752-2dff303a13d9%2F4DNFI6GFHB6G.hic":"4239331168,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd70dc3b8-48a7-42c2-bd23-80bc44fc2266%2F4DNFIS5F6EBL.hic":"4404671861,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77df7bf8-6a3d-407a-8968-4ca1e78d2269%2F4DNFIF2D3TL9.hic":"4793989394,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8f7cc35-d2ef-4717-9009-c02154050fbf%2F4DNFI6EIFUZI.hic":"3370273763,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F98449d79-30d1-4e32-801d-07435819a42f%2F4DNFIRKGMZRQ.hic":"4669813207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd4fe1844-2493-4722-8b98-34a93a4bb7d8%2F4DNFIQWD8ZYD.hic":"5379889057,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1ee40499-1de4-47ff-b540-d9a65943c6b8%2F4DNFIX7H3CE2.hic":"4857679239,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac016170-23a7-4111-8773-353d6c150f34%2F4DNFIO21YDCV.hic":"4695989644,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1faea4e7-9a32-466e-a826-0bfdab6cd915%2F4DNFIUE5RAS6.hic":"4788044799,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcbd396ed-11bb-404f-aed9-ef10abc258e6%2F4DNFIFI6NIKJ.hic":"2069414927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3f78db-ae92-4215-bcae-76d30c617e5d%2F4DNFIL5K3MA1.hic":"2585598247,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66fc2893-224e-48b4-bdb0-25e022dedd03%2F4DNFIPV5KFMK.hic":"2060965679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2b39781d-aadc-434f-abe3-562d61308fdd%2F4DNFIW8TIFI5.hic":"1694424195,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6d28f7b-27d3-486f-b5ac-32567416560d%2F4DNFIA6NSSBJ.hic":"2219532611,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F08785616-722e-46bb-ade2-2fdd21324e11%2F4DNFIBKZK63V.hic":"2429136232,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F904b13d3-1203-42a4-812c-963e80c159b1%2F4DNFI3CFMRID.hic":"1233390166,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0ed4afe-5ecf-451d-bb1f-444697e3f558%2F4DNFIYIAUEPW.hic":"1753567534,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4bb9a9b3-12a8-4d2f-8071-4722294c88ea%2F4DNFIC3HAU11.hic":"2271375254,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5abf9c36-c1d1-44dc-8197-74d860d896c0%2F4DNFIM2BMJ33.hic":"1770471113,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa68475db-7816-4cec-b2da-d4ce4a0c7a0e%2F4DNFIBY3UHJB.hic":"2095528423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07c40943-0d0b-4b3e-94a0-8583b0e00b47%2F4DNFIWZEN3FF.hic":"1558559508,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8a39553-2718-4866-9b2a-45d8e9c5ac6f%2F4DNFIE5TEYK7.hic":"1323063102,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294b61ef-5565-4f04-ade9-f921a6686cce%2F4DNFI7H4II2V.hic":"1436947982,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a70ad7-7d34-4302-9c03-eb824bd4e633%2F4DNFIAS8LV1C.hic":"1263105698,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9db804c6-5a91-4cf5-8ae9-e054223afb77%2F4DNFIBXWIH8J.hic":"1587059951,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd1e55906-ec8f-444b-8ce1-2de22a431a76%2F4DNFIO2HBDAI.hic":"1666436393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a4b9b37-8e38-470c-8190-fd4d513c0bbb%2F4DNFIXWCLD4M.hic":"1513511880,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7615b2-5310-4bbf-a605-98761d3a3079%2F4DNFINASC4NQ.hic":"1420358914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F20454014-49cd-4e2d-93da-f40ad52776d5%2F4DNFIZF1KI43.hic":"1377041630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5df04e86-ee2a-45f2-b878-bf1648e2cca5%2F4DNFIQBHR9XC.hic":"1179502734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1cc910-bb3f-4106-802a-73184c58d5ba%2F4DNFIQVMVRP6.hic":"1811976991,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe431986b-0732-460f-92ff-0abd1694d2d0%2F4DNFIJ7OAIFQ.hic":"1685503856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56d0c575-4962-4ea3-92c3-55bd0e17c096%2F4DNFIE8E4ANZ.hic":"1598369564,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb1502fb-a989-4ef9-b800-7eaa7be172ae%2F4DNFIOUSETUP.hic":"1493294709,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Facc2f1c3-8c96-4d21-814a-3a8ba81e7741%2F4DNFIVJ3IIQL.hic":"1472376655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F037fb4c3-8641-4953-a977-cc71f2137582%2F4DNFIHN2QSMX.hic":"1179632606,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16d2c3c0-6d29-4815-b074-b142af90b615%2F4DNFIILDWK8M.hic":"2280059989,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31789849-e4db-45d8-9730-66a048c02d8a%2F4DNFI6XD6JAQ.hic":"2253961696,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fff04947e-e6e8-4d62-8374-ef2ee4104809%2F4DNFIALNLR78.hic":"1914687914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F53e6c1e7-9410-4158-84e6-57c2e683b095%2F4DNFIBT4EAKN.hic":"2296378356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0127900a-258f-4815-97d2-6fd2b043d853%2F4DNFIDJ2JZ7Q.hic":"2558945393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F89f95693-3d28-44eb-9d45-14932f8e258c%2F4DNFI8JFOAJT.hic":"1726440253,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd803d818-b0d4-4796-8d61-a9f3943f3b10%2F4DNFIRZA6EV6.hic":"1805017504,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff9165fb1-0782-4757-a740-5b929e0252bb%2F4DNFIB7QTIMH.hic":"2541020707,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8d916b2-b58e-4cdf-894c-ffcb3bf6ebd9%2F4DNFIJ5DQZVK.hic":"2445734043,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14066a5b-e01a-43c2-a468-b18826174df3%2F4DNFISTWNV9C.hic":"2499319890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd0692151-7f9a-4475-b059-f8802616dded%2F4DNFIBN9K4V9.hic":"1591570769,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70a7ef36-a514-4e45-918f-47c4e9e30ef4%2F4DNFIR8OU6QJ.hic":"1689882108,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F180306cd-8593-413a-ae83-24f19209c5d2%2F4DNFIDSWKFF5.hic":"1596696630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e7b9be7-f465-4434-8e9c-68d1e44a76af%2F4DNFIV239W4L.hic":"2345867406,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F55df948c-941d-4930-854c-6a07557a0c1d%2F4DNFIREVU1Z5.hic":"2254683002,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f590cb7-df3a-498f-81c3-d5ed4179b8ad%2F4DNFIFHU75I5.hic":"2497670883,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8f064770-6008-4f74-bfca-268d4a22d745%2F4DNFIMROE6N4.hic":"9850583704,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa93d0588-76b7-4ccf-933c-4325876b0a53%2F4DNFI5SUHCGZ.hic":"10364705187,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f5f0d6b-0b22-4936-93c9-0944d49c037b%2F4DNFII84FBKM.hic":"8836986129,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12e90fc5-0b76-4e42-b346-58d267f9ad6e%2F4DNFI2J1ODWB.hic":"13410858286,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2702a45-3e8b-4980-bcd5-6bb0e291614f%2F4DNFIJWBWE41.hic":"20515676755,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa0859349-5f06-4ad3-b56f-b1166b34a9eb%2F4DNFIIMZB6Y9.hic":"15350325963,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12685c57-d54a-46fa-9efb-acf34ed77574%2F4DNFICJECID5.hic":"1525002266,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd101a58e-89aa-44fd-96c5-6bf1e2476272%2F4DNFIR6UW2QA.hic":"1264999913,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8c73bf-1335-4af4-b124-e3622d48c5f6%2F4DNFIGOEKBUZ.hic":"1905947578,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcd2477cf-6ed0-4d7b-b4e9-88fb38b0df48%2F4DNFIMDNAEW4.hic":"996444147,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0f03953e-29da-4f2e-8c05-572d0edf4525%2F4DNFI5OSZ3JC.hic":"369361754,22829","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F29d95dbb-005a-4ae1-8b9c-0fec9ec0bbd0%2F4DNFI7KOUGFM.hic":"1227434049,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa441ab7b-afbe-437d-bf98-b6b916558642%2F4DNFIGKX4A32.hic":"883933242,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F941b2f94-2fff-4d3c-aceb-fee4a5ae41a9%2F4DNFI1ORHOTA.hic":"1140970677,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8720ede9-093f-4c00-912f-373283260a16%2F4DNFIWSVLZED.hic":"458091151,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9e17155-2b62-4a68-afb2-31dfa674e169%2F4DNFI6H926RO.hic":"3552863515,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F22f22778-987a-4dc0-97bc-f26eae0156d9%2F4DNFIKTYSPOF.hic":"2939475400,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40f40192-0acb-44cb-8778-8d21afe593fb%2F4DNFIZ4S52BV.hic":"3067438113,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8767374-7018-4e11-9226-bf5612d39ebb%2F4DNFI3APMXHF.hic":"3258874744,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c5140ec-a65a-4186-8c59-2927233eecaa%2F4DNFIQLIKDSD.hic":"2746398416,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8cdedda6-d7d8-4231-a85b-d56fcd962366%2F4DNFIKYXMF1E.hic":"14442148774,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa4d4497-7c6c-4dad-8040-be13ba07ea32%2F4DNFI9815EEJ.hic":"17960817603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9b7b95f-190b-49fe-8047-ef4a8fc59746%2F4DNFIQ2687RT.hic":"15954277087,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F59863d3a-8d7c-49c7-9a41-7f2a58ad24d1%2F4DNFIYDBBSE3.hic":"16499534862,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e80ca41-b3e0-4f4f-a05e-8f95fe96d938%2F4DNFIMOCN1YS.hic":"863725312,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F96f97a01-0020-4f09-93e8-fc8a9fd07218%2F4DNFI6558CM8.hic":"1597967345,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fce9e9334-ee0b-4549-a845-110470ba5986%2F4DNFIQZRKS7Y.hic":"907626411,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaac8209-1015-48da-9e31-2e252dfd8fe0%2F4DNFIX4DLXSE.hic":"1369766288,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F268b7d52-9655-474c-9467-8ba31bb2195c%2F4DNFII3JV8I1.hic":"856656441,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9681f9b5-335a-4f56-afa1-15b58bbb41e8%2F4DNFI5IAH9H1.hic":"1495185175,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e082eab-95aa-4677-88ed-9d7adcc1effb%2F4DNFIK5HY1GP.hic":"2135337789,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31af1ead-4520-4669-957e-424b4b197c33%2F4DNFIFA89L5B.hic":"1975593640,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcc2b78fd-52d4-4e0c-ac93-b84ee82daf7e%2F4DNFICXCFGEI.hic":"2628202920,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff54efece-280f-46ca-95e3-1f8a3cd18820%2F4DNFIK4CECUH.hic":"1901129375,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1181c0c4-afb7-4b6a-9fdc-d868fb2253fc%2F4DNFI1EYIGOC.hic":"1947135384,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1d3e2905-b9b9-4b91-bcb4-8d34746e78f6%2F4DNFI7TLEWUI.hic":"1185758726,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faba3d42f-39cd-4a85-9d3f-835aefb5c803%2F4DNFIVCJKHMN.hic":"687240974,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F27f54fcb-54fe-41a4-b25a-2f8944c89044%2F4DNFIN8F14CS.hic":"1304082029,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb75fedb5-88f4-4bc0-8e38-298df7847a7f%2F4DNFI5LCW273.hic":"12497258313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f22b2a0-3712-496e-92d2-63775ec0e421%2F4DNFIVSCH2CH.hic":"12594733778,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07e47261-5863-44f5-9198-76e263081bea%2F4DNFIZ268JGC.hic":"1499059135,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F682b1ae1-3ac3-40e4-a330-c49f63946952%2F4DNFIJ1P4HBI.hic":"1190211725,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F197e7c89-ea73-41de-8cb2-8c0b1e3bb945%2F4DNFITEGKBIW.hic":"2061501971,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F191f6928-c9a8-44b2-8516-ee4d6005f24b%2F4DNFIE1P6RVH.hic":"1711447310,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F94435086-3701-4b28-a6d0-4a59b24d7615%2F4DNFICJ6I4DO.hic":"1557899940,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa9ac173-d233-41c7-8985-ca91949664e4%2F4DNFIKUG8MEW.hic":"1339072088,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fba6d8ab6-ee18-4ba2-8da9-d631888dd50a%2F4DNFICFZGFAV.hic":"1261083478,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a3ab04-7094-4673-81e4-ac8c9add8eb5%2F4DNFIQXCZVVA.hic":"1084913802,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc1ff488-82af-4579-9424-959184edb139%2F4DNFIB6PJFJ3.hic":"1114571343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f7026ee-987a-41e7-8a61-45510ee3f86b%2F4DNFIX97731O.hic":"1246860402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6186787c-2e72-4925-9729-02121e2e4597%2F4DNFIYQYZOTO.hic":"1212210849,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b98a946-0109-4efa-a13e-cc7a36772125%2F4DNFIPXU7V25.hic":"1696288217,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fea17d041-c6ed-43a1-8047-535f3d19ad44%2F4DNFIL39PR76.hic":"1719284710,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72774afe-f166-42ac-9849-4070b0dadf6d%2F4DNFIYLJ3R3B.hic":"1106419640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a45e733-55f8-4a8e-be24-2ef34c976e25%2F4DNFIL51WBN6.hic":"1327651164,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F086c62b0-a26f-41ae-a5ff-88b8be2bd2aa%2F4DNFI6SFPUDA.hic":"1336964405,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4d9b79c7-af62-4070-84a9-b953903f2732%2F4DNFI2KM22QR.hic":"953067310,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c9889d1-f49e-4639-8e15-2d99d6cd22e7%2F4DNFIVF8Q45U.hic":"984193565,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa080dd7b-b7bb-4eae-a275-572a8b45b2d0%2F4DNFI2RN3WFP.hic":"1046525527,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb81860ca-c227-4b68-a298-1907fd32300a%2F4DNFI4TJTL7A.hic":"1160373401,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F74ab47dc-7b52-421c-845e-6feb33457adf%2F4DNFIYJ4TWB8.hic":"1268416204,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc6582128-a930-4bcc-941e-5c0733bdd4d5%2F4DNFIM6RGKPV.hic":"863347067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11a75514-4450-4295-9eda-18e3678a575a%2F4DNFIL2VWWL5.hic":"860731581,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5eb52a8c-bf14-4225-bf34-14a0aa47c369%2F4DNFIX6ZXCA8.hic":"893462267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66aaa4c0-1f62-4040-8ecc-4e95da23cd18%2F4DNFIEVR81FS.hic":"879736207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F821c6e7f-96f7-47de-b7d9-4970562b3c8e%2F4DNFIAUI6BBI.hic":"996313881,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9252c362-31ab-413d-a47a-cc97bdbf243a%2F4DNFIAFEE9G2.hic":"1103265750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc1a0bf52-2e65-4deb-871f-ede736babd41%2F4DNFIPZBEXCP.hic":"1081257762,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F729f5ce3-d7e0-466d-b781-d18049e63bfa%2F4DNFIWPKRZGU.hic":"973779283,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80b769ee-a717-4825-9db0-dca86f913173%2F4DNFIMD9QNDX.hic":"1158688208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F266290c0-2767-4158-85ab-7274368905b9%2F4DNFIATA1HD5.hic":"1073361089,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc46f18a8-eb24-4d35-b112-36db72bde2f5%2F4DNFIH9U4I7I.hic":"1111124316,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fec91a79e-7de7-49f7-9b3d-d28313aeddc8%2F4DNFIZ95S6TR.hic":"1242494051,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e9390b9-da20-43bb-a8f4-9830f354ddf9%2F4DNFI5ERM9J7.hic":"1271051397,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee8ea82e-b9e4-41ad-bced-5f4fbdaa4fec%2F4DNFI15FPSQL.hic":"1216714120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbed7eb86-8990-42f2-b3ee-5992d6361f7c%2F4DNFIJ3DZPGM.hic":"1035089437,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaa8a324-3bf8-424c-8a86-b8ad325cc20d%2F4DNFINW9P6XF.hic":"1215712740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70631758-6bf8-47a0-92b6-132574886faa%2F4DNFITS16HW8.hic":"1105283847,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe473304b-7bc8-49b8-bba1-ecb9f06914ee%2F4DNFIS3DIH4V.hic":"1036056660,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F10f9224a-111c-402a-ac25-e221ad0af9ef%2F4DNFIY3KDHP6.hic":"1071761024,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17519b96-2bdd-4294-98f0-1535f1aef28e%2F4DNFIO8HVKOL.hic":"953793750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb18f896-4730-4909-86a3-867fc8e76cd6%2F4DNFIMF6CFOM.hic":"708717889,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcfee4d87-0873-40b0-b79f-35dcc8669c1c%2F4DNFIZZ77KD2.hic":"732668723,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8b5d909-8a1b-41bb-bcdd-d108a0bde762%2F4DNFIOLO226X.hic":"951271932,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ce81f6e-b9cf-4ec9-8bd3-517539e4b662%2F4DNFIJMS2ODT.hic":"932509067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F506aa952-5d41-49ff-b658-916bcf88a395%2F4DNFI49F3LJ4.hic":"1208494817,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4dc392d-ca36-4bdf-a27d-173cae34f520%2F4DNFI65MQOIJ.hic":"854630155,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F149ef8d7-e0b4-4e4f-b7e5-7226e2603746%2F4DNFIM4KEPRD.hic":"882790622,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa436f0a8-4f9a-4524-90ac-795c5b8491cf%2F4DNFIIXBIZFC.hic":"848244425,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc8a05dc-7449-4b01-8330-a55db37ca8e6%2F4DNFIWDOOBVE.hic":"1116239020,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faef8b881-28fe-4694-9a95-1d31940e6726%2F4DNFIDT9EB5M.hic":"888289053,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff66f3162-a53d-46f2-8800-3752935d5400%2F4DNFIX2VUNV8.hic":"1226661451,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F36c782e6-2c48-4298-aa43-bd6624da003d%2F4DNFIEQHTV1R.hic":"804665819,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff15d571e-605d-4bcc-a359-0350b57a6815%2F4DNFIFW7GA64.hic":"901568712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2aa2e8b-ac7f-4acb-b4b5-ac5f845840fe%2F4DNFIXGXD67I.hic":"970995551,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F71b6fd7d-b249-4d65-a597-b80b95845399%2F4DNFIA7GB1NB.hic":"956785837,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cbb1418-34db-427f-9273-5174eac81529%2F4DNFIVOJGWNP.hic":"890415052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc69c2ee7-b6c3-4a62-8d4f-913491c9dab8%2F4DNFIW22BNB5.hic":"1075499540,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa268f28f-c6d9-4324-8989-75d2d317af1b%2F4DNFIIFBC8WN.hic":"1045459440,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7361d4-60a6-440b-b5be-072cada98663%2F4DNFI9ZBEBJH.hic":"759395398,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcceaad1a-e01e-4430-8bd6-24ffa6891802%2F4DNFID4SLU53.hic":"921288444,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9eee5854-b33e-4d5a-9ba8-ceffd47e7488%2F4DNFIODI1NUJ.hic":"733159777,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5e1089b0-42e8-441c-99bb-4be99bcec28b%2F4DNFIJL26LFN.hic":"723567970,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F298a429e-ea29-49d3-bfed-fa851e1e7c4c%2F4DNFI5KTF553.hic":"2213661745,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F965d29f0-e4a3-477c-8ae4-faf4a654e69a%2F4DNFIYSPGFGV.hic":"2274989349,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd88acbc1-37b9-4266-9f97-d8fed576d0f3%2F4DNFILOR6D2D.hic":"2595459358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7b6ddbce-0ed1-4272-b8ae-32793e4ea4e4%2F4DNFI1WMMPJQ.hic":"2262433890,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fedc0c8c4-97d8-4372-9a4f-5e0cdf09d7d0%2F4DNFI47P5978.hic":"2146314403,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0edcc389-43a4-44d7-b946-fe3496f93d56%2F4DNFI7XGW6IH.hic":"2302805723,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0a802926-e235-4c80-b521-83a1774dfb46%2F4DNFIK1EJG8I.hic":"2374943035,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c36aedb-6a58-4aa2-9b11-bb440ec174f1%2F4DNFIDQ3THN9.hic":"2341188249,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F846123cd-8828-4e51-8b8a-27deaf293858%2F4DNFI3WPNFWT.hic":"775145629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd06e3ad-0e37-48a3-8367-c7d5912cab03%2F4DNFI9DCUOQ1.hic":"870487824,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2eaf9bf-9584-4cec-8685-bd74038a6c01%2F4DNFIU8AF5ZY.hic":"1276224366,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F219497b5-3f35-473b-9d4e-e1cf21c69561%2F4DNFIHW8NTQX.hic":"28864787856,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4be13558-114a-4f2d-abca-7598e2ff4757%2F4DNFI4OUMWZ8.hic":"17061013588,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49aed637-87a1-4d4d-ae68-e5da82aec05b%2F4DNFIEYQ5ZIR.hic":"13555272651,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa2f48779-4eff-44a6-8a9d-96435aca1ddc%2F4DNFIDZT7PR8.hic":"13425047093,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6ec6b71-27b8-4891-b10a-ab06a5270468%2F4DNFIEJEFCAM.hic":"15394960208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F68b9a7b5-8413-44fc-8c2d-59a67b1c4166%2F4DNFIJ8JKKWJ.hic":"17012681779,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294d45a4-8b5e-456f-a9cb-1cbbbad3a7d2%2F4DNFINEQY95T.hic":"13966775978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd7f3a48-b822-41e2-bd9c-f52b3aff7b6a%2F4DNFII6AN691.hic":"12367300362,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7da44594-0dc8-4e74-8e10-a957aeaea51a%2F4DNFIDBIEXI7.hic":"2015474981,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F085a0453-3784-4eba-80b2-3556e53e2f52%2F4DNFIDKJFK2S.hic":"1983111659,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc370c78c-0a99-4c3f-a29b-2dfafc6a3e86%2F4DNFIPAF4PYT.hic":"3041434294,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F907ce45f-baa5-416d-92de-e86db4bacff1%2F4DNFIWIYYNQ5.hic":"7082321112,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff13afc6b-cf69-4c9d-881f-eed4dd3c28ee%2F4DNFIHMCILEN.hic":"1739157603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7575d891-0e3d-4a77-896a-3e1b3a8d330b%2F4DNFIJBJ6QVH.hic":"5213499748,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0daa830-60d5-4c7c-a2e1-a4ee70b3fee7%2F4DNFIH2A7IKF.hic":"4099503507,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4970a25-91d8-49a7-9a4a-fe0f12cb2b0f%2F4DNFIOL8KGQ2.hic":"2256042055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879f1850-d175-4a86-8a97-12658482e3d1%2F4DNFIWILLD6C.hic":"5476286356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F787f538e-d619-4c8f-985b-78753fb7e57c%2F4DNFIZBXXJAF.hic":"5946467856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8ee785f-1016-4989-9e64-78352621d32f%2F4DNFI8PZOJHN.hic":"8307204961,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8997fa-528c-4531-b25b-a412de6bd472%2F4DNFIGXAMSJY.hic":"6577588285,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87aede55-7610-4283-af0e-c6840429a31e%2F4DNFIWNNO89O.hic":"2871061417,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93b8e020-b337-4685-81dc-40cc8a12b5e9%2F4DNFIXU2KPNQ.hic":"3401717686,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb5cf1bd-59d6-46fe-857d-b86d9756029d%2F4DNFIHBGD6N6.hic":"840028421,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2d1bc088-d838-49b8-85fc-fea78a7353c4%2F4DNFI7J8NI4A.hic":"675705256,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a27b63-fd67-401b-9aa2-2798e6588d21%2F4DNFISFM9VFK.hic":"800145922,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F656c0a9d-7058-4c4b-a3ce-701d929561c1%2F4DNFIJU5XBK7.hic":"966593603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2efacfbd-9c81-4e62-8df7-847d1ab774d5%2F4DNFIPKY8ED1.hic":"3401629450,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa50b6a26-56b5-43f2-b525-fa219fd716f1%2F4DNFIQRTP7NM.hic":"5358852759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5dc7a59-b998-4490-8a76-afbf3b258a49%2F4DNFIBCIA62Q.hic":"5779049277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62b2b237-cb02-45f7-89d9-616cf9ffb678%2F4DNFIV56OFE3.hic":"5818844506,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ac79b4f-cfbf-4b2a-9fc2-898ed6c3e5e1%2F4DNFILIM6FDL.hic":"19637469163,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cff8afa-5a13-4ad4-bcad-91fc3ced759c%2F4DNFIP71EWXC.hic":"17934647326,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F000789fe-9a22-4280-a71c-7ad228fd4cac%2F4DNFIM7ZVQOQ.hic":"700134697,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8d78457f-0c2b-4358-b08c-4d4ef4d9f59d%2F4DNFIS6EYHCX.hic":"628314484,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ca3b4a0-2478-49c9-b4a2-a28430417a32%2F4DNFIKKCMS1Q.hic":"584050634,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5041473-18ec-439d-92b1-8ad98c9b25c0%2F4DNFIBIV8OUN.hic":"522632731,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcf474ec6-abd4-431e-a21c-252fcf5ee6b3%2F4DNFIAUMRM2S.hic":"313395531,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bb1c73e-fb0f-41c4-8620-a938cc8d24a0%2F4DNFI9ZUXG61.hic":"332217525,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F26dfa41e-7e4f-457a-a3ac-72daf8059f3c%2F4DNFIDBFENL7.hic":"359604894,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ed2e68b-189e-4988-bb6d-94e63240a231%2F4DNFI7XAZNNQ.hic":"5312422266,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6f2b1ce0-5205-4680-981e-d91b694dc3e4%2F4DNFISNGDB53.hic":"2008546759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F73c8147f-bc7d-4d33-8a10-a9e7b413ecc6%2F4DNFI1CIGHYC.hic":"2221847625,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F526ae3e3-32cc-4670-970f-1faa9cfafd4d%2F4DNFIQD2DP2F.hic":"5295591503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e803530-47f8-4c56-bb19-fbdcd578d2f0%2F4DNFINHT8P7C.hic":"3159499486,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe705f38-903f-47b7-9b38-f80ebd18a479%2F4DNFIGF8EM7M.hic":"3490552542,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa197328-d6da-4299-a0fd-409ac9892668%2F4DNFIUPG2ZBJ.hic":"5382003751,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe5d52c4-2be7-4812-bca0-cd4bb3025e6b%2F4DNFIH3OTR14.hic":"3224693110,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21935f61-daa8-4df2-aa69-fcd27953b405%2F4DNFIUATRW3Z.hic":"3835865655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72147527-e3e8-4967-bc45-8251249d76c9%2F4DNFI6V7ZQAE.hic":"4382708138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F589f0919-f54d-49ff-a482-e2f453ef7f34%2F4DNFICKMT1CY.hic":"4479068191,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F861946ca-bad8-4a87-96e1-b2eb20b9ef10%2F4DNFIF9BDCNI.hic":"3698151402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff76346ac-97ec-4893-8984-2b75ce1cdc51%2F4DNFIG5O1OQS.hic":"5704288175,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe8b43826-f049-4c3f-b83a-e75fa7aacc85%2F4DNFIHS2SVBQ.hic":"990025510,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46316260-f555-4dd4-9e40-8ae06ca52822%2F4DNFIU95B69H.hic":"1275878544,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff62ef491-a3ae-4f66-ab33-c5673c9e0b65%2F4DNFIYRROFCR.hic":"1522530503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cd617e1-fad4-4fdc-8b4e-cb277650123c%2F4DNFIF7JN3IU.hic":"1463443128,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb20fe2a-0078-4d4a-8a52-d76043d06f40%2F4DNFIB2RYULQ.hic":"1269529700,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d386fcf-1d22-47de-a0d6-0c3a641ca174%2F4DNFIMVDK3SI.hic":"1185489599,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F00e470bd-c533-41b1-923a-4b471824da12%2F4DNFIRLOTXSC.hic":"978217499,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8774fb3-d0c5-43cc-a6c9-eb0ca39841fb%2F4DNFIZAPX6J8.hic":"1100356082,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fab3b826e-614c-448b-860f-a3ebef68a82f%2F4DNFIQD5VCSD.hic":"1322319877,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66c78d2b-993a-4937-95ed-9e2d302ceb3e%2F4DNFIIF6VAGN.hic":"868885799,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5d106fe1-2d80-466e-87aa-46b38ba142c5%2F4DNFI86IEZXH.hic":"751443267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc99490b6-faf9-413f-9c38-3f53018089d6%2F4DNFIP881SR2.hic":"754427927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F39c7e387-e710-4b1d-b757-357dec03f6ad%2F4DNFI42NNCW8.hic":"1166392978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4742a211-43b1-4325-af6f-82490aeb766b%2F4DNFIEV4PKP6.hic":"1102227476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaa73842-1c86-4ad9-8a9e-c189c0b4c01d%2F4DNFIF1DUQHE.hic":"1206699207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd25f24df-0298-4079-bb6f-1c8e1e32392b%2F4DNFIGW55EAY.hic":"1033358104,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc57a7ab5-2778-4fe2-9d64-9a4e95135f12%2F4DNFISZRU6I4.hic":"1539570262,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd89f494a-27ca-46b6-89be-7583f3f6d18c%2F4DNFIBKKDTAP.hic":"350372180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F06725280-cb24-4f22-a267-18b434bfa79e%2F4DNFIJSRQW24.hic":"314361467,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8fe5c3c5-006f-425b-ac6d-ea475e29be78%2F4DNFI3REN89E.hic":"299665258,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8b6ac5c-13b4-427e-9158-cec0b890b6d8%2F4DNFIF5XLHKM.hic":"235668364,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F01ff33fc-fc23-48aa-a6c6-b720d6fe0768%2F4DNFIB6Q538N.hic":"316494853,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F552978c8-abbc-424a-9187-3e34cf802a97%2F4DNFI3ST3F7Y.hic":"296298411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72e66520-5170-4f2e-844a-fbfd0e23b480%2F4DNFIQT4M6UI.hic":"307691265,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb3eb3953-ffe8-4d5a-970c-a16f3b7b9ec3%2F4DNFIFNCC7M2.hic":"364160436,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F37d413fb-afab-41ff-99aa-1678830f7dde%2F4DNFITM9MDJL.hic":"252412426,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf5db92c-aaf1-4086-a0d2-79b28648f172%2F4DNFI3NTD7B3.hic":"227586640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6892f7b-1f8a-4d7d-9605-c67932cd5654%2F4DNFIBED48O1.hic":"328344868,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd64afb07-5ab1-4c4f-8438-2fee37afa86a%2F4DNFISATK9PF.hic":"379669025,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fad11bb63-8692-461c-b698-89c601451321%2F4DNFISRP84FE.hic":"298491537,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F63710ec5-35d2-47dd-bf9a-08d3daa83d67%2F4DNFI2LY7B73.hic":"303150299,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76077d9e-ca75-4301-ab79-88aa49bda495%2F4DNFIXEB4UZO.hic":"711757090,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F34dd4c0e-3487-4fb4-b95f-c4bb66e0fa31%2F4DNFIQWWATGK.hic":"221304476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F48a8cf86-3248-4a8e-8e85-472ec219d49c%2F4DNFI44JLUSL.hic":"284772724,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee399fbf-2a9e-46e2-8364-457713bff508%2F4DNFIM7Q2FQQ.hic":"330729464,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F124d191a-c5c7-49b6-b84b-0d1bad8bef2b%2F4DNFIZK7W8GZ.hic":"293166018,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe351f7cc-7a2c-4515-ae0b-3bb2f91c986a%2F4DNFIMIMLMD3.hic":"240094740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffd1ae249-57b1-41d6-81a6-16b21dcd8f12%2F4DNFI7QUSU5J.hic":"681762505,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46c92c5c-9ad8-4d49-beba-f35c5cd99208%2F4DNFINXUOI5H.hic":"375594313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7350d40-4e9e-4131-9151-bb539d39b431%2F4DNFIIJR2296.hic":"331322302,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfacf37b-1665-45f3-a046-e29e1544e9b0%2F4DNFIJMZUTXR.hic":"361313244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F234e18fb-9990-43bf-9a48-f72722cfa232%2F4DNFIZQPT9EL.hic":"540421873,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b35ab09-2e79-4876-b2bc-d3a8faa26257%2F4DNFIZIXSZ9J.hic":"545066813,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae5118e-807a-46e0-8e92-143d4b282b3d%2F4DNFIDD9IF9T.hic":"237409149,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb34d7f6f-73f7-4b6b-80c7-c8af0f991549%2F4DNFIVC8OQPG.hic":"355121712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ab169fd-cbdd-4f60-8553-a4c6912ad89e%2F4DNFITUPI4HA.hic":"313085022,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4e53712b-d0d9-40c5-afe1-ffa0fad71e59%2F4DNFI5IZNXIO.hic":"341863906,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a91477f-45eb-4a16-affb-fc131f9326b8%2F4DNFII16KXA7.hic":"248904495,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F153729de-0eca-43cc-9b61-61aa8d775b38%2F4DNFIAAH19VM.hic":"668047244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879fd78a-7165-43d9-a0de-ca158b53df30%2F4DNFIVKIY3KV.hic":"247571318,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f901a4-040b-4b04-9fff-94a1780423cd%2F4DNFIVVCWL6C.hic":"198355985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd5b30c5a-654a-463c-9474-39bdc3ce4500%2F4DNFIJRF2273.hic":"343971277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7070280a-8f03-40d0-9fef-e9d9f4d3dae7%2F4DNFI6FCC9ZA.hic":"312013061,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F47049719-9407-4d76-9048-26231045f642%2F4DNFI1CPQ4O3.hic":"352923267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F862c2b5f-44c2-4bd7-9264-b3ca032d3d8d%2F4DNFISXFEDE9.hic":"271745977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feffbe052-39ff-4217-9871-44199ed90818%2F4DNFIF9L6QEQ.hic":"668409334,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa7791854-1b35-4258-90fb-603c55f24642%2F4DNFIPKASX1Q.hic":"312727920,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79cccad6-a78e-4de9-9fe7-08f7e8df663d%2F4DNFIWXZ4JQZ.hic":"151808553,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7e86e0cc-d6f1-4ce0-aba4-c36c6ebb3c4c%2F4DNFIEMQ1O8V.hic":"700533280,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a1b58d3-9ae6-43e4-91cf-49f1fcbbab33%2F4DNFIYWONU7A.hic":"729050356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67bff264-0b0c-4c5c-9d4d-ff5abef2bbe4%2F4DNFISNIE5FH.hic":"7987657997,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3a6a943f-2cc0-4433-a27d-c89f3fdd3309%2F4DNFIV8MLWJB.hic":"6646216171,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e235711-ba90-404d-b4ac-b15990ea8e33%2F4DNFIXSTDPHL.hic":"3146468238,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c89f4bc-e9fc-4ecf-b868-26108dbb7bb2%2F4DNFIQJNOH8U.hic":"2919703928,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1856ff9e-de7a-4fa1-ae0b-3e04b837b5e1%2F4DNFI57XB4A8.hic":"13417594377,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F099bb5b9-6315-4650-8f78-d603f5a046b3%2F4DNFIQ7UKVZV.hic":"9016468637,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3c7a30-0fc4-410d-8d41-247da3eb105d%2F4DNFIWJY8GHD.hic":"7921314766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda99f429-20ab-4d91-bbfe-f8bdea8ed7b1%2F4DNFIN8NKRNF.hic":"4247121358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0ca0f4e3-30ca-4332-b735-e32dce08e1a4%2F4DNFIZYGEHNZ.hic":"4910404663,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F243f48b0-6b59-4f37-ad39-a12e0986f530%2F4DNFIRPYGAV8.hic":"4220073636,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49f1a890-d458-42a6-9c78-99c38b6c7a8f%2F4DNFI6MZTDM1.hic":"375035361,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76bd4768-9343-44ba-a99d-5500e184e39d%2F4DNFIG3BCGPL.hic":"2422923206,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1ed866-eaf6-4906-aa8c-9e39616dde38%2F4DNFIS9YPJ3L.hic":"1593271574,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1e7a5636-bdb6-45fb-85d8-87a7e908de43%2F4DNFIOWGA9AX.hic":"1632314387,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ecc552a-0a6b-49a9-9aa5-9f3fd9b535fd%2F4DNFINKEDSBF.hic":"1458761024,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c03f1d2-bb25-4c94-b5f5-d5cdd01c14b6%2F4DNFIVIXVUK7.hic":"1504818271,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1a4616ff-6d04-4a6a-9773-b80e81da2471%2F4DNFIANHFY16.hic":"1850724180,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd2231870-a78d-4c8b-9cfd-084f2468acb1%2F4DNFIJ67ZFBI.hic":"1473864703,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F859c2dd3-df8a-42b7-86ea-bf6524f75e80%2F4DNFIG3YQQ4V.hic":"1539822829,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8bad667e-6003-4828-9a20-07585fa9c811%2F4DNFIOLKEOME.hic":"3036353747,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F92ea551b-5779-4d31-a0f5-621e4bd0eb21%2F4DNFIVLN8WJE.hic":"2710426318,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61ee79fa-0617-4083-b121-f92ef3a8905c%2F4DNFI2111XQA.hic":"2589549183,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F83ebb98d-e5db-403d-aa23-875293156c0e%2F4DNFI88HXX7D.hic":"2462367030,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6d63671a-8f1d-4159-82c0-931b43464772%2F4DNFIUBM6QK8.hic":"2486020469,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcccb9014-ce15-4032-81ac-222b3d621cb4%2F4DNFIVILEERC.hic":"2052537210,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a07867-4007-4ca5-b066-25d3168208dc%2F4DNFIF7Q43N4.hic":"2091773428,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff738de0f-358b-44bf-97dd-644c8d9b1b1c%2F4DNFID56VJGW.hic":"878913568,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda97c1d4-bb92-4a77-92a7-f7960f88b9dc%2F4DNFIYUR29KO.hic":"983915575,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F54ea363a-99e7-4f55-861e-1644acab7939%2F4DNFIUDPGHO8.hic":"905253594,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcd66a07-55ee-48d9-a157-419cf4ee3eef%2F4DNFISWC2N8T.hic":"1233576358,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40363837-7466-4a1d-b20d-a66d1670b700%2F4DNFICMPHDMI.hic":"516590777,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0b3fa4e6-caeb-40b4-8942-e9c0b03dfe4f%2F4DNFIKMKN736.hic":"634310295,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6a34050-d52b-4880-91cf-d3fe4b0ce982%2F4DNFIN5NLS49.hic":"650451131,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8e63a47b-9fd4-4772-8b0c-10ee589ffb16%2F4DNFI4P8UBRL.hic":"705655033,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d92b666-30cc-4838-9d46-c1f11cee3d3c%2F4DNFISNC3LAI.hic":"176146197,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17f7dc63-a1bc-4970-b389-87d9ee93b753%2F4DNFIVBWPFD7.hic":"749678512,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8897333-4791-4a83-9444-a653e24aee13%2F4DNFITMQRXB7.hic":"254477361,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8712bf31-33d0-4562-ab0b-a1e9cf4fd30c%2F4DNFIUYD3HBY.hic":"995625724,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfaf6383-9cc6-4b5c-9b20-d3bf2e8c3495%2F4DNFIRRSC7P9.hic":"1149985362,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0b70598-5d17-4e0a-8831-6cbe697e69e2%2F4DNFIWKR8FP6.hic":"1151628407,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fccc094a8-23ce-4fd8-9c4a-41f07c045c8f%2F4DNFIQ74RSUY.hic":"931695969,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8eda16f3-af5e-4f1f-b46d-c74df44b76aa%2F4DNFI9IIO5PW.hic":"1077740364,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff283637b-cf2c-4412-ba00-0e3d7e279fad%2F4DNFI8WGJG19.hic":"812086456,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ad8438f-d3d9-42d8-88bf-42845a0dc2d0%2F4DNFIQ5CCESJ.hic":"652559720,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70e3bdcc-caf4-4822-b9c5-85234873db7a%2F4DNFIWTZHB4H.hic":"760694196,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56ed767d-cd8a-4d38-8047-ed1e8bc8cd19%2F4DNFIENYQCDP.hic":"1159428005,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa912fff9-5f90-42b1-a3a6-cbb9eb2cf861%2F4DNFIFATZWPD.hic":"1033325746,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21338ea5-fdee-4ad8-b61c-608fc6cec4bc%2F4DNFI7YRXKEO.hic":"388142539,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0f88647-5631-437b-b48a-4603915e3714%2F4DNFIUY3J7EW.hic":"407344788,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16926af8-ac3b-4f32-97d5-6c0dc6f1596a%2F4DNFIRKUYKP4.hic":"893352368,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93e39aec-6cde-4c5b-bcdf-283faa3163a2%2F4DNFIAQDBJZP.hic":"489922022,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0dc0b1ba-5509-4464-9814-dfe103ff09a0%2F4DNFIC1CLPK7.hic":"565748333,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb50964c7-b025-49d9-b1ed-289bedb59678%2F4DNFI3A3VYWU.hic":"4597459343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4390cea-b330-4022-88c1-9ff8c0a786f7%2F4DNFI6JJQKFJ.hic":"3678393678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c0f730-5da1-4863-9b7a-6cdd31066cff%2F4DNFIK61ILGM.hic":"3324300994,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14b14ac4-ab59-4754-9c43-eacd9d0638e2%2F4DNFIYD8LO9Z.hic":"3227227120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7386f953-8da9-47b0-acb2-931cba810544%2F4DNFIOTPSS3L.hic":"253942497,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6b5d8bd-27dc-4415-a320-53405a16db85%2F4DNFI525PKU5.hic":"305089653,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f922dbc-637b-4c43-b816-f604f0e79ad1%2F4DNFI8Y9SRP2.hic":"1438589609,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6a36d686-716c-4ba8-a9c3-fa8311791d3c%2F4DNFIP25GZGA.hic":"1419100109,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0e535542-2cf2-46e4-ba10-7a0b946a7fb2%2F4DNFITPO1WTY.hic":"3885296184,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c17d228-5052-4c83-880e-af05118e6929%2F4DNFIG4X5Z5F.hic":"2159245890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc3977c00-525b-4556-9a27-061707f8cb76%2F4DNFIXLYR32S.hic":"587852728,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f856506-cbc5-4211-a29d-48a7530c622e%2F4DNFIWI3V5LI.hic":"2318237793,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F38f77979-5eb7-4b6f-9a60-c2451185db98%2F4DNFI2DGL7LH.hic":"2068150664,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe0992a75-7727-405e-95ac-aa97141b51c1%2F4DNFI1VSO8JP.hic":"1807949651,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe925f1aa-2e7b-44e7-bfa8-2084a613ab13%2F4DNFIV5O2ZYO.hic":"2242134377,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F803a6d3c-3972-4939-8ff2-d195c5192090%2F4DNFIEWEWQ8D.hic":"2981341325,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F25104375-a588-46e6-a382-663cee6c332f%2F4DNFICSTCJQZ.hic":"14592996888,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F927aa8a5-24a5-43b7-807a-1e99ac321459%2F4DNFICEGAHRC.hic":"15431307603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c380474-12cd-41f4-b86f-2a29faf12eec%2F4DNFIY3XPKPO.hic":"2550999291,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77da562e-d0ec-45a8-8764-14fa16d995a1%2F4DNFIK9PS9GM.hic":"3401011629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11b26222-d480-40a7-8d53-3ad8500396cb%2F4DNFIF4Y74JR.hic":"2127593378,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93df02c6-1047-43f6-afae-d3598b61eeea%2F4DNFIBBKG9KD.hic":"5724446278,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cd4378a-8f51-4e65-99eb-15f5c80abf8d%2F4DNFIT4I5C6Z.hic":"5419655766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F067881e5-563d-40de-a9e3-caccad887fbc%2F4DNFI2U38HCE.hic":"14749043471,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcb3da9ad-7afe-4d0c-9c2d-261181e7a95c%2F4DNFIETP228R.hic":"9401474797,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F185b7bcc-7bb7-41b7-9ebe-92d4fe159431%2F4DNFIXKC48TK.hic":"11624295594,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F18459b84-dd43-4af6-a05f-bcb773096322%2F4DNFIFPGOWJ6.hic":"2843730862,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffde1e48c-4a0d-4bb1-b84a-e0e45f9a0aa3%2F4DNFIIRMBE8Y.hic":"5820677927,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbabed539-1f0f-4e87-8815-fde596e6024c%2F4DNFIVUGNDD7.hic":"5170782436,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d00531a-e616-469b-af52-5b028270e2ce%2F4DNFIFLJLIS5.hic":"18917549985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a9dad53-b8af-4cb6-9ce3-5c38e4a855c7%2F4DNFIOX3BGNE.hic":"5482775936,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F82fd7b7e-5f47-48d5-bf0d-daaa48a4674d%2F4DNFISPUVQHA.hic":"2177864938,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4c6680f3-9cf6-452f-9dc5-ecebf376775d%2F4DNFI8649RQJ.hic":"3288850368,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2395f001-19d9-4000-9f00-dae3dea708d6%2F4DNFIE8T8JZ8.hic":"1383191843,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24464fa8-bf96-483c-8e9a-c2f626ad6e19%2F4DNFIBM714BP.hic":"1765204569,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F918fc048-fa27-41d2-a63a-d50c511fbb9a%2F4DNFI6CWNUFL.hic":"2431120602,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ff5a0d1-8e54-4cf0-9fe7-339f147c78da%2F4DNFIZ4F74QR.hic":"3211825957,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F355f0412-cb17-452a-b15c-aba16c5a742c%2F4DNFIOUVOX3R.hic":"5547401083,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cac91c5-160a-4b91-a91e-edc309318dd5%2F4DNFIVTDXW6X.hic":"4797344498,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9ac9ec5-6221-4f39-951a-1c5054fc9f1c%2F4DNFICA8Y9TN.hic":"4277557869,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46f62222-b50a-428b-938b-5444951600eb%2F4DNFIDWM3HN5.hic":"4374808431,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F50e4f2a1-9cb6-4192-8199-64d354bfdf96%2F4DNFIBK5TB3N.hic":"3757387253,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4cdd5a8-1a45-4c6a-906b-a9603260d4c8%2F4DNFI3JYF9VS.hic":"5260534916,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8164e99-5778-427d-be26-f0e1b62400f0%2F4DNFIP1GNKUO.hic":"7589365689,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0d72e78a-fc87-4716-8b8e-6dc5650ff2ef%2F4DNFIQYQWPF5.hic":"22022259901,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac58fc15-48c2-4eec-a689-23b677b4b6e7%2F4DNFIW6H9U3S.hic":"6810897169,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31811e40-e3ca-4456-8ba6-2ee66d6c7104%2F4DNFI7J8BQ4P.hic":"7188744676,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62d81a52-d2cb-4bbd-8510-0fe120e786e0%2F4DNFIA3AKFSU.hic":"1763730692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae0b7513-d1a0-4f27-a9d3-348837f42cb6%2F4DNFID68JQY9.hic":"2422880133,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae6a1a7e-1d2d-4fd2-a89f-1799abac8a9c%2F4DNFIL1FQDXE.hic":"1543814834,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80d343c9-bd60-468a-803d-c3e351a958bc%2F4DNFITSIPCSK.hic":"2344682115,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2d61195-a3a6-4d50-b928-546ca67546cb%2F4DNFIJ88LYHR.hic":"3362742962,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31052aba-773a-4500-961b-e0a518245b0c%2F4DNFIJIPWD63.hic":"2529548812,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc93d0710-3fbf-40cc-b0eb-878e2aa659e4%2F4DNFIZUP2BBI.hic":"491996147,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8660baeb-5be1-4ba5-93e4-66499e9a4587%2F4DNFIEBC4AF3.hic":"2993048734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6d08fbc-b836-4776-82ad-8b1b277ae837%2F4DNFI5VO3E1W.hic":"1949322679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3af004a2-a6fa-46dc-8be8-898b847a77be%2F4DNFIFDGVWLU.hic":"2456400803,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd613b4b-2422-492c-8d8f-8afba9c8a182%2F4DNFITVGFNYZ.hic":"1411204423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc340694f-14f3-4638-b09b-98220c20039a%2F4DNFIOW9TTC1.hic":"2611370588,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3effa71b-6aa3-4265-87ba-f8d709d778d7%2F4DNFIOAA3ZEQ.hic":"3123195980,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde75cf8b-9ce1-44fc-8b7b-ca0adea6bae9%2F4DNFIA5ID1S6.hic":"3496246968,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F714f775d-a5a4-4314-83f8-016b9d73200b%2F4DNFIZYU7V81.hic":"4245592042,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ca518af-6e1e-4777-b67b-0fe7f039ce58%2F4DNFIRV6PVUX.hic":"3981520466,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc29b57d5-c263-4372-b396-ab4f55682f5d%2F4DNFIMEANFBY.hic":"3999623376,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4196d3ef-161a-4c18-a57e-005165c6b32a%2F4DNFIGLGQXLC.hic":"4105683321,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe10828b5-9519-4ceb-81e7-7228bfd890de%2F4DNFILS2HLXC.hic":"3804942111,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaac88c7-9bdc-4b1e-aa9f-e675520dfffa%2F4DNFIQS8853L.hic":"5287726781,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faab371b1-bc8d-4e83-998e-5bb977c443ca%2F4DNFIVBYCYGS.hic":"4657988157,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb116add-af8c-4a3b-b106-9f704ba0a175%2F4DNFIE4WWHMF.hic":"5116727268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F033366e2-05a2-4381-9d48-90122892a9e0%2F4DNFIKDUUC3C.hic":"45638237,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7284a446-442d-4a46-aae5-84987e75a7af%2F4DNFIJ5HIRA2.hic":"62201052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F876649a3-6dd3-463a-8b17-5752a98a89c5%2F4DNFIXDFC7EM.hic":"69878143,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cb4ce4d-d474-459f-8b8a-2159d8df8068%2F4DNFIO35EOVR.hic":"70153114,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5c5612fa-18c2-47fb-8074-693b1054e254%2F4DNFI57QGL6U.hic":"54605055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c1472d-cf3a-41d7-8682-cd03b7cc978d%2F4DNFI2AGEBE5.hic":"67930121,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bf4cce8-6e03-422b-a190-e51d4a07d501%2F4DNFI1E6NJQJ.hic":"4893181511,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0eb3aa56-8a23-435d-a07b-8bb545e8d708%2F4DNFI2DNFM1A.hic":"60466977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1201682a-a223-482d-913d-3c3972b8eb65%2F4DNFIIRIHBR2.hic":"48961678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6aee7913-6356-43cf-affa-f2b60dd478f6%2F4DNFIKXNMT46.hic":"39095246,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F357139a3-c9a5-4343-b0a4-b41c45fd03fd%2F4DNFIRV7IRJP.hic":"70916718,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76be3061-6259-42be-a917-19dcba41517b%2F4DNFIFX1XYKZ.hic":"229197441,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff60c348a-a62c-43c3-ac85-f6c28b5f823f%2F4DNFI64CJUZ5.hic":"112428610,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd0b0a14-9703-49af-bb36-2359f96d4d0e%2F4DNFIBPL2HL1.hic":"73972428,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79ac278d-83f7-4c1f-91b2-05c8018c1426%2F4DNFIBRSIPE4.hic":"415430378,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c3b8141-8e67-4211-80dd-3bae88f9e537%2F4DNFIDLDVY14.hic":"112747303,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae703d2-d85c-4ac4-9ce1-14d653927675%2F4DNFI4R1II4P.hic":"210565448,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76e641af-90be-49f8-b126-12c20f856159%2F4DNFINMLRY95.hic":"1590865292,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b416382-ae5d-469f-9e9a-85a3e2ce9793%2F4DNFI8KBXYNL.hic":"4626496956,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa27589a6-86b2-43a2-8218-1f2232d551e6%2F4DNFI53R5IKA.hic":"1536016455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdd3999f5-b36e-4154-a6b9-446656959a3a%2F4DNFIAWVDQ8C.hic":"2210273411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc377953b-0e61-426b-a905-abab2d5a3002%2F4DNFI9VXTBE2.hic":"3384365692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2dbe0377-1db2-4aae-af2b-d87dff728035%2F4DNFIT96Z365.hic":"7692311974,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcfcb009-f006-4ab8-a4c7-af72be58c12c%2F4DNFITUOMFUQ.hic":"6592120312,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f9073d-b2c5-474e-b3d5-7d72cde555cd%2F4DNFIHLQKDN8.hic":"2647703964,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76968cc8-fb9f-485b-85b2-c9289067194b%2F4DNFIL9M97T2.hic":"6186798917,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87d9330b-8d2c-4e9d-85bb-02e572de7a68%2F4DNFIDWGZLHX.hic":"4379708168,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffc01b381-3665-4225-88ee-2e5e9ecb7324%2F4DNFIMEG1QIC.hic":"3587146533,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3144a03c-15c3-4bf9-95f8-ffad2640a1bf%2F4DNFIWSB66VX.hic":"1529739069,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7d3aac0-ba66-494b-ba0c-147631084b98%2F4DNFIH7TH4MF.hic":"6896300679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b13bd19-fbd1-4c68-8855-4f0158d1ce47%2F4DNFIHKWIZ9T.hic":"1954878455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d04e286-30d4-4add-a806-7a929d36419e%2F4DNFIZBBX795.hic":"1350142414,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa26f261-a88a-4cac-9118-ff8e90ab6f61%2F4DNFI9ZWZ5BS.hic":"3410552807,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24e516ce-0b49-4476-b818-cc96471d8765%2F4DNFIPAI8XB5.hic":"4168518737,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac3b06b5-46d4-4c1e-97e9-9a4f353473a7%2F4DNFI1OUWFSC.hic":"10766406904,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76c6aa27-895f-4e82-8ed8-7a85aca84490%2F4DNFIX4PJKXZ.hic":"1463157350,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe6fbe03a-997b-4d72-a3cc-f1ed7bd88a92%2F4DNFIZGCA8AH.hic":"1597664180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61d99a87-4ec6-4116-be99-b483999641c4%2F4DNFI5CGQ46V.hic":"2870576870,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F271ea8cd-53b9-44c9-9fff-1bb5c444b54c%2F4DNFIOCW5AEM.hic":"2463600138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa98ca64a-861a-4a8c-92e9-586af457b1fb%2F4DNFI1UEG1HD.hic":"22480709268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5809b32e-0aea-4cf5-a174-cf162d591a35%2F4DNFI9YAVTI1.hic":"3141182061,25900"};const Qd="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,Ud=new class{constructor(e){this.wait=void 0===e?100:e,this.isCalled=!1,this.calls=[]}limiter(e){const t=this;let i=function(){t.calls.length&&!t.isCalled&&(t.isCalled=!0,t.calls.shift().call(),setTimeout((function(){t.isCalled=!1,i()}),t.wait))};return function(){t.calls.push(e.bind(this,...arguments)),i()}}}(100);class jd{constructor(e){if(e.alert&&(this.alert=e.alert),this.config=e,this.loadFragData=e.loadFragData,this.fragmentSitesCache={},this.normVectorCache=new Od(10),this.normalizationTypes=["NONE"],this.matrixCache=new Od(10),this.blockCache=new $d,e.file)this.file=e.file;else if(e.blob)this.file=new Nd(e.blob);else{if(!(e.url||e.path&&!Qd))throw e.path?Error("path property is deprecated, use NodeLocalFile"):Error("Arguments must include file, blob, url, or path");{this.url=e.url||this.path,this.remote=!0;const i=new Ed(e);(t=this.url).indexOf("drive.google.com")>=0||t.indexOf("www.googleapis.com/drive")>0?this.file=new Md(i,Ud):this.file=i}}var t}async init(){this.initialized||(await this.readHeaderAndFooter(),this.initialized=!0)}async getVersion(){if(void 0===this.version){const e=await this.file.read(0,128);if(!e)return;const t=new Dd(new DataView(e));return this.magic=t.getString(),this.version=t.getInt(),this.version}return this.version}async getMetaData(){return await this.init(),this.meta}async readHeaderAndFooter(){let e=await this.file.read(0,16);if(!e||0===e.byteLength)throw Error("File content is empty");let t=new Dd(new DataView(e));if(this.magic=t.getString(),this.version=t.getInt(),this.version<5)throw Error("Unsupported hic version: "+this.version);this.footerPosition=t.getLong(),await this.readFooter();const i=Object.values(this.masterIndex).reduce(((e,t)=>Math.min(e,t.start)),Number.MAX_VALUE),n=i-16;e=await this.file.read(16,n),t=new Dd(new DataView(e)),this.genomeId=t.getString(),this.version>=9&&(this.normVectorIndexPosition=t.getLong(),this.normVectorIndexSize=t.getLong()),this.attributes={};let r=t.getInt();for(;r-- >0;)this.attributes[t.getString()]=t.getString();this.chromosomes=[],this.chromosomeIndexMap={};let s=t.getInt(),o=0;for(;s-- >0;){const e={index:o,name:t.getString(),size:this.version<9?t.getInt():t.getLong()};"all"===e.name.toLowerCase()&&(this.wholeGenomeChromosome=e,this.wholeGenomeResolution=Math.round(2*e.size)),this.chromosomes.push(e),this.chromosomeIndexMap[e.name]=e.index,o++}this.bpResolutions=[];let a=t.getInt();for(;a-- >0;)this.bpResolutions.push(t.getInt());if(this.loadFragData){this.fragResolutions=[];let e=t.getInt();if(e>0)for(;e-- >0;)this.fragResolutions.push(t.getInt())}this.chrAliasTable={};for(let e of Object.keys(this.chromosomeIndexMap))e.startsWith("chr")?this.chrAliasTable[e.substr(3)]=e:"MT"===e?this.chrAliasTable.chrM=e:this.chrAliasTable["chr"+e]=e;this.meta={version:this.version,genome:this.genomeId,chromosomes:this.chromosomes,resolutions:this.bpResolutions}}async readFooter(){const e=this.version<9?8:12;let t=await this.file.read(this.footerPosition,e);if(!t)return null;let i=new Dd(new DataView(t));const n=this.version<9?i.getInt():i.getLong();let r=i.getInt();const s=196*r;for(t=await this.file.read(this.footerPosition+e,Math.min(s,n)),i=new Dd(new DataView(t)),this.masterIndex={};r-- >0;){const e=i.getString(),t=i.getLong(),n=i.getInt();this.masterIndex[e]={start:t,size:n}}if(this.expectedValueVectors={},this.version>5){const e=this.version<9?4:8;this.normExpectedValueVectorsPosition=this.footerPosition+e+n}return this}async printIndexStats(){let e,t=0,i=0;await await this.init();for(let n of Object.keys(this.masterIndex)){const r=this.masterIndex[n];t+=r.size,r.size>i&&(i=r.size,e=n)}console.log(`${i} ${e} ${this.config.url}`)}async getMatrix(e,t){const i=Hd.getKey(e,t);if(this.matrixCache.has(i))return this.matrixCache.get(i);{const n=await this.readMatrix(e,t);return this.matrixCache.set(i,n),n}}async readMatrix(e,t){if(await this.init(),e>t){const i=e;e=t,t=i}const i=Hd.getKey(e,t),n=this.masterIndex[i];if(!n)return;const r=await this.file.read(n.start,n.size);return r?Hd.parseMatrix(r,this.chromosomes):void 0}async getContactRecords(e,t,i,n,r,s=!1){await this.init();const o=this.chromosomeIndexMap[this.getFileChrName(t.chr)],a=this.chromosomeIndexMap[this.getFileChrName(i.chr)];if(o>a||o===a&&t.start>=i.end){const e=t;t=i,i=e}const c=await this.getBlocks(t,i,n,r);if(!c||0===c.length)return[];const l=[],h=t.start/r,d=t.end/r,u=i.start/r,f=i.end/r,p=Math.floor(h),g=Math.ceil(d),m=Math.floor(u),w=Math.ceil(f);for(let o of c)if(o){let a,c,b=e&&"NONE"!==e;const F=this.getFileChrName(t.chr),v=this.getFileChrName(i.chr);if(b){const t=await this.getNormalizationVector(e,F,n,r),i=F===v?t:await this.getNormalizationVector(e,v,n,r);t&&i?(a=await t.getValues(p,g),c=await i.getValues(m,w)):b=!1}for(let e of o.records)if(s||e.bin1>=h&&e.bin1<d&&e.bin2>=u&&e.bin2<f)if(b){const t=e.bin1,i=e.bin2,n=a[t-p]*c[i-m];if(0!==n&&!isNaN(n)){const r=e.counts/n;l.push(new Pd(t,i,r))}}else l.push(e);void 0===this.percentile95&&o.records.length>10&&(this.percentile95=Kd(o.records,95))}return l}async getBlocks(e,t,i,n){const r=(e,t)=>`${t.getKey()}_${e}`;await this.init();const s=this.getFileChrName(e.chr),o=this.getFileChrName(t.chr),a=this.chromosomeIndexMap[s],c=this.chromosomeIndexMap[o];if(void 0===a)return console.log("No chromosome named: "+e.chr),[];if(void 0===c)return console.log("No chromosome named: "+t.chr),[];const l=await this.getMatrix(a,c);if(!l)return console.log("No matrix for "+e.chr+"-"+t.chr),[];const h=l.getZoomData(n,i);if(!h){let i=`No data avalailble for resolution: ${n} for map ${e.chr}-${t.chr}`;throw new Error(i)}const d=h.getBlockNumbers(e,t,this.version),u=[],f=[];for(let e of d){const t=r(e,h);this.blockCache.has(n,t)?u.push(this.blockCache.get(n,t)):f.push(e)}const p=f.map((e=>this.readBlock(e,h))),g=await Promise.all(p);for(let e of g)e&&this.blockCache.set(n,r(e.blockNumber,h),e);return u.concat(g)}async readBlock(e,t){const i=await t.blockIndex.getBlockIndexEntry(e);if(i){let n=await this.file.read(i.filePosition,i.size);if(!n)return;n=new Ki(new Uint8Array(n)).buffer;const r=new Dd(new DataView(n)),s=r.getInt(),o=[];if(this.version<7)for(let e=0;e<s;e++){const e=r.getInt(),t=r.getInt(),i=r.getFloat();o.push(new Pd(e,t,i))}else{const e=r.getInt(),t=r.getInt(),i=1===r.getByte(),n=!(this.version<9)&&1==r.getByte(),s=!(this.version<9)&&1==r.getByte(),a=r.getByte();if(1===a){const a=s?r.getInt():r.getShort();for(let c=0;c<a;c++){const a=t+(s?r.getInt():r.getShort()),c=n?r.getInt():r.getShort();for(let t=0;t<c;t++){const t=e+(n?r.getInt():r.getShort()),s=i?r.getFloat():r.getShort();o.push(new Pd(t,a,s))}}}else{if(2!=a)throw new Error("Unknown block type: "+a);{const n=r.getInt(),s=r.getShort();for(let a=0;a<n;a++){const n=Math.floor(a/s),c=e+(a-n*s),l=t+n;if(i){const e=r.getFloat();isNaN(e)||o.push(new Pd(c,l,e))}else{const e=r.getShort();-32768!=e&&o.push(new Pd(c,l,e))}}}}}return new Wd(e,t,o,i)}}async hasNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Gd(e,r,i.toString(),n),o=await this.getNormVectorIndex();return o&&o[s]}async isNormalizationValueAvailableAtResolution(e,t,i,n){let r;if(Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}return void 0!==(await this.getNormVectorIndex())[Gd(e,r,i.toString(),n)]}async getNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Gd(e,r,i.toString(),n);if(this.normVectorCache.has(s))return this.normVectorCache.get(s);const o=await this.getNormVectorIndex();if(!o)return void console.log("Normalization vectors not present in this file");if(!1===await this.isNormalizationValueAvailableAtResolution(e,t,i,n)){const t=`Normalization option ${e} not available at resolution ${n}. Will use NONE.`;return console.log(t),void(this.alert&&this.alert(t))}const a=o[s],c=await this.file.read(a.filePosition,8);if(!c)return;const l=new Dd(new DataView(c)),h=this.version<9?l.getInt():l.getLong(),d=this.version<9?8:4,u=this.version<9?a.filePosition+4:a.filePosition+8,f=new Vd(this.file,u,h,d);return this.normVectorCache.set(s,f),f}async getNormVectorIndex(){if(!(this.version<6)){if(!this.normVectorIndex){if(!this.config.nvi&&this.remote&&this.url){const e=new URL(this.url),t=encodeURIComponent(e.hostname+e.pathname);qd.hasOwnProperty(t)&&(this.config.nvi=qd[t])}if(this.config.nvi){const e=decodeURIComponent(this.config.nvi).split(","),t={start:parseInt(e[0]),size:parseInt(e[1])};return this.readNormVectorIndex(t)}try{return await this.readNormExpectedValuesAndNormVectorIndex(),this.normVectorIndex}catch(e){"416"===e.code||416===e.code?this.normExpectedValueVectorsPosition=void 0:console.error(e)}}return this.normVectorIndex}}async getNormalizationOptions(){return await this.getNormVectorIndex(),this.normalizationTypes}async readNormVectorIndex(e){await this.init(),this.normalizationVectorIndexRange=e;const t=await this.file.read(e.start,e.size),i=new Dd(new DataView(t));this.normVectorIndex={};let n=i.getInt();for(;n-- >0;)this.parseNormVectorEntry(i);return this.normVectorIndex}async readNormExpectedValuesAndNormVectorIndex(){if(await this.init(),void 0===this.normExpectedValueVectorsPosition)return;const e=await this.skipExpectedValues(this.normExpectedValueVectorsPosition);let t=4,i=await this.file.read(e,4);if(0===i.byteLength)return;const n=new Dd(new DataView(i)).getInt(),r={start:e+t,size:30*n};i=await this.file.read(r.start,r.size),this.normalizedExpectedValueVectors={},this.normVectorIndex={},await async function i(n,r){const s=new Dd(new DataView(r));for(;n-- >0;){if(s.available()<100){n++,t+=s.position;const r=Math.max(1e3,30*n),o={start:e+t,size:r},a=await this.file.read(o.start,o.size);return i.call(this,n,a)}this.parseNormVectorEntry(s)}t+=s.position}.call(this,n,i),this.config.nvi=e.toString()+","+t}async skipExpectedValues(e){const t=this.version,i=new Rd({file:this.file,size:256e3}),n={start:e,size:4},r=await i.read(n.start,n.size),s=new Dd(new DataView(r)).getInt();return 0===s?e+4:async function e(n,r){let s={start:n,size:500},o=0,a=n,c=await i.read(s.start,s.size),l=new Dd(new DataView(c));l.getString(),l.getString(),l.getInt();const h=t<9?l.getInt():l.getLong();o+=l.position+h*(t<9?8:4),s={start:n+o,size:4},c=await i.read(s.start,s.size),l=new Dd(new DataView(c));const d=l.getInt();return o+=4+d*(4+(t<9?8:4)),r--,0===r?a+o:e(a+o,r)}(e+4,s)}getZoomIndexForBinSize(e,t){let i;if("BP"===(t=t||"BP"))i=this.bpResolutions;else{if("FRAG"!==t)throw new Error("Invalid unit: "+t);i=this.fragResolutions}for(let t=0;t<i.length;t++)if(i[t]===e)return t;return-1}parseNormVectorEntry(e){const t=e.getString(),i=e.getInt(),n=e.getString(),r=e.getInt(),s=e.getLong(),o=this.version<9?e.getInt():e.getLong(),a=t+"_"+i+"_"+n+"_"+r;this.normalizationTypes.includes(t)||this.normalizationTypes.push(t),this.normVectorIndex[a]={filePosition:s,size:o}}getFileChrName(e){return this.chrAliasTable.hasOwnProperty(e)?this.chrAliasTable[e]:e}}function Gd(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}class Wd{constructor(e,t,i,n){this.blockNumber=e,this.zoomData=t,this.records=i,this.idx=n}}class $d{constructor(){this.resolution=void 0,this.map=new Od(6)}set(e,t,i){this.resolution!==e&&this.map.clear(),this.resolution=e,this.map.set(t,i)}get(e,t){return this.resolution===e?this.map.get(t):void 0}has(e,t){return this.resolution===e&&this.map.has(t)}}function Kd(e,t){const i=e.map((e=>e.counts));i.sort((function(e,t){return e-t}));return i[Math.floor(t/100*e.length)]}class Yd{constructor(e,t){this.config=e,this.genome=t,this.hicFile=e._hicFile?e._hicFile:new jd(e),e._hicFile=void 0}async getHeader(){return await this.hicFile.init(),this.hicFile}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){this.hicFile.initialized||await this.hicFile.init();const s=this.hicFile.bpResolutions,o=s[s.length-1];return(await this.hicFile.getContactRecords(void 0,{chr:e,start:t,end:i},{chr:"celltype",start:0,end:1e8},"BP",o)).map((t=>{const i=t.bin1*o;return{chr:e,start:i,end:i+o,value:t.counts,sample:t.bin2.toString()}}))}supportsWholeGenome(){return!1}}function Xd(e,t){const i=new Set(e.attributeNames),n=t[0];if(void 0===e.getAttributes(n))return!1;{const t=Object.keys(e.getAttributes(n));for(const e of t)if(!1===i.has(e))return!1}return!0}class Zd extends Pa{#y=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),this.type=e.type||"seg","maf"===this.type&&(this.type="mut"),this.isLog=e.isLog,this.displayMode=e.displayMode||"EXPANDED",this.height=e.height||300,this.maxHeight=e.maxHeight||500,this.squishedRowHeight=e.sampleSquishHeight||e.squishedRowHeight||2,this.expandedRowHeight=e.sampleExpandHeight||e.expandedRowHeight||13,this.sampleHeight=this.squishedRowHeight,this.sampleKeys=[],e.samples){for(let t of e.samples)this.sampleKeys.push(t);this.explicitSamples=!0}if(e.color)this.color=e.color;else if(e.colorTable)this.colorTable=new Yn(e.colorTable);else if("mut"===this.type)this.colorTable=new Yn(tu);else this.posColorScale=new gl(e.posColorScale||Jd),this.negColorScale=new gl(e.negColorScale||eu);const t=Object.assign({},this.config);t.maxWGCount=t.maxWGCount||Number.MAX_SAFE_INTEGER,"shoebox"===this.type?(this.featureSource=new Yd(t,this.browser.genome),this.height=e.height||500,this.maxHeight=e.maxHeight||800,this.isLog=!1,this.squishedRowHeight=e.squishedRowHeight||1,this.displayMode=e.displayMode||"SQUISHED",this.visibilityWindow=void 0===e.visibilityWindow?1e6:e.visibilityWindow):this.featureSource=Hl(t,this.browser.genome),this.initialSort=e.sort}async postInit(){"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader(),this.disposed)||(this.header&&this.setTrackProperties(this.header),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor)}menuItemList(){const t=[];if(!0===Xd(this.browser.sampleInfo,this.sampleKeys)){t.push("<hr/>"),t.push("Sort by attribute:");for(const r of this.browser.sampleInfo.attributeNames){if(this.sampleKeys.some((e=>{const t=this.browser.sampleInfo.getAttributes(e);return t&&t[r]}))){const s=document.createElement("div");function o(){const e=this.#y.get(r)||1;this.sortByAttribute(r,e),this.#y.set(r,-1*e),this.config.sort={option:"ATTRIBUTE",attribute:r,direction:1===e?"ASC":"DESC"}}s.innerHTML=` ${r.split(rd.emptySpaceReplacement).join(" ")}`,t.push({element:s,click:o})}}}const i={SQUISHED:"Squish",EXPANDED:"Expand",FILL:"Fill"};if("shoebox"===this.type&&this.sbColorScale){function a(e){this.browser.inputDialog.present({label:"Color Scale Threshold",value:this.sbColorScale.threshold,callback:()=>{const e=Number(this.browser.inputDialog.value,10);e&&(this.sbColorScale.setThreshold(e),this.trackView.repaintViews())}},e)}t.push("<hr/>"),t.push({element:e("<div>Set color scale threshold</div>"),dialog:a})}t.push("<hr/>"),t.push("DisplayMode:");const n="seg"===this.type||"shoebox"===this.type?["SQUISHED","EXPANDED","FILL"]:["SQUISHED","EXPANDED"];for(let c of n)t.push({element:Ta(i[c],c===this.displayMode),click:function(){this.displayMode=c,this.config.displayMode=c,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.trackView.moveScroller(this.trackView.sampleNameViewport.trackScrollDelta)}});return t}hasSamples(){return!0}getSamples(){return{names:this.sampleKeys,height:this.sampleHeight,yOffset:0}}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:t,end:i});if(this.updateSampleKeys(n),this.initialSort){const e=this.initialSort;if(void 0===e.option||"VALUE"===e.option.toUpperCase())this.sortByValue(e,n);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="DESC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return n}draw({context:e,pixelTop:t,pixelWidth:i,pixelHeight:n,features:r,bpPerPixel:s,bpStart:o}){if(fr.fillRect(e,0,t,i,n,{fillStyle:"rgb(255, 255, 255)"}),r&&r.length>0){if(this.checkForLog(r),"shoebox"===this.type&&!this.sbColorScale){const e=this.featureSource.hicFile.percentile95||2e3;this.sbColorScale=new Sd({threshold:e,r:0,g:0,b:255})}const a={};let c;switch(this.sampleKeys.forEach((function(e,t){a[e]=t})),this.displayMode){case"FILL":this.sampleHeight=n/this.sampleKeys.length,c=0;break;case"SQUISHED":this.sampleHeight=this.squishedRowHeight,c=0;break;default:this.sampleHeight=this.expandedRowHeight,c=1}const l=this.sampleHeight;for(let e of r)e.pixelRect=void 0;const h=t+n,d=o+i*s+1,u=s;this.sampleYStart=void 0;for(let i of r){if(i.end<o||i.start>d)continue;const n=i.sampleKey||i.sample;i.row=a[n];const r=i.row*l+c;void 0===this.sampleYStart&&(this.sampleYStart=r);if(r+l<t||r>h)continue;const s=Math.max(i.start,o);let f=Math.round((s-o)/u);const p=Math.min(i.end,d),g=Math.round((p-o)/u);let m,w,b=Math.max(1,g-f);if(this.color?m="function"==typeof this.color?this.color(i):this.color:this.colorTable&&(m=this.colorTable.getColor(i.value.toLowerCase())),"mut"===this.type)w=l-2*c,b<3&&(b=3,f-=1);else if("shoebox"===this.type){m=this.sbColorScale.getColor(i.value);let e=l;if(l<.25){const t=.1+2*Math.abs(t.value);e=Math.min(1,t*l)}w=e-2*c}else{let e=i.value;this.isLog||(e=ln(e/2)),m=e<-.1?this.negColorScale.getColor(e):e>.1?this.posColorScale.getColor(e):"white";let t=l;if(l<.25){const i=.1+2*Math.abs(e);t=Math.min(1,i*l)}w=t-2*c}i.pixelRect={x:f,y:r,w:b,h:w},e.fillStyle=m,e.fillRect(f,r,b,w)}}}checkForLog(e){if(void 0===this.isLog){this.isLog=!1;for(let t of e)if(t.value<0)return void(this.isLog=!0)}}computePixelHeight(e){if(!e)return 0;const t="SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight;return this.updateSampleKeys(e),this.sampleKeys.length*t}async sortByValue(e,t){const i=e.chr;let n,r;if(e.position?(n=e.position-1,r=n+1):(n=e.start,r=e.end),t||(t=await this.featureSource.getFeatures({chr:i,start:n,end:r})),!t)return;this.updateSampleKeys(t);const s={},o="ASC"===e.direction?1:-1,a=()=>{const e=r-n+1;for(let i of t){if(i.end<n)continue;if(i.start>r)break;const t=Math.max(n,i.start),o=(Math.min(r,i.end)-t)/e,a=i.sampleKey||i.sample,c=s[a]||0;s[a]=c+o*i.value}this.sampleKeys.sort((function(e,t){let i=s[e],n=s[t];return i||(i=o*Number.MAX_VALUE),n||(n=o*Number.MAX_VALUE),i===n?0:i>n?o:-1*o}))},c=()=>{for(let e of t){if(e.end<n)continue;if(e.start>r)break;const t=e.sampleKey||e.sample;(!s.hasOwnProperty(t)||e.value.localeCompare(s[t])>0)&&(s[t]=e.value)}this.sampleKeys.sort((function(e,t){let i=s[e]||"",n=s[t]||"";return o*i.localeCompare(n)}))};"mut"===this.type?c():a(),this.trackView.repaintViews()}sortByAttribute(e,t){this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}clickedFeatures(e){const t=super.clickedFeatures(e),i=e.y;return t.filter((function(e){const t=e.pixelRect;return t&&i>=t.y&&i<=t.y+t.h}))}hoverText(e){const t=this.clickedFeatures(e);if(t&&t.length>0)return`${t[0].sample}: ${t[0].value}`}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){i.length>0&&(i.push("<hr/>"),i.push("<hr/>"));const t=e._f||e,n="function"==typeof t.popupData?t.popupData(this.type,this.browser.genome.id):this.extractPopupData(t);Array.prototype.push.apply(i,n)}return i}contextMenuItemList(e){const t=e.genomicLocation,i=t=>{const i=e.viewport.cachedFeatures;this.sortByValue(t,i)},n=e.referenceFrame.toBP(2.5);return["DESC","ASC"].map((r=>{const s="DESC"===r?"descending":"ascending";return{label:"seg"===this.type||"shoebox"===this.type?`Sort by value (${s})`:`Sort by type (${s})`,click:()=>{const s={option:"VALUE",direction:r,chr:e.referenceFrame.chr,start:Math.floor(t-n),end:Math.floor(t+n)};i(s),this.config.sort=s}}}))}get supportsWholeGenome(){return(!1===this.config.indexed||!this.config.indexURL)&&!1!==this.config.supportsWholeGenome}updateSampleKeys(e){if(this.explicitSamples)return;const t=new Set(this.sampleKeys);for(let i of e){const e=i.sampleKey||i.sample;t.has(e)||(this.sampleKeys.push(e),t.add(e))}}}const Jd={low:.1,high:1.5,lowColor:"rgb(255,255,255)",highColor:"rgb(255,0,0)"},eu={low:-1.5,high:-.1,lowColor:"rgb(0,0,255)",highColor:"rgb(255,255,255)"},tu={indel:"rgb(0,200,0)","targeted region":"rgb(236,155,43)",truncating:"rgb(\t150,0,0)","non-coding transcript":"rgb(0,0,150)",synonymous:"rgb(109,165,95)",silent:"rgb(109,135,80)",missense_mutation:"rgb(72,130,187)",missense:"rgb(72,130,187)","splice site":"rgb(143,83,155)",splice_region:"rgb(143,83,155)",nonsense:"rgb(216, 57,81)",nonsense_mutation:"rgb(216, 57,81)",frame_shift_del:"rgb(226,135,65)",frame_shift_ins:"rgb(226,135,65)",in_frame_del:"rgb(247,235,94)",in_frame_ins:"rgb(247,235,94)","*other*":"rgb(159,91,50)"};class iu{constructor(e){this.paired=!0,this.firstAlignment=e,this.chr=e.chr,this.readName=e.readName,e.start<e.mate.position?(this.start=e.start,this.scStart=e.scStart,this.connectingStart=e.start+e.lengthOnRef,this.connectingEnd=e.mate.position):(this.start=e.mate.position,this.scStart=this.start,this.connectingStart=e.mate.position,this.connectingEnd=e.start),this.end=Math.max(e.mate.position,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start;let t=Math.max(this.end,e.scStart+e.scLengthOnRef);this.scLengthOnRef=t-this.scStart}setSecondAlignment(e){this.secondAlignment=e;const t=this.firstAlignment;e.start>t.start?this.connectingEnd=e.start:this.connectingStart=e.start+e.lengthOnRef,this.start=Math.min(t.start,e.start),this.end=Math.max(t.start+t.lengthOnRef,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start,this.scStart=Math.min(t.scStart,e.scStart);const i=Math.max(t.scStart+t.scLengthOnRef,e.scStart+e.scLengthOnRef);this.scLengthOnRef=i-this.scStart}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}alignmentContaining(e,t){return this.firstAlignment.containsLocation(e,t)?this.firstAlignment:this.secondAlignment&&this.secondAlignment.containsLocation(e,t)?this.secondAlignment:void 0}popupData(e){let t=this.firstAlignment.popupData(e);return this.secondAlignment&&(t.push("-------------------------------"),t=t.concat(this.secondAlignment.popupData(e))),t}isPaired(){return!0}isMateMapped(){return!0}isProperPair(){return this.firstAlignment.isProperPair()}get fragmentLength(){return Math.abs(this.firstAlignment.fragmentLength)}get firstOfPairStrand(){return this.firstAlignment.firstOfPairStrand}get pairOrientation(){return this.firstAlignment.pairOrientation}hasTag(e){return this.firstAlignment.hasTag(e)||this.secondAlignment&&this.secondAlignment.hasTag(e)}getGroupValue({option:e,tag:t}){switch(e){case"strand":return this.isNegativeStrand()?"-":"+";case"FIRST_IN_PAIR_STRAND":return this.isPaired()?this.isFirstOfPair()?this.isNegativeStrand()?"-":"+":this.isSecondOfPair()?this.isNegativeStrand()?"+":"-":void 0:void 0;case"START":return this.start;case"INSERT_SIZE":return this.fragmentLength;case"MATE_CHR":return this.mate?this.mate.chr:void 0;case"MQ":return this.mq;case"ALIGNED_READ_LENGTH":return this.lengthOnRef;case"TAG":return this.tags()[t];case"PHASE":return this.tags().HP;case"READ_ORDER":return this.isPaired()&&this.isFirstOfPair()?"FIRST":this.isPaired()&&this.isSecondOfPair()?"SECOND":"";default:return}}}class nu{static instances=new Map;static getKey(e,t,i){const n=""+e+t+i;return nu.instances.has(n)||nu.instances.set(n,new nu(e,t,i)),nu.instances.get(n)}constructor(e,t,i){this.base=e,this.strand=t,this.modification=i,this.canonicalBase="+"===this.strand?this.base:ao(this.base)}getCanonicalBase(){}toString(){return""+this.base+this.strand+this.modification}static compare(e,t){const i=e.modification,n=t.modification;return i===n?e.strand.charAt(0)-t.strand.charAt(0):ru.has(i)&ru.has(n)?ru.get(i)-ru.get(n):ru.has(i)?1:ru.has(n)?-1:i>n?1:-1}}const ru=new Map(["NONE_C","NONE_T","NONE_G","NONE_A","m","h","f","c","C","g","e","b","T","U","a","A","o","G","n","N"].map(((e,t)=>[e,t])));class su{constructor(e,t,i,n){this.base=e,this.modification=i,this.strand=t,this.likelihoods=n,this.canonicalBase="+"==this.strand?this.base:ao(this.base),this.key=nu.getKey(e,t,i)}containsPosition(e){return this.likelihoods.has(e)}is5mC(){return this.modification.equals("m")&&("C"===this.base&&"+"===this.strand||"G"===this.base&&"-"===this.strand)}fullName(){return ou.get(this.modification)||this.modification}}const ou=new Map;ou.set("m","5mC"),ou.set("h","5hmC"),ou.set("f","5fC"),ou.set("c","5caC"),ou.set("g","5hmU"),ou.set("e","5fU"),ou.set("b","5caU"),ou.set("a","6mA"),ou.set("o","8xoG"),ou.set("n","Xao"),ou.set("C","Unknown C"),ou.set("T","Unknown T"),ou.set("A","Unknown A"),ou.set("G","Unknown G"),ou.set("N","Unknown");const au=new Map([["m","5mC"],["h","5hmC"],["f","5fC"],["c","5caC"],["g","5hmU"],["e","5fU"],["b","5caU"],["a","6mA"],["o","8xoG"],["n","Xao"],["C","Unknown C"],["T","Unknown T"],["A","Unknown A"],["G","Unknown G"],["N","Unknown"]]);function cu(e){return au.has(e)?au.get(e):"Uknown"}function lu(e){if(!e)return!1;const t=e.length;if(0==t)return!1;for(let i=0;i<t;i++){const t=e.charAt(i);if(t<"0"||t>"9")return!1}return!0}function hu(e){return e<0?e+256:e}class du{allModifications=new Set;simplexModifications=new Set;maxLikelihoods=new Map;nomodLikelihoods=new Map;lastThreshold;incrementCounts(e){if(!e.blocks)return;const t=e.getBaseModificationSets();if(t)for(let i of e.blocks)if("S"!==i.type)for(let e=0;e<i.len;e++){let n,r=e+i.seqOffset,s=0,o=-1,a=255;for(let e of t){const t=nu.getKey(e.base,e.strand,e.modification);this.allModifications.add(t);const i=e.likelihoods;if(e.containsPosition(r)){const c=hu(i.get(r));a-=c,c>o&&(s=e.canonicalBase,o=c,n=t)}}if(0!=s){const t=i.start+e,r=nu.getKey(s,"+","NONE_"+s);this.allModifications.add(r);const c=(e,t,i,n)=>{let r=n.get(i);r||(r=new Map,n.set(i,r));let s=r.get(e);s||(s=[],r.set(e,s)),s.push(t)};c(t,o,n,this.maxLikelihoods),a>o?c(t,a,r,this.nomodLikelihoods):c(t,o,n,this.nomodLikelihoods)}}}getCount(e,t,i,n){this.lastThreshold=i;const r=255*i,s=n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t);if(!s)return 0;const o=s.get(e);if(o){let e=0;for(let t of o){hu(t)>=r&&e++}return e}return 0}getLikelihoodSum(e,t,i,n){this.lastThreshold=i;const r=255*i,s=(n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t)).get(e);if(s){let e=0;for(let t of s){const i=hu(t);i>=r&&(e+=i)}return e}return 0}popupData(e,t){const i=[];i.push("<b>Modifications with likelihood > "+100*this.lastThreshold+"%</b>");for(let n of this.maxLikelihoods.keys()){if(this.maxLikelihoods.get(n).has(e)){let r="basemod2"===t;const s=this.getCount(e,n,this.lastThreshold,r);if(s>0){const t=this.getLikelihoodSum(e,n,this.lastThreshold,r)/s*.3921568,o=cu(n.modification);i.push(o+" ("+n.base+n.strand+"): "+s+" @ average likelihood "+Math.round(t)+"%")}}}return i}computeSimplex(){const e=new Set(Array.from(this.allModifications).filter((e=>"-"===e.strand)).map((e=>e.modification)));for(let t of this.allModifications)"+"!==t.strand||e.has(t.modification)||(this.simplexModifications.add(t.modification),this.simplexModifications.add("NONE_"+t.getCanonicalBase()))}}class uu{constructor(){this.alignments=[],this.score=void 0}findAlignment(e,t=!1){const i=(e,i)=>i>=e.start&&i<e.start+(t?e.fragmentLength:e.lengthOnRef);let n;for(let r=0;r<this.alignments.length;r++){const s=this.alignments[r];if(e>=s.start&&e<s.start+(t?s.fragmentLength:s.lengthOnRef)){s.paired?s.firstAlignment&&i(s.firstAlignment,e)?n=s.firstAlignment:s.secondAlignment&&i(s.secondAlignment,e)&&(n=s.secondAlignment):n=s;break}}return n}getSortValue({position:e,option:t,tag:i,sortAsPairs:n},r){t||(t="BASE");const s=this.findAlignment(e,n);if(void 0===s)return Number.MAX_VALUE;switch(t){case"NUCLEOTIDE":case"BASE":return function(e,t,i){let n;const r=Math.floor(i)-t.start;r<t.sequence.length&&(n=t.sequence.charAt(r));if(!n)return 0;const s=e.readBaseAt(i),o=e.readBaseQualityAt(i),a=t.coverageMap,c=Math.floor(i-a.bpStart),l=a.coverage[c];let h=0;if(e.insertions)for(let t of e.insertions)t.start===i&&(h=-l.ins);if(s)if(n=n.toUpperCase(),"N"===s&&0===h)h=2;else if(n!==s&&"="!==s||0!==h){if("X"===s||n!==s){h-=l["pos"+s]+l["neg"+s]+o/1e3}}else h=4-o/1e3;else{const e=l.del;e>0?h-=e:0===h&&(h=1)}return h}(s,r,e);case"strand":return s.strand?1:-1;case"START":return s.start;case"TAG":return s.tags()[i];case"READ_NAME":return s.readName;case"INSERT_SIZE":return-Math.abs(s.fragmentLength);case"GAP_SIZE":return-s.gapSizeAt(e);case"MATE_CHR":return s.mate?s.mate.chr:Number.MAX_VALUE;case"MQ":return void 0===s.mq?Number.MAX_VALUE:-s.mq;case"ALIGNED_READ_LENGTH":return-s.lengthOnRef;default:return Number.MAX_VALUE}}}var fu={fr:{F1R2:"LR",F2R1:"LR",F1F2:"LL",F2F1:"LL",R1R2:"RR",R2R1:"RR",R1F2:"RL",R2F1:"RL"},rf:{R1F2:"LR",R2F1:"LR",R1R2:"LL",R2R1:"LL",F1F2:"RR",F2F1:"RR",F1R2:"RL",F2R1:"RL"},ff:{F2F1:"LR",R1R2:"LR",F2R1:"LL",R1F2:"LL",R2F1:"RR",F1R2:"RR",R2R1:"RL",F1F2:"RL"}};class pu{#A=[];baseModificationKeys=new Set;constructor(e,t,i,{samplingWindowSize:n,samplingDepth:r,alleleFreqThreshold:s,colorBy:o}){this.alleleFreqThreshold=void 0===s?.2:s,this.samplingWindowSize=n||100,this.samplingDepth=r||1e3,this.chr=e,this.start=Math.floor(t),this.end=Math.ceil(i),this.length=i-t,this.coverageMap=new mu(e,t,i,this.alleleFreqThreshold),this.downsampledIntervals=[],o&&o.startsWith("basemod")&&(this.baseModCounts=new du),this.alignments=[],this.pairsCache=new Map,this.downsampledReads=new Set,this.currentBucket=new gu(this.start,this.start+this.samplingWindowSize,this),this.hasPairs=!1}pack({viewAsPairs:e,showSoftClips:t,expectedPairOrientation:i,groupBy:n,displayMode:r}){let s=this.allAlignments();s=e?function(e){const t=new Map,i=e.map((e=>{if(vu(e)){let i=t.get(e.readName);return i?(i.setSecondAlignment(e),t.delete(e.readName),i):(i=new iu(e),t.set(e.readName,i),i)}return e}));return i}(s):function(e){return e.flatMap((e=>e instanceof iu?[e.firstAlignment,e.secondAlignment].filter(Boolean):[e]))}(s),this.packAlignmentRows(s,t,i,n,r),this.alignments&&delete this.alignments}packAlignmentRows(e,t,i,n,r){this.#A=[];const s=(e,i)=>{e.sort((function(e,i){return t?e.scStart-i.scStart:e.start-i.start}));const n=new Fu(i);let r,s=0,o=0;const a=new Set,c=()=>{r=new uu,n.push(r),s=0,o=0,a.clear()};for(c();e.length>0;)if(o>=0&&o<e.length){const i=e[o];a.add(i),r.alignments.push(i),s=t?i.scStart+i.scLengthOnRef+2:i.start+i.lengthOnRef+2,o=yu(e,(e=>(t?e.scStart:e.start)>s),o)}else e=e.filter((e=>!a.has(e))),c();return n},o=(e,t)=>{e.sort((function(e,t){return e.start-t.start}));const i=new Fu(t),{start:n,end:r}=this.viewport.genomicRange();for(let t of e)if(t.end<n||t.start>r)this.#A.push(t);else{const e=new uu;e.alignments.push(t),i.push(e)}return i};if(!e||0===e.length)return new Map;{const t=new Map;if(n)for(let r of e){const e=Au(r,n,i)||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}else t.set("",e);const a=new Map,c=Array.from(t.keys()).sort(function(e){switch(e){case"pairOrientation":return function(){const e=["LL","RR","RL","LR",""];return(t,i)=>e.indexOf(t)-e.indexOf(i)}();case"strand":case"firstOfPairStrand":return xu;default:return e&&e.startsWith("base:")?_u:ku}}(n));for(let e of c){const i=t.get(e),n="FULL"===r?o(i,e):s(i,e);a.set(e,n)}this.packedGroups=a}}push(e){this.hasPairs=this.hasPairs||e.isPaired(),this.coverageMap.incCounts(e);const t=e.getBaseModificationSets();if(t)for(let e of t)this.baseModificationKeys.add(e.key);this.baseModCounts&&this.baseModCounts.incrementCounts(e),this.downsampledReads.has(e.readName)?this.currentBucket.downsampledCount++:(e.start>=this.currentBucket.end&&(this.finishBucket(),this.currentBucket=new gu(e.start,e.start+this.samplingWindowSize,this)),this.currentBucket.addAlignment(e))}finish(){void 0!==this.currentBucket&&this.finishBucket(),this.hasAlignments=this.alignments.length>0,this.alignments.sort((function(e,t){return e.start-t.start})),this.baseModCounts&&this.baseModCounts.computeSimplex(),delete this.currentBucket,delete this.pairsCache,delete this.downsampledReads}contains(e,t,i){return this.chr===e&&this.start<=t&&this.end>=i}hasDownsampledIntervals(){return this.downsampledIntervals&&this.downsampledIntervals.length>0}finishBucket(){this.alignments=this.alignments.concat(this.currentBucket.alignments),this.currentBucket.downsampledCount>0&&this.downsampledIntervals.push(new bu(this.currentBucket.start,this.currentBucket.end,this.currentBucket.downsampledCount))}allAlignments(){if(this.alignments)return this.alignments;if(this.packedGroups){const e=Array.from(this.packedGroups.values()).flatMap((e=>e.rows.flatMap((e=>e.alignments))));if(this.#A&&this.#A.length>0)for(let t of this.#A)e.push(t);return e}return[]}getMax(e,t){return this.coverageMap.getMax(e,t)}sortRows(e){if(this.packedGroups)for(let t of this.packedGroups.values())t.sortRows(e,this)}}class gu{constructor(e,t,{samplingDepth:i,downsampledReads:n,pairsCache:r}){this.start=e,this.end=t,this.alignments=[],this.downsampledCount=0,this.samplingDepth=i,this.downsampledReads=n,this.pairsCache=r,this.hasPairs=!1}addAlignment(e){this.hasPairs=this.hasPairs||e.isPaired();const t=this.hasPairs?Math.ceil(this.samplingDepth/2):this.samplingDepth;if(vu(e)){const t=this.pairsCache.get(e.readName);if(t)return t.setSecondAlignment(e),void this.pairsCache.delete(e.readName)}if(this.alignments.length<t)if(vu(e)){const t=new iu(e);this.pairsCache.set(e.readName,t),this.alignments.push(t)}else this.alignments.push(e);else{const i=Math.floor(Math.random()*(t+this.downsampledCount-1));if(i<t){const t=this.alignments[i];if(this.pairsCache.has(t.readName)&&this.pairsCache.delete(t.readName),vu(e)){const t=new iu(e);this.pairsCache.set(e.readName,t),this.alignments[i]=t}else this.alignments[i]=e;this.downsampledReads.add(t.readName)}else this.downsampledReads.add(e.readName);this.downsampledCount++}}}class mu{constructor(e,t,i,n){this.chr=e,this.bpStart=t,this.length=i-t,this.coverage=new Array(this.length),this.maximum=0,this.threshold=n,this.qualityWeight=!0}getMax(e,t){let i=0;const n=this.coverage.length;for(let r=0;r<n;r++){const n=this.bpStart+r;if(n>t)break;const s=this.coverage[r];n>=e&&s&&(i=Math.max(i,s.total))}return i}incCounts(e){var t=this;if(void 0===e.blocks?i(e):e.blocks.forEach((function(e){i(e)})),e.gaps)for(let i of e.gaps)if("D"===i.type){const e=i.start-t.bpStart;for(let n=e;n<e+i.len;n++)n<0||(this.coverage[n]||(this.coverage[n]=new wu(t.threshold)),this.coverage[n].del++)}if(e.insertions)for(let i of e.insertions){const e=i.start-this.bpStart;e<0||(this.coverage[e]||(this.coverage[e]=new wu(t.threshold)),this.coverage[e].ins++)}function i(i){if("S"===i.type)return;const n=e.seq,r=e.qual,s=i.seqOffset;for(let o=i.start-t.bpStart,a=0;a<i.len;o++,a++){t.coverage[o]||(t.coverage[o]=new wu(t.threshold));const i=null==n?"N":n.charAt(s+a),c=e.strand?"pos"+i:"neg"+i,l=r&&s+a<r.length?r[s+a]:30;t.coverage[o][c]+=1,t.coverage[o]["qual"+i]+=l,t.coverage[o].total+=1,t.coverage[o].qual+=l,t.maximum=Math.max(t.coverage[o].total,t.maximum)}}}getPosCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.posA;case"C":case"c":return n.posC;case"T":case"t":return n.posT;case"G":case"g":return n.posG;case"N":case"n":return n.posN;default:return 0}}getNegCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.negA;case"C":case"c":return n.negC;case"T":case"t":return n.negT;case"G":case"g":return n.negG;case"N":case"n":return n.negN;default:return 0}}getCount(e,t){return this.getPosCount(e,t)+this.getNegCount(e,t)}getTotalCount(e){const t=e-this.bpStart;return t>=0&&t<this.coverage.length?this.coverage[t].total:0}}class wu{constructor(e){this.qualityWeight=!0,this.posA=0,this.negA=0,this.posT=0,this.negT=0,this.posC=0,this.negC=0,this.posG=0,this.negG=0,this.posN=0,this.negN=0,this.pos=0,this.neg=0,this.qualA=0,this.qualT=0,this.qualC=0,this.qualG=0,this.qualN=0,this.qual=0,this.total=0,this.del=0,this.ins=0,this.threshold=e}hoverText(){const e=this.posA+this.posT+this.posC+this.posG+this.posN,t=this.negA+this.negT+this.negC+this.negG+this.negN;return`${this.total} (${e}+, ${t}-)`}isMismatch(e){const t=this.threshold*(this.qualityWeight&&this.qual?this.qual:this.total);let i=0;for(let t of["A","T","C","G"])t!==e&&(i+=this.qualityWeight&&this.qual?this["qual"+t]:this["pos"+t]+this["neg"+t]);return i>=t}}class bu{constructor(e,t,i){this.start=e,this.end=t,this.counts=i}popupData(e){return[{name:"start",value:Math.floor(this.start+1)},{name:"end",value:this.end},{name:"# downsampled:",value:this.counts}]}}class Fu{pixelTop=0;pixelBottom=0;rows=[];constructor(e){this.name=this.name}push(e){this.rows.push(e)}get length(){return this.rows.length}sortRows(e,t){const i=[],n=[];for(let t of this.rows){void 0!==t.findAlignment(e.position,e.sortAsPairs)?i.push(t):n.push(t)}i.sort(((i,n)=>{const r=e.direction,s=i.getSortValue(e,t),o=n.getSortValue(e,t);if(void 0===o&&void 0!==o)return 1;if(void 0!==s&&void 0===o)return-1;const a=s>o?1:s<o?-1:0;return!0===r?a:-a}));for(let e of n)i.push(e);this.rows=i}}function vu(e){return e.isPaired()&&e.mate&&e.isMateMapped()&&e.chr===e.mate.chr&&(e.isFirstOfPair()||e.isSecondOfPair())&&!(e.isSecondary()||e.isSupplementary())}function yu(e,t,i){let n=i-1,r=e.length;for(;1+n<r;){const i=n+(r-n>>1);t(e[i])?r=i:n=i}return r}function Au(e,t,i){let n,r,s;if(t.startsWith("tag:"))n=t.substring(4),t="tag";else if(t.startsWith("base:")){const e=t.split(":");3===e.length&&(t="base",r=e[1],s=Number.parseInt(e[2].replaceAll(",",""))-1)}switch(t){case"strand":return e.strand?"+":"-";case"firstOfPairStrand":const t=e.firstOfPairStrand;return void 0===t?"":t?"+":"-";case"mateChr":return e.mate&&e.isMateMapped()?e.mate.chr:"";case"pairOrientation":return fu[i][e.pairOrientation]||"";case"chimeric":return e.tags().SA?"chimeric":"";case"supplementary":return e.isSupplementary?"supplementary":"";case"readOrder":return e.isPaired()&&e.isFirstOfPair()?"first":e.isPaired()&&e.isSecondOfPair()?"second":"";case"phase":return e.tags().HP||"";case"tag":return e.tags()[n]||"";case"base":if(e.chr===r&&e.start<=s&&e.end>s){const t=e.readBaseAt(s);return t||"GAP"}return"";default:return}}const Cu=new Map([["A",1],["T",2],["C",3],["G",4],["N",5],["GAP",5],["",7]]);function _u(e,t){return Cu.has(e)&&Cu.has(t)?Cu.get(e)-Cu.get(t):e.localeCompare(t,void 0,{sensitivity:"base"})}function xu(e,t){return e===t?0:e&&t?-e.localeCompare(t):e?1:-1}function ku(e,t){if(e||t){if(e){if(t){if(e===t)return 0;if($s(e)&&($s(t),1))return Number.parseFloat(e)-Number.parseFloat(t);{let i=e.toString(),n=t.toString();return i.localeCompare(n,void 0,{sensitivity:"base"})}}return-1}return 1}return 0}class Iu{constructor(e){const t=e.split(",");this.chr=t[0],this.start=parseInt(t[1]),this.strand=t[2].charAt(0),this.mapQ=parseInt(t[4]),this.numMismatches=parseInt(t[5]),this.lenOnRef=function(e){let t=0,i="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(r>47&&r<58)i+=e.charAt(n);else{switch(r){case 78:case 68:case 77:case 61:case 88:t+=parseInt(i.toString())}i=""}}return t}(t[3])}printString(){return this.chr+":"+F(this.start)+"-"+F(this.start+this.lenOnRef)+" ("+this.strand+") = "+F(this.lenOnRef)+"bp @MAPQ: "+this.mapQ+" NM: "+this.numMismatches}}function Su(e){return e.split(";").filter((e=>e.length>0)).map((e=>new Iu(e)))}const Eu={c:1,C:1,s:2,S:2,i:4,I:4,f:4};class Nu{constructor(){this.hidden=!1}isMapped(){return!(4&this.flags)}isPaired(){return!!(1&this.flags)}isProperPair(){return!!(2&this.flags)}isFirstOfPair(){return!!(64&this.flags)}isSecondOfPair(){return!!(128&this.flags)}isSecondary(){return!!(256&this.flags)}isSupplementary(){return!!(2048&this.flags)}isFailsVendorQualityCheck(){return!!(512&this.flags)}isDuplicate(){return!!(1024&this.flags)}isMateMapped(){return!(8&this.flags)}isNegativeStrand(){return!!(16&this.flags)}isMateNegativeStrand(){return!!(32&this.flags)}hasTag(e){const t=this.tagDict||function(e){let t=0;const i=e.length,n={};for(;t<i;){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const s=String.fromCharCode(e[t++]);let o;if("A"===s)o=String.fromCharCode(e[t]),t++;else if("i"===s||"I"===s)o=Bu(e,t),t+=4;else if("c"===s)o=zu(e,t),t++;else if("C"===s)o=Lu(e,t),t++;else if("s"===s||"S"===s)o=Du(e,t),t+=2;else if("f"===s)o=Tu(e,t),t+=4;else if("Z"===s)for(o="";;){var r=e[t++];if(0===r)break;o+=String.fromCharCode(r)}else{if("B"!==s){o="Error unknown type: "+s,n[i]=o;break}{const r=String.fromCharCode(e[t++]);let s=Eu[r];if(void 0===s){n[i]=`Error: unknown element type '${r}'`;break}const a=Bu(e,t);t+=4;const c=t+a*s;o=[];const l=new DataView(e.buffer);for(;t<c;){switch(r){case"c":o.push(l.getInt8(t));break;case"C":o.push(l.getUint8(t));break;case"s":o.push(l.getInt16(t));break;case"S":o.push(l.getUint16(t));break;case"i":o.push(l.getInt32(t));break;case"I":o.push(l.getUint32(t));break;case"f":o.push(l.getFloat32(t))}t+=s}}}n[i]=o}return n}(this.tagBA);return t.hasOwnProperty(e)}tags(){return this.tagDict}getTag(e){return this.tags()[e]}get firstOfPairStrand(){if(this.isPaired()){if(this.isFirstOfPair())return this.strand;if(this.isMateMapped())return this.mate.strand}}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}popupData(e){const t=[];if(e=Math.floor(e),this.insertions){const n=this.seq;for(let r of this.insertions){var i=r.start;if(e===i||e===i-1)return t.push({name:"Insertion",value:n.substr(r.seqOffset,r.len)}),t.push({name:"Location",value:i}),t}}t.push({name:"Read Name",value:this.readName}),t.push("<hr/>"),t.push({name:"Alignment Start",value:F(1+this.start),borderTop:!0}),t.push({name:"Read Strand",value:!0===this.strand?"(+)":"(-)",borderTop:!0});let n=this.cigar;if(n&&n.length>50){const e=25;n=`${n.substring(0,e-2)} ... ${n.substring(n.length-e+2)}`}t.push({name:"Cigar",value:n}),t.push({name:"Mapping Quality",value:this.mq}),t.push({name:"Secondary",value:a(this.isSecondary())}),t.push({name:"Supplementary",value:a(this.isSupplementary())}),t.push({name:"Duplicate",value:a(this.isDuplicate())}),t.push({name:"Failed QC",value:a(this.isFailsVendorQualityCheck())}),this.isPaired()&&(t.push("<hr/>"),t.push({name:"First in Pair",value:!this.isSecondOfPair(),borderTop:!0}),t.push({name:"Mate is Mapped",value:a(this.isMateMapped())}),this.pairOrientation&&t.push({name:"Pair Orientation",value:this.pairOrientation}),this.isMateMapped()&&(t.push({name:"Mate Chromosome",value:this.mate.chr}),t.push({name:"Mate Start",value:this.mate.position+1}),t.push({name:"Mate Strand",value:!0===this.mate.strand?"(+)":"(-)"}),t.push({name:"Insert Size",value:this.fragmentLength})));const r=this.tags();if(r.hasOwnProperty("SA")){t.push("<hr/>"),t.push({name:"Supplementary Alignments",value:""});const e=Su(r.SA);if(e){t.push("<ul>");for(let i of e)t.push(`<li>${i.printString()}</li>`);t.push("</ul>")}}const s=new Set(["SA","MD"]);t.push("<hr/>");for(let e in r)s.has(e)||t.push({name:e,value:r[e]});t.push({name:"Hidden Tags",value:"SA, MD"}),t.push("<hr/>"),t.push({name:"Genomic Location: ",value:F(1+e)}),t.push({name:"Read Base:",value:this.readBaseAt(e)}),t.push({name:"Base Quality:",value:this.readBaseQualityAt(e)});const o=this.getBaseModificationSets();if(o){const i=this.positionToReadIndex(e);if(void 0!==i){let e=!1;for(let n of o)if(n.containsPosition(i)){e||(t.push("<hr/>"),t.push("<b>Base modifications:</b>"),e=!0);const r=Math.round(100/255*hu(n.likelihoods.get(i)));t.push(`${n.fullName()} @ likelihood = ${r}%`)}}}return t;function a(e){return e?"Yes":"No"}}readBaseAt(e){const t=Ru(this.blocks,e);if(t){if("*"===this.seq)return"*";{const i=t.seqIndexAt(e);return this.seq[i]}}}readBaseQualityAt(e){const t=Ru(this.blocks,e);if(t){if("*"===this.qual)return 30;{const i=t.seqIndexAt(e);return i>=0&&this.qual&&i<this.qual.length?this.qual[i]:30}}}gapSizeAt(e){if(this.gaps)for(let t of this.gaps)if(e>=t.start&&e<t.start+t.len)return t.len;return 0}softClippedBlocks(){let e,t,i;for(let n of this.blocks)"S"===n.type?i?t=n:e=n:"H"!==n.type&&(i=!0);return{left:e,right:t}}getBaseModificationSets(){if(!this.baseModificationSets&&(this.tagDict.MM||this.tagDict.Mm)){const e=this.tagDict.MM||this.tagDict.Mm,t=this.tagDict.ML||this.tagDict.Ml;!b(e)||t&&!Array.isArray(t)||(0===e.length?this.baseModificationSets=Mu:this.baseModificationSets=function(e,t,i,n){n&&(i=lo(i));const r=[],s=e.split(";");let o=0;for(let e of s){const s=e.split(","),a=s[0].charAt(0),c=s[0].charAt(1),l=s[0].endsWith(".");if(1==s.length);else{const e=s[0].endsWith(".")||s[0].endsWith("?")?s[0].substring(2,s[0].length-1):s[0].substring(2);let h=[];if(e.length>1)if(lu(e))h.push(e);else for(let t=0;t<e.length;t++)h.push(e.substring(t,t+1));else h.push(e);const d=new Map;for(let e of h)d.set(e,new Map);let u=1,f=Number.parseInt(s[u++]),p=0,g=0;for(;p<i.length;){if("N"===a||i[p]===a){const e=n?i.length-1-p:p;if(g===f){for(let i of h){const n=t?t[o++]:255;d.get(i).set(e,n)}if(u<s.length)f=Number.parseInt(s[u++]),g=0;else{if(!l)break;f=-1}}else{if(l)for(let t of h)d.get(t).set(e,0);g++}}p++}for(let e of h)r.push(new su(a,c,e,d.get(e)))}}return r}(e,t,this.seq,this.isNegativeStrand()))}return this.baseModificationSets}getGroupValue(e,t,i){const n=this;switch(e){case"strand":return n.strand?"+":"-";case"firstOfPairStrand":const e=n.firstOfPairStrand;return void 0===e?"":e?"+":"-";case"mateChr":return n.mate&&n.isMateMapped()?n.mate.chr:"";case"pairOrientation":return fu[i][n.pairOrientation]||"";case"chimeric":return n.tags().SA?"chimeric":"";case"supplementary":return n.isSupplementary?"supplementary":"";case"readOrder":return n.isPaired()&&n.isFirstOfPair()?"first":n.isPaired()&&n.isSecondOfPair()?"second":"";case"phase":return n.tags().HP||"";case"tag":return n.tags()[t]||"";default:return}}positionToReadIndex(e){const t=Ru(this.blocks,e);return t?e-t.start+t.seqOffset:void 0}}const Mu=new Set;function Ru(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(t>=n.start&&t<n.start+n.len)return n}}function Bu(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Du(e,t){return e[t+1]<<8|e[t]}function Tu(e,t){return new DataView(e.buffer).getFloat32(t)}function zu(e,t){return new DataView(e.buffer).getInt8(t)}function Lu(e,t){return new DataView(e.buffer).getUint8(t)}class Hu{constructor(e){e&&Object.assign(this,e)}seqIndexAt(e){return Math.floor(e)-this.start+this.seqOffset}}class Pu{constructor(e){e||(e={}),this.vendorFailed=e.vendorFailed=!1!==e.vendorFailed,this.duplicate=e.duplicate=!1!==e.duplicate,this.secondary=e.secondary||!1,this.supplementary=e.supplementary||!1,this.mq=e.mq||0,e.readgroups&&(this.readgroups=new Set(e.readgroups))}pass(e){if(!e.isMapped())return!1;if(this.vendorFailed&&e.isFailsVendorQualityCheck())return!1;if(this.duplicate&&e.isDuplicate())return!1;if(this.secondary&&e.isSecondary())return!1;if(this.supplementary&&e.isSupplementary())return!1;if(e.mq<this.mq)return!1;if(this.readgroups){const t=e.tags().RG;return this.readgroups.has(t)}return!0}}const Ou=Wu(new Uint8Array([66,65,77,1]),0),Vu=["=","A","C","M","G","R","S","V","T","W","Y","H","K","D","B","N"],qu=["M","I","D","N","S","H","P","=","X","?","?","?","?","?","?","?"],Qu={c:1,C:1,s:2,S:2,i:4,I:4,f:4},Uu=1e4,ju={readHeader:async function(e,t,i){const n=en(await Mn.loadArrayBuffer(e,t));return ju.decodeBamHeader(n,i)},decodeBamHeader:function(e){const t=Wu(e,0);if(t!==Ou)throw new Error("BAM header errror: bad magic number. This could be caused by either a corrupt or missing file.");const i=Wu(e,4);let n="";for(var r=0;r<i;++r)n+=String.fromCharCode(e[r+8]);const s=Wu(e,i+8);let o=i+12;const a={},c=[];for(r=0;r<s;++r){const t=Wu(e,o);let i="";for(var l=0;l<t-1;++l)i+=String.fromCharCode(e[o+4+l]);a[i]=r,c[r]=i,o=o+8+t}return{magicNumber:t,size:o,chrNames:c,chrToIndex:a}},bam_tag2cigar:function(e,t,i,n,r,s){function o(e){return"C"===e||"c"===e||"A"===e?1:"S"===e||"s"===e?2:"I"===e||"i"===e||"f"===e?4:0}if(1!==s.length||r.start<0)return!1;for(var a=i+(n+1>>1)+n;a+4<t;){if("CG"===String.fromCharCode(e[a])+String.fromCharCode(e[a+1]))break;var c=String.fromCharCode(e[a+2]);if("B"===c)a+=8+o(c=String.fromCharCode(e[a+3]))*Wu(e,a+4);else if("Z"===c||"H"===c)for(a+=3;0!==e[a++];);else a+=3+o(c)}if(a>=t)return!1;if("B"!==String.fromCharCode(e[a+2])||"I"!==String.fromCharCode(e[a+3]))return!1;var l=Wu(e,a+4),h=a+8;if(h+4*l>t)return!1;var d="",u=0;s.length=0,a=h;for(var f=0;f<l;++f,a+=4){var p=Wu(e,a),g=p>>4,m=qu[15&p];"M"!==m&&"EQ"!==m&&"X"!==m&&"D"!==m&&"N"!==m&&"="!==m||(u+=g),d=d+g+m,s.push({len:g,ltr:m})}return r.cigar=d,r.lengthOnRef=u,!0},decodeBamRecords:function(e,t,i,n,r,s,o,a){for(;t<e.length;){const u=t+Wu(e,t)+4,f=new Nu,p=Wu(e,t+4),g=Wu(e,t+8);if(u>e.length)return;if(p<0){t=u;continue}if(void 0!==r&&(p>r||g>o))return!0;if(void 0!==r&&p<r){t=u;continue}const m=Wu(e,t+12),w=(65280&m)>>8,b=255&m,F=Wu(e,t+16),v=(4294901760&F)>>16,y=65535&F,A=Wu(e,t+20),C=Wu(e,t+24),_=Wu(e,t+28),x=Wu(e,t+32);let k=[];for(let i=0;i<b-1;++i)k.push(String.fromCharCode(e[t+36+i]));k=k.join("");let I=0,S="",E=t+36+b;const N=[];let M;for(let t=0;t<y;++t){var c=Wu(e,E),l=c>>4,h=qu[15&c];"M"!==h&&"EQ"!==h&&"X"!==h&&"D"!==h&&"N"!==h&&"="!==h||(I+=l),S=S+l+h,E+=4,M={len:l,ltr:h},N.push(M)}if(f.chr=n[p],f.start=g,f.flags=v,f.strand=!(16&v),f.readName=k,f.cigar=S,f.lengthOnRef=I,f.fragmentLength=x,f.mq=w,ju.bam_tag2cigar(e,u,E,A,f,N),f.end=f.start+f.lengthOnRef,f.end<s){t=u;continue}let R=[];const B=A+1>>1;for(let t=0;t<B;++t){var d=e[E+t];R.push(Vu[(240&d)>>4]),R.push(Vu[15&d])}R=R.slice(0,A).join(""),E+=B;const D=[];for(let t=0;t<A;++t)D.push(e[E+t]);E+=A,C>=0&&(f.mate={chr:n[C],position:_,strand:!(32&v)}),f.seq=R,f.qual=D;const T=new Uint8Array(e.buffer.slice(E,u));f.tagDict=Yu(T),this.setPairOrientation(f),(void 0===a||a.pass(f))&&(Gu(f,N),i.push(f)),t=u}},decodeSamRecords:function(e,t,i,n,r,s){var o,a,c,l,h,d,u,f,p,g;for(l=(o=v(e)).length,a=0;a<l;a++)if(h=o[a].split("\t"),(p=new Nu).chr=h[2],p.start=Number.parseInt(h[3])-1,p.flags=Number.parseInt(h[1]),p.readName=h[0],p.strand=!(16&p.flags),p.mq=Number.parseInt(h[4]),p.cigar=h[5],p.fragmentLength=Number.parseInt(h[8]),p.seq=h[9],"*"!==p.chr&&p.isMapped()&&p.chr===i){if(p.start>r)break;if(f=0,(g=$u(p.cigar)).forEach((function(e){var t=e.len,i=e.ltr;"M"!==i&&"EQ"!==i&&"X"!==i&&"D"!==i&&"N"!==i&&"="!==i||(f+=t)})),p.lengthOnRef=f,!(p.start+f<n)){for(d=h[10],p.qual=[],c=0;c<d.length;c++)p.qual[c]=d.charCodeAt(c)-33;p.tagDict=h.length<11?{}:Ku(h.slice(11)),p.isMateMapped()&&(u=h[6],p.mate={chr:"="===u?p.chr:u,position:Number.parseInt(h[7]),strand:!(32&p.flags)}),this.setPairOrientation(p),(void 0===s||s.pass(p))&&(Gu(p,g),t.push(p))}}},setReaderDefaults:function(e,t){e.filter="function"==typeof t.filter?{pass:t.filter}:new Pu(t.filter),t.readgroup&&(e.filter.readgroups=new Set([t.readgroup])),e.alleleFreqThreshold=void 0===t.alleleFreqThreshold?.2:t.alleleFreqThreshold,e.samplingWindowSize=void 0===t.samplingWindowSize?100:t.samplingWindowSize,e.samplingDepth=void 0===t.samplingDepth?500:t.samplingDepth,e.samplingDepth>Uu&&(console.log("Warning: attempt to set sampling depth > maximum value of "+Uu),e.samplingDepth=Uu)},setPairOrientation:function(e){if(e.isMapped()&&e.mate&&e.isMateMapped()&&e.mate.chr===e.chr){var t=e.strand?"F":"R",i=e.mate,n=i.strand?"F":"R",r=" ",s=" ";e.isFirstOfPair()?(r="1",s="2"):e.isSecondOfPair()&&(r="2",s="1");var o=[],a=e.fragmentLength,c=e.end-e.start;if(0===a)a=(e.start<i.position?i.position+c:i.position-c)-e.start;a>0?(o[0]=t,o[1]=r,o[2]=n,o[3]=s):(o[2]=t,o[3]=r,o[0]=n,o[1]=s),e.pairOrientation=o.join("")}}};function Gu(e,t){const i=[];let n,r,s=0,o=e.start;e.scStart=e.start,e.scLengthOnRef=e.lengthOnRef;for(let a of t){let t;switch(a.ltr){case"H":case"P":break;case"S":t=o,e.scLengthOnRef+=a.len,0===i.length&&(e.scStart-=a.len,t-=a.len),i.push(new Hu({start:t,seqOffset:s,len:a.len,type:"S"})),s+=a.len;break;case"N":case"D":void 0===r&&(r=[]),r.push({start:o,len:a.len,type:a.ltr}),o+=a.len;break;case"I":void 0===n&&(n=[]),n.push(new Hu({start:o,len:a.len,seqOffset:s,type:"I"})),s+=a.len;break;case"M":case"EQ":case"=":case"X":i.push(new Hu({start:o,seqOffset:s,len:a.len,type:"M"})),s+=a.len,o+=a.len;break;default:console.log("Error processing cigar element: "+a.len+a.ltr)}}e.blocks=i,e.insertions=n,e.gaps=r}function Wu(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function $u(e){var t,i,n,r,s,o,a,c,l;for(t=[],i=[],s=null,r=e.length,n=0;n<r;n++)o=e.charAt(n),l=void 0,(l=o.charCodeAt(0))>=48&&l<=57?i.push(o):(a=o,c=Number.parseInt(i.join("")),i=[],null!==s&&s.ltr===a?s.len+=c:(s={len:c,ltr:a},t.push(s)));return t}function Ku(e){var t={};return e.forEach((function(e){var i=e.split(":");t[i[0]]=i[2]})),t}function Yu(e){let t=0;const i=e.length,n={},r=new DataView(e.buffer);for(;t<i;){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const o=String.fromCharCode(e[t++]);let a;if("A"===o)a=String.fromCharCode(e[t]),t++;else if("i"===o||"I"===o)a=r.getInt32(t,!0),t+=4;else if("c"===o)a=r.getInt8(t,!0),t++;else if("C"===o)a=r.getUint8(t,!0),t++;else if("s"===o||"S"===o)a=r.getInt16(t,!0),t+=2;else if("f"===o)a=r.getFloat32(t,!0),t+=4;else if("Z"===o)for(a="";;){var s=e[t++];if(0===s)break;a+=String.fromCharCode(s)}else{if("B"!==o){a="Error unknown type: "+o,n[i]=a;break}{const s=String.fromCharCode(e[t++]);let o=Qu[s];if(void 0===o){n[i]=`Error: unknown element type '${s}'`;break}const c=r.getInt32(t,!0);t+=4;const l=t+c*o;for(a=[];t<l;){switch(s){case"c":a.push(r.getInt8(t,!0));break;case"C":a.push(r.getUint8(t,!0));break;case"s":a.push(r.getInt16(t,!0));break;case"S":a.push(r.getUint16(t,!0));break;case"i":a.push(r.getInt32(t,!0));break;case"I":a.push(r.getUint32(t,!0));break;case"f":a.push(r.getFloat32(t,!0))}t+=o}}}n[i]=a}return n}class Xu{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.isDataUri=Xs(e.url),ju.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.alignmentCache){let e;if(this.isDataUri){e=en(function(e){const t=e.split(","),i=t[0].split(":")[1];let n=t[1];n=i.indexOf("base64")>=0?atob(n):decodeURI(n);const r=new Uint8Array(n.length);for(var s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}(this.bamPath).buffer)}else{e=en(await Mn.loadArrayBuffer(this.bamPath,js(this.config)))}this.alignmentCache=this.#C(e)}const n=await this.#_(e),r=this.alignmentCache.queryFeatures(n,t,i),s=new pu(e,t,i,this.config);for(let e of r)s.push(e);return s.finish(),s}#C(e){const t=[];return this.header=ju.decodeBamHeader(e),ju.decodeBamRecords(e,this.header.size,t,this.header.chrNames,void 0,0,Number.MAX_SAFE_INTEGER,this.filter),new On(t,this.genome)}async#_(e){const t=new Set(this.header.chrNames);if(t.has(e))return e;if(this.chrAliasTable.has(e))return this.chrAliasTable.get(e);if(this.genome){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>t.has(e)));e.length>0&&(n=e[0])}return this.chrAliasTable.set(e,n),n}return e}}class Zu{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.baiPath=e.indexURL,ju.setReaderDefaults(this,e),this._blockLoader=new Ac(e)}async readAlignments(e,t,i){const n=await this.#x(e),r=new pu(e,t,i,this.config);if(void 0===n)return r;{const e=(await this.getIndex()).chunksForRange(n,t,i);if(!e||0===e.length)return r;for(let s of e){const e=await this._blockLoader.getData(s.minv,s.maxv);if(ju.decodeBamRecords(e,s.minv.offset,r,this.header.chrNames,n,t,i,this.filter))break}return r.finish(),r}}async#x(e){if(await this.getHeader(),this.chrAliasTable.has(e)&&void 0===(e=this.chrAliasTable.get(e)))return;let t=this.header.chrToIndex[e];if(void 0===t){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>void 0!==this.header.chrToIndex[e]));e.length>0&&(n=e[0],t=this.header.chrToIndex[e[0]])}this.chrAliasTable.set(e,n)}return t}async getHeader(){if(!this.header){const e=this.genome,t=await this.getIndex();let i;if(t.firstBlockPosition){const e=js(this.config,{range:{start:t.firstBlockPosition,size:26}}),n=tn(await Mn.loadArrayBuffer(this.bamPath,e));i=t.firstBlockPosition+n}else i=64e3;const n=js(this.config,{range:{start:0,size:i}});this.header=await ju.readHeader(this.bamPath,n,e)}return this.header}async getIndex(){return this.index||(this.index=await mc(this.baiPath,this.config)),this.index}async getChrIndex(){if(this.chrToIndex)return this.chrToIndex;{const e=await this.getHeader();return this.chrToIndex=e.chrToIndex,this.indexToChr=e.chrNames,this.chrNames=new Set(e.chrNames),this.chrToIndex}}}class Ju{constructor(e,t){this.config=e,this.genome=t;const i={};e.sources.sequences.forEach((function(n){const r=t?t.getChromosomeName(n):n;i[r]=function(e,t,i){const n={url:e.sources.url.replace("$CHR",i)};e.sources.indexURL&&(n.indexURL=e.sources.indexURL.replace("$CHR",i));const r=Object.assign(e,n);return new Zu(r,t)}(e,t,n)})),this.bamReaders=i,ju.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(this.bamReaders.hasOwnProperty(e)){let n=this.bamReaders[e];return await n.readAlignments(e,t,i)}return new pu(e,t,i,this.config)}}const ef=function(e,t){this.config=e,this.genome=t,ju.setReaderDefaults(this,e)};function tf(){const e=this,t=this.genome;if(this.header)return Promise.resolve(this.header);{const i=this.config.url+"?file="+this.config.alignmentFile+"&options=-b,-H",n=js(this.config);return ju.readHeader(i,n,t).then((function(t){return e.header=t,t}))}}ef.prototype.readAlignments=function(e,t,i){var n=this;return tf.call(n).then((function(r){var s,o;return s=r.chrAliasTable.hasOwnProperty(e)?r.chrAliasTable[e]:e,o=n.config.url+"?reference="+n.config.referenceFile+"&file="+n.config.alignmentFile+"®ion="+s+":"+t+"-"+i,Mn.loadString(o,js(n.config)).then((function(o){var a;return r.chrToIndex[s],a=new pu(e,t,i,n.config),ju.decodeSamRecords(o,a,s,t,i,n.filter),a}))}))};class nf extends Dc{constructor(e,t){super(e,t),ju.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.header){const e=en((await this.readHeaderData()).buffer);this.header=ju.decodeBamHeader(e,this.genome),this.chrAliasTable=new Map;for(let e of this.header.chrNames)this.chrAliasTable.set(e,this.genome.getChromosomeName(e))}let n=this.chrAliasTable.has(e)?this.chrAliasTable.get(e):e;const r=en((await this.readData(n,t,i)).buffer);this.header=ju.decodeBamHeader(r,this.genome);const s=this.header.chrToIndex[e],o=new pu(e,t,i,this.config);return ju.decodeBamRecords(r,this.header.size,o,this.header.chrNames,s,t,i,this.filter),o.finish(),o}}
|
|
25
|
+
*/function mh(e,t){var i,n=Object.keys(t);for(i=0;i<n.length;i++)e=e.replace(new RegExp("\\{"+n[i]+"\\}","gi"),t[n[i]]);return e}function wh(e){var t,i,n;if(!e)throw new Error("cannot create a random attribute name for an undefined object");t="ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",i="";do{for(i="",n=0;n<12;n++)i+=t[Math.floor(51*Math.random())]}while(e[i]);return i}function bh(e){var t={alphabetic:"alphabetic",hanging:"hanging",top:"text-before-edge",bottom:"text-after-edge",middle:"central"};return t[e]||t.alphabetic}function Fh(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}const vh=function(e,t){var i,n,r,s={};for(e=e.split(","),t=t||10,i=0;i<e.length;i+=2)n="&"+e[i+1]+";",r=parseInt(e[i],t),s[n]="&#"+r+";";return s["\\xa0"]=" ",s}("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32),yh={strokeStyle:{svgAttr:"stroke",canvas:"#000000",svg:"none",apply:"stroke"},fillStyle:{svgAttr:"fill",canvas:"#000000",svg:null,apply:"fill"},lineCap:{svgAttr:"stroke-linecap",canvas:"butt",svg:"butt",apply:"stroke"},lineJoin:{svgAttr:"stroke-linejoin",canvas:"miter",svg:"miter",apply:"stroke"},miterLimit:{svgAttr:"stroke-miterlimit",canvas:10,svg:4,apply:"stroke"},lineWidth:{svgAttr:"stroke-width",canvas:1,svg:1,apply:"stroke"},globalAlpha:{svgAttr:"opacity",canvas:1,svg:1,apply:"fill stroke"},font:{canvas:"10px sans-serif"},shadowColor:{canvas:"#000000"},shadowOffsetX:{canvas:0},shadowOffsetY:{canvas:0},shadowBlur:{canvas:0},textAlign:{canvas:"start"},textBaseline:{canvas:"alphabetic"},lineDash:{svgAttr:"stroke-dasharray",canvas:[],svg:null,apply:"stroke"}};class Ah{constructor(e,t){this.__root=e,this.__ctx=t}addColorStop(e,t){var i,n=this.__ctx.__createElement("stop");n.setAttribute("offset",e),t&&-1!==t.indexOf("rgba")?(i=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(t),n.setAttribute("stop-color",mh("rgb({r},{g},{b})",{r:i[1],g:i[2],b:i[3]})),n.setAttribute("stop-opacity",i[4])):n.setAttribute("stop-color",t),this.__root.appendChild(n)}}class Ch{constructor(e,t){this.__root=e,this.__ctx=t}}class _h{constructor(e){if(!(this instanceof _h))return new _h(e);if(this.config=e,this.width=e.width,this.height=e.height,this.enableMirroring=e.enableMirroring||!1,this.canvas=this,this.__document=document,e.ctx?this.__ctx=e.ctx:(this.__canvas=this.__document.createElement("canvas"),this.__ctx=this.__canvas.getContext("2d")),this.isSVG=!0,this.__setDefaultStyles(),this.__stack=[this.__getStyleState()],this.__groupStack=[],this.__root=this.__createElement("svg"),this.__root.setAttribute("width",this.width),this.__root.setAttribute("height",this.height),this.__root.setAttribute("overflow","visible"),e.viewbox){const t=e.viewbox.x+" "+e.viewbox.y+" "+e.viewbox.width+" "+e.viewbox.height;this.__root.setAttribute("viewBox",t),this.viewbox=e.viewbox}this.__ids={},this.__defs=this.__createElement("defs"),this.__root.appendChild(this.__defs),this.multiLocusGap=e.multiLocusGap;let t={id:"svg_output_backdrop",width:"100%",height:"100%",fill:e.backdropColor||"white"},i=this.__createElement("rect",t);this.__root.appendChild(i),this.__rootGroup=this.__createElement("g",{id:"root-group"}),this.__root.appendChild(this.__rootGroup),this.__currentElement=this.__rootGroup}setWidth(e){this.width=e,this.__root.setAttribute("width",this.width);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+e+" "+this.config.viewbox.height;this.__root.setAttribute("viewBox",t)}setHeight(e){this.height=e,this.__root.setAttribute("height",this.height);const t=this.config.viewbox.x+" "+this.config.viewbox.y+" "+this.config.viewbox.width+" "+e;this.__root.setAttribute("viewBox",t)}__createElement(e,t,i){void 0===t&&(t={});let n=this.__document.createElementNS("http://www.w3.org/2000/svg",e);i&&(n.setAttribute("fill","none"),n.setAttribute("stroke","none"));for(let e of Object.keys(t))n.setAttribute(e,t[e]);return n}__setDefaultStyles(){var e,t,i=Object.keys(yh);for(e=0;e<i.length;e++)this[t=i[e]]=yh[t].canvas}__applyStyleState(e){var t,i,n=Object.keys(e);for(t=0;t<n.length;t++)this[i=n[t]]=e[i]}__getStyleState(){var e,t,i={},n=Object.keys(yh);for(e=0;e<n.length;e++)i[t=n[e]]=this[t];return i}__applyStyleToCurrentElement(e){var t=this.__currentElement,i=this.__currentElementsToStyle;i&&(t.setAttribute(e,""),t=i.element,i.children.forEach((function(t){t.setAttribute(e,"")})));var n,r,s,o,a,c=Object.keys(yh);for(n=0;n<c.length;n++)if(r=yh[c[n]],s=this[c[n]],r.apply)if(s instanceof Ch){if(s.__ctx)for(;s.__ctx.__defs.childNodes.length;)o=s.__ctx.__defs.childNodes[0].getAttribute("id"),this.__ids[o]=o,this.__defs.appendChild(s.__ctx.__defs.childNodes[0]);t.setAttribute(r.apply,mh("url(#{id})",{id:s.__root.getAttribute("id")}))}else if(s instanceof Ah)t.setAttribute(r.apply,mh("url(#{id})",{id:s.__root.getAttribute("id")}));else if(r&&-1!==r.apply.indexOf(e)&&r.svg!==s)if("stroke"!==r.svgAttr&&"fill"!==r.svgAttr||!s||-1===s.indexOf("rgba")){var l=r.svgAttr;if("globalAlpha"===c[n]&&(l=e+"-"+r.svgAttr,t.getAttribute(l)))continue;t.setAttribute(l,s)}else{a=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d?\.?\d*)\s*\)/gi.exec(s),t.setAttribute(r.svgAttr,mh("rgb({r},{g},{b})",{r:a[1],g:a[2],b:a[3]}));var h=a[4],d=this.globalAlpha;null!=d&&(h*=d),t.setAttribute(r.svgAttr+"-opacity",h)}}__closestGroupOrSvg(e){return"g"===(e=e||this.__currentElement).nodeName||"svg"===e.nodeName?e:this.__closestGroupOrSvg(e.parentNode)}getSerializedSvg(e){var t,i,n,r,s,o=(new XMLSerializer).serializeToString(this.__root);if(e)for(t=Object.keys(vh),i=0;i<t.length;i++)n=t[i],r=vh[n],(s=new RegExp(n,"gi")).test(o)&&(o=o.replace(s,r));return o}getSvg(){return this.__root}saveWithTranslationAndClipRect(e,t,i,n,r,s){const o=`${e}_clip_rect`;let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a);const c={x:"0",y:s.toString(),width:n.toString(),height:r.toString()};a.appendChild(this.__createElement("rect",c));const l=this.__createElement("g");l.setAttribute("transform",mh("translate({x},{y})",{x:t,y:i})),l.setAttribute("clip-path",mh("url(#{id})",{id:o}));const h=this.__closestGroupOrSvg();h.appendChild(l),this.__groupStack.push(h),this.__currentElement=l,this.__stack.push(this.__getStyleState())}save(){var e=this.__createElement("g"),t=this.__closestGroupOrSvg();this.__groupStack.push(t),t.appendChild(e),this.__currentElement=e,this.__stack.push(this.__getStyleState())}restore(){this.__currentElement=this.__groupStack.pop(),this.__currentElementsToStyle=null,this.__currentElement||(this.__currentElement=this.__root.childNodes[1]);var e=this.__stack.pop();this.__applyStyleState(e)}__addTransform(e){var t=this.__closestGroupOrSvg();if(t.childNodes.length>0){"path"===this.__currentElement.nodeName&&(this.__currentElementsToStyle||(this.__currentElementsToStyle={element:t,children:[]}),this.__currentElementsToStyle.children.push(this.__currentElement),this.__applyCurrentDefaultPath());var i=this.__createElement("g");t.appendChild(i),this.__currentElement=i}var n=this.__currentElement.getAttribute("transform");n?n+=" ":n="",n+=e,this.__currentElement.setAttribute("transform",n)}addTrackGroupWithTranslationAndClipRect(e,t,i,n,r,s){const o=e+"_clip_rect";let a=this.__createElement("clipPath",{id:o});this.__defs.appendChild(a),a.appendChild(this.__createElement("rect",{x:"0",y:s.toString(),width:n.toString(),height:r.toString()}));let c=this.__createElement("g");this.__rootGroup.appendChild(c),c.setAttribute("transform",mh("translate({x},{y})",{x:t,y:i})),c.setAttribute("id",e+"_group"),c.setAttribute("clip-path",mh("url(#{id})",{id:o})),this.__currentElement=c}scale(e,t){void 0===t&&(t=e),this.__addTransform(mh("scale({x},{y})",{x:e,y:t}))}rotate(e){var t=180*e/Math.PI;this.__addTransform(mh("rotate({angle},{cx},{cy})",{angle:t,cx:0,cy:0}))}translate(e,t){this.__addTransform(mh("translate({x},{y})",{x:e,y:t}))}transform(e,t,i,n,r,s){this.__addTransform(mh("matrix({a},{b},{c},{d},{e},{f})",{a:e,b:t,c:i,d:n,e:r,f:s}))}beginPath(){var e;this.__currentDefaultPath="",this.__currentPosition={},e=this.__createElement("path",{},!0),this.__closestGroupOrSvg().appendChild(e),this.__currentElement=e}__applyCurrentDefaultPath(){var e=this.__currentElement;"path"===e.nodeName?e.setAttribute("d",this.__currentDefaultPath):console.error("Attempted to apply path command to node",e.nodeName)}__addPathCommand(e){this.__currentDefaultPath+=" ",this.__currentDefaultPath+=e}moveTo(e,t){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.__currentPosition={x:e,y:t},this.__addPathCommand(mh("M {x} {y}",{x:e,y:t}))}closePath(){this.__currentDefaultPath&&this.__addPathCommand("Z")}lineTo(e,t){this.__currentPosition={x:e,y:t},this.__currentDefaultPath&&this.__currentDefaultPath.indexOf("M")>-1?this.__addPathCommand(mh("L {x} {y}",{x:e,y:t})):this.__addPathCommand(mh("M {x} {y}",{x:e,y:t}))}bezierCurveTo(e,t,i,n,r,s){this.__currentPosition={x:r,y:s},this.__addPathCommand(mh("C {cp1x} {cp1y} {cp2x} {cp2y} {x} {y}",{cp1x:e,cp1y:t,cp2x:i,cp2y:n,x:r,y:s}))}quadraticCurveTo(e,t,i,n){this.__currentPosition={x:i,y:n},this.__addPathCommand(mh("Q {cpx} {cpy} {x} {y}",{cpx:e,cpy:t,x:i,y:n}))}arcTo(e,t,i,n,r){var s=this.__currentPosition&&this.__currentPosition.x,o=this.__currentPosition&&this.__currentPosition.y;if(void 0!==s&&void 0!==o){if(r<0)throw new Error("IndexSizeError: The radius provided ("+r+") is negative.");if(s===e&&o===t||e===i&&t===n||0===r)this.lineTo(e,t);else{var a=Fh([s-e,o-t]),c=Fh([i-e,n-t]);if(a[0]*c[1]!=a[1]*c[0]){var l=a[0]*c[0]+a[1]*c[1],h=Math.acos(Math.abs(l)),d=Fh([a[0]+c[0],a[1]+c[1]]),u=r/Math.sin(h/2),f=e+u*d[0],p=t+u*d[1],g=[-a[1],a[0]],m=[c[1],-c[0]],w=function(e){var t=e[0];return e[1]>=0?Math.acos(t):-Math.acos(t)},b=w(g),F=w(m);this.lineTo(f+g[0]*r,p+g[1]*r),this.arc(f,p,r,b,F)}else this.lineTo(e,t)}}}stroke(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","fill stroke markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("stroke")}fill(){"path"===this.__currentElement.nodeName&&this.__currentElement.setAttribute("paint-order","stroke fill markers"),this.__applyCurrentDefaultPath(),this.__applyStyleToCurrentElement("fill")}rect(e,t,i,n){"path"!==this.__currentElement.nodeName&&this.beginPath(),this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+n),this.lineTo(e,t+n),this.lineTo(e,t),this.closePath()}fillRect(e,t,i,n){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i);var r,s,o,a={x:e,y:t,width:i,height:n};(!this.viewbox||(r=this.viewbox,s=a,r.x<s.x+s.width&&r.x+r.width>s.x&&r.y<s.y+s.height&&r.y+r.height>s.y))&&(o=this.__createElement("rect",a,!0),this.__closestGroupOrSvg().appendChild(o),this.__currentElement=o,this.__applyStyleToCurrentElement("fill"))}strokeRect(e,t,i,n){var r;r=this.__createElement("rect",{x:e,y:t,width:i,height:n},!0),this.__closestGroupOrSvg().appendChild(r),this.__currentElement=r,this.__applyStyleToCurrentElement("stroke")}strokeEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"stroke")}fillEllipse(e,t,i,n,r,s,o,a){this.__ellipse(e,t,i,n,r,s,o,a,"fill")}__ellipse(e,t,i,n,r,s,o,a,c){const l={cx:e,cy:t,rx:i,ry:n},h=this.__createElement("ellipse",l,!0);this.__closestGroupOrSvg().appendChild(h),this.__currentElement=h,this.__applyStyleToCurrentElement(c)}__clearCanvas(){for(var e=this.__closestGroupOrSvg().getAttribute("transform"),t=this.__root.childNodes[1],i=t.childNodes,n=i.length-1;n>=0;n--)i[n]&&t.removeChild(i[n]);this.__currentElement=t,this.__groupStack=[],e&&this.__addTransform(e)}clearRect(e,t,i,n){if(0!==e||0!==t||i!==this.width||n!==this.height){var r,s=this.__closestGroupOrSvg();r=this.__createElement("rect",{x:e,y:t,width:i,height:n,fill:"#FFFFFF"},!0),s.appendChild(r)}else this.__clearCanvas()}createLinearGradient(e,t,i,n){var r=this.__createElement("linearGradient",{id:wh(this.__ids),x1:e+"px",x2:i+"px",y1:t+"px",y2:n+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(r),new Ah(r,this)}createRadialGradient(e,t,i,n,r,s){var o=this.__createElement("radialGradient",{id:wh(this.__ids),cx:n+"px",cy:r+"px",r:s+"px",fx:e+"px",fy:t+"px",gradientUnits:"userSpaceOnUse"},!1);return this.__defs.appendChild(o),new Ah(o,this)}__parseFont(){var e=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-,\'\"\sa-z0-9]+?)\s*$/i.exec(this.font),t={style:e[1]||"normal",size:e[4]||"10px",family:e[6]||"sans-serif",weight:e[3]||"normal",decoration:e[2]||"normal",href:null};return"underline"===this.__fontUnderline&&(t.decoration="underline"),this.__fontHref&&(t.href=this.__fontHref),t}__wrapTextLink(e,t){if(e.href){var i=this.__createElement("a");return i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",e.href),i.appendChild(t),i}return t}__applyText(e,t,i,n){var r,s,o=this.__parseFont(),a=this.__closestGroupOrSvg(),c=this.__createElement("text",{"font-family":o.family,"font-size":o.size,"font-style":o.style,"font-weight":o.weight,"text-decoration":o.decoration,x:t,y:i,"text-anchor":(r=this.textAlign,s={left:"start",right:"end",center:"middle",start:"start",end:"end"},s[r]||s.start),"dominant-baseline":bh(this.textBaseline)},!0);c.appendChild(this.__document.createTextNode(e)),this.__currentElement=c,this.__applyStyleToCurrentElement(n),a.appendChild(this.__wrapTextLink(o,c))}fillText(e,t,i){this.__applyText(e,t,i,"fill")}strokeText(e,t,i){this.__applyText(e,t,i,"stroke")}measureText(e){return this.__ctx.font=this.font,this.__ctx.measureText(e)}arc(e,t,i,n,r,s){if(n!==r){(n%=2*Math.PI)===(r%=2*Math.PI)&&(r=(r+2*Math.PI-.001*(s?-1:1))%(2*Math.PI));var o=e+i*Math.cos(r),a=t+i*Math.sin(r),c=e+i*Math.cos(n),l=t+i*Math.sin(n),h=s?0:1,d=0,u=r-n;u<0&&(u+=2*Math.PI),d=s?u>Math.PI?0:1:u>Math.PI?1:0,this.lineTo(c,l),this.__addPathCommand(mh("A {rx} {ry} {xAxisRotation} {largeArcFlag} {sweepFlag} {endX} {endY}",{rx:i,ry:i,xAxisRotation:0,largeArcFlag:d,sweepFlag:h,endX:o,endY:a})),this.__currentPosition={x:o,y:a}}}clip(){var e=this.__closestGroupOrSvg(),t=this.__createElement("clipPath"),i=wh(this.__ids),n=this.__createElement("g");this.__applyCurrentDefaultPath(),e.removeChild(this.__currentElement),t.setAttribute("id",i),t.appendChild(this.__currentElement),this.__defs.appendChild(t),e.setAttribute("clip-path",mh("url(#{id})",{id:i})),e.appendChild(n),this.__currentElement=n}drawImage(){var e,t,i,n,r,s,o,a,c,l,h,d,u,f=Array.prototype.slice.call(arguments),p=f[0],g=0,m=0;if(3===f.length)e=f[1],t=f[2],i=r=p.width,n=s=p.height;else if(5===f.length)e=f[1],t=f[2],i=f[3],n=f[4],r=p.width,s=p.height;else{if(9!==f.length)throw new Error("Invalid number of arguments passed to drawImage: "+arguments.length);g=f[1],m=f[2],r=f[3],s=f[4],e=f[5],t=f[6],i=f[7],n=f[8]}o=this.__closestGroupOrSvg(),this.__currentElement;var w="translate("+e+", "+t+")";if(p instanceof _h){if((a=p.getSvg().cloneNode(!0)).childNodes&&a.childNodes.length>1){for(c=a.childNodes[0];c.childNodes.length;)u=c.childNodes[0].getAttribute("id"),this.__ids[u]=u,this.__defs.appendChild(c.childNodes[0]);if(l=a.childNodes[1]){var b,F=l.getAttribute("transform");b=F?F+" "+w:w,l.setAttribute("transform",b),o.appendChild(l)}}}else"CANVAS"!==p.nodeName&&"IMG"!==p.nodeName||((h=this.__createElement("image")).setAttribute("width",i),h.setAttribute("height",n),h.setAttribute("preserveAspectRatio","none"),(g||m||r!==p.width||s!==p.height)&&((d=this.__document.createElement("canvas")).width=i,d.height=n,d.getContext("2d").drawImage(p,g,m,r,s,0,0,i,n),p=d),h.setAttribute("transform",w),h.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===p.nodeName?p.toDataURL():p.getAttribute("src")),o.appendChild(h))}createPattern(e,t){let i,n=this.__document.__createElement("pattern"),r=wh(this.__ids);return n.setAttribute("id",r),n.setAttribute("width",e.width),n.setAttribute("height",e.height),"CANVAS"===e.nodeName||"IMG"===e.nodeName?(i=this.__createElement("image"),i.setAttribute("width",e.width),i.setAttribute("height",e.height),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href","CANVAS"===e.nodeName?e.toDataURL():e.getAttribute("src")),n.appendChild(i),this.__defs.appendChild(n)):e instanceof _h&&(n.appendChild(e.__root.childNodes[1]),this.__defs.appendChild(n)),new Ch(n,this)}setLineDash(e){e&&e.length>0?this.lineDash=e.join(","):this.lineDash=null}drawFocusRing(){}createImageData(){}getImageData(){}putImageData(){}globalCompositeOperation(){}setTransform(){}}function xh(e){if(e.startsWith("GCF")||e.startsWith("GCA")&&e.length>=13){return"https://hgdownload.soe.ucsc.edu/hubs/"+e.substring(0,3)+"/"+e.substring(4,7)+"/"+e.substring(7,10)+"/"+e.substring(10,13)+"/"+e+"/hub.txt"}}class kh{static supportedTypes=new Set(["bigBed","bigWig","bigGenePred","vcfTabix"]);static filterTracks=new Set(["cytoBandIdeo","assembly","gap","gapOverlap","allGaps","cpgIslandExtUnmasked","windowMasker"]);static async loadHub(e){const t=e.lastIndexOf("/"),i=e.substring(0,t+1),n=await Eh(e);let r;if("genome"===n[1].type){const e=n[1];if(e.hasProperty("groups")){const t=i+e.getProperty("groups");r=await Eh(t)}if(e.hasProperty("chromSizes")){const t=i+e.getProperty("chromSizes"),n=await async function(e){try{const t=(await fetch(e,{method:"HEAD"})).headers;return t.has("content-length")?t.get("content-length"):null}catch(e){return null}}(t);null!==n&&Number.parseInt(n)<1e6&&e.setProperty("chromSizesURL",t)}}return new kh(e,n,r)}constructor(e,t,i){this.url=e;const n=e.lastIndexOf("/");if(this.baseURL=e.substring(0,n+1),"hub"!==t[0].type)throw Error("Unexpected hub.txt file -- does the first line start with 'hub'?");if(this.hubStanza=t[0],"on"!==this.hubStanza.getProperty("useOneFile"))throw Error("Only 'useOneFile' hubs are currently supported");if(t.length<2)throw Error("Expected at least 2 stanzas, hub and genome");if("genome"!==t[1].type)throw Error(`Unexpected hub file -- expected "genome" stanza but found "${t[1].type}"`);this.genomeStanza=t[1],this.trackStanzas=[];for(let e=2;e<t.length;e++)"track"===t[e].type&&this.trackStanzas.push(t[e]);if(i){this.groupStanzas=i,this.groupPriorityMap=new Map;for(let e of i)e.hasProperty("priority")&&this.groupPriorityMap.set(e.getProperty("name"),10*Number.parseInt(e.getProperty("priority")))}}getDefaultPosition(){return this.genomeStanza.getProperty("defaultPos")}getGenomeConfig(e={}){const t=this.genomeStanza.getProperty("genome"),i=this.hubStanza.getProperty("shortLabel")||this.genomeStanza.getProperty("scientificName")||this.genomeStanza.getProperty("organism")||this.genomeStanza.getProperty("description"),n=i+(i?` (${t})`:` ${t}`),r={hubURL:this.url,id:t,name:n,twoBitURL:this.baseURL+this.genomeStanza.getProperty("twoBitPath"),nameSet:"ucsc"};if(this.genomeStanza.hasProperty("chromSizesURL")?r.chromSizesURL=this.genomeStanza.getProperty("chromSizesURL"):(r.wholeGenomeView=!1,r.showChromosomeWidget=!1),this.genomeStanza.hasProperty("defaultPos")){const e=this.genomeStanza.getProperty("defaultPos");if(e){const t=e.lastIndexOf(":");r.locus=t>0?e.substring(0,t):e}}this.genomeStanza.hasProperty("blat")&&(r.blat=this.baseURL+this.genomeStanza.getProperty("blat")),this.genomeStanza.hasProperty("chromAliasBb")&&(r.chromAliasBbURL=this.baseURL+this.genomeStanza.getProperty("chromAliasBb")),this.genomeStanza.hasProperty("chromAlias")&&(r.aliasURL=this.baseURL+this.genomeStanza.getProperty("chromAlias")),this.genomeStanza.hasProperty("twoBitBptURL")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptURL")),this.genomeStanza.hasProperty("twoBitBptUrl")&&(r.twoBitBptURL=this.baseURL+this.genomeStanza.getProperty("twoBitBptUrl")),e.includeChromSizes&&this.genomeStanza.hasProperty("chromSizes")&&(r.chromSizesURL=this.baseURL+this.genomeStanza.getProperty("chromSizes")),this.hubStanza.hasProperty("longLabel")?r.description=this.hubStanza.getProperty("longLabel").replace("/","\n"):(r.description=r.id,this.genomeStanza.hasProperty("description")&&(r.description+=`\n${this.genomeStanza.getProperty("description")}`),this.genomeStanza.hasProperty("organism")&&(r.description+=`\n${this.genomeStanza.getProperty("organism")}`),this.genomeStanza.hasProperty("scientificName")&&(r.description+=`\n${this.genomeStanza.getProperty("scientificName")}`),this.genomeStanza.hasProperty("htmlPath")&&(r.infoURL=this.baseURL+this.genomeStanza.getProperty("htmlPath")));const s=this.trackStanzas.filter((e=>"cytoBandIdeo"===e.name&&e.hasProperty("bigDataUrl")));s.length>0&&(r.cytobandBbURL=this.baseURL+s[0].getProperty("bigDataUrl"));return r.tracks=this.#g((e=>!kh.filterTracks.has(e.name)&&"hide"!==e.getProperty("visibility"))),r}getGroupedTrackConfigurations(){const e=new Map;for(let t of this.#g()){if("cytoBandIdeo"===t.name)continue;const i=t.group||"other";e.has(i)?e.get(i).push(t):e.set(i,[t])}const t=this.groupStanzas?new Map(this.groupStanzas.map((e=>[e.getProperty("name"),e]))):new Map;return Array.from(e.keys()).map((i=>({label:t.has(i)?t.get(i).getProperty("label"):i,tracks:e.get(i)})))}#g(e){return this.trackStanzas.filter((t=>kh.supportedTypes.has(t.format)&&t.hasProperty("bigDataUrl")&&(!e||e(t)))).map((e=>this.#m(e)))}#m(e){const t=e.format,i={id:e.getProperty("track"),name:e.getProperty("shortLabel"),format:t,url:this.baseURL+e.getProperty("bigDataUrl"),displayMode:e.displayMode};if("vcfTabix"===t&&(i.indexURL=i.url+".tbi"),e.hasProperty("longLabel")&&e.hasProperty("html")?(i.description&&(i.description+="<br/>"),i.description=`<a target="_blank" href="${this.baseURL+e.getProperty("html")}">${e.getProperty("longLabel")}</a>`):e.hasProperty("longLabel")&&(i.description=e.getProperty("longLabel")),e.hasProperty("autoScale")&&(i.autoscale="on"===e.getProperty("autoScale").toLowerCase()),e.hasProperty("maxHeightPixels")){const t=e.getProperty("maxHeightPixels").split(":");i.maxHeight=Number.parseInt(t[0]),i.height=Number.parseInt(t[1]),i.minHeight=Number.parseInt(t[2])}if(e.hasProperty("color")){const t=e.getProperty("color");i.color=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("altColor")){const t=e.getProperty("altColor");i.altColor=t.indexOf(",")>0?`rgb(${t})`:t}if(e.hasProperty("viewLimits")){const t=e.getProperty("viewLimits").split(":");let n,r;t.length>1&&(n=Number.parseInt(t[0]),r=Number.parseInt(t[1])),Number.isNaN(r)||Number.isNaN(n)?console.warn(`Unexpected viewLimits value in track line: ${properties.viewLimits}`):(i.min=n,i.max=r)}if(e.hasProperty("itemRgb"),"hide"===e.getProperty("visibility")&&(i.visible=!1),e.hasProperty("url")&&(i.infoURL=e.getProperty("url")),e.hasProperty("searchIndex")&&(i.searchIndex=e.getProperty("searchIndex")),e.hasProperty("searchTrix")&&(i.trixURL=this.baseURL+e.getProperty("searchTrix")),e.hasProperty("group")&&(i.group=e.getProperty("group"),this.groupPriorityMap&&this.groupPriorityMap.has(i.group))){const e=this.groupPriorityMap.get(i.group)+1;i.order=e,this.groupPriorityMap.set(i.group,e)}return i}}function Ih(e){const t=e.indexOf(" ");return t>0?e.substring(0,t):e}class Sh{properties=new Map;constructor(e,t){this.type=e,this.name=t}setProperty(e,t){this.properties.set(e,t)}getProperty(e){return this.properties.has(e)?this.properties.get(e):this.parent?this.parent.getProperty(e):void 0}hasProperty(e){return!!this.properties.has(e)||!!this.parent&&this.parent.hasProperty(e)}get format(){const e=this.getProperty("type");if(e)return Ih(e)}get displayMode(){let e=this.getProperty("visibility");if(!e)return"COLLAPSED";switch(e=e.toLowerCase(),e){case"dense":default:return"COLLAPSED";case"pack":return"EXPANDED";case"squish":return"SQUISHED"}}}async function Eh(e){const t=await fetch(e),i=(await t.text()).split(/\n|\r\n|\r/g),n=[];let r,s=!0;for(let e of i){const t=Nh(e),i=e.indexOf(" ",t);if(i<0)s=!0;else{const o=e.substring(t,i).trim();if(o.startsWith("#"))continue;const a=e.substring(i+1).trim();if(s){const e=new Sh(o,a);n.push(e),r=e,s=!1}r.setProperty(o,a)}}return function(e){const t=new Map;for(let i of e)t.set(i.name,i);for(let i of e)if(i.properties.has("parent")){const e=Ih(i.properties.get("parent"));i.parent=t.get(e)}return e}(n)}function Nh(e){let t=0;for(t=0;t<e.length;t++){const i=e.charAt(t);if(" "!==i&&"\t"!==i)break}return t}const Mh={initializeGenomes:async function(e){if(!Mh.KNOWN_GENOMES){const t={};if(!1!==e.loadDefaultGenomes){const r="https://igv.org/genomes/genomes.json";n(await Mn.loadJson(r,{timeout:5e3}))}const i=e.genomeList||e.genomes;if(i)if("string"==typeof i){n(await Mn.loadJson(i,{}))}else n(i);function n(e){return e.forEach((function(e){t[e.id]=e})),t}Mh.KNOWN_GENOMES=t}},isWholeGenomeView:function(e){return"all"===e.toLowerCase()},expandReference:async function(e,t){if(b(t)&&t.startsWith("{"))try{t=JSON.parse(t)}catch(e){}let i;if(b(t)?i=t:t.genome?i=t.genome:void 0===t.id||t.fastaURL||t.twobitURL||(i=t.id),i){let t=Mh.KNOWN_GENOMES[i];if(!t){if((i.startsWith("GCA_")||i.startsWith("GCF_"))&&i.length>=13)try{const e=xh(i);t=(await kh.loadHub(e)).getGenomeConfig()}catch(e){console.error(e)}t||e.present(new Error(`Unknown genome id: ${i}`),void 0)}return t}return t}};let Rh,Bh,Dh=0,Th=0,zh=[];class Lh extends gh{constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.spinnerElement=document.createElement("div"),this.spinnerElement.className="igv-loading-spinner-container",this.viewportElement.appendChild(this.spinnerElement);const e=document.createElement("div");this.spinnerElement.appendChild(e);const t=this.trackView.track;"sequence"!==t.type&&(this.zoomInNoticeElement=Lh.createZoomInNotice(this.viewportElement)),"sequence"!==t.id&&(this.trackLabelElement=document.createElement("div"),this.trackLabelElement.className="igv-track-label",this.viewportElement.appendChild(this.trackLabelElement),this.setTrackLabel(t.name||""),!1===this.browser.doShowTrackLabels&&(this.trackLabelElement.style.display="none"),this.trackView.track.height&&this.setHeight(this.trackView.track.height)),this.stopSpinner(),this.addMouseHandlers()}isZoomLevelRenderable(){const e=!(void 0===this.zoomInNoticeElement);let t;return t=!0===e&&"none"===this.zoomInNoticeElement.style.display,!0===e&&!0===t}setContentHeight(e){super.setContentHeight(e),this.featureCache&&(this.featureCache.redraw=!0)}setTrackLabel(e){this.trackLabelElement.innerHTML="",this.trackLabelElement.innerHTML=e;const t=this.trackLabelElement.textContent;this.trackLabelElement.setAttribute("title",t)}startSpinner(){this.spinnerElement&&(this.spinnerElement.style.display="flex")}stopSpinner(){this.spinnerElement&&(this.spinnerElement.style.display="none")}checkZoomIn(){if(this.trackView.track&&"sequence"===this.trackView.track.type&&this.referenceFrame.bpPerPixel>10)return this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),this.canvas=void 0,!1;if(!this.viewIsReady())return!1;if((()=>{if("all"===this.referenceFrame.chr.toLowerCase())return!this.trackView.track.supportsWholeGenome;{const e=this.trackView.track.visibilityWindow;return void 0!==e&&e>0&&this.referenceFrame.bpPerPixel*this.viewportElement.clientWidth>e}})()){if(this.canvas&&this.canvas.parentNode&&(this.canvas.parentNode.removeChild(this.canvas),this.canvas=void 0),this.trackView.track.autoHeight){const e=this.trackView.minHeight||0;this.setContentHeight(e)}return this.zoomInNoticeElement&&(this.zoomInNoticeElement.style.display="flex"),!1}return this.zoomInNoticeElement&&(this.zoomInNoticeElement.style.display="none"),!0}shift(){const e=this.referenceFrame;this.canvas&&this.canvas._data&&this.canvas._data.referenceFrame.chr===this.referenceFrame.chr&&this.canvas._data.bpPerPixel===e.bpPerPixel&&(this.canvas._data.pixelShift=Math.round((this.canvas._data.bpStart-e.start)/e.bpPerPixel),this.canvas.style.left=this.canvas._data.pixelShift+"px")}genomicRange(){return{start:this.referenceFrame.start,end:this.referenceFrame.start+this.referenceFrame.bpPerPixel*this.viewportElement.clientWidth}}setTop(e){if(super.setTop(e),this.canvas){const t=this.viewportElement.clientHeight,i=e+this.canvas._data.pixelTop,n=i+this.canvas._data.pixelHeight;(i>0||n<t)&&this.repaint()}else this.repaint();if(this.canvas&&this.canvas._data){let t=e+this.canvas._data.pixelTop;this.canvas.style.top=`${t}px`}}setHeight(e){super.setHeight(e);const t=this.viewportElement.querySelector(".igv-track-label");t&&(e<30?(t.style.margin=0,t.style.top="50%",t.style.transform="translateY(-50%)",t.style["-ms-transform"]="translateY(-50%)"):(t.style.removeProperty("margin"),t.style.removeProperty("top"),t.style.removeProperty("transform"),t.style.removeProperty("-ms-transform")))}async loadFeatures(){try{const e=this.referenceFrame,t=e.chr,i=await this.browser.genome.loadChromosome(t),n=i?i.bpLength:Number.MAX_SAFE_INTEGER,r=this.viewportElement.clientWidth*e.bpPerPixel,s=Math.floor(Math.max(0,e.start-r)),o=Math.ceil(Math.min(n,e.start+r+r));if(this.loading&&this.loading.start===s&&this.loading.end===o)return;this.loading={start:s,end:o},this.startSpinner();const a=this.trackView.track,c=await this.getFeatures(a,t,s,o,e.bpPerPixel);if(c){let i=[];if(a.roiSets&&a.roiSets.length>0)for(let n of a.roiSets){const r=await n.getFeatures(t,s,o,e.bpPerPixel);i.push({track:n,features:r})}const n=a&&a.resolutionAware,r=this.windowFunction;return this.featureCache=new Hh(t,s,o,e.bpPerPixel,c,i,n,r),this.loading=!1,this.hideMessage(),this.stopSpinner(),this.browser.fireEvent("featuresloaded",[this]),this.featureCache}}catch(e){this.trackView&&!0!==this.trackView.disposed&&(this.showMessage("Error loading track data"),this.browser.alert.present(e),console.error(e))}finally{this.loading=!1,this.stopSpinner()}}get track(){return this.trackView.track}get windowFunction(){return this.track?this.track.windowFunction:void 0}repaintDimensions(){const e=Mh.isWholeGenomeView(this.referenceFrame.chr),t=e?this.viewportElement.clientWidth:3*this.viewportElement.clientWidth,i=this.referenceFrame.bpPerPixel;return{bpStart:this.referenceFrame.start-(e?0:this.viewportElement.clientWidth*i),bpEnd:e?Number.MAX_SAFE_INTEGER:this.referenceFrame.start+2*this.viewportElement.clientWidth*i+1,pixelWidth:t}}repaint(){if(void 0===this.featureCache)return;const{features:e,roiFeatures:t}=this.featureCache,{bpStart:i,bpEnd:n,pixelWidth:r}=this.repaintDimensions(),s=this.viewportElement.clientHeight,o=this.getContentHeight(),a=t?Math.max(o,s):o,c=Math.min(a,3*s);if(0===r||0===c)return void(this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas));const l=Math.max(0,-this.contentTop-Math.floor(c/3)),h=this.referenceFrame.bpPerPixel,d=Math.round((i-this.referenceFrame.start)/h),u=(this.contentTop||0)+l,f=document.createElement("canvas");f.style.position="relative",f.style.display="block",f.style.width=r+"px",f.style.height=c+"px",f.style.left=d+"px",f.style.top=u+"px";const p="FILL"===this.trackView.track.displayMode||!1!==this.trackView.track.supportHiDPI?window.devicePixelRatio:1;f.width=p*r,f.height=p*c;const g=f.getContext("2d");g.scale(p,p),g.translate(0,-l);const m={context:g,pixelXOffset:d,pixelWidth:r,pixelHeight:c,pixelTop:l,bpStart:i,bpEnd:n,bpPerPixel:h,pixelShift:d,windowFunction:this.windowFunction,referenceFrame:this.referenceFrame,selection:this.selection,viewport:this,viewportWidth:this.viewportElement.clientWidth};this.draw(m,e,t),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas),f._data=m,this.canvas=f,this.viewportElement.appendChild(f)}refresh(){if(!this.canvas||!this.featureCache)return;const e=this.canvas._data;e.context.clearRect(0,0,this.canvas.width,this.canvas.height);const{features:t,roiFeatures:i}=this.featureCache;this.draw(e,t,i)}draw(e,t,i){if(t&&(e.features=t,this.trackView.track.draw(e)),i&&i.length>0)for(let t of i)e.features=t.features,t.track.draw(e)}containsPosition(e,t){return this.referenceFrame.chr===e&&t>=this.referenceFrame.start&&t<=this.referenceFrame.calculateEnd(this.getWidth())}isLoading(){return this.loading}savePNG(){if(!this.canvas)return;const e=this.viewportElement.clientWidth*window.devicePixelRatio,t=this.viewportElement.clientHeight*window.devicePixelRatio,i=-this.canvas.offsetLeft*window.devicePixelRatio,n=this.canvas._data,r=n?n.pixelTop:0,s=(-this.contentTop-r)*window.devicePixelRatio,o=this.canvas.getContext("2d").getImageData(i,s,e,t),a=document.createElement("canvas"),c=a.getContext("2d");a.width=o.width,a.height=o.height,c.putImageData(o,0,0);x((this.trackLabelElement&&this.trackLabelElement.textContent?this.trackLabelElement.textContent:"image")+".png",a.toDataURL("image/png"))}saveSVG(){let{width:e,height:t}=this.browser.columnContainer.getBoundingClientRect();const i=new _h({width:e,height:8e3,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:e,height:8e3}}),n={deltaX:32,deltaY:32};this.renderSVGContext(i,n,!1),i.setHeight(t);const r=(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,""),s=this.browser.referenceFrameList.indexOf(this.referenceFrame),a=i.getSerializedSvg(!0),c=URL.createObjectURL(new Blob([a],{type:"application/octet-stream"}));x(`${`${r}_referenceFrame_${s}_guid_${o()}`}.svg`,c)}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){if(!0===this.isZoomLevelRenderable()){const{width:n,height:r}=this.viewportElement.getBoundingClientRect(),s=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${o()}`,a=t,c=i+this.contentTop,l=-this.contentTop;e.saveWithTranslationAndClipRect(s,a,c,n,r,l);const{start:h,bpPerPixel:d}=this.referenceFrame,u=Math.round((h-this.referenceFrame.start)/d),f={context:e,viewport:this,referenceFrame:this.referenceFrame,top:l,pixelTop:l,pixelWidth:n,pixelHeight:r,pixelXOffset:u,pixelShift:u,bpStart:h,bpEnd:h+n*d,bpPerPixel:d,viewportWidth:n,selection:this.selection},p=this.featureCache?this.featureCache.features:void 0,g=this.featureCache?this.featureCache.roiFeatures:void 0;this.draw(f,p,g),e.restore()}if(n&&this.trackLabelElement&&this.browser.doShowTrackLabels){const{x:n,y:r,width:s,height:o}=this.viewportElement.getBoundingClientRect(),{x:a,y:c,width:l,height:h}=this.trackLabelElement.getBoundingClientRect(),d=a-n,u=c-r,f=l,p=h;this.renderTrackLabelSVG(e,t+d,i+u,f,p)}}renderTrackLabelSVG(e,t,i,n,r){const s=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_track_label_guid_${o()}`;e.saveWithTranslationAndClipRect(s,t,i,n,r,0),e.fillStyle="white",e.fillRect(0,0,n,r),e.font="12px Arial",e.fillStyle="rgb(68, 68, 68)";const a=.25*(n-e.measureText(this.trackLabelElement.textContent).width),c=.7*(r-12);e.fillText(this.trackLabelElement.textContent,a,r-c),e.strokeStyle="rgb(68, 68, 68)",e.strokeRect(0,0,n,r),e.restore()}get cachedFeatures(){return this.featureCache?this.featureCache.features:[]}clearCache(){this.featureCache=void 0,this.canvas&&(this.canvas._data=void 0)}async getFeatures(e,t,i,n,r){if(this.featureCache&&this.featureCache.containsRange(t,i,n,r,this.windowFunction))return this.featureCache.features;if("function"==typeof e.getFeatures){const s=await e.getFeatures(t,i,n,r,this);return this.checkContentHeight(s),s}}needsRepaint(){if(!this.canvas)return!0;const e=this.canvas._data;return!e||this.referenceFrame.start<e.bpStart||this.referenceFrame.end>e.bpEnd||this.referenceFrame.chr!==e.referenceFrame.chr||this.referenceFrame.bpPerPixel!==e.bpPerPixel||this.windowFunction!==e.windowFunction}needsReload(){if(!this.featureCache)return!0;const{chr:e,bpPerPixel:t}=this.referenceFrame,{bpStart:i,bpEnd:n}=this.repaintDimensions();return!this.featureCache.containsRange(e,i,n,t,this.windowFunction)}static createZoomInNotice(e){const t=document.createElement("div");t.className="igv-zoom-in-notice-container",e.appendChild(t);const i=document.createElement("div");return t.appendChild(i),i.textContent="Zoom in to see features",t.style.display="none",t}viewIsReady(){return this.browser&&this.browser.referenceFrameList&&this.referenceFrame}addMouseHandlers(){this.addViewportContextMenuHandler(this.viewportElement);const e=e=>{this.enableClick=!0,this.browser.mouseDownOnViewport(e,this),s(e)};this.viewportElement.addEventListener("mousedown",e),this.viewportElement.addEventListener("touchstart",e);const t=e=>{this.browser.dragObject||this.browser.isScrolling?(this.browser.cancelTrackPan(),this.enableClick=!1):(this.browser.cancelTrackPan(),this.browser.endTrackDrag())};this.viewportElement.addEventListener("mouseup",t),this.viewportElement.addEventListener("touchend",t),"function"==typeof this.trackView.track.hoverText&&this.viewportElement.addEventListener("mousemove",(e=>{if(0===e.buttons&&Date.now()-Th>100){Th=Date.now();const t=this.createClickState(e);if(t){const e=this.trackView.track.hoverText(t);e?this.viewportElement.setAttribute("title",e):this.viewportElement.removeAttribute("title")}}})),this.addViewportClickHandler(this.viewportElement),this.trackView.track.name&&"sequence"!==this.trackView.track.config.type&&this.addTrackLabelClickHandler(this.trackLabelElement)}addViewportContextMenuHandler(e){e.addEventListener("contextmenu",(e=>{if(this.browser.dragObject)return!1;const t=this.createClickState(e);if(void 0===t)return!1;e.preventDefault();let i=[];if("function"==typeof this.trackView.track.contextMenuItemList){const e=this.trackView.track.contextMenuItemList(t);e&&(i=e)}i.length>0&&i.push({label:document.createElement("hr")}),i.push({label:"Save Image (PNG)",click:()=>this.savePNG()}),i.push({label:"Save Image (SVG)",click:()=>this.saveSVG()}),this.browser.menuPopup.presentTrackContextMenu(e,i)}))}addViewportClickHandler(e){e.addEventListener("click",(e=>{if(this.enableClick&&this.canvas){if(3===e.which||e.ctrlKey)return;if(this.browser.dragObject||this.browser.isScrolling)return;e.preventDefault();const t=a(e,this.viewportElement).x,i=a(e,this.canvas).x,n=this.referenceFrame;Math.floor(n.start+n.toBP(i));const r=Date.now();if(r-Dh<this.browser.constants.doubleClickDelay){Rh&&(window.clearTimeout(Rh),Rh=void 0);const e=Math.round(n.start+n.toBP(t));let i;if("all"===this.referenceFrame.chr.toLowerCase()){const t=this.browser.genome.getChromosomeCoordinate(e).chr;if(1===this.browser.referenceFrameList.length)i=t;else{const e=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));e[this.browser.referenceFrameList.indexOf(this.referenceFrame)]=t,i=e.join(" ")}this.browser.search(i)}else this.browser.zoomWithScaleFactor(.5,e,this.referenceFrame)}else"function"==typeof this.trackView.track.popupData&&(Rh=setTimeout((()=>{const t=this.getPopupContent(e);if(t)if(!1===e.shiftKey){if(Bh&&Bh.dispose(),zh.length>0){for(const e of zh)e.dispose();zh.length=0}Bh=new io(this.viewportElement.parentElement,!0,void 0,(()=>{Bh.dispose()})),Bh.presentContentWithEvent(e,t)}else{let i=new io(this.viewportElement.parentElement,!0,void 0,(()=>{const e=zh.indexOf(i);zh.splice(e,1),i.dispose()}));zh.push(i),i.presentContentWithEvent(e,t)}window.clearTimeout(Rh),Rh=void 0}),this.browser.constants.doubleClickDelay));Dh=r}}))}addTrackLabelClickHandler(e){e.addEventListener("click",(e=>{e.stopPropagation();const{track:t}=this.trackView;let i;"function"==typeof t.description?i=t.description():t.description&&(i=`<div>${t.description}</div>`),i&&(void 0===this.popover&&(this.popover=new io(this.browser.columnContainer,!0,t.name||"",void 0)),this.popover.presentContentWithEvent(e,i))}))}createClickState(e){if(!this.canvas)return;const t=this.referenceFrame,i=a(e,this.viewportElement),n=a(e,this.canvas),r=t.start+t.toBP(i.x);return{event:e,viewport:this,referenceFrame:t,genomicLocation:r,y:i.y-this.contentTop,canvasX:n.x,canvasY:n.y}}getPopupContent(e){const t=this.createClickState(e);if(void 0===t)return;let i=this.trackView.track;const n=i.popupData(t),r=this.browser.fireEvent("trackclick",[i,n]);let s;return void 0===r||!0===r?n&&n.length>0&&(s=n.map((e=>{if(e.name){const t=`<span>${e.name}</span>   ${e.value}`;return`<div title="${e.value}">${t}</div>`}return"<hr>"===e?e:e.html?e.html:`<div title="${e}">${e}</div>`})).join("")):"string"==typeof r&&(s=r),s}dispose(){this.popover&&this.popover.dispose(),super.dispose()}}class Hh{constructor(e,t,i,n,r,s,o,a){this.chr=e,this.bpStart=t,this.bpEnd=i,this.bpPerPixel=n,this.features=r,this.roiFeatures=s,this.multiresolution=o,this.windowFunction=a}containsRange(e,t,i,n,r){if(r&&r!==this.windowFunction)return!1;const s=this.multiresolution?this.bpPerPixel/n:1;return t>=this.bpStart&&i<=this.bpEnd&&e===this.chr&&s>.5&&s<2}overlapsRange(e,t,i){return this.chr===e&&i>=this.bpStart&&t<=this.bpEnd}}const Ph=1/16,Oh=function(e,t){const{r:i,g:n,b:r}=Gn[e];return`rgba(${i},${n},${r},${t})`}("nickel",Ph),Vh=Oh;class qh{constructor(e,t){if(this.url=e.url,e.name&&(this.name=e.name),this.isUserDefined=e.isUserDefined,e.featureSource)this.featureSource=e.featureSource;else if(e.features)this.featureSource=new Uh(e.features,t);else{if(!e.format)throw Error("ROI configuration must define either features or file format");this.featureSource=Hl(e,t)}if(e.color&&!e.color.startsWith("rgba")&&(e.color=un.addAlpha(e.color,Ph)),!0===this.isUserDefined)this.color=e.color||Vh,this.headerColor="rgba(155,185,129)";else{this.color=e.color||Oh,this.headerColor="rgb(190,190,190)";const[t,i,n,r]=function(e){if(e.startsWith("rgba(")){const[t,i]=e.split("("),[n]=i.split(")");return n.split(",").map(((e,t)=>t<3?parseInt(e):parseFloat(e)))}}(this.color);this.headerColor=`rgba(${t},${i},${n},1)`}delete e.isVisible}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}async getAllFeatures(){return"function"==typeof this.featureSource.getAllFeatures?await this.featureSource.getAllFeatures():{}}addFeature(e){this.featureSource.addFeature(e)}removeFeature(e){this.featureSource.removeFeature(e)}toJSON(){if(this.url)return{name:this.name,color:this.color,url:this.url,isUserDefined:this.isUserDefined,isVisible:this.isVisible};{const e=this.featureSource.getAllFeatures(),t=[];for(let i of Object.keys(e))for(let n of e[i])t.push(n);return{name:this.name,color:this.color,features:t,isUserDefined:this.isUserDefined,isVisible:this.isVisible}}}dispose(){for(let e of Object.keys(this))this[e]=void 0}}function Qh(e,t,i,n){let r=Math.round((e-i)/n);let s=Math.round((t-i)/n)-r;return s<3&&(s=3,r-=1),{x:r,width:s}}class Uh{constructor(e,t){this.featureMap={},this.genome=t;for(let i of e){const e=t?t.getChromosomeName(i.chr):i.chr;let n=this.featureMap[e];n||(n=[],this.featureMap[e]=n),n.push(i)}for(let e of Object.keys(this.featureMap))this.featureMap[e].sort(((e,t)=>e.start-t.start))}async getFeatures({chr:e,start:t,end:i}){if("all"===e.toLowerCase())return La(this.featureMap,this.genome);{const n=this.featureMap[e];return n?n.filter((e=>e.end>t&&e.start<i)):[]}}getAllFeatures(){return this.featureMap}supportsWholeGenome(){return!0}addFeature(e){let t=this.featureMap[e.chr];t||(t=[],this.featureMap[e.chr]=t),t.push(e),t.sort(((e,t)=>e.start-t.start))}removeFeature({chr:e,start:t,end:i}){if(this.featureMap[e]){const n=`${e}-${t}-${i}`;this.featureMap[e]=this.featureMap[e].filter((e=>n!==`${e.chr}-${e.start}-${e.end}`)),0===this.featureMap[e].length&&delete this.featureMap[e]}}}class jh{constructor(e,i,n,r){this.rulerViewport=e,this.rulerSweeper=t({class:"igv-ruler-sweeper"}),i.appendChild(this.rulerSweeper),this.browser=n,this.referenceFrame=r,this.isMouseHandlers=void 0,this.addBrowserObserver()}addBrowserObserver(){this.boundObserverHandler=(()=>{this.referenceFrame&&(Mh.isWholeGenomeView(this.referenceFrame.chr)?this.removeMouseHandlers():this.addMouseHandlers())}).bind(this),this.browser.on("locuschange",this.boundObserverHandler)}removeBrowserObserver(){this.browser.off("locuschange",this.boundObserverHandler)}addMouseHandlers(){if(!0===this.isMouseHandlers)return;let e,t,i,n,r,s;this.boundContentMouseDownHandler=function(s){e=!0,t=!0;const{x:o}=a(s,this.rulerViewport.contentDiv);n=i=o,r=1,this.rulerSweeper.style.display="block",this.rulerSweeper.style.backgroundColor=!0===s.shiftKey?Vh:"rgba(68, 134, 247, 0.25)",this.rulerSweeper.style.left=`${n}px`,this.rulerSweeper.style.width=`${r}px`}.bind(this),this.rulerViewport.contentDiv.addEventListener("mousedown",this.boundContentMouseDownHandler),this.boundDocumentMouseMoveHandler=function(o){let c;if(e&&t){const{x:e}=a(o,this.rulerViewport.contentDiv);c=Math.max(Math.min(e,this.rulerViewport.contentDiv.clientWidth),0),s=c-i,r=Math.abs(s),this.rulerSweeper.style.width=`${r}px`,s<0&&(n=i+s,this.rulerSweeper.style.left=`${n}px`)}}.bind(this),document.addEventListener("mousemove",this.boundDocumentMouseMoveHandler),this.boundDocumentMouseUpHandler=function(i){let s;if(!0===e&&!0===t&&(e=t=void 0,this.rulerSweeper.style.display="none",r>1)){s={start:Math.floor(this.referenceFrame.calculateEnd(n)),end:Math.floor(this.referenceFrame.calculateEnd(n+r))};!0===i.shiftKey?this.browser.roiManager.updateUserDefinedROISet(Object.assign({chr:this.referenceFrame.chr},s)):(Ws(this.browser.genome.getChromosome(this.referenceFrame.chr).bpLength,s,this.browser.minimumBases()),function(e,t,i){e.start=Math.round(t.start),e.end=Math.round(t.end),e.bpPerPixel=(e.end-e.start)/i}(this.referenceFrame,s,this.rulerViewport.contentDiv.clientWidth),this.browser.updateViews(this.referenceFrame))}}.bind(this),document.addEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!0}removeMouseHandlers(){this.rulerViewport.contentDiv.removeEventListener("mousedown",this.boundContentMouseDownHandler),document.removeEventListener("mousemove",this.boundDocumentMouseMoveHandler),document.removeEventListener("mouseup",this.boundDocumentMouseUpHandler),this.isMouseHandlers=!1}dispose(){this.removeBrowserObserver(),this.removeMouseHandlers(),this.rulerSweeper.remove()}}function Gh(e){if(Wh[e])return Wh[e];if(Wh["chr"+e]){const t=Wh["chr"+e];return Wh[e]=t,t}{const t=un.randomRGB(0,255);return Wh[e]=t,t}}const Wh={chrX:"rgb(204, 153, 0)",chrY:"rgb(153, 204, 0)",chrUn:"rgb(50, 50, 50)",chr1:"rgb(80, 80, 255)",chrI:"rgb(139, 155, 187)",chr2:"rgb(206, 61, 50)",chrII:"rgb(206, 61, 50)",chr2a:"rgb(216, 71, 60)",chr2b:"rgb(226, 81, 70)",chr3:"rgb(116, 155, 88)",chrIII:"rgb(116, 155, 88)",chr4:"rgb(240, 230, 133)",chrIV:"rgb(240, 230, 133)",chr5:"rgb(70, 105, 131)",chr6:"rgb(186, 99, 56)",chr7:"rgb(93, 177, 221)",chr8:"rgb(128, 34, 104)",chr9:"rgb(107, 215, 107)",chr10:"rgb(213, 149, 167)",chr11:"rgb(146, 72, 34)",chr12:"rgb(131, 123, 141)",chr13:"rgb(199, 81, 39)",chr14:"rgb(213, 143, 92)",chr15:"rgb(122, 101, 165)",chr16:"rgb(228, 175, 105)",chr17:"rgb(59, 27, 83)",chr18:"rgb(205, 222, 183)",chr19:"rgb(97, 42, 121)",chr20:"rgb(174, 31, 99)",chr21:"rgb(231, 199, 111)",chr22:"rgb(90, 101, 94)",chr23:"rgb(204, 153, 0)",chr24:"rgb(153, 204, 0)",chr25:"rgb(51, 204, 0)",chr26:"rgb(0, 204, 51)",chr27:"rgb(0, 204, 153)",chr28:"rgb(0, 153, 204)",chr29:"rgb(10, 71, 255)",chr30:"rgb(71, 117, 255)",chr31:"rgb(255, 194, 10)",chr32:"rgb(255, 209, 71)",chr33:"rgb(153, 0, 51)",chr34:"rgb(153, 26, 0)",chr35:"rgb(153, 102, 0)",chr36:"rgb(128, 153, 0)",chr37:"rgb(51, 153, 0)",chr38:"rgb(0, 153, 26)",chr39:"rgb(0, 153, 102)",chr40:"rgb(0, 128, 153)",chr41:"rgb(0, 51, 153)",chr42:"rgb(26, 0, 153)",chr43:"rgb(102, 0, 153)",chr44:"rgb(153, 0, 128)",chr45:"rgb(214, 0, 71)",chr46:"rgb(255, 20, 99)",chr47:"rgb(0, 214, 143)",chr48:"rgb(20, 255, 177)"};let $h,Kh;class Yh extends Lh{constructor(e,t,i,n){super(e,t,i,n)}get contentDiv(){return this.viewportElement}initializationHelper(){this.multiLocusCloseButton=document.createElement("div"),this.multiLocusCloseButton.className="igv-multi-locus-close-button",this.viewportElement.appendChild(this.multiLocusCloseButton);const e=l("times-circle");this.multiLocusCloseButton.appendChild(e),this.multiLocusCloseButton.addEventListener("click",(()=>{this.browser.removeMultiLocusPanel(this.referenceFrame)})),this.rulerLabel=document.createElement("div"),this.rulerLabel.className="igv-multi-locus-ruler-label",this.viewportElement.appendChild(this.rulerLabel);const t=document.createElement("div");this.rulerLabel.appendChild(t),this.rulerLabel.addEventListener("click",(async e=>{e.stopPropagation(),await this.browser.gotoMultilocusPanel(this.referenceFrame)})),this.tooltip=document.createElement("div"),this.tooltip.className="igv-ruler-tooltip",this.tooltip.style.height=`${this.viewportElement.clientHeight}px`,this.viewportElement.appendChild(this.tooltip),this.tooltipContent=document.createElement("div"),this.tooltip.appendChild(this.tooltipContent),this.rulerSweeper=new jh(this,this.viewportElement.parentElement,this.browser,this.referenceFrame),this.attachMouseHandlers(Mh.isWholeGenomeView(this.referenceFrame.chr)),this.tooltip.style.display="none",this.dismissLocusLabel()}presentLocusLabel(e){this.multiLocusCloseButton.style.display="block",this.rulerLabel.style.display="block",this.rulerLabel.style.backgroundColor=Gh(this.referenceFrame.chr);const t=this.rulerLabel.querySelector("div"),{width:i}=this.rulerLabel.getBoundingClientRect();t.innerHTML=`${this.referenceFrame.getMultiLocusLabel(e)}`;const{width:n}=t.getBoundingClientRect();n/i>.5&&(t.innerHTML=`${this.referenceFrame.getMultiLocusLabelBPLengthOnly(e)}`)}dismissLocusLabel(){this.rulerLabel.style.display="none",this.multiLocusCloseButton.style.display="none"}attachMouseHandlers(e){!0===e?(this.viewportElement.addEventListener("click",(e=>{const{x:t}=a(e,this.viewportElement),i=Math.round(this.referenceFrame.start+this.referenceFrame.toBP(t));let n;const{chr:r}=this.browser.genome.getChromosomeCoordinate(i);if(1===this.browser.referenceFrameList.length)n=r;else{const e=this.browser.referenceFrameList.indexOf(this.referenceFrame),t=this.browser.referenceFrameList.map((({locusSearchString:e})=>e));t[e]=r,n=t.join(" ")}this.browser.search(n)})),this.viewportElement.style.cursor="pointer"):this.viewportElement.style.cursor="default"}mouseMove(e){if(this.browser.doShowCursorGuide){void 0===Kh?(Kh=this,this.tooltip.style.display="block"):Kh.guid!==this.guid?(Kh.tooltip&&(Kh.tooltip.style.display="none"),this.tooltip.style.display="block",Kh=this):this.tooltip.style.display="block";if(this.browser.isMultiLocusWholeGenomeView()||Mh.isWholeGenomeView(this.referenceFrame.chr))return void(this.tooltip.style.display="none");const{x:t}=a(e,this.viewportElement),{start:i,end:n,bpPerPixel:r}=this.referenceFrame,s=Math.round(.5+i+Math.max(0,t)*r);this.tooltipContent.textContent=F(s);const o=this.tooltipContent.getBoundingClientRect(),c=this.viewportElement.getBoundingClientRect(),l=cn(t,0,c.width-o.width);return this.tooltip.style.left=`${l}px`,clearTimeout($h),$h=setTimeout((()=>{this.tooltip&&(this.tooltip.style.display="none")}),1e4),{start:i,bp:s,end:n}}}startSpinner(){}stopSpinner(){}dispose(){this.rulerSweeper.dispose(),super.dispose()}}let Xh;class Zh extends Lh{featureCache=new Jh;constructor(e,t,i,n){super(e,t,i,n)}initializationHelper(){this.canvas=document.createElement("canvas"),this.canvas.className="igv-ideogram-canvas",this.viewportElement.appendChild(this.canvas),this.ideogram_ctx=this.canvas.getContext("2d"),this.tooltip=document.createElement("div"),this.tooltip.className="igv-cytoband-tooltip",this.tooltip.style.height=`${this.viewportElement.clientHeight}px`,this.viewportElement.appendChild(this.tooltip),this.tooltipContent=document.createElement("div"),this.tooltip.appendChild(this.tooltipContent),this.tooltip.style.display="none",this.addMouseHandlers()}async getFeatures(e,t,i,n){return this.featureCache.containsRange(e)?this.featureCache.get(e):this.loadFeatures()}async loadFeatures(){const e=this.referenceFrame.chr,t=await this.referenceFrame.genome.getCytobands(e);return this.featureCache.set(e,t),t}repaint(){if(void 0===this.featureCache)return;const{width:e,height:t}=this.viewportElement.getBoundingClientRect();fr.configureHighDPICanvas(this.ideogram_ctx,e,t);const i=this.referenceFrame.chr,n=this.featureCache.get(i),r={context:this.ideogram_ctx,pixelWidth:e,pixelHeight:t,referenceFrame:this.referenceFrame,features:n};this.trackView.track.draw(r)}addMouseHandlers(){this.addViewportClickHandler(this.viewportElement),this.trackView.track.showCytobandNames&&(this.viewportElement.addEventListener("mousemove",this.mouseMove.bind(this)),this.viewportElement.addEventListener("mouseleave",this.mouseLeave.bind(this)))}mouseMove(e){const{x:t}=a(e,this.viewportElement),i=this.featureCache.get(this.referenceFrame.chr);if(i){const{width:e}=this.viewportElement.getBoundingClientRect(),n=e/i[i.length-1].end;let r=!1;for(let s=0;s<i.length;s++){const o=i[s],a=o.start*n,c=o.end*n;if(t>=a&&t<=c){this.tooltipContent.textContent=o.name;const{width:t}=this.tooltipContent.getBoundingClientRect();const i=cn((a+c)/2-t/2,0,e-t);this.tooltip.style.left=`${i}px`,clearTimeout(Xh),Xh=setTimeout((()=>{this.tooltip&&(this.tooltip.style.display="none")}),1e4),this.tooltip.style.display="block",r=!0;break}}if(r)return}this.tooltip.style.display="none"}mouseLeave(e){this.tooltip.style.display="none"}addViewportClickHandler(e){this.boundClickHandler=function(e){const{xNormalized:t,width:i}=a(e,this.ideogram_ctx.canvas),{bpLength:n}=this.browser.genome.getChromosome(this.referenceFrame.chr),r=this.referenceFrame.bpPerPixel*i/n;let s=t;s-r/2<0&&(s=r/2);s+r/2>1&&(s=1-r/2);const o=Math.round((s-r/2)*n),c=Math.round((s+r/2)*n);this.referenceFrame.start=o,this.referenceFrame.end=c,this.referenceFrame.bpPerPixel=(c-o)/i,this.browser.updateViews(this.referenceFrame,this.browser.trackViews,!0)}.bind(this),e.addEventListener("click",this.boundClickHandler)}setWidth(e){this.viewportElement.style.width=e+"px"}renderSVGContext(e,{deltaX:t,deltaY:i},n=!0){const{width:r,height:s}=this.viewportElement.getBoundingClientRect(),a=`ideogram_referenceFrame_${this.browser.referenceFrameList.indexOf(this.referenceFrame)}_guid_${o()}`,c=t,l=i+this.contentTop,h=-this.contentTop;e.saveWithTranslationAndClipRect(a,c,l,r,s,h),this.trackView.track.draw({context:e,pixelWidth:r,pixelHeight:s,referenceFrame:this.referenceFrame,features:this.featureCache.get(this.referenceFrame.chr)}),e.restore()}startSpinner(){}stopSpinner(){}}class Jh{features=new Map;containsRange(e){return this.features.has(e)}set(e,t){this.features.set(e,t)}get(e){return this.features.get(e)}}function ed(e,t,i,n){if("ruler"===e.track.type)return new Yh(e,t,i,n);if("ideogram"===e.track.id)return new Zh(e,t,i,n);{const r=new Lh(e,t,i,n);return i.viewport=r,r}}const td=["rgb(255, 0, 0)","rgb(0, 255, 0)","rgb(0, 0, 255)","rgb(255, 0, 255)","rgb(0, 255, 255)","rgb(128, 0, 128)","rgb(255, 165, 0)","rgb(255, 105, 180)","rgb(255, 127, 80)","rgb(220, 20, 60)","rgb(255, 99, 71)","rgb(173, 216, 230)","rgb(144, 238, 144)","rgb(224, 255, 255)","rgb(250, 250, 210)","rgb(152, 251, 152)","rgb(70, 130, 180)","rgb(102, 205, 170)"].map((e=>{const[t,i,n]=e.split(","),[r,s]=t.split("("),[o,a]=n.split(")");return[s,i,o]})),id=Wn("magnesium"),nd=["#sampleTable","#sampleMapping","#colors"];class rd{static emptySpaceReplacement="|";sampleDictionary={};attributeNames=[];sampleMappingDictionary={};colorDictionary={};attributeRangeLUT={};constructor(e){e.tracks.some((e=>"function"==typeof e.getSamples)).length>0&&e.sampleInfoControl.setButtonVisibility(!0),this.initialize()}initialize(){this.sampleInfoFiles=[],this.attributeNames=[],this.sampleDictionary={},this.sampleMappingDictionary={},this.colorDictionary={},this.attributeRangeLUT={},this.initialized=!1}get attributeCount(){return this.attributeNames?this.attributeNames.length:0}isInitialized(){return this.initialized}hasAttributes(){return this.attributeCount>0}getAttributes(e){const t=0===Object.keys(this.sampleMappingDictionary)?e:this.sampleMappingDictionary[e]||e;return this.sampleDictionary[t]}async loadSampleInfoFile(e){try{const t=await Mn.loadString(e);this.#w(t),this.sampleInfoFiles.push(e)}catch(e){console.error(e.message)}}#w(e){const t=function(e){const t={},i=e.split(/\r?\n|\r/).map((e=>e.trim())).filter((e=>""!==e));let n;nd.includes(i[0])||(n="#sampleTable",t[n]=[]);for(const e of i)nd.includes(e)?(n=e,t[n]=[]):n&&!1===e.startsWith("#")&&t[n].push(e);return t}(e);for(const[e,i]of Object.entries(t))switch(e){case"#sampleTable":this.#b(i);break;case"#sampleMapping":this.#F(i);break;case"#colors":this.#v(i)}this.initialized=!0}getAttributeColor(e,t){let i;if("-"===t)i=Wn("snow");else if("string"==typeof t&&this.colorDictionary[t])i=this.colorDictionary[t]();else if(this.colorDictionary[e])i=this.colorDictionary[e](t);else if("string"==typeof t)i="NA"===t?id:function(e){let t=0;for(let i=0;i<e.length;i++)t=e.charCodeAt(i)+((t<<5)-t);let i=[];for(let e=0;e<3;e++){const n=t>>8*e&255;i.push(n)}return`rgb(${i.join(", ")})`}(t);else{const[n,r]=this.attributeRangeLUT[e],s=.2,o=Math.max((t-n)/(r-n),s),[a,c,l]=td[Object.keys(this.attributeRangeLUT).indexOf(e)];i=`rgba(${a},${c},${l},${o})`}return i}getSortedSampleKeysByAttribute(e,t,i){i=i||1;const n=e.filter((e=>"number"==typeof this.getAttributes(e)[t])),r=e.filter((e=>"string"==typeof this.getAttributes(e)[t])),s=(e,n)=>{const r=this.getAttributes(e)[t],s=this.getAttributes(n)[t];return"string"==typeof r&&"string"==typeof s?i*r.localeCompare(s):"number"==typeof r&&"number"==typeof s?i*(r-s):void 0};return n.sort(s),r.sort(s),-1===i?[...n,...r]:[...r,...n]}toJSON(){const e=[];for(const t of this.sampleInfoFiles){const i={url:t},n=Pa.localFileInspection(i);e.push(n)}return e}#b(e){const t=e.shift().split("\t").filter((e=>e.length>0));t.shift();const i=t.map((e=>e.split(" ").join(rd.emptySpaceReplacement))),n=e.filter((e=>e.length>0));let r;for(const e of n){const t=e.split("\t"),n=t.shift();void 0===r&&(r={}),r[n]={};for(let e=0;e<t.length;e++){const s={};""===t[e]?s[i[e]]="-":s[i[e]]=t[e],Object.assign(r[n],s)}}for(const[e,t]of Object.entries(r))r[e]=od(t);const s=function(e,t){const i={};for(const n of Object.values(t))for(const t of e){let e=n[t];void 0===i[t]&&(i[t]=[]),i[t].push(e)}const n=e=>"number"==typeof e,r=e=>"string"==typeof e;for(const e of Object.keys(i)){const t=i[e],s=new Set(t),o=Array.from(s);if(!0===o.some(r)&&!0===o.some(n)?i[e]=o.filter((e=>!r(e))):i[e]=o,!i[e].some(r)){const t=i[e].slice();i[e]=[Math.min(...t),Math.max(...t)]}}return i}(i,r);sd(this.attributeRangeLUT,s);const o=new Set(this.attributeNames);for(const e of i)o.has(e)||this.attributeNames.push(e);sd(this.sampleDictionary,r)}#F(e){for(const t of e){const[e,i]=t.split("\t");this.sampleMappingDictionary[e]=i}}#v(e){const t=(e,t,i)=>{let n;switch(t){case 0:n=e.split(" ").join(rd.emptySpaceReplacement);break;case 1:n=e.includes(":")?e.split(":").map((e=>parseFloat(e))):e;break;case 2:case 3:n=`rgb(${e})`}return n},i=e.map((e=>e.split("\t").map(t))),n=i.filter((e=>3===e.length&&!e.includes("*"))).filter((([e,t,i])=>!Array.isArray(t))),r={};for(const e of n){const[t,i,n]=e;void 0===r[t]&&(r[t]={}),r[t][i.toUpperCase()]=n}for(const[e,t]of Object.entries(r)){const i=Object.assign({},t);this.colorDictionary[e]=e=>{const t=e.toUpperCase();return i[t]||Wn("snow")}}const s=i.filter((e=>Array.isArray(e[1])));for(const e of s){const[t,i]=e[1],n=e[0];if(3===e.length){const[r,s,o]=er(e[2]);this.colorDictionary[n]=e=>{e=cn(e,t,i);return Zn(r,s,o,(e-t)/(i-t))}}else if(4===e.length){const[t,i]=e[1],[n,r,s,o]=e;this.colorDictionary[n]=e=>{e=cn(e,t,i);return tr(s,o,(e-t)/(i-t))}}}const o=i.filter((e=>3===e.length&&e.includes("*")));for(const e of o)if("*"===e[1]){const[t,i,n]=e;this.colorDictionary[t]=e=>{if("NA"===e)return id;{const[i,r]=this.attributeRangeLUT[t],s=(e-i)/(r-i),[o,a,c]=er(n);return Zn(o,a,c,s)}}}else if("*"===e[0]){const[t,i,n]=e;this.colorDictionary[i]=()=>n}}}function sd(e,t){for(const[i,n]of Object.entries(t))i in e&&e[i]===n||(e[i]=n)}function od(e){const t=Object.assign({},e);for(const[e,i]of Object.entries(t))"string"!=typeof i||isNaN(i)||(t[e]=Number(i));return t}const ad=16,cd=F;class ld{constructor(e){this.browser=e,this.height=40,this.name="",this.disableButtons=!0,this.ignoreTrackMenu=!0,this.order=.01*Number.MIN_SAFE_INTEGER,this.removable=!1,this.type="ruler",this.id="ruler"}async getFeatures(e,t,i){return[]}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpPerPixel:r,bpStart:s}){Mh.isWholeGenomeView(t.chr)?this.drawWholeGenome({context:e,pixelWidth:i,pixelHeight:n,bpPerPixel:r}):this.doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:s})}drawWholeGenome({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n}){e.save(),fr.fillRect(e,0,0,t,i,{fillStyle:"white"});for(let t of this.browser.genome.wgChromosomeNames){let r=this.browser.genome.getCumulativeOffset(t),s=this.browser.genome.getChromosome(t).bpLength,o=Math.round(r/n),a=Math.round(s/n);this.renderChromosomeRect(e,o,0,a,i,t)}e.restore()}doDraw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,bpStart:r}){e.clearRect(0,0,i,n);const s=function(e,t){if(e<10)return new hd(1,"bp",1);const i=Math.floor(Math.log10(e));let n="bp",r=1;i>9?(n="gb",r=1e9):i>6?(n="mb",r=1e6):i>3&&(n="kb",r=1e3);const s=Math.pow(10,i-1),o=e/s,a=75,c=Math.pow(10,i-1),l=Math.pow(10,i)/2;return new hd(o<a&&!0!==t?c:l,n,r)}(Math.floor(t.toBP(i)),e.isSVG);let o=Math.floor(r/s.majorTick)-1;const{tickDelta:a,labelLength:c}=function(e,t,i,n,r){const s=l(t,c(1+n,r),i)-l(t,c(n,r),i),o=`${F(Math.floor(c(n,r)/r.unitMultiplier))} ${r.majorUnit}`,a=Math.floor(e.measureText(o).width);return{tickDelta:s,labelLength:a};function c(e,t){return Math.floor(e*t.majorTick)}function l(e,t,i){return Math.round(e.toPixels(t-1-i+.5))}}(e,t,r,o,s);let l,h;this.browser.referenceFrameList.indexOf(t);let d=a;const u=.25*c;do{h=Math.floor(o*s.majorTick);const i=`${F(Math.floor(h/s.unitMultiplier))} ${s.majorUnit}`;l=Math.round(t.toPixels(h-1-r+.5));const n=Math.round(l-e.measureText(i).width/2);n>0&&u+c<=d&&(fr.fillText(e,i,n,this.height-8),d=0),l>0&&fr.strokeLine(e,l,this.height-6,l,this.height-2),h=Math.floor((1+o)*s.majorTick);let f=l+(Math.round(t.toPixels(h-1-r+.5))-l)/2;f>0&&fr.strokeLine(e,f,this.height-6,f,this.height-2),++o,d+=a}while(l<i);fr.strokeLine(e,0,this.height-2,i,this.height-2)}renderChromosomeRect(e,t,i,n,r,s){e.textAlign="center",e.textBaseline="middle",e.font="12px sans-serif",fr.strokeLine(e,t+n,i,t+n,i+r,{strokeStyle:un.greyScale(191)});const o=(s=this.browser.genome.getChromosomeDisplayName(s)).startsWith("chr")?s.substring(3):s;n>e.measureText(o).width&&fr.fillText(e,o,t+n/2,i+r/2,{fillStyle:un.greyScale(68)})}get supportsWholeGenome(){return!0}dispose(){}}class hd{constructor(e,t,i){this.majorTick=e,this.minorTick=e/10,this.majorUnit=t,this.unitMultiplier=i}description(e){console.log((e||"")+" tick "+cd(this.majorTick)+" label width "+cd(this.labelWidthBP)+" multiplier "+this.unitMultiplier)}}class dd{constructor(e,i,n){this.guid=o(),this.trackView=e,this.browser=e.browser,this.viewport=t({class:"igv-viewport"}),i.appendChild(this.viewport),this.viewport.style.height=`${e.track.height}px`,null===this.viewport.previousElementSibling&&(this.viewport.style.zIndex=16,this.viewport.style.overflow="visible"),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.ctx.font="10px verdana",this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(n),this.addMouseHandlers()}resizeCanvas(){const e=window.devicePixelRatio,t=this.browser.getSampleInfoViewportWidth();let i;if(this.browser.trackViews.length>1&&null===this.viewport.previousElementSibling){const[e,t]=[this.browser.ideogramTrackView.track,this.browser.rulerTrackView.track];i=e.height+t.height}else i=this.viewport.clientHeight;if(this.canvas.width!==t*e||this.canvas.height!==i*e){const n=this.canvas;n.width=t*e,n.height=i*e,n.style.width=`${t}px`,n.style.height=`${i}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(e,e),null===this.viewport.previousElementSibling&&fr.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:Wn("snow")})}}setTop(e){"function"==typeof this.trackView.track.getSamples&&(this.contentTop=e,this.repaint())}setWidth(e){this.viewport.innerWidth=e,this.resizeCanvas()}setHeight(e){const t=this.browser.getSampleInfoViewportWidth();this.viewport.style.width=`${t}px`,this.viewport.style.height=`${e}px`;const i=window.devicePixelRatio;this.canvas.width=t*i,this.canvas.height=e*i,this.canvas.style.width=`${t}px`,this.canvas.style.height=`${e}px`,this.ctx=this.canvas.getContext("2d"),this.ctx.scale(i,i),null===this.viewport.previousElementSibling&&fr.fillRect(this.ctx,0,0,this.ctx.canvas.width,this.ctx.canvas.height,{fillStyle:Wn("snow")})}async repaint(){if(this.resizeCanvas(),"function"==typeof this.trackView.track.getSamples){const e=this.trackView.track.getSamples();e.names&&e.names.length>0&&this.draw({context:this.ctx,samples:e})}else null===this.viewport.previousElementSibling&&(this.browser.rulerTrackView&&this.browser.rulerTrackView.setTrackHeight(!0===this.browser.sampleInfoControl.showSampleInfo?this.calculateSampleInfoColumnHeight():40,!0),this.renderSampleInfoColumns(this.ctx))}calculateSampleInfoColumnHeight(){const e=this.browser.sampleInfo.attributeNames.map((e=>this.ctx.measureText(e).width));return 4+Math.min(Math.max(...e),128)}draw({context:e,samples:t}){if(e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillStyle=Wn("snow"),e.fillRect(0,0,e.canvas.width,e.canvas.height),t&&t.names.length>0){const i=this.browser.sampleInfo.attributeNames,n=this.viewport.getBoundingClientRect().height;let r=1;const s=t.height;r=s-2*r<=1?0:1;let o=this.contentTop+t.yOffset;this.hitList={};for(const a of t.names){if(o>n)break;if(o+s>0){const t=this.browser.sampleInfo.getAttributes(a);if(t){const n=Object.entries(t);for(const t of n){const[n,a]=t;e.fillStyle=this.browser.sampleInfo.getAttributeColor(n,a);const c=8+i.indexOf(n)*ad,l=o+r,h=s-2*r;e.fillRect(c,l,15,h);const d=`${Math.floor(c)}#${Math.floor(l)}#16#${Math.ceil(h)}`;this.hitList[d]=`${n}#${a}`}}}o+=s}}}renderSampleInfoColumns(e){const t=(e,t,i,n,r,s)=>{e.save(),e.font="10px verdana",e.translate(i+r/2,n+s),e.rotate(-Math.PI/2),e.textAlign="left",e.fillStyle=Wn("lead"),e.fillText(t,2,2),e.restore()},i=this.browser.sampleInfo.attributeNames;this.hitList={};for(let n=0;n<i.length;n++){const r=8+n*ad,s=15,o=Math.round(e.canvas.height/window.devicePixelRatio);fr.fillRect(e,r,0,s,o,{fillStyle:Wn("snow")}),t(e,i[n],r,0,s,o);const a=`${Math.floor(r)}#0#${s}#${Math.ceil(o)}`;this.hitList[a]=`${i[n]}`}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:s,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${o()}`;e.saveWithTranslationAndClipRect(c,t,i+r,s,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.addMouseMoveHandler()}addMouseMoveHandler(){this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList);if(null===this.viewport.previousElementSibling){const i=(t,i)=>{const{marginTop:n}=window.getComputedStyle(i),{x:r,y:s}=a(e,this.browser.columnContainer.querySelector(".igv-sample-info-column"));return{x:Math.floor(r),y:Math.floor(s-parseInt(n,10))}},n=this.browser.columnContainer.querySelector(".igv-sample-info-column"),{x:r,y:s}=i(n,this.viewport);n.setAttribute("title","");for(const[e,i]of t){const[t,o,a,c]=e.split("#").map((e=>parseInt(e,10)));if(!(r<t||r>t+a||s<o||s>o+c)){n.setAttribute("title",`${i}`);break}}}else{const{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){const[e,t]=r.split("#");this.viewport.setAttribute("title",`${e.split(rd.emptySpaceReplacement).join(" ")}: ${"-"===t?"":t}`);break}}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}show(){this.viewport.style.display="block"}hide(){this.viewport.style.display="none"}}class ud{constructor(e,i,n,r){this.guid=o(),this.trackView=e,this.browser=e.browser,this.viewport=t({class:"igv-viewport"}),i.appendChild(this.viewport),e.track.height&&(this.viewport.style.height=`${e.track.height}px`),this.canvas=document.createElement("canvas"),this.viewport.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.trackScrollDelta=0,this.contentTop=0,this.hitList=void 0,this.sortDirection=1,this.setWidth(r),this.addMouseHandlers()}checkCanvas(){const e=this.browser.sampleNameViewportWidth||0;this.ctx.canvas.width=e*window.devicePixelRatio,this.ctx.canvas.style.width=`${e}px`,this.ctx.canvas.height=this.viewport.clientHeight*window.devicePixelRatio,this.ctx.canvas.style.height=`${this.viewport.clientHeight}px`,this.ctx.scale(window.devicePixelRatio,window.devicePixelRatio)}setTop(e){if("function"==typeof this.trackView.track.getSamples){this.contentTop=e;const t=this.trackView.track.getSamples();this.repaint(t)}}setWidth(e){this.viewport.innerWidth=e,this.checkCanvas()}async repaint(e){if(e.names.length>0&&!0===this.browser.showSampleNames&&(this.checkCanvas(),this.draw({context:this.ctx,samples:e}),void 0===this.browser.sampleNameViewportWidth)){const t=e.names.map((e=>this.ctx.measureText(e).width));this.browser.sampleNameViewportWidth=Math.min(200,4+Math.ceil(Math.max(...t))),this.browser.layoutChange()}}draw({context:e,samples:t}){if(fr.fillRect(e,0,0,e.canvas.width,t.height,{fillStyle:Wn("snow")}),t&&t.names.length>0){const i=this.viewport.getBoundingClientRect().height,n=t.height,r=n-2<=1?0:1;let s=this.contentTop+t.yOffset;this.hitList={};for(const o of t.names){if(s>i)break;if(s+n>0){const t=n-2*r;fd(e,o,0+2,s+r,e.canvas.width,t)}s+=n}}}renderSVGContext(e,{deltaX:t,deltaY:i}){if("function"==typeof this.trackView.track.getSamples){const n=this.trackView.track.getSamples(),r=0,{width:s,height:a}=this.viewport.getBoundingClientRect(),c=`${(this.trackView.track.name||this.trackView.track.id).replace(/\W/g,"")}_sample_names_guid_${o()}`;e.saveWithTranslationAndClipRect(c,t,i+r,s,a,-r),this.draw({context:e,samples:n}),e.restore()}}addMouseHandlers(){this.boundClickHandler=function(e){e.preventDefault();const t={label:"Name Panel Width",value:this.browser.sampleNameViewportWidth,callback:e=>{this.browser.sampleNameViewportWidth=parseInt(e),this.browser.layoutChange()}};this.browser.inputDialog.present(t,e)}.bind(this),this.viewport.addEventListener("contextmenu",this.boundClickHandler),this.boundMouseMoveHandler=function(e){if(this.hitList){const t=Object.entries(this.hitList),{x:i,y:n}=a(e,this.viewport);this.viewport.setAttribute("title","");for(const[e,r]of t){const[t,s,o,a]=e.split("#").map((e=>parseInt(e,10)));if(!(i<t||i>t+o||n<s||n>s+a)){this.viewport.setAttribute("title",`${r}`);break}}}}.bind(this),this.viewport.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandlers(){this.viewport.removeEventListener("contextmenu",this.boundClickHandler),this.viewport.removeEventListener("mousemove",this.boundMouseMoveHandler)}dispose(){this.removeMouseHandlers(),this.viewport.remove()}}function fd(e,t,i,n,r,s){const o=Math.min(s,10);e.font=`${o}px sans-serif`,e.textAlign="start",e.fillStyle=Wn("lead");const a=i,c=e.measureText(t),l=n+s/2+(c.actualBoundingBoxAscent+c.actualBoundingBoxDescent)/2;e.fillText(t,a,l)}class pd{constructor(e){this.popover=t({class:"igv-menu-popup"}),e.appendChild(this.popover),this.parent=e;const i=t({class:"igv-menu-popup-header"});this.popover.appendChild(i),u(i,(()=>this.popover.style.display="none")),this.popoverContent=t(),this.popover.appendChild(this.popoverContent),p(this.popover,i),i.addEventListener("click",(e=>{e.stopPropagation(),e.preventDefault()})),this.popover.style.display="none"}presentMenuList(e,t){if(gd(this.parent),t.length>0){this.popoverContent.innerHTML="";const i=this.parseMenuList(e,t);for(let e of i)e.init&&e.init(),0===i.indexOf(e)&&e.element.classList.remove("igv-track-menu-border-top"),e.element.classList.contains("igv-track-menu-border-top")||e.element.classList.contains("igv-menu-popup-check-container")||"div"===e.element.tagName.toLowerCase()&&e.element.classList.add("igv-menu-popup-shim"),this.popoverContent.appendChild(e.element);this.popover.style.display="flex";const{width:n}=this.popover.getBoundingClientRect();this.popover.style.left=-n+"px",this.popover.style.top="0px"}}parseMenuList(e,t){return t.map(((t,i)=>{let n;if(t.name)n=document.createElement("div"),n.textContent=t.name;else if(t.element)n=t.element;else if("string"==typeof t.label)n=document.createElement("div"),n.innerHTML=t.label;else if("string"==typeof t)if(t.startsWith("<")){const e=document.createElement("div");e.innerHTML=t,n=e.firstChild}else n=document.createElement("div"),n.textContent=t;if(0===i&&n.classList.add("igv-track-menu-border-top"),t.click||t.dialog){const i=i=>{if(i.preventDefault(),i.stopPropagation(),t.click)if(e.track.selected){const n=e.browser.getSelectedTrackViews();if(!0===t.doAllMultiSelectedTracks)t.click.call(e.track,i);else if("removeTrack"===t.menuItemType){const r=()=>{e.browser.overlayTrackButton.setVisibility(!1);for(const{track:e}of n)t.click.call(e,i)},s={html:`Are you sure you want to delete ${n.length} tracks?`,callback:r};e.browser.menuUtils.dialog.present(s,i)}else for(const{track:e}of n)t.click.call(e,i)}else t.click.call(e.track,i);else t.dialog&&t.dialog.call(e.track,i);this.popover.style.display="none"};void 0===n&&console.log("element is undefined"),n.addEventListener("click",i),n.addEventListener("touchend",(e=>i(e))),n.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}return{element:n,init:t.init||void 0}}))}presentTrackContextMenu(e,i){this.popoverContent.innerHTML="";const r=function(e,i){return e.map((e=>{let r;if("string"==typeof e&&"<hr/>"===e)r=document.createElement("hr");else if("string"==typeof e)r=t({class:"context-menu"}),r.innerHTML=e;else if("Node"==typeof e)r=e;else if("function"==typeof e.init&&e.init(),"checkbox"===e.type?r=Ta("Show all bases",e.value):(r=t({class:"context-menu"}),"string"==typeof e.label&&(r.innerHTML=e.label)),e.click&&"color"!==e.type){function s(t){e.click(),n(i),t.preventDefault(),t.stopPropagation()}r.addEventListener("click",s),r.addEventListener("touchend",s),r.addEventListener("mouseup",(function(e){e.preventDefault(),e.stopPropagation()}))}return{el:r,init:e.init}}))}(i,this.popover);for(let{el:e}of r)this.popoverContent.appendChild(e);!function(e,t){t.style.display="flex";const{x:i,y:n}=a(e,t.parentNode),{width:r}=t.getBoundingClientRect(),s=i+r,{width:o}=t.parentNode.getBoundingClientRect();t.style.left=`${s>o?i-(s-o):i}px`,t.style.top=`${n}px`}(e,this.popover)}hide(){this.popover.style.display="none"}dispose(){this.popoverContent.innerHTML="",this.popover.innerHTML="",Object.keys(this).forEach((function(e){this[e]=void 0}))}}const gd=e=>{const t=e.querySelectorAll(".igv-menu-popup");for(const e of t)e.style.display="none"};class md{constructor(e,i,n,r,s,o,a){this.browser=i,this.button=t({class:"igv-navbar-text-button"}),e.appendChild(this.button),Array.isArray(n)?(this.textContent=n[0],this.title=n[1]):this.textContent=this.title=n,this.buttonLabel=r,this.imageDictionary={image:`url("data:image/svg+xml,${encodeURIComponent(s)}")`,imageHover:`url("data:image/svg+xml,${encodeURIComponent(o)}")`},this.responsiveKey="text",this.configureButton(this.textContent,this.title),this.setState(a),i.on("navbar-resize",(e=>{this.navbarResizeHandler(e)}))}navbarResizeHandler(e){const t="igv-navbar-icon-button"===e?"image":"text";t!==this.responsiveKey&&(this.responsiveKey=t,this.configureButton(this.textContent,this.title),this.setState(void 0))}configureButton(e,t){this.groupElement=void 0,this.button.title=t,this.button.innerHTML="",this.button.style.backgroundImage="none",this.button.classList.remove("igv-navbar-icon-button"),this.button.classList.remove("igv-navbar-text-button"),"text"===this.responsiveKey?this.configureTextButton(e):this.configureIconButton()}configureTextButton(e){this.button.classList.add("igv-navbar-text-button");const t=document.createElement("div");t.innerHTML=this.buttonLabel;const i=t.firstChild;this.button.appendChild(i),this.groupElement=i.querySelector("#igv-navbar-button-group");i.querySelector("#igv-navbar-button-label").textContent=e}configureIconButton(){this.button.classList.add("igv-navbar-icon-button")}setState(e){void 0!==e&&(this.doHover=e),"text"===this.responsiveKey?this.setTextButtonState(this.doHover):this.setIconButtonState(this.doHover)}setTextButtonState(e){this.groupElement.classList.remove(...this.groupElement.classList);const t=!0===e?"igv-navbar-text-button-svg-hover":"igv-navbar-text-button-svg-inactive";this.groupElement.classList.add(t)}setIconButtonState(e){this.button.style.backgroundImage=!0===e?this.imageDictionary.imageHover:this.imageDictionary.image}show(){this.button.style.display="flex"}hide(){this.button.style.display="none"}setVisibility(e){!0===e?this.show():this.hide()}}const wd='<svg width="80px" height="18px" viewBox="0 0 80 18" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="79" height="17" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>';class bd extends Pa{static defaults={autoscale:void 0,alpha:.5,height:50};constructor(e,t,i){super(e,t),this.type="merged",this.paintAxis=hl,this.graphType=e.graphType,this.tracks=i||[]}async postInit(){if(this.config.tracks){for(let e of this.config.tracks){const t=await this.browser.createTrack(e);t?this.tracks.push(t):console.warn("Could not create track "+e),"function"==typeof t.postInit&&await t.postInit()}this.config.tracks.every((e=>void 0!==e.autoscale||void 0!==e.max))||(this.config.autoscale=void 0===this.config.max)}for(let e of this.tracks)e.isMergedTrack=!0;if(this.config.autoscale?this.autoscale=this.config.autoscale:void 0!==this.config.max&&this.setDataRange({min:this.config.min||0,max:this.config.max}),void 0!==this.config.flipAxis)for(let e of this.tracks)e.flipAxis=this.config.flipAxis;if(void 0!==this.config.logScale)for(let e of this.tracks)e.logScale=this.config.logScale;this.resolutionAware=this.tracks.some((e=>e.resolutionAware))}set flipAxis(e){this.config.flipAxis=e;for(let t of vd(this.tracks))t.flipAxis=e}get flipAxis(){return vd(this.tracks).every((e=>e.flipAxis))}set logScale(e){this.config.logScale=e;for(let t of vd(this.tracks))t.logScale=e}get logScale(){return vd(this.tracks).every((e=>e.logScale))}get height(){return this._height}set height(e){if(this.config.height=e,this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}set autoscale(e){if(this._autoscale=e,!1===e&&this.tracks)for(let e of this.tracks)e.autoscale=!1}get autoscale(){return this._autoscale}set autoscaleGroup(e){if(this.tracks)for(let t of this.tracks)t.autoscaleGroup=e}get autoscaleGroup(){if(this.tracks&&this.tracks.length>0){const e=this.tracks[0].autoscaleGroup;return this.tracks.some((t=>e!==t.autoscaleGroup))?void 0:e}}setDataRange({min:e,max:t}){this.autoscale=!1;for(const i of vd(this.tracks))i.dataRange={min:e,max:t},i.autoscale=!1,i.autoscaleGroup=!1}set dataRange({min:e,max:t}){for(const i of vd(this.tracks))i.dataRange={min:e,max:t}}get dataRange(){if(this.tracks){const e=vd(this.tracks);if(e.length>0){const t=e[0].dataRange;if(e.every((e=>e.dataRange&&e.dataRange.min===t.min&&e.dataRange.max===t.max)))return t}}}menuItemList(){const e=[];return vd(this.tracks).length>0&&(void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e.push(...this.numericDataMenuItems())),e.push("<hr/>"),e.push(this.overlayTrackAlphaAdjustmentMenuItem()),e.push(this.trackSeparationMenuItem()),e}async getFeatures(e,t,i,n){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n))),s=await Promise.all(r);if(s.every((e=>0===e.length)))return new Fd([],[]);{const e=this.tracks.map((e=>e.name));return new Fd(s,e)}}draw(e){const t=e.features;for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t.featureArrays[i],n.alpha=this.alpha,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}}popupData(e){const t=this.clickedFeatures(e);if(t&&t.length===this.tracks.length){const i=[];let n=!0;for(let r=0;r<t.length;r++)if(r>0&&i.push("<hr/>"),i.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${t[r].trackName}</div>`),t[r].features.length>0){n=!1;const s=this.tracks[r].popupData(e,t[r].features);i.push(...s)}else i.push("Missing or 0 value(s)");return!0===n?[]:i}}clickedFeatures(e){const t=e.viewport.cachedFeatures;if(!t||!t.featureArrays||!Array.isArray(t.featureArrays)||0===t.featureArrays.length)return[];const i=e.genomicLocation,n=[],r=e.referenceFrame.bpPerPixel>.2?3*e.referenceFrame.bpPerPixel:.2,s=i-r,o=i+r;for(let e=0;e<t.featureArrays.length;e++){const i=Qn(t.featureArrays[e],s,o);n.push({trackName:t.trackNames[e],features:i})}return n}get supportsWholeGenome(){return this.tracks.every((e=>e.supportsWholeGenome))}getState(){const e=super.getState(),t=[];for(let e of this.tracks)t.push(e.getState());return e.tracks=t,e}updateScales(e){let t;if(this.autoscale){t=!0;let i=[];for(let t of e){if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,r=n+e.toBP(t.getWidth()),s=t.featureCache.features;this.autoscale&&(i.push({value:s.getMax(n,r)}),i.push({value:s.getMin(n,r)}))}const e=Gs(i);for(const t of vd(this.tracks))t.dataRange=e}}else{let i=-1;for(let n of this.tracks)if(++i,n.autoscale){t=!0;let r=[];for(let t of e)if(t.featureCache&&t.featureCache.features){const e=t.referenceFrame,n=e.start,s=n+e.toBP(t.getWidth()),o=t.featureCache.features.featureArrays[i];if(o)for(let e of o)if(!(e.end<n)){if(e.start>s)break;r.push(e)}}n.dataRange=Gs(r)}}return t}overlayTrackAlphaAdjustmentMenuItem(){const e=t();return e.innerText="Set transparency",{element:e,dialog:function(e){const t={label:"Transparency",value:this.alpha,min:0,max:1,scaleFactor:1e3,callback:e=>{this.alpha=Math.max(.001,e),this.repaintViews()}};this.browser.sliderDialog.present(t,e)}}}trackSeparationMenuItem(){let e=document.createElement("div");return e.textContent="Separate tracks",{element:e,click:function(e){const t=this.autoscale,i=this.name,n=this.tracks,r=this.browser,s=this.order;r.removeTrack(this);for(let e of n)e.order=s,t&&(e.autoscaleGroup=i),e.isMergedTrack=!1,r.addTrack(e.config,e);r.updateViews()}}}}class Fd{constructor(e,t){this.featureArrays=e,this.trackNames=t}getMax(e,t){let i=-Number.MAX_VALUE;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(!(void 0===r.value||Number.isNaN(r.value)||r.end<e)){if(r.start>t)break;i=Math.max(i,r.value)}return i!==-Number.MAX_VALUE?i:100}getMin(e,t){let i=0;for(let n of this.featureArrays)if(Array.isArray(n))for(let r of n)if(void 0!==r.value&&!Number.isNaN(r.value)){if(r.end<e)continue;if(r.start>t)break;i=Math.min(i,r.value)}return i}}const vd=e=>e?e.filter((e=>void 0!==e.dataRange||void 0!==e.autoscale||void 0!==e.autoscaleGroup)):[];class yd extends md{constructor(e,t){super(e,t,"Overlay Tracks",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks">\n <rect id="backdrop" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#737373" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#737373" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#737373" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Overlay Tracks Hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Overlay-Tracks-Hover">\n <rect id="backdrop-copy" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="layer-group" transform="translate(3, 127)">\n <rect id="a" stroke="#FFFFFF" stroke-width="24" fill="#A1A1A1" x="12" y="12" width="332" height="139"></rect>\n <rect id="a---hold-out" fill="#A1A1A1" x="9" y="25" width="324" height="115"></rect>\n <rect id="b" stroke="#FFFFFF" stroke-width="24" fill="#C9C9C9" x="81" y="103" width="474" height="139"></rect>\n <rect id="c" stroke="#FFFFFF" stroke-width="24" fill="#ECECEC" x="238" y="214" width="372" height="139"></rect>\n <rect id="c---hold-out" fill="#ECECEC" x="250" y="226" width="372" height="115"></rect>\n </g>\n <rect id="over-border-copy" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>this.setState(!1)));this.boundMouseClickHandler=(()=>{this.setVisibility(!1),Ad.call(this)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(!0)}}function Ad(e){if(!0===Cd(this.browser)){const e=this.browser.getSelectedTrackViews().map((({track:e})=>e));for(const t of e)t.selected=!1;const t=[];for(let i of e)"merged"===i.type?t.push(...i.tracks):t.push(i);const i={name:"Overlay",type:"merged",autoscale:!1,alpha:.5,height:Math.max(...e.map((({height:e})=>e))),order:Math.min(...e.map((({order:e})=>e)))},n=new bd(i,this.browser,t);for(const t of e){const e=this.browser.trackViews.indexOf(t.trackView);this.browser.trackViews.splice(e,1),t.trackView.dispose()}this.browser.addTrack(i,n),n.trackView.updateViews()}}function Cd(e){const t=e.getSelectedTrackViews();if(t&&t.length>1){const e=new Set(["wig","merged"]);return t.filter((({track:t})=>e.has(t.type))).length>1}return!1}const _d=new Set(["sequence","ruler","ideogram"]),xd=new Set(["ruler","sequence","ideogram"]);class kd{constructor(e,t,i){this.namespace=`trackview-${o()}`,this.browser=e,this.track=i,i.trackView=this,this.addDOMToColumnContainer(e,t,e.referenceFrameList)}startSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].startSpinner()}stopSpinner(){this.viewports&&this.viewports.length>0&&this.viewports[0].stopSpinner()}addDOMToColumnContainer(e,t,i){this.axis=this.createAxis(e,this.track),this.createViewports(e,t,i),this.sampleInfoViewport=new dd(this,e.columnContainer.querySelector(".igv-sample-info-column"),e.getSampleInfoViewportWidth()),this.sampleNameViewport=new ud(this,e.columnContainer.querySelector(".igv-sample-name-column"),void 0,e.getSampleNameViewportWidth()),this.createTrackScrollbar(e),this.createTrackDragHandle(e),this.createTrackGearPopup(e)}createViewports(e,t,i){this.viewports=[];const n=e.calculateViewportWidth(i.length),r=t.querySelectorAll(".igv-column");for(let e=0;e<r.length;e++){const t=ed(this,r[e],i[e],n);this.viewports.push(t)}}createAxis(e,i){const n=t();if(this.axis=n,e.columnContainer.querySelector(".igv-axis-column").appendChild(n),n.dataset.tracktype=i.type,n.style.height=`${i.height}px`,"function"==typeof i.paintAxis){const{width:e,height:t}=n.getBoundingClientRect();this.axisCanvas=document.createElement("canvas"),this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`,n.appendChild(this.axisCanvas)}if(!1===rr.has(this.track.type)){this.trackSelectionContainer=t(),n.appendChild(this.trackSelectionContainer);const e='<input type="checkbox" name="track-select">',i=document.createRange().createContextualFragment(e).firstChild;this.trackSelectionContainer.appendChild(i),i.checked=this.track.selected||!1,i.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation(),this.track.selected=e.target.checked,this.setDragHandleSelectionState(e.target.checked),this.browser.overlayTrackButton.setVisibility(Cd(this.browser))})),this.enableTrackSelection(!1)}return n}resizeAxisCanvas(e,t){this.axis.style.width=`${e}px`,this.axis.style.height=`${t}px`,"function"==typeof this.track.paintAxis&&(this.axisCanvas.style.width=`${e}px`,this.axisCanvas.style.height=`${t}px`)}renderSVGContext(e,{deltaX:t,deltaY:i}){!function(e,t,i,n,r){if("function"==typeof t.paintAxis){const{y:s,width:a,height:c}=i.getBoundingClientRect(),l=`${(t.name||t.id).replace(/\W/g,"")}_axis_guid_${o()}`;e.saveWithTranslationAndClipRect(l,n,s+r,a,c,0),t.paintAxis(e,a,c),e.restore()}}(e,this.track,this.axisCanvas,t,i);const{width:n}=this.axis.getBoundingClientRect(),{y:r}=this.viewports[0].viewportElement.getBoundingClientRect();let s={deltaX:n+t,deltaY:r+i};for(let t of this.viewports){t.renderSVGContext(e,s);const{width:i}=t.viewportElement.getBoundingClientRect();s.deltaX+=i}if(!0===this.browser.sampleInfo.isInitialized()&&!0===this.browser.sampleInfoControl.showSampleInfo){this.sampleInfoViewport.renderSVGContext(e,s);const{width:t}=this.sampleInfoViewport.viewport.getBoundingClientRect();s.deltaX+=t}!0===this.browser.showSampleNames&&this.sampleNameViewport.renderSVGContext(e,s)}presentColorPicker(e,t){if(!1===xd.has(this.track.type)){let i,n;i="color"===e?this.track._initialColor||this.track.constructor.defaultColor:this.track._initialAltColor||this.track.constructor.defaultColor;const r=this.browser.getSelectedTrackViews();n=r.length>0&&new Set(r).has(this)?{color:e=>{for(const t of r)t.track.color=e,t.repaintViews()},altColor:e=>{for(const t of r)t.track.altColor=e,t.repaintViews()}}:{color:e=>{this.track.color=Un(e),this.repaintViews()},altColor:e=>{this.track.altColor=Un(e),this.repaintViews()}};const s="color"===e?this.track.color||this.track.constructor.defaultColor:this.track.altColor||this.track.constructor.defaultColor;this.browser.genericColorPicker.configure(i,n[e],s),this.browser.genericColorPicker.present(t)}}setTrackHeight(e,t){t||(this.track.minHeight&&(e=Math.max(this.track.minHeight,e)),this.track.maxHeight&&(e=Math.min(this.track.maxHeight,e))),this.track.height=e,this.resizeAxisCanvas(this.axis.clientWidth,this.track.height),"function"==typeof this.track.paintAxis&&this.paintAxis();for(let t of this.viewports)t.setHeight(e);if(this.sampleInfoViewport.setHeight(e),this.sampleNameViewport.viewport.style.height=`${e}px`,"function"!=typeof this.track.computePixelHeight)for(let t of this.viewports)t.setContentHeight(e);this.repaintViews(),this.updateScrollbar(),this.dragHandle.style.height=`${e}px`,this.gearContainer.style.height=`${e}px`}updateScrollbar(){const e=this.viewports[0].viewportElement.clientHeight;if(this.outerScroll.style.height=`${e}px`,!1===_d.has(this.track.type)){const t=this.maxViewportContentHeight(),i=Math.round(e/t*e);t>e?(this.innerScroll.style.display="block",this.innerScroll.style.height=`${i}px`):this.innerScroll.style.display="none"}}moveScroller(e){const t=this.innerScroll.offsetTop+e,i=Math.min(Math.max(0,t),this.outerScroll.clientHeight-this.innerScroll.clientHeight);this.innerScroll.style.top=`${i}px`;const n=this.maxViewportContentHeight(),r=-Math.round(i*(n/this.viewports[0].viewportElement.clientHeight));for(let e of this.viewports)e.setTop(r);this.sampleInfoViewport.setTop(r),this.sampleNameViewport.trackScrollDelta=e,this.sampleNameViewport.setTop(r)}isLoading(){for(let e of this.viewports)if(e.isLoading())return!0}repaintViews(){for(let e of this.viewports)e.isVisible()&&e.repaint();"function"==typeof this.track.paintAxis&&this.paintAxis(),this.repaintSampleInfo(),this.repaintSamples()}repaintSampleInfo(){this.sampleInfoViewport.repaint()}repaintSamples(){if("function"==typeof this.track.getSamples){const e=this.track.getSamples();e.names&&e.names.length>0&&this.sampleNameViewport.repaint(e)}}setTrackLabelName(e){this.viewports.forEach((t=>t.setTrackLabel(e)))}resize(e){for(let t of this.viewports)t.setWidth(e)}async updateViews(){if(!this.browser||!this.browser.referenceFrameList)return;const e=this.viewports.filter((e=>e.isVisible()));if(e.forEach((e=>e.shift())),this.browser.dragObject)return;const t=e.filter((e=>e.needsRepaint())).filter((e=>e.checkZoomIn())),i=e.filter((e=>e.checkZoomIn())).filter((e=>e.needsReload()));for(let e of i)await e.loadFeatures();if(this.disposed)return;if(this.track&&"function"==typeof this.track.variantRowCount&&i.length>0){let e=0;for(let t of this.viewports)t.featureCache&&t.featureCache.features&&(e=Math.max(e,t.featureCache.features.reduce(((e,t)=>Math.max(e,t.row||0)),0)));if(this.track.nVariantRows!==e+1){this.track.variantRowCount(e+1);for(let e of this.viewports)e.checkContentHeight()}}let n;if("merged"===this.track.type)n=this.track.updateScales(e);else if(this.track.autoscale){let t=[];for(let i of e){const e=i.referenceFrame,n=e.start,r=n+e.toBP(i.getWidth());if(i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const e=i.featureCache.features.getMax(n,r);if(t.push({value:e}),"function"==typeof i.featureCache.features.getMin){const e=i.featureCache.features.getMin(n,r);t.push({value:e})}}else{const e=Qn(i.featureCache.features,n,r);for(let i of e)t.push(i)}}"function"==typeof this.track.doAutoscale?this.track.dataRange=this.track.doAutoscale(t):this.track.dataRange=Gs(t)}const r=this.track.autoscale||this.track.autoscaleGroup||"ruler"===this.track.type||n||this.track.groupBy;for(let i of e)t.includes(i)?i.repaint():r&&i.refresh();this.adjustTrackHeight(),this.repaintSampleInfo(),this.repaintSamples(),this.updateRulerViewportLabels()}clearCachedFeatures(){for(let e of this.viewports)e.clearCache()}updateRulerViewportLabels(){const e=this.browser.calculateViewportWidth(this.viewports.length);for(let t of this.viewports)"ruler"===this.track.type&&(this.viewports.length>1?t.presentLocusLabel(e):t.dismissLocusLabel())}async getInViewFeatures(){if(!this.browser||!this.browser.referenceFrameList)return[];let e=[];const t=this.viewports.filter((e=>e.isVisible()));for(let i of t){const t=i.referenceFrame,{chr:n,start:r,bpPerPixel:s}=i.referenceFrame,o=r+t.toBP(i.getWidth());if((!i.featureCache||!i.featureCache.containsRange(n,r,o,s))&&await i.loadFeatures(),i.featureCache&&i.featureCache.features)if("function"==typeof i.featureCache.features.getMax){const t=i.featureCache.features.getMax(r,o);e.push({value:t})}else{const t="function"==typeof i.featureCache.queryFeatures?i.featureCache.queryFeatures(n,r,o):Qn(i.featureCache.features,r,o);e=e.concat(t)}}return e}checkContentHeight(){for(let e of this.viewports)e.checkContentHeight();this.adjustTrackHeight()}adjustTrackHeight(){var e=this.maxViewportContentHeight();if(this.track.autoHeight?this.setTrackHeight(e,!1):this.track.paintAxis&&this.paintAxis(),!1===_d.has(this.track.type)){const t=this.viewports[0].getContentTop(),i=this.viewports[0].viewportElement.clientHeight,n=Math.min(0,i-e);if(t<n)for(let e of this.viewports)e.setTop(n);this.updateScrollbar()}}createTrackScrollbar(e){const i=t();if(e.columnContainer.querySelector(".igv-scrollbar-column").appendChild(i),i.style.height=`${this.track.height}px`,this.outerScroll=i,!1===_d.has(this.track.type)){const n=t();i.appendChild(n),this.innerScroll=n,this.addTrackScrollMouseHandlers(e)}}createTrackDragHandle(e){"sequence"!==this.track.type&&!0===rr.has(this.track.type)?this.dragHandle=t({class:"igv-track-drag-shim"}):(this.dragHandle=t({class:"igv-track-drag-handle"}),this.dragHandle.classList.add("igv-track-drag-handle-color")),e.columnContainer.querySelector(".igv-track-drag-column").appendChild(this.dragHandle),this.dragHandle.style.height=`${this.track.height}px`,this.addTrackDragMouseHandlers(e)}createTrackGearPopup(e){if(this.gearContainer=t(),e.columnContainer.querySelector(".igv-gear-menu-column").appendChild(this.gearContainer),this.gearContainer.style.height=`${this.track.height}px`,!0===this.track.ignoreTrackMenu);else{function i(t){if(t.preventDefault(),t.stopPropagation(),"none"===this.trackGearPopup.popover.style.display){for(const t of e.trackViews.filter((e=>e!==this&&void 0!==e.trackGearPopup)))t.trackGearPopup.popover.style.display="none";this.trackGearPopup.presentMenuList(this,e.menuUtils.trackMenuItemList(this))}else this.trackGearPopup.popover.style.display="none"}this.gear=t(),this.gearContainer.appendChild(this.gear),this.gear.appendChild(l("cog")),this.trackGearPopup=new pd(this.gear),this.boundTrackGearClickHandler=i.bind(this),this.gear.addEventListener("click",this.boundTrackGearClickHandler)}}addTrackScrollMouseHandlers(e){this.boundTrackScrollMouseDownHandler=function(t){t.stopPropagation();const{y:i}=s(t);this.innerScroll.dataset.yDown=i.toString(),this.boundColumnContainerMouseMoveHandler=function(e){e.stopPropagation();const{y:t}=s(e);this.moveScroller(t-parseInt(this.innerScroll.dataset.yDown)),this.innerScroll.dataset.yDown=t.toString()}.bind(this),e.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),this.innerScroll.addEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.boundColumnContainerMouseUpHandler=function(t){e.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler)}.bind(this),e.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),e.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseUpHandler)}removeTrackScrollMouseHandlers(){!1===_d.has(this.track.type)&&(this.innerScroll.removeEventListener("mousedown",this.boundTrackScrollMouseDownHandler),this.browser.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.browser.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.browser.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseMoveHandler))}addTrackDragMouseHandlers(e){if("sequence"===this.track.type||!1===rr.has(this.track.type)){let t;function i(i){i.preventDefault(),t=i.target,!1!==this.track.selected&&"sequence"!==this.track.type||(t.classList.remove("igv-track-drag-handle-color"),t.classList.add("igv-track-drag-handle-hover-color")),e.startTrackDrag(this)}function n(i){e.endTrackDrag(),t&&i.target!==t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-color"))),t=void 0}function r(i){i.preventDefault(),void 0===t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(i.target.classList.remove("igv-track-drag-handle-color"),i.target.classList.add("igv-track-drag-handle-hover-color"))),e.updateTrackDrag(this)}function s(e){e.preventDefault(),void 0===t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color")))}this.boundTrackDragMouseDownHandler=i.bind(this),this.dragHandle.addEventListener("mousedown",this.boundTrackDragMouseDownHandler),this.boundDocumentTrackDragMouseUpHandler=n.bind(this),document.addEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.boundTrackDragMouseEnterHandler=r.bind(this),this.dragHandle.addEventListener("mouseenter",this.boundTrackDragMouseEnterHandler),this.dragHandle.addEventListener("mouseout",(e=>{e.preventDefault(),void 0===t&&(!1!==this.track.selected&&"sequence"!==this.track.type||(e.target.classList.remove("igv-track-drag-handle-hover-color"),e.target.classList.add("igv-track-drag-handle-color")))})),this.boundTrackDragMouseOutHandler=s.bind(this),this.dragHandle.addEventListener("mouseout",this.boundTrackDragMouseOutHandler)}}removeTrackDragMouseHandlers(){"ideogram"===this.track.type||"ruler"===this.track.type||(this.dragHandle.removeEventListener("mousedown",this.boundTrackDragMouseDownHandler),document.removeEventListener("mouseup",this.boundDocumentTrackDragMouseUpHandler),this.dragHandle.removeEventListener("mouseup",this.boundTrackDragMouseEnterHandler),this.dragHandle.removeEventListener("mouseout",this.boundTrackDragMouseOutHandler))}removeTrackGearMouseHandlers(){!0===this.track.ignoreTrackMenu||this.gear.removeEventListener("click",this.boundTrackGearClickHandler)}removeDOMFromColumnContainer(){this.axis.remove(),this.removeViewportsFromColumnContainer(),this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove()}removeViewportsFromColumnContainer(){for(let e of this.viewports)e.viewportElement.remove()}dispose(){this.axis.remove();for(let e of this.viewports)e.dispose();this.sampleInfoViewport.dispose(),this.sampleNameViewport.dispose(),this.removeTrackScrollMouseHandlers(),this.outerScroll.remove(),this.removeTrackDragMouseHandlers(),this.dragHandle.remove(),this.removeTrackGearMouseHandlers(),this.gearContainer.remove(),"function"==typeof this.track.dispose&&this.track.dispose();for(let e of Object.keys(this))this[e]=void 0;this.alert&&this.alert.container.remove(),this.disposed=!0}paintAxis(){if("function"==typeof this.track.paintAxis){const{width:e,height:t}=this.axisCanvas.getBoundingClientRect(),i=window.devicePixelRatio||1;this.axisCanvas.height=i*t,this.axisCanvas.width=i*e;const n=this.axisCanvas.getContext("2d");if(n.scale(i,i),this.track.autoscaleGroup){if(void 0===sr[this.track.autoscaleGroup]){const e=$n.Dark2,t=Math.floor(Math.random()*$n.Dark2.length);sr[this.track.autoscaleGroup]=e[t]}const i=un.addAlpha(sr[this.track.autoscaleGroup],.75);this.track.paintAxis(n,e,t,i)}else this.track.paintAxis(n,e,t,void 0)}}maxViewportContentHeight(){return Math.max(...this.viewports.map((e=>e.getContentHeight())))}enableTrackSelection(e){const t=this.trackSelectionContainer;if(t&&!rr.has(this.track.type))if(!1!==e)t.style.display="grid";else{this.track.selected=!1;t.querySelector("[name=track-select]").checked=this.track.selected,this.dragHandle&&this.setDragHandleSelectionState(!1),t.style.display="none"}}setDragHandleSelectionState(e){const t=this.dragHandle;e?(t.classList.remove("igv-track-drag-handle-color"),t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.add("igv-track-drag-handle-selected-color")):(t.classList.remove("igv-track-drag-handle-hover-color"),t.classList.remove("igv-track-drag-handle-selected-color"),t.classList.add("igv-track-drag-handle-color"))}}const Id={threshold:2e3,r:0,g:0,b:255};class Sd{constructor(e){e=e||Id,this.threshold=e.threshold,this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[],this.nbins=2e3,this.binsize=this.threshold/this.nbins}setThreshold(e){this.threshold=e,this.cache=[],this.binsize=this.threshold/this.nbins}getThreshold(){return this.threshold}setColorComponents(e){this.r=e.r,this.g=e.g,this.b=e.b,this.cache=[]}getColorComponents(){return{r:this.r,g:this.g,b:this.b}}equals(e){return JSON.stringify(this)===JSON.stringify(e)}getColor(e){const t=Math.floor(Math.min(this.threshold,e)/this.binsize);if(void 0===this.cache[t]){const i=(cn(e,0,this.threshold)-0)/(this.threshold-0);this.cache[t]=`rgba(${this.r},${this.g},${this.b}, ${i})`}return this.cache[t]}stringify(){return this.threshold+","+this.r+","+this.g+","+this.b}static parse(e){var t,i;return e.startsWith("R:")?(t=e.substring(2).split(":"),(i=new RatioColorScale(Number.parseFloat(t[0]))).positiveScale=n(t[1]),i.negativeScale=n(t[2]),i):n(e);function n(e){var t,i;return t={threshold:(i=e.split(","))[0],r:i[1],g:i[2],b:i[3]},new Sd(t)}}}class Ed{constructor(e){this.config=e,this.url=e.path||e.url}async read(e,t){const i={start:e,size:t};return Mn.loadArrayBuffer(this.url,{range:i})}}class Nd{constructor(e){this.file=e}async read(e,t){const i=this.file;return void 0!==e?i.slice(e,e+t).arrayBuffer():i.arrayBuffer()}}class Md{constructor(e,t){this.file=e,this.rateLimiter=t}async read(e,t){const i=this.file,n=this.rateLimiter;return new Promise((function(r,s){n.limiter((async function(i){try{const n=await i.read(e,t);r(n)}catch(e){s(e)}}))(i)}))}}class Rd{constructor(e){this.file=e.file,this.size=e.size||64e3,this.position=0,this.bufferStart=0,this.bufferLength=0,this.buffer=void 0}async read(e,t){const i=e,n=e+t,r=this.bufferStart,s=this.bufferStart+this.bufferLength;if(t>this.size)return this.buffer=void 0,this.bufferStart=0,this.bufferLength=0,this.file.read(e,t);if(i>=r&&n<=s){const e=i-r,n=e+t;return this.buffer.slice(e,n)}if(i<r&&n>r){const n=r-i,s=await this.file.read(e,n),o=t-n;if(o>0){const e=this.buffer.slice(0,o);return Bd(s,e)}return s}if(!(i<s&&n>s))return this.buffer=await this.file.read(e,this.size),this.bufferStart=e,this.bufferLength=this.buffer.byteLength,this.buffer.slice(0,t);{const e=s-i,n=this.bufferLength-e,r=this.buffer.slice(n,this.bufferLength),o=t-e;if(!(o>0))return r;try{this.buffer=await this.file.read(s,this.size),this.bufferStart=s,this.bufferLength=this.buffer.byteLength;const e=this.buffer.slice(0,o);return Bd(r,e)}catch(e){if(e.code&&416===e.code)return r;throw e}}}}var Bd=function(e,t){var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer};const Dd=function(e,t){this.littleEndian=void 0===t||t,this.position=0,this.view=e,this.length=e.byteLength};function Td(e,t){this.block=e,this.offset=t}Dd.prototype.available=function(){return this.length-this.position},Dd.prototype.remLength=function(){return this.length-this.position},Dd.prototype.hasNext=function(){return this.position<this.length-1},Dd.prototype.getByte=function(){var e=this.view.getUint8(this.position,this.littleEndian);return this.position++,e},Dd.prototype.getShort=function(){var e=this.view.getInt16(this.position,this.littleEndian);return this.position+=2,e},Dd.prototype.getUShort=function(){var e=this.view.getUint16(this.position,this.littleEndian);return this.position+=2,e},Dd.prototype.getInt=function(){var e=this.view.getInt32(this.position,this.littleEndian);return this.position+=4,e},Dd.prototype.getUInt=function(){var e=this.view.getUint32(this.position,this.littleEndian);return this.position+=4,e},Dd.prototype.getLong=function(){var e=[];e[0]=this.view.getUint8(this.position),e[1]=this.view.getUint8(this.position+1),e[2]=this.view.getUint8(this.position+2),e[3]=this.view.getUint8(this.position+3),e[4]=this.view.getUint8(this.position+4),e[5]=this.view.getUint8(this.position+5),e[6]=this.view.getUint8(this.position+6),e[7]=this.view.getUint8(this.position+7);var t=0;if(this.littleEndian)for(var i=e.length-1;i>=0;i--)t=256*t+e[i];else for(i=0;i<e.length;i++)t=256*t+e[i];return this.position+=8,t},Dd.prototype.getString=function(e){for(var t,i="";0!=(t=this.view.getUint8(this.position++))&&(i+=String.fromCharCode(t),!e||i.length!=e););return i},Dd.prototype.getFixedLengthString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>0&&(n+=String.fromCharCode(i));return n},Dd.prototype.getFixedLengthTrimmedString=function(e){var t,i,n="";for(t=0;t<e;t++)(i=this.view.getUint8(this.position++))>32&&(n+=String.fromCharCode(i));return n},Dd.prototype.getFloat=function(){var e=this.view.getFloat32(this.position,this.littleEndian);return this.position+=4,e},Dd.prototype.getDouble=function(){var e=this.view.getFloat64(this.position,this.littleEndian);return this.position+=8,e},Dd.prototype.skip=function(e){return this.position+=e,this.position},Dd.prototype.getVPointer=function(){var e=this.position,t=this.view.getUint8(e+1)<<8|this.view.getUint8(e),i=4294967296*(255&this.view.getUint8(e+6))+16777216*(255&this.view.getUint8(e+5))+65536*(255&this.view.getUint8(e+4))+256*(255&this.view.getUint8(e+3))+(255&this.view.getUint8(e+2));return this.position+=8,new Td(i,t)},Td.prototype.isLessThan=function(e){return this.block<e.block||this.block===e.block&&this.offset<e.offset},Td.prototype.isGreaterThan=function(e){return this.block>e.block||this.block===e.block&&this.offset>e.offset},Td.prototype.print=function(){return this.block+":"+this.offset};class zd{constructor(e,t){this.chr1=e,this.chr2=t}getKey(){return this.chr1.name+"_"+this.chr2.name+"_"+this.zoom.unit+"_"+this.zoom.binSize}getBlockNumbers(e,t,i){if(e.chr==this.chr2&&t.chr===this.chr1){const i=e;e=t,t=i}const n=this.chr1===this.chr2,r=this.zoom.binSize,s=this.blockBinCount,o=this.blockColumnCount;return i<9||!n?function(){const i=e.start/r,a=e.end/r,c=t.start/r,l=t.end/r,h=Math.floor(i/s),d=Math.floor((a-1)/s),u=Math.floor(c/s),f=Math.floor((l-1)/s),p=[];for(let e=u;e<=f;e++)for(let t=h;t<=d;t++){let i;i=n&&e<t?t*o+e:e*o+t,p.includes(i)||p.push(i)}return p}():function(){const i=e.start/r,n=e.end/r,a=t.start/r,c=t.end/r,l=Math.floor((i+a)/2/s),h=Math.floor((n+c)/2/s),d=Math.floor(Math.log2(1+Math.abs(i-c)/Math.sqrt(2)/s)),u=Math.floor(Math.log2(1+Math.abs(n-a)/Math.sqrt(2)/s)),f=(n-a)*(i-c)<0?0:Math.min(d,u),p=Math.max(d,u),g=[];for(let e=f;e<=p;e++)for(let t=l;t<=h;t++){const i=e*o+t;g.push(i)}return g}()}static parseMatrixZoomData(e,t,i){const n=new zd(e,t),r=i.getString(),s=i.getInt(),o=i.getFloat(),a=i.getFloat(),c=i.getFloat(),l=i.getFloat(),h=i.getInt();n.blockBinCount=i.getInt(),n.blockColumnCount=i.getInt();const d=i.getInt();n.zoom={index:s,unit:r,binSize:h},n.blockIndex=new Ld(d,i);const u=o/(e.size/h)/(t.size/h);return n.averageCount=u,n.sumCounts=o,n.stdDev=c,n.occupiedCellCount=a,n.percent95=l,n}}class Ld{constructor(e,t){for(this.blockIndex={};e-- >0;){const e=t.getInt(),i=t.getLong(),n=t.getInt();this.blockIndex[e]={filePosition:i,size:n}}}getBlockIndexEntry(e){return this.blockIndex[e]}}class Hd{constructor(e,t,i){this.chr1=e,this.chr2=t,this.bpZoomData=[],this.fragZoomData=[];for(let e of i)"BP"===e.zoom.unit?this.bpZoomData.push(e):this.fragZoomData.push(e)}findZoomForResolution(e,t){const i="FRAG"===t?this.fragZoomData:this.bpZoomData;for(let t=1;t<i.length;t++){if(i[t].zoom.binSize<e)return t-1}return i.length-1}getZoomData(e,t){const i="BP"===(t=t||"BP")?this.bpZoomData:this.fragZoomData;for(let t=0;t<i.length;t++){var n=i[t];if(e===n.zoom.binSize)return n}}getZoomDataByIndex(e,t){return("FRAG"===t?this.fragZoomData:this.bpZoomData)[e]}static getKey(e,t){if(e>t){const i=e;e=t,t=i}return`${e}_${t}`}static parseMatrix(e,t){const i=new Dd(new DataView(e)),n=i.getInt(),r=i.getInt(),s=t[n],o=t[r];let a=i.getInt();const c=[];for(;a-- >0;){const e=zd.parseMatrixZoomData(s,o,i);c.push(e)}return new Hd(n,r,c)}}class Pd{constructor(e,t,i){this.bin1=e,this.bin2=t,this.counts=i}getKey(){return this.bin1+"_"+this.bin2}}class Od{constructor(e=10){this.max=e,this.map=new Map}get(e){let t=this.map.get(e);return t&&(this.map.delete(e),this.map.set(e,t)),t}set(e,t){this.map.has(e)?this.map.delete(e):this.map.size===this.max&&this.map.delete(this.first()),this.map.set(e,t)}has(e){return this.map.has(e)}clear(){this.map.clear()}first(){return this.map.keys().next().value}}class Vd{constructor(e,t,i,n){this.file=e,this.filePosition=t,this.nValues=i,this.dataType=n,this.cache=void 0}async getValues(e,t){if(!this.cache||e<this.cache.start||t>this.cache.end){const i=Math.max(0,e-1e3),n=Math.min(this.nValues,t+1e3),r=this.filePosition+i*this.dataType,s=n-i,o=s*this.dataType,a=await this.file.read(r,o);if(!a)return;const c=new Dd(new DataView(a)),l=[];for(let e=0;e<s;e++)l[e]=8===this.dataType?c.getDouble():c.getFloat();this.cache={start:i,end:n,values:l}}const i=e-this.cache.start,n=i+(t-e);return this.cache.values.slice(i,n)}getKey(){return Vd.getKey(this.type,this.chrIdx,this.unit,this.resolution)}static getNormalizationVectorKey(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}}var qd={"hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined.hic":"54386046426,55860","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fprimary.hic":"33860030033,37504","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Freplicate.hic":"30849652794,55832","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fmaternal.hic":"1380542661,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fpaternal.hic":"1389001777,17185","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2Fcombined.hic":"13433880319,35723","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC001.hic":"3409347253,35975","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC002.hic":"4529947083,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC003.hic":"6894962500,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC004.hic":"3395593338,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC005.hic":"5204128636,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC006.hic":"3278363811,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC007.hic":"3585547340,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC008.hic":"4134197273,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC009.hic":"2851728310,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC010.hic":"1754216102,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC011.hic":"1716829574,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC012.hic":"4367980375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC013.hic":"2309654671,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC014.hic":"5324950266,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC015.hic":"3132333594,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC016.hic":"3159154704,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC017.hic":"3262554627,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC018.hic":"3014216364,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC019.hic":"5025753246,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC020.hic":"5861584507,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC021.hic":"3542263275,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC022.hic":"5061949378,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC023.hic":"4816423919,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC024.hic":"2683781104,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC025.hic":"6522701781,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC026.hic":"6748846520,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC027.hic":"5642693007,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC028.hic":"2098921691,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC029.hic":"3886454027,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC030.hic":"2288984204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fagar%2FHIC031.hic":"2115342419,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fpellet%2FHIC032.hic":"2063314324,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fsupernatant%2FHIC033.hic":"1933908457,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC034.hic":"13555514595,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC035.hic":"6129650900,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC036.hic":"4307445019,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2FHIC037.hic":"9375139867,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fdilution%2Fcombined.hic":"11664249584,33929","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_DpnII.hic":"7003537290,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC038.hic":"2099825544,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC039.hic":"2096900138,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC040.hic":"2593642141,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC041.hic":"2263919098,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC042.hic":"2684774693,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2Fcombined_noXlink.hic":"5574807456,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC043.hic":"2986114347,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC044.hic":"1916378621,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC045.hic":"746463126,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC046.hic":"2338476164,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC047.hic":"1167496250,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC048.hic":"2231690794,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fin-situ%2FHIC049.hic":"2782308678,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC050.hic":"3633531346,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC051.hic":"4063486444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC052.hic":"929756278,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC053.hic":"2489657204,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC054.hic":"4036419444,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC055.hic":"4284185549,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fin-situ%2FHIC056.hic":"4410546240,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fimr90%2Fdilution%2FHIC057.hic":"1491998259,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2Fcombined.hic":"7266425111,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC058.hic":"6532635593,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC059.hic":"400684530,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC060.hic":"645352187,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC061.hic":"736291871,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC062.hic":"762731037,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fin-situ%2FHIC063.hic":"682917431,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhmec%2Fdilution%2FHIC064.hic":"4550171307,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2Fcombined.hic":"11897184911,35789","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC065.hic":"5425943567,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC066.hic":"5942869818,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fin-situ%2FHIC067.hic":"5191049261,35647","hicfiles.s3.amazonaws.com%2Fhiseq%2Fnhek%2Fdilution%2FHIC068.hic":"2713318801,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2Fcombined.hic":"12641555389,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC069.hic":"5630177461,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC070.hic":"5926611269,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC071.hic":"2486191351,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC072.hic":"2281343366,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC073.hic":"2173074239,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fk562%2Fin-situ%2FHIC074.hic":"2463700999,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2Fcombined.hic":"14661922519,35639","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC075.hic":"3685310515,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC076.hic":"5833658487,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC077.hic":"2406346486,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC078.hic":"5241454987,35919","hicfiles.s3.amazonaws.com%2Fhiseq%2Fkbm7%2Fin-situ%2FHIC079.hic":"6297234263,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2Fcombined.hic":"9193858096,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC080.hic":"5171405536,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC081.hic":"3489767688,35891","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fin-situ%2FHIC082.hic":"4243339375,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhuvec%2Fdilution%2FHIC083.hic":"1497495406,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2Fcombined.hic":"7923332224,35593","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC084.hic":"867699123,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC085.hic":"3669518514,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC086.hic":"5306474712,35595","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhela%2Fin-situ%2FHIC087.hic":"1490963755,36397","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2Fcombined.hic":"8956382853,50248","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC088.hic":"1874185366,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC089.hic":"1301165236,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC090.hic":"1105246282,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC091.hic":"1338325770,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC092.hic":"1307918730,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC093.hic":"755136918,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC094.hic":"1606583694,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC095.hic":"2039711245,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC096.hic":"1909573053,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC097.hic":"1826710712,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC098.hic":"1998793575,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC099.hic":"1007740962,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC100.hic":"736464120,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC101.hic":"980505082,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fin-situ%2FHIC102.hic":"1116083646,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC103.hic":"1096994310,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fch12-lx-b-lymphoblasts%2Fdilution%2FHIC104.hic":"841063882,32102","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC105.hic":"107742864,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC106.hic":"134295912,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC107.hic":"110228014,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC108.hic":"102761401,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC109.hic":"100461491,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC110.hic":"88828472,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC111.hic":"81471064,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC112.hic":"92297035,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC113.hic":"65503916,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC114.hic":"49181188,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC115.hic":"46471102,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC116.hic":"64284432,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC117.hic":"60434076,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC118.hic":"45248563,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC119.hic":"60288782,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC120.hic":"136888414,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC121.hic":"125009003,33681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC122.hic":"154011688,34127","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC123.hic":"177663372,35293","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC124.hic":"382186226,35245","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC125.hic":"158160717,35271","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC127.hic":"110261177,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC128.hic":"246131875,35509","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC129.hic":"260160119,35667","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC130.hic":"117479562,34681","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC131.hic":"81508929,34673","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC132.hic":"105959102,34895","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC133.hic":"91504812,33451","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC134.hic":"52222546,33737","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC135.hic":"57763085,34159","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC136.hic":"50618489,33731","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC137.hic":"193163606,33363","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC138.hic":"229876152,33777","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC139.hic":"201783666,33571","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC140.hic":"281163862,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC141.hic":"275969727,33935","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC142.hic":"275020431,34125","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC144.hic":"223834810,34177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC145.hic":"296632653,33937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC146.hic":"290945216,33961","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC147.hic":"234459964,34231","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC148.hic":"295457850,34039","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC149.hic":"113569632,35695","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC150.hic":"304381897,33963","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC151.hic":"289314545,33805","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC152.hic":"284320182,33803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC153.hic":"401393947,34659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC154.hic":"188065488,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC155.hic":"299157119,33967","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC156.hic":"279289244,33787","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC157.hic":"254852119,33917","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC158.hic":"195969660,33477","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC159.hic":"185720388,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC160.hic":"227709279,33599","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC161.hic":"157225076,33209","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC162.hic":"105703444,32033","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC163.hic":"122665658,32121","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC164.hic":"228048231,33761","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC165.hic":"114440819,32011","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC166.hic":"285147558,33891","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC167.hic":"363116754,33943","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC168.hic":"119592158,31937","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC169.hic":"236853872,33785","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC170.hic":"195187639,33395","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC171.hic":"208044058,33309","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC172.hic":"144645916,32877","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC173.hic":"119115941,32203","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC175.hic":"178030481,33525","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC176.hic":"117220136,32169","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC177.hic":"128586196,32659","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC178.hic":"191419141,33629","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC179.hic":"141556748,32959","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC180.hic":"199825102,33185","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC181.hic":"301022688,33783","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC182.hic":"185384453,33205","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC183.hic":"202189264,36367","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC184.hic":"37464475,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC185.hic":"161938278,36099","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC186.hic":"133853166,36179","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC188.hic":"128068030,36237","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC189.hic":"148053886,36177","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC190.hic":"198946958,35803","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC191.hic":"226584564,36063","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC192.hic":"194412797,36341","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC193.hic":"176408194,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC194.hic":"207215649,36055","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC195.hic":"175185530,36315","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC196.hic":"168969337,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC197.hic":"121231252,36339","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC198.hic":"92713752,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC199.hic":"105130500,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC200.hic":"114526350,36479","hicfiles.s3.amazonaws.com%2Fmiseq%2Frh2014%2FHIC201.hic":"122689717,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fhap1%2Fin-situ%2Fcombined.hic":"9614983328,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fctbp_8_4_17%2Fall_intra_megabase_michrom.hic":"154205644,10960","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xa-combined.hic":"8843305329,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXa-chrX-diploid.hic":"11173520,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-combined.hic":"13365182403,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FWT-chrX-diploid.hic":"17343459,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC002.hic":"4279298739,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC003.hic":"3027365532,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC004.hic":"2896130835,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC005.hic":"4717830071,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC006.hic":"5066210154,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC007.hic":"3069516128,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2Fdel-Xi-combined.hic":"14551096423,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FdelXi-chrX-diploid.hic":"17362477,1498","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC008.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC009.hic":"2935931663,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC010.hic":"2019085070,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC011.hic":"6087610814,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC012.hic":"2809618194,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Frpe1%2FDarrowHuntley-2015%2FHIC013.hic":"2572386655,36479","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fcombined.hic":"6950423609,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fpaternal.hic":"220592749,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2Fmaternal.hic":"323233095,15691","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC014.hic":"3183235800,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC015.hic":"1739539801,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC016.hic":"1105912758,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC017.hic":"1060773319,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC018.hic":"1203679874,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fpatski%2FDarrowHuntley-2015%2FHIC019.hic":"3321955269,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Frhesus%2FDarrowHuntley-2015%2FHIC020.hic":"7108980626,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2Fgm12878%2Fcola%2FDarrowHuntley-2015%2FHIC021.hic":"3906448676,34955","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Faedes%2Fcombined.hic":"390780490,2245","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2Fhs2-hic.hic":"1960284186,33561","hicfiles.s3.amazonaws.com%2Fhiseq%2Fassembly%2FCpipJ3.hic":"766279097,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2Fupdated_O%2FSnyder_O.hic":"8046980555,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fphanstiel%2FA_inter.hic":"10986005145,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2Fcombined.hic":"30439217680,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2Fcombined.hic":"33255540403,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F20min_withdraw_combined.hic":"11078436933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F40min_withdraw_combined.hic":"11031830038,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F60min_withdraw_combined.hic":"10312725340,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Fdeep%2F180min_withdraw_combined.hic":"10038610214,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC001.hic":"8004335785,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC002.hic":"8453215933,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC003.hic":"9118406189,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC004.hic":"5973342894,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC005.hic":"6846576837,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC006.hic":"6075148017,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Funsynchronized%2FHIC007.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC008.hic":"6844159653,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC009.hic":"7282063059,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC010.hic":"10410578833,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC011.hic":"8192366992,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC012.hic":"7223422850,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC013.hic":"7435986997,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Funsynchronized%2FHIC014.hic":"9120113605,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2Fcombined.hic":"4170577904,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC015.hic":"1504084990,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC016.hic":"1686244500,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC017.hic":"1804802410,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Funtreated%2Fsynchronized%2FHIC018.hic":"1533942067,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2Fcombined.hic":"4572390198,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC019.hic":"1543609666,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC020.hic":"1814133288,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC021.hic":"1942698243,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftreated_6hr%2Fsynchronized%2FHIC022.hic":"1873587413,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC049.hic":"405127557,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC060.hic":"326681741,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2Funtreated%2FRao-2017-HIC061.hic":"300908673,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC050.hic":"481758242,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_20min%2FRao-2017-HIC051.hic":"417577401,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC052.hic":"419353227,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_40min%2FRao-2017-HIC053.hic":"411554953,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC054.hic":"386655891,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_60min%2FRao-2017-HIC055.hic":"402170701,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_240min%2FRao-2017-HIC057.hic":"735906308,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC058.hic":"443789827,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC059.hic":"491422615,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC062.hic":"320261375,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min%2FRao-2017-HIC063.hic":"306590499,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC032S.hic":"367051742,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_20min%2FRao-2017-HIC033S.hic":"344555339,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC036S.hic":"349392947,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_40min%2FRao-2017-HIC037S.hic":"317714554,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC040S.hic":"266786397,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_60min%2FRao-2017-HIC041S.hic":"279445530,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC044S.hic":"898418269,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_180min%2FRao-2017-HIC045S.hic":"961006347,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC064.hic":"833576408,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_360min%2FRao-2017-HIC065.hic":"840881418,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC066.hic":"980958864,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1080min%2FRao-2017-HIC067.hic":"882023129,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC068.hic":"1110292630,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fdegron%2Ftime_course%2FAuxin_treated_360min_withdraw_1440min%2FRao-2017-HIC069.hic":"1001747023,36479","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FCP190_HiChIP.hic":"144107588,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27ac_HiChIP_combined.hic":"43171370,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FH3K27me3_HiChIP_combined.hic":"42906472,5233","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2_ChIAPET.hic":"41992430,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPol2S2_HiChIP.hic":"145842743,6976","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FArabidopsis_Wang2015_Liu2016.hic":"1134391078,4984","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FElegans_Crane2015.hic":"387127568,8758","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FNcrassa_Galazka2016.hic":"26555511,27725","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fexternal%2Frowley_nichols_mol_cell_2017%2FPfalciparum_trophozoite_Ay2014.hic":"15640893,13948","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-A.hic":"6897251,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Me-B.hic":"4959088,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-A.hic":"5232286,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FE-Mp-B.hic":"5105292,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-A.hic":"6900072,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Me-B.hic":"8653258,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-A.hic":"7999058,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fduan%2FH-Mp-B.hic":"8774657,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc.hic":"23671753603,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep1.hic":"23671754721,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fh1hesc_rep2.hic":"22269909910,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdekker%2F4dn%2Fhffc6_rep1.hic":"19016661622,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_NcoI.hic":"480725203,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2F302NH.hic":"99948617,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FK562.hic":"470263605,36151","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_HindIII.hic":"293706559,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Flieberman_aiden_van_berkum%2FGM06990_rep_HindIII.hic":"309673862,36087","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep1.hic":"1531151371,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fcanis-lupus-rep2.hic":"2851437676,56905","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmouse-rep1.hic":"582052544,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep1.hic":"698509182,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Fmacaque-rep2.hic":"461410393,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep1.hic":"691045338,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Frudan%2Frabbit-rep2.hic":"668888336,33561","hicfiles.s3.amazonaws.com%2Fexternal%2Fsexton%2Fcombined.hic":"50650087,4486","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-hindiii.hic":"1071142023,16500","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-mboi.hic":"1508851093,16448","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Fnon-tcc-hindiii.hic":"395179229,36093","hicfiles.s3.amazonaws.com%2Fexternal%2Fkalhor%2Ftcc-combined.hic":"1050423847,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-hindiii%2Fsplit-read-run.hic":"9599984876,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fhesc-hindiii.hic":"1952555632,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fimr90-hindiii.hic":"9691260435,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fdixon%2Fmm9-cortex.hic":"3712072953,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr18.hic":"2083350075,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr2.hic":"3362049644,16360","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fatm-i-scei-chr7.hic":"1658399854,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr15.hic":"866691249,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fzhang%2Fwt-i-scei-chr2.hic":"3304782795,16386","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-1.hic":"23673506,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-2.hic":"26873280,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-3.hic":"31066362,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-4.hic":"16807724,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-5.hic":"28665065,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-6.hic":"13124158,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-7.hic":"15118945,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-8.hic":"68316814,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-9.hic":"18965101,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2Fcell-10.hic":"17020666,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Fcombined.hic":"6526601242,36427","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep1.hic":"1861562891,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep2.hic":"3061013635,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep3.hic":"1564588211,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep4.hic":"1255543175,36153","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep5.hic":"974683253,36179","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90%2Frep6.hic":"1040805629,36053","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Fcombined.hic":"8424080116,36401","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep1.hic":"2697976702,36295","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep3.hic":"1718610467,36159","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep4.hic":"2029519405,36101","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep5.hic":"985310855,36069","hicfiles.s3.amazonaws.com%2Fexternal%2Fjin%2Fimr90-tnf-alpha%2Frep6.hic":"1418750480,35967","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fmhh-call-4-cell-line.hic":"538380253,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fprimary-b-all.hic":"773764191,35793","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Fnormal-b-cell-line.hic":"336271459,35005","hicfiles.s3.amazonaws.com%2Fexternal%2Fcheng%2Frl-cell-line.hic":"484807998,35351","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-biorep.hic":"135932435,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep1.hic":"160355961,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Fhou%2Fkc167-techrep2.hic":"188809887,8758","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fpre-prob-egs.hic":"2237792858,15483","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-egs.hic":"5744720377,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Flin%2Fprob-fa.hic":"2174866215,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhct116-rnapii-pilot.hic":"396366166,35999","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fhela-rnapii-pilot.hic":"882516759,35107","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-pilot.hic":"1131576189,35969","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fk562-rnapii-saturated.hic":"571583828,36291","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fmcf7-rnapii-saturated.hic":"1282547841,36035","hicfiles.s3.amazonaws.com%2Fexternal%2Fli%2Fnb4-rnapii-pilot.hic":"761614686,34861","hicfiles.s3.amazonaws.com%2Fexternal%2Fjung%2Fmouse_sperm.hic":"1730231642,29184","hicfiles.s3.amazonaws.com%2Fexternal%2Ftang%2Fgm12878.hic":"1953518212,20505","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791299.hic":"5723484,11956","hicfiles.s3.amazonaws.com%2Fexternal%2Frutledge%2FSRR1791297.hic":"16534743,23348","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv.hic":"5094525579,36289","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep1.hic":"2574358912,36373","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-hrv-rep2.hic":"3417099433,36243","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev.hic":"4785157552,36323","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep1.hic":"2648268465,36321","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-rad21cv-tev-rep2.hic":"2994727980,36107","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf.hic":"5391791815,36063","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep1.hic":"3325842095,36269","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctcf-rep2.hic":"3096215920,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl.hic":"3830902383,36167","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl-rep1.hic":"1346712252,36079","hicfiles.s3.amazonaws.com%2Fexternal%2Fzuin%2Fhek293t-sirna-ctrl_rep2.hic":"3098067367,36271","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-0h-hiseq.hic":"38174042,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq.hic":"26506099,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-18h-hiseq-non-crosslinked_control.hic":"3545496,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fay%2Fp-falciparum-3d7-36h-hiseq.hic":"70754194,21889","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fg1mid-r1.hic":"200863476,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r1.hic":"249021190,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3%2Fm-r2.hic":"212341157,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-0-25fa.hic":"583572265,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fg1-1fa.hic":"354502306,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-0-25fa.hic":"149308791,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-98percent.hic":"778175225,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhelas3ccl2p2%2Fm-1fa.hic":"158091047,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-ns-r1.hic":"801670039,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fhff1%2Fcchic-hff1-m-r1.hic":"875922086,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r1.hic":"130959943,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fnaumova%2Fk562%2Fm-r2.hic":"237861106,17185","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT.hic":"496104039,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-WT-adv-cre.hic":"438608517,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep1.hic":"446205712,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-floxed-rep2.hic":"386354767,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep1.hic":"621998722,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmAST-deleted-rep2.hic":"583840829,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep1.hic":"801290988,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-floxed-rep2.hic":"819406658,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep1.hic":"792825269,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-deleted-rep2.hic":"746189884,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT.hic":"309353372,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fsofueva%2FmNSC-WT-OHT.hic":"274229679,30643","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R1.hic":"1490362251,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21KO-R3.hic":"2403664421,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R1.hic":"1377124538,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fseitan%2FTcell-Rad21WT-R3.hic":"2646201369,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2Fcrh6-mutant.hic":"105261071,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fmoissiard%2FWT.hic":"127506388,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2FCol.hic":"153638500,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn1.hic":"211213220,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fgrob%2Fcrwn4.hic":"134236837,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fxie%2Fprimary.hic":"92936173,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt337.hic":"318737891,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt-control6wt67.hic":"348123956,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt337.hic":"251107279,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2F6wt67.hic":"351840994,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2FCol0.hic":"345969497,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fclf28-swn7.hic":"299585025,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fcmt3-11.hic":"253427706,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fddm1-2.hic":"303626924,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fmet1-3.hic":"347697973,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Ffeng%2Fsuvh4-suvh5-suvh6.hic":"263122019,10217","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNase-HiC-WG-K562.hic":"892955840,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FDNaseHiC-WG-H1.hic":"696922695,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-K562-rep1.hic":"341917716,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargeredDNaseHiC-lincRNA-K562-rep2.hic":"214841185,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep1.hic":"616326137,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-lincRNA-H1-rep2.hic":"579654013,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-H1-rep1.hic":"519810544,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Fma%2FtargetedDNaseHiC-pe-K562-rep1.hic":"199553123,18679","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII.hic":"1319373594,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_HinfI.hic":"1465493873,6976","hicfiles.s3.amazonaws.com%2Fexternal%2Frowley%2FKc167_DpnII_HinfI_combo.hic":"753062558,5814","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-10A.hic":"2784956115,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbarutcu%2FMCF-7.hic":"2700457411,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fbatullin%2Fsperm.hic":"501052169,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep1.hic":"1450697530,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2FWT_hiC_rep2.hic":"1189371558,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Fcombined.hic":"2262007875,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Finactive.hic":"4444564,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fminajigi%2Factive.hic":"3993495,751","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep1.hic":"1650838357,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_rep2.hic":"1258038606,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski.hic":"499827296,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fpatski_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_dnase.hic":"4298088401,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_in_situ_dnase.hic":"609321852,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain.hic":"1028196506,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_active.hic":"79175714,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fdeng%2Fbrain_inactive.hic":"98947881,15691","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep1.hic":"1283306,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FBglII_rep2.hic":"1263227,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Fle%2FNcoI_rep1.hic":"4380906,1463","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined.hic":"1829549643,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Feagen%2FGSE89112_Kc167combined_randomized.hic":"1859742654,25624","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_GM_cohesin.hic":"1231264781,17932","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_cohesin_all.hic":"1152008628,16438","hicfiles.s3.amazonaws.com%2Fexternal%2Fmumbach%2FGSE80820_HiChIP_mES_Oct4.hic":"912828146,16438","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FSCC4KO.hic":"1767906138,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FDKO.hic":"1487228787,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_1.14.hic":"1189751862,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWaplKO_3.3.hic":"1155057696,18679","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fwapl_hic%2FWT.hic":"1522401568,18679","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2Fmega_Liverpool%2Fmega.hic":"2612171975,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2836_Liverpool1%2FLiverpool1.hic":"191729195,2245","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2861_Liverpool2%2FLiverpool2.hic":"1637096030,4381","s3.amazonaws.com%2Fhicfiles%2Fhiseq%2Fskfuwi4fnsjkdf9jekrw2%2FHIC2862_Liverpool3%2FLiverpool3.hic":"1160045602,4381","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC.hic":"11857786247,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2FHSPC_CanyonDel.hic":"8139168836,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Ftcell.hic":"9871547081,36479","s3.amazonaws.com%2Fhicfiles%2Fexternal%2Fgoodell%2Fep.hic":"17479335373,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fnagano%2FTh1_ensemble.hic":"1690592868,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FES_mapq30.hic":"32930498831,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FNPC_mapq30.hic":"55053730986,32386","hicfiles.s3.amazonaws.com%2Fexternal%2Fbonev%2FCN_mapq30.hic":"53138031154,32386","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_72_hours_WT.hic":"16492991184,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_WT.hic":"23057795398,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_MYC_KO.hic":"21245554876,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-resting_B_cells_TSA.hic":"13933346059,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-activated_B_cells_24_hours_oligomycin.hic":"21902506832,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FKieffer-Kwon_et_al_2017%2FMain_maps%2FKieffer-Kwon-2017-mES_WT.hic":"9451969795,32102","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_WT.hic":"3600188564,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_WT.hic":"1309503359,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_30_hours_HU_treated.hic":"1477252396,16438","hicfiles.s3.amazonaws.com%2Fhiseq%2FVian_et_al_2018%2FMain_maps%2FVian-2018-activated_B_cells_24_hours_flavopiridol.hic":"15711773490,32102","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FPGP1F_mega_090118%2FPGP1F_mega_090118_30.hic":"24786676166,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7145%2FHIC7145_30.hic":"4554644616,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7146%2FHIC7146_30.hic":"4174848944,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7147%2FHIC7147_30.hic":"5062229182,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7862%2FHIC7862_30.hic":"4520990620,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7863%2FHIC7863_30.hic":"4330354773,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7864%2FHIC7864_30.hic":"5880640268,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7865%2FHIC7865_30.hic":"4431632469,36479","hicfiles.s3.amazonaws.com%2Fexternal%2Fpgp%2FHIC7866%2FHIC7866_30.hic":"4686000222,36479","encode-public.s3.amazonaws.com%2F2018%2F10%2F19%2Fb122542b-306c-4631-bdc3-2e155e89af55%2FENCFF718AWL.hic":"39544267907,58932","encode-public.s3.amazonaws.com%2F2019%2F02%2F15%2F8e787cd8-e388-4bc2-a236-7a5e6f39e0c0%2FENCFF999YXX.hic":"9255069996,56883","encode-public.s3.amazonaws.com%2F2019%2F02%2F08%2Ffc1d9d5d-8fa0-4e29-9080-3da674d9490d%2FENCFF543USQ.hic":"5005263062,36479","s3.us-east-1.wasabisys.com%2Fhicfiles%2Finternal%2FLCL_mega_42B_500bp_30.hic":"106482584851,22829","www.encodeproject.org%2Ffiles%2FENCFF925QIF%2F%40%40download%2FENCFF925QIF.hic":"51712684396,54779","www.encodeproject.org%2Ffiles%2FENCFF259YUS%2F%40%40download%2FENCFF259YUS.hic":"24640030444,54779","www.encodeproject.org%2Ffiles%2FENCFF783KQI%2F%40%40download%2FENCFF783KQI.hic":"27209249856,54779","www.encodeproject.org%2Ffiles%2FENCFF318JAP%2F%40%40download%2FENCFF318JAP.hic":"28636979242,54779","www.encodeproject.org%2Ffiles%2FENCFF512PQA%2F%40%40download%2FENCFF512PQA.hic":"28124104361,54779","www.encodeproject.org%2Ffiles%2FENCFF591MHA%2F%40%40download%2FENCFF591MHA.hic":"37373387202,54779","www.encodeproject.org%2Ffiles%2FENCFF197OWW%2F%40%40download%2FENCFF197OWW.hic":"41826180893,54779","www.encodeproject.org%2Ffiles%2FENCFF317OIA%2F%40%40download%2FENCFF317OIA.hic":"34741636038,54779","www.encodeproject.org%2Ffiles%2FENCFF522YLZ%2F%40%40download%2FENCFF522YLZ.hic":"24064692329,54779","www.encodeproject.org%2Ffiles%2FENCFF420JTA%2F%40%40download%2FENCFF420JTA.hic":"21202405177,54779","www.encodeproject.org%2Ffiles%2FENCFF871ZDJ%2F%40%40download%2FENCFF871ZDJ.hic":"10124815680,18679","www.encodeproject.org%2Ffiles%2FENCFF349RZY%2F%40%40download%2FENCFF349RZY.hic":"4446702705,36479","www.encodeproject.org%2Ffiles%2FENCFF738YON%2F%40%40download%2FENCFF738YON.hic":"3338049584,35947","www.encodeproject.org%2Ffiles%2FENCFF406KJN%2F%40%40download%2FENCFF406KJN.hic":"4132875306,36479","www.encodeproject.org%2Ffiles%2FENCFF081NPN%2F%40%40download%2FENCFF081NPN.hic":"34495587443,54779","www.encodeproject.org%2Ffiles%2FENCFF946RZW%2F%40%40download%2FENCFF946RZW.hic":"34571955193,54779","www.encodeproject.org%2Ffiles%2FENCFF602CHT%2F%40%40download%2FENCFF602CHT.hic":"30674798032,54779","www.encodeproject.org%2Ffiles%2FENCFF150DKS%2F%40%40download%2FENCFF150DKS.hic":"12618769864,36479","www.encodeproject.org%2Ffiles%2FENCFF614IPZ%2F%40%40download%2FENCFF614IPZ.hic":"42450060331,54779","www.encodeproject.org%2Ffiles%2FENCFF571ZQR%2F%40%40download%2FENCFF571ZQR.hic":"15230068871,47429","www.encodeproject.org%2Ffiles%2FENCFF705MKK%2F%40%40download%2FENCFF705MKK.hic":"38686554702,54779","www.encodeproject.org%2Ffiles%2FENCFF658KTB%2F%40%40download%2FENCFF658KTB.hic":"13195884405,47429","www.encodeproject.org%2Ffiles%2FENCFF435JYN%2F%40%40download%2FENCFF435JYN.hic":"17192139674,54779","www.encodeproject.org%2Ffiles%2FENCFF016JKX%2F%40%40download%2FENCFF016JKX.hic":"37266736642,54779","www.encodeproject.org%2Ffiles%2FENCFF294GFP%2F%40%40download%2FENCFF294GFP.hic":"36389843399,54779","www.encodeproject.org%2Ffiles%2FENCFF700CYI%2F%40%40download%2FENCFF700CYI.hic":"60482012152,54779","www.encodeproject.org%2Ffiles%2FENCFF962EDB%2F%40%40download%2FENCFF962EDB.hic":"39394328182,54779","www.encodeproject.org%2Ffiles%2FENCFF467OGP%2F%40%40download%2FENCFF467OGP.hic":"35572788855,54779","www.encodeproject.org%2Ffiles%2FENCFF556RLR%2F%40%40download%2FENCFF556RLR.hic":"34826921187,54779","www.encodeproject.org%2Ffiles%2FENCFF309UNV%2F%40%40download%2FENCFF309UNV.hic":"48510618174,54779","www.encodeproject.org%2Ffiles%2FENCFF653HCO%2F%40%40download%2FENCFF653HCO.hic":"41079007620,54779","www.encodeproject.org%2Ffiles%2FENCFF120DSV%2F%40%40download%2FENCFF120DSV.hic":"12790195576,47429","www.encodeproject.org%2Ffiles%2FENCFF284OEA%2F%40%40download%2FENCFF284OEA.hic":"46007570339,54779","www.encodeproject.org%2Ffiles%2FENCFF035BLF%2F%40%40download%2FENCFF035BLF.hic":"63868871985,54779","www.encodeproject.org%2Ffiles%2FENCFF094KKX%2F%40%40download%2FENCFF094KKX.hic":"42151419971,54779","www.encodeproject.org%2Ffiles%2FENCFF965BPU%2F%40%40download%2FENCFF965BPU.hic":"42717376107,54779","www.encodeproject.org%2Ffiles%2FENCFF842DUO%2F%40%40download%2FENCFF842DUO.hic":"39553892515,54779","www.encodeproject.org%2Ffiles%2FENCFF417GBZ%2F%40%40download%2FENCFF417GBZ.hic":"45544785452,54779","www.encodeproject.org%2Ffiles%2FENCFF499BVX%2F%40%40download%2FENCFF499BVX.hic":"40900674170,54779","www.encodeproject.org%2Ffiles%2FENCFF136XCV%2F%40%40download%2FENCFF136XCV.hic":"47700392974,54779","www.encodeproject.org%2Ffiles%2FENCFF224HKR%2F%40%40download%2FENCFF224HKR.hic":"40426005932,54779","www.encodeproject.org%2Ffiles%2FENCFF711XSR%2F%40%40download%2FENCFF711XSR.hic":"41434581949,54779","www.encodeproject.org%2Ffiles%2FENCFF660JWA%2F%40%40download%2FENCFF660JWA.hic":"54201632697,54779","www.encodeproject.org%2Ffiles%2FENCFF081PMO%2F%40%40download%2FENCFF081PMO.hic":"53428285130,54779","www.encodeproject.org%2Ffiles%2FENCFF799QGA%2F%40%40download%2FENCFF799QGA.hic":"1228682189,36479","www.encodeproject.org%2Ffiles%2FENCFF473CAA%2F%40%40download%2FENCFF473CAA.hic":"1077514950,36479","www.encodeproject.org%2Ffiles%2FENCFF663FRL%2F%40%40download%2FENCFF663FRL.hic":"39843938245,54779","www.encodeproject.org%2Ffiles%2FENCFF341WOY%2F%40%40download%2FENCFF341WOY.hic":"34792598619,54779","www.encodeproject.org%2Ffiles%2FENCFF515ZBF%2F%40%40download%2FENCFF515ZBF.hic":"41779230923,54779","www.encodeproject.org%2Ffiles%2FENCFF545GBW%2F%40%40download%2FENCFF545GBW.hic":"38351980358,54779","www.encodeproject.org%2Ffiles%2FENCFF252ANV%2F%40%40download%2FENCFF252ANV.hic":"37668839771,54779","www.encodeproject.org%2Ffiles%2FENCFF912NDK%2F%40%40download%2FENCFF912NDK.hic":"21196851956,54779","www.encodeproject.org%2Ffiles%2FENCFF683PLM%2F%40%40download%2FENCFF683PLM.hic":"21849338763,54779","www.encodeproject.org%2Ffiles%2FENCFF355NFJ%2F%40%40download%2FENCFF355NFJ.hic":"47880627268,54779","www.encodeproject.org%2Ffiles%2FENCFF507WEW%2F%40%40download%2FENCFF507WEW.hic":"35777782924,54779","www.encodeproject.org%2Ffiles%2FENCFF241MSL%2F%40%40download%2FENCFF241MSL.hic":"22507408288,54779","www.encodeproject.org%2Ffiles%2FENCFF135MUT%2F%40%40download%2FENCFF135MUT.hic":"24168734040,54779","www.encodeproject.org%2Ffiles%2FENCFF459FRB%2F%40%40download%2FENCFF459FRB.hic":"37166770103,54779","www.encodeproject.org%2Ffiles%2FENCFF705YZH%2F%40%40download%2FENCFF705YZH.hic":"44679182442,54779","www.encodeproject.org%2Ffiles%2FENCFF395INO%2F%40%40download%2FENCFF395INO.hic":"56727346538,54779","www.encodeproject.org%2Ffiles%2FENCFF736ITL%2F%40%40download%2FENCFF736ITL.hic":"49036286185,54779","www.encodeproject.org%2Ffiles%2FENCFF546TZN%2F%40%40download%2FENCFF546TZN.hic":"33195126348,54779","www.encodeproject.org%2Ffiles%2FENCFF706SFK%2F%40%40download%2FENCFF706SFK.hic":"3271831702,36479","www.encodeproject.org%2Ffiles%2FENCFF922ERE%2F%40%40download%2FENCFF922ERE.hic":"12476647122,36479","www.encodeproject.org%2Ffiles%2FENCFF876OWE%2F%40%40download%2FENCFF876OWE.hic":"1538692704,47429","www.encodeproject.org%2Ffiles%2FENCFF227XJZ%2F%40%40download%2FENCFF227XJZ.hic":"1925617685,36479","www.encodeproject.org%2Ffiles%2FENCFF053BXY%2F%40%40download%2FENCFF053BXY.hic":"1032237652,36479","www.encodeproject.org%2Ffiles%2FENCFF014VMM%2F%40%40download%2FENCFF014VMM.hic":"1564021703,36479","www.encodeproject.org%2Ffiles%2FENCFF563XES%2F%40%40download%2FENCFF563XES.hic":"1489180508,36479","www.encodeproject.org%2Ffiles%2FENCFF482LGO%2F%40%40download%2FENCFF482LGO.hic":"1208778887,36479","www.encodeproject.org%2Ffiles%2FENCFF216QQM%2F%40%40download%2FENCFF216QQM.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF256UOW%2F%40%40download%2FENCFF256UOW.hic":"6293163571,47429","www.encodeproject.org%2Ffiles%2FENCFF791UZC%2F%40%40download%2FENCFF791UZC.hic":"37029615181,54779","www.encodeproject.org%2Ffiles%2FENCFF911AHQ%2F%40%40download%2FENCFF911AHQ.hic":"34246649165,54779","www.encodeproject.org%2Ffiles%2FENCFF491AOR%2F%40%40download%2FENCFF491AOR.hic":"558663570,36479","www.encodeproject.org%2Ffiles%2FENCFF307PDL%2F%40%40download%2FENCFF307PDL.hic":"525321519,36479","www.encodeproject.org%2Ffiles%2FENCFF773ITV%2F%40%40download%2FENCFF773ITV.hic":"295464771,36479","www.encodeproject.org%2Ffiles%2FENCFF198SSL%2F%40%40download%2FENCFF198SSL.hic":"500142476,36479","www.encodeproject.org%2Ffiles%2FENCFF251UEF%2F%40%40download%2FENCFF251UEF.hic":"567443575,36479","www.encodeproject.org%2Ffiles%2FENCFF942LTN%2F%40%40download%2FENCFF942LTN.hic":"4430960222,36479","www.encodeproject.org%2Ffiles%2FENCFF543USQ%2F%40%40download%2FENCFF543USQ.hic":"5005263062,36479","www.encodeproject.org%2Ffiles%2FENCFF434XQU%2F%40%40download%2FENCFF434XQU.hic":"25506511674,54779","www.encodeproject.org%2Ffiles%2FENCFF318GOM%2F%40%40download%2FENCFF318GOM.hic":"44750824314,54779","www.encodeproject.org%2Ffiles%2FENCFF004TKY%2F%40%40download%2FENCFF004TKY.hic":"20705661833,54779","www.encodeproject.org%2Ffiles%2FENCFF493YNC%2F%40%40download%2FENCFF493YNC.hic":"53407154984,54779","www.encodeproject.org%2Ffiles%2FENCFF334XXU%2F%40%40download%2FENCFF334XXU.hic":"14341194962,47429","www.encodeproject.org%2Ffiles%2FENCFF569RJM%2F%40%40download%2FENCFF569RJM.hic":"1922066634,36479","www.encodeproject.org%2Ffiles%2FENCFF076LWH%2F%40%40download%2FENCFF076LWH.hic":"39406255845,54779","www.encodeproject.org%2Ffiles%2FENCFF977XWK%2F%40%40download%2FENCFF977XWK.hic":"20563512962,54779","www.encodeproject.org%2Ffiles%2FENCFF127TPS%2F%40%40download%2FENCFF127TPS.hic":"21032070512,54779","www.encodeproject.org%2Ffiles%2FENCFF480KLP%2F%40%40download%2FENCFF480KLP.hic":"33115569647,54779","www.encodeproject.org%2Ffiles%2FENCFF281ILS%2F%40%40download%2FENCFF281ILS.hic":"28236353584,54779","www.encodeproject.org%2Ffiles%2FENCFF129LMU%2F%40%40download%2FENCFF129LMU.hic":"35247096013,54779","www.encodeproject.org%2Ffiles%2FENCFF759YCW%2F%40%40download%2FENCFF759YCW.hic":"16058537743,32102","www.encodeproject.org%2Ffiles%2FENCFF045YOM%2F%40%40download%2FENCFF045YOM.hic":"19775445828,32102","www.encodeproject.org%2Ffiles%2FENCFF013TGD%2F%40%40download%2FENCFF013TGD.hic":"4208420532,36479","www.encodeproject.org%2Ffiles%2FENCFF929RPW%2F%40%40download%2FENCFF929RPW.hic":"1974260276,36479","www.encodeproject.org%2Ffiles%2FENCFF996XEO%2F%40%40download%2FENCFF996XEO.hic":"2072918865,36479","www.encodeproject.org%2Ffiles%2FENCFF097SKJ%2F%40%40download%2FENCFF097SKJ.hic":"1983524001,36479","www.encodeproject.org%2Ffiles%2FENCFF464KRA%2F%40%40download%2FENCFF464KRA.hic":"1957300131,36479","www.encodeproject.org%2Ffiles%2FENCFF406HHC%2F%40%40download%2FENCFF406HHC.hic":"3854527235,36479","www.encodeproject.org%2Ffiles%2FENCFF080DPJ%2F%40%40download%2FENCFF080DPJ.hic":"19953768024,47429","www.encodeproject.org%2Ffiles%2FENCFF621AIY%2F%40%40download%2FENCFF621AIY.hic":"26781700010,54779","www.encodeproject.org%2Ffiles%2FENCFF366ERB%2F%40%40download%2FENCFF366ERB.hic":"1049184239,36479","www.encodeproject.org%2Ffiles%2FENCFF997RGL%2F%40%40download%2FENCFF997RGL.hic":"2521167549,36479","www.encodeproject.org%2Ffiles%2FENCFF029MPB%2F%40%40download%2FENCFF029MPB.hic":"1854711185,36479","www.encodeproject.org%2Ffiles%2FENCFF043EEE%2F%40%40download%2FENCFF043EEE.hic":"2924133032,36479","www.encodeproject.org%2Ffiles%2FENCFF920CJR%2F%40%40download%2FENCFF920CJR.hic":"3011577886,36479","www.encodeproject.org%2Ffiles%2FENCFF928NJV%2F%40%40download%2FENCFF928NJV.hic":"2778936244,36479","www.encodeproject.org%2Ffiles%2FENCFF894GLR%2F%40%40download%2FENCFF894GLR.hic":"2831733099,36479","www.encodeproject.org%2Ffiles%2FENCFF303PCK%2F%40%40download%2FENCFF303PCK.hic":"688704435,36479","www.encodeproject.org%2Ffiles%2FENCFF999YXX%2F%40%40download%2FENCFF999YXX.hic":"9255069996,56883","www.encodeproject.org%2Ffiles%2FENCFF685BLG%2F%40%40download%2FENCFF685BLG.hic":"16797022992,47429","www.encodeproject.org%2Ffiles%2FENCFF188SSH%2F%40%40download%2FENCFF188SSH.hic":"16797023050,47429","www.encodeproject.org%2Ffiles%2FENCFF465ESX%2F%40%40download%2FENCFF465ESX.hic":"13489465953,32102","www.encodeproject.org%2Ffiles%2FENCFF493SFI%2F%40%40download%2FENCFF493SFI.hic":"30033046818,54779","www.encodeproject.org%2Ffiles%2FENCFF235LCO%2F%40%40download%2FENCFF235LCO.hic":"38572174589,54779","www.encodeproject.org%2Ffiles%2FENCFF625VNK%2F%40%40download%2FENCFF625VNK.hic":"45202258438,54779","www.encodeproject.org%2Ffiles%2FENCFF304HMS%2F%40%40download%2FENCFF304HMS.hic":"36994445315,54779","www.encodeproject.org%2Ffiles%2FENCFF605CEN%2F%40%40download%2FENCFF605CEN.hic":"40358346301,54779","www.encodeproject.org%2Ffiles%2FENCFF086ORS%2F%40%40download%2FENCFF086ORS.hic":"22650781304,54779","www.encodeproject.org%2Ffiles%2FENCFF237UKR%2F%40%40download%2FENCFF237UKR.hic":"41516707246,54779","www.encodeproject.org%2Ffiles%2FENCFF004YZQ%2F%40%40download%2FENCFF004YZQ.hic":"71900665326,54779","www.encodeproject.org%2Ffiles%2FENCFF104THR%2F%40%40download%2FENCFF104THR.hic":"15172410632,54779","www.encodeproject.org%2Ffiles%2FENCFF807IRK%2F%40%40download%2FENCFF807IRK.hic":"17346637451,54779","www.encodeproject.org%2Ffiles%2FENCFF193CQL%2F%40%40download%2FENCFF193CQL.hic":"55726903245,54779","www.encodeproject.org%2Ffiles%2FENCFF700DEX%2F%40%40download%2FENCFF700DEX.hic":"20231399798,54779","www.encodeproject.org%2Ffiles%2FENCFF234MDO%2F%40%40download%2FENCFF234MDO.hic":"24635312640,54779","www.encodeproject.org%2Ffiles%2FENCFF181ROW%2F%40%40download%2FENCFF181ROW.hic":"26883606497,54779","www.encodeproject.org%2Ffiles%2FENCFF896OFN%2F%40%40download%2FENCFF896OFN.hic":"36952196833,54779","www.encodeproject.org%2Ffiles%2FENCFF573OPJ%2F%40%40download%2FENCFF573OPJ.hic":"36685546919,54779","www.encodeproject.org%2Ffiles%2FENCFF028RXH%2F%40%40download%2FENCFF028RXH.hic":"31053919206,54779","www.encodeproject.org%2Ffiles%2FENCFF156GGD%2F%40%40download%2FENCFF156GGD.hic":"35284134289,54779","www.encodeproject.org%2Ffiles%2FENCFF496GEU%2F%40%40download%2FENCFF496GEU.hic":"44659660933,54779","www.encodeproject.org%2Ffiles%2FENCFF945TUH%2F%40%40download%2FENCFF945TUH.hic":"3898570191,35639","www.encodeproject.org%2Ffiles%2FENCFF698KFV%2F%40%40download%2FENCFF698KFV.hic":"4427896684,35751","www.encodeproject.org%2Ffiles%2FENCFF239BHZ%2F%40%40download%2FENCFF239BHZ.hic":"1718552021,36479","www.encodeproject.org%2Ffiles%2FENCFF277LAN%2F%40%40download%2FENCFF277LAN.hic":"4542391336,36479","www.encodeproject.org%2Ffiles%2FENCFF397CMD%2F%40%40download%2FENCFF397CMD.hic":"2832016430,36479","www.encodeproject.org%2Ffiles%2FENCFF778OYA%2F%40%40download%2FENCFF778OYA.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF775VSU%2F%40%40download%2FENCFF775VSU.hic":"14067187484,47429","www.encodeproject.org%2Ffiles%2FENCFF812THZ%2F%40%40download%2FENCFF812THZ.hic":"9667720429,36479","www.encodeproject.org%2Ffiles%2FENCFF777KBU%2F%40%40download%2FENCFF777KBU.hic":"5058284320,36479","www.encodeproject.org%2Ffiles%2FENCFF688KOY%2F%40%40download%2FENCFF688KOY.hic":"4198695833,36479","www.encodeproject.org%2Ffiles%2FENCFF223UBX%2F%40%40download%2FENCFF223UBX.hic":"1206064037,36479","www.encodeproject.org%2Ffiles%2FENCFF273XBU%2F%40%40download%2FENCFF273XBU.hic":"44085607579,54779","www.encodeproject.org%2Ffiles%2FENCFF952JZV%2F%40%40download%2FENCFF952JZV.hic":"44728845246,54779","www.encodeproject.org%2Ffiles%2FENCFF643NDM%2F%40%40download%2FENCFF643NDM.hic":"35877886780,54779","www.encodeproject.org%2Ffiles%2FENCFF586MQY%2F%40%40download%2FENCFF586MQY.hic":"71158037547,54779","www.encodeproject.org%2Ffiles%2FENCFF251VFA%2F%40%40download%2FENCFF251VFA.hic":"40089479399,54779","www.encodeproject.org%2Ffiles%2FENCFF033WGK%2F%40%40download%2FENCFF033WGK.hic":"30802023728,54779","www.encodeproject.org%2Ffiles%2FENCFF649OHR%2F%40%40download%2FENCFF649OHR.hic":"28203184265,54779","www.encodeproject.org%2Ffiles%2FENCFF782WVZ%2F%40%40download%2FENCFF782WVZ.hic":"37248221674,54779","www.encodeproject.org%2Ffiles%2FENCFF579CAR%2F%40%40download%2FENCFF579CAR.hic":"39662025395,54779","www.encodeproject.org%2Ffiles%2FENCFF514XWQ%2F%40%40download%2FENCFF514XWQ.hic":"1319613701,36479","www.encodeproject.org%2Ffiles%2FENCFF666USK%2F%40%40download%2FENCFF666USK.hic":"15051670107,32102","www.encodeproject.org%2Ffiles%2FENCFF047SDP%2F%40%40download%2FENCFF047SDP.hic":"1357076705,16438","www.encodeproject.org%2Ffiles%2FENCFF584LEP%2F%40%40download%2FENCFF584LEP.hic":"9314176858,36479","www.encodeproject.org%2Ffiles%2FENCFF671SOE%2F%40%40download%2FENCFF671SOE.hic":"3273732256,16438","www.encodeproject.org%2Ffiles%2FENCFF702LAP%2F%40%40download%2FENCFF702LAP.hic":"1800427500,31682","www.encodeproject.org%2Ffiles%2FENCFF339PON%2F%40%40download%2FENCFF339PON.hic":"5394351199,31514","www.encodeproject.org%2Ffiles%2FENCFF741QPR%2F%40%40download%2FENCFF741QPR.hic":"4271510019,30139","www.encodeproject.org%2Ffiles%2FENCFF103ANX%2F%40%40download%2FENCFF103ANX.hic":"4439745804,30083","www.encodeproject.org%2Ffiles%2FENCFF395SBC%2F%40%40download%2FENCFF395SBC.hic":"1596732351,31850","www.encodeproject.org%2Ffiles%2FENCFF289WNN%2F%40%40download%2FENCFF289WNN.hic":"8632980535,32102","www.encodeproject.org%2Ffiles%2FENCFF381EAU%2F%40%40download%2FENCFF381EAU.hic":"1702476311,36479","www.encodeproject.org%2Ffiles%2FENCFF976FEY%2F%40%40download%2FENCFF976FEY.hic":"1448279040,36479","www.encodeproject.org%2Ffiles%2FENCFF485LVS%2F%40%40download%2FENCFF485LVS.hic":"1593610856,36479","www.encodeproject.org%2Ffiles%2FENCFF143VJV%2F%40%40download%2FENCFF143VJV.hic":"1422312076,36479","www.encodeproject.org%2Ffiles%2FENCFF588NHX%2F%40%40download%2FENCFF588NHX.hic":"3943637009,36479","www.encodeproject.org%2Ffiles%2FENCFF768UBD%2F%40%40download%2FENCFF768UBD.hic":"24786676166,36479","www.encodeproject.org%2Ffiles%2FENCFF965PEE%2F%40%40download%2FENCFF965PEE.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF702IFC%2F%40%40download%2FENCFF702IFC.hic":"29387092778,47429","www.encodeproject.org%2Ffiles%2FENCFF288DNV%2F%40%40download%2FENCFF288DNV.hic":"10313429504,36479","www.encodeproject.org%2Ffiles%2FENCFF698HWZ%2F%40%40download%2FENCFF698HWZ.hic":"10962849269,47429","www.encodeproject.org%2Ffiles%2FENCFF355OWW%2F%40%40download%2FENCFF355OWW.hic":"3219571601,36479","www.encodeproject.org%2Ffiles%2FENCFF177TYX%2F%40%40download%2FENCFF177TYX.hic":"10325679706,36479","www.encodeproject.org%2Ffiles%2FENCFF542BHD%2F%40%40download%2FENCFF542BHD.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF684IFW%2F%40%40download%2FENCFF684IFW.hic":"11085397879,47429","www.encodeproject.org%2Ffiles%2FENCFF592UHE%2F%40%40download%2FENCFF592UHE.hic":"21363948089,32102","www.encodeproject.org%2Ffiles%2FENCFF779XIS%2F%40%40download%2FENCFF779XIS.hic":"9517383271,36479","www.encodeproject.org%2Ffiles%2FENCFF518PSL%2F%40%40download%2FENCFF518PSL.hic":"7500581463,36479","www.encodeproject.org%2Ffiles%2FENCFF275GBB%2F%40%40download%2FENCFF275GBB.hic":"7889407162,36479","www.encodeproject.org%2Ffiles%2FENCFF634KXI%2F%40%40download%2FENCFF634KXI.hic":"6430702966,36479","www.encodeproject.org%2Ffiles%2FENCFF337QPM%2F%40%40download%2FENCFF337QPM.hic":"8529733887,36479","www.encodeproject.org%2Ffiles%2FENCFF162KMP%2F%40%40download%2FENCFF162KMP.hic":"5615896908,36479","www.encodeproject.org%2Ffiles%2FENCFF992VTE%2F%40%40download%2FENCFF992VTE.hic":"7328975027,36479","www.encodeproject.org%2Ffiles%2FENCFF464WXY%2F%40%40download%2FENCFF464WXY.hic":"5715339664,36479","www.encodeproject.org%2Ffiles%2FENCFF752EGH%2F%40%40download%2FENCFF752EGH.hic":"1733758743,36479","www.encodeproject.org%2Ffiles%2FENCFF474UJM%2F%40%40download%2FENCFF474UJM.hic":"222309548,18679","www.encodeproject.org%2Ffiles%2FENCFF531UPZ%2F%40%40download%2FENCFF531UPZ.hic":"1827756846,36479","www.encodeproject.org%2Ffiles%2FENCFF022VHA%2F%40%40download%2FENCFF022VHA.hic":"244983451,18679","www.encodeproject.org%2Ffiles%2FENCFF732NGR%2F%40%40download%2FENCFF732NGR.hic":"1679484567,36479","www.encodeproject.org%2Ffiles%2FENCFF513VSF%2F%40%40download%2FENCFF513VSF.hic":"28397932940,36479","www.encodeproject.org%2Ffiles%2FENCFF750AOC%2F%40%40download%2FENCFF750AOC.hic":"36471430712,47429","www.encodeproject.org%2Ffiles%2FENCFF219YOB%2F%40%40download%2FENCFF219YOB.hic":"2859767211,26979","www.encodeproject.org%2Ffiles%2FENCFF604YDD%2F%40%40download%2FENCFF604YDD.hic":"3549694085,26979","www.encodeproject.org%2Ffiles%2FENCFF746AMV%2F%40%40download%2FENCFF746AMV.hic":"2954867135,26979","www.encodeproject.org%2Ffiles%2FENCFF845ZEB%2F%40%40download%2FENCFF845ZEB.hic":"2763039282,26979","www.encodeproject.org%2Ffiles%2FENCFF570LWS%2F%40%40download%2FENCFF570LWS.hic":"2861588289,26979","www.encodeproject.org%2Ffiles%2FENCFF883YVR%2F%40%40download%2FENCFF883YVR.hic":"2433679887,26979","www.encodeproject.org%2Ffiles%2FENCFF056VLK%2F%40%40download%2FENCFF056VLK.hic":"2502986910,26979","www.encodeproject.org%2Ffiles%2FENCFF532DUQ%2F%40%40download%2FENCFF532DUQ.hic":"3172615899,26979","www.encodeproject.org%2Ffiles%2FENCFF723PYJ%2F%40%40download%2FENCFF723PYJ.hic":"10292839095,36479","www.encodeproject.org%2Ffiles%2FENCFF991SGJ%2F%40%40download%2FENCFF991SGJ.hic":"13072407683,32102","www.encodeproject.org%2Ffiles%2FENCFF885UZI%2F%40%40download%2FENCFF885UZI.hic":"1201881201,16438","www.encodeproject.org%2Ffiles%2FENCFF287KXA%2F%40%40download%2FENCFF287KXA.hic":"14705801988,32102","www.encodeproject.org%2Ffiles%2FENCFF335HYI%2F%40%40download%2FENCFF335HYI.hic":"20366756545,32102","www.encodeproject.org%2Ffiles%2FENCFF121YPY%2F%40%40download%2FENCFF121YPY.hic":"2760104016,26979","www.encodeproject.org%2Ffiles%2FENCFF675SJE%2F%40%40download%2FENCFF675SJE.hic":"3751779995,26979","www.encodeproject.org%2Ffiles%2FENCFF876LAW%2F%40%40download%2FENCFF876LAW.hic":"4032376256,26979","www.encodeproject.org%2Ffiles%2FENCFF740KVX%2F%40%40download%2FENCFF740KVX.hic":"3202490322,26979","www.encodeproject.org%2Ffiles%2FENCFF977OQV%2F%40%40download%2FENCFF977OQV.hic":"2919735477,26979","www.encodeproject.org%2Ffiles%2FENCFF525EFN%2F%40%40download%2FENCFF525EFN.hic":"2394748073,26979","www.encodeproject.org%2Ffiles%2FENCFF690QRC%2F%40%40download%2FENCFF690QRC.hic":"3183023394,26979","www.encodeproject.org%2Ffiles%2FENCFF452FWS%2F%40%40download%2FENCFF452FWS.hic":"2951805127,26979","www.encodeproject.org%2Ffiles%2FENCFF089KBG%2F%40%40download%2FENCFF089KBG.hic":"2531936700,26979","www.encodeproject.org%2Ffiles%2FENCFF939ARM%2F%40%40download%2FENCFF939ARM.hic":"3066385212,26979","www.encodeproject.org%2Ffiles%2FENCFF401ZAN%2F%40%40download%2FENCFF401ZAN.hic":"3008677144,26979","www.encodeproject.org%2Ffiles%2FENCFF378RZT%2F%40%40download%2FENCFF378RZT.hic":"2830232168,26979","www.encodeproject.org%2Ffiles%2FENCFF304AVD%2F%40%40download%2FENCFF304AVD.hic":"6164439305,50358","www.encodeproject.org%2Ffiles%2FENCFF453DBX%2F%40%40download%2FENCFF453DBX.hic":"6775246670,36479","www.encodeproject.org%2Ffiles%2FENCFF590VOM%2F%40%40download%2FENCFF590VOM.hic":"6443478922,36479","www.encodeproject.org%2Ffiles%2FENCFF246DOF%2F%40%40download%2FENCFF246DOF.hic":"6837914659,36479","www.encodeproject.org%2Ffiles%2FENCFF125FXX%2F%40%40download%2FENCFF125FXX.hic":"9736232550,36479","www.encodeproject.org%2Ffiles%2FENCFF241RAY%2F%40%40download%2FENCFF241RAY.hic":"7686758397,36479","www.encodeproject.org%2Ffiles%2FENCFF415XWQ%2F%40%40download%2FENCFF415XWQ.hic":"6973092068,36479","www.encodeproject.org%2Ffiles%2FENCFF374EBH%2F%40%40download%2FENCFF374EBH.hic":"8557459058,36479","www.encodeproject.org%2Ffiles%2FENCFF263YWR%2F%40%40download%2FENCFF263YWR.hic":"331586820,18679","www.encodeproject.org%2Ffiles%2FENCFF280CGS%2F%40%40download%2FENCFF280CGS.hic":"1743569614,36479","www.encodeproject.org%2Ffiles%2FENCFF553ZNS%2F%40%40download%2FENCFF553ZNS.hic":"1717253636,36479","www.encodeproject.org%2Ffiles%2FENCFF451VOI%2F%40%40download%2FENCFF451VOI.hic":"1626927468,36479","www.encodeproject.org%2Ffiles%2FENCFF420MQO%2F%40%40download%2FENCFF420MQO.hic":"31055961677,36479","www.encodeproject.org%2Ffiles%2FENCFF301BWY%2F%40%40download%2FENCFF301BWY.hic":"38902429246,47429","www.encodeproject.org%2Ffiles%2FENCFF606XNW%2F%40%40download%2FENCFF606XNW.hic":"1009699327,36479","www.encodeproject.org%2Ffiles%2FENCFF439ZOU%2F%40%40download%2FENCFF439ZOU.hic":"12381714313,36479","www.encodeproject.org%2Ffiles%2FENCFF499SYK%2F%40%40download%2FENCFF499SYK.hic":"13182654663,47429","www.encodeproject.org%2Ffiles%2FENCFF532LFI%2F%40%40download%2FENCFF532LFI.hic":"8286030286,36479","www.encodeproject.org%2Ffiles%2FENCFF020DPP%2F%40%40download%2FENCFF020DPP.hic":"23521952420,47429","www.encodeproject.org%2Ffiles%2FENCFF306VTV%2F%40%40download%2FENCFF306VTV.hic":"23521952480,47429","www.encodeproject.org%2Ffiles%2FENCFF399IHE%2F%40%40download%2FENCFF399IHE.hic":"10216571232,36479","www.encodeproject.org%2Ffiles%2FENCFF944AII%2F%40%40download%2FENCFF944AII.hic":"12567308552,47429","www.encodeproject.org%2Ffiles%2FENCFF230HVV%2F%40%40download%2FENCFF230HVV.hic":"8629849711,36479","www.encodeproject.org%2Ffiles%2FENCFF174LAF%2F%40%40download%2FENCFF174LAF.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF898HRO%2F%40%40download%2FENCFF898HRO.hic":"9446506633,47429","www.encodeproject.org%2Ffiles%2FENCFF429MOR%2F%40%40download%2FENCFF429MOR.hic":"1455757398,36479","www.encodeproject.org%2Ffiles%2FENCFF061NXV%2F%40%40download%2FENCFF061NXV.hic":"1710915891,36479","www.encodeproject.org%2Ffiles%2FENCFF434PYS%2F%40%40download%2FENCFF434PYS.hic":"1832274903,36479","www.encodeproject.org%2Ffiles%2FENCFF704HHX%2F%40%40download%2FENCFF704HHX.hic":"1768142834,36479","www.encodeproject.org%2Ffiles%2FENCFF349DPM%2F%40%40download%2FENCFF349DPM.hic":"4316041260,36479","www.encodeproject.org%2Ffiles%2FENCFF718AWL%2F%40%40download%2FENCFF718AWL.hic":"39544267907,58932","www.encodeproject.org%2Ffiles%2FENCFF065LSP%2F%40%40download%2FENCFF065LSP.hic":"24929805283,55874","www.encodeproject.org%2Ffiles%2FENCFF632MFV%2F%40%40download%2FENCFF632MFV.hic":"22333105467,55798","www.encodeproject.org%2Ffiles%2FENCFF179HVU%2F%40%40download%2FENCFF179HVU.hic":"2659219603,36479","www.encodeproject.org%2Ffiles%2FENCFF791SPZ%2F%40%40download%2FENCFF791SPZ.hic":"2537491657,36479","www.encodeproject.org%2Ffiles%2FENCFF211ZWF%2F%40%40download%2FENCFF211ZWF.hic":"3512141227,36479","www.encodeproject.org%2Ffiles%2FENCFF614BNU%2F%40%40download%2FENCFF614BNU.hic":"5252155462,36479","www.encodeproject.org%2Ffiles%2FENCFF891DLM%2F%40%40download%2FENCFF891DLM.hic":"2549095612,36479","www.encodeproject.org%2Ffiles%2FENCFF056EXT%2F%40%40download%2FENCFF056EXT.hic":"2219014704,36479","www.encodeproject.org%2Ffiles%2FENCFF776DSS%2F%40%40download%2FENCFF776DSS.hic":"3920308353,36479","www.encodeproject.org%2Ffiles%2FENCFF814LQF%2F%40%40download%2FENCFF814LQF.hic":"1349480197,36479","www.encodeproject.org%2Ffiles%2FENCFF513ZNA%2F%40%40download%2FENCFF513ZNA.hic":"2638868195,36479","www.encodeproject.org%2Ffiles%2FENCFF692IOL%2F%40%40download%2FENCFF692IOL.hic":"3106768498,36479","www.encodeproject.org%2Ffiles%2FENCFF294WZY%2F%40%40download%2FENCFF294WZY.hic":"2211089761,36479","www.encodeproject.org%2Ffiles%2FENCFF339UWS%2F%40%40download%2FENCFF339UWS.hic":"2142759055,36479","www.encodeproject.org%2Ffiles%2FENCFF835FSK%2F%40%40download%2FENCFF835FSK.hic":"3919821739,36479","www.encodeproject.org%2Ffiles%2FENCFF328BMB%2F%40%40download%2FENCFF328BMB.hic":"2550686152,36479","www.encodeproject.org%2Ffiles%2FENCFF897RTY%2F%40%40download%2FENCFF897RTY.hic":"1323294397,36479","www.encodeproject.org%2Ffiles%2FENCFF306MWH%2F%40%40download%2FENCFF306MWH.hic":"1665386199,36479","www.encodeproject.org%2Ffiles%2FENCFF039YUJ%2F%40%40download%2FENCFF039YUJ.hic":"2335679939,36479","www.encodeproject.org%2Ffiles%2FENCFF468QIN%2F%40%40download%2FENCFF468QIN.hic":"3352516594,36479","www.encodeproject.org%2Ffiles%2FENCFF364WXU%2F%40%40download%2FENCFF364WXU.hic":"3959043175,36479","www.encodeproject.org%2Ffiles%2FENCFF373MSH%2F%40%40download%2FENCFF373MSH.hic":"4429550624,36479","www.encodeproject.org%2Ffiles%2FENCFF959EGQ%2F%40%40download%2FENCFF959EGQ.hic":"2475218228,36479","www.encodeproject.org%2Ffiles%2FENCFF624XMK%2F%40%40download%2FENCFF624XMK.hic":"3527855681,36479","www.encodeproject.org%2Ffiles%2FENCFF445OKS%2F%40%40download%2FENCFF445OKS.hic":"3369125589,36479","www.encodeproject.org%2Ffiles%2FENCFF239QDV%2F%40%40download%2FENCFF239QDV.hic":"1960069888,36479","www.encodeproject.org%2Ffiles%2FENCFF645AVM%2F%40%40download%2FENCFF645AVM.hic":"4969006589,36479","www.encodeproject.org%2Ffiles%2FENCFF494IPI%2F%40%40download%2FENCFF494IPI.hic":"1565483792,36479","www.encodeproject.org%2Ffiles%2FENCFF753IXE%2F%40%40download%2FENCFF753IXE.hic":"2892400648,36479","www.encodeproject.org%2Ffiles%2FENCFF731GXX%2F%40%40download%2FENCFF731GXX.hic":"5131381303,36479","www.encodeproject.org%2Ffiles%2FENCFF369CAQ%2F%40%40download%2FENCFF369CAQ.hic":"4236629448,36479","www.encodeproject.org%2Ffiles%2FENCFF053VBX%2F%40%40download%2FENCFF053VBX.hic":"54305946375,47429","www.encodeproject.org%2Ffiles%2FENCFF555ISR%2F%40%40download%2FENCFF555ISR.hic":"54305946434,47429","www.encodeproject.org%2Ffiles%2FENCFF964RSP%2F%40%40download%2FENCFF964RSP.hic":"12065485229,36479","www.encodeproject.org%2Ffiles%2FENCFF234MZQ%2F%40%40download%2FENCFF234MZQ.hic":"17507142760,47429","www.encodeproject.org%2Ffiles%2FENCFF994CEG%2F%40%40download%2FENCFF994CEG.hic":"17507142760,47429","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb068e787-bbdd-49e2-9f6d-7a0e9f065d6e%2F4DNFIHSUIRFY.hic":"2701182442,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3768b89a-e124-40eb-8acd-94a4fdd35807%2F4DNFIXTAS6EE.hic":"3283740601,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9c513602-5abb-4088-8415-c827c381ab0d%2F4DNFIC3JD6O2.hic":"4896075767,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde954dad-1849-4c23-beb4-bf893b7d76c9%2F4DNFIGY85S4W.hic":"3364151996,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe1befa6e-8067-4296-8db2-67d2a2458985%2F4DNFI2LTNXME.hic":"3699291418,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbb3307fd-7162-477a-87c5-52f12d03befc%2F4DNFID162B9J.hic":"3576428773,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8597cdae-8319-42d9-9175-3f77aaee34e1%2F4DNFIQWS3632.hic":"4022561190,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F327f091d-6a63-47c4-9752-2dff303a13d9%2F4DNFI6GFHB6G.hic":"4239331168,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd70dc3b8-48a7-42c2-bd23-80bc44fc2266%2F4DNFIS5F6EBL.hic":"4404671861,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77df7bf8-6a3d-407a-8968-4ca1e78d2269%2F4DNFIF2D3TL9.hic":"4793989394,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8f7cc35-d2ef-4717-9009-c02154050fbf%2F4DNFI6EIFUZI.hic":"3370273763,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F98449d79-30d1-4e32-801d-07435819a42f%2F4DNFIRKGMZRQ.hic":"4669813207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd4fe1844-2493-4722-8b98-34a93a4bb7d8%2F4DNFIQWD8ZYD.hic":"5379889057,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1ee40499-1de4-47ff-b540-d9a65943c6b8%2F4DNFIX7H3CE2.hic":"4857679239,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac016170-23a7-4111-8773-353d6c150f34%2F4DNFIO21YDCV.hic":"4695989644,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1faea4e7-9a32-466e-a826-0bfdab6cd915%2F4DNFIUE5RAS6.hic":"4788044799,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcbd396ed-11bb-404f-aed9-ef10abc258e6%2F4DNFIFI6NIKJ.hic":"2069414927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3f78db-ae92-4215-bcae-76d30c617e5d%2F4DNFIL5K3MA1.hic":"2585598247,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66fc2893-224e-48b4-bdb0-25e022dedd03%2F4DNFIPV5KFMK.hic":"2060965679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2b39781d-aadc-434f-abe3-562d61308fdd%2F4DNFIW8TIFI5.hic":"1694424195,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6d28f7b-27d3-486f-b5ac-32567416560d%2F4DNFIA6NSSBJ.hic":"2219532611,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F08785616-722e-46bb-ade2-2fdd21324e11%2F4DNFIBKZK63V.hic":"2429136232,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F904b13d3-1203-42a4-812c-963e80c159b1%2F4DNFI3CFMRID.hic":"1233390166,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0ed4afe-5ecf-451d-bb1f-444697e3f558%2F4DNFIYIAUEPW.hic":"1753567534,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4bb9a9b3-12a8-4d2f-8071-4722294c88ea%2F4DNFIC3HAU11.hic":"2271375254,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5abf9c36-c1d1-44dc-8197-74d860d896c0%2F4DNFIM2BMJ33.hic":"1770471113,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa68475db-7816-4cec-b2da-d4ce4a0c7a0e%2F4DNFIBY3UHJB.hic":"2095528423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07c40943-0d0b-4b3e-94a0-8583b0e00b47%2F4DNFIWZEN3FF.hic":"1558559508,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8a39553-2718-4866-9b2a-45d8e9c5ac6f%2F4DNFIE5TEYK7.hic":"1323063102,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294b61ef-5565-4f04-ade9-f921a6686cce%2F4DNFI7H4II2V.hic":"1436947982,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a70ad7-7d34-4302-9c03-eb824bd4e633%2F4DNFIAS8LV1C.hic":"1263105698,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9db804c6-5a91-4cf5-8ae9-e054223afb77%2F4DNFIBXWIH8J.hic":"1587059951,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd1e55906-ec8f-444b-8ce1-2de22a431a76%2F4DNFIO2HBDAI.hic":"1666436393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a4b9b37-8e38-470c-8190-fd4d513c0bbb%2F4DNFIXWCLD4M.hic":"1513511880,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7615b2-5310-4bbf-a605-98761d3a3079%2F4DNFINASC4NQ.hic":"1420358914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F20454014-49cd-4e2d-93da-f40ad52776d5%2F4DNFIZF1KI43.hic":"1377041630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5df04e86-ee2a-45f2-b878-bf1648e2cca5%2F4DNFIQBHR9XC.hic":"1179502734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1cc910-bb3f-4106-802a-73184c58d5ba%2F4DNFIQVMVRP6.hic":"1811976991,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe431986b-0732-460f-92ff-0abd1694d2d0%2F4DNFIJ7OAIFQ.hic":"1685503856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56d0c575-4962-4ea3-92c3-55bd0e17c096%2F4DNFIE8E4ANZ.hic":"1598369564,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb1502fb-a989-4ef9-b800-7eaa7be172ae%2F4DNFIOUSETUP.hic":"1493294709,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Facc2f1c3-8c96-4d21-814a-3a8ba81e7741%2F4DNFIVJ3IIQL.hic":"1472376655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F037fb4c3-8641-4953-a977-cc71f2137582%2F4DNFIHN2QSMX.hic":"1179632606,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16d2c3c0-6d29-4815-b074-b142af90b615%2F4DNFIILDWK8M.hic":"2280059989,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31789849-e4db-45d8-9730-66a048c02d8a%2F4DNFI6XD6JAQ.hic":"2253961696,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fff04947e-e6e8-4d62-8374-ef2ee4104809%2F4DNFIALNLR78.hic":"1914687914,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F53e6c1e7-9410-4158-84e6-57c2e683b095%2F4DNFIBT4EAKN.hic":"2296378356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0127900a-258f-4815-97d2-6fd2b043d853%2F4DNFIDJ2JZ7Q.hic":"2558945393,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F89f95693-3d28-44eb-9d45-14932f8e258c%2F4DNFI8JFOAJT.hic":"1726440253,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd803d818-b0d4-4796-8d61-a9f3943f3b10%2F4DNFIRZA6EV6.hic":"1805017504,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff9165fb1-0782-4757-a740-5b929e0252bb%2F4DNFIB7QTIMH.hic":"2541020707,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8d916b2-b58e-4cdf-894c-ffcb3bf6ebd9%2F4DNFIJ5DQZVK.hic":"2445734043,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14066a5b-e01a-43c2-a468-b18826174df3%2F4DNFISTWNV9C.hic":"2499319890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd0692151-7f9a-4475-b059-f8802616dded%2F4DNFIBN9K4V9.hic":"1591570769,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70a7ef36-a514-4e45-918f-47c4e9e30ef4%2F4DNFIR8OU6QJ.hic":"1689882108,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F180306cd-8593-413a-ae83-24f19209c5d2%2F4DNFIDSWKFF5.hic":"1596696630,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e7b9be7-f465-4434-8e9c-68d1e44a76af%2F4DNFIV239W4L.hic":"2345867406,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F55df948c-941d-4930-854c-6a07557a0c1d%2F4DNFIREVU1Z5.hic":"2254683002,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f590cb7-df3a-498f-81c3-d5ed4179b8ad%2F4DNFIFHU75I5.hic":"2497670883,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8f064770-6008-4f74-bfca-268d4a22d745%2F4DNFIMROE6N4.hic":"9850583704,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa93d0588-76b7-4ccf-933c-4325876b0a53%2F4DNFI5SUHCGZ.hic":"10364705187,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f5f0d6b-0b22-4936-93c9-0944d49c037b%2F4DNFII84FBKM.hic":"8836986129,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12e90fc5-0b76-4e42-b346-58d267f9ad6e%2F4DNFI2J1ODWB.hic":"13410858286,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2702a45-3e8b-4980-bcd5-6bb0e291614f%2F4DNFIJWBWE41.hic":"20515676755,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa0859349-5f06-4ad3-b56f-b1166b34a9eb%2F4DNFIIMZB6Y9.hic":"15350325963,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F12685c57-d54a-46fa-9efb-acf34ed77574%2F4DNFICJECID5.hic":"1525002266,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd101a58e-89aa-44fd-96c5-6bf1e2476272%2F4DNFIR6UW2QA.hic":"1264999913,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8c73bf-1335-4af4-b124-e3622d48c5f6%2F4DNFIGOEKBUZ.hic":"1905947578,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcd2477cf-6ed0-4d7b-b4e9-88fb38b0df48%2F4DNFIMDNAEW4.hic":"996444147,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0f03953e-29da-4f2e-8c05-572d0edf4525%2F4DNFI5OSZ3JC.hic":"369361754,22829","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F29d95dbb-005a-4ae1-8b9c-0fec9ec0bbd0%2F4DNFI7KOUGFM.hic":"1227434049,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa441ab7b-afbe-437d-bf98-b6b916558642%2F4DNFIGKX4A32.hic":"883933242,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F941b2f94-2fff-4d3c-aceb-fee4a5ae41a9%2F4DNFI1ORHOTA.hic":"1140970677,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8720ede9-093f-4c00-912f-373283260a16%2F4DNFIWSVLZED.hic":"458091151,26979","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9e17155-2b62-4a68-afb2-31dfa674e169%2F4DNFI6H926RO.hic":"3552863515,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F22f22778-987a-4dc0-97bc-f26eae0156d9%2F4DNFIKTYSPOF.hic":"2939475400,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40f40192-0acb-44cb-8778-8d21afe593fb%2F4DNFIZ4S52BV.hic":"3067438113,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd8767374-7018-4e11-9226-bf5612d39ebb%2F4DNFI3APMXHF.hic":"3258874744,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c5140ec-a65a-4186-8c59-2927233eecaa%2F4DNFIQLIKDSD.hic":"2746398416,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8cdedda6-d7d8-4231-a85b-d56fcd962366%2F4DNFIKYXMF1E.hic":"14442148774,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa4d4497-7c6c-4dad-8040-be13ba07ea32%2F4DNFI9815EEJ.hic":"17960817603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9b7b95f-190b-49fe-8047-ef4a8fc59746%2F4DNFIQ2687RT.hic":"15954277087,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F59863d3a-8d7c-49c7-9a41-7f2a58ad24d1%2F4DNFIYDBBSE3.hic":"16499534862,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e80ca41-b3e0-4f4f-a05e-8f95fe96d938%2F4DNFIMOCN1YS.hic":"863725312,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F96f97a01-0020-4f09-93e8-fc8a9fd07218%2F4DNFI6558CM8.hic":"1597967345,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fce9e9334-ee0b-4549-a845-110470ba5986%2F4DNFIQZRKS7Y.hic":"907626411,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaac8209-1015-48da-9e31-2e252dfd8fe0%2F4DNFIX4DLXSE.hic":"1369766288,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F268b7d52-9655-474c-9467-8ba31bb2195c%2F4DNFII3JV8I1.hic":"856656441,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9681f9b5-335a-4f56-afa1-15b58bbb41e8%2F4DNFI5IAH9H1.hic":"1495185175,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3e082eab-95aa-4677-88ed-9d7adcc1effb%2F4DNFIK5HY1GP.hic":"2135337789,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31af1ead-4520-4669-957e-424b4b197c33%2F4DNFIFA89L5B.hic":"1975593640,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcc2b78fd-52d4-4e0c-ac93-b84ee82daf7e%2F4DNFICXCFGEI.hic":"2628202920,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff54efece-280f-46ca-95e3-1f8a3cd18820%2F4DNFIK4CECUH.hic":"1901129375,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1181c0c4-afb7-4b6a-9fdc-d868fb2253fc%2F4DNFI1EYIGOC.hic":"1947135384,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1d3e2905-b9b9-4b91-bcb4-8d34746e78f6%2F4DNFI7TLEWUI.hic":"1185758726,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faba3d42f-39cd-4a85-9d3f-835aefb5c803%2F4DNFIVCJKHMN.hic":"687240974,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F27f54fcb-54fe-41a4-b25a-2f8944c89044%2F4DNFIN8F14CS.hic":"1304082029,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb75fedb5-88f4-4bc0-8e38-298df7847a7f%2F4DNFI5LCW273.hic":"12497258313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2f22b2a0-3712-496e-92d2-63775ec0e421%2F4DNFIVSCH2CH.hic":"12594733778,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F07e47261-5863-44f5-9198-76e263081bea%2F4DNFIZ268JGC.hic":"1499059135,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F682b1ae1-3ac3-40e4-a330-c49f63946952%2F4DNFIJ1P4HBI.hic":"1190211725,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F197e7c89-ea73-41de-8cb2-8c0b1e3bb945%2F4DNFITEGKBIW.hic":"2061501971,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F191f6928-c9a8-44b2-8516-ee4d6005f24b%2F4DNFIE1P6RVH.hic":"1711447310,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F94435086-3701-4b28-a6d0-4a59b24d7615%2F4DNFICJ6I4DO.hic":"1557899940,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa9ac173-d233-41c7-8985-ca91949664e4%2F4DNFIKUG8MEW.hic":"1339072088,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fba6d8ab6-ee18-4ba2-8da9-d631888dd50a%2F4DNFICFZGFAV.hic":"1261083478,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87a3ab04-7094-4673-81e4-ac8c9add8eb5%2F4DNFIQXCZVVA.hic":"1084913802,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc1ff488-82af-4579-9424-959184edb139%2F4DNFIB6PJFJ3.hic":"1114571343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f7026ee-987a-41e7-8a61-45510ee3f86b%2F4DNFIX97731O.hic":"1246860402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6186787c-2e72-4925-9729-02121e2e4597%2F4DNFIYQYZOTO.hic":"1212210849,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b98a946-0109-4efa-a13e-cc7a36772125%2F4DNFIPXU7V25.hic":"1696288217,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fea17d041-c6ed-43a1-8047-535f3d19ad44%2F4DNFIL39PR76.hic":"1719284710,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72774afe-f166-42ac-9849-4070b0dadf6d%2F4DNFIYLJ3R3B.hic":"1106419640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a45e733-55f8-4a8e-be24-2ef34c976e25%2F4DNFIL51WBN6.hic":"1327651164,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F086c62b0-a26f-41ae-a5ff-88b8be2bd2aa%2F4DNFI6SFPUDA.hic":"1336964405,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4d9b79c7-af62-4070-84a9-b953903f2732%2F4DNFI2KM22QR.hic":"953067310,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c9889d1-f49e-4639-8e15-2d99d6cd22e7%2F4DNFIVF8Q45U.hic":"984193565,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa080dd7b-b7bb-4eae-a275-572a8b45b2d0%2F4DNFI2RN3WFP.hic":"1046525527,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb81860ca-c227-4b68-a298-1907fd32300a%2F4DNFI4TJTL7A.hic":"1160373401,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F74ab47dc-7b52-421c-845e-6feb33457adf%2F4DNFIYJ4TWB8.hic":"1268416204,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc6582128-a930-4bcc-941e-5c0733bdd4d5%2F4DNFIM6RGKPV.hic":"863347067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11a75514-4450-4295-9eda-18e3678a575a%2F4DNFIL2VWWL5.hic":"860731581,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5eb52a8c-bf14-4225-bf34-14a0aa47c369%2F4DNFIX6ZXCA8.hic":"893462267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66aaa4c0-1f62-4040-8ecc-4e95da23cd18%2F4DNFIEVR81FS.hic":"879736207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F821c6e7f-96f7-47de-b7d9-4970562b3c8e%2F4DNFIAUI6BBI.hic":"996313881,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9252c362-31ab-413d-a47a-cc97bdbf243a%2F4DNFIAFEE9G2.hic":"1103265750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc1a0bf52-2e65-4deb-871f-ede736babd41%2F4DNFIPZBEXCP.hic":"1081257762,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F729f5ce3-d7e0-466d-b781-d18049e63bfa%2F4DNFIWPKRZGU.hic":"973779283,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80b769ee-a717-4825-9db0-dca86f913173%2F4DNFIMD9QNDX.hic":"1158688208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F266290c0-2767-4158-85ab-7274368905b9%2F4DNFIATA1HD5.hic":"1073361089,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc46f18a8-eb24-4d35-b112-36db72bde2f5%2F4DNFIH9U4I7I.hic":"1111124316,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fec91a79e-7de7-49f7-9b3d-d28313aeddc8%2F4DNFIZ95S6TR.hic":"1242494051,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e9390b9-da20-43bb-a8f4-9830f354ddf9%2F4DNFI5ERM9J7.hic":"1271051397,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee8ea82e-b9e4-41ad-bced-5f4fbdaa4fec%2F4DNFI15FPSQL.hic":"1216714120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbed7eb86-8990-42f2-b3ee-5992d6361f7c%2F4DNFIJ3DZPGM.hic":"1035089437,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdaa8a324-3bf8-424c-8a86-b8ad325cc20d%2F4DNFINW9P6XF.hic":"1215712740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70631758-6bf8-47a0-92b6-132574886faa%2F4DNFITS16HW8.hic":"1105283847,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe473304b-7bc8-49b8-bba1-ecb9f06914ee%2F4DNFIS3DIH4V.hic":"1036056660,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F10f9224a-111c-402a-ac25-e221ad0af9ef%2F4DNFIY3KDHP6.hic":"1071761024,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17519b96-2bdd-4294-98f0-1535f1aef28e%2F4DNFIO8HVKOL.hic":"953793750,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb18f896-4730-4909-86a3-867fc8e76cd6%2F4DNFIMF6CFOM.hic":"708717889,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcfee4d87-0873-40b0-b79f-35dcc8669c1c%2F4DNFIZZ77KD2.hic":"732668723,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8b5d909-8a1b-41bb-bcdd-d108a0bde762%2F4DNFIOLO226X.hic":"951271932,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ce81f6e-b9cf-4ec9-8bd3-517539e4b662%2F4DNFIJMS2ODT.hic":"932509067,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F506aa952-5d41-49ff-b658-916bcf88a395%2F4DNFI49F3LJ4.hic":"1208494817,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4dc392d-ca36-4bdf-a27d-173cae34f520%2F4DNFI65MQOIJ.hic":"854630155,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F149ef8d7-e0b4-4e4f-b7e5-7226e2603746%2F4DNFIM4KEPRD.hic":"882790622,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa436f0a8-4f9a-4524-90ac-795c5b8491cf%2F4DNFIIXBIZFC.hic":"848244425,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbc8a05dc-7449-4b01-8330-a55db37ca8e6%2F4DNFIWDOOBVE.hic":"1116239020,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faef8b881-28fe-4694-9a95-1d31940e6726%2F4DNFIDT9EB5M.hic":"888289053,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff66f3162-a53d-46f2-8800-3752935d5400%2F4DNFIX2VUNV8.hic":"1226661451,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F36c782e6-2c48-4298-aa43-bd6624da003d%2F4DNFIEQHTV1R.hic":"804665819,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff15d571e-605d-4bcc-a359-0350b57a6815%2F4DNFIFW7GA64.hic":"901568712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2aa2e8b-ac7f-4acb-b4b5-ac5f845840fe%2F4DNFIXGXD67I.hic":"970995551,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F71b6fd7d-b249-4d65-a597-b80b95845399%2F4DNFIA7GB1NB.hic":"956785837,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cbb1418-34db-427f-9273-5174eac81529%2F4DNFIVOJGWNP.hic":"890415052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc69c2ee7-b6c3-4a62-8d4f-913491c9dab8%2F4DNFIW22BNB5.hic":"1075499540,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa268f28f-c6d9-4324-8989-75d2d317af1b%2F4DNFIIFBC8WN.hic":"1045459440,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c7361d4-60a6-440b-b5be-072cada98663%2F4DNFI9ZBEBJH.hic":"759395398,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcceaad1a-e01e-4430-8bd6-24ffa6891802%2F4DNFID4SLU53.hic":"921288444,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9eee5854-b33e-4d5a-9ba8-ceffd47e7488%2F4DNFIODI1NUJ.hic":"733159777,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5e1089b0-42e8-441c-99bb-4be99bcec28b%2F4DNFIJL26LFN.hic":"723567970,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F298a429e-ea29-49d3-bfed-fa851e1e7c4c%2F4DNFI5KTF553.hic":"2213661745,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F965d29f0-e4a3-477c-8ae4-faf4a654e69a%2F4DNFIYSPGFGV.hic":"2274989349,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd88acbc1-37b9-4266-9f97-d8fed576d0f3%2F4DNFILOR6D2D.hic":"2595459358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7b6ddbce-0ed1-4272-b8ae-32793e4ea4e4%2F4DNFI1WMMPJQ.hic":"2262433890,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fedc0c8c4-97d8-4372-9a4f-5e0cdf09d7d0%2F4DNFI47P5978.hic":"2146314403,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0edcc389-43a4-44d7-b946-fe3496f93d56%2F4DNFI7XGW6IH.hic":"2302805723,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0a802926-e235-4c80-b521-83a1774dfb46%2F4DNFIK1EJG8I.hic":"2374943035,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3c36aedb-6a58-4aa2-9b11-bb440ec174f1%2F4DNFIDQ3THN9.hic":"2341188249,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F846123cd-8828-4e51-8b8a-27deaf293858%2F4DNFI3WPNFWT.hic":"775145629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd06e3ad-0e37-48a3-8367-c7d5912cab03%2F4DNFI9DCUOQ1.hic":"870487824,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc2eaf9bf-9584-4cec-8685-bd74038a6c01%2F4DNFIU8AF5ZY.hic":"1276224366,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F219497b5-3f35-473b-9d4e-e1cf21c69561%2F4DNFIHW8NTQX.hic":"28864787856,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4be13558-114a-4f2d-abca-7598e2ff4757%2F4DNFI4OUMWZ8.hic":"17061013588,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49aed637-87a1-4d4d-ae68-e5da82aec05b%2F4DNFIEYQ5ZIR.hic":"13555272651,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa2f48779-4eff-44a6-8a9d-96435aca1ddc%2F4DNFIDZT7PR8.hic":"13425047093,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6ec6b71-27b8-4891-b10a-ab06a5270468%2F4DNFIEJEFCAM.hic":"15394960208,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F68b9a7b5-8413-44fc-8c2d-59a67b1c4166%2F4DNFIJ8JKKWJ.hic":"17012681779,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F294d45a4-8b5e-456f-a9cb-1cbbbad3a7d2%2F4DNFINEQY95T.hic":"13966775978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd7f3a48-b822-41e2-bd9c-f52b3aff7b6a%2F4DNFII6AN691.hic":"12367300362,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7da44594-0dc8-4e74-8e10-a957aeaea51a%2F4DNFIDBIEXI7.hic":"2015474981,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F085a0453-3784-4eba-80b2-3556e53e2f52%2F4DNFIDKJFK2S.hic":"1983111659,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc370c78c-0a99-4c3f-a29b-2dfafc6a3e86%2F4DNFIPAF4PYT.hic":"3041434294,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F907ce45f-baa5-416d-92de-e86db4bacff1%2F4DNFIWIYYNQ5.hic":"7082321112,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff13afc6b-cf69-4c9d-881f-eed4dd3c28ee%2F4DNFIHMCILEN.hic":"1739157603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7575d891-0e3d-4a77-896a-3e1b3a8d330b%2F4DNFIJBJ6QVH.hic":"5213499748,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0daa830-60d5-4c7c-a2e1-a4ee70b3fee7%2F4DNFIH2A7IKF.hic":"4099503507,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4970a25-91d8-49a7-9a4a-fe0f12cb2b0f%2F4DNFIOL8KGQ2.hic":"2256042055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879f1850-d175-4a86-8a97-12658482e3d1%2F4DNFIWILLD6C.hic":"5476286356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F787f538e-d619-4c8f-985b-78753fb7e57c%2F4DNFIZBXXJAF.hic":"5946467856,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8ee785f-1016-4989-9e64-78352621d32f%2F4DNFI8PZOJHN.hic":"8307204961,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d8997fa-528c-4531-b25b-a412de6bd472%2F4DNFIGXAMSJY.hic":"6577588285,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87aede55-7610-4283-af0e-c6840429a31e%2F4DNFIWNNO89O.hic":"2871061417,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93b8e020-b337-4685-81dc-40cc8a12b5e9%2F4DNFIXU2KPNQ.hic":"3401717686,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffb5cf1bd-59d6-46fe-857d-b86d9756029d%2F4DNFIHBGD6N6.hic":"840028421,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2d1bc088-d838-49b8-85fc-fea78a7353c4%2F4DNFI7J8NI4A.hic":"675705256,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a27b63-fd67-401b-9aa2-2798e6588d21%2F4DNFISFM9VFK.hic":"800145922,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F656c0a9d-7058-4c4b-a3ce-701d929561c1%2F4DNFIJU5XBK7.hic":"966593603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2efacfbd-9c81-4e62-8df7-847d1ab774d5%2F4DNFIPKY8ED1.hic":"3401629450,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa50b6a26-56b5-43f2-b525-fa219fd716f1%2F4DNFIQRTP7NM.hic":"5358852759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5dc7a59-b998-4490-8a76-afbf3b258a49%2F4DNFIBCIA62Q.hic":"5779049277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62b2b237-cb02-45f7-89d9-616cf9ffb678%2F4DNFIV56OFE3.hic":"5818844506,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ac79b4f-cfbf-4b2a-9fc2-898ed6c3e5e1%2F4DNFILIM6FDL.hic":"19637469163,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cff8afa-5a13-4ad4-bcad-91fc3ced759c%2F4DNFIP71EWXC.hic":"17934647326,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F000789fe-9a22-4280-a71c-7ad228fd4cac%2F4DNFIM7ZVQOQ.hic":"700134697,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8d78457f-0c2b-4358-b08c-4d4ef4d9f59d%2F4DNFIS6EYHCX.hic":"628314484,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ca3b4a0-2478-49c9-b4a2-a28430417a32%2F4DNFIKKCMS1Q.hic":"584050634,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff5041473-18ec-439d-92b1-8ad98c9b25c0%2F4DNFIBIV8OUN.hic":"522632731,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcf474ec6-abd4-431e-a21c-252fcf5ee6b3%2F4DNFIAUMRM2S.hic":"313395531,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bb1c73e-fb0f-41c4-8620-a938cc8d24a0%2F4DNFI9ZUXG61.hic":"332217525,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F26dfa41e-7e4f-457a-a3ac-72daf8059f3c%2F4DNFIDBFENL7.hic":"359604894,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8ed2e68b-189e-4988-bb6d-94e63240a231%2F4DNFI7XAZNNQ.hic":"5312422266,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6f2b1ce0-5205-4680-981e-d91b694dc3e4%2F4DNFISNGDB53.hic":"2008546759,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F73c8147f-bc7d-4d33-8a10-a9e7b413ecc6%2F4DNFI1CIGHYC.hic":"2221847625,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F526ae3e3-32cc-4670-970f-1faa9cfafd4d%2F4DNFIQD2DP2F.hic":"5295591503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6e803530-47f8-4c56-bb19-fbdcd578d2f0%2F4DNFINHT8P7C.hic":"3159499486,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe705f38-903f-47b7-9b38-f80ebd18a479%2F4DNFIGF8EM7M.hic":"3490552542,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa197328-d6da-4299-a0fd-409ac9892668%2F4DNFIUPG2ZBJ.hic":"5382003751,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffe5d52c4-2be7-4812-bca0-cd4bb3025e6b%2F4DNFIH3OTR14.hic":"3224693110,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21935f61-daa8-4df2-aa69-fcd27953b405%2F4DNFIUATRW3Z.hic":"3835865655,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72147527-e3e8-4967-bc45-8251249d76c9%2F4DNFI6V7ZQAE.hic":"4382708138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F589f0919-f54d-49ff-a482-e2f453ef7f34%2F4DNFICKMT1CY.hic":"4479068191,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F861946ca-bad8-4a87-96e1-b2eb20b9ef10%2F4DNFIF9BDCNI.hic":"3698151402,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff76346ac-97ec-4893-8984-2b75ce1cdc51%2F4DNFIG5O1OQS.hic":"5704288175,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe8b43826-f049-4c3f-b83a-e75fa7aacc85%2F4DNFIHS2SVBQ.hic":"990025510,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46316260-f555-4dd4-9e40-8ae06ca52822%2F4DNFIU95B69H.hic":"1275878544,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff62ef491-a3ae-4f66-ab33-c5673c9e0b65%2F4DNFIYRROFCR.hic":"1522530503,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1cd617e1-fad4-4fdc-8b4e-cb277650123c%2F4DNFIF7JN3IU.hic":"1463443128,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb20fe2a-0078-4d4a-8a52-d76043d06f40%2F4DNFIB2RYULQ.hic":"1269529700,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d386fcf-1d22-47de-a0d6-0c3a641ca174%2F4DNFIMVDK3SI.hic":"1185489599,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F00e470bd-c533-41b1-923a-4b471824da12%2F4DNFIRLOTXSC.hic":"978217499,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb8774fb3-d0c5-43cc-a6c9-eb0ca39841fb%2F4DNFIZAPX6J8.hic":"1100356082,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fab3b826e-614c-448b-860f-a3ebef68a82f%2F4DNFIQD5VCSD.hic":"1322319877,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F66c78d2b-993a-4937-95ed-9e2d302ceb3e%2F4DNFIIF6VAGN.hic":"868885799,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5d106fe1-2d80-466e-87aa-46b38ba142c5%2F4DNFI86IEZXH.hic":"751443267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc99490b6-faf9-413f-9c38-3f53018089d6%2F4DNFIP881SR2.hic":"754427927,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F39c7e387-e710-4b1d-b757-357dec03f6ad%2F4DNFI42NNCW8.hic":"1166392978,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4742a211-43b1-4325-af6f-82490aeb766b%2F4DNFIEV4PKP6.hic":"1102227476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaa73842-1c86-4ad9-8a9e-c189c0b4c01d%2F4DNFIF1DUQHE.hic":"1206699207,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd25f24df-0298-4079-bb6f-1c8e1e32392b%2F4DNFIGW55EAY.hic":"1033358104,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc57a7ab5-2778-4fe2-9d64-9a4e95135f12%2F4DNFISZRU6I4.hic":"1539570262,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd89f494a-27ca-46b6-89be-7583f3f6d18c%2F4DNFIBKKDTAP.hic":"350372180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F06725280-cb24-4f22-a267-18b434bfa79e%2F4DNFIJSRQW24.hic":"314361467,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8fe5c3c5-006f-425b-ac6d-ea475e29be78%2F4DNFI3REN89E.hic":"299665258,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8b6ac5c-13b4-427e-9158-cec0b890b6d8%2F4DNFIF5XLHKM.hic":"235668364,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F01ff33fc-fc23-48aa-a6c6-b720d6fe0768%2F4DNFIB6Q538N.hic":"316494853,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F552978c8-abbc-424a-9187-3e34cf802a97%2F4DNFI3ST3F7Y.hic":"296298411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F72e66520-5170-4f2e-844a-fbfd0e23b480%2F4DNFIQT4M6UI.hic":"307691265,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb3eb3953-ffe8-4d5a-970c-a16f3b7b9ec3%2F4DNFIFNCC7M2.hic":"364160436,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F37d413fb-afab-41ff-99aa-1678830f7dde%2F4DNFITM9MDJL.hic":"252412426,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf5db92c-aaf1-4086-a0d2-79b28648f172%2F4DNFI3NTD7B3.hic":"227586640,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6892f7b-1f8a-4d7d-9605-c67932cd5654%2F4DNFIBED48O1.hic":"328344868,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd64afb07-5ab1-4c4f-8438-2fee37afa86a%2F4DNFISATK9PF.hic":"379669025,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fad11bb63-8692-461c-b698-89c601451321%2F4DNFISRP84FE.hic":"298491537,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F63710ec5-35d2-47dd-bf9a-08d3daa83d67%2F4DNFI2LY7B73.hic":"303150299,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76077d9e-ca75-4301-ab79-88aa49bda495%2F4DNFIXEB4UZO.hic":"711757090,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F34dd4c0e-3487-4fb4-b95f-c4bb66e0fa31%2F4DNFIQWWATGK.hic":"221304476,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F48a8cf86-3248-4a8e-8e85-472ec219d49c%2F4DNFI44JLUSL.hic":"284772724,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fee399fbf-2a9e-46e2-8364-457713bff508%2F4DNFIM7Q2FQQ.hic":"330729464,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F124d191a-c5c7-49b6-b84b-0d1bad8bef2b%2F4DNFIZK7W8GZ.hic":"293166018,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe351f7cc-7a2c-4515-ae0b-3bb2f91c986a%2F4DNFIMIMLMD3.hic":"240094740,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffd1ae249-57b1-41d6-81a6-16b21dcd8f12%2F4DNFI7QUSU5J.hic":"681762505,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46c92c5c-9ad8-4d49-beba-f35c5cd99208%2F4DNFINXUOI5H.hic":"375594313,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7350d40-4e9e-4131-9151-bb539d39b431%2F4DNFIIJR2296.hic":"331322302,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfacf37b-1665-45f3-a046-e29e1544e9b0%2F4DNFIJMZUTXR.hic":"361313244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F234e18fb-9990-43bf-9a48-f72722cfa232%2F4DNFIZQPT9EL.hic":"540421873,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b35ab09-2e79-4876-b2bc-d3a8faa26257%2F4DNFIZIXSZ9J.hic":"545066813,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae5118e-807a-46e0-8e92-143d4b282b3d%2F4DNFIDD9IF9T.hic":"237409149,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb34d7f6f-73f7-4b6b-80c7-c8af0f991549%2F4DNFIVC8OQPG.hic":"355121712,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9ab169fd-cbdd-4f60-8553-a4c6912ad89e%2F4DNFITUPI4HA.hic":"313085022,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4e53712b-d0d9-40c5-afe1-ffa0fad71e59%2F4DNFI5IZNXIO.hic":"341863906,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a91477f-45eb-4a16-affb-fc131f9326b8%2F4DNFII16KXA7.hic":"248904495,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F153729de-0eca-43cc-9b61-61aa8d775b38%2F4DNFIAAH19VM.hic":"668047244,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F879fd78a-7165-43d9-a0de-ca158b53df30%2F4DNFIVKIY3KV.hic":"247571318,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f901a4-040b-4b04-9fff-94a1780423cd%2F4DNFIVVCWL6C.hic":"198355985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd5b30c5a-654a-463c-9474-39bdc3ce4500%2F4DNFIJRF2273.hic":"343971277,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7070280a-8f03-40d0-9fef-e9d9f4d3dae7%2F4DNFI6FCC9ZA.hic":"312013061,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F47049719-9407-4d76-9048-26231045f642%2F4DNFI1CPQ4O3.hic":"352923267,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F862c2b5f-44c2-4bd7-9264-b3ca032d3d8d%2F4DNFISXFEDE9.hic":"271745977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feffbe052-39ff-4217-9871-44199ed90818%2F4DNFIF9L6QEQ.hic":"668409334,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa7791854-1b35-4258-90fb-603c55f24642%2F4DNFIPKASX1Q.hic":"312727920,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79cccad6-a78e-4de9-9fe7-08f7e8df663d%2F4DNFIWXZ4JQZ.hic":"151808553,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7e86e0cc-d6f1-4ce0-aba4-c36c6ebb3c4c%2F4DNFIEMQ1O8V.hic":"700533280,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4a1b58d3-9ae6-43e4-91cf-49f1fcbbab33%2F4DNFIYWONU7A.hic":"729050356,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67bff264-0b0c-4c5c-9d4d-ff5abef2bbe4%2F4DNFISNIE5FH.hic":"7987657997,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3a6a943f-2cc0-4433-a27d-c89f3fdd3309%2F4DNFIV8MLWJB.hic":"6646216171,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9e235711-ba90-404d-b4ac-b15990ea8e33%2F4DNFIXSTDPHL.hic":"3146468238,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c89f4bc-e9fc-4ecf-b868-26108dbb7bb2%2F4DNFIQJNOH8U.hic":"2919703928,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1856ff9e-de7a-4fa1-ae0b-3e04b837b5e1%2F4DNFI57XB4A8.hic":"13417594377,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F099bb5b9-6315-4650-8f78-d603f5a046b3%2F4DNFIQ7UKVZV.hic":"9016468637,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faf3c7a30-0fc4-410d-8d41-247da3eb105d%2F4DNFIWJY8GHD.hic":"7921314766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda99f429-20ab-4d91-bbfe-f8bdea8ed7b1%2F4DNFIN8NKRNF.hic":"4247121358,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0ca0f4e3-30ca-4332-b735-e32dce08e1a4%2F4DNFIZYGEHNZ.hic":"4910404663,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F243f48b0-6b59-4f37-ad39-a12e0986f530%2F4DNFIRPYGAV8.hic":"4220073636,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F49f1a890-d458-42a6-9c78-99c38b6c7a8f%2F4DNFI6MZTDM1.hic":"375035361,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76bd4768-9343-44ba-a99d-5500e184e39d%2F4DNFIG3BCGPL.hic":"2422923206,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F9d1ed866-eaf6-4906-aa8c-9e39616dde38%2F4DNFIS9YPJ3L.hic":"1593271574,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1e7a5636-bdb6-45fb-85d8-87a7e908de43%2F4DNFIOWGA9AX.hic":"1632314387,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ecc552a-0a6b-49a9-9aa5-9f3fd9b535fd%2F4DNFINKEDSBF.hic":"1458761024,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6c03f1d2-bb25-4c94-b5f5-d5cdd01c14b6%2F4DNFIVIXVUK7.hic":"1504818271,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1a4616ff-6d04-4a6a-9773-b80e81da2471%2F4DNFIANHFY16.hic":"1850724180,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd2231870-a78d-4c8b-9cfd-084f2468acb1%2F4DNFIJ67ZFBI.hic":"1473864703,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F859c2dd3-df8a-42b7-86ea-bf6524f75e80%2F4DNFIG3YQQ4V.hic":"1539822829,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8bad667e-6003-4828-9a20-07585fa9c811%2F4DNFIOLKEOME.hic":"3036353747,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F92ea551b-5779-4d31-a0f5-621e4bd0eb21%2F4DNFIVLN8WJE.hic":"2710426318,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61ee79fa-0617-4083-b121-f92ef3a8905c%2F4DNFI2111XQA.hic":"2589549183,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F83ebb98d-e5db-403d-aa23-875293156c0e%2F4DNFI88HXX7D.hic":"2462367030,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6d63671a-8f1d-4159-82c0-931b43464772%2F4DNFIUBM6QK8.hic":"2486020469,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcccb9014-ce15-4032-81ac-222b3d621cb4%2F4DNFIVILEERC.hic":"2052537210,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21a07867-4007-4ca5-b066-25d3168208dc%2F4DNFIF7Q43N4.hic":"2091773428,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff738de0f-358b-44bf-97dd-644c8d9b1b1c%2F4DNFID56VJGW.hic":"878913568,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fda97c1d4-bb92-4a77-92a7-f7960f88b9dc%2F4DNFIYUR29KO.hic":"983915575,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F54ea363a-99e7-4f55-861e-1644acab7939%2F4DNFIUDPGHO8.hic":"905253594,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcd66a07-55ee-48d9-a157-419cf4ee3eef%2F4DNFISWC2N8T.hic":"1233576358,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F40363837-7466-4a1d-b20d-a66d1670b700%2F4DNFICMPHDMI.hic":"516590777,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0b3fa4e6-caeb-40b4-8942-e9c0b03dfe4f%2F4DNFIKMKN736.hic":"634310295,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb6a34050-d52b-4880-91cf-d3fe4b0ce982%2F4DNFIN5NLS49.hic":"650451131,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8e63a47b-9fd4-4772-8b0c-10ee589ffb16%2F4DNFI4P8UBRL.hic":"705655033,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d92b666-30cc-4838-9d46-c1f11cee3d3c%2F4DNFISNC3LAI.hic":"176146197,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F17f7dc63-a1bc-4970-b389-87d9ee93b753%2F4DNFIVBWPFD7.hic":"749678512,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff8897333-4791-4a83-9444-a653e24aee13%2F4DNFITMQRXB7.hic":"254477361,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8712bf31-33d0-4562-ab0b-a1e9cf4fd30c%2F4DNFIUYD3HBY.hic":"995625724,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbfaf6383-9cc6-4b5c-9b20-d3bf2e8c3495%2F4DNFIRRSC7P9.hic":"1149985362,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb0b70598-5d17-4e0a-8831-6cbe697e69e2%2F4DNFIWKR8FP6.hic":"1151628407,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fccc094a8-23ce-4fd8-9c4a-41f07c045c8f%2F4DNFIQ74RSUY.hic":"931695969,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8eda16f3-af5e-4f1f-b46d-c74df44b76aa%2F4DNFI9IIO5PW.hic":"1077740364,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff283637b-cf2c-4412-ba00-0e3d7e279fad%2F4DNFI8WGJG19.hic":"812086456,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ad8438f-d3d9-42d8-88bf-42845a0dc2d0%2F4DNFIQ5CCESJ.hic":"652559720,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70e3bdcc-caf4-4822-b9c5-85234873db7a%2F4DNFIWTZHB4H.hic":"760694196,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F56ed767d-cd8a-4d38-8047-ed1e8bc8cd19%2F4DNFIENYQCDP.hic":"1159428005,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa912fff9-5f90-42b1-a3a6-cbb9eb2cf861%2F4DNFIFATZWPD.hic":"1033325746,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F21338ea5-fdee-4ad8-b61c-608fc6cec4bc%2F4DNFI7YRXKEO.hic":"388142539,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff0f88647-5631-437b-b48a-4603915e3714%2F4DNFIUY3J7EW.hic":"407344788,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F16926af8-ac3b-4f32-97d5-6c0dc6f1596a%2F4DNFIRKUYKP4.hic":"893352368,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93e39aec-6cde-4c5b-bcdf-283faa3163a2%2F4DNFIAQDBJZP.hic":"489922022,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0dc0b1ba-5509-4464-9814-dfe103ff09a0%2F4DNFIC1CLPK7.hic":"565748333,37769","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fb50964c7-b025-49d9-b1ed-289bedb59678%2F4DNFI3A3VYWU.hic":"4597459343,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff4390cea-b330-4022-88c1-9ff8c0a786f7%2F4DNFI6JJQKFJ.hic":"3678393678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c0f730-5da1-4863-9b7a-6cdd31066cff%2F4DNFIK61ILGM.hic":"3324300994,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F14b14ac4-ab59-4754-9c43-eacd9d0638e2%2F4DNFIYD8LO9Z.hic":"3227227120,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7386f953-8da9-47b0-acb2-931cba810544%2F4DNFIOTPSS3L.hic":"253942497,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6b5d8bd-27dc-4415-a320-53405a16db85%2F4DNFI525PKU5.hic":"305089653,7557","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1f922dbc-637b-4c43-b816-f604f0e79ad1%2F4DNFI8Y9SRP2.hic":"1438589609,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6a36d686-716c-4ba8-a9c3-fa8311791d3c%2F4DNFIP25GZGA.hic":"1419100109,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0e535542-2cf2-46e4-ba10-7a0b946a7fb2%2F4DNFITPO1WTY.hic":"3885296184,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c17d228-5052-4c83-880e-af05118e6929%2F4DNFIG4X5Z5F.hic":"2159245890,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc3977c00-525b-4556-9a27-061707f8cb76%2F4DNFIXLYR32S.hic":"587852728,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3f856506-cbc5-4211-a29d-48a7530c622e%2F4DNFIWI3V5LI.hic":"2318237793,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F38f77979-5eb7-4b6f-9a60-c2451185db98%2F4DNFI2DGL7LH.hic":"2068150664,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe0992a75-7727-405e-95ac-aa97141b51c1%2F4DNFI1VSO8JP.hic":"1807949651,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe925f1aa-2e7b-44e7-bfa8-2084a613ab13%2F4DNFIV5O2ZYO.hic":"2242134377,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F803a6d3c-3972-4939-8ff2-d195c5192090%2F4DNFIEWEWQ8D.hic":"2981341325,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F25104375-a588-46e6-a382-663cee6c332f%2F4DNFICSTCJQZ.hic":"14592996888,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F927aa8a5-24a5-43b7-807a-1e99ac321459%2F4DNFICEGAHRC.hic":"15431307603,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8c380474-12cd-41f4-b86f-2a29faf12eec%2F4DNFIY3XPKPO.hic":"2550999291,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F77da562e-d0ec-45a8-8764-14fa16d995a1%2F4DNFIK9PS9GM.hic":"3401011629,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F11b26222-d480-40a7-8d53-3ad8500396cb%2F4DNFIF4Y74JR.hic":"2127593378,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F93df02c6-1047-43f6-afae-d3598b61eeea%2F4DNFIBBKG9KD.hic":"5724446278,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6cd4378a-8f51-4e65-99eb-15f5c80abf8d%2F4DNFIT4I5C6Z.hic":"5419655766,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F067881e5-563d-40de-a9e3-caccad887fbc%2F4DNFI2U38HCE.hic":"14749043471,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fcb3da9ad-7afe-4d0c-9c2d-261181e7a95c%2F4DNFIETP228R.hic":"9401474797,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F185b7bcc-7bb7-41b7-9ebe-92d4fe159431%2F4DNFIXKC48TK.hic":"11624295594,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F18459b84-dd43-4af6-a05f-bcb773096322%2F4DNFIFPGOWJ6.hic":"2843730862,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffde1e48c-4a0d-4bb1-b84a-e0e45f9a0aa3%2F4DNFIIRMBE8Y.hic":"5820677927,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbabed539-1f0f-4e87-8815-fde596e6024c%2F4DNFIVUGNDD7.hic":"5170782436,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7d00531a-e616-469b-af52-5b028270e2ce%2F4DNFIFLJLIS5.hic":"18917549985,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7a9dad53-b8af-4cb6-9ce3-5c38e4a855c7%2F4DNFIOX3BGNE.hic":"5482775936,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F82fd7b7e-5f47-48d5-bf0d-daaa48a4674d%2F4DNFISPUVQHA.hic":"2177864938,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4c6680f3-9cf6-452f-9dc5-ecebf376775d%2F4DNFI8649RQJ.hic":"3288850368,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2395f001-19d9-4000-9f00-dae3dea708d6%2F4DNFIE8T8JZ8.hic":"1383191843,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24464fa8-bf96-483c-8e9a-c2f626ad6e19%2F4DNFIBM714BP.hic":"1765204569,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F918fc048-fa27-41d2-a63a-d50c511fbb9a%2F4DNFI6CWNUFL.hic":"2431120602,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7ff5a0d1-8e54-4cf0-9fe7-339f147c78da%2F4DNFIZ4F74QR.hic":"3211825957,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F355f0412-cb17-452a-b15c-aba16c5a742c%2F4DNFIOUVOX3R.hic":"5547401083,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cac91c5-160a-4b91-a91e-edc309318dd5%2F4DNFIVTDXW6X.hic":"4797344498,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe9ac9ec5-6221-4f39-951a-1c5054fc9f1c%2F4DNFICA8Y9TN.hic":"4277557869,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F46f62222-b50a-428b-938b-5444951600eb%2F4DNFIDWM3HN5.hic":"4374808431,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F50e4f2a1-9cb6-4192-8199-64d354bfdf96%2F4DNFIBK5TB3N.hic":"3757387253,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe4cdd5a8-1a45-4c6a-906b-a9603260d4c8%2F4DNFI3JYF9VS.hic":"5260534916,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc8164e99-5778-427d-be26-f0e1b62400f0%2F4DNFIP1GNKUO.hic":"7589365689,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0d72e78a-fc87-4716-8b8e-6dc5650ff2ef%2F4DNFIQYQWPF5.hic":"22022259901,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac58fc15-48c2-4eec-a689-23b677b4b6e7%2F4DNFIW6H9U3S.hic":"6810897169,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31811e40-e3ca-4456-8ba6-2ee66d6c7104%2F4DNFI7J8BQ4P.hic":"7188744676,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F62d81a52-d2cb-4bbd-8510-0fe120e786e0%2F4DNFIA3AKFSU.hic":"1763730692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae0b7513-d1a0-4f27-a9d3-348837f42cb6%2F4DNFID68JQY9.hic":"2422880133,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fae6a1a7e-1d2d-4fd2-a89f-1799abac8a9c%2F4DNFIL1FQDXE.hic":"1543814834,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F80d343c9-bd60-468a-803d-c3e351a958bc%2F4DNFITSIPCSK.hic":"2344682115,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff2d61195-a3a6-4d50-b928-546ca67546cb%2F4DNFIJ88LYHR.hic":"3362742962,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F31052aba-773a-4500-961b-e0a518245b0c%2F4DNFIJIPWD63.hic":"2529548812,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc93d0710-3fbf-40cc-b0eb-878e2aa659e4%2F4DNFIZUP2BBI.hic":"491996147,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F8660baeb-5be1-4ba5-93e4-66499e9a4587%2F4DNFIEBC4AF3.hic":"2993048734,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff6d08fbc-b836-4776-82ad-8b1b277ae837%2F4DNFI5VO3E1W.hic":"1949322679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3af004a2-a6fa-46dc-8be8-898b847a77be%2F4DNFIFDGVWLU.hic":"2456400803,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd613b4b-2422-492c-8d8f-8afba9c8a182%2F4DNFITVGFNYZ.hic":"1411204423,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc340694f-14f3-4638-b09b-98220c20039a%2F4DNFIOW9TTC1.hic":"2611370588,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3effa71b-6aa3-4265-87ba-f8d709d778d7%2F4DNFIOAA3ZEQ.hic":"3123195980,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fde75cf8b-9ce1-44fc-8b7b-ca0adea6bae9%2F4DNFIA5ID1S6.hic":"3496246968,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F714f775d-a5a4-4314-83f8-016b9d73200b%2F4DNFIZYU7V81.hic":"4245592042,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5ca518af-6e1e-4777-b67b-0fe7f039ce58%2F4DNFIRV6PVUX.hic":"3981520466,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc29b57d5-c263-4372-b396-ab4f55682f5d%2F4DNFIMEANFBY.hic":"3999623376,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4196d3ef-161a-4c18-a57e-005165c6b32a%2F4DNFIGLGQXLC.hic":"4105683321,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe10828b5-9519-4ceb-81e7-7228bfd890de%2F4DNFILS2HLXC.hic":"3804942111,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Feaac88c7-9bdc-4b1e-aa9f-e675520dfffa%2F4DNFIQS8853L.hic":"5287726781,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faab371b1-bc8d-4e83-998e-5bb977c443ca%2F4DNFIVBYCYGS.hic":"4657988157,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdb116add-af8c-4a3b-b106-9f704ba0a175%2F4DNFIE4WWHMF.hic":"5116727268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F033366e2-05a2-4381-9d48-90122892a9e0%2F4DNFIKDUUC3C.hic":"45638237,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F7284a446-442d-4a46-aae5-84987e75a7af%2F4DNFIJ5HIRA2.hic":"62201052,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F876649a3-6dd3-463a-8b17-5752a98a89c5%2F4DNFIXDFC7EM.hic":"69878143,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3cb4ce4d-d474-459f-8b8a-2159d8df8068%2F4DNFIO35EOVR.hic":"70153114,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5c5612fa-18c2-47fb-8074-693b1054e254%2F4DNFI57QGL6U.hic":"54605055,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F70c1472d-cf3a-41d7-8682-cd03b7cc978d%2F4DNFI2AGEBE5.hic":"67930121,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2bf4cce8-6e03-422b-a190-e51d4a07d501%2F4DNFI1E6NJQJ.hic":"4893181511,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0eb3aa56-8a23-435d-a07b-8bb545e8d708%2F4DNFI2DNFM1A.hic":"60466977,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F1201682a-a223-482d-913d-3c3972b8eb65%2F4DNFIIRIHBR2.hic":"48961678,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F6aee7913-6356-43cf-affa-f2b60dd478f6%2F4DNFIKXNMT46.hic":"39095246,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F357139a3-c9a5-4343-b0a4-b41c45fd03fd%2F4DNFIRV7IRJP.hic":"70916718,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76be3061-6259-42be-a917-19dcba41517b%2F4DNFIFX1XYKZ.hic":"229197441,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ff60c348a-a62c-43c3-ac85-f6c28b5f823f%2F4DNFI64CJUZ5.hic":"112428610,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fbd0b0a14-9703-49af-bb36-2359f96d4d0e%2F4DNFIBPL2HL1.hic":"73972428,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F79ac278d-83f7-4c1f-91b2-05c8018c1426%2F4DNFIBRSIPE4.hic":"415430378,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F0c3b8141-8e67-4211-80dd-3bae88f9e537%2F4DNFIDLDVY14.hic":"112747303,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2ae703d2-d85c-4ac4-9ce1-14d653927675%2F4DNFI4R1II4P.hic":"210565448,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76e641af-90be-49f8-b126-12c20f856159%2F4DNFINMLRY95.hic":"1590865292,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3b416382-ae5d-469f-9e9a-85a3e2ce9793%2F4DNFI8KBXYNL.hic":"4626496956,22663","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa27589a6-86b2-43a2-8218-1f2232d551e6%2F4DNFI53R5IKA.hic":"1536016455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdd3999f5-b36e-4154-a6b9-446656959a3a%2F4DNFIAWVDQ8C.hic":"2210273411,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fc377953b-0e61-426b-a905-abab2d5a3002%2F4DNFI9VXTBE2.hic":"3384365692,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F2dbe0377-1db2-4aae-af2b-d87dff728035%2F4DNFIT96Z365.hic":"7692311974,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fdcfcb009-f006-4ab8-a4c7-af72be58c12c%2F4DNFITUOMFUQ.hic":"6592120312,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F67f9073d-b2c5-474e-b3d5-7d72cde555cd%2F4DNFIHLQKDN8.hic":"2647703964,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76968cc8-fb9f-485b-85b2-c9289067194b%2F4DNFIL9M97T2.hic":"6186798917,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F87d9330b-8d2c-4e9d-85bb-02e572de7a68%2F4DNFIDWGZLHX.hic":"4379708168,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Ffc01b381-3665-4225-88ee-2e5e9ecb7324%2F4DNFIMEG1QIC.hic":"3587146533,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3144a03c-15c3-4bf9-95f8-ffad2640a1bf%2F4DNFIWSB66VX.hic":"1529739069,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fd7d3aac0-ba66-494b-ba0c-147631084b98%2F4DNFIH7TH4MF.hic":"6896300679,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F4b13bd19-fbd1-4c68-8855-4f0158d1ce47%2F4DNFIHKWIZ9T.hic":"1954878455,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F3d04e286-30d4-4add-a806-7a929d36419e%2F4DNFIZBBX795.hic":"1350142414,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Faa26f261-a88a-4cac-9118-ff8e90ab6f61%2F4DNFI9ZWZ5BS.hic":"3410552807,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F24e516ce-0b49-4476-b818-cc96471d8765%2F4DNFIPAI8XB5.hic":"4168518737,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fac3b06b5-46d4-4c1e-97e9-9a4f353473a7%2F4DNFI1OUWFSC.hic":"10766406904,21916","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F76c6aa27-895f-4e82-8ed8-7a85aca84490%2F4DNFIX4PJKXZ.hic":"1463157350,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fe6fbe03a-997b-4d72-a3cc-f1ed7bd88a92%2F4DNFIZGCA8AH.hic":"1597664180,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F61d99a87-4ec6-4116-be99-b483999641c4%2F4DNFI5CGQ46V.hic":"2870576870,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F271ea8cd-53b9-44c9-9fff-1bb5c444b54c%2F4DNFIOCW5AEM.hic":"2463600138,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2Fa98ca64a-861a-4a8c-92e9-586af457b1fb%2F4DNFI1UEG1HD.hic":"22480709268,25900","4dn-open-data-public.s3.amazonaws.com%2Ffourfront-webprod%2Fwfoutput%2F5809b32e-0aea-4cf5-a174-cf162d591a35%2F4DNFI9YAVTI1.hic":"3141182061,25900"};const Qd="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,Ud=new class{constructor(e){this.wait=void 0===e?100:e,this.isCalled=!1,this.calls=[]}limiter(e){const t=this;let i=function(){t.calls.length&&!t.isCalled&&(t.isCalled=!0,t.calls.shift().call(),setTimeout((function(){t.isCalled=!1,i()}),t.wait))};return function(){t.calls.push(e.bind(this,...arguments)),i()}}}(100);class jd{constructor(e){if(e.alert&&(this.alert=e.alert),this.config=e,this.loadFragData=e.loadFragData,this.fragmentSitesCache={},this.normVectorCache=new Od(10),this.normalizationTypes=["NONE"],this.matrixCache=new Od(10),this.blockCache=new $d,e.file)this.file=e.file;else if(e.blob)this.file=new Nd(e.blob);else{if(!(e.url||e.path&&!Qd))throw e.path?Error("path property is deprecated, use NodeLocalFile"):Error("Arguments must include file, blob, url, or path");{this.url=e.url||this.path,this.remote=!0;const i=new Ed(e);(t=this.url).indexOf("drive.google.com")>=0||t.indexOf("www.googleapis.com/drive")>0?this.file=new Md(i,Ud):this.file=i}}var t}async init(){this.initialized||(await this.readHeaderAndFooter(),this.initialized=!0)}async getVersion(){if(void 0===this.version){const e=await this.file.read(0,128);if(!e)return;const t=new Dd(new DataView(e));return this.magic=t.getString(),this.version=t.getInt(),this.version}return this.version}async getMetaData(){return await this.init(),this.meta}async readHeaderAndFooter(){let e=await this.file.read(0,16);if(!e||0===e.byteLength)throw Error("File content is empty");let t=new Dd(new DataView(e));if(this.magic=t.getString(),this.version=t.getInt(),this.version<5)throw Error("Unsupported hic version: "+this.version);this.footerPosition=t.getLong(),await this.readFooter();const i=Object.values(this.masterIndex).reduce(((e,t)=>Math.min(e,t.start)),Number.MAX_VALUE),n=i-16;e=await this.file.read(16,n),t=new Dd(new DataView(e)),this.genomeId=t.getString(),this.version>=9&&(this.normVectorIndexPosition=t.getLong(),this.normVectorIndexSize=t.getLong()),this.attributes={};let r=t.getInt();for(;r-- >0;)this.attributes[t.getString()]=t.getString();this.chromosomes=[],this.chromosomeIndexMap={};let s=t.getInt(),o=0;for(;s-- >0;){const e={index:o,name:t.getString(),size:this.version<9?t.getInt():t.getLong()};"all"===e.name.toLowerCase()&&(this.wholeGenomeChromosome=e,this.wholeGenomeResolution=Math.round(2*e.size)),this.chromosomes.push(e),this.chromosomeIndexMap[e.name]=e.index,o++}this.bpResolutions=[];let a=t.getInt();for(;a-- >0;)this.bpResolutions.push(t.getInt());if(this.loadFragData){this.fragResolutions=[];let e=t.getInt();if(e>0)for(;e-- >0;)this.fragResolutions.push(t.getInt())}this.chrAliasTable={};for(let e of Object.keys(this.chromosomeIndexMap))e.startsWith("chr")?this.chrAliasTable[e.substr(3)]=e:"MT"===e?this.chrAliasTable.chrM=e:this.chrAliasTable["chr"+e]=e;this.meta={version:this.version,genome:this.genomeId,chromosomes:this.chromosomes,resolutions:this.bpResolutions}}async readFooter(){const e=this.version<9?8:12;let t=await this.file.read(this.footerPosition,e);if(!t)return null;let i=new Dd(new DataView(t));const n=this.version<9?i.getInt():i.getLong();let r=i.getInt();const s=196*r;for(t=await this.file.read(this.footerPosition+e,Math.min(s,n)),i=new Dd(new DataView(t)),this.masterIndex={};r-- >0;){const e=i.getString(),t=i.getLong(),n=i.getInt();this.masterIndex[e]={start:t,size:n}}if(this.expectedValueVectors={},this.version>5){const e=this.version<9?4:8;this.normExpectedValueVectorsPosition=this.footerPosition+e+n}return this}async printIndexStats(){let e,t=0,i=0;await await this.init();for(let n of Object.keys(this.masterIndex)){const r=this.masterIndex[n];t+=r.size,r.size>i&&(i=r.size,e=n)}console.log(`${i} ${e} ${this.config.url}`)}async getMatrix(e,t){const i=Hd.getKey(e,t);if(this.matrixCache.has(i))return this.matrixCache.get(i);{const n=await this.readMatrix(e,t);return this.matrixCache.set(i,n),n}}async readMatrix(e,t){if(await this.init(),e>t){const i=e;e=t,t=i}const i=Hd.getKey(e,t),n=this.masterIndex[i];if(!n)return;const r=await this.file.read(n.start,n.size);return r?Hd.parseMatrix(r,this.chromosomes):void 0}async getContactRecords(e,t,i,n,r,s=!1){await this.init();const o=this.chromosomeIndexMap[this.getFileChrName(t.chr)],a=this.chromosomeIndexMap[this.getFileChrName(i.chr)];if(o>a||o===a&&t.start>=i.end){const e=t;t=i,i=e}const c=await this.getBlocks(t,i,n,r);if(!c||0===c.length)return[];const l=[],h=t.start/r,d=t.end/r,u=i.start/r,f=i.end/r,p=Math.floor(h),g=Math.ceil(d),m=Math.floor(u),w=Math.ceil(f);for(let o of c)if(o){let a,c,b=e&&"NONE"!==e;const F=this.getFileChrName(t.chr),v=this.getFileChrName(i.chr);if(b){const t=await this.getNormalizationVector(e,F,n,r),i=F===v?t:await this.getNormalizationVector(e,v,n,r);t&&i?(a=await t.getValues(p,g),c=await i.getValues(m,w)):b=!1}for(let e of o.records)if(s||e.bin1>=h&&e.bin1<d&&e.bin2>=u&&e.bin2<f)if(b){const t=e.bin1,i=e.bin2,n=a[t-p]*c[i-m];if(0!==n&&!isNaN(n)){const r=e.counts/n;l.push(new Pd(t,i,r))}}else l.push(e);void 0===this.percentile95&&o.records.length>10&&(this.percentile95=Kd(o.records,95))}return l}async getBlocks(e,t,i,n){const r=(e,t)=>`${t.getKey()}_${e}`;await this.init();const s=this.getFileChrName(e.chr),o=this.getFileChrName(t.chr),a=this.chromosomeIndexMap[s],c=this.chromosomeIndexMap[o];if(void 0===a)return console.log("No chromosome named: "+e.chr),[];if(void 0===c)return console.log("No chromosome named: "+t.chr),[];const l=await this.getMatrix(a,c);if(!l)return console.log("No matrix for "+e.chr+"-"+t.chr),[];const h=l.getZoomData(n,i);if(!h){let i=`No data avalailble for resolution: ${n} for map ${e.chr}-${t.chr}`;throw new Error(i)}const d=h.getBlockNumbers(e,t,this.version),u=[],f=[];for(let e of d){const t=r(e,h);this.blockCache.has(n,t)?u.push(this.blockCache.get(n,t)):f.push(e)}const p=f.map((e=>this.readBlock(e,h))),g=await Promise.all(p);for(let e of g)e&&this.blockCache.set(n,r(e.blockNumber,h),e);return u.concat(g)}async readBlock(e,t){const i=await t.blockIndex.getBlockIndexEntry(e);if(i){let n=await this.file.read(i.filePosition,i.size);if(!n)return;n=new Ki(new Uint8Array(n)).buffer;const r=new Dd(new DataView(n)),s=r.getInt(),o=[];if(this.version<7)for(let e=0;e<s;e++){const e=r.getInt(),t=r.getInt(),i=r.getFloat();o.push(new Pd(e,t,i))}else{const e=r.getInt(),t=r.getInt(),i=1===r.getByte(),n=!(this.version<9)&&1==r.getByte(),s=!(this.version<9)&&1==r.getByte(),a=r.getByte();if(1===a){const a=s?r.getInt():r.getShort();for(let c=0;c<a;c++){const a=t+(s?r.getInt():r.getShort()),c=n?r.getInt():r.getShort();for(let t=0;t<c;t++){const t=e+(n?r.getInt():r.getShort()),s=i?r.getFloat():r.getShort();o.push(new Pd(t,a,s))}}}else{if(2!=a)throw new Error("Unknown block type: "+a);{const n=r.getInt(),s=r.getShort();for(let a=0;a<n;a++){const n=Math.floor(a/s),c=e+(a-n*s),l=t+n;if(i){const e=r.getFloat();isNaN(e)||o.push(new Pd(c,l,e))}else{const e=r.getShort();-32768!=e&&o.push(new Pd(c,l,e))}}}}}return new Wd(e,t,o,i)}}async hasNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Gd(e,r,i.toString(),n),o=await this.getNormVectorIndex();return o&&o[s]}async isNormalizationValueAvailableAtResolution(e,t,i,n){let r;if(Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}return void 0!==(await this.getNormVectorIndex())[Gd(e,r,i.toString(),n)]}async getNormalizationVector(e,t,i,n){let r;if(await this.init(),Number.isInteger(t))r=t;else{const e=this.getFileChrName(t);r=this.chromosomeIndexMap[e]}const s=Gd(e,r,i.toString(),n);if(this.normVectorCache.has(s))return this.normVectorCache.get(s);const o=await this.getNormVectorIndex();if(!o)return void console.log("Normalization vectors not present in this file");if(!1===await this.isNormalizationValueAvailableAtResolution(e,t,i,n)){const t=`Normalization option ${e} not available at resolution ${n}. Will use NONE.`;return console.log(t),void(this.alert&&this.alert(t))}const a=o[s],c=await this.file.read(a.filePosition,8);if(!c)return;const l=new Dd(new DataView(c)),h=this.version<9?l.getInt():l.getLong(),d=this.version<9?8:4,u=this.version<9?a.filePosition+4:a.filePosition+8,f=new Vd(this.file,u,h,d);return this.normVectorCache.set(s,f),f}async getNormVectorIndex(){if(!(this.version<6)){if(!this.normVectorIndex){if(!this.config.nvi&&this.remote&&this.url){const e=new URL(this.url),t=encodeURIComponent(e.hostname+e.pathname);qd.hasOwnProperty(t)&&(this.config.nvi=qd[t])}if(this.config.nvi){const e=decodeURIComponent(this.config.nvi).split(","),t={start:parseInt(e[0]),size:parseInt(e[1])};return this.readNormVectorIndex(t)}try{return await this.readNormExpectedValuesAndNormVectorIndex(),this.normVectorIndex}catch(e){"416"===e.code||416===e.code?this.normExpectedValueVectorsPosition=void 0:console.error(e)}}return this.normVectorIndex}}async getNormalizationOptions(){return await this.getNormVectorIndex(),this.normalizationTypes}async readNormVectorIndex(e){await this.init(),this.normalizationVectorIndexRange=e;const t=await this.file.read(e.start,e.size),i=new Dd(new DataView(t));this.normVectorIndex={};let n=i.getInt();for(;n-- >0;)this.parseNormVectorEntry(i);return this.normVectorIndex}async readNormExpectedValuesAndNormVectorIndex(){if(await this.init(),void 0===this.normExpectedValueVectorsPosition)return;const e=await this.skipExpectedValues(this.normExpectedValueVectorsPosition);let t=4,i=await this.file.read(e,4);if(0===i.byteLength)return;const n=new Dd(new DataView(i)).getInt(),r={start:e+t,size:30*n};i=await this.file.read(r.start,r.size),this.normalizedExpectedValueVectors={},this.normVectorIndex={},await async function i(n,r){const s=new Dd(new DataView(r));for(;n-- >0;){if(s.available()<100){n++,t+=s.position;const r=Math.max(1e3,30*n),o={start:e+t,size:r},a=await this.file.read(o.start,o.size);return i.call(this,n,a)}this.parseNormVectorEntry(s)}t+=s.position}.call(this,n,i),this.config.nvi=e.toString()+","+t}async skipExpectedValues(e){const t=this.version,i=new Rd({file:this.file,size:256e3}),n={start:e,size:4},r=await i.read(n.start,n.size),s=new Dd(new DataView(r)).getInt();return 0===s?e+4:async function e(n,r){let s={start:n,size:500},o=0,a=n,c=await i.read(s.start,s.size),l=new Dd(new DataView(c));l.getString(),l.getString(),l.getInt();const h=t<9?l.getInt():l.getLong();o+=l.position+h*(t<9?8:4),s={start:n+o,size:4},c=await i.read(s.start,s.size),l=new Dd(new DataView(c));const d=l.getInt();return o+=4+d*(4+(t<9?8:4)),r--,0===r?a+o:e(a+o,r)}(e+4,s)}getZoomIndexForBinSize(e,t){let i;if("BP"===(t=t||"BP"))i=this.bpResolutions;else{if("FRAG"!==t)throw new Error("Invalid unit: "+t);i=this.fragResolutions}for(let t=0;t<i.length;t++)if(i[t]===e)return t;return-1}parseNormVectorEntry(e){const t=e.getString(),i=e.getInt(),n=e.getString(),r=e.getInt(),s=e.getLong(),o=this.version<9?e.getInt():e.getLong(),a=t+"_"+i+"_"+n+"_"+r;this.normalizationTypes.includes(t)||this.normalizationTypes.push(t),this.normVectorIndex[a]={filePosition:s,size:o}}getFileChrName(e){return this.chrAliasTable.hasOwnProperty(e)?this.chrAliasTable[e]:e}}function Gd(e,t,i,n){return e+"_"+t+"_"+i+"_"+n}class Wd{constructor(e,t,i,n){this.blockNumber=e,this.zoomData=t,this.records=i,this.idx=n}}class $d{constructor(){this.resolution=void 0,this.map=new Od(6)}set(e,t,i){this.resolution!==e&&this.map.clear(),this.resolution=e,this.map.set(t,i)}get(e,t){return this.resolution===e?this.map.get(t):void 0}has(e,t){return this.resolution===e&&this.map.has(t)}}function Kd(e,t){const i=e.map((e=>e.counts));i.sort((function(e,t){return e-t}));return i[Math.floor(t/100*e.length)]}class Yd{constructor(e,t){this.config=e,this.genome=t,this.hicFile=e._hicFile?e._hicFile:new jd(e),e._hicFile=void 0}async getHeader(){return await this.hicFile.init(),this.hicFile}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){this.hicFile.initialized||await this.hicFile.init();const s=this.hicFile.bpResolutions,o=s[s.length-1];return(await this.hicFile.getContactRecords(void 0,{chr:e,start:t,end:i},{chr:"celltype",start:0,end:1e8},"BP",o)).map((t=>{const i=t.bin1*o;return{chr:e,start:i,end:i+o,value:t.counts,sample:t.bin2.toString()}}))}supportsWholeGenome(){return!1}}function Xd(e,t){const i=new Set(e.attributeNames),n=t[0];if(void 0===e.getAttributes(n))return!1;{const t=Object.keys(e.getAttributes(n));for(const e of t)if(!1===i.has(e))return!1}return!0}class Zd extends Pa{#y=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),this.type=e.type||"seg","maf"===this.type&&(this.type="mut"),this.isLog=e.isLog,this.displayMode=e.displayMode||"EXPANDED",this.height=e.height||300,this.maxHeight=e.maxHeight||500,this.squishedRowHeight=e.sampleSquishHeight||e.squishedRowHeight||2,this.expandedRowHeight=e.sampleExpandHeight||e.expandedRowHeight||13,this.sampleHeight=this.squishedRowHeight,this.sampleKeys=[],e.samples){for(let t of e.samples)this.sampleKeys.push(t);this.explicitSamples=!0}if(e.color)this.color=e.color;else if(e.colorTable)this.colorTable=new Yn(e.colorTable);else if("mut"===this.type)this.colorTable=new Yn(tu);else this.posColorScale=new gl(e.posColorScale||Jd),this.negColorScale=new gl(e.negColorScale||eu);const t=Object.assign({},this.config);t.maxWGCount=t.maxWGCount||Number.MAX_SAFE_INTEGER,"shoebox"===this.type?(this.featureSource=new Yd(t,this.browser.genome),this.height=e.height||500,this.maxHeight=e.maxHeight||800,this.isLog=!1,this.squishedRowHeight=e.squishedRowHeight||1,this.displayMode=e.displayMode||"SQUISHED",this.visibilityWindow=void 0===e.visibilityWindow?1e6:e.visibilityWindow):this.featureSource=Hl(t,this.browser.genome),this.initialSort=e.sort}async postInit(){"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader(),this.disposed)||(this.header&&this.setTrackProperties(this.header),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor)}menuItemList(){const t=[];if(!0===Xd(this.browser.sampleInfo,this.sampleKeys)){t.push("<hr/>"),t.push("Sort by attribute:");for(const r of this.browser.sampleInfo.attributeNames){if(this.sampleKeys.some((e=>{const t=this.browser.sampleInfo.getAttributes(e);return t&&t[r]}))){const s=document.createElement("div");function o(){const e=this.#y.get(r)||1;this.sortByAttribute(r,e),this.#y.set(r,-1*e),this.config.sort={option:"ATTRIBUTE",attribute:r,direction:1===e?"ASC":"DESC"}}s.innerHTML=` ${r.split(rd.emptySpaceReplacement).join(" ")}`,t.push({element:s,click:o})}}}const i={SQUISHED:"Squish",EXPANDED:"Expand",FILL:"Fill"};if("shoebox"===this.type&&this.sbColorScale){function a(e){this.browser.inputDialog.present({label:"Color Scale Threshold",value:this.sbColorScale.threshold,callback:()=>{const e=Number(this.browser.inputDialog.value,10);e&&(this.sbColorScale.setThreshold(e),this.trackView.repaintViews())}},e)}t.push("<hr/>"),t.push({element:e("<div>Set color scale threshold</div>"),dialog:a})}t.push("<hr/>"),t.push("DisplayMode:");const n="seg"===this.type||"shoebox"===this.type?["SQUISHED","EXPANDED","FILL"]:["SQUISHED","EXPANDED"];for(let c of n)t.push({element:Ta(i[c],c===this.displayMode),click:function(){this.displayMode=c,this.config.displayMode=c,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.trackView.moveScroller(this.trackView.sampleNameViewport.trackScrollDelta)}});return t}hasSamples(){return!0}getSamples(){return{names:this.sampleKeys,height:this.sampleHeight,yOffset:0}}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:t,end:i});if(this.updateSampleKeys(n),this.initialSort){const e=this.initialSort;if(void 0===e.option||"VALUE"===e.option.toUpperCase())this.sortByValue(e,n);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="DESC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return n}draw({context:e,pixelTop:t,pixelWidth:i,pixelHeight:n,features:r,bpPerPixel:s,bpStart:o}){if(fr.fillRect(e,0,t,i,n,{fillStyle:"rgb(255, 255, 255)"}),r&&r.length>0){if(this.checkForLog(r),"shoebox"===this.type&&!this.sbColorScale){const e=this.featureSource.hicFile.percentile95||2e3;this.sbColorScale=new Sd({threshold:e,r:0,g:0,b:255})}const a={};let c;switch(this.sampleKeys.forEach((function(e,t){a[e]=t})),this.displayMode){case"FILL":this.sampleHeight=n/this.sampleKeys.length,c=0;break;case"SQUISHED":this.sampleHeight=this.squishedRowHeight,c=0;break;default:this.sampleHeight=this.expandedRowHeight,c=1}const l=this.sampleHeight;for(let e of r)e.pixelRect=void 0;const h=t+n,d=o+i*s+1,u=s;this.sampleYStart=void 0;for(let i of r){if(i.end<o||i.start>d)continue;const n=i.sampleKey||i.sample;i.row=a[n];const r=i.row*l+c;void 0===this.sampleYStart&&(this.sampleYStart=r);if(r+l<t||r>h)continue;const s=Math.max(i.start,o);let f=Math.round((s-o)/u);const p=Math.min(i.end,d),g=Math.round((p-o)/u);let m,w,b=Math.max(1,g-f);if(this.color?m="function"==typeof this.color?this.color(i):this.color:this.colorTable&&(m=this.colorTable.getColor(i.value.toLowerCase())),"mut"===this.type)w=l-2*c,b<3&&(b=3,f-=1);else if("shoebox"===this.type){m=this.sbColorScale.getColor(i.value);let e=l;if(l<.25){const t=.1+2*Math.abs(t.value);e=Math.min(1,t*l)}w=e-2*c}else{let e=i.value;this.isLog||(e=ln(e/2)),m=e<-.1?this.negColorScale.getColor(e):e>.1?this.posColorScale.getColor(e):"white";let t=l;if(l<.25){const i=.1+2*Math.abs(e);t=Math.min(1,i*l)}w=t-2*c}i.pixelRect={x:f,y:r,w:b,h:w},e.fillStyle=m,e.fillRect(f,r,b,w)}}}checkForLog(e){if(void 0===this.isLog){this.isLog=!1;for(let t of e)if(t.value<0)return void(this.isLog=!0)}}computePixelHeight(e){if(!e)return 0;const t="SQUISHED"===this.displayMode?this.squishedRowHeight:this.expandedRowHeight;return this.updateSampleKeys(e),this.sampleKeys.length*t}async sortByValue(e,t){const i=e.chr;let n,r;if(e.position?(n=e.position-1,r=n+1):(n=e.start,r=e.end),t||(t=await this.featureSource.getFeatures({chr:i,start:n,end:r})),!t)return;this.updateSampleKeys(t);const s={},o="ASC"===e.direction?1:-1,a=()=>{const e=r-n+1;for(let i of t){if(i.end<n)continue;if(i.start>r)break;const t=Math.max(n,i.start),o=(Math.min(r,i.end)-t)/e,a=i.sampleKey||i.sample,c=s[a]||0;s[a]=c+o*i.value}this.sampleKeys.sort((function(e,t){let i=s[e],n=s[t];return i||(i=o*Number.MAX_VALUE),n||(n=o*Number.MAX_VALUE),i===n?0:i>n?o:-1*o}))},c=()=>{for(let e of t){if(e.end<n)continue;if(e.start>r)break;const t=e.sampleKey||e.sample;(!s.hasOwnProperty(t)||e.value.localeCompare(s[t])>0)&&(s[t]=e.value)}this.sampleKeys.sort((function(e,t){let i=s[e]||"",n=s[t]||"";return o*i.localeCompare(n)}))};"mut"===this.type?c():a(),this.trackView.repaintViews()}sortByAttribute(e,t){this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}clickedFeatures(e){const t=super.clickedFeatures(e),i=e.y;return t.filter((function(e){const t=e.pixelRect;return t&&i>=t.y&&i<=t.y+t.h}))}hoverText(e){const t=this.clickedFeatures(e);if(t&&t.length>0)return`${t[0].sample}: ${t[0].value}`}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){i.length>0&&(i.push("<hr/>"),i.push("<hr/>"));const t=e._f||e,n="function"==typeof t.popupData?t.popupData(this.type,this.browser.genome.id):this.extractPopupData(t);Array.prototype.push.apply(i,n)}return i}contextMenuItemList(e){const t=e.genomicLocation,i=t=>{const i=e.viewport.cachedFeatures;this.sortByValue(t,i)},n=e.referenceFrame.toBP(2.5);return["DESC","ASC"].map((r=>{const s="DESC"===r?"descending":"ascending";return{label:"seg"===this.type||"shoebox"===this.type?`Sort by value (${s})`:`Sort by type (${s})`,click:()=>{const s={option:"VALUE",direction:r,chr:e.referenceFrame.chr,start:Math.floor(t-n),end:Math.floor(t+n)};i(s),this.config.sort=s}}}))}get supportsWholeGenome(){return(!1===this.config.indexed||!this.config.indexURL)&&!1!==this.config.supportsWholeGenome}updateSampleKeys(e){if(this.explicitSamples)return;const t=new Set(this.sampleKeys);for(let i of e){const e=i.sampleKey||i.sample;t.has(e)||(this.sampleKeys.push(e),t.add(e))}}}const Jd={low:.1,high:1.5,lowColor:"rgb(255,255,255)",highColor:"rgb(255,0,0)"},eu={low:-1.5,high:-.1,lowColor:"rgb(0,0,255)",highColor:"rgb(255,255,255)"},tu={indel:"rgb(0,200,0)","targeted region":"rgb(236,155,43)",truncating:"rgb(\t150,0,0)","non-coding transcript":"rgb(0,0,150)",synonymous:"rgb(109,165,95)",silent:"rgb(109,135,80)",missense_mutation:"rgb(72,130,187)",missense:"rgb(72,130,187)","splice site":"rgb(143,83,155)",splice_region:"rgb(143,83,155)",nonsense:"rgb(216, 57,81)",nonsense_mutation:"rgb(216, 57,81)",frame_shift_del:"rgb(226,135,65)",frame_shift_ins:"rgb(226,135,65)",in_frame_del:"rgb(247,235,94)",in_frame_ins:"rgb(247,235,94)","*other*":"rgb(159,91,50)"};class iu{constructor(e){this.paired=!0,this.firstAlignment=e,this.chr=e.chr,this.readName=e.readName,e.start<e.mate.position?(this.start=e.start,this.scStart=e.scStart,this.connectingStart=e.start+e.lengthOnRef,this.connectingEnd=e.mate.position):(this.start=e.mate.position,this.scStart=this.start,this.connectingStart=e.mate.position,this.connectingEnd=e.start),this.end=Math.max(e.mate.position,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start;let t=Math.max(this.end,e.scStart+e.scLengthOnRef);this.scLengthOnRef=t-this.scStart}setSecondAlignment(e){this.secondAlignment=e;const t=this.firstAlignment;e.start>t.start?this.connectingEnd=e.start:this.connectingStart=e.start+e.lengthOnRef,this.start=Math.min(t.start,e.start),this.end=Math.max(t.start+t.lengthOnRef,e.start+e.lengthOnRef),this.lengthOnRef=this.end-this.start,this.scStart=Math.min(t.scStart,e.scStart);const i=Math.max(t.scStart+t.scLengthOnRef,e.scStart+e.scLengthOnRef);this.scLengthOnRef=i-this.scStart}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}alignmentContaining(e,t){return this.firstAlignment.containsLocation(e,t)?this.firstAlignment:this.secondAlignment&&this.secondAlignment.containsLocation(e,t)?this.secondAlignment:void 0}popupData(e){let t=this.firstAlignment.popupData(e);return this.secondAlignment&&(t.push("-------------------------------"),t=t.concat(this.secondAlignment.popupData(e))),t}isPaired(){return!0}isMateMapped(){return!0}isProperPair(){return this.firstAlignment.isProperPair()}get fragmentLength(){return Math.abs(this.firstAlignment.fragmentLength)}get firstOfPairStrand(){return this.firstAlignment.firstOfPairStrand}get pairOrientation(){return this.firstAlignment.pairOrientation}hasTag(e){return this.firstAlignment.hasTag(e)||this.secondAlignment&&this.secondAlignment.hasTag(e)}getGroupValue({option:e,tag:t}){switch(e){case"strand":return this.isNegativeStrand()?"-":"+";case"FIRST_IN_PAIR_STRAND":return this.isPaired()?this.isFirstOfPair()?this.isNegativeStrand()?"-":"+":this.isSecondOfPair()?this.isNegativeStrand()?"+":"-":void 0:void 0;case"START":return this.start;case"INSERT_SIZE":return this.fragmentLength;case"MATE_CHR":return this.mate?this.mate.chr:void 0;case"MQ":return this.mq;case"ALIGNED_READ_LENGTH":return this.lengthOnRef;case"TAG":return this.tags()[t];case"PHASE":return this.tags().HP;case"READ_ORDER":return this.isPaired()&&this.isFirstOfPair()?"FIRST":this.isPaired()&&this.isSecondOfPair()?"SECOND":"";default:return}}}class nu{static instances=new Map;static getKey(e,t,i){const n=""+e+t+i;return nu.instances.has(n)||nu.instances.set(n,new nu(e,t,i)),nu.instances.get(n)}constructor(e,t,i){this.base=e,this.strand=t,this.modification=i,this.canonicalBase="+"===this.strand?this.base:ao(this.base)}getCanonicalBase(){}toString(){return""+this.base+this.strand+this.modification}static compare(e,t){const i=e.modification,n=t.modification;return i===n?e.strand.charAt(0)-t.strand.charAt(0):ru.has(i)&ru.has(n)?ru.get(i)-ru.get(n):ru.has(i)?1:ru.has(n)?-1:i>n?1:-1}}const ru=new Map(["NONE_C","NONE_T","NONE_G","NONE_A","m","h","f","c","C","g","e","b","T","U","a","A","o","G","n","N"].map(((e,t)=>[e,t])));class su{constructor(e,t,i,n){this.base=e,this.modification=i,this.strand=t,this.likelihoods=n,this.canonicalBase="+"==this.strand?this.base:ao(this.base),this.key=nu.getKey(e,t,i)}containsPosition(e){return this.likelihoods.has(e)}is5mC(){return this.modification.equals("m")&&("C"===this.base&&"+"===this.strand||"G"===this.base&&"-"===this.strand)}fullName(){return ou.get(this.modification)||this.modification}}const ou=new Map;ou.set("m","5mC"),ou.set("h","5hmC"),ou.set("f","5fC"),ou.set("c","5caC"),ou.set("g","5hmU"),ou.set("e","5fU"),ou.set("b","5caU"),ou.set("a","6mA"),ou.set("o","8xoG"),ou.set("n","Xao"),ou.set("C","Unknown C"),ou.set("T","Unknown T"),ou.set("A","Unknown A"),ou.set("G","Unknown G"),ou.set("N","Unknown");const au=new Map([["m","5mC"],["h","5hmC"],["f","5fC"],["c","5caC"],["g","5hmU"],["e","5fU"],["b","5caU"],["a","6mA"],["o","8xoG"],["n","Xao"],["C","Unknown C"],["T","Unknown T"],["A","Unknown A"],["G","Unknown G"],["N","Unknown"]]);function cu(e){return au.has(e)?au.get(e):"Uknown"}function lu(e){if(!e)return!1;const t=e.length;if(0==t)return!1;for(let i=0;i<t;i++){const t=e.charAt(i);if(t<"0"||t>"9")return!1}return!0}function hu(e){return e<0?e+256:e}class du{allModifications=new Set;simplexModifications=new Set;maxLikelihoods=new Map;nomodLikelihoods=new Map;lastThreshold;incrementCounts(e){if(!e.blocks)return;const t=e.getBaseModificationSets();if(t)for(let i of e.blocks)if("S"!==i.type)for(let e=0;e<i.len;e++){let n,r=e+i.seqOffset,s=0,o=-1,a=255;for(let e of t){const t=nu.getKey(e.base,e.strand,e.modification);this.allModifications.add(t);const i=e.likelihoods;if(e.containsPosition(r)){const c=hu(i.get(r));a-=c,c>o&&(s=e.canonicalBase,o=c,n=t)}}if(0!=s){const t=i.start+e,r=nu.getKey(s,"+","NONE_"+s);this.allModifications.add(r);const c=(e,t,i,n)=>{let r=n.get(i);r||(r=new Map,n.set(i,r));let s=r.get(e);s||(s=[],r.set(e,s)),s.push(t)};c(t,o,n,this.maxLikelihoods),a>o?c(t,a,r,this.nomodLikelihoods):c(t,o,n,this.nomodLikelihoods)}}}getCount(e,t,i,n){this.lastThreshold=i;const r=255*i,s=n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t);if(!s)return 0;const o=s.get(e);if(o){let e=0;for(let t of o){hu(t)>=r&&e++}return e}return 0}getLikelihoodSum(e,t,i,n){this.lastThreshold=i;const r=255*i,s=(n?this.nomodLikelihoods.get(t):this.maxLikelihoods.get(t)).get(e);if(s){let e=0;for(let t of s){const i=hu(t);i>=r&&(e+=i)}return e}return 0}popupData(e,t){const i=[];i.push("<b>Modifications with likelihood > "+100*this.lastThreshold+"%</b>");for(let n of this.maxLikelihoods.keys()){if(this.maxLikelihoods.get(n).has(e)){let r="basemod2"===t;const s=this.getCount(e,n,this.lastThreshold,r);if(s>0){const t=this.getLikelihoodSum(e,n,this.lastThreshold,r)/s*.3921568,o=cu(n.modification);i.push(o+" ("+n.base+n.strand+"): "+s+" @ average likelihood "+Math.round(t)+"%")}}}return i}computeSimplex(){const e=new Set(Array.from(this.allModifications).filter((e=>"-"===e.strand)).map((e=>e.modification)));for(let t of this.allModifications)"+"!==t.strand||e.has(t.modification)||(this.simplexModifications.add(t.modification),this.simplexModifications.add("NONE_"+t.getCanonicalBase()))}}class uu{constructor(){this.alignments=[],this.score=void 0}findAlignment(e,t=!1){const i=(e,i)=>i>=e.start&&i<e.start+(t?e.fragmentLength:e.lengthOnRef);let n;for(let r=0;r<this.alignments.length;r++){const s=this.alignments[r];if(e>=s.start&&e<s.start+(t?s.fragmentLength:s.lengthOnRef)){s.paired?s.firstAlignment&&i(s.firstAlignment,e)?n=s.firstAlignment:s.secondAlignment&&i(s.secondAlignment,e)&&(n=s.secondAlignment):n=s;break}}return n}getSortValue({position:e,option:t,tag:i,sortAsPairs:n},r){t||(t="BASE");const s=this.findAlignment(e,n);if(void 0===s)return Number.MAX_VALUE;switch(t){case"NUCLEOTIDE":case"BASE":return function(e,t,i){let n;const r=Math.floor(i)-t.start;r<t.sequence.length&&(n=t.sequence.charAt(r));if(!n)return 0;const s=e.readBaseAt(i),o=e.readBaseQualityAt(i),a=t.coverageMap,c=Math.floor(i-a.bpStart),l=a.coverage[c];let h=0;if(e.insertions)for(let t of e.insertions)t.start===i&&(h=-l.ins);if(s)if(n=n.toUpperCase(),"N"===s&&0===h)h=2;else if(n!==s&&"="!==s||0!==h){if("X"===s||n!==s){h-=l["pos"+s]+l["neg"+s]+o/1e3}}else h=4-o/1e3;else{const e=l.del;e>0?h-=e:0===h&&(h=1)}return h}(s,r,e);case"strand":return s.strand?1:-1;case"START":return s.start;case"TAG":return s.tags()[i];case"READ_NAME":return s.readName;case"INSERT_SIZE":return-Math.abs(s.fragmentLength);case"GAP_SIZE":return-s.gapSizeAt(e);case"MATE_CHR":return s.mate?s.mate.chr:Number.MAX_VALUE;case"MQ":return void 0===s.mq?Number.MAX_VALUE:-s.mq;case"ALIGNED_READ_LENGTH":return-s.lengthOnRef;default:return Number.MAX_VALUE}}}var fu={fr:{F1R2:"LR",F2R1:"LR",F1F2:"LL",F2F1:"LL",R1R2:"RR",R2R1:"RR",R1F2:"RL",R2F1:"RL"},rf:{R1F2:"LR",R2F1:"LR",R1R2:"LL",R2R1:"LL",F1F2:"RR",F2F1:"RR",F1R2:"RL",F2R1:"RL"},ff:{F2F1:"LR",R1R2:"LR",F2R1:"LL",R1F2:"LL",R2F1:"RR",F1R2:"RR",R2R1:"RL",F1F2:"RL"}};class pu{#A=[];baseModificationKeys=new Set;constructor(e,t,i,{samplingWindowSize:n,samplingDepth:r,alleleFreqThreshold:s,colorBy:o}){this.alleleFreqThreshold=void 0===s?.2:s,this.samplingWindowSize=n||100,this.samplingDepth=r||1e3,this.chr=e,this.start=Math.floor(t),this.end=Math.ceil(i),this.length=i-t,this.coverageMap=new mu(e,t,i,this.alleleFreqThreshold),this.downsampledIntervals=[],o&&o.startsWith("basemod")&&(this.baseModCounts=new du),this.alignments=[],this.pairsCache=new Map,this.downsampledReads=new Set,this.currentBucket=new gu(this.start,this.start+this.samplingWindowSize,this),this.hasPairs=!1}pack({viewAsPairs:e,showSoftClips:t,expectedPairOrientation:i,groupBy:n,displayMode:r}){let s=this.allAlignments();s=e?function(e){const t=new Map,i=e.map((e=>{if(vu(e)){let i=t.get(e.readName);return i?(i.setSecondAlignment(e),t.delete(e.readName),i):(i=new iu(e),t.set(e.readName,i),i)}return e}));return i}(s):function(e){return e.flatMap((e=>e instanceof iu?[e.firstAlignment,e.secondAlignment].filter(Boolean):[e]))}(s),this.packAlignmentRows(s,t,i,n,r),this.alignments&&delete this.alignments}packAlignmentRows(e,t,i,n,r){this.#A=[];const s=(e,i)=>{e.sort((function(e,i){return t?e.scStart-i.scStart:e.start-i.start}));const n=new Fu(i);let r,s=0,o=0;const a=new Set,c=()=>{r=new uu,n.push(r),s=0,o=0,a.clear()};for(c();e.length>0;)if(o>=0&&o<e.length){const i=e[o];a.add(i),r.alignments.push(i),s=t?i.scStart+i.scLengthOnRef+2:i.start+i.lengthOnRef+2,o=yu(e,(e=>(t?e.scStart:e.start)>s),o)}else e=e.filter((e=>!a.has(e))),c();return n},o=(e,t)=>{e.sort((function(e,t){return e.start-t.start}));const i=new Fu(t),{start:n,end:r}=this.viewport.genomicRange();for(let t of e)if(t.end<n||t.start>r)this.#A.push(t);else{const e=new uu;e.alignments.push(t),i.push(e)}return i};if(!e||0===e.length)return new Map;{const t=new Map;if(n)for(let r of e){const e=Au(r,n,i)||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}else t.set("",e);const a=new Map,c=Array.from(t.keys()).sort(function(e){switch(e){case"pairOrientation":return function(){const e=["LL","RR","RL","LR",""];return(t,i)=>e.indexOf(t)-e.indexOf(i)}();case"strand":case"firstOfPairStrand":return xu;default:return e&&e.startsWith("base:")?_u:ku}}(n));for(let e of c){const i=t.get(e),n="FULL"===r?o(i,e):s(i,e);a.set(e,n)}this.packedGroups=a}}push(e){this.hasPairs=this.hasPairs||e.isPaired(),this.coverageMap.incCounts(e);const t=e.getBaseModificationSets();if(t)for(let e of t)this.baseModificationKeys.add(e.key);this.baseModCounts&&this.baseModCounts.incrementCounts(e),this.downsampledReads.has(e.readName)?this.currentBucket.downsampledCount++:(e.start>=this.currentBucket.end&&(this.finishBucket(),this.currentBucket=new gu(e.start,e.start+this.samplingWindowSize,this)),this.currentBucket.addAlignment(e))}finish(){void 0!==this.currentBucket&&this.finishBucket(),this.hasAlignments=this.alignments.length>0,this.alignments.sort((function(e,t){return e.start-t.start})),this.baseModCounts&&this.baseModCounts.computeSimplex(),delete this.currentBucket,delete this.pairsCache,delete this.downsampledReads}contains(e,t,i){return this.chr===e&&this.start<=t&&this.end>=i}hasDownsampledIntervals(){return this.downsampledIntervals&&this.downsampledIntervals.length>0}finishBucket(){this.alignments=this.alignments.concat(this.currentBucket.alignments),this.currentBucket.downsampledCount>0&&this.downsampledIntervals.push(new bu(this.currentBucket.start,this.currentBucket.end,this.currentBucket.downsampledCount))}allAlignments(){if(this.alignments)return this.alignments;if(this.packedGroups){const e=Array.from(this.packedGroups.values()).flatMap((e=>e.rows.flatMap((e=>e.alignments))));if(this.#A&&this.#A.length>0)for(let t of this.#A)e.push(t);return e}return[]}getMax(e,t){return this.coverageMap.getMax(e,t)}sortRows(e){if(this.packedGroups)for(let t of this.packedGroups.values())t.sortRows(e,this)}}class gu{constructor(e,t,{samplingDepth:i,downsampledReads:n,pairsCache:r}){this.start=e,this.end=t,this.alignments=[],this.downsampledCount=0,this.samplingDepth=i,this.downsampledReads=n,this.pairsCache=r,this.hasPairs=!1}addAlignment(e){this.hasPairs=this.hasPairs||e.isPaired();const t=this.hasPairs?Math.ceil(this.samplingDepth/2):this.samplingDepth;if(vu(e)){const t=this.pairsCache.get(e.readName);if(t)return t.setSecondAlignment(e),void this.pairsCache.delete(e.readName)}if(this.alignments.length<t)if(vu(e)){const t=new iu(e);this.pairsCache.set(e.readName,t),this.alignments.push(t)}else this.alignments.push(e);else{const i=Math.floor(Math.random()*(t+this.downsampledCount-1));if(i<t){const t=this.alignments[i];if(this.pairsCache.has(t.readName)&&this.pairsCache.delete(t.readName),vu(e)){const t=new iu(e);this.pairsCache.set(e.readName,t),this.alignments[i]=t}else this.alignments[i]=e;this.downsampledReads.add(t.readName)}else this.downsampledReads.add(e.readName);this.downsampledCount++}}}class mu{constructor(e,t,i,n){this.chr=e,this.bpStart=t,this.length=i-t,this.coverage=new Array(this.length),this.maximum=0,this.threshold=n,this.qualityWeight=!0}getMax(e,t){let i=0;const n=this.coverage.length;for(let r=0;r<n;r++){const n=this.bpStart+r;if(n>t)break;const s=this.coverage[r];n>=e&&s&&(i=Math.max(i,s.total))}return i}incCounts(e){var t=this;if(void 0===e.blocks?i(e):e.blocks.forEach((function(e){i(e)})),e.gaps)for(let i of e.gaps)if("D"===i.type){const e=i.start-t.bpStart;for(let n=e;n<e+i.len;n++)n<0||(this.coverage[n]||(this.coverage[n]=new wu(t.threshold)),this.coverage[n].del++)}if(e.insertions)for(let i of e.insertions){const e=i.start-this.bpStart;e<0||(this.coverage[e]||(this.coverage[e]=new wu(t.threshold)),this.coverage[e].ins++)}function i(i){if("S"===i.type)return;const n=e.seq,r=e.qual,s=i.seqOffset;for(let o=i.start-t.bpStart,a=0;a<i.len;o++,a++){t.coverage[o]||(t.coverage[o]=new wu(t.threshold));const i=null==n?"N":n.charAt(s+a),c=e.strand?"pos"+i:"neg"+i,l=r&&s+a<r.length?r[s+a]:30;t.coverage[o][c]+=1,t.coverage[o]["qual"+i]+=l,t.coverage[o].total+=1,t.coverage[o].qual+=l,t.maximum=Math.max(t.coverage[o].total,t.maximum)}}}getPosCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.posA;case"C":case"c":return n.posC;case"T":case"t":return n.posT;case"G":case"g":return n.posG;case"N":case"n":return n.posN;default:return 0}}getNegCount(e,t){const i=e-this.bpStart;if(i<0||i>=this.coverage.length)return 0;const n=this.coverage[i];switch(t){case"A":case"a":return n.negA;case"C":case"c":return n.negC;case"T":case"t":return n.negT;case"G":case"g":return n.negG;case"N":case"n":return n.negN;default:return 0}}getCount(e,t){return this.getPosCount(e,t)+this.getNegCount(e,t)}getTotalCount(e){const t=e-this.bpStart;return t>=0&&t<this.coverage.length?this.coverage[t].total:0}}class wu{constructor(e){this.qualityWeight=!0,this.posA=0,this.negA=0,this.posT=0,this.negT=0,this.posC=0,this.negC=0,this.posG=0,this.negG=0,this.posN=0,this.negN=0,this.pos=0,this.neg=0,this.qualA=0,this.qualT=0,this.qualC=0,this.qualG=0,this.qualN=0,this.qual=0,this.total=0,this.del=0,this.ins=0,this.threshold=e}hoverText(){const e=this.posA+this.posT+this.posC+this.posG+this.posN,t=this.negA+this.negT+this.negC+this.negG+this.negN;return`${this.total} (${e}+, ${t}-)`}isMismatch(e){const t=this.threshold*(this.qualityWeight&&this.qual?this.qual:this.total);let i=0;for(let t of["A","T","C","G"])t!==e&&(i+=this.qualityWeight&&this.qual?this["qual"+t]:this["pos"+t]+this["neg"+t]);return i>=t}}class bu{constructor(e,t,i){this.start=e,this.end=t,this.counts=i}popupData(e){return[{name:"start",value:Math.floor(this.start+1)},{name:"end",value:this.end},{name:"# downsampled:",value:this.counts}]}}class Fu{pixelTop=0;pixelBottom=0;rows=[];constructor(e){this.name=this.name}push(e){this.rows.push(e)}get length(){return this.rows.length}sortRows(e,t){const i=[],n=[];for(let t of this.rows){void 0!==t.findAlignment(e.position,e.sortAsPairs)?i.push(t):n.push(t)}i.sort(((i,n)=>{const r=e.direction,s=i.getSortValue(e,t),o=n.getSortValue(e,t);if(void 0===o&&void 0!==o)return 1;if(void 0!==s&&void 0===o)return-1;const a=s>o?1:s<o?-1:0;return!0===r?a:-a}));for(let e of n)i.push(e);this.rows=i}}function vu(e){return e.isPaired()&&e.mate&&e.isMateMapped()&&e.chr===e.mate.chr&&(e.isFirstOfPair()||e.isSecondOfPair())&&!(e.isSecondary()||e.isSupplementary())}function yu(e,t,i){let n=i-1,r=e.length;for(;1+n<r;){const i=n+(r-n>>1);t(e[i])?r=i:n=i}return r}function Au(e,t,i){let n,r,s;if(t.startsWith("tag:"))n=t.substring(4),t="tag";else if(t.startsWith("base:")){const e=t.split(":");3===e.length&&(t="base",r=e[1],s=Number.parseInt(e[2].replaceAll(",",""))-1)}switch(t){case"strand":return e.strand?"+":"-";case"firstOfPairStrand":const t=e.firstOfPairStrand;return void 0===t?"":t?"+":"-";case"mateChr":return e.mate&&e.isMateMapped()?e.mate.chr:"";case"pairOrientation":return fu[i][e.pairOrientation]||"";case"chimeric":return e.tags().SA?"chimeric":"";case"supplementary":return e.isSupplementary?"supplementary":"";case"readOrder":return e.isPaired()&&e.isFirstOfPair()?"first":e.isPaired()&&e.isSecondOfPair()?"second":"";case"phase":return e.tags().HP||"";case"tag":return e.tags()[n]||"";case"base":if(e.chr===r&&e.start<=s&&e.end>s){const t=e.readBaseAt(s);return t||"GAP"}return"";default:return}}const Cu=new Map([["A",1],["T",2],["C",3],["G",4],["N",5],["GAP",5],["",7]]);function _u(e,t){return Cu.has(e)&&Cu.has(t)?Cu.get(e)-Cu.get(t):e.localeCompare(t,void 0,{sensitivity:"base"})}function xu(e,t){return e===t?0:e&&t?-e.localeCompare(t):e?1:-1}function ku(e,t){if(e||t){if(e){if(t){if(e===t)return 0;if($s(e)&&($s(t),1))return Number.parseFloat(e)-Number.parseFloat(t);{let i=e.toString(),n=t.toString();return i.localeCompare(n,void 0,{sensitivity:"base"})}}return-1}return 1}return 0}class Iu{constructor(e){const t=e.split(",");this.chr=t[0],this.start=parseInt(t[1]),this.strand=t[2].charAt(0),this.mapQ=parseInt(t[4]),this.numMismatches=parseInt(t[5]),this.lenOnRef=function(e){let t=0,i="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(r>47&&r<58)i+=e.charAt(n);else{switch(r){case 78:case 68:case 77:case 61:case 88:t+=parseInt(i.toString())}i=""}}return t}(t[3])}printString(){return this.chr+":"+F(this.start)+"-"+F(this.start+this.lenOnRef)+" ("+this.strand+") = "+F(this.lenOnRef)+"bp @MAPQ: "+this.mapQ+" NM: "+this.numMismatches}}function Su(e){return e.split(";").filter((e=>e.length>0)).map((e=>new Iu(e)))}const Eu={c:1,C:1,s:2,S:2,i:4,I:4,f:4};class Nu{constructor(){this.hidden=!1}isMapped(){return!(4&this.flags)}isPaired(){return!!(1&this.flags)}isProperPair(){return!!(2&this.flags)}isFirstOfPair(){return!!(64&this.flags)}isSecondOfPair(){return!!(128&this.flags)}isSecondary(){return!!(256&this.flags)}isSupplementary(){return!!(2048&this.flags)}isFailsVendorQualityCheck(){return!!(512&this.flags)}isDuplicate(){return!!(1024&this.flags)}isMateMapped(){return!(8&this.flags)}isNegativeStrand(){return!!(16&this.flags)}isMateNegativeStrand(){return!!(32&this.flags)}hasTag(e){const t=this.tagDict||function(e){let t=0;const i=e.length,n={};for(;t<i;){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const s=String.fromCharCode(e[t++]);let o;if("A"===s)o=String.fromCharCode(e[t]),t++;else if("i"===s||"I"===s)o=Bu(e,t),t+=4;else if("c"===s)o=zu(e,t),t++;else if("C"===s)o=Lu(e,t),t++;else if("s"===s||"S"===s)o=Du(e,t),t+=2;else if("f"===s)o=Tu(e,t),t+=4;else if("Z"===s)for(o="";;){var r=e[t++];if(0===r)break;o+=String.fromCharCode(r)}else{if("B"!==s){o="Error unknown type: "+s,n[i]=o;break}{const r=String.fromCharCode(e[t++]);let s=Eu[r];if(void 0===s){n[i]=`Error: unknown element type '${r}'`;break}const a=Bu(e,t);t+=4;const c=t+a*s;o=[];const l=new DataView(e.buffer);for(;t<c;){switch(r){case"c":o.push(l.getInt8(t));break;case"C":o.push(l.getUint8(t));break;case"s":o.push(l.getInt16(t));break;case"S":o.push(l.getUint16(t));break;case"i":o.push(l.getInt32(t));break;case"I":o.push(l.getUint32(t));break;case"f":o.push(l.getFloat32(t))}t+=s}}}n[i]=o}return n}(this.tagBA);return t.hasOwnProperty(e)}tags(){return this.tagDict}getTag(e){return this.tags()[e]}get firstOfPairStrand(){if(this.isPaired()){if(this.isFirstOfPair())return this.strand;if(this.isMateMapped())return this.mate.strand}}containsLocation(e,t){const i=t?this.scStart:this.start,n=t?this.scLengthOnRef:this.lengthOnRef;return e>=i&&e<=i+n}popupData(e){const t=[];if(e=Math.floor(e),this.insertions){const n=this.seq;for(let r of this.insertions){var i=r.start;if(e===i||e===i-1)return t.push({name:"Insertion",value:n.substr(r.seqOffset,r.len)}),t.push({name:"Location",value:i}),t}}t.push({name:"Read Name",value:this.readName}),t.push("<hr/>"),t.push({name:"Alignment Start",value:F(1+this.start),borderTop:!0}),t.push({name:"Read Strand",value:!0===this.strand?"(+)":"(-)",borderTop:!0});let n=this.cigar;if(n&&n.length>50){const e=25;n=`${n.substring(0,e-2)} ... ${n.substring(n.length-e+2)}`}t.push({name:"Cigar",value:n}),t.push({name:"Mapping Quality",value:this.mq}),t.push({name:"Secondary",value:a(this.isSecondary())}),t.push({name:"Supplementary",value:a(this.isSupplementary())}),t.push({name:"Duplicate",value:a(this.isDuplicate())}),t.push({name:"Failed QC",value:a(this.isFailsVendorQualityCheck())}),this.isPaired()&&(t.push("<hr/>"),t.push({name:"First in Pair",value:!this.isSecondOfPair(),borderTop:!0}),t.push({name:"Mate is Mapped",value:a(this.isMateMapped())}),this.pairOrientation&&t.push({name:"Pair Orientation",value:this.pairOrientation}),this.isMateMapped()&&(t.push({name:"Mate Chromosome",value:this.mate.chr}),t.push({name:"Mate Start",value:this.mate.position+1}),t.push({name:"Mate Strand",value:!0===this.mate.strand?"(+)":"(-)"}),t.push({name:"Insert Size",value:this.fragmentLength})));const r=this.tags();if(r.hasOwnProperty("SA")){t.push("<hr/>"),t.push({name:"Supplementary Alignments",value:""});const e=Su(r.SA);if(e){t.push("<ul>");for(let i of e)t.push(`<li>${i.printString()}</li>`);t.push("</ul>")}}const s=new Set(["SA","MD"]);t.push("<hr/>");for(let e in r)s.has(e)||t.push({name:e,value:r[e]});t.push({name:"Hidden Tags",value:"SA, MD"}),t.push("<hr/>"),t.push({name:"Genomic Location: ",value:F(1+e)}),t.push({name:"Read Base:",value:this.readBaseAt(e)}),t.push({name:"Base Quality:",value:this.readBaseQualityAt(e)});const o=this.getBaseModificationSets();if(o){const i=this.positionToReadIndex(e);if(void 0!==i){let e=!1;for(let n of o)if(n.containsPosition(i)){e||(t.push("<hr/>"),t.push("<b>Base modifications:</b>"),e=!0);const r=Math.round(100/255*hu(n.likelihoods.get(i)));t.push(`${n.fullName()} @ likelihood = ${r}%`)}}}return t;function a(e){return e?"Yes":"No"}}readBaseAt(e){const t=Ru(this.blocks,e);if(t){if("*"===this.seq)return"*";{const i=t.seqIndexAt(e);return this.seq[i]}}}readBaseQualityAt(e){const t=Ru(this.blocks,e);if(t){if("*"===this.qual)return 30;{const i=t.seqIndexAt(e);return i>=0&&this.qual&&i<this.qual.length?this.qual[i]:30}}}gapSizeAt(e){if(this.gaps)for(let t of this.gaps)if(e>=t.start&&e<t.start+t.len)return t.len;return 0}softClippedBlocks(){let e,t,i;for(let n of this.blocks)"S"===n.type?i?t=n:e=n:"H"!==n.type&&(i=!0);return{left:e,right:t}}getBaseModificationSets(){if(!this.baseModificationSets&&(this.tagDict.MM||this.tagDict.Mm)){const e=this.tagDict.MM||this.tagDict.Mm,t=this.tagDict.ML||this.tagDict.Ml;!b(e)||t&&!Array.isArray(t)||(0===e.length?this.baseModificationSets=Mu:this.baseModificationSets=function(e,t,i,n){n&&(i=lo(i));const r=[],s=e.split(";");let o=0;for(let e of s){const s=e.split(","),a=s[0].charAt(0),c=s[0].charAt(1),l=s[0].endsWith(".");if(1==s.length);else{const e=s[0].endsWith(".")||s[0].endsWith("?")?s[0].substring(2,s[0].length-1):s[0].substring(2);let h=[];if(e.length>1)if(lu(e))h.push(e);else for(let t=0;t<e.length;t++)h.push(e.substring(t,t+1));else h.push(e);const d=new Map;for(let e of h)d.set(e,new Map);let u=1,f=Number.parseInt(s[u++]),p=0,g=0;for(;p<i.length;){if("N"===a||i[p]===a){const e=n?i.length-1-p:p;if(g===f){for(let i of h){const n=t?t[o++]:255;d.get(i).set(e,n)}if(u<s.length)f=Number.parseInt(s[u++]),g=0;else{if(!l)break;f=-1}}else{if(l)for(let t of h)d.get(t).set(e,0);g++}}p++}for(let e of h)r.push(new su(a,c,e,d.get(e)))}}return r}(e,t,this.seq,this.isNegativeStrand()))}return this.baseModificationSets}getGroupValue(e,t,i){const n=this;switch(e){case"strand":return n.strand?"+":"-";case"firstOfPairStrand":const e=n.firstOfPairStrand;return void 0===e?"":e?"+":"-";case"mateChr":return n.mate&&n.isMateMapped()?n.mate.chr:"";case"pairOrientation":return fu[i][n.pairOrientation]||"";case"chimeric":return n.tags().SA?"chimeric":"";case"supplementary":return n.isSupplementary?"supplementary":"";case"readOrder":return n.isPaired()&&n.isFirstOfPair()?"first":n.isPaired()&&n.isSecondOfPair()?"second":"";case"phase":return n.tags().HP||"";case"tag":return n.tags()[t]||"";default:return}}positionToReadIndex(e){const t=Ru(this.blocks,e);return t?e-t.start+t.seqOffset:void 0}}const Mu=new Set;function Ru(e,t){for(let i=0;i<e.length;i++){const n=e[i];if(t>=n.start&&t<n.start+n.len)return n}}function Bu(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function Du(e,t){return e[t+1]<<8|e[t]}function Tu(e,t){return new DataView(e.buffer).getFloat32(t)}function zu(e,t){return new DataView(e.buffer).getInt8(t)}function Lu(e,t){return new DataView(e.buffer).getUint8(t)}class Hu{constructor(e){e&&Object.assign(this,e)}seqIndexAt(e){return Math.floor(e)-this.start+this.seqOffset}}class Pu{constructor(e){e||(e={}),this.vendorFailed=e.vendorFailed=!1!==e.vendorFailed,this.duplicate=e.duplicate=!1!==e.duplicate,this.secondary=e.secondary||!1,this.supplementary=e.supplementary||!1,this.mq=e.mq||0,e.readgroups&&(this.readgroups=new Set(e.readgroups))}pass(e){if(!e.isMapped())return!1;if(this.vendorFailed&&e.isFailsVendorQualityCheck())return!1;if(this.duplicate&&e.isDuplicate())return!1;if(this.secondary&&e.isSecondary())return!1;if(this.supplementary&&e.isSupplementary())return!1;if(e.mq<this.mq)return!1;if(this.readgroups){const t=e.tags().RG;return this.readgroups.has(t)}return!0}}const Ou=Wu(new Uint8Array([66,65,77,1]),0),Vu=["=","A","C","M","G","R","S","V","T","W","Y","H","K","D","B","N"],qu=["M","I","D","N","S","H","P","=","X","?","?","?","?","?","?","?"],Qu={c:1,C:1,s:2,S:2,i:4,I:4,f:4},Uu=1e4,ju={readHeader:async function(e,t,i){const n=en(await Mn.loadArrayBuffer(e,t));return ju.decodeBamHeader(n,i)},decodeBamHeader:function(e){const t=Wu(e,0);if(t!==Ou)throw new Error("BAM header errror: bad magic number. This could be caused by either a corrupt or missing file.");const i=Wu(e,4);let n="";for(var r=0;r<i;++r)n+=String.fromCharCode(e[r+8]);const s=Wu(e,i+8);let o=i+12;const a={},c=[];for(r=0;r<s;++r){const t=Wu(e,o);let i="";for(var l=0;l<t-1;++l)i+=String.fromCharCode(e[o+4+l]);a[i]=r,c[r]=i,o=o+8+t}return{magicNumber:t,size:o,chrNames:c,chrToIndex:a}},bam_tag2cigar:function(e,t,i,n,r,s){function o(e){return"C"===e||"c"===e||"A"===e?1:"S"===e||"s"===e?2:"I"===e||"i"===e||"f"===e?4:0}if(1!==s.length||r.start<0)return!1;for(var a=i+(n+1>>1)+n;a+4<t;){if("CG"===String.fromCharCode(e[a])+String.fromCharCode(e[a+1]))break;var c=String.fromCharCode(e[a+2]);if("B"===c)a+=8+o(c=String.fromCharCode(e[a+3]))*Wu(e,a+4);else if("Z"===c||"H"===c)for(a+=3;0!==e[a++];);else a+=3+o(c)}if(a>=t)return!1;if("B"!==String.fromCharCode(e[a+2])||"I"!==String.fromCharCode(e[a+3]))return!1;var l=Wu(e,a+4),h=a+8;if(h+4*l>t)return!1;var d="",u=0;s.length=0,a=h;for(var f=0;f<l;++f,a+=4){var p=Wu(e,a),g=p>>4,m=qu[15&p];"M"!==m&&"EQ"!==m&&"X"!==m&&"D"!==m&&"N"!==m&&"="!==m||(u+=g),d=d+g+m,s.push({len:g,ltr:m})}return r.cigar=d,r.lengthOnRef=u,!0},decodeBamRecords:function(e,t,i,n,r,s,o,a){for(;t<e.length;){const u=t+Wu(e,t)+4,f=new Nu,p=Wu(e,t+4),g=Wu(e,t+8);if(u>e.length)return;if(p<0){t=u;continue}if(void 0!==r&&(p>r||g>o))return!0;if(void 0!==r&&p<r){t=u;continue}const m=Wu(e,t+12),w=(65280&m)>>8,b=255&m,F=Wu(e,t+16),v=(4294901760&F)>>16,y=65535&F,A=Wu(e,t+20),C=Wu(e,t+24),_=Wu(e,t+28),x=Wu(e,t+32);let k=[];for(let i=0;i<b-1;++i)k.push(String.fromCharCode(e[t+36+i]));k=k.join("");let I=0,S="",E=t+36+b;const N=[];let M;for(let t=0;t<y;++t){var c=Wu(e,E),l=c>>4,h=qu[15&c];"M"!==h&&"EQ"!==h&&"X"!==h&&"D"!==h&&"N"!==h&&"="!==h||(I+=l),S=S+l+h,E+=4,M={len:l,ltr:h},N.push(M)}if(f.chr=n[p],f.start=g,f.flags=v,f.strand=!(16&v),f.readName=k,f.cigar=S,f.lengthOnRef=I,f.fragmentLength=x,f.mq=w,ju.bam_tag2cigar(e,u,E,A,f,N),f.end=f.start+f.lengthOnRef,f.end<s){t=u;continue}let R=[];const B=A+1>>1;for(let t=0;t<B;++t){var d=e[E+t];R.push(Vu[(240&d)>>4]),R.push(Vu[15&d])}R=R.slice(0,A).join(""),E+=B;const D=[];for(let t=0;t<A;++t)D.push(e[E+t]);E+=A,C>=0&&(f.mate={chr:n[C],position:_,strand:!(32&v)}),f.seq=R,f.qual=D;const T=new Uint8Array(e.buffer.slice(E,u));f.tagDict=Yu(T),this.setPairOrientation(f),(void 0===a||a.pass(f))&&(Gu(f,N),i.push(f)),t=u}},decodeSamRecords:function(e,t,i,n,r,s){var o,a,c,l,h,d,u,f,p,g;for(l=(o=v(e)).length,a=0;a<l;a++)if(h=o[a].split("\t"),(p=new Nu).chr=h[2],p.start=Number.parseInt(h[3])-1,p.flags=Number.parseInt(h[1]),p.readName=h[0],p.strand=!(16&p.flags),p.mq=Number.parseInt(h[4]),p.cigar=h[5],p.fragmentLength=Number.parseInt(h[8]),p.seq=h[9],"*"!==p.chr&&p.isMapped()&&p.chr===i){if(p.start>r)break;if(f=0,(g=$u(p.cigar)).forEach((function(e){var t=e.len,i=e.ltr;"M"!==i&&"EQ"!==i&&"X"!==i&&"D"!==i&&"N"!==i&&"="!==i||(f+=t)})),p.lengthOnRef=f,!(p.start+f<n)){for(d=h[10],p.qual=[],c=0;c<d.length;c++)p.qual[c]=d.charCodeAt(c)-33;p.tagDict=h.length<11?{}:Ku(h.slice(11)),p.isMateMapped()&&(u=h[6],p.mate={chr:"="===u?p.chr:u,position:Number.parseInt(h[7]),strand:!(32&p.flags)}),this.setPairOrientation(p),(void 0===s||s.pass(p))&&(Gu(p,g),t.push(p))}}},setReaderDefaults:function(e,t){e.filter="function"==typeof t.filter?{pass:t.filter}:new Pu(t.filter),t.readgroup&&(e.filter.readgroups=new Set([t.readgroup])),e.alleleFreqThreshold=void 0===t.alleleFreqThreshold?.2:t.alleleFreqThreshold,e.samplingWindowSize=void 0===t.samplingWindowSize?100:t.samplingWindowSize,e.samplingDepth=void 0===t.samplingDepth?500:t.samplingDepth,e.samplingDepth>Uu&&(console.log("Warning: attempt to set sampling depth > maximum value of "+Uu),e.samplingDepth=Uu)},setPairOrientation:function(e){if(e.isMapped()&&e.mate&&e.isMateMapped()&&e.mate.chr===e.chr){var t=e.strand?"F":"R",i=e.mate,n=i.strand?"F":"R",r=" ",s=" ";e.isFirstOfPair()?(r="1",s="2"):e.isSecondOfPair()&&(r="2",s="1");var o=[],a=e.fragmentLength,c=e.end-e.start;if(0===a)a=(e.start<i.position?i.position+c:i.position-c)-e.start;a>0?(o[0]=t,o[1]=r,o[2]=n,o[3]=s):(o[2]=t,o[3]=r,o[0]=n,o[1]=s),e.pairOrientation=o.join("")}}};function Gu(e,t){const i=[];let n,r,s=0,o=e.start;e.scStart=e.start,e.scLengthOnRef=e.lengthOnRef;for(let a of t){let t;switch(a.ltr){case"H":case"P":break;case"S":t=o,e.scLengthOnRef+=a.len,0===i.length&&(e.scStart-=a.len,t-=a.len),i.push(new Hu({start:t,seqOffset:s,len:a.len,type:"S"})),s+=a.len;break;case"N":case"D":void 0===r&&(r=[]),r.push({start:o,len:a.len,type:a.ltr}),o+=a.len;break;case"I":void 0===n&&(n=[]),n.push(new Hu({start:o,len:a.len,seqOffset:s,type:"I"})),s+=a.len;break;case"M":case"EQ":case"=":case"X":i.push(new Hu({start:o,seqOffset:s,len:a.len,type:"M"})),s+=a.len,o+=a.len;break;default:console.log("Error processing cigar element: "+a.len+a.ltr)}}e.blocks=i,e.insertions=n,e.gaps=r}function Wu(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function $u(e){var t,i,n,r,s,o,a,c,l;for(t=[],i=[],s=null,r=e.length,n=0;n<r;n++)o=e.charAt(n),l=void 0,(l=o.charCodeAt(0))>=48&&l<=57?i.push(o):(a=o,c=Number.parseInt(i.join("")),i=[],null!==s&&s.ltr===a?s.len+=c:(s={len:c,ltr:a},t.push(s)));return t}function Ku(e){var t={};return e.forEach((function(e){var i=e.split(":");t[i[0]]=i[2]})),t}function Yu(e){let t=0;const i=e.length,n={},r=new DataView(e.buffer);for(;t<i;){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const o=String.fromCharCode(e[t++]);let a;if("A"===o)a=String.fromCharCode(e[t]),t++;else if("i"===o||"I"===o)a=r.getInt32(t,!0),t+=4;else if("c"===o)a=r.getInt8(t,!0),t++;else if("C"===o)a=r.getUint8(t,!0),t++;else if("s"===o||"S"===o)a=r.getInt16(t,!0),t+=2;else if("f"===o)a=r.getFloat32(t,!0),t+=4;else if("Z"===o)for(a="";;){var s=e[t++];if(0===s)break;a+=String.fromCharCode(s)}else{if("B"!==o){a="Error unknown type: "+o,n[i]=a;break}{const s=String.fromCharCode(e[t++]);let o=Qu[s];if(void 0===o){n[i]=`Error: unknown element type '${s}'`;break}const c=r.getInt32(t,!0);t+=4;const l=t+c*o;for(a=[];t<l;){switch(s){case"c":a.push(r.getInt8(t,!0));break;case"C":a.push(r.getUint8(t,!0));break;case"s":a.push(r.getInt16(t,!0));break;case"S":a.push(r.getUint16(t,!0));break;case"i":a.push(r.getInt32(t,!0));break;case"I":a.push(r.getUint32(t,!0));break;case"f":a.push(r.getFloat32(t,!0))}t+=o}}}n[i]=a}return n}class Xu{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.isDataUri=Xs(e.url),ju.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.alignmentCache){let e;if(this.isDataUri){e=en(function(e){const t=e.split(","),i=t[0].split(":")[1];let n=t[1];n=i.indexOf("base64")>=0?atob(n):decodeURI(n);const r=new Uint8Array(n.length);for(var s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r}(this.bamPath).buffer)}else{e=en(await Mn.loadArrayBuffer(this.bamPath,js(this.config)))}this.alignmentCache=this.#C(e)}const n=await this.#_(e),r=this.alignmentCache.queryFeatures(n,t,i),s=new pu(e,t,i,this.config);for(let e of r)s.push(e);return s.finish(),s}#C(e){const t=[];return this.header=ju.decodeBamHeader(e),ju.decodeBamRecords(e,this.header.size,t,this.header.chrNames,void 0,0,Number.MAX_SAFE_INTEGER,this.filter),new On(t,this.genome)}async#_(e){const t=new Set(this.header.chrNames);if(t.has(e))return e;if(this.chrAliasTable.has(e))return this.chrAliasTable.get(e);if(this.genome){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>t.has(e)));e.length>0&&(n=e[0])}return this.chrAliasTable.set(e,n),n}return e}}class Zu{chrAliasTable=new Map;constructor(e,t){this.config=e,this.genome=t,this.bamPath=e.url,this.baiPath=e.indexURL,ju.setReaderDefaults(this,e),this._blockLoader=new Ac(e)}async readAlignments(e,t,i){const n=await this.#x(e),r=new pu(e,t,i,this.config);if(void 0===n)return r;{const e=(await this.getIndex()).chunksForRange(n,t,i);if(!e||0===e.length)return r;for(let s of e){const e=await this._blockLoader.getData(s.minv,s.maxv);if(ju.decodeBamRecords(e,s.minv.offset,r,this.header.chrNames,n,t,i,this.filter))break}return r.finish(),r}}async#x(e){if(await this.getHeader(),this.chrAliasTable.has(e)&&void 0===(e=this.chrAliasTable.get(e)))return;let t=this.header.chrToIndex[e];if(void 0===t){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>void 0!==this.header.chrToIndex[e]));e.length>0&&(n=e[0],t=this.header.chrToIndex[e[0]])}this.chrAliasTable.set(e,n)}return t}async getHeader(){if(!this.header){const e=this.genome,t=await this.getIndex();let i;if(t.firstBlockPosition){const e=js(this.config,{range:{start:t.firstBlockPosition,size:26}}),n=tn(await Mn.loadArrayBuffer(this.bamPath,e));i=t.firstBlockPosition+n}else i=64e3;const n=js(this.config,{range:{start:0,size:i}});this.header=await ju.readHeader(this.bamPath,n,e)}return this.header}async getIndex(){return this.index||(this.index=await mc(this.baiPath,this.config)),this.index}async getChrIndex(){if(this.chrToIndex)return this.chrToIndex;{const e=await this.getHeader();return this.chrToIndex=e.chrToIndex,this.indexToChr=e.chrNames,this.chrNames=new Set(e.chrNames),this.chrToIndex}}}class Ju{constructor(e,t){this.config=e,this.genome=t;const i={};e.sources.sequences.forEach((function(n){const r=t?t.getChromosomeName(n):n;i[r]=function(e,t,i){const n={url:e.sources.url.replace("$CHR",i)};e.sources.indexURL&&(n.indexURL=e.sources.indexURL.replace("$CHR",i));const r=Object.assign(e,n);return new Zu(r,t)}(e,t,n)})),this.bamReaders=i,ju.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(this.bamReaders.hasOwnProperty(e)){let n=this.bamReaders[e];return await n.readAlignments(e,t,i)}return new pu(e,t,i,this.config)}}const ef=function(e,t){this.config=e,this.genome=t,ju.setReaderDefaults(this,e)};function tf(){const e=this,t=this.genome;if(this.header)return Promise.resolve(this.header);{const i=this.config.url+"?file="+this.config.alignmentFile+"&options=-b,-H",n=js(this.config);return ju.readHeader(i,n,t).then((function(t){return e.header=t,t}))}}ef.prototype.readAlignments=function(e,t,i){var n=this;return tf.call(n).then((function(r){var s,o;return s=r.chrAliasTable.hasOwnProperty(e)?r.chrAliasTable[e]:e,o=n.config.url+"?reference="+n.config.referenceFile+"&file="+n.config.alignmentFile+"®ion="+s+":"+t+"-"+i,Mn.loadString(o,js(n.config)).then((function(o){var a;return r.chrToIndex[s],a=new pu(e,t,i,n.config),ju.decodeSamRecords(o,a,s,t,i,n.filter),a}))}))};class nf extends Dc{constructor(e,t){super(e,t),ju.setReaderDefaults(this,e)}async readAlignments(e,t,i){if(!this.header){const e=en((await this.readHeaderData()).buffer);this.header=ju.decodeBamHeader(e,this.genome),this.chrAliasTable=new Map;for(let e of this.header.chrNames)this.chrAliasTable.set(e,this.genome.getChromosomeName(e))}let n=this.chrAliasTable.has(e)?this.chrAliasTable.get(e):e;const r=en((await this.readData(n,t,i)).buffer);this.header=ju.decodeBamHeader(r,this.genome);const s=this.header.chrToIndex[e],o=new pu(e,t,i,this.config);return ju.decodeBamRecords(r,this.header.size,o,this.header.chrNames,s,t,i,this.filter),o.finish(),o}}
|
|
26
26
|
/*! For license information please see cram-bundle.js.LICENSE.txt */var rf=(()=>{var e={4923:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(9747),r=i(5931),s=i(8876);function o(e,t){const[i,n,r,s,o,a]=t,c=i;e[c]||(e[c]=[]),e[c].push({start:n,span:r,containerStart:s,sliceStart:o,sliceBytes:a})}t.default=class{constructor(e){this.filehandle=(0,r.open)(e.url,e.path,e.filehandle)}async parseIndex(){const e={},t=31===(i=await this.filehandle.readFile())[0]&&139===i[1]?(0,s.unzip)(i):i;var i;const r=new DataView(t.buffer);if(t.length>4&&21578050===r.getUint32(0,!0))throw new n.CramMalformedError("invalid .crai index file. note: file appears to be a .bai index. this is technically legal but please open a github issue if you need support");let a=[],c="";for(const i of t)if(i>=48&&i<=57||!c&&45===i)c+=String.fromCharCode(i);else if(9===i)a.push(Number.parseInt(c,10)),c="";else if(10===i)a.push(Number.parseInt(c,10)),c="",o(e,a),a=[];else if(13!==i&&32!==i)throw new n.CramMalformedError("invalid .crai index file");return c&&a.push(Number.parseInt(c,10)),6===a.length&&o(e,a),Object.entries(e).forEach((([t,i])=>{const n=i;e[t]=n.sort(((e,t)=>e.start-t.start||e.span-t.span))})),e}getIndex(){return this.parseIndexP||(this.parseIndexP=this.parseIndex().catch((e=>{throw this.parseIndexP=void 0,e}))),this.parseIndexP}async hasDataForReferenceSequence(e){return!!(await this.getIndex())[e]}async getEntriesForRange(e,t,i){const n=(await this.getIndex())[e];if(!n)return[];const r=e=>{const n=e.start,r=e.start+e.span;return n>i?-1:r<=t?1:0},s=[];for(const e of n)0===r(e)&&s.push(e);return s}}},9508:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t){this.parameters=e,this.dataType=t}}},368:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(612),o=i(9747);class a extends r.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new o.CramUnimplementedError(`${this.dataType} decoding not yet implemented by BETA codec`)}decode(e,t,i,n){return(0,s.getBits)(t.content,n.coreBlock,this.parameters.length)-this.parameters.offset}}t.default=a},8635:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(400);class o extends r.default{constructor(e,t,i){super(e,t),this.instantiateCodec=i}decode(e,t,i,n){const r=this._getLengthCodec().decode(e,t,i,n)||0,s=this._getDataCodec(),o=new Uint8Array(r);for(let a=0;a<r;a+=1)o[a]=s.decode(e,t,i,n)||0;return o}_getLengthCodec(){const e=this.parameters.lengthsEncoding;return this.instantiateCodec(e,"int")}_getDataCodec(){const e=this.parameters.valuesEncoding;return this.instantiateCodec(e,"byte")}}t.default=o,"_getLengthCodec _getDataCodec".split(" ").forEach((e=>{(0,s.tinyMemoize)(o,e)}))},4839:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(9747),o=i(612);class a extends r.default{decode(e,t,i,n){const{blockContentId:r}=this.parameters,o=i[r];if(!o)throw new s.CramMalformedError(`no block found with content ID ${r}`);const a=n.externalBlocks.getCursor(r);return this._decodeByteArray(o,a)}_decodeByteArray(e,t){const i=e.content,{stopByte:n}=this.parameters,r=t.bytePosition;let s=t.bytePosition;for(;i[s]!==n&&s<i.length;){if(s===i.length)throw new o.CramBufferOverrunError("byteArrayStop reading beyond length of data buffer?");s+=1}return t.bytePosition=s+1,i.subarray(r,s)}}t.default=a},8153:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(9747),o=i(400),a=i(612);class c extends r.default{constructor(e,t){if(super(e,t),"int"===this.dataType)this._decodeData=this._decodeInt;else{if("byte"!==this.dataType)throw new s.CramUnimplementedError(`${this.dataType} decoding not yet implemented by EXTERNAL codec`);this._decodeData=this._decodeByte}}decode(e,t,i,n){const{blockContentId:r}=this.parameters,s=i[r],o=n.externalBlocks.getCursor(r);return s?this._decodeData(s,o):void 0}_decodeInt(e,t){const[i,n]=(0,o.parseItf8)(e.content,t.bytePosition);return t.bytePosition=t.bytePosition+n,i}_decodeByte(e,t){if(t.bytePosition>=e.content.length)throw new a.CramBufferOverrunError("attempted to read beyond end of block. this file seems truncated.");return e.content[t.bytePosition++]}}t.default=c},8185:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(612),o=i(9747);class a extends r.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new o.CramUnimplementedError(`${this.dataType} decoding not yet implemented by GAMMA codec`)}decode(e,t,i,n){let r=1;for(;0===(0,s.getBits)(t.content,n.coreBlock,1);)r+=1;return((0,s.getBits)(t.content,n.coreBlock,r-1)|1<<r-1)-this.parameters.offset}}t.default=a},612:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CramBufferOverrunError=void 0,t.getBits=function(e,t,n){let r=0;if(t.bytePosition+(7-t.bitPosition+n)/8>e.length)throw new i("read error during decoding. the file seems to be truncated.");for(let i=n;i;i--)r<<=1,r|=e[t.bytePosition]>>t.bitPosition&1,t.bitPosition-=1,t.bitPosition<0&&(t.bytePosition+=1),t.bitPosition&=7;return r};class i extends Error{}t.CramBufferOverrunError=i},4341:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(612),o=i(9747);class a extends r.default{constructor(e,t){if(super(e,t),this.codes={},this.codeBook={},this.sortedCodes=[],this.sortedValuesByBitCode=[],this.sortedBitCodes=[],this.sortedBitLengthsByBitCode=[],this.bitCodeToValue=[],!["byte","int"].includes(this.dataType))throw new TypeError(`${this.dataType} decoding not yet implemented by HUFFMAN_INT codec`);this.buildCodeBook(),this.buildCodes(),this.buildCaches(),0===this.sortedCodes[0].bitLength&&(this._decode=this._decodeZeroLengthCode)}buildCodeBook(){let e=new Array(this.parameters.numCodes);for(let t=0;t<this.parameters.numCodes;t++)e[t]={symbol:this.parameters.symbols[t],bitLength:this.parameters.bitLengths[t]};e=e.sort(((e,t)=>e.bitLength-t.bitLength||e.symbol-t.symbol)),this.codeBook={},e.forEach((e=>{this.codeBook[e.bitLength]||(this.codeBook[e.bitLength]=[]),this.codeBook[e.bitLength].push(e.symbol)}))}buildCodes(){this.codes={};let e=0,t=-1;Object.entries(this.codeBook).forEach((([i,n])=>{const r=Number.parseInt(i,10);n.forEach((i=>{const n={bitLength:r,value:i,bitCode:0};t+=1;const s=r-e;if(t<<=s,n.bitCode=t,e+=s,function(e){let t=e-(e>>1)&1431655765;return t=(858993459&t)+(t>>2&858993459),16843009*(t+(t>>4)&252645135)>>24}(t)>r)throw new o.CramMalformedError("Symbol out of range");this.codes[i]=n}))}))}buildCaches(){this.sortedCodes=Object.values(this.codes).sort(((e,t)=>e.bitLength-t.bitLength||e.bitCode-t.bitCode)),this.sortedValuesByBitCode=this.sortedCodes.map((e=>e.value)),this.sortedBitCodes=this.sortedCodes.map((e=>e.bitCode)),this.sortedBitLengthsByBitCode=this.sortedCodes.map((e=>e.bitLength));const e=Math.max(...this.sortedBitCodes);this.bitCodeToValue=new Array(e+1).fill(-1);for(let e=0;e<this.sortedBitCodes.length;e+=1)this.bitCodeToValue[this.sortedCodes[e].bitCode]=e}decode(e,t,i,n){return this._decode(e,t,n.coreBlock)}_decodeZeroLengthCode(){return this.sortedCodes[0].value}_decode(e,t,i){const n=t.content;let r=0,a=0;for(let e=0;e<this.sortedCodes.length;e+=1){const t=this.sortedCodes[e].bitLength;a<<=t-r,a|=(0,s.getBits)(n,i,t-r),r=t;{const i=this.bitCodeToValue[a];if(i>-1&&this.sortedBitLengthsByBitCode[i]===t)return this.sortedValuesByBitCode[i];for(let i=e;this.sortedCodes[i+1].bitLength===t&&i<this.sortedCodes.length;i+=1)e+=1}}throw new o.CramMalformedError("Huffman symbol not found.")}}t.default=a},6524:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.instantiateCodec=function e(t,i){const n=(r="ignore"===i?0:t.codecId,u[r]);var r;if(!n)throw new d.CramUnimplementedError(`no codec implemented for codec ID ${t.codecId}`);return new n(t.parameters,i,e)};const r=n(i(368)),s=n(i(8635)),o=n(i(4839)),a=n(i(8153)),c=n(i(8185)),l=n(i(4341)),h=n(i(99)),d=i(9747),u={1:a.default,3:l.default,4:s.default,5:o.default,6:r.default,7:h.default,9:c.default}},99:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(9508)),s=i(612),o=i(9747);class a extends r.default{constructor(e,t){if(super(e,t),"int"!==this.dataType)throw new o.CramUnimplementedError(`${this.dataType} decoding not yet implemented by SUBEXP codec`)}decode(e,t,i,n){let r,o,a=0;for(;(0,s.getBits)(t.content,n.coreBlock,1);)a+=1;return 0===a?(r=this.parameters.K,o=(0,s.getBits)(t.content,n.coreBlock,r)):(r=a+this.parameters.K-1,o=1<<r|(0,s.getBits)(t.content,n.coreBlock,r)),o-this.parameters.offset}}t.default=a},7295:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={CRAM_FLAG_PRESERVE_QUAL_SCORES:1,CRAM_FLAG_DETACHED:2,CRAM_FLAG_MATE_DOWNSTREAM:4,CRAM_FLAG_NO_SEQ:8,CRAM_FLAG_MASK:15,CRAM_M_REVERSE:1,CRAM_M_UNMAP:2,BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048,BAM_CMATCH:0,BAM_CINS:1,BAM_CDEL:2,BAM_CREF_SKIP:3,BAM_CSOFT_CLIP:4,BAM_CHARD_CLIP:5,BAM_CPAD:6,BAM_CEQUAL:7,BAM_CDIFF:8,BAM_CBACK:9,BAM_CIGAR_STR:"MIDNSHP:XB",BAM_CIGAR_SHIFT:4,BAM_CIGAR_MASK:15,BAM_CIGAR_TYPE:246183}},7219:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(9747),r=i(6524),s={BF:"int",CF:"int",RI:"int",RL:"int",AP:"int",RG:"int",MF:"int",NS:"int",NP:"int",TS:"int",NF:"int",TC:"byte",TN:"int",FN:"int",FC:"byte",FP:"int",BS:"byte",IN:"byteArray",SC:"byteArray",DL:"int",BA:"byte",BB:"byteArray",RS:"int",PD:"int",HC:"int",MQ:"int",RN:"byteArray",QS:"byte",QQ:"byteArray",TL:"int"};t.default=class{constructor(e){this.dataSeriesCodecCache={},this.tagCodecCache={},this.tagEncoding={},this.readNamesIncluded=e.preservation.RN,this.APdelta=e.preservation.AP,this.referenceRequired=!!e.preservation.RR,this.tagIdsDictionary=e.preservation.TD,this.substitutionMatrix=function(e){const t=new Array(5);for(let e=0;e<5;e+=1)t[e]=new Array(4);return t[0][e[0]>>6&3]="C",t[0][e[0]>>4&3]="G",t[0][e[0]>>2&3]="T",t[0][3&e[0]]="N",t[1][e[1]>>6&3]="A",t[1][e[1]>>4&3]="G",t[1][e[1]>>2&3]="T",t[1][3&e[1]]="N",t[2][e[2]>>6&3]="A",t[2][e[2]>>4&3]="C",t[2][e[2]>>2&3]="T",t[2][3&e[2]]="N",t[3][e[3]>>6&3]="A",t[3][e[3]>>4&3]="C",t[3][e[3]>>2&3]="G",t[3][3&e[3]]="N",t[4][e[4]>>6&3]="A",t[4][e[4]>>4&3]="C",t[4][e[4]>>2&3]="G",t[4][3&e[4]]="T",t}(e.preservation.SM),this.dataSeriesEncoding=e.dataSeriesEncoding,this.tagEncoding=e.tagEncoding}getCodecForTag(e){const t=this.tagCodecCache[e];if(t)return t;{const t=this.tagEncoding[e];if(!t)throw new Error("Error, no tag encoding");const i=(0,r.instantiateCodec)(t,"byteArray");return this.tagCodecCache[e]=i,i}}getTagNames(e){return this.tagIdsDictionary[e]}getCodecForDataSeries(e){let t=this.dataSeriesCodecCache[e];if(void 0===t){const i=this.dataSeriesEncoding[e];if(i){const o=s[e];if(!o)throw new n.CramMalformedError(`data series name ${e} not defined in file compression header`);t=(0,r.instantiateCodec)(i,o),this.dataSeriesCodecCache[e]=t}}return t}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.endsWith("Cache")||(e[t]=this[t])})),e}}},78:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=n(i(6771)),o=i(400),a=n(i(7219)),c=i(3165);class l{constructor(e,t){this.file=e,this.filePosition=t}getHeader(){return this._readContainerHeader(this.filePosition)}async getCompressionHeaderBlock(){if(!(await this.getHeader()).numRecords)return null;const{majorVersion:e}=await this.file.getDefinition(),t=(0,c.getSectionParsers)(e),i=await this.getFirstBlock();if("COMPRESSION_HEADER"!==i.contentType)throw new r.CramMalformedError(`invalid content type ${i.contentType} in compression header block`);const n=(0,o.parseItem)(i.content,t.cramCompressionHeader.parser,0,i.contentPosition);return{...i,parsedContent:n}}async getFirstBlock(){const e=await this.getHeader();return this.file.readBlock(e._endPosition)}async getCompressionScheme(){const e=await this.getCompressionHeaderBlock();if(e)return new a.default(e.parsedContent)}getSlice(e,t){return new s.default(this,e,t)}async _readContainerHeader(e){const{majorVersion:t}=await this.file.getDefinition(),i=(0,c.getSectionParsers)(t),{cramContainerHeader1:n,cramContainerHeader2:r}=i,s=await this.file.read(n.maxLength,e),a=(0,o.parseItem)(s,n.parser),l=(0,o.itf8Size)(a.numLandmarks),h=await this.file.read(r.maxLength(a.numLandmarks),e+a._size-l),d=(0,o.parseItem)(h,r.parser);return this.file.validateChecksums&&void 0!==d.crc32&&await this.file.checkCrc32(e,a._size+d._size-l-4,d.crc32,`container header beginning at position ${e}`),{...a,...d,_size:a._size+d._size-l,_endPosition:a._size+d._size-l+e}}}t.default=l,"getHeader getCompressionHeaderBlock getCompressionScheme".split(" ").forEach((e=>{(0,o.tinyMemoize)(l,e)}))},6794:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),o=0;o<i.length;o++)"default"!==i[o]&&r(t,e,i[o]);return s(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const c=a(i(86)),l=a(i(7392)),h=i(1307),d=i(9747),u=o(i(9151)),f=i(5931),p=a(i(9989)),g=i(5417),m=i(9995),w=i(8876),b=a(i(78)),F=i(3165),v=i(400);class y{constructor(e){if(this.file=(0,f.open)(e.url,e.path,e.filehandle),this.validateChecksums=!0,this.fetchReferenceSequenceCallback=e.seqFetch,this.options={checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize??2e4},this.featureCache=new l.default({maxSize:this.options.cacheSize}),function(){const e=new Uint32Array([287454020]),t=new Uint8Array(e.buffer);return 68===t[0]?0:17===t[0]?1:2}()>0)throw new Error("Detected big-endian machine, may be unable to run")}read(e,t){return this.file.read(e,t)}async getDefinition(){const{maxLength:e,parser:t}=(0,F.cramFileDefinition)(),i=t(await this.file.read(e,0)).value;if(2!==i.majorVersion&&3!==i.majorVersion)throw new d.CramUnimplementedError(`CRAM version ${i.majorVersion} not supported`);return i}async getSamHeader(){const e=await this.getContainerById(0);if(!e)throw new d.CramMalformedError("file contains no containers");const t=(await e.getFirstBlock()).content,i=new DataView(t.buffer).getInt32(0,!0),n=new TextDecoder("utf8").decode(t.subarray(4,4+i));return this.header=n,(0,g.parseHeaderText)(n)}async getHeaderText(){return await this.getSamHeader(),this.header}async getContainerById(e){const{majorVersion:t}=await this.getDefinition();let i,n=(0,F.getSectionParsers)(t).cramFileDefinition.maxLength;for(let t=0;t<=e;t++){i=this.getContainerAtPosition(n);const e=await i.getHeader();if(0===t){n=e._endPosition;for(let t=0;t<e.numBlocks;t++)n=(await this.readBlock(n))._endPosition}else n+=e._size+e.length}return i}async checkCrc32(e,t,i,n){const r=await this.file.read(t,e),s=(0,c.default)(r)>>>0;if(s!==i)throw new d.CramMalformedError(`crc mismatch in ${n}: recorded CRC32 = ${i}, but calculated CRC32 = ${s}`)}async containerCount(){const{majorVersion:e}=await this.getDefinition();let t=0,i=(0,F.getSectionParsers)(e).cramFileDefinition.maxLength;try{for(;;){const e=await this.getContainerAtPosition(i).getHeader();if(0===t){i=e._endPosition;for(let t=0;t<e.numBlocks;t++)i=(await this.readBlock(i))._endPosition}else i+=e._size+e.length;t+=1}}catch(e){t--}return t}getContainerAtPosition(e){return new b.default(this,e)}async readBlockHeader(e){const{majorVersion:t}=await this.getDefinition(),i=(0,F.getSectionParsers)(t),{cramBlockHeader:n}=i,r=await this.file.read(n.maxLength,e);return(0,v.parseItem)(r,n.parser,0,e)}async _parseSection(e,t,i=e.maxLength,n){const r=n??await this.file.read(i,t),s=(0,v.parseItem)(r,e.parser,0,t);if(s._size!==i)throw new d.CramMalformedError(`section read error: requested size ${i} does not equal parsed size ${s._size}`);return s}async _uncompressPre(e,t,i){if("gzip"===e){const e=(0,w.unzip)(t);return e[0],e}if("bzip2"===e)return(0,m.decode)(t);if("lzma"===e){const e=new Response(new h.XzReadableStream((n=t,new ReadableStream({start(e){e.enqueue(n),e.close()}}))));return new Uint8Array(await e.arrayBuffer())}if("rans"===e){const e=new Uint8Array(i);return(0,p.default)(t,e),e}if("rans4x16"===e)return u.r4x16_uncompress(t);if("arith"===e)return u.arith_uncompress(t);if("fqzcomp"===e)return u.fqzcomp_uncompress(t);if("tok3"===e)return u.tok3_uncompress(t);throw new d.CramUnimplementedError(`${e} decompression not yet implemented`);var n}async _uncompress(e,t,i){const n=await this._uncompressPre(e,t,i);if(n.length!==i){const e=new Uint8Array(i);return e.set(n,0),e}return n}async readBlock(e){const{majorVersion:t}=await this.getDefinition(),i=(0,F.getSectionParsers)(t),n=await this.readBlockHeader(e),r=n._endPosition,s=await this.file.read(n.compressedSize,r),o="raw"!==n.compressionMethod?await this._uncompress(n.compressionMethod,s,n.uncompressedSize):s,a={...n,_endPosition:r,contentPosition:r,content:o};if(t>=3){const t=await this._parseSection(i.cramBlockCrc32,r+n.compressedSize);a.crc32=t.crc32,this.validateChecksums&&await this.checkCrc32(e,n._size+n.compressedSize,t.crc32,"block data"),a._endPosition=t._endPosition,a._size=a.compressedSize+i.cramBlockCrc32.maxLength}else a._endPosition=r+a.compressedSize,a._size=a.compressedSize;return a}}t.default=y,"getDefinition getSectionParsers getSamHeader".split(" ").forEach((e=>{(0,v.tinyMemoize)(y,e)}))},7390:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.CramRecord=void 0;var r=i(8401);Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return n(r).default}});var s=i(6794);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n(s).default}})},8401:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MateFlagsDecoder=t.CramFlagsDecoder=t.BamFlagsDecoder=t.MateFlags=t.CramFlags=t.BamFlags=void 0;const r=n(i(7295)),s={a:0,A:0,c:1,C:1,g:2,G:2,t:3,T:3,n:4,N:4};function o(e){const t={};for(const[i,n]of e)t[`is${n}`]=e=>!!(e&i),t[`set${n}`]=e=>e|i;return t}t.BamFlags=[[1,"Paired"],[2,"ProperlyPaired"],[4,"SegmentUnmapped"],[8,"MateUnmapped"],[16,"ReverseComplemented"],[32,"MateReverseComplemented"],[64,"Read1"],[128,"Read2"],[256,"Secondary"],[512,"FailedQc"],[1024,"Duplicate"],[2048,"Supplementary"]],t.CramFlags=[[1,"PreservingQualityScores"],[2,"Detached"],[4,"WithMateDownstream"],[8,"DecodeSequenceAsStar"]],t.MateFlags=[[1,"OnNegativeStrand"],[2,"Unmapped"]],t.BamFlagsDecoder=o(t.BamFlags),t.CramFlagsDecoder=o(t.CramFlags),t.MateFlagsDecoder=o(t.MateFlags),t.default=class{constructor({flags:e,cramFlags:t,readLength:i,mappingQuality:n,lengthOnRef:r,qualityScores:s,mateRecordNumber:o,readBases:a,readFeatures:c,mateToUse:l,readGroupId:h,readName:d,sequenceId:u,uniqueId:f,templateSize:p,alignmentStart:g,tags:m}){this.flags=e,this.cramFlags=t,this.readLength=i,this.mappingQuality=n,this.lengthOnRef=r,this.qualityScores=s,a&&(this.readBases=a),this.readGroupId=h,this.readName=d,this.sequenceId=u,this.uniqueId=f,this.templateSize=p,this.alignmentStart=g,this.tags=m,c&&(this.readFeatures=c),l&&(this.mate={flags:l.mateFlags,readName:l.mateReadName,sequenceId:l.mateSequenceId,alignmentStart:l.mateAlignmentStart}),o&&(this.mateRecordNumber=o)}isPaired(){return!!(this.flags&r.default.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&r.default.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&r.default.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&r.default.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&r.default.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&r.default.BAM_FMREVERSE)}isRead1(){return!!(this.flags&r.default.BAM_FREAD1)}isRead2(){return!!(this.flags&r.default.BAM_FREAD2)}isSecondary(){return!!(this.flags&r.default.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&r.default.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&r.default.BAM_FDUP)}isSupplementary(){return!!(this.flags&r.default.BAM_FSUPPLEMENTARY)}isDetached(){return!!(this.cramFlags&r.default.CRAM_FLAG_DETACHED)}hasMateDownStream(){return!!(this.cramFlags&r.default.CRAM_FLAG_MATE_DOWNSTREAM)}isPreservingQualityScores(){return!!(this.cramFlags&r.default.CRAM_FLAG_PRESERVE_QUAL_SCORES)}isUnknownBases(){return!!(this.cramFlags&r.default.CRAM_FLAG_NO_SEQ)}getReadBases(){if(!this.readBases&&this._refRegion){const e=function(e,t){if(!e.lengthOnRef&&!e.readLength)return null;if(e.isUnknownBases())return null;const i=e.alignmentStart-t.start;if(!e.readFeatures)return t.seq.slice(i,i+(e.lengthOnRef||0)).toUpperCase();let n="",r=i,s=0;for(;n.length<e.readLength;)if(s<e.readFeatures.length){const i=e.readFeatures[s];if("Q"===i.code||"q"===i.code)s+=1;else if(i.pos===n.length+1)if(s+=1,"b"===i.code){const e=i.data;n+=e,r+=e.length}else"B"===i.code?(n+=i.data[0],r+=1):"X"===i.code?(n+=i.sub,r+=1):"I"===i.code?n+=i.data:"D"===i.code?r+=i.data:"i"===i.code?n+=i.data:"N"===i.code?r+=i.data:"S"===i.code?n+=i.data:"P"===i.code||i.code;else if(s<e.readFeatures.length){const e=t.seq.slice(r,r+i.pos-n.length-1);n+=e,r+=e.length}}else{const i=t.seq.slice(r,r+e.readLength-n.length);n+=i,r+=i.length}return n.toUpperCase()}(this,this._refRegion);e&&(this.readBases=e)}return this.readBases}getPairOrientation(){if(!this.isSegmentUnmapped()&&this.isPaired()&&!this.isMateUnmapped()&&this.mate&&this.sequenceId===this.mate.sequenceId){const e=this.isReverseComplemented()?"R":"F",t=this.isMateReverseComplemented()?"R":"F";let i=" ",n=" ";this.isRead1()?(i="1",n="2"):this.isRead2()&&(i="2",n="1");const r=[];let s=this.templateLength||this.templateSize;if(void 0===s)throw new Error("One of templateSize and templateLength must be set");return this.alignmentStart>this.mate.alignmentStart&&s>0&&(s=-s),s>0?(r[0]=e,r[1]=i,r[2]=t,r[3]=n):(r[2]=e,r[3]=i,r[0]=t,r[1]=n),r.join("")}return null}addReferenceSequence(e,t){this.readFeatures&&this.readFeatures.forEach((i=>{"X"===i.code&&function(e,t,i,n){const r=n.refPos-t.start,o=t.seq.charAt(r);o&&(n.ref=o);let a=s[o];void 0===a&&(a=4);const c=i.substitutionMatrix[a][n.data];c&&(n.sub=c)}(0,e,t,i)})),!this.readBases&&e.start<=this.alignmentStart&&e.end>=this.alignmentStart+(this.lengthOnRef||this.readLength)-1&&(this._refRegion=e)}toJSON(){const e={};return Object.keys(this).forEach((t=>{t.startsWith("_")||(e[t]=this[t])})),e.readBases=this.getReadBases(),e}}},3165:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.cramFileDefinition=r,t.cramBlockHeader=s,t.cramBlockCrc32=o,t.cramTagDictionary=c,t.cramPreservationMap=l,t.isMappedSliceHeader=function(e){return"number"==typeof e.refSeqId},t.getSectionParsers=function(e){return{cramFileDefinition:r(),cramBlockHeader:s(),cramBlockCrc32:o(),cramDataSeriesEncodingMap:p(),cramTagEncodingMap:g(),cramCompressionHeader:{parser:(e,t)=>{const{value:i,offset:n}=l().parser(e,t);t=n;const{value:r,offset:s}=p().parser(e,t);t=s;const{value:o,offset:a}=g().parser(e,t);return t=a,{value:{dataSeriesEncoding:h(r),preservation:h(i),tagEncoding:h(o)},offset:t}}},cramEncoding:{parser:(e,t)=>f(e,t)},cramUnmappedSliceHeader:d(e),cramMappedSliceHeader:u(e),cramContainerHeader1:m(e),cramContainerHeader2:w(e)}};const n=i(400);function r(){return{parser:(e,t=0)=>{const i=new DataView(e.buffer,e.byteOffset,e.length),n=new TextDecoder("utf8");let r=0;const s=n.decode(e.subarray(r,r+4));r+=4;const o=i.getUint8(r);r+=1;const a=i.getUint8(r);r+=1;const c=n.decode(e.subarray(r,r+20)).replaceAll("\0","");return r+=20,{value:{magic:s,majorVersion:o,minorVersion:a,fileId:c},offset:r}},maxLength:26}}function s(){return{parser:(e,t=0)=>{const i=e,r=new DataView(i.buffer,i.byteOffset,i.length);let s=0;const o=r.getUint8(s),a=["raw","gzip","bzip2","lzma","rans","rans4x16","arith","fqzcomp","tok3"][o];if(!a)throw new Error(`compression method number ${o} not implemented`);s+=1;const c=r.getUint8(s),l=["FILE_HEADER","COMPRESSION_HEADER","MAPPED_SLICE_HEADER","UNMAPPED_SLICE_HEADER","EXTERNAL_DATA","CORE_DATA"][c];if(!l)throw new Error(`invalid block content type id ${c}`);s+=1;const[h,d]=(0,n.parseItf8)(e,s);s+=d;const[u,f]=(0,n.parseItf8)(e,s);s+=f;const[p,g]=(0,n.parseItf8)(e,s);return s+=g,{offset:s,value:{uncompressedSize:p,compressedSize:u,contentId:h,contentType:l,compressionMethod:a}}},maxLength:17}}function o(){return{parser:(e,t)=>{const i=e,n=new DataView(i.buffer,i.byteOffset,i.length).getUint32(t,!0);return{offset:t+=4,value:{crc32:n}}},maxLength:4}}function a(e,t,i){const n=new TextDecoder("utf8").decode(e.subarray(t,i)),r=[];for(let e=0;e<n.length;e+=3)r.push(n.slice(e,e+3));return r}function c(){return{parser:(e,t)=>{const[i,r]=(0,n.parseItf8)(e,t);t+=r;const s=e.subarray(t,t+i);t+=i;const o=[];let c=0,l=0;for(;l<s.length;l++)s[l]||(o.push(a(s,c,l)),c=l+1);return l>c&&o.push(a(s,c,l)),{value:{size:i,ents:o},offset:t}}}}function l(){return{parser:(e,t)=>{const i=e,r=new DataView(i.buffer,i.byteOffset,i.length),[s,o]=(0,n.parseItf8)(e,t);t+=o;const[a,l]=(0,n.parseItf8)(e,t);t+=l;const h=[];for(let i=0;i<a;i++){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);if(t+=2,"MI"===i||"UI"===i||"PI"===i||"RN"===i||"AP"===i||"RR"===i)h.push({key:i,value:!!r.getUint8(t)}),t+=1;else if("SM"===i)h.push({key:i,value:[r.getUint8(t),r.getUint8(t+1),r.getUint8(t+2),r.getUint8(t+3),r.getUint8(t+4)]}),t+=5;else{if("TD"!==i)throw new Error(`unknown key ${i}`);{const{offset:n,value:r}=c().parser(e,t);h.push({key:i,value:r.ents}),t=n}}}return{value:{mapSize:s,mapCount:a,ents:h},offset:t}}}}function h(e){const t={};for(const{key:i,value:n}of e.ents)t[i]&&console.warn(`duplicate key ${i} in map`),t[i]=n;return t}function d(e){return{parser:(t,i)=>{const[r,s]=(0,n.parseItf8)(t,i);i+=s;let o=0;if(e>=3){const[e,r]=(0,n.parseLtf8)(t,i);i+=r,o=e}else if(2===e){const[e,r]=(0,n.parseItf8)(t,i);i+=r,o=e}else console.warn("recordCounter=0");const[a,c]=(0,n.parseItf8)(t,i);i+=c;const[l,h]=(0,n.parseItf8)(t,i);i+=h;const d=[];for(let e=0;e<l;e++){const[e,r]=(0,n.parseItf8)(t,i);i+=r,d.push(e)}let u;return e>=2&&(u=[...t.subarray(i,i+16)],i+=16),{value:{recordCounter:o,md5:u,contentIds:d,numContentIds:l,numBlocks:a,numRecords:r},offset:i}},maxLength:e=>40+5*e}}function u(e){return{parser:(t,i)=>{const[r,s]=(0,n.parseItf8)(t,i);i+=s;const[o,a]=(0,n.parseItf8)(t,i);i+=a;const[c,l]=(0,n.parseItf8)(t,i);i+=l;const[h,d]=(0,n.parseItf8)(t,i);i+=d;let u=0;if(e>=3){const[e,r]=(0,n.parseLtf8)(t,i);i+=r,u=e}else if(2===e){const[e,r]=(0,n.parseItf8)(t,i);i+=r,u=e}else console.warn("majorVersion is <2, recordCounter set to 0");const[f,p]=(0,n.parseItf8)(t,i);i+=p;const[g,m]=(0,n.parseItf8)(t,i);i+=m;const w=[];for(let e=0;e<g;e++){const[e,r]=(0,n.parseItf8)(t,i);i+=r,w.push(e)}const[b,F]=(0,n.parseItf8)(t,i);let v;return i+=F,e>=2&&(v=[...t.subarray(i,i+16)],i+=16),{value:{md5:v,numBlocks:f,numRecords:h,numContentIds:g,refSeqSpan:c,refSeqId:r,refSeqStart:o,recordCounter:u,refBaseBlockId:b,contentIds:w},offset:i}},maxLength:e=>60+5*e}}function f(e,t){const i=e,r=new DataView(i.buffer,i.byteOffset,i.length),[s,o]=(0,n.parseItf8)(e,t);t+=o;const[a,c]=(0,n.parseItf8)(e,t);t+=c;const l={};if(0===s);else if(1===s){const[i,r]=(0,n.parseItf8)(e,t);l.blockContentId=i,t+=r}else if(2===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.M=s,t+=o}else if(3===s){const i=(0,n.parseItf8)(e,t),r=i[0];t+=i[1];const s=[];for(let i=0;i<r;i++){const i=(0,n.parseItf8)(e,t);s.push(i[0]),t+=i[1]}l.symbols=s;const o=(0,n.parseItf8)(e,t),a=i[0];l.numLengths=a,l.numCodes=r,l.numLengths=a,t+=o[1];const c=[];for(let i=0;i<a;i++){const i=(0,n.parseItf8)(e,t);t+=i[1],c.push(i[0])}l.bitLengths=c}else if(4===s){const{value:i,offset:n}=f(e,t);l.lengthsEncoding=i,t=n;const{value:r,offset:s}=f(e,t);l.valuesEncoding=r,t=s}else if(5===s){l.stopByte=r.getUint8(t),t+=1;const[i,s]=(0,n.parseItf8)(e,t);l.blockContentId=i,t+=s}else if(6===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.length=s,t+=o}else if(7===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.K=s,t+=o}else if(8===s){const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r;const[s,o]=(0,n.parseItf8)(e,t);l.log2m=s,t+=o}else{if(9!==s)throw new Error(`unknown codecId ${s}`);{const[i,r]=(0,n.parseItf8)(e,t);l.offset=i,t+=r}}return{value:{codecId:s,parametersBytes:a,parameters:l},offset:t}}function p(){return{parser:(e,t)=>{const[i,r]=(0,n.parseItf8)(e,t);t+=r;const[s,o]=(0,n.parseItf8)(e,t);t+=o;const a=[];for(let i=0;i<s;i++){const i=String.fromCharCode(e[t])+String.fromCharCode(e[t+1]);t+=2;const{value:n,offset:r}=f(e,t);t=r,a.push({key:i,value:n})}return{value:{mapSize:i,ents:a,mapCount:s},offset:t}}}}function g(){return{parser:(e,t)=>{const[i,r]=(0,n.parseItf8)(e,t);t+=r;const[s,o]=(0,n.parseItf8)(e,t);t+=o;const a=[];for(let i=0;i<s;i++){const[i,r]=(0,n.parseItf8)(e,t);t+=r;const s=String.fromCharCode(i>>16&255)+String.fromCharCode(i>>8&255)+String.fromCharCode(255&i),{value:o,offset:c}=f(e,t);t=c,a.push({key:s,value:o})}return{value:{mapSize:i,ents:a,mapCount:s},offset:t}}}}function m(e){return{maxLength:52,parser:(t,i)=>{const r=t,s=new DataView(r.buffer,r.byteOffset,r.length).getInt32(i,!0);i+=4;const[o,a]=(0,n.parseItf8)(t,i);i+=a;const[c,l]=(0,n.parseItf8)(t,i);i+=l;const[h,d]=(0,n.parseItf8)(t,i);i+=d;const[u,f]=(0,n.parseItf8)(t,i);i+=f;let p,g=0;if(e>=3){const[e,r]=(0,n.parseLtf8)(t,i);g=e,i+=r}else if(2===e){const[e,r]=(0,n.parseItf8)(t,i);g=e,i+=r}else console.warn("setting recordCounter=0");if(e>1){const[e,r]=(0,n.parseLtf8)(t,i);p=e,i+=r}const[m,w]=(0,n.parseItf8)(t,i);i+=w;const[b,F]=(0,n.parseItf8)(t,i);return{value:{length:s,refSeqId:o,refSeqStart:c,alignmentSpan:h,numBlocks:m,numLandmarks:b,numBases:p,recordCounter:g,numRecords:u},offset:i+=F}}}}function w(e){return{parser:(t,i)=>{const r=t,s=new DataView(r.buffer,r.byteOffset,r.length),[o,a]=(0,n.parseItf8)(t,i);i+=a;const c=[];for(let e=0;e<o;e++){const[e,r]=(0,n.parseItf8)(t,i);i+=r,c.push(e)}let l;return e>=3&&(l=s.getUint32(i,!0),i+=4),{value:{...void 0===l?{}:{crc32:l},numLandmarks:o,landmarks:c},offset:i}},maxLength:e=>5+5*e+4}}},6484:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,c,l,h,d,u,f){let p=t("BF");const g=t("CF");if(!(0,s.isMappedSliceHeader)(c.parsedContent))throw new Error("slice header not mapped");const m=u>1&&-2===c.parsedContent.refSeqId?t("RI"):c.parsedContent.refSeqId,w=t("RL");let b=t("AP");i.APdelta&&(b+=d.lastAlignmentStart),d.lastAlignmentStart=b;const F=t("RG");let v,y,A,C;if(i.readNamesIncluded&&(v=o(t("RN"))),r.CramFlagsDecoder.isDetached(g)){const e=t("MF");let n;i.readNamesIncluded||(n=o(t("RN")),v=n);const s=t("NS"),a=t("NP");(e||s>-1)&&(y={mateFlags:e,mateSequenceId:s,mateAlignmentStart:a,mateReadName:n}),A=t("TS"),r.MateFlagsDecoder.isUnmapped(e)&&(p=r.BamFlagsDecoder.setMateUnmapped(p)),r.MateFlagsDecoder.isOnNegativeStrand(e)&&(p=r.BamFlagsDecoder.setMateReverseComplemented(p))}else r.CramFlagsDecoder.isWithMateDownstream(g)&&(C=t("NF")+f+1);const _=t("TL");if(_<0)throw new n.CramMalformedError("invalid TL index");const x={},k=i.getTagNames(_),I=k.length;for(let t=0;t<I;t++){const n=k[t],r=n.slice(0,2),s=n.slice(2,3),o=i.getCodecForTag(n).decode(e,l,h,d);x[r]=void 0===o?void 0:"number"==typeof o?o:a(s,o)}let S,E,N,M,R;if(r.BamFlagsDecoder.isSegmentUnmapped(p))if(r.CramFlagsDecoder.isDecodeSequenceAsStar(g))R=null,M=null;else{const e=new Array(w);for(let i=0;i<e.length;i++)e[i]=t("BA");if(R=String.fromCharCode(...e),r.CramFlagsDecoder.isPreservingQualityScores(g)){M=new Array(w);for(let i=0;i<e.length;i++)M[i]=t("QS")}}else{const e=t("FN");if(e&&(S=function(e,t,i,r,s){let o=0,a=e-1;const c=new Array(t);function l([e,t]){const n=i(t);if("character"===e)return String.fromCharCode(n);if("string"===e){let e="";for(let t=0;t<n.byteLength;t++)e+=String.fromCharCode(n[t]);return e}return"numArray"===e?Array.from(n):n}for(let e=0;e<t;e++){const t=String.fromCharCode(i("FC")),r=i("FP"),h={B:["character","BA"],S:["string",s>1?"SC":"IN"],X:["number","BS"],D:["number","DL"],I:["string","IN"],i:["character","BA"],b:["string","BB"],q:["numArray","QQ"],Q:["number","QS"],H:["number","HC"],P:["number","PD"],N:["number","RS"]}[t];if(!h)throw new n.CramMalformedError(`invalid read feature code "${t}"`);let d=l(h);const u={B:["number","QS"]}[t];u&&(d=[d,l(u)]),o+=r;const f=o;a+=r;const p=a;"D"===t||"N"===t?a+=d:"I"===t||"S"===t?a-=d.length:"i"===t&&(a-=1),c[e]={code:t,pos:f,refPos:p,data:d}}return c}(b,e,t,0,u)),E=w,S)for(const{code:e,data:t}of S)"D"===e||"N"===e?E+=t:"I"===e||"S"===e?E-=t.length:"i"===e&&(E-=1);if(Number.isNaN(E)&&(console.warn(`${v||`${m}:${b}`} record has invalid read features`),E=w),N=t("MQ"),r.CramFlagsDecoder.isPreservingQualityScores(g)){M=new Array(w);for(let e=0;e<M.length;e++)M[e]=t("QS")}}return{readLength:w,sequenceId:m,cramFlags:g,flags:p,alignmentStart:b,readGroupId:F,readName:v,mateToUse:y,templateSize:A,mateRecordNumber:C,readFeatures:S,lengthOnRef:E,mappingQuality:N,qualityScores:M,readBases:R,tags:x}};const n=i(9747),r=i(8401),s=i(3165);function o(e){let t="";for(let i=0;i<e.length&&0!==e[i];i++)t+=String.fromCharCode(e[i]);return t}function a(e,t){if("Z"===e)return o(t);if("A"===e)return String.fromCharCode(t[0]);if("I"===e)return new Uint32Array(t.buffer)[0];if("i"===e)return new Int32Array(t.buffer)[0];if("s"===e)return new Int16Array(t.buffer)[0];if("S"===e)return new Uint16Array(t.buffer)[0];if("c"===e)return new Int8Array(t.buffer)[0];if("C"===e)return t[0];if("f"===e)return new Float32Array(t.buffer)[0];if("H"===e)return Number.parseInt(o(t).replace(/^0x/,""),16);if("B"===e)return function(e){const t=String.fromCharCode(e[0]),i=new DataView(e.buffer).getUint32(1,!0),n=new Array(i);if(e=e.slice(5),"c"===t){const t=new Int8Array(e.buffer);for(let e=0;e<i;e++)n[e]=t[e]}else if("C"===t){const t=new Uint8Array(e.buffer);for(let e=0;e<i;e++)n[e]=t[e]}else if("s"===t){const t=new Int16Array(e.buffer);for(let e=0;e<i;e++)n[e]=t[e]}else if("S"===t){const t=new Uint16Array(e.buffer);for(let e=0;e<i;e++)n[e]=t[e]}else if("i"===t){const t=new Int32Array(e.buffer);for(let e=0;e<i;e++)n[e]=t[e]}else if("I"===t){const t=new Uint32Array(e.buffer);for(let e=0;e<i;e++)n[e]=t[e]}else{if("f"!==t)throw new Error(`unknown type: ${t}`);{const t=new Float32Array(e.buffer);for(let e=0;e<i;e++)n[e]=t[e]}}return n}(t);throw new n.CramMalformedError(`Unrecognized tag type ${e}`)}},6771:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9747),s=i(612),o=n(i(7295)),a=n(i(6484)),c=n(i(8401)),l=i(3165),h=i(400);function d(e,t,i,n){const s=!!(n.mate||void 0!==n.mateRecordNumber&&n.mateRecordNumber!==t);i.readName||(i.readName=String(i.uniqueId),n.readName=i.readName),i.mate={sequenceId:n.sequenceId,alignmentStart:n.alignmentStart,uniqueId:n.uniqueId},n.readName&&(i.mate.readName=n.readName),n.mate||void 0!==n.mateRecordNumber||(n.mate={sequenceId:i.sequenceId,alignmentStart:i.alignmentStart,uniqueId:i.uniqueId},i.readName&&(n.mate.readName=i.readName)),i.flags|=o.default.BAM_FPAIRED,n.flags&o.default.BAM_FUNMAP&&(i.flags|=o.default.BAM_FMUNMAP),i.flags&o.default.BAM_FUNMAP&&(n.flags|=o.default.BAM_FMUNMAP),n.flags&o.default.BAM_FREVERSE&&(i.flags|=o.default.BAM_FMREVERSE),i.flags&o.default.BAM_FREVERSE&&(n.flags|=o.default.BAM_FMREVERSE),void 0===i.templateLength&&(s?function(e,t,i){const n=function t(i){const n=[i];if(void 0!==i.mateRecordNumber&&i.mateRecordNumber>=0){const s=e[i.mateRecordNumber];if(!s)throw new r.CramMalformedError("intra-slice mate record not found, this file seems malformed");n.push(...t(s))}return n}(i),s=n.map((e=>e.alignmentStart)),o=n.map((e=>e.alignmentStart+e.readLength-1)),a=Math.max(...o)-Math.min(...s)+1;a>=0&&n.forEach((e=>{if(void 0!==e.templateLength)throw new r.CramMalformedError("mate pair group has some members that have template lengths already, this file seems malformed");e.templateLength=a}))}(e,0,i):function(e,t){const i=Math.min(e.alignmentStart,t.alignmentStart),n=Math.max(e.alignmentStart+e.readLength-1,t.alignmentStart+t.readLength-1)-i+1;e.templateLength=n,t.templateLength=n}(i,n)),i.mateRecordNumber=void 0}class u{constructor(e,t,i){this.container=e,this.containerPosition=t,this.sliceSize=i,this.file=e.file}async getHeader(){const{majorVersion:e}=await this.file.getDefinition(),t=(0,l.getSectionParsers)(e),i=await this.container.getHeader(),n=await this.file.readBlock(i._endPosition+this.containerPosition);if("MAPPED_SLICE_HEADER"===n.contentType){const e=(0,h.parseItem)(n.content,t.cramMappedSliceHeader.parser,0,i._endPosition);return{...n,parsedContent:e}}if("UNMAPPED_SLICE_HEADER"===n.contentType){const e=(0,h.parseItem)(n.content,t.cramUnmappedSliceHeader.parser,0,i._endPosition);return{...n,parsedContent:e}}throw new r.CramMalformedError(`error reading slice header block, invalid content type ${n.contentType}`)}async getBlocks(){const e=await this.getHeader();let t=e._endPosition;const i=new Array(e.parsedContent.numBlocks);for(let e=0;e<i.length;e++){const n=await this.file.readBlock(t);i[e]=n,t=i[e]._endPosition}return i}async getCoreDataBlock(){return(await this.getBlocks())[0]}async _getBlocksContentIdIndex(){const e=await this.getBlocks(),t={};return e.forEach((e=>{"EXTERNAL_DATA"===e.contentType&&(t[e.contentId]=e)})),t}async getBlockByContentId(e){return(await this._getBlocksContentIdIndex())[e]}async getReferenceRegion(){const e=new TextDecoder("utf8"),t=(await this.getHeader()).parsedContent;if(!(0,l.isMappedSliceHeader)(t))throw new Error("slice header not mapped");if(t.refSeqId<0)return;const i=await this.container.getCompressionScheme();if(void 0===i)throw new Error("compression scheme undefined");if(t.refBaseBlockId>=0){const i=await this.getBlockByContentId(t.refBaseBlockId);if(!i)throw new r.CramMalformedError("embedded reference specified, but reference block does not exist");return{seq:e.decode(i.data),start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}}if(i.referenceRequired||this.file.fetchReferenceSequenceCallback){if(!this.file.fetchReferenceSequenceCallback)throw new Error("reference sequence not embedded, and seqFetch callback not provided, cannot fetch reference sequence");const e=await this.file.fetchReferenceSequenceCallback(t.refSeqId,t.refSeqStart,t.refSeqStart+t.refSeqSpan-1);if(e.length!==t.refSeqSpan)throw new r.CramArgumentError("seqFetch callback returned a reference sequence of the wrong length");return{seq:e,start:t.refSeqStart,end:t.refSeqStart+t.refSeqSpan-1,span:t.refSeqSpan}}}getAllRecords(){return this.getRecords((()=>!0))}async _fetchRecords(){const{majorVersion:e}=await this.file.getDefinition(),t=await this.container.getCompressionScheme();if(void 0===t)throw new Error("compression scheme undefined");const i=await this.getHeader(),n=await this._getBlocksContentIdIndex();if(e>1&&this.file.options.checkSequenceMD5&&(0,l.isMappedSliceHeader)(i.parsedContent)&&i.parsedContent.refSeqId>=0&&"0000000000000000"!==i.parsedContent.md5?.join("")){const e=await this.getReferenceRegion();if(e){const{seq:t,start:n,end:s}=e,o=(0,h.sequenceMD5)(t),a=i.parsedContent.md5?.map((e=>(e<16?"0":"")+e.toString(16))).join("");if(o!==a)throw new r.CramMalformedError(`MD5 checksum reference mismatch for ref ${i.parsedContent.refSeqId} pos ${n}..${s}. recorded MD5: ${a}, calculated MD5: ${o}`)}}const o=await this.getCoreDataBlock(),u={lastAlignmentStart:(0,l.isMappedSliceHeader)(i.parsedContent)?i.parsedContent.refSeqStart:0,coreBlock:{bitPosition:7,bytePosition:0},externalBlocks:{map:new Map,getCursor(e){let t=this.map.get(e);return void 0===t&&(t={bitPosition:7,bytePosition:0},this.map.set(e,t)),t}}},f=e=>{const i=t.getCodecForDataSeries(e);if(!i)throw new r.CramMalformedError(`no codec defined for ${e} data series`);return i.decode(this,o,n,u)},p=new Array(i.parsedContent.numRecords);for(let r=0;r<p.length;r+=1)try{const s=(0,a.default)(this,f,t,i,o,n,u,e,r);p[r]=new c.default({...s,uniqueId:i.contentPosition+i.parsedContent.recordCounter+r+1})}catch(e){if(e instanceof s.CramBufferOverrunError){console.warn("read attempted beyond end of buffer, file seems truncated.");break}throw e}for(let e=0;e<p.length;e+=1){const t=p[e];if(t){const{mateRecordNumber:i}=t;void 0!==i&&i>=0&&p[i]&&d(p,e,t,p[i])}}return p}async getRecords(e){const t=this.container.filePosition+this.containerPosition;let i=this.file.featureCache.get(t.toString());i||(i=this._fetchRecords(),this.file.featureCache.set(t.toString(),i));const n=(await i).filter(e);if(n.length&&this.file.fetchReferenceSequenceCallback){const e=await this.getHeader();if((0,l.isMappedSliceHeader)(e.parsedContent)&&(e.parsedContent.refSeqId>=0||-2===e.parsedContent.refSeqId)){const t=e.parsedContent.refSeqId>=0?e.parsedContent.refSeqId:void 0,i=await this.container.getCompressionScheme();if(void 0===i)throw new Error("compression scheme undefined");const r={};for(const e of n){const i=void 0!==t?t:e.sequenceId;let n=r[i];n||(n={id:i,start:e.alignmentStart,end:Number.NEGATIVE_INFINITY,seq:null},r[i]=n);const s=e.alignmentStart+(e.lengthOnRef||e.readLength)-1;s>n.end&&(n.end=s),e.alignmentStart<n.start&&(n.start=e.alignmentStart)}await Promise.all(Object.values(r).map((async e=>{-1!==e.id&&e.start<=e.end&&this.file.fetchReferenceSequenceCallback&&(e.seq=await this.file.fetchReferenceSequenceCallback(e.id,e.start,e.end))})));for(const e of n){const n=r[void 0!==t?t:e.sequenceId];if(n?.seq){const t=n.seq;e.addReferenceSequence({...n,seq:t},i)}}}}return n}}t.default=u,"getHeader getBlocks _getBlocksContentIdIndex".split(" ").forEach((e=>{(0,h.tinyMemoize)(u,e)}))},400:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TWO_PWR_56_DBL=t.TWO_PWR_24_DBL=t.TWO_PWR_64_DBL=t.TWO_PWR_32_DBL=t.TWO_PWR_16_DBL=void 0,t.itf8Size=function(e){return-128&e?-16384&e?-2097152&e?-268435456&e?5:4:3:2:1},t.parseItf8=function(e,t){let i=t;const n=e[i];let r;return n<128?(r=n,i+=1):n<192?(r=(63&n)<<8|e[i+1],i+=2):n<224?(r=(31&n)<<16|e[i+1]<<8|e[i+2],i+=3):n<240?(r=(15&n)<<24|e[i+1]<<16|e[i+2]<<8|e[i+3],i+=4):(r=(15&n)<<28|e[i+1]<<20|e[i+2]<<12|e[i+3]<<4|15&e[i+4],i+=5),[r,i-t]},t.parseLtf8=function(e,i){let n=i;const r=e[n];let s;return r<128?(s=r,n+=1):r<192?(s=16383&(r<<8|e[n+1]),n+=2):r<224?(s=(63&r)<<16|e[n+1]<<8|e[n+2],n+=3):r<240?(s=(31&r)<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4):r<248?(s=(15&e[n])*t.TWO_PWR_32_DBL+(e[n+1]<<24|e[n+2]<<16|e[n+3]<<8|e[n+4]),n+=5):r<252?(s=((7&e[n])<<8|e[n+1])*t.TWO_PWR_32_DBL+(e[n+2]<<24|e[n+3]<<16|e[n+4]<<8|e[n+5]),n+=6):r<254?(s=((3&e[n])<<16|e[n+1]<<8|e[n+2])*t.TWO_PWR_32_DBL+(e[n+3]<<24|e[n+4]<<16|e[n+5]<<8|e[n+6]),n+=7):r<255?(s=(e[n+1]<<24|e[n+2]<<16|e[n+3]<<8|e[n+4])*t.TWO_PWR_32_DBL+(e[n+5]<<24|e[n+6]<<16|e[n+7]<<8|e[n+8]),n+=8):(s=e[n+1]*t.TWO_PWR_56_DBL+(e[n+2]<<24|e[n+3]<<16|e[n+4]<<8|e[n+5])*t.TWO_PWR_32_DBL+(e[n+6]<<24|e[n+7]<<16|e[n+8]<<8|e[n+9]),n+=9),[s,n-i]},t.parseItem=function(e,t,i=0,n=0){const{offset:r,value:s}=t(e,i);return{...s,_endPosition:r+n,_size:r-i}},t.tinyMemoize=function(e,t){const i=e.prototype[t],n=`_memo_${t}`;e.prototype[t]=function(){if(!(n in this)){const e=i.call(this);this[n]=e,Promise.resolve(e).catch((()=>{delete this[n]}))}return this[n]}},t.sequenceMD5=function(e){return(0,r.default)(e.toUpperCase().replaceAll(/[^\u0021-\u007e]/g,""))};const r=n(i(3503));t.TWO_PWR_16_DBL=65536,t.TWO_PWR_32_DBL=t.TWO_PWR_16_DBL*t.TWO_PWR_16_DBL,t.TWO_PWR_64_DBL=t.TWO_PWR_32_DBL*t.TWO_PWR_32_DBL,t.TWO_PWR_24_DBL=1<<24,t.TWO_PWR_56_DBL=t.TWO_PWR_24_DBL*t.TWO_PWR_32_DBL},9747:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CramArgumentError=t.CramSizeLimitError=t.CramMalformedError=t.CramUnimplementedError=t.CramError=void 0;class i extends Error{}t.CramError=i;class n extends Error{}t.CramUnimplementedError=n,t.CramMalformedError=class extends i{},t.CramSizeLimitError=class extends i{},t.CramArgumentError=class extends i{}},2884:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=i(9995),s=n(i(8175)),o=n(i(5871)),a=n(i(2935));t.default=class{decode(e){return this.stream=new a.default(e),this.decodeStream(this.stream)}decodeStream(e,t=0){const i=this.stream.ReadByte();16&i||(t=this.stream.ReadUint7());let n=t;const r=1&i;if(8&i)return this.decodeStripe(this.stream,t);var s;if(128&i&&([s,n]=this.decodePackMeta(this.stream)),32&i)var o=this.decodeCat(this.stream,n);else o=4&i?this.decodeExt(this.stream,n):64&i?r?this.decodeRLE1(this.stream,n):this.decodeRLE0(this.stream,n):r?this.decode1(this.stream,n):this.decode0(this.stream,n);return 128&i&&(o=this.decodePack(o,s,t)),o}decode0(e,t){const i=new Uint8Array(t);let n=e.ReadByte();0==n&&(n=256);const r=new o.default(n),a=new s.default(e);a.RangeStartDecode(e);for(let n=0;n<t;n++)i[n]=r.ModelDecode(e,a);return i}decode1(e,t){const i=new Uint8Array(t);let n=e.ReadByte();0==n&&(n=256);const r=new Array(n);for(var a=0;a<n;a++)r[a]=new o.default(n);const c=new s.default(e);c.RangeStartDecode(e);let l=0;for(a=0;a<t;a++)i[a]=r[l].ModelDecode(e,c),l=i[a];return i}decodeExt(e,t){return(0,r.decode)(e.buf.slice(e.pos))}decodeRLE0(e,t){const i=new Uint8Array(t);let n=e.ReadByte();0==n&&(n=256);const r=new o.default(n),a=new Array(258);for(var c=0;c<=257;c++)a[c]=new o.default(4);const l=new s.default(e);for(l.RangeStartDecode(e),c=0;c<t;){i[c]=r.ModelDecode(e,l);let t=a[i[c]].ModelDecode(e,l),n=t,s=256;for(;3==t;)t=a[s].ModelDecode(e,l),s=257,n+=t;for(let e=1;e<=n;e++)i[c+e]=i[c];c+=n+1}return i}decodeRLE1(e,t){const i=new Uint8Array(t);let n=e.ReadByte();0==n&&(n=256);const r=new Array(n);for(var a=0;a<n;a++)r[a]=new o.default(n);const c=new Array(258);for(a=0;a<=257;a++)c[a]=new o.default(4);const l=new s.default(e);l.RangeStartDecode(e);let h=0;for(a=0;a<t;){i[a]=r[h].ModelDecode(e,l),h=i[a];let t=c[i[a]].ModelDecode(e,l),n=t,s=256;for(;3==t;)t=c[s].ModelDecode(e,l),s=257,n+=t;for(let e=1;e<=n;e++)i[a+e]=i[a];a+=n+1}return i}decodePackMeta(e){this.nsym=e.ReadByte();const t=new Array(this.nsym);for(let i=0;i<this.nsym;i++)t[i]=e.ReadByte();return[t,e.ReadUint7()]}decodePack(e,t,i){const n=new Uint8Array(i);if(this.nsym<=1)for(var r=0;r<i;r++)n[r]=t[0];else if(this.nsym<=2){r=0;for(var s=0;r<i;r++){if(r%8==0)var o=e[s++];n[r]=t[1&o],o>>=1}}else if(this.nsym<=4)for(r=0,s=0;r<i;r++)r%4==0&&(o=e[s++]),n[r]=t[3&o],o>>=2;else{if(!(this.nsym<=16))return e;for(r=0,s=0;r<i;r++)r%2==0&&(o=e[s++]),n[r]=t[15&o],o>>=4}return n}packMeta(e){const t=new a.default("",0,1024),i=new Array(256);for(var n=0;n<e.length;n++)i[e[n]]=1;var r=0;for(n=0;n<256;n++)i[n]&&(i[n]=++r);for(t.WriteByte(r),n=0;n<256;n++)i[n]&&(t.WriteByte(n),i[n]--);return[t,i,r]}decodeStripe(e,t){const i=e.ReadByte(),n=new Array(i),r=new Array(i);for(var s=0;s<i;s++)n[s]=e.ReadUint7();const o=new Array(i);for(s=0;s<i;s++)r[s]=Math.floor(t/i)+(t%i>s),o[s]=this.decodeStream(e,r[s]);const a=new Uint8Array(t);for(s=0;s<i;s++)for(let e=0;e<r[s];e++)a[e*i+s]=o[s][e];return a}decodeCat(e,t){const i=new Uint8Array(t);for(let n=0;n<t;n++)i[n]=e.ReadByte();return i}}},8175:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e){this.low=0,this.range=4294967295,this.code=0,this.FFnum=0,this.carry=0,this.cache=0}RangeStartDecode(e){for(let t=0;t<5;t++)this.code=(this.code<<8)+e.ReadByte();this.code&=4294967295,this.code>>>=0}RangeGetFrequency(e){return this.range=Math.floor(this.range/e),Math.floor(this.code/this.range)}RangeDecode(e,t,i,n){for(this.code-=t*this.range,this.range*=i;this.range<1<<24;)this.range*=256,this.code=256*this.code+e.ReadByte()}RangeShiftLow(e){if(this.low<4278190080|this.carry){for(e.WriteByte(this.cache+this.carry);this.FFnum;)e.WriteByte(this.carry-1),this.FFnum--;this.cache=this.low>>>24,this.carry=0}else this.FFnum++;this.low<<=8,this.low>>>=0}RangeEncode(e,t,i,n){const r=this.low;for(this.range=Math.floor(this.range/n),this.low+=t*this.range,this.low>>>=0,this.range*=i,this.low<r&&(0!=this.carry&&console.log("ERROR: Multiple carry"),this.carry=1);this.range<1<<24;)this.range*=256,this.RangeShiftLow(e)}RangeFinishEncode(e){for(let t=0;t<5;t++)this.RangeShiftLow(e)}}},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e=256){this.total_freq=e,this.max_sym=e-1,this.S=[],this.F=[];for(let e=0;e<=this.max_sym;e++)this.S[e]=e,this.F[e]=1}ModelDecode(e,t){const i=t.RangeGetFrequency(this.total_freq);let n=0,r=0;for(;n+this.F[r]<=i;)n+=this.F[r++];t.RangeDecode(e,n,this.F[r],this.total_freq),this.F[r]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise();const s=this.S[r];if(r>0&&this.F[r]>this.F[r-1]){let e=this.F[r];this.F[r]=this.F[r-1],this.F[r-1]=e,e=this.S[r],this.S[r]=this.S[r-1],this.S[r-1]=e}return s}ModelRenormalise(){this.total_freq=0;for(let e=0;e<=this.max_sym;e++)this.F[e]-=Math.floor(this.F[e]/2),this.total_freq+=this.F[e]}ModelEncode(e,t,i){let n=0;for(var r=0;this.S[r]!=i;r++)n+=this.F[r];if(t.RangeEncode(e,n,this.F[r],this.total_freq),this.F[r]+=16,this.total_freq+=16,this.total_freq>65519&&this.ModelRenormalise(),i=this.S[r],r>0&&this.F[r]>this.F[r-1]){let e=this.F[r];this.F[r]=this.F[r-1],this.F[r-1]=e,e=this.S[r],this.S[r]=this.S[r-1],this.S[r-1]=e}}}},4373:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t){return function(e,t){const i=e.ReadUint7(),n=function(e){const t={max_sym:0};if(5!=e.ReadByte())return void console.error("Invalid FQZComp version number");const i=e.ReadByte(),n=i&g?e.ReadByte():1;let r=i.nparam>1?i.nparam-1:0;const s=new Array(256);if(i&m)r=e.ReadByte(),a(e,s,256);else{for(var o=0;o<n;o++)s[o]=o;for(;o<256;o++)s[o]=n-1}t.do_rev=i&w,t.stab=s,t.max_sel=r,t.params=new Array(t.nparam);for(let i=0;i<n;i++)t.params[i]=F(e),t.max_sym<t.params[i].max_sym&&(t.max_sym=t.params[i].max_sym);return t}(e);if(!n)return;var o=n.params;const c=new Array(t.length),l=function(e){const t={};t.qual=new Array(65536);for(var i=0;i<65536;i++)t.qual[i]=new s.default(e.max_sym+1);for(t.len=new Array(4),i=0;i<4;i++)t.len[i]=new s.default(256);return t.rev=new s.default(2),t.dup=new s.default(2),e.max_sel>0&&(t.sel=new s.default(e.max_sel+1)),t}(n),h=new r.default(e);h.RangeStartDecode(e);const d=new Uint8Array(i),u={qctx:0,prevq:0,delta:0,p:0,s:0,x:0,len:0,is_dup:0,rec:0};let f=0;for(;f<i;){if(0==u.p){if(v(e,h,n,l,u,c),u.is_dup>0&&l.dup.ModelDecode(e,h)){for(let e=0;e<len;e++)d[f+e]=d[f+e-u.len];f+=u.len,u.p=0;continue}t.push(u.len);var p=(o=n.params[u.x]).context}const i=l.qual[p].ModelDecode(e,h);d[f++]=o.qmap[i],p=b(o,u,i)}return n.do_rev&&function(e,t,i,n){let r=0,s=0;for(;s<t;){if(i[r]){let t=0,i=n[r]-1;for(;t<i;){const n=e[s+t];e[s+t]=e[s+i],e[s+i]=n,t++,i--}}s+=n[r++]}}(d,i,c,t),d}(new o.default(e),t)};const r=n(i(8175)),s=n(i(5871)),o=n(i(2935));function a(e,t,i){let n=0,r=0,s=-1;const o=new Array(1024);for(;r<i;){const t=e.ReadByte();if(o[n++]=t,r+=t,t==s){let i=e.ReadByte();for(r+=t*i;i--;)o[n++]=t}s=t}let a=0;for(n=0,r=0;r<i;){let e=0;do{var c=o[n++];e+=c}while(255==c);for(;e--;)t[r++]=a;a++}}const c=2,l=4,h=8,d=16,u=32,f=64,p=128,g=1,m=2,w=4;function b(e,t,i){let n=e.context;return t.qctx=(t.qctx<<e.qshift)+e.qtab[i],n+=(t.qctx&(1<<e.qbits)-1)<<e.qloc,e.do_pos&&(n+=e.ptab[Math.min(t.p,1023)]<<e.ploc),e.do_delta&&(n+=e.dtab[Math.min(t.delta,255)]<<e.dloc,t.delta+=t.prevq!=i?1:0,t.prevq=i),e.do_sel&&(n+=t.s<<e.sloc),t.p--,65535&n}function F(e){const t={};t.context=e.ReadUint16(),t.pflags=e.ReadByte(),t.do_dedup=t.pflags&c,t.fixed_len=t.pflags&l,t.do_sel=t.pflags&h,t.do_qmap=t.pflags&d,t.do_pos=t.pflags&u,t.do_delta=t.pflags&f,t.do_qtab=t.pflags&p,t.max_sym=e.ReadByte();let i=e.ReadByte();if(t.qbits=i>>4,t.qshift=15&i,i=e.ReadByte(),t.qloc=i>>4,t.sloc=15&i,i=e.ReadByte(),t.ploc=i>>4,t.dloc=15&i,t.qmap=new Array(256),t.pflags&d)for(var n=0;n<t.max_sym;n++)t.qmap[n]=e.ReadByte();else for(n=0;n<256;n++)t.qmap[n]=n;if(t.qtab=new Array(1024),t.qbits>0&&t.pflags&p)a(e,t.qtab,256);else for(n=0;n<256;n++)t.qtab[n]=n;return t.ptab=new Array(1024),t.pflags&u&&a(e,t.ptab,1024),t.dtab=new Array(256),t.pflags&f&&a(e,t.dtab,256),t}function v(e,t,i,n,r,s){r.s=i.max_sel>0?n.sel.ModelDecode(e,t):0,r.x=i.stab[r.s];const o=i.params[r.x];if(o.fixed_len>=0){var a=n.len[0].ModelDecode(e,t);a|=n.len[1].ModelDecode(e,t)<<8,a|=n.len[2].ModelDecode(e,t)<<16,a|=n.len[3].ModelDecode(e,t)<<24,o.fixed_len>0&&(o.fixed_len=-a)}else a=-o.fixed_len;r.len=a,i.do_rev&&(s[r.rec]=n.rev.ModelDecode(e,t)),r.is_dup=0,o.pflags&c&&n.dup.ModelDecode(e,t)&&(r.is_dup=1),r.p=a,r.delta=0,r.qctx=0,r.prevq=0,r.rec++}},9151:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),o=0;o<i.length;o++)"default"!==i[o]&&r(t,e,i[o]);return s(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.r4x8_uncompress=function(e){return h.decode(e)},t.r4x16_uncompress=function(e){return d.decode(e)},t.arith_uncompress=function(e){return(new c.default).decode(e)},t.fqzcomp_uncompress=function(e){return l.decode(e,[])},t.tok3_uncompress=function(e){const t=u.decode(e,0,"\0");return Uint8Array.from(Array.from(t).map((e=>e.charCodeAt(0))))};const c=a(i(2884)),l=o(i(4373)),h=o(i(9725)),d=o(i(6194)),u=o(i(680))},2935:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{constructor(e,t=0,i=0){0!==i?(this.buf=new Uint8Array(i),this.length=i):(this.buf=e,this.length=e.length),this.dataView=new DataView(this.buf.buffer),this.pos=t}EOF(){return this.pos>=this.length}ReadData(e){const t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}ReadByte(){const e=this.buf[this.pos];return this.pos++,e}ReadChar(){const e=this.buf[this.pos];return this.pos++,String.fromCharCode(e)}ReadUint16(){let e=this.ReadByte();return e|=this.ReadByte()<<8,e}ReadUint32(){const e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}ReadString(){let e,t="";do{e=this.buf[this.pos++],e&&(t+=String.fromCharCode(e))}while(e);return t}ReadUint7(){let e,t=0;do{e=this.ReadByte(),t=t<<7|127&e}while(128&e);return t}ReadITF8(){let e=this.buf[this.pos];return this.pos++,e>=240?(e=(15&e)<<28,e+=(this.buf[this.pos+0]<<20)+(this.buf[this.pos+1]<<12)+(this.buf[this.pos+2]<<4)+(this.buf[this.pos+3]>>4),this.pos+=4):e>=224?(e=(15&e)<<24,e+=(this.buf[this.pos+0]<<16)+(this.buf[this.pos+1]<<8)+(0|this.buf[this.pos+2]),this.pos+=3):e>=192?(e=(31&e)<<16,e+=(this.buf[this.pos+0]<<8)+(0|this.buf[this.pos+1]),this.pos+=2):e>=128&&(e=(63&e)<<8,e+=this.buf[this.pos],this.pos++),e}}},9725:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){const t=new r.default(e),i=t.ReadByte(),n=(t.ReadUint32(),t.ReadUint32());return 0==i?function(e,t){const i=new Array(256),n=new Array(256);h(e,i,n);const r=a(n),o=new Array(4);for(var d=0;d<4;d++)o[d]=e.ReadUint32();const u=new Uint8Array(t);for(d=0;d<t;d++){const t=d%4,a=r[s(o[t])];u[d]=a,o[t]=c(o[t],n[a],i[a]),o[t]=l(e,o[t])}return u}(t,n):function(e,t){const i=new Array(256),n=new Array(256);!function(e,t,i){for(let e=0;e<256;e++){t[e]=new Array(256),i[e]=new Array(256);for(let i=0;i<256;i++)t[e][i]=0}let n=e.ReadByte(),r=n,s=0;do{h(e,t[n],i[n]),s>0?(s--,n++):(n=e.ReadByte(),n==r+1&&(s=e.ReadByte())),r=n}while(0!=n)}(e,i,n);const r=new Array(256);for(var d=0;d<256;d++)r[d]=a(n[d]);const u=new Array(4),f=new Array(4);for(var p=0;p<4;p++)u[p]=e.ReadUint32(),f[p]=0;const g=new Uint8Array(t),m=Math.floor(t/4);for(d=0;d<m;d++)for(p=0;p<4;p++){var w=s(u[p]),b=r[f[p]][w];g[d+p*m]=b,u[p]=c(u[p],n[f[p]][b],i[f[p]][b]),u[p]=l(e,u[p]),f[p]=b}for(d*=4;d<t;)w=s(u[3]),b=o(n[f[3]],w),g[d++]=b,u[3]=c(u[3],n[f[3]][b],i[f[3]][b]),u[3]=l(e,u[3]),f[3]=b;return g}(t,n)};const r=n(i(2935));function s(e){return 4095&e}function o(e,t){let i=0;for(;t>=e[i+1];)i++;return i}function a(e){const t=new Array(4096);let i=0;for(let n=0;n<4096;n++){for(;n>=e[i+1];)i++;t[n]=i}return t}function c(e,t,i){return i*(e>>12)+(4095&e)-t}function l(e,t){for(;t<1<<23;)t=(t<<8)+e.ReadByte();return t}function h(e,t,i){for(var n=0;n<256;n++)t[n]=0;let r=e.ReadByte(),s=r,o=0;do{const i=e.ReadITF8();t[r]=i,o>0?(o--,r++):(r=e.ReadByte(),r==s+1&&(o=e.ReadByte())),s=r}while(0!=r);for(i[0]=0,n=0;n<=255;n++)i[n+1]=i[n]+t[n]}},6194:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){return h(new r.default(e),0)};const r=n(i(2935));function s(e,t){return e&(1<<t)-1}function o(e,t){let i=0;for(;t>=e[i+1];)i++;return i}function a(e,t){const i=1<<t,n=new Array(i);let r=0;for(let t=0;t<i;t++){for(;t>=e[r+1];)r++;n[t]=r}return n}function c(e,t,i,n){return i*(e>>n)+(e&(1<<n)-1)-t}function l(e,t){return t<32768&&(t=(t<<16)+e.ReadUint16()),t}function h(e,t){const i=e.ReadByte(),n=1&i,p=8&i,g=32&i,m=64&i,w=128&i,b=4&i?32:4;if(16&i||(t=e.ReadUint7()),p)return function(e,t){const i=e.ReadByte(),n=new Array(i),r=new Array(i);for(var s=0;s<i;s++)n[s]=e.ReadUint7();const o=new Array(i);for(s=0;s<i;s++)r[s]=Math.floor(t/i)+(t%i>s),o[s]=h(e,r[s]);const a=new Uint8Array(t);for(s=0;s<i;s++)for(let e=0;e<r[s];e++)a[e*i+s]=o[s][e];return a}(e,t);if(w)var F=t,[v,y,t]=function(e){const t=e.ReadByte(),i=new Array(t);for(let n=0;n<t;n++)i[n]=e.ReadByte();return[i,t,e.ReadUint7()]}(e);if(m)var A=t,[C,_,t]=function(e,t){const i=e.ReadUint7(),n=e.ReadUint7();if(1&i)var s=e.ReadData((i-1)/2);else{const n=e.ReadUint7();s=e.ReadData(n),s=u(new r.default(s),i/2,t)}s=new r.default(s);const o=new Array(256);let a=s.ReadByte();0==a&&(a=256);for(let e=0;e<a;e++)o[s.ReadByte()]=1;return[o,s,n]}(e,b);if(g)var x=e.ReadData(t);else x=0==n?u(e,t,b):function(e,t,i){const n=(p=e.ReadByte())>>4;var h=e;if(1&p){const t=e.ReadUint7(),i=e.ReadUint7();var p=new r.default(e.ReadData(i));h=new r.default(u(p,t,4))}const g=new Array(256),m=new Array(256);!function(e,t,i,n){for(var r=0;r<256;r++){t[r]=new Array(256),i[r]=new Array(256);for(var s=0;s<256;s++)t[r][s]=0}const o=d(e);for(r=0;r<256;r++){if(!o[r])continue;let a=0;for(s=0;s<256;s++)o[s]&&(a>0?a--:(t[r][s]=e.ReadUint7(),0==t[r][s]&&(a=e.ReadByte())));for(f(t[r],n),i[r][0]=0,s=0;s<256;s++)i[r][s+1]=i[r][s]+t[r][s]}}(h,g,m,n);const w=new Array(256);for(var b=0;b<256;b++)w[b]=a(m[b],n);const F=new Array(i),v=new Array(i);for(var y=0;y<i;y++)F[y]=e.ReadUint32(),v[y]=0;const A=new Uint8Array(t),C=Math.floor(t/i);for(b=0;b<C;b++)for(y=0;y<i;y++){var _=s(F[y],n),x=w[v[y]][_];A[b+y*C]=x,F[y]=c(F[y],m[v[y]][x],g[v[y]][x],n),F[y]=l(e,F[y]),v[y]=x}for(b*=i;b<t;)_=s(F[i-1],n),x=o(m[v[i-1]],_),A[b++]=x,F[i-1]=c(F[i-1],m[v[i-1]][x],g[v[i-1]][x],n),F[i-1]=l(e,F[i-1]),v[i-1]=x;return A}(e,t,b);return m&&(x=function(e,t,i,n){new r.default(e);const s=new Uint8Array(n);let o=0;for(let r=0;o<n;r++){const n=e[r];if(t[n]){const e=i.ReadUint7();for(let t=0;t<=e;t++)s[o++]=n}else s[o++]=n}return s}(x,C,_,A)),w&&(x=function(e,t,i,n){const r=new Uint8Array(n);let s=0;if(i<=1)for(var o=0;o<n;o++)r[o]=t[0];else if(i<=2)for(o=0;o<n;o++){if(o%8==0)var a=e[s++];r[o]=t[1&a],a>>=1}else if(i<=4)for(o=0;o<n;o++)o%4==0&&(a=e[s++]),r[o]=t[3&a],a>>=2;else if(i<=16)for(o=0;o<n;o++)o%2==0&&(a=e[s++]),r[o]=t[15&a],a>>=4;return r}(x,v,y,F)),x}function d(e){const t=new Array(256);for(let e=0;e<256;e++)t[e]=0;let i=0,n=e.ReadByte(),r=n;do{t[n]=1,i>0?(i--,n++):(n=e.ReadByte(),n==r+1&&(i=e.ReadByte())),r=n}while(0!=n);return t}function u(e,t,i){const n=new Array(256),r=new Array(256);!function(e,t,i){for(var n=0;n<256;n++)t[n]=0;const r=d(e);for(n=0;n<256;n++)r[n]>0&&(t[n]=e.ReadUint7());for(f(t,12),i[0]=0,n=0;n<=255;n++)i[n+1]=i[n]+t[n]}(e,n,r);const o=a(r,12),h=new Array(i);for(var u=0;u<i;u++)h[u]=e.ReadUint32();const p=new Uint8Array(t);for(u=0;u<t;u++){const t=u&i-1,a=o[s(h[t],12)];p[u]=a,h[t]=c(h[t],r[a],n[a],12),h[t]=l(e,h[t])}return p}function f(e,t){let i=0;for(var n=0;n<256;n++)i+=e[n];if(0==i||i==1<<t)return;let r=0;for(;i<1<<t;)i*=2,r++;for(n=0;n<256;n++)e[n]<<=r}},680:function(e,t,i){var n,r=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[t.length]=i);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i=n(e),o=0;o<i.length;o++)"default"!==i[o]&&r(t,e,i[o]);return s(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,i){(e=new h.default(e)).ReadUint32();const n=e.ReadUint32(),r=e.ReadByte(),s=function(e,t,i,n){let r=-1;const s=new Array(256);for(;!e.EOF();){const t=e.ReadByte(),o=128&t,a=64&t,l=63&t;if(o&&(r++,s[r]=new Array(13)),l!=f&&o){const e=new Array(n-1).fill(A);s[r][f]=new h.default((0,c.concatUint8Array)([new Uint8Array(l),e]))}if(a){const t=e.ReadByte(),i=e.ReadByte();s[r][l]=new h.default(s[t][i].buf)}else{const t=e.ReadUint7(),n=e.ReadData(t);s[r][l]=i?u.decode(n):d.decode(n),s[r][l]=new h.default(s[r][l])}}return s}(e,0,r,n),o=new Array(n),a=new Array(n);let l="";void 0===i&&(i="\n");for(let e=0;e<n;e++)l+=x(s,o,a,e)+i;return l};const c=i(3472),l=a(i(2884)),h=a(i(2935)),d=o(i(6194)),u=new l.default,f=0,p=1,g=2,m=3,w=4,b=5,F=7,v=8,y=9,A=10,C=12;function _(e,t){let i=e+"";for(;i.length<t;)i="0"+i;return i}function x(e,t,i,n){let r=e[0][f].ReadByte();const s=n-e[0][r].ReadUint32();if(r==b)return t[n]=t[s],i[n]=i[s],t[n];let o=1;t[n]="",i[n]=new Array(256);do{switch(r=e[o][f].ReadByte(),r){case g:i[n][o]=e[o][g].ReadChar();break;case p:i[n][o]=e[o][p].ReadString();break;case F:i[n][o]=e[o][F].ReadUint32();break;case m:var a=e[o][m].ReadUint32(),c=e[o][w].ReadByte();i[n][o]=_(a,c);break;case v:i[n][o]=(0|i[s][o])+e[o][v].ReadByte();break;case y:a=(0|i[s][o])+e[o][y].ReadByte(),c=i[s][o].length,i[n][o]=_(a,c);break;case A:i[n][o]=i[s][o];break;default:i[n][o]=""}t[n]+=i[n][o++]}while(r!=C);return t[n]}},7806:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.IndexedCramFile=t.CraiIndex=t.CramFile=t.CramRecord=void 0;var r=i(7390);Object.defineProperty(t,"CramRecord",{enumerable:!0,get:function(){return r.CramRecord}}),Object.defineProperty(t,"CramFile",{enumerable:!0,get:function(){return n(r).default}});var s=i(4923);Object.defineProperty(t,"CraiIndex",{enumerable:!0,get:function(){return n(s).default}});var o=i(6014);Object.defineProperty(t,"IndexedCramFile",{enumerable:!0,get:function(){return n(o).default}})},6014:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(i(7390)),s=i(9747);t.default=class{constructor(e){if(this.cram=e.cram??new r.default({url:e.cramUrl,path:e.cramPath,filehandle:e.cramFilehandle,seqFetch:e.seqFetch,checkSequenceMD5:e.checkSequenceMD5,cacheSize:e.cacheSize}),!(this.cram instanceof r.default))throw new Error("invalid arguments: no cramfile");this.index=e.index}async getRecordsForRange(e,t,i,n={}){if(n.viewAsPairs=n.viewAsPairs||!1,n.pairAcrossChr=n.pairAcrossChr||!1,n.maxInsertSize=n.maxInsertSize||2e5,"string"==typeof e)throw new s.CramUnimplementedError("string sequence names not yet supported");const r=e,o=await this.index.getEntriesForRange(r,t,i),a=await Promise.all(o.map((n=>this.getRecordsInSlice(n,(n=>n.sequenceId===e&&n.alignmentStart<=i&&void 0!==n.lengthOnRef&&n.alignmentStart+n.lengthOnRef-1>=t)))));let c=Array.prototype.concat(...a);if(n.viewAsPairs){const e={},t={};for(const i of c){const n=i.readName;if(void 0===n)throw new Error("readName undefined");const r=i.uniqueId;e[n]||(e[n]=0),e[n]+=1,t[r]=1}const i={};Object.entries(e).forEach((([e,t])=>{1===t&&(i[e]=!0)}));const s=[];for(const e of c){const t=e.readName;if(void 0===t)throw new Error("readName undefined");if(i[t]&&e.mate&&(e.mate.sequenceId===r||n.pairAcrossChr)&&Math.abs(e.alignmentStart-e.mate.alignmentStart)<n.maxInsertSize){const t=this.index.getEntriesForRange(e.mate.sequenceId,e.mate.alignmentStart,e.mate.alignmentStart+1);s.push(t)}}const o=await Promise.all(s);let a=[];for(const e of o)a.push(...e);a=a.sort(((e,t)=>e.toString().localeCompare(t.toString()))).filter(((e,t,i)=>!t||e.toString()!==i[t-1].toString()));const l=[];for(const e of a){let n=this.cram.featureCache.get(e.toString());n||(n=this.getRecordsInSlice(e,(()=>!0)),this.cram.featureCache.set(e.toString(),n));const r=n.then((e=>{const n=[];for(const r of e){if(void 0===r.readName)throw new Error("readName undefined");i[r.readName]&&!t[r.uniqueId]&&n.push(r)}return n}));l.push(r)}const h=await Promise.all(l);if(h.length){const e=h.reduce(((e,t)=>e.concat(t)));c=c.concat(e)}}return c}getRecordsInSlice({containerStart:e,sliceStart:t,sliceBytes:i},n){return this.cram.getContainerAtPosition(e).getSlice(t,i).getRecords(n)}hasDataForReferenceSequence(e){return this.index.hasDataForReferenceSequence(e)}}},5931:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RemoteFile=t.LocalFile=void 0,t.open=function(e,t,i){if(i)return i;if(e)return new n.RemoteFile(e);if(t)return new n.LocalFile(t);throw new Error("no url, path, or filehandle provided, cannot open")};const n=i(689);var r=i(689);Object.defineProperty(t,"LocalFile",{enumerable:!0,get:function(){return r.LocalFile}}),Object.defineProperty(t,"RemoteFile",{enumerable:!0,get:function(){return r.RemoteFile}})},6476:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TOTFREQ=t.TF_SHIFT=t.RANS_BYTE_L=void 0,t.TF_SHIFT=12,t.TOTFREQ=4096,t.RANS_BYTE_L=1<<23},997:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,n){let a=e.getInt(),c=e.getInt(),l=e.getInt(),h=e.getInt();const d=n.remaining(),u=-4&d;for(let r=0;r<u;r+=4){const d=t.R[o.default.get(a,s.TF_SHIFT)],u=t.R[o.default.get(c,s.TF_SHIFT)],f=t.R[o.default.get(l,s.TF_SHIFT)],p=t.R[o.default.get(h,s.TF_SHIFT)];n.putAt(r,d),n.putAt(r+1,u),n.putAt(r+2,f),n.putAt(r+3,p),a=o.default.advanceSymbolStep(a,i[255&d],s.TF_SHIFT),c=o.default.advanceSymbolStep(c,i[255&u],s.TF_SHIFT),l=o.default.advanceSymbolStep(l,i[255&f],s.TF_SHIFT),h=o.default.advanceSymbolStep(h,i[255&p],s.TF_SHIFT),a=o.default.renormalize(a,e),c=o.default.renormalize(c,e),l=o.default.renormalize(l,e),h=o.default.renormalize(h,e)}let f;switch(n.setPosition(u),3&d){case 0:break;case 1:f=t.R[o.default.get(a,s.TF_SHIFT)],o.default.advanceSymbol(a,e,i[255&f],s.TF_SHIFT),n.put(f);break;case 2:f=t.R[o.default.get(a,s.TF_SHIFT)],o.default.advanceSymbol(a,e,i[255&f],s.TF_SHIFT),n.put(f),f=t.R[o.default.get(c,s.TF_SHIFT)],o.default.advanceSymbol(c,e,i[255&f],s.TF_SHIFT),n.put(f);break;case 3:f=t.R[o.default.get(a,s.TF_SHIFT)],o.default.advanceSymbol(a,e,i[255&f],s.TF_SHIFT),n.put(f),f=t.R[o.default.get(c,s.TF_SHIFT)],o.default.advanceSymbol(c,e,i[255&f],s.TF_SHIFT),n.put(f),f=t.R[o.default.get(l,s.TF_SHIFT)],o.default.advanceSymbol(l,e,i[255&f],s.TF_SHIFT),n.put(f);break;default:throw new r.CramMalformedError("invalid output size encountered during rANS decoding")}n.setPosition(0)};const r=i(9747),s=i(6476),o=n(i(488))},7960:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i,n){const o=t.remaining();let a=e.getInt(),c=e.getInt(),l=e.getInt(),h=e.getInt();const d=o>>2;let u=0,f=d,p=2*d,g=3*d,m=0,w=0,b=0,F=0;for(;u<d;u+=1,f+=1,p+=1,g+=1){const o=255&i[m].R[s.default.get(a,r.TF_SHIFT)],d=255&i[w].R[s.default.get(c,r.TF_SHIFT)],v=255&i[b].R[s.default.get(l,r.TF_SHIFT)],y=255&i[F].R[s.default.get(h,r.TF_SHIFT)];t.putAt(u,o),t.putAt(f,d),t.putAt(p,v),t.putAt(g,y),a=s.default.advanceSymbolStep(a,n[m][o],r.TF_SHIFT),c=s.default.advanceSymbolStep(c,n[w][d],r.TF_SHIFT),l=s.default.advanceSymbolStep(l,n[b][v],r.TF_SHIFT),h=s.default.advanceSymbolStep(h,n[F][y],r.TF_SHIFT),a=s.default.renormalize(a,e),c=s.default.renormalize(c,e),l=s.default.renormalize(l,e),h=s.default.renormalize(h,e),m=o,w=d,b=v,F=y}for(;g<o;g+=1){const o=255&i[F].R[s.default.get(h,r.TF_SHIFT)];t.putAt(g,o),h=s.default.advanceSymbol(h,e,n[F][o],r.TF_SHIFT),F=o}};const r=i(6476),s=n(i(488))},488:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(9747),r=i(6476);class s{constructor(){this.F=void 0,this.C=void 0}}function o(e,t,i,n){return i*(e>>n)+(e&(1<<n)-1)-t}t.default={FC:s,AriDecoder:class{constructor(){this.fc=new Array(256);for(let e=0;e<this.fc.length;e+=1)this.fc[e]=new s;this.R=null}},DecodingSymbol:class{constructor(){this.start=void 0,this.freq=void 0}},symbolInit:function(e,t,i){if(!(t<=65536))throw new n.CramMalformedError("assertion failed: start <= 1<<16");if(!(i<=65536-t))throw new n.CramMalformedError("assertion failed: freq <= 1<<16");e.start=t,e.freq=i},advanceStep:o,advanceSymbolStep:function(e,t,i){return o(e,t.start,t.freq,i)},get:function(e,t){return e&(1<<t)-1},advanceSymbol:function(e,t,i,n){return function(e,t,i,n,s){if((e=n*(e>>s)+(e&(1<<s)-1)-i)<r.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<r.RANS_BYTE_L);return e}(e,t,i.start,i.freq,n)},renormalize:function(e,t){if(e<r.RANS_BYTE_L)do{e=e<<8|255&t.get()}while(e<r.RANS_BYTE_L);return e}}},1971:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.readStatsO0=function(e,t,i){let n=0,r=0,c=255&e.get();do{null==t.fc[c]&&(t.fc[c]=new o.default.FC),t.fc[c].F=255&e.get(),t.fc[c].F>=128&&(t.fc[c].F&=-129,t.fc[c].F=(127&t.fc[c].F)<<8|255&e.get()),t.fc[c].C=r,o.default.symbolInit(i[c],t.fc[c].C,t.fc[c].F),t.R||(t.R=new Array(s.TOTFREQ)),t.R.fill(c,r,r+t.fc[c].F),r+=t.fc[c].F,0===n&&c+1===(255&e.getByteAt(e.position()))?(c=255&e.get(),n=255&e.get()):0!==n?(n-=1,c+=1):c=255&e.get()}while(0!==c);a(r<s.TOTFREQ)},t.readStatsO1=function(e,t,i){let n=0,r=255&e.get();do{let c=0,l=0,h=255&e.get();null==t[r]&&(t[r]=new o.default.AriDecoder);do{null==t[r].fc[h]&&(t[r].fc[h]=new o.default.FC),t[r].fc[h].F=255&e.get(),t[r].fc[h].F>=128&&(t[r].fc[h].F&=-129,t[r].fc[h].F=(127&t[r].fc[h].F)<<8|255&e.get()),t[r].fc[h].C=l,0===t[r].fc[h].F&&(t[r].fc[h].F=s.TOTFREQ),null==i[r][h]&&(i[r][h]=new o.default.RansDecSymbol),o.default.symbolInit(i[r][h],t[r].fc[h].C,t[r].fc[h].F),null==t[r].R&&(t[r].R=new Array(s.TOTFREQ)),t[r].R.fill(h,l,l+t[r].fc[h].F),l+=t[r].fc[h].F,a(l<=s.TOTFREQ),0===c&&h+1===(255&e.getByteAt(e.position()))?(h=255&e.get(),c=255&e.get()):0!==c?(c-=1,h+=1):h=255&e.get()}while(0!==h);0===n&&r+1===(255&e.getByteAt(e.position()))?(r=255&e.get(),n=255&e.get()):0!==n?(n-=1,r+=1):r=255&e.get()}while(0!==r)};const r=i(9747),s=i(6476),o=n(i(488));function a(e){if(!e)throw new r.CramMalformedError("assertion failed")}},9989:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,i=0){if(0===e.length)return t.fill(0),t;const n=new h(e,i),d=n.get();if(0!==d&&1!==d)throw new r.CramMalformedError(`Invalid rANS order ${d}`);if(n.getInt()!==n.remaining()-l)throw new r.CramMalformedError("Incorrect input length.");const u=n.getInt(),f=new h(t||new Uint8Array(u));if(f.length<u)throw new r.CramMalformedError(`Output buffer too small to fit ${u} bytes.`);switch(d){case 0:return function(e,t){const i=new a.default.AriDecoder,n=new Array(256);for(let e=0;e<n.length;e+=1)n[e]=new a.default.DecodingSymbol;return(0,c.readStatsO0)(e,i,n),(0,s.default)(e,i,n,t),t}(n,f);case 1:return function(e,t){const i=new Array(256);for(let e=0;e<i.length;e+=1)i[e]=new a.default.AriDecoder;const n=new Array(256);for(let e=0;e<n.length;e+=1){n[e]=new Array(256);for(let t=0;t<n[e].length;t+=1)n[e][t]=new a.default.DecodingSymbol}return(0,c.readStatsO1)(e,i,n),(0,o.default)(e,t,i,n),t}(n,f);default:throw new r.CramMalformedError(`Invalid rANS order: ${d}`)}};const r=i(9747),s=n(i(997)),o=n(i(7960)),a=n(i(488)),c=i(1971),l=4;class h{constructor(e,t=0){this._buffer=e,this._dataView=new DataView(e.buffer),this._position=t,this.length=e.length}get(){const e=this._buffer[this._position];return this._position+=1,e}getByte(){return this.get()}getByteAt(e){return this._buffer[e]}position(){return this._position}put(e){return this._buffer[this._position]=e,this._position+=1,e}putAt(e,t){return this._buffer[e]=t,t}setPosition(e){return this._position=e,e}getInt(){const e=this._dataView.getInt32(this._position,!0);return this._position+=4,e}remaining(){return this._buffer.length-this._position}}},5417:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseHeaderText=function(e){const t=e.split(/\r?\n/),i=[];for(const e of t){const[t,...n]=e.split(/\t/);t&&i.push({tag:t.slice(1),data:n.map((e=>{const t=e.indexOf(":");return-1!==t?{tag:e.slice(0,t),value:e.slice(t+1)}:{tag:e,value:""}}))})}return i}},2683:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=i(6305),r=[0,1,3,7,15,31,63,127,255];t.default=class{constructor(e){this.stream=e,this.bitOffset=0,this.curByte=0,this.hasByte=!1}_ensureByte(){this.hasByte||(this.curByte=this.stream.readByte(),this.hasByte=!0)}read(e){let t=0;for(;e>0;){this._ensureByte();const i=8-this.bitOffset;if(e>=i)t<<=i,t|=r[i]&this.curByte,this.hasByte=!1,this.bitOffset=0,e-=i;else{t<<=e;const n=i-e;t|=(this.curByte&r[e]<<n)>>n,this.bitOffset+=e,e=0}}return t}seek(e){const t=e%8,i=(e-t)/8;this.bitOffset=t,this.stream.seek(i),this.hasByte=!1}pi(){const e=new Uint8Array(6);for(let t=0;t<e.length;t++)e[t]=this.read(8);return(0,n.toHex)(e)}}},9092:e=>{e.exports=function(){const e=new Uint32Array([0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188]);return function(){let t=4294967295;this.getCRC=function(){return~t>>>0},this.updateCRC=function(i){t=t<<8^e[255&(t>>>24^i)]},this.updateCRCRun=function(i,n){for(;n-- >0;)t=t<<8^e[255&(t>>>24^i)]}}}()},9995:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,i){const n=u(e),r=f(t),s=new d(n,r);for(;!("eof"in n)||!n.eof();)if(s._init_block())s._read_bunzip();else{const e=s.reader.read(32)>>>0;if(e!==s.streamCRC&&h(c.DATA_ERROR,"Bad stream CRC (got "+s.streamCRC.toString(16)+" expected "+e.toString(16)+")"),!i||!("eof"in n)||n.eof())break;s._start_bunzip(n,r)}if("getBuffer"in r)return r.getBuffer()};const r=n(i(2683)),s=n(i(9092)),o=n(i(4271)),a=function(e,t){const i=e[t];for(let i=t;i>0;i--)e[i]=e[i-1];return e[0]=i,i},c={OK:0,LAST_BLOCK:-1,NOT_BZIP_DATA:-2,UNEXPECTED_INPUT_EOF:-3,UNEXPECTED_OUTPUT_EOF:-4,DATA_ERROR:-5,OUT_OF_MEMORY:-6,OBSOLETE_INPUT:-7,END_OF_BLOCK:-8},l={};l[c.LAST_BLOCK]="Bad file checksum",l[c.NOT_BZIP_DATA]="Not bzip data",l[c.UNEXPECTED_INPUT_EOF]="Unexpected input EOF",l[c.UNEXPECTED_OUTPUT_EOF]="Unexpected output EOF",l[c.DATA_ERROR]="Data error",l[c.OUT_OF_MEMORY]="Out of memory",l[c.OBSOLETE_INPUT]="Obsolete (pre 0.9.5) bzip format not supported.";const h=function(e,t){let i=l[e]||"unknown error";t&&(i+=": "+t);const n=new TypeError(i);throw n.errorCode=e,n};class d{constructor(e,t){this.writePos=this.writeCurrent=this.writeCount=0,this._start_bunzip(e,t)}_init_block(){return this._get_next_block()?(this.blockCRC=new s.default,!0):(this.writeCount=-1,!1)}_start_bunzip(e,t){const i=new Uint8Array(4);4===e.read(i,0,4)&&"BZh"===String.fromCharCode(i[0],i[1],i[2])||h(c.NOT_BZIP_DATA,"bad magic");const n=i[3]-48;(n<1||n>9)&&h(c.NOT_BZIP_DATA,"level out of range"),this.reader=new r.default(e),this.dbufSize=1e5*n,this.nextoutput=0,this.outputStream=t,this.streamCRC=0}_get_next_block(){let e,t,i;const n=this.reader,r=n.pi();if("177245385090"===r)return!1;"314159265359"!==r&&h(c.NOT_BZIP_DATA),this.targetBlockCRC=n.read(32)>>>0,this.streamCRC=(this.targetBlockCRC^(this.streamCRC<<1|this.streamCRC>>>31))>>>0,n.read(1)&&h(c.OBSOLETE_INPUT);const s=n.read(24);s>this.dbufSize&&h(c.DATA_ERROR,"initial position out of bounds");let o=n.read(16),l=new Uint8Array(256),d=0;for(e=0;e<16;e++)if(o&1<<15-e){const r=16*e;for(i=n.read(16),t=0;t<16;t++)i&1<<15-t&&(l[d++]=r+t)}const u=n.read(3);(u<2||u>6)&&h(c.DATA_ERROR);const f=n.read(15);0===f&&h(c.DATA_ERROR);const p=new Uint8Array(256);for(e=0;e<u;e++)p[e]=e;const g=new Uint8Array(f);for(e=0;e<f;e++){for(t=0;n.read(1);t++)t>=u&&h(c.DATA_ERROR);g[e]=a(p,t)}let m,w=d+2,b=[];for(t=0;t<u;t++){const t=new Uint8Array(w),i=new Uint16Array(21);for(o=n.read(5),e=0;e<w;e++){for(;(o<1||o>20)&&h(c.DATA_ERROR),n.read(1);)n.read(1)?o--:o++;t[e]=o}var F,v;for(F=v=t[0],e=1;e<w;e++)t[e]>v?v=t[e]:t[e]<F&&(F=t[e]);m={},b.push(m),m.permute=new Uint16Array(258),m.limit=new Uint32Array(22),m.base=new Uint32Array(21),m.minLen=F,m.maxLen=v;let r=0;for(e=F;e<=v;e++)for(i[e]=m.limit[e]=0,o=0;o<w;o++)t[o]===e&&(m.permute[r++]=o);for(e=0;e<w;e++)i[t[e]]++;for(r=o=0,e=F;e<v;e++)r+=i[e],m.limit[e]=r-1,r<<=1,o+=i[e],m.base[e+1]=r-o;m.limit[v+1]=Number.MAX_VALUE,m.limit[v]=r+i[v]-1,m.base[F]=0}const y=new Uint32Array(256);for(e=0;e<256;e++)p[e]=e;let A,C=0,_=0,x=0;const k=this.dbuf=new Uint32Array(this.dbufSize);for(w=0;;){for(w--||(w=49,x>=f&&h(c.DATA_ERROR),m=b[g[x++]]),e=m.minLen,t=n.read(e);e>m.maxLen&&h(c.DATA_ERROR),!(t<=m.limit[e]);e++)t=t<<1|n.read(1);t-=m.base[e],(t<0||t>=258)&&h(c.DATA_ERROR);const i=m.permute[t];if(0!==i&&1!==i){if(C)for(C=0,_+o>this.dbufSize&&h(c.DATA_ERROR),A=l[p[0]],y[A]+=o;o--;)k[_++]=A;if(i>d)break;_>=this.dbufSize&&h(c.DATA_ERROR),e=i-1,A=a(p,e),A=l[A],y[A]++,k[_++]=A}else C||(C=1,o=0),o+=0===i?C:2*C,C<<=1}for((s<0||s>=_)&&h(c.DATA_ERROR),t=0,e=0;e<256;e++)i=t+y[e],y[e]=t,t=i;for(e=0;e<_;e++)A=255&k[e],k[y[A]]|=e<<8,y[A]++;let I=0,S=0,E=0;return _&&(I=k[s],S=255&I,I>>=8,E=-1),this.writePos=I,this.writeCurrent=S,this.writeCount=_,this.writeRun=E,!0}_read_bunzip(e,t){let i,n,r;if(this.writeCount<0)return 0;let s=this.dbuf,o=this.writePos,a=this.writeCurrent,l=this.writeCount,d=(this.outputsize,this.writeRun);for(;l;){for(l--,n=a,o=s[o],a=255&o,o>>=8,3==d++?(i=a,r=n,a=-1):(i=1,r=a),this.blockCRC.updateCRCRun(r,i);i--;)this.outputStream.writeByte(r),this.nextoutput++;a!=n&&(d=0)}return this.writeCount=l,this.blockCRC.getCRC()!==this.targetBlockCRC&&h(c.DATA_ERROR,"Bad block CRC (got "+this.blockCRC.getCRC().toString(16)+" expected "+this.targetBlockCRC.toString(16)+")"),this.nextoutput}}const u=function(e){if("readByte"in e)return e;const t=new o.default;return t.pos=0,t.readByte=function(){return e[this.pos++]},t.seek=function(e){this.pos=e},t.eof=function(){return this.pos>=e.length},t},f=function(e){const t=new o.default;let i=!0;if(e)if("number"==typeof e)t.buffer=new Uint8Array(e),i=!1;else{if("writeByte"in e)return e;t.buffer=e,i=!1}else t.buffer=new Uint8Array(16384);return t.pos=0,t.writeByte=function(e){if(i&&this.pos>=this.buffer.length){const e=new Uint8Array(2*this.buffer.length);e.set(this.buffer),this.buffer=e}this.buffer[this.pos++]=e},t.getBuffer=function(){if(this.pos!==this.buffer.length){if(!i)throw new TypeError("outputsize does not match decoded input");const e=new Uint8Array(this.pos);e.set(this.buffer.slice(0,this.pos)),this.buffer=e}return this.buffer},t._coerced=!0,t};t.default=d},4271:e=>{const t=function(){};t.prototype.readByte=function(){throw new Error("abstract method readByte() not implemented")},t.prototype.read=function(e,t,i){let n=0;for(;n<i;){const i=this.readByte();if(i<0)return 0===n?-1:n;e[t++]=i,n++}return n},t.prototype.seek=function(e){throw new Error("abstract method seek() not implemented")},t.prototype.writeByte=function(e){throw new Error("abstract method readByte() not implemented")},t.prototype.write=function(e,t,i){let n;for(n=0;n<i;n++)this.writeByte(e[t++]);return i},t.prototype.flush=function(){},e.exports=t},6305:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toHex=function(e){let t="";for(let i=0,r=e.length;i<r;i++)t+=n[e[i]];return t};const i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"],n=new Array(256);for(let e=0;e<256;e++)n[e]=`${i[e>>>4&15]}${i[15&e]}`},8876:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.unzip=function(e){return(0,n.inflate)(e)};const n=i(1668)},3472:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.concatUint8Array=function(e){const t=new Uint8Array(function(e){let t=0;for(const i of e)t+=i.length;return t}(e));let i=0;for(const n of e)t.set(n,i),i+=n.length;return t}},2151:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],i=0;i<e.length;i++)t.push(255&e.charCodeAt(i));return t},bytesToString:function(e){for(var t=[],i=0;i<e.length;i++)t.push(String.fromCharCode(e[i]));return t.join("")}}};e.exports=t},3939:e=>{var t,i;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&i.rotl(e,8)|4278255360&i.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=i.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],i=0,n=0;i<e.length;i++,n+=8)t[n>>>5]|=e[i]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],i=0;i<32*e.length;i+=8)t.push(e[i>>>5]>>>24-i%32&255);return t},bytesToHex:function(e){for(var t=[],i=0;i<e.length;i++)t.push((e[i]>>>4).toString(16)),t.push((15&e[i]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t},bytesToBase64:function(e){for(var i=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],s=0;s<4;s++)8*n+6*s<=8*e.length?i.push(t.charAt(r>>>6*(3-s)&63)):i.push("=");return i.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var i=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&i.push((t.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|t.indexOf(e.charAt(n))>>>6-2*r);return i}},e.exports=i},689:(e,t,i)=>{i.r(t),i.d(t,{BlobFile:()=>a,LocalFile:()=>r(),RemoteFile:()=>o,fromUrl:()=>c,open:()=>l});var n=i(7937),r=i.n(n);function s(e){return("object"==typeof e&&null!==e&&"message"in e?e.message:`${e}`).replace(/\.$/,"")}class o{constructor(e,t={}){this.baseOverrides={},this.url=e;const i=t.fetch||globalThis.fetch.bind(globalThis);t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=i}async fetch(e,t){let i;try{i=await this.fetchImplementation(e,t)}catch(n){if(!`${n}`.includes("Failed to fetch"))throw new Error(`${s(n)} fetching ${e}`,{cause:n});console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{i=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(t){throw new Error(`${s(t)} fetching ${e}`,{cause:t})}}return i}async read(e,t,i={}){const{headers:n={},signal:r,overrides:s={}}=i;e<1/0?n.range=`bytes=${t}-${t+e}`:e===1/0&&0!==t&&(n.range=`bytes=${t}-`);const o=await this.fetch(this.url,{...this.baseOverrides,...s,headers:{...n,...s.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:r});if(!o.ok)throw new Error(`HTTP ${o.status} fetching ${this.url}`);if(200===o.status&&0===t||206===o.status){const t=await o.arrayBuffer(),i=o.headers.get("content-range"),n=/\/(\d+)$/.exec(i||"");return n?.[1]&&(this._stat={size:parseInt(n[1],10)}),new Uint8Array(t.slice(0,e))}throw 200===o.status?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${o.status} fetching ${this.url}`)}async readFile(e={}){let t,i;"string"==typeof e?(t=e,i={}):(t=e.encoding,i=e,delete i.encoding);const{headers:n={},signal:r,overrides:s={}}=i,o=await this.fetch(this.url,{headers:n,method:"GET",redirect:"follow",mode:"cors",signal:r,...this.baseOverrides,...s});if(200!==o.status)throw new Error(`HTTP ${o.status} fetching ${this.url}`);if("utf8"===t)return o.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await o.arrayBuffer())}async stat(){if(!this._stat&&(await this.read(10,0),!this._stat))throw new Error(`unable to determine size of file at ${this.url}`);return this._stat}async close(){}}class a{constructor(e){this.blob=e,this.size=e.size}async read(e,t=0){if(!e)return new Uint8Array(0);const i=t,n=i+e;return new Uint8Array(await this.blob.slice(i,n).arrayBuffer())}async readFile(e){const t="string"==typeof e?e:e?.encoding;if("utf8"===t)return this.blob.text();if(t)throw new Error(`unsupported encoding: ${t}`);return new Uint8Array(await this.blob.arrayBuffer())}async stat(){return{size:this.size}}async close(){}}function c(e,t={}){return new o(e,t)}function l(e,t,i,n={}){if(void 0!==i)return i;if(void 0!==e)return c(e,n);if(void 0!==t)return new(r())(t,n);throw new Error("no url, path, or filehandle provided, cannot open")}},3503:(e,t,i)=>{var n,r,s,o,a;n=i(3939),r=i(2151).utf8,s=i(652),o=i(2151).bin,(a=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?o.stringToBytes(e):r.stringToBytes(e):s(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var i=n.bytesToWords(e),c=8*e.length,l=1732584193,h=-271733879,d=-1732584194,u=271733878,f=0;f<i.length;f++)i[f]=16711935&(i[f]<<8|i[f]>>>24)|4278255360&(i[f]<<24|i[f]>>>8);i[c>>>5]|=128<<c%32,i[14+(c+64>>>9<<4)]=c;var p=a._ff,g=a._gg,m=a._hh,w=a._ii;for(f=0;f<i.length;f+=16){var b=l,F=h,v=d,y=u;l=p(l,h,d,u,i[f+0],7,-680876936),u=p(u,l,h,d,i[f+1],12,-389564586),d=p(d,u,l,h,i[f+2],17,606105819),h=p(h,d,u,l,i[f+3],22,-1044525330),l=p(l,h,d,u,i[f+4],7,-176418897),u=p(u,l,h,d,i[f+5],12,1200080426),d=p(d,u,l,h,i[f+6],17,-1473231341),h=p(h,d,u,l,i[f+7],22,-45705983),l=p(l,h,d,u,i[f+8],7,1770035416),u=p(u,l,h,d,i[f+9],12,-1958414417),d=p(d,u,l,h,i[f+10],17,-42063),h=p(h,d,u,l,i[f+11],22,-1990404162),l=p(l,h,d,u,i[f+12],7,1804603682),u=p(u,l,h,d,i[f+13],12,-40341101),d=p(d,u,l,h,i[f+14],17,-1502002290),l=g(l,h=p(h,d,u,l,i[f+15],22,1236535329),d,u,i[f+1],5,-165796510),u=g(u,l,h,d,i[f+6],9,-1069501632),d=g(d,u,l,h,i[f+11],14,643717713),h=g(h,d,u,l,i[f+0],20,-373897302),l=g(l,h,d,u,i[f+5],5,-701558691),u=g(u,l,h,d,i[f+10],9,38016083),d=g(d,u,l,h,i[f+15],14,-660478335),h=g(h,d,u,l,i[f+4],20,-405537848),l=g(l,h,d,u,i[f+9],5,568446438),u=g(u,l,h,d,i[f+14],9,-1019803690),d=g(d,u,l,h,i[f+3],14,-187363961),h=g(h,d,u,l,i[f+8],20,1163531501),l=g(l,h,d,u,i[f+13],5,-1444681467),u=g(u,l,h,d,i[f+2],9,-51403784),d=g(d,u,l,h,i[f+7],14,1735328473),l=m(l,h=g(h,d,u,l,i[f+12],20,-1926607734),d,u,i[f+5],4,-378558),u=m(u,l,h,d,i[f+8],11,-2022574463),d=m(d,u,l,h,i[f+11],16,1839030562),h=m(h,d,u,l,i[f+14],23,-35309556),l=m(l,h,d,u,i[f+1],4,-1530992060),u=m(u,l,h,d,i[f+4],11,1272893353),d=m(d,u,l,h,i[f+7],16,-155497632),h=m(h,d,u,l,i[f+10],23,-1094730640),l=m(l,h,d,u,i[f+13],4,681279174),u=m(u,l,h,d,i[f+0],11,-358537222),d=m(d,u,l,h,i[f+3],16,-722521979),h=m(h,d,u,l,i[f+6],23,76029189),l=m(l,h,d,u,i[f+9],4,-640364487),u=m(u,l,h,d,i[f+12],11,-421815835),d=m(d,u,l,h,i[f+15],16,530742520),l=w(l,h=m(h,d,u,l,i[f+2],23,-995338651),d,u,i[f+0],6,-198630844),u=w(u,l,h,d,i[f+7],10,1126891415),d=w(d,u,l,h,i[f+14],15,-1416354905),h=w(h,d,u,l,i[f+5],21,-57434055),l=w(l,h,d,u,i[f+12],6,1700485571),u=w(u,l,h,d,i[f+3],10,-1894986606),d=w(d,u,l,h,i[f+10],15,-1051523),h=w(h,d,u,l,i[f+1],21,-2054922799),l=w(l,h,d,u,i[f+8],6,1873313359),u=w(u,l,h,d,i[f+15],10,-30611744),d=w(d,u,l,h,i[f+6],15,-1560198380),h=w(h,d,u,l,i[f+13],21,1309151649),l=w(l,h,d,u,i[f+4],6,-145523070),u=w(u,l,h,d,i[f+11],10,-1120210379),d=w(d,u,l,h,i[f+2],15,718787259),h=w(h,d,u,l,i[f+9],21,-343485551),l=l+b>>>0,h=h+F>>>0,d=d+v>>>0,u=u+y>>>0}return n.endian([l,h,d,u])})._ff=function(e,t,i,n,r,s,o){var a=e+(t&i|~t&n)+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._gg=function(e,t,i,n,r,s,o){var a=e+(t&n|i&~n)+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._hh=function(e,t,i,n,r,s,o){var a=e+(t^i^n)+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._ii=function(e,t,i,n,r,s,o){var a=e+(i^(t|~n))+(r>>>0)+o;return(a<<s|a>>>32-s)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);var i=n.wordsToBytes(a(e,t));return t&&t.asBytes?i:t&&t.asString?o.bytesToString(i):n.bytesToHex(i)}},652:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},1668:(e,t,i)=>{var n={};(0,i(9805).assign)(n,i(3303),i(7083),i(9681)),e.exports=n},3303:(e,t,i)=>{var n=i(8411),r=i(9805),s=i(1996),o=i(4674),a=i(4442),c=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=r.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var i=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==i)throw new Error(o[i]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var h;if(h="string"==typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(i=n.deflateSetDictionary(this.strm,h)))throw new Error(o[i]);this._dict_set=!0}}function h(e,t){var i=new l(t);if(i.push(e,!0),i.err)throw i.msg||o[i.err];return i.result}l.prototype.push=function(e,t){var i,o,a=this.strm,l=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=s.string2buf(e):"[object ArrayBuffer]"===c.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(l),a.next_out=0,a.avail_out=l),1!==(i=n.deflate(a,o))&&0!==i)return this.onEnd(i),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(s.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==i);return 4===o?(i=n.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,0===i):2!==o||(this.onEnd(0),a.avail_out=0,!0)},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=l,t.deflate=h,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,h(e,t)}},7083:(e,t,i)=>{var n=i(1447),r=i(9805),s=i(1996),o=i(9681),a=i(4674),c=i(4442),l=i(7414),h=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var i=n.inflateInit2(this.strm,t.windowBits);if(i!==o.Z_OK)throw new Error(a[i]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=s.string2buf(t.dictionary):"[object ArrayBuffer]"===h.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=n.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(a[i])}function u(e,t){var i=new d(t);if(i.push(e,!0),i.err)throw i.msg||a[i.err];return i.result}d.prototype.push=function(e,t){var i,a,c,l,d,u=this.strm,f=this.options.chunkSize,p=this.options.dictionary,g=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?u.input=s.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?u.input=new Uint8Array(e):u.input=e,u.next_in=0,u.avail_in=u.input.length;do{if(0===u.avail_out&&(u.output=new r.Buf8(f),u.next_out=0,u.avail_out=f),(i=n.inflate(u,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&p&&(i=n.inflateSetDictionary(this.strm,p)),i===o.Z_BUF_ERROR&&!0===g&&(i=o.Z_OK,g=!1),i!==o.Z_STREAM_END&&i!==o.Z_OK)return this.onEnd(i),this.ended=!0,!1;u.next_out&&(0!==u.avail_out&&i!==o.Z_STREAM_END&&(0!==u.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(c=s.utf8border(u.output,u.next_out),l=u.next_out-c,d=s.buf2string(u.output,c),u.next_out=l,u.avail_out=f-l,l&&r.arraySet(u.output,u.output,c,l,0),this.onData(d)):this.onData(r.shrinkBuf(u.output,u.next_out)))),0===u.avail_in&&0===u.avail_out&&(g=!0)}while((u.avail_in>0||0===u.avail_out)&&i!==o.Z_STREAM_END);return i===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(i=n.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),u.avail_out=0,!0)},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=d,t.inflate=u,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,u(e,t)},t.ungzip=u},9805:(e,t)=>{var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(var r in i)n(i,r)&&(e[r]=i[r])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,i,n,r){if(t.subarray&&e.subarray)e.set(t.subarray(i,i+n),r);else for(var s=0;s<n;s++)e[r+s]=t[i+s]},flattenChunks:function(e){var t,i,n,r,s,o;for(n=0,t=0,i=e.length;t<i;t++)n+=e[t].length;for(o=new Uint8Array(n),r=0,t=0,i=e.length;t<i;t++)s=e[t],o.set(s,r),r+=s.length;return o}},s={arraySet:function(e,t,i,n,r){for(var s=0;s<n;s++)e[r+s]=t[i+s]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,r)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(i)},1996:(e,t,i)=>{var n=i(9805),r=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var o=new n.Buf8(256),a=0;a<256;a++)o[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function c(e,t){if(t<65534&&(e.subarray&&s||!e.subarray&&r))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var i="",o=0;o<t;o++)i+=String.fromCharCode(e[o]);return i}o[254]=o[254]=1,t.string2buf=function(e){var t,i,r,s,o,a=e.length,c=0;for(s=0;s<a;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),c+=i<128?1:i<2048?2:i<65536?3:4;for(t=new n.Buf8(c),o=0,s=0;o<c;s++)55296==(64512&(i=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(r=e.charCodeAt(s+1)))&&(i=65536+(i-55296<<10)+(r-56320),s++),i<128?t[o++]=i:i<2048?(t[o++]=192|i>>>6,t[o++]=128|63&i):i<65536?(t[o++]=224|i>>>12,t[o++]=128|i>>>6&63,t[o++]=128|63&i):(t[o++]=240|i>>>18,t[o++]=128|i>>>12&63,t[o++]=128|i>>>6&63,t[o++]=128|63&i);return t},t.buf2binstring=function(e){return c(e,e.length)},t.binstring2buf=function(e){for(var t=new n.Buf8(e.length),i=0,r=t.length;i<r;i++)t[i]=e.charCodeAt(i);return t},t.buf2string=function(e,t){var i,n,r,s,a=t||e.length,l=new Array(2*a);for(n=0,i=0;i<a;)if((r=e[i++])<128)l[n++]=r;else if((s=o[r])>4)l[n++]=65533,i+=s-1;else{for(r&=2===s?31:3===s?15:7;s>1&&i<a;)r=r<<6|63&e[i++],s--;s>1?l[n++]=65533:r<65536?l[n++]=r:(r-=65536,l[n++]=55296|r>>10&1023,l[n++]=56320|1023&r)}return c(l,n)},t.utf8border=function(e,t){var i;for((t=t||e.length)>e.length&&(t=e.length),i=t-1;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+o[e[i]]>t?i:t}},3269:e=>{e.exports=function(e,t,i,n){for(var r=65535&e,s=e>>>16&65535,o=0;0!==i;){i-=o=i>2e3?2e3:i;do{s=s+(r=r+t[n++]|0)|0}while(--o);r%=65521,s%=65521}return r|s<<16}},9681:e=>{e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},4823:e=>{var t=function(){for(var e,t=[],i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t}();e.exports=function(e,i,n,r){var s=t,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^s[255&(e^i[a])];return~e}},8411:(e,t,i)=>{var n,r=i(9805),s=i(3665),o=i(3269),a=i(4823),c=i(4674),l=-2,h=258,d=262,u=103,f=113,p=666;function g(e,t){return e.msg=c[t],t}function m(e){return(e<<1)-(e>4?9:0)}function w(e){for(var t=e.length;--t>=0;)e[t]=0}function b(e){var t=e.state,i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(r.arraySet(e.output,t.pending_buf,t.pending_out,i,e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))}function F(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,b(e.strm)}function v(e,t){e.pending_buf[e.pending++]=t}function y(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function A(e,t,i,n){var s=e.avail_in;return s>n&&(s=n),0===s?0:(e.avail_in-=s,r.arraySet(t,e.input,e.next_in,s,i),1===e.state.wrap?e.adler=o(e.adler,t,s,i):2===e.state.wrap&&(e.adler=a(e.adler,t,s,i)),e.next_in+=s,e.total_in+=s,s)}function C(e,t){var i,n,r=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-d?e.strstart-(e.w_size-d):0,l=e.window,u=e.w_mask,f=e.prev,p=e.strstart+h,g=l[s+o-1],m=l[s+o];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do{if(l[(i=t)+o]===m&&l[i+o-1]===g&&l[i]===l[s]&&l[++i]===l[s+1]){s+=2,i++;do{}while(l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&l[++s]===l[++i]&&s<p);if(n=h-(p-s),s=p-h,n>o){if(e.match_start=t,o=n,n>=a)break;g=l[s+o-1],m=l[s+o]}}}while((t=f[t&u])>c&&0!=--r);return o<=e.lookahead?o:e.lookahead}function _(e){var t,i,n,s,o,a=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=a+(a-d)){r.arraySet(e.window,e.window,a,a,0),e.match_start-=a,e.strstart-=a,e.block_start-=a,t=i=e.hash_size;do{n=e.head[--t],e.head[t]=n>=a?n-a:0}while(--i);t=i=a;do{n=e.prev[--t],e.prev[t]=n>=a?n-a:0}while(--i);s+=a}if(0===e.strm.avail_in)break;if(i=A(e.strm,e.window,e.strstart+e.lookahead,s),e.lookahead+=i,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+3-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<d&&0!==e.strm.avail_in)}function x(e,t){for(var i,n;;){if(e.lookahead<d){if(_(e),e.lookahead<d&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-d&&(e.match_length=C(e,i)),e.match_length>=3)if(n=s._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(F(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(F(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(F(e,!1),0===e.strm.avail_out)?1:2}function k(e,t){for(var i,n,r;;){if(e.lookahead<d){if(_(e),e.lookahead<d&&0===t)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-d&&(e.match_length=C(e,i),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,n=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(F(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=s._tr_tally(e,0,e.window[e.strstart-1]))&&F(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(F(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(F(e,!1),0===e.strm.avail_out)?1:2}function I(e,t,i,n,r){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=n,this.func=r}function S(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(1146),this.dyn_dtree=new r.Buf16(122),this.bl_tree=new r.Buf16(78),w(this.dyn_ltree),w(this.dyn_dtree),w(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(16),this.heap=new r.Buf16(573),w(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(573),w(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function E(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:f,e.adler=2===t.wrap?0:1,t.last_flush=0,s._tr_init(t),0):g(e,l)}function N(e){var t,i=E(e);return 0===i&&((t=e.state).window_size=2*t.w_size,w(t.head),t.max_lazy_match=n[t.level].max_lazy,t.good_match=n[t.level].good_length,t.nice_match=n[t.level].nice_length,t.max_chain_length=n[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),i}function M(e,t,i,n,s,o){if(!e)return l;var a=1;if(-1===t&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),s<1||s>9||8!==i||n<8||n>15||t<0||t>9||o<0||o>4)return g(e,l);8===n&&(n=9);var c=new S;return e.state=c,c.strm=e,c.wrap=a,c.gzhead=null,c.w_bits=n,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=s+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new r.Buf8(2*c.w_size),c.head=new r.Buf16(c.hash_size),c.prev=new r.Buf16(c.w_size),c.lit_bufsize=1<<s+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new r.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=i,N(e)}n=[new I(0,0,0,0,(function(e,t){var i=65535;for(i>e.pending_buf_size-5&&(i=e.pending_buf_size-5);;){if(e.lookahead<=1){if(_(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+i;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,F(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-d&&(F(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(F(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(F(e,!1),e.strm.avail_out),1)})),new I(4,4,8,4,x),new I(4,5,16,8,x),new I(4,6,32,32,x),new I(4,4,16,16,k),new I(8,16,32,32,k),new I(8,16,128,128,k),new I(8,32,128,256,k),new I(32,128,258,1024,k),new I(32,258,258,4096,k)],t.deflateInit=function(e,t){return M(e,t,8,15,8,0)},t.deflateInit2=M,t.deflateReset=N,t.deflateResetKeep=E,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?l:(e.state.gzhead=t,0):l},t.deflate=function(e,t){var i,r,o,c;if(!e||!e.state||t>5||t<0)return e?g(e,l):l;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||r.status===p&&4!==t)return g(e,0===e.avail_out?-5:l);if(r.strm=e,i=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,v(r,31),v(r,139),v(r,8),r.gzhead?(v(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),v(r,255&r.gzhead.time),v(r,r.gzhead.time>>8&255),v(r,r.gzhead.time>>16&255),v(r,r.gzhead.time>>24&255),v(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),v(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(v(r,255&r.gzhead.extra.length),v(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=a(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(v(r,0),v(r,0),v(r,0),v(r,0),v(r,0),v(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),v(r,3),r.status=f);else{var d=8+(r.w_bits-8<<4)<<8;d|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(d|=32),d+=31-d%31,r.status=f,y(r,d),0!==r.strstart&&(y(r,e.adler>>>16),y(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(o=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),b(e),o=r.pending,r.pending!==r.pending_buf_size));)v(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),b(e),o=r.pending,r.pending===r.pending_buf_size)){c=1;break}c=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,v(r,c)}while(0!==c);r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===c&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){o=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),b(e),o=r.pending,r.pending===r.pending_buf_size)){c=1;break}c=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,v(r,c)}while(0!==c);r.gzhead.hcrc&&r.pending>o&&(e.adler=a(e.adler,r.pending_buf,r.pending-o,o)),0===c&&(r.status=u)}else r.status=u;if(r.status===u&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&b(e),r.pending+2<=r.pending_buf_size&&(v(r,255&e.adler),v(r,e.adler>>8&255),e.adler=0,r.status=f)):r.status=f),0!==r.pending){if(b(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&m(t)<=m(i)&&4!==t)return g(e,-5);if(r.status===p&&0!==e.avail_in)return g(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&r.status!==p){var A=2===r.strategy?function(e,t){for(var i;;){if(0===e.lookahead&&(_(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(F(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(F(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(F(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var i,n,r,o,a=e.window;;){if(e.lookahead<=h){if(_(e),e.lookahead<=h&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=a[r=e.strstart-1])===a[++r]&&n===a[++r]&&n===a[++r]){o=e.strstart+h;do{}while(n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&n===a[++r]&&r<o);e.match_length=h-(o-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=s._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(F(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(F(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(F(e,!1),0===e.strm.avail_out)?1:2}(r,t):n[r.level].func(r,t);if(3!==A&&4!==A||(r.status=p),1===A||3===A)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===A&&(1===t?s._tr_align(r):5!==t&&(s._tr_stored_block(r,0,0,!1),3===t&&(w(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),b(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(v(r,255&e.adler),v(r,e.adler>>8&255),v(r,e.adler>>16&255),v(r,e.adler>>24&255),v(r,255&e.total_in),v(r,e.total_in>>8&255),v(r,e.total_in>>16&255),v(r,e.total_in>>24&255)):(y(r,e.adler>>>16),y(r,65535&e.adler)),b(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},t.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==u&&t!==f&&t!==p?g(e,l):(e.state=null,t===f?g(e,-3):0):l},t.deflateSetDictionary=function(e,t){var i,n,s,a,c,h,d,u,f=t.length;if(!e||!e.state)return l;if(2===(a=(i=e.state).wrap)||1===a&&42!==i.status||i.lookahead)return l;for(1===a&&(e.adler=o(e.adler,t,f,0)),i.wrap=0,f>=i.w_size&&(0===a&&(w(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new r.Buf8(i.w_size),r.arraySet(u,t,f-i.w_size,i.w_size,0),t=u,f=i.w_size),c=e.avail_in,h=e.next_in,d=e.input,e.avail_in=f,e.next_in=0,e.input=t,_(i);i.lookahead>=3;){n=i.strstart,s=i.lookahead-2;do{i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+3-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++}while(--s);i.strstart=n,i.lookahead=2,_(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=h,e.input=d,e.avail_in=c,i.wrap=a,0},t.deflateInfo="pako deflate (from Nodeca project)"},7414:e=>{e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},7293:e=>{e.exports=function(e,t){var i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v,y,A,C,_,x,k;i=e.state,n=e.next_in,x=e.input,r=n+(e.avail_in-5),s=e.next_out,k=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),c=i.dmax,l=i.wsize,h=i.whave,d=i.wnext,u=i.window,f=i.hold,p=i.bits,g=i.lencode,m=i.distcode,w=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;e:do{p<15&&(f+=x[n++]<<p,p+=8,f+=x[n++]<<p,p+=8),F=g[f&w];t:for(;;){if(f>>>=v=F>>>24,p-=v,0==(v=F>>>16&255))k[s++]=65535&F;else{if(!(16&v)){if(64&v){if(32&v){i.mode=12;break e}e.msg="invalid literal/length code",i.mode=30;break e}F=g[(65535&F)+(f&(1<<v)-1)];continue t}for(y=65535&F,(v&=15)&&(p<v&&(f+=x[n++]<<p,p+=8),y+=f&(1<<v)-1,f>>>=v,p-=v),p<15&&(f+=x[n++]<<p,p+=8,f+=x[n++]<<p,p+=8),F=m[f&b];;){if(f>>>=v=F>>>24,p-=v,16&(v=F>>>16&255)){if(A=65535&F,p<(v&=15)&&(f+=x[n++]<<p,(p+=8)<v&&(f+=x[n++]<<p,p+=8)),(A+=f&(1<<v)-1)>c){e.msg="invalid distance too far back",i.mode=30;break e}if(f>>>=v,p-=v,A>(v=s-o)){if((v=A-v)>h&&i.sane){e.msg="invalid distance too far back",i.mode=30;break e}if(C=0,_=u,0===d){if(C+=l-v,v<y){y-=v;do{k[s++]=u[C++]}while(--v);C=s-A,_=k}}else if(d<v){if(C+=l+d-v,(v-=d)<y){y-=v;do{k[s++]=u[C++]}while(--v);if(C=0,d<y){y-=v=d;do{k[s++]=u[C++]}while(--v);C=s-A,_=k}}}else if(C+=d-v,v<y){y-=v;do{k[s++]=u[C++]}while(--v);C=s-A,_=k}for(;y>2;)k[s++]=_[C++],k[s++]=_[C++],k[s++]=_[C++],y-=3;y&&(k[s++]=_[C++],y>1&&(k[s++]=_[C++]))}else{C=s-A;do{k[s++]=k[C++],k[s++]=k[C++],k[s++]=k[C++],y-=3}while(y>2);y&&(k[s++]=k[C++],y>1&&(k[s++]=k[C++]))}break}if(64&v){e.msg="invalid distance code",i.mode=30;break e}F=m[(65535&F)+(f&(1<<v)-1)]}}break}}while(n<r&&s<a);n-=y=p>>3,f&=(1<<(p-=y<<3))-1,e.next_in=n,e.next_out=s,e.avail_in=n<r?r-n+5:5-(n-r),e.avail_out=s<a?a-s+257:257-(s-a),i.hold=f,i.bits=p}},1447:(e,t,i)=>{var n=i(9805),r=i(3269),s=i(4823),o=i(7293),a=i(1998),c=-2,l=12,h=30;function d(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):c}function p(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,f(e)):c}function g(e,t){var i,n;return e&&e.state?(n=e.state,t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?c:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,p(e))):c}function m(e,t){var i,n;return e?(n=new u,e.state=n,n.window=null,0!==(i=g(e,t))&&(e.state=null),i):c}var w,b,F=!0;function v(e){if(F){var t;for(w=new n.Buf32(512),b=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,w,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,b,0,e.work,{bits:5}),F=!1}e.lencode=w,e.lenbits=9,e.distcode=b,e.distbits=5}function y(e,t,i,r){var s,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),r>=o.wsize?(n.arraySet(o.window,t,i-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>r&&(s=r),n.arraySet(o.window,t,i-r,s,o.wnext),(r-=s)?(n.arraySet(o.window,t,i-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}t.inflateReset=p,t.inflateReset2=g,t.inflateResetKeep=f,t.inflateInit=function(e){return m(e,15)},t.inflateInit2=m,t.inflate=function(e,t){var i,u,f,p,g,m,w,b,F,A,C,_,x,k,I,S,E,N,M,R,B,D,T,z,L=0,H=new n.Buf8(4),P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;(i=e.state).mode===l&&(i.mode=13),g=e.next_out,f=e.output,w=e.avail_out,p=e.next_in,u=e.input,m=e.avail_in,b=i.hold,F=i.bits,A=m,C=w,D=0;e:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;F<16;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(2&i.wrap&&35615===b){i.check=0,H[0]=255&b,H[1]=b>>>8&255,i.check=s(i.check,H,2,0),b=0,F=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg="incorrect header check",i.mode=h;break}if(8!=(15&b)){e.msg="unknown compression method",i.mode=h;break}if(F-=4,B=8+(15&(b>>>=4)),0===i.wbits)i.wbits=B;else if(B>i.wbits){e.msg="invalid window size",i.mode=h;break}i.dmax=1<<B,e.adler=i.check=1,i.mode=512&b?10:l,b=0,F=0;break;case 2:for(;F<16;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(i.flags=b,8!=(255&i.flags)){e.msg="unknown compression method",i.mode=h;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=h;break}i.head&&(i.head.text=b>>8&1),512&i.flags&&(H[0]=255&b,H[1]=b>>>8&255,i.check=s(i.check,H,2,0)),b=0,F=0,i.mode=3;case 3:for(;F<32;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}i.head&&(i.head.time=b),512&i.flags&&(H[0]=255&b,H[1]=b>>>8&255,H[2]=b>>>16&255,H[3]=b>>>24&255,i.check=s(i.check,H,4,0)),b=0,F=0,i.mode=4;case 4:for(;F<16;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}i.head&&(i.head.xflags=255&b,i.head.os=b>>8),512&i.flags&&(H[0]=255&b,H[1]=b>>>8&255,i.check=s(i.check,H,2,0)),b=0,F=0,i.mode=5;case 5:if(1024&i.flags){for(;F<16;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}i.length=b,i.head&&(i.head.extra_len=b),512&i.flags&&(H[0]=255&b,H[1]=b>>>8&255,i.check=s(i.check,H,2,0)),b=0,F=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&((_=i.length)>m&&(_=m),_&&(i.head&&(B=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,u,p,_,B)),512&i.flags&&(i.check=s(i.check,u,_,p)),m-=_,p+=_,i.length-=_),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===m)break e;_=0;do{B=u[p+_++],i.head&&B&&i.length<65536&&(i.head.name+=String.fromCharCode(B))}while(B&&_<m);if(512&i.flags&&(i.check=s(i.check,u,_,p)),m-=_,p+=_,B)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===m)break e;_=0;do{B=u[p+_++],i.head&&B&&i.length<65536&&(i.head.comment+=String.fromCharCode(B))}while(B&&_<m);if(512&i.flags&&(i.check=s(i.check,u,_,p)),m-=_,p+=_,B)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;F<16;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(b!==(65535&i.check)){e.msg="header crc mismatch",i.mode=h;break}b=0,F=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=l;break;case 10:for(;F<32;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}e.adler=i.check=d(b),b=0,F=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=g,e.avail_out=w,e.next_in=p,e.avail_in=m,i.hold=b,i.bits=F,2;e.adler=i.check=1,i.mode=l;case l:if(5===t||6===t)break e;case 13:if(i.last){b>>>=7&F,F-=7&F,i.mode=27;break}for(;F<3;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}switch(i.last=1&b,F-=1,3&(b>>>=1)){case 0:i.mode=14;break;case 1:if(v(i),i.mode=20,6===t){b>>>=2,F-=2;break e}break;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=h}b>>>=2,F-=2;break;case 14:for(b>>>=7&F,F-=7&F;F<32;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if((65535&b)!=(b>>>16^65535)){e.msg="invalid stored block lengths",i.mode=h;break}if(i.length=65535&b,b=0,F=0,i.mode=15,6===t)break e;case 15:i.mode=16;case 16:if(_=i.length){if(_>m&&(_=m),_>w&&(_=w),0===_)break e;n.arraySet(f,u,p,_,g),m-=_,p+=_,w-=_,g+=_,i.length-=_;break}i.mode=l;break;case 17:for(;F<14;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(i.nlen=257+(31&b),b>>>=5,F-=5,i.ndist=1+(31&b),b>>>=5,F-=5,i.ncode=4+(15&b),b>>>=4,F-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=h;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;F<3;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}i.lens[P[i.have++]]=7&b,b>>>=3,F-=3}for(;i.have<19;)i.lens[P[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,T={bits:i.lenbits},D=a(0,i.lens,0,19,i.lencode,0,i.work,T),i.lenbits=T.bits,D){e.msg="invalid code lengths set",i.mode=h;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;S=(L=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,E=65535&L,!((I=L>>>24)<=F);){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(E<16)b>>>=I,F-=I,i.lens[i.have++]=E;else{if(16===E){for(z=I+2;F<z;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(b>>>=I,F-=I,0===i.have){e.msg="invalid bit length repeat",i.mode=h;break}B=i.lens[i.have-1],_=3+(3&b),b>>>=2,F-=2}else if(17===E){for(z=I+3;F<z;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}F-=I,B=0,_=3+(7&(b>>>=I)),b>>>=3,F-=3}else{for(z=I+7;F<z;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}F-=I,B=0,_=11+(127&(b>>>=I)),b>>>=7,F-=7}if(i.have+_>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=h;break}for(;_--;)i.lens[i.have++]=B}}if(i.mode===h)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=h;break}if(i.lenbits=9,T={bits:i.lenbits},D=a(1,i.lens,0,i.nlen,i.lencode,0,i.work,T),i.lenbits=T.bits,D){e.msg="invalid literal/lengths set",i.mode=h;break}if(i.distbits=6,i.distcode=i.distdyn,T={bits:i.distbits},D=a(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,T),i.distbits=T.bits,D){e.msg="invalid distances set",i.mode=h;break}if(i.mode=20,6===t)break e;case 20:i.mode=21;case 21:if(m>=6&&w>=258){e.next_out=g,e.avail_out=w,e.next_in=p,e.avail_in=m,i.hold=b,i.bits=F,o(e,C),g=e.next_out,f=e.output,w=e.avail_out,p=e.next_in,u=e.input,m=e.avail_in,b=i.hold,F=i.bits,i.mode===l&&(i.back=-1);break}for(i.back=0;S=(L=i.lencode[b&(1<<i.lenbits)-1])>>>16&255,E=65535&L,!((I=L>>>24)<=F);){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(S&&!(240&S)){for(N=I,M=S,R=E;S=(L=i.lencode[R+((b&(1<<N+M)-1)>>N)])>>>16&255,E=65535&L,!(N+(I=L>>>24)<=F);){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}b>>>=N,F-=N,i.back+=N}if(b>>>=I,F-=I,i.back+=I,i.length=E,0===S){i.mode=26;break}if(32&S){i.back=-1,i.mode=l;break}if(64&S){e.msg="invalid literal/length code",i.mode=h;break}i.extra=15&S,i.mode=22;case 22:if(i.extra){for(z=i.extra;F<z;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}i.length+=b&(1<<i.extra)-1,b>>>=i.extra,F-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;S=(L=i.distcode[b&(1<<i.distbits)-1])>>>16&255,E=65535&L,!((I=L>>>24)<=F);){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(!(240&S)){for(N=I,M=S,R=E;S=(L=i.distcode[R+((b&(1<<N+M)-1)>>N)])>>>16&255,E=65535&L,!(N+(I=L>>>24)<=F);){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}b>>>=N,F-=N,i.back+=N}if(b>>>=I,F-=I,i.back+=I,64&S){e.msg="invalid distance code",i.mode=h;break}i.offset=E,i.extra=15&S,i.mode=24;case 24:if(i.extra){for(z=i.extra;F<z;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}i.offset+=b&(1<<i.extra)-1,b>>>=i.extra,F-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=h;break}i.mode=25;case 25:if(0===w)break e;if(_=C-w,i.offset>_){if((_=i.offset-_)>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=h;break}_>i.wnext?(_-=i.wnext,x=i.wsize-_):x=i.wnext-_,_>i.length&&(_=i.length),k=i.window}else k=f,x=g-i.offset,_=i.length;_>w&&(_=w),w-=_,i.length-=_;do{f[g++]=k[x++]}while(--_);0===i.length&&(i.mode=21);break;case 26:if(0===w)break e;f[g++]=i.length,w--,i.mode=21;break;case 27:if(i.wrap){for(;F<32;){if(0===m)break e;m--,b|=u[p++]<<F,F+=8}if(C-=w,e.total_out+=C,i.total+=C,C&&(e.adler=i.check=i.flags?s(i.check,f,C,g-C):r(i.check,f,C,g-C)),C=w,(i.flags?b:d(b))!==i.check){e.msg="incorrect data check",i.mode=h;break}b=0,F=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;F<32;){if(0===m)break e;m--,b+=u[p++]<<F,F+=8}if(b!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=h;break}b=0,F=0}i.mode=29;case 29:D=1;break e;case h:D=-3;break e;case 31:return-4;default:return c}return e.next_out=g,e.avail_out=w,e.next_in=p,e.avail_in=m,i.hold=b,i.bits=F,(i.wsize||C!==e.avail_out&&i.mode<h&&(i.mode<27||4!==t))&&y(e,e.output,e.next_out,C-e.avail_out)?(i.mode=31,-4):(A-=e.avail_in,C-=e.avail_out,e.total_in+=A,e.total_out+=C,i.total+=C,i.wrap&&C&&(e.adler=i.check=i.flags?s(i.check,f,C,e.next_out-C):r(i.check,f,C,e.next_out-C)),e.data_type=i.bits+(i.last?64:0)+(i.mode===l?128:0)+(20===i.mode||15===i.mode?256:0),(0===A&&0===C||4===t)&&0===D&&(D=-5),D)},t.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,0},t.inflateGetHeader=function(e,t){var i;return e&&e.state&&2&(i=e.state).wrap?(i.head=t,t.done=!1,0):c},t.inflateSetDictionary=function(e,t){var i,n=t.length;return e&&e.state?0!==(i=e.state).wrap&&11!==i.mode?c:11===i.mode&&r(1,t,n,0)!==i.check?-3:y(e,t,n,n)?(i.mode=31,-4):(i.havedict=1,0):c},t.inflateInfo="pako inflate (from Nodeca project)"},1998:(e,t,i)=>{var n=i(9805),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],s=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,i,c,l,h,d,u){var f,p,g,m,w,b,F,v,y,A=u.bits,C=0,_=0,x=0,k=0,I=0,S=0,E=0,N=0,M=0,R=0,B=null,D=0,T=new n.Buf16(16),z=new n.Buf16(16),L=null,H=0;for(C=0;C<=15;C++)T[C]=0;for(_=0;_<c;_++)T[t[i+_]]++;for(I=A,k=15;k>=1&&0===T[k];k--);if(I>k&&(I=k),0===k)return l[h++]=20971520,l[h++]=20971520,u.bits=1,0;for(x=1;x<k&&0===T[x];x++);for(I<x&&(I=x),N=1,C=1;C<=15;C++)if(N<<=1,(N-=T[C])<0)return-1;if(N>0&&(0===e||1!==k))return-1;for(z[1]=0,C=1;C<15;C++)z[C+1]=z[C]+T[C];for(_=0;_<c;_++)0!==t[i+_]&&(d[z[t[i+_]]++]=_);if(0===e?(B=L=d,b=19):1===e?(B=r,D-=257,L=s,H-=257,b=256):(B=o,L=a,b=-1),R=0,_=0,C=x,w=h,S=I,E=0,g=-1,m=(M=1<<I)-1,1===e&&M>852||2===e&&M>592)return 1;for(;;){F=C-E,d[_]<b?(v=0,y=d[_]):d[_]>b?(v=L[H+d[_]],y=B[D+d[_]]):(v=96,y=0),f=1<<C-E,x=p=1<<S;do{l[w+(R>>E)+(p-=f)]=F<<24|v<<16|y}while(0!==p);for(f=1<<C-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,_++,0==--T[C]){if(C===k)break;C=t[i+d[_]]}if(C>I&&(R&m)!==g){for(0===E&&(E=I),w+=x,N=1<<(S=C-E);S+E<k&&!((N-=T[S+E])<=0);)S++,N<<=1;if(M+=1<<S,1===e&&M>852||2===e&&M>592)return 1;l[g=R&m]=I<<24|S<<16|w-h}}return 0!==R&&(l[w+R]=C-E<<24|64<<16),u.bits=I,0}},4674:e=>{e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},3665:(e,t,i)=>{var n=i(9805);function r(e){for(var t=e.length;--t>=0;)e[t]=0}var s=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],o=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],c=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],l=new Array(576);r(l);var h=new Array(60);r(h);var d=new Array(512);r(d);var u=new Array(256);r(u);var f=new Array(29);r(f);var p,g,m,w=new Array(30);function b(e,t,i,n,r){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=n,this.max_length=r,this.has_stree=e&&e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function v(e){return e<256?d[e]:d[256+(e>>>7)]}function y(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function A(e,t,i){e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,y(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)}function C(e,t,i){A(e,i[2*t],i[2*t+1])}function _(e,t){var i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1}function x(e,t,i){var n,r,s=new Array(16),o=0;for(n=1;n<=15;n++)s[n]=o=o+i[n-1]<<1;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=_(s[a]++,a))}}function k(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function I(e){e.bi_valid>8?y(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function S(e,t,i,n){var r=2*t,s=2*i;return e[r]<e[s]||e[r]===e[s]&&n[t]<=n[i]}function E(e,t,i){for(var n=e.heap[i],r=i<<1;r<=e.heap_len&&(r<e.heap_len&&S(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!S(t,n,e.heap[r],e.depth));)e.heap[i]=e.heap[r],i=r,r<<=1;e.heap[i]=n}function N(e,t,i){var n,r,a,c,l=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],r=e.pending_buf[e.l_buf+l],l++,0===n?C(e,r,t):(C(e,(a=u[r])+256+1,t),0!==(c=s[a])&&A(e,r-=f[a],c),C(e,a=v(--n),i),0!==(c=o[a])&&A(e,n-=w[a],c))}while(l<e.last_lit);C(e,256,t)}function M(e,t){var i,n,r,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,i=0;i<c;i++)0!==s[2*i]?(e.heap[++e.heap_len]=l=i,e.depth[i]=0):s[2*i+1]=0;for(;e.heap_len<2;)s[2*(r=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[r]=0,e.opt_len--,a&&(e.static_len-=o[2*r+1]);for(t.max_code=l,i=e.heap_len>>1;i>=1;i--)E(e,s,i);r=c;do{i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],E(e,s,1),n=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=n,s[2*r]=s[2*i]+s[2*n],e.depth[r]=(e.depth[i]>=e.depth[n]?e.depth[i]:e.depth[n])+1,s[2*i+1]=s[2*n+1]=r,e.heap[1]=r++,E(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var i,n,r,s,o,a,c=t.dyn_tree,l=t.max_code,h=t.stat_desc.static_tree,d=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,p=t.stat_desc.max_length,g=0;for(s=0;s<=15;s++)e.bl_count[s]=0;for(c[2*e.heap[e.heap_max]+1]=0,i=e.heap_max+1;i<573;i++)(s=c[2*c[2*(n=e.heap[i])+1]+1]+1)>p&&(s=p,g++),c[2*n+1]=s,n>l||(e.bl_count[s]++,o=0,n>=f&&(o=u[n-f]),a=c[2*n],e.opt_len+=a*(s+o),d&&(e.static_len+=a*(h[2*n+1]+o)));if(0!==g){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=e.bl_count[s];0!==n;)(r=e.heap[--i])>l||(c[2*r+1]!==s&&(e.opt_len+=(s-c[2*r+1])*c[2*r],c[2*r+1]=s),n--)}}(e,t),x(s,l,e.bl_count)}function R(e,t,i){var n,r,s=-1,o=t[1],a=0,c=7,l=4;for(0===o&&(c=138,l=3),t[2*(i+1)+1]=65535,n=0;n<=i;n++)r=o,o=t[2*(n+1)+1],++a<c&&r===o||(a<l?e.bl_tree[2*r]+=a:0!==r?(r!==s&&e.bl_tree[2*r]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,a=0,s=r,0===o?(c=138,l=3):r===o?(c=6,l=3):(c=7,l=4))}function B(e,t,i){var n,r,s=-1,o=t[1],a=0,c=7,l=4;for(0===o&&(c=138,l=3),n=0;n<=i;n++)if(r=o,o=t[2*(n+1)+1],!(++a<c&&r===o)){if(a<l)do{C(e,r,e.bl_tree)}while(0!=--a);else 0!==r?(r!==s&&(C(e,r,e.bl_tree),a--),C(e,16,e.bl_tree),A(e,a-3,2)):a<=10?(C(e,17,e.bl_tree),A(e,a-3,3)):(C(e,18,e.bl_tree),A(e,a-11,7));a=0,s=r,0===o?(c=138,l=3):r===o?(c=6,l=3):(c=7,l=4)}}r(w);var D=!1;function T(e,t,i,r){A(e,0+(r?1:0),3),function(e,t,i){I(e),y(e,i),y(e,~i),n.arraySet(e.pending_buf,e.window,t,i,e.pending),e.pending+=i}(e,t,i)}t._tr_init=function(e){D||(function(){var e,t,i,n,r,c=new Array(16);for(i=0,n=0;n<28;n++)for(f[n]=i,e=0;e<1<<s[n];e++)u[i++]=n;for(u[i-1]=n,r=0,n=0;n<16;n++)for(w[n]=r,e=0;e<1<<o[n];e++)d[r++]=n;for(r>>=7;n<30;n++)for(w[n]=r<<7,e=0;e<1<<o[n]-7;e++)d[256+r++]=n;for(t=0;t<=15;t++)c[t]=0;for(e=0;e<=143;)l[2*e+1]=8,e++,c[8]++;for(;e<=255;)l[2*e+1]=9,e++,c[9]++;for(;e<=279;)l[2*e+1]=7,e++,c[7]++;for(;e<=287;)l[2*e+1]=8,e++,c[8]++;for(x(l,287,c),e=0;e<30;e++)h[2*e+1]=5,h[2*e]=_(e,5);p=new b(l,s,257,286,15),g=new b(h,o,0,30,15),m=new b(new Array(0),a,0,19,7)}(),D=!0),e.l_desc=new F(e.dyn_ltree,p),e.d_desc=new F(e.dyn_dtree,g),e.bl_desc=new F(e.bl_tree,m),e.bi_buf=0,e.bi_valid=0,k(e)},t._tr_stored_block=T,t._tr_flush_block=function(e,t,i,n){var r,s,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),M(e,e.l_desc),M(e,e.d_desc),o=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),M(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*c[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),r=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=r&&(r=s)):r=s=i+5,i+4<=r&&-1!==t?T(e,t,i,n):4===e.strategy||s===r?(A(e,2+(n?1:0),3),N(e,l,h)):(A(e,4+(n?1:0),3),function(e,t,i,n){var r;for(A(e,t-257,5),A(e,i-1,5),A(e,n-4,4),r=0;r<n;r++)A(e,e.bl_tree[2*c[r]+1],3);B(e,e.dyn_ltree,t-1),B(e,e.dyn_dtree,i-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),N(e,e.dyn_ltree,e.dyn_dtree)),k(e),n&&I(e)},t._tr_tally=function(e,t,i){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&i,e.last_lit++,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(u[i]+256+1)]++,e.dyn_dtree[2*v(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){A(e,2,3),C(e,256,l),function(e){16===e.bi_valid?(y(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},4442:e=>{e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},7392:e=>{class t{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){return this.cache.has(e)?this.cache.get(e):this.oldCache.has(e)?this.oldCache.get(e):void 0}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}e.exports=t},1307:function(e,t,i){var n;n=e=>(()=>{var t=[,e=>{e.exports="data:application/wasm;base64,AGFzbQEAAAABOApgAX8Bf2ABfwBgAABgA39/fwF/YAABf2ACf38AYAN/f34BfmACf38Bf2AEf39/fwF/YAN/f38AAyEgAAABAgMDAwMEAQUAAgMCBgcIBwUDAAMHAQcABwcBAwkFAwEAAgYIAX8BQfCgBAsHTgUGbWVtb3J5AgAOY3JlYXRlX2NvbnRleHQACA9kZXN0cm95X2NvbnRleHQACQxzdXBwbHlfaW5wdXQACg9nZXRfbmV4dF9vdXRwdXQACwqNYCDfAgEFf0EAIQECQCAAQQdqIgJBEEkNAEEBIQEgAkEDdiIDQQJGDQBBAiEBIAJBIEkNAEEDIQEgA0EERg0AQQQhASACQTBJDQBBBSEBIANBBkYNAEEGIQEgAkHIAEkNAEEHIQEgAkHYAEkNAEEIIQEgAkGIAUkNAEEJIQEgAkGIAkkNACAAEIGAgIAAIgBBCGpBACAAGw8LAkACQCABQQJ0QcCIgIAAaiIEKAIAIgANAEEAIQACQAJAQQAoAuSIgIAAIgJFDQBBACACKAIANgLkiICAAAwBC0EAEIGAgIAAIgJFDQILIAJBgIB8cSIAIAJBCHZB/wFxIgJyIAE6AAAgAkEIdCAAckGAAmohAEEAIQJBACABQQJ0QYCIgIAAaigCACIDayEFIAMhAQNAIAAgBWoiACACNgIAIAAhAiABIANqIgFBgQJJDQALIAQgADYCAAsgBCAAKAIANgIACyAAC+4HAQd/AkACQAJAAkACQEEALQC0iICAAEUNAEEAQQA6ALSIgIAAQQAoArCIgIAAIgFFDQFBsIiAgAAhAgNAAkACQCABQQhqIgMgASgCBCIEaiIFQQh2Qf8BcSIGDQAgASECDAELAkADQCAFQYCAfHEgBmotAABB/gFHDQFBsIiAgAAhBgNAIAYiBygCACIGIAVHDQALIAcgBSgCADYCACABIAQgBSgCBGpBCGoiBDYCBCAHIAIgAiAFRhshAiADIARqIgVBCHZB/wFxIgYNAAsLIAIoAgAhAgsgAigCACIBDQALC0EAKAKwiICAACIFRQ0AIABBhwJqQYB+cSEDQX8hAkGwiICAACEEQQAhAUGwiICAACEGA0AgBiEHAkAgBSIGKAIEIgUgAEkNACAFIAJPDQAgBSECIAchBCAGIQEgBUEIaiADRw0AIAchBCAFIQIgBiEBDAQLIAYoAgAiBQ0ACyABDQIMAQtBsIiAgAAhBAs/AEEQdCEBIABBiAJqIQdBACEDAkACQEEAKAK4iICAACICRQ0AQQAhBSABIQYMAQtBACABQfCghIAAQf//A2pBgIB8cSIGayICNgK4iICAACACIQULAkAgByAFTQ0AIAcgBWsiByACQQF2IgIgAiAHSRtB//8DaiIHQRB2QABBf0YNAkEAQQAoAriIgIAAIAdBgIB8cSIDajYCuIiAgAALIAZFDQEgBkH/AToAASAGQQAoArCIgIAANgKAAiAGQYQCaiADIAVqQYCAfHFB+H1qIgI2AgAgBkGAAmohAQsgAUGAgHxxIgYgAUEIdkH/AXFyQf8BOgAAIAQgASgCADYCAAJAIAIgAGtBgH5xIgUNACABDwsgASEDAkAgBiABQQhqIgQgAmoiByAFQX9zakGAgHxxRg0AIARB//8DcSEFAkAgAEH3/QNLDQAgBiAEQQh2Qf8BcWpB/gE6AAAgAUEAKAKwiICAADYCACABQYCABCAFayIFNgIEQQAgATYCsIiAgAAQg4CAgAAgBkGEggRqIAIgBWtB+H1qIgU2AgAgBkGBgARqQf8BOgAAIAZBgIIEaiEDIAUgAGtBgH5xIQUMAQsgAiAFaiAAIAVqQX9qQYCAfHFrQYCAfGohBSABIQMLIAMgAygCBCAFazYCBCAFQfgBaiEGIAcgBWtBCHZB/wFxIQUCQANAIAYiB0GAfmohBiAFIgQNAUEBIQUgB0H4AUcNAAsLAkAgB0H4AUYNACACIAFqIAZrQYCAfHEiBSAEakH+AToAACAFIARBCHRqIgVBACgCsIiAgAA2AgAgBSAGNgIEQQAgBTYCsIiAgAAQg4CAgAALIAMPC0EAC3wBAn8CQCAARQ0AAkAgAEGAgHxxIABBCHZB/wFxciIBLQAAIgJB/wFHDQAgAEF4aiIAQQAoArCIgIAANgIAQQAgADYCsIiAgAAgAUH+AToAAEEAQQE6ALSIgIAADwsgACACQQJ0QcCIgIAAaiICKAIANgIAIAIgADYCAAsLawECfwJAQQAoArCIgIAAIgAoAgRB/wFLDQAgAEGAgHxxIgEgAEEIdkH/AXEiAHJBCToAAEEAQQAoArCIgIAAKAIANgKwiICAACABIABBCHRyIgBBACgC5IiAgAA2AgBBACAANgLkiICAAAsLTgECfwJAIAAgAUYNACACRQ0AA0ACQCAALQAAIgMgAS0AACIERg0AQQFBfyADIARLGw8LIAFBAWohASAAQQFqIQAgAkF/aiICDQALC0EAC3gBAX8CQAJAIAAgAU8NACACRQ0BIAAhAwNAIAMgAS0AADoAACABQQFqIQEgA0EBaiEDIAJBf2oiAg0ADAILCyAAIAFNDQAgAkUNACABQX9qIQEgAEF/aiEDA0AgAyACaiABIAJqLQAAOgAAIAJBf2oiAg0ACwsgAAssAQF/AkAgAkUNACAAIQMDQCADIAE6AAAgA0EBaiEDIAJBf2oiAg0ACwsgAAuCAQEBfwJAAkAgAEEDcQ0AIAEgAnJBA3ENACACQQRJDQEgAkECdiECIAAhAwNAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIAJBf2oiAg0ADAILCyACRQ0AIAAhAwNAIAMgAS0AADoAACABQQFqIQEgA0EBaiEDIAJBf2oiAg0ACwsgAAuIAQECfwJAQQAtAOiIgIAADQBBAEEBOgDoiICAABCMgICAABCOgICAAAtBoIAIEICAgIAAIgBBgIAENgIAQQJBgICAIBCXgICAACEBIABBFGpCgICAgICAwAA3AgAgAEEQaiAAQaCABGo2AgAgAEEIakIANwMAIAAgAEEgajYCBCAAIAE2AhwgAAsVACAAKAIcEJiAgIAAIAAQgoCAgAALFgAgAEEMaiABNgIAIABBCGpBADYCAAsbACAAKAIcIABBBGogAEEMaigCAEUQloCAgAALVAEDf0EAIQADQEEIIQEgACECA0BBACACQQFxa0GghuLtfnEgAkEBdnMhAiABQX9qIgENAAsgAEECdEHwiICAAGogAjYCACAAQQFqIgBBgAJHDQALC0oAIAJBf3MhAgJAIAFFDQADQCACQf8BcSAALQAAc0ECdEHwiICAAGooAgAgAkEIdnMhAiAAQQFqIQAgAUF/aiIBDQALCyACQX9zC10DAX4BfwF+QgAhAANAQQghASAAIQIDQEIAIAJCAYN9QsKenLzd8pW2SYMgAkIBiIUhAiABQX9qIgENAAsgAKdBA3RB8JCAgABqIAI3AwAgAEIBfCIAQoACUg0ACwtLACACQn+FIQICQCABRQ0AA0AgAkL/AYMgADEAAIWnQQN0QfCQgIAAaikDACACQgiIhSECIABBAWohACABQX9qIgENAAsLIAJCf4UL1RACDH8CfgJAAkAgACgCJEUNACAAKAIAIQIMAQtBACECIABBADoAKCAAQgA3AwAgAEIANwMYIABByABqQQBB5AAQhoCAgAAaIABBrAFqQQw2AgALIAAgASgCBCIDNgIQIABBsAFqIQQgAEHgAGohBSAAQcgAaiEGIABBtgFqIQcgAEGoAWohCCABKAIQIQkCQAJAAkACQANAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAIOCgECAAQFBgcICQoPCyABKAIAIQogACgCqAEhAiAAKAKsASELIAEoAgQhDCABKAIIIQ0MAgsgCCAAKAKoASIMakEIaiABKAIAIAEoAgQiAmogASgCCCACayICIAAoAqwBIAxrIgwgAiAMSRsiAhCHgICAABogASABKAIEIAJqNgIEQQAhDCAAQQAgACgCqAEgAmoiAiACIAAoAqwBIgtGGzYCqAEgAiALRw0RIABBATYCAAJAIARBqIiAgABBBhCEgICAAEUNAEEFIQwMEgsgB0ECQQAQjYCAgAAgACgAuAFHDRBBBiEMIActAAANESAAIAAtALcBIgI2AiAgAkEESw0RQQEgAnRBE3FFDRELIAEoAgQiDCABKAIIIg1GDQ4CQCABKAIAIgogDGotAAAiCw0AIAAgDDYCECABIAxBAWo2AgRBBiECDAwLQQAhAiAAQQA2AqgBIABBAjYCACAAIAtBAnRBBGoiCzYCrAEgACALNgJACyAIIAJqQQhqIAogDGogDSAMayIMIAsgAmsiAiAMIAJJGyICEIeAgIAAGiABIAIgASgCBGo2AgRBACEMIABBACAAKAKoASACaiICIAIgACgCrAEiC0YbNgKoASACIAtHDQ8gACACQXxqIgI2AqwBQQchDCAEIAJBABCNgICAACAAIAAoAqwBIgtqQbABaigAAEcNDyAAQQI2AqgBIAAtALEBIgJBP3ENDAJAAkAgAkHAAHFFDQAgACAEIAggCxCRgICAAEEBRw0RIAAgACkDCDcDMCAALQCxASECDAELIABCfzcDMAtCfyEOAkAgAkEYdEEYdUF/Sg0AIAAgBCAIIAAoAqwBEJGAgIAAQQFHDRAgACkDCCEOCyAAIA43AzggACgCrAEiDSAAKAKoASICa0ECSQ0PIAAgAkEBaiIKNgKoASAIIAJqQQhqLQAAQSFHDQwgACACQQJqIgs2AqgBIAggCmpBCGotAABBAUcNDCANIAtGDQ8gACACQQNqNgKoASAAKAKwCSAIIAtqQQhqLQAAEJyAgIAAIgwNDyAAKAKoASIMIAAoAqwBIgIgDCACSxshDQJAA0AgDSAMRg0BIAggDEEBaiICNgIAIAQgDGohCyACIQwgCy0AAA0ODAALCyAGQgA3AwAgAEEANgKoASAAQQM2AgAgBkEIakIANwMACyAAIAEoAgQ2AhAgACABKAIQNgIUIAAoArAJIAEQmYCAgAAhDCAAIAApA0ggASgCBCAAKAIQa618Ig43A0ggACAAKQNQIAEoAhAgACgCFCICayILrXwiDzcDUCAOIAApAzBWDQ0gDyAAKQM4Vg0NAkACQAJAAkAgACgCIEF/ag4EAAMDAQMLIAEoAgwgAmogCyAAKAIYEI2AgIAArSEODAELIAEoAgwgAmogCyAAKQMYEI+AgIAAIQ4LIAAgDjcDGAsgDEEBRw0OAkAgACkDMCIOQn9RDQAgDiAGKQMAUg0OCwJAIAApAzgiDkJ/UQ0AQQchDCAOIAApA1BSDQ8LIAAgACkDSCAANQJAfCAAKQNgfCIPNwNgQgQhDgJAAkACQCAAKAIgQX9qDgQBAgIAAgtCCCEOCyAFIA4gD3w3AwALIAAgACkDaCAAKQNQfDcDaCAAIAVBGCAAKAJwEI2AgIAANgJwIABBBDYCACAAIAApA1hCAXw3A1gLAkAgBikDACIOQgODUA0AIA5CAXwhDiABKAIEIQwgASgCCCELA0AgCyAMRg0NIAEgDEEBaiICNgIEIAEoAgAgDGotAAANDiAGIA43AwAgDkIDgyEPIA5CAXwhDiACIQwgD0IAUg0ACwsgAEEFNgIAC0EBIQIgACgCIEF/ag4EBgcHBQcLIAAgARCSgICAACIMQQFHDQsgAEEHNgIAC0EAIAAoAhBrIQggAEGAAWopAwAhDiABKAIEIQwCQANAIA4gCCAMaq18QgODUA0BAkAgDCABKAIIRw0AIAAgARCTgICAAAwLCyABIAxBAWoiAjYCBCABKAIAIAxqIQsgAiEMIAstAAANCwwACwsgACABEJOAgIAAQQchDCAFIABBkAFqQRgQhICAgAANCiAAQQg2AgALIAAgAUEgEJSAgIAAIgxBAUcNCSAAQQk2AgBBDCELIABBDDYCrAEMAQsgACgCrAEhCwsgAEGoAWogACgCqAEiDGpBCGogASgCACABKAIEIgJqIAEoAgggAmsiAiALIAxrIgwgAiAMSRsiAhCHgICAABogASABKAIEIAJqNgIEQQAhDCAAQQAgACgCqAEgAmoiAiACIAAoAqwBIgtGGzYCqAEgAiALRw0HIAAQlYCAgAAhDAwHC0EBIQIgACABQcAAEJSAgIAAIgxBAUcNBgwBC0EBIQIgACABQSAQlICAgAAiDEEBRw0FCyAAIAI2AgAMAAsLQQYhDAwCC0EAIQwMAQtBByEMCwJAAkAgACgCJA0AAkACQCAMDgIAAwELQQdBCCABKAIEIAEoAghGGyEMCyABIAk2AhAgASADNgIEIAwPCwJAIAwNACADIAEoAgRHDQAgCSABKAIQRw0AIAAtACghASAAQQE6ACggAUEDdA8LIABBADoAKAsgDAuaAQEDfwJAIAAoAgQiBA0AIABCADcDCAsgAigCACEFA0ACQCAFIANJDQBBAA8LIAEgBWotAAAhBiACIAVBAWoiBTYCACAAIAZB/wBxrSAErYYgACkDCIQ3AwgCQAJAIAZBgAFxDQACQCAGDQBBByEGIAQNAgsgAEEANgIEQQEPC0EHIQYgACAEQQdqIgQ2AgQgBEE/Rw0BCwsgBguhAgIDfwF+IABBkAFqIQIgAUEEaiEDA0ACQCAAIAEoAgAgAyABKAIIEJGAgIAAIgRBAUYNACAAQYABaiIDIAMpAwAgASgCBCAAKAIQIgNrIgKtfDcDACAAIAMgASgCAGogAiAAKAIYEI2AgIAArTcDGCAEDwsCQAJAAkACQAJAIAAoAngOAwACAQMLIAAgACkDCCIFNwOIAQJAIAUgACkDWFENAEEHDwsgAEEBNgJ4DAMLIAAgACkDmAEgACkDCHw3A5gBIAAgAkEYIAAoAqABEI2AgIAANgKgASAAQQE2AnggACAAKQOIAUJ/fCIFNwOIAQwCCyAAQQI2AnggACAAKQOQASAAKQMIfDcDkAELIAApA4gBIQULIAVCAFINAAtBAQtAAQJ/IABBgAFqIgIgAikDACABKAIEIAAoAhAiAmsiA618NwMAIAAgAiABKAIAaiADIAAoAhgQjYCAgACtNwMYC3wBBH8gASgCBCEDIAEoAgghBANAAkAgBCADRw0AQQAPCyABIANBAWoiBTYCBAJAIAEoAgAgA2otAAAgACkDGCAAKAIEIgOtiKdB/wFxRg0AQQcPCyAAIANBCGoiBjYCBCAFIQMgBiACSQ0ACyAAQQA2AgQgAEIANwMYQQELbwEBf0EHIQECQCAAQboBai8AAEHZtAFHDQAgAEG0AWpBBkEAEI2AgIAAIABBsAFqKAAARw0AIABBgAFqKQMAQgKIIAA1ALQBUg0AIABBuAFqLQAADQBBAUEHIAAoAiAgAEG5AWotAABGGyEBCyABC7QCAQR/AkACQCAAKAIkRQ0AIAAoAgAhAwwBC0EAIQMgAEEAOgAoIABCADcDACAAQgA3AxggAEHIAGpBAEHkABCGgICAABogAEGsAWpBDDYCAEEBIQILIABByABqIQQCQAJAA0ACQCADQQpHDQAgASgCBCIDIAEoAggiBUYNAiABKAIAIQYCQANAIAYgA2otAAANASABIANBAWoiAzYCBCAAIAAoAgRBAWpBA3E2AgQgBSADRg0EDAALCwJAIAAoAgRFDQBBBw8LIAAoAiRFDQAgAEEAOgAoIABCADcDACAAQgA3AxggBEEAQeQAEIaAgIAAGiAAQQw2AqwBCyAAIAEQkICAgAAiA0EBRw0CQQohAyAAQQo2AgAMAAsLAkAgAg0AQQAPC0EHQQEgACgCBBshAwsgAwt1AQF/AkBBuAkQgICAgAAiAkUNACACIAA2AiQgAiAAIAEQm4CAgAAiADYCsAkCQCAARQ0AIAJBADoAKCACQgA3AwAgAkIANwMYIAJByABqQQBB5AAQhoCAgAAaIAJBrAFqQQw2AgAgAg8LIAIQgoCAgAALQQALHgACQCAARQ0AIAAoArAJEJ2AgIAAIAAQgoCAgAALC4ARAQx/IABB6N0BaiECIABB1ABqIQMgAEEcaiIEQQhqIQUCQAJAA0AgACgCQCEGAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgASgCBCIHIAEoAggiCEkNACAGQQdGDQEMEgsgBg4JAQIDBAUGBwAJDwsgACgCTCEGDAcLQQEhCSABIAdBAWo2AgQgASgCACAHai0AACIHRQ0IAkACQCAHQd8BSw0AIAdBAUcNAQsgAEGAAjsBUAJAIAAoAjwNACAAIAEoAgwgASgCECIGajYCGCAAIAEoAhQgBms2AiwLIARCADcCACAFQgA3AgAMCwsgAC0AUEUNCgwOCyABIAdBAWo2AgQgASgCACAHai0AACEHIABBAjYCQCAAIAdBCHQgACgCSGo2AkgMDAsgASAHQQFqNgIEIAEoAgAgB2otAAAhByAAQQM2AkAgACAHIAAoAkhqQQFqNgJIDAsLIAEgB0EBajYCBCABKAIAIAdqLQAAIQcgAEEENgJAIAAgB0EIdDYCTAwKCyABIAdBAWo2AgQgASgCACAHai0AACEHIAAgACgCRDYCQCAAIAcgACgCTGpBAWo2AkwMCQsgASAHQQFqNgIEQQchCSABKAIAIAdqLQAAIgdB4AFLDQNBACEGAkACQCAHQS1PDQBBACEIDAELIAdBU2oiByAHQf8BcUEtbiIIQS1sayEHIAhBAWohCAsgAEF/IAh0QX9zNgJ0AkAgB0H/AXFBCUkNACAHQXdqIgcgB0H/AXFBCW4iBkEJbGshByAGQQFqIQYLIAAgBjYCcCAAIAdB/wFxIgc2AmwgBiAHakEESw0DIANCADcCACADQQhqQgA3AgAgA0EQakEANgIAIABBfyAGdEF/czYCcEH4ACEHA0AgACAHakGACDsBACAHQQJqIgdB5N0BRw0ACyAAQQY2AkAgAEEFNgIIIABC/////w83AgALIAAoAkwiCUEFSQ0IAkAgACgCCCIHRQ0AIAdBf2ohBiABKAIEIQcgASgCCCEKA0AgCiAHRg0LIAEgB0EBaiIINgIEIAEoAgAgB2otAAAhByAAIAY2AgggACAHIAAoAgRBCHRyNgIEIAghByAGQX9qIgZBf0cNAAsLIABBBzYCQCAAIAlBe2oiBjYCTAsgACAAKAIgIgcgASgCFCABKAIQayIIIAAoAkgiCiAIIApJGyIIaiAAKAIsIgogCiAHayAISxs2AiggASgCCCIJIAEoAgQiCGshBwJAAkACQCAAKALk3QEiCg0AIAYNAUEAIQYLIABB5N0BaiILIApqQQRqIAEoAgAgCGogByAGIAprIgZBKiAKayIIIAggBksbIgYgBiAHSxsiBxCHgICAABoCQAJAIAcgACgC5N0BIghqIgYgACgCTEcNACALIAhqIAdqQQRqQQBBPyAGaxCGgICAABogACgC5N0BIAdqIQYMAQsCQCAGQRRLDQAgACAGNgLk3QEgASABKAIEIAdqNgIEDAMLIAZBa2ohBgsgAEEANgIQIAAgAjYCDCAAIAY2AhRBByEJIAAQmoCAgABFDQMgACgCECIIIAAoAuTdASIKIAdqSw0DIAAgACgCTCAIayIGNgJMAkAgCiAITQ0AIAAgCiAIayIHNgLk3QEgAiALIAhqQQRqIAcQhYCAgAAaDAILIABBADYC5N0BIAEgASgCBCAIIApraiIINgIEIAEoAggiCSAIayEHCwJAIAdBFUkNACAAIAg2AhAgACABKAIANgIMIAAgCUFraiAIIAZqIAcgBkEVakkbNgIUQQchCSAAEJqAgIAARQ0DIAAoAkwiByAAKAIQIgggASgCBGsiBkkNAyABIAg2AgQgACAHIAZrIgY2AkwgASgCCCAIayIHQRRLDQELIAIgASgCACAIaiAGIAcgByAGSxsiBxCHgICAABogACAHNgLk3QEgASABKAIEIAdqNgIECyAAKAIgIgYgACgCHCIIayEHAkAgACgCPEUNAAJAIAYgACgCLEcNACAAQQA2AiALIAEoAgwgASgCEGogACgCGCAIaiAHEIeAgIAAGiAAKAIgIQYLIAAgBjYCHCABIAEoAhAgB2oiBjYCECAAIAAoAkggB2siBzYCSAJAIAcNAEEHIQkgACgCTA0CIAAoAmgNAiAAKAIEDQIgAEEANgJADAULQQAhCSAGIAEoAhRGDQEgASgCBCABKAIIRw0GIAAoAuTdASAAKAJMTw0GDAELIAAoAkwiCkUNAUEAIQkgCCAHTQ0AA0AgASgCFCIGIAEoAhAiC00NASAAIAogCiAAKAIsIAAoAiAiDGsiDSAIIAdrIgggBiALayIGIAggBkkbIgYgBiANSxsiBiAGIApLGyIGazYCTCAMIAAoAhhqIAEoAgAgB2ogBhCFgICAABogACAAKAIgIAZqIgc2AiACQCAAKAIkIAdPDQAgACAHNgIkCwJAIAAoAjxFDQACQCAHIAAoAixHDQAgAEEANgIgCyABKAIMIAEoAhBqIAEoAgAgASgCBGogBhCFgICAABogACgCICEHCyAAIAc2AhwgASABKAIQIAZqNgIQIAEgASgCBCAGaiIHNgIEIAAoAkwiCkUNAiABKAIIIgggB0sNAAsLIAkPCyAAQQA2AkAMAwsgB0EYdEEYdUF/Sg0BIABBATYCQCAAIAdBEHRBgID8AHE2AkgCQCAHQcABSQ0AIABBBTYCRCAAQQA6AFEMAwsgAC0AUQ0DIABBBjYCRCAHQaABSQ0CIANCADcCACADQRBqQQA2AgAgA0EIakIANwIAQfgAIQcDQCAAIAdqQYAIOwEAIAdBAmoiB0Hk3QFHDQALCyAAQQU2AgggAEL/////DzcCAAwBCyAHQQJLDQEgAEKDgICAgAE3AkAMAAsLQQcPC0EAC/8XARJ/IABBGGohAQJAIABBIGooAgAiAiAAQShqKAIAIgNPDQAgAEHoAGoiBCgCAEUNACABIAQgACgCVBCegICAABogACgCKCEDIAAoAiAhAgsCQCACIANPDQAgAEHcDWohBSAAQegAaiEGIABB4BVqIQcgAEHUAGohCANAIAAoAhAiCSAAKAIUSw0BIAAgACgCZCIKQQV0aiAAKAJ0IAJxIgtBAXRqIgxB+ABqIQ0CQAJAIAAoAgAiBEGAgIAISQ0AIAAoAgQhDgwBCyAAIARBCHQiBDYCACAAIAlBAWoiAzYCECAAIAAoAgRBCHQgACgCDCAJai0AAHIiDjYCBCADIQkLAkACQCAOIARBC3YgDS8BACIPbCIDTw0AIAAgAzYCACANIA9BgBAgD2tBBXZqOwEAIAJBf2ohBAJAIAINACAAKAIsIARqIQQLAkACQCAAKAIkIg8NAEEAIQQMAQsgACgCGCAEai0AACEECyAAKAJwIAJxIAAoAmwiDXQgBEEIIA1rdmohDAJAAkAgCkEGSw0AQQEhBANAIAAgDEGADGxqIARBAXQiBGpB5B1qIQ0CQAJAIANB////B00NACADIQoMAQsgACADQQh0Igo2AgAgACAJQQFqIgM2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQgAyEJCwJAAkAgDiAKQQt2IA0vAQAiD2wiA0kNACAAIA4gA2siDjYCBCAAIAogA2siAzYCACANIA8gD0EFdms7AQAgBEEBciEEDAELIAAgAzYCACANIA9BgBAgD2tBBXZqOwEACyAEQYACSQ0ADAILCyACIAAoAlQiDUF/c2ohBAJAIAIgDUsNACAAKAIsIARqIQQLAkACQCAPDQBBACEQDAELIAAoAhggBGotAAAhEAtBASEEQYACIQ0DQCAAIAxBgAxsaiAQQQF0IhAgDXEiESANaiAEakEBdGpB5B1qIQ8CQAJAIANB////B00NACADIQsMAQsgACADQQh0Igs2AgAgACAJQQFqIgM2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQgAyEJCwJAAkAgDiALQQt2IA8vAQAiCmwiA08iEg0AIAAgAzYCACAKQYAQIAprQQV2aiEKDAELIAAgDiADayIONgIEIAAgCyADayIDNgIAIAogCkEFdmshCkEAIQ0LIA8gCjsBACANIBFzIQ0gBEEBdCASciIEQYACSQ0ACwsgACACQQFqNgIgIAAoAhggAmogBDoAAAJAIAAoAiQgACgCICICTw0AIAAgAjYCJAtBACEDAkAgACgCZCIEQQRJDQACQCAEQQlLDQAgBEF9aiEDDAELIARBemohAwsgACADNgJkDAELIAAgDiADayIONgIEIAAgBCADayIDNgIAIA0gDyAPQQV2azsBACAAIApBAXRqIg9B+ANqIQQCQAJAIANB////B00NACAJIQoMAQsgACADQQh0IgM2AgAgACAJQQFqIgo2AhAgACAOQQh0IAAoAgwgCWotAAByIg42AgQLAkACQCAOIANBC3YgBC8BACINbCIJSQ0AIAAgDiAJayIONgIEIAAgAyAJayIDNgIAIAQgDSANQQV2azsBACAPQZAEaiENAkACQCADQf///wdNDQAgCiEQDAELIAAgA0EIdCIDNgIAIAAgCkEBaiIQNgIQIAAgDkEIdCAAKAIMIApqLQAAciIONgIECwJAAkAgDiADQQt2IA0vAQAiCWwiBE8NACANIAlBgBAgCWtBBXZqOwEAIAxB2ARqIQMCQCAEQf///wdLDQAgACAEQQh0IgQ2AgAgACAQQQFqNgIQIAAgDkEIdCAAKAIMIBBqLQAAciIONgIECwJAIA4gBEELdiADLwEAIg1sIglJDQAgACAOIAlrNgIEIAAgBCAJazYCACADIA0gDUEFdms7AQAMAgsgAyANQYAQIA1rQQV2ajsBACAAIAk2AgAgAEEBNgJoIABBCUELIAAoAmRBB0kbNgJkDAMLIAAgDiAEayIONgIEIA0gCSAJQQV2azsBACAPQagEaiENAkACQCADIARrIgNB////B00NACAQIQoMAQsgACADQQh0IgM2AgAgACAQQQFqIgo2AhAgACAOQQh0IAAoAgwgEGotAAByIg42AgQLAkACQCAOIANBC3YgDS8BACIEbCIJTw0AIAAgCTYCACANIARBgBAgBGtBBXZqOwEAIAAoAlghAwwBCyAAIA4gCWsiDjYCBCANIAQgBEEFdms7AQAgD0HABGohBAJAIAMgCWsiA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgCkEBajYCECAAIA5BCHQgACgCDCAKai0AAHIiDjYCBAsCQAJAIA4gA0ELdiAELwEAIg1sIglPDQAgACAJNgIAIAQgDUGAECANa0EFdmo7AQAgACgCXCEDDAELIAAgDiAJazYCBCAAIAMgCWs2AgAgACgCYCEDIAAgACgCXDYCYCAEIA0gDUEFdms7AQALIAAgACgCWDYCXAsgACAAKAJUNgJYIAAgAzYCVAsgAEEIQQsgACgCZEEHSRs2AmQgACAHIAsQn4CAgAAMAQsgBCANQYAQIA1rQQV2ajsBACAAIAk2AgAgACAAKAJcNgJgIAAgACkCVDcCWCAAQQdBCiAAKAJkQQdJGzYCZCAAIAUgCxCfgICAACAAKAJoIgNBfmpBAyADQQZJGyEKIAAoAgAhA0EBIQ4DQCAAIApBB3RqIA5BAXQiDmpB2AdqIQ0CQAJAIANBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgRBAWo2AhAgACAAKAIEQQh0IAQgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgDS8BACIJbCIPSQ0AIAAgBCAPayIENgIEIAAgAyAPayIDNgIAIA0gCSAJQQV2azsBACAOQQFyIQ4MAQsgACAPNgIAIA0gCUGAECAJa0EFdmo7AQAgDyEDCyAOQcAASQ0ACwJAIA5BQGoiCUEDSw0AIAAgCTYCVAwBCyAAIA5BAXFBAnIiDTYCVCAJQQF2IQ8CQCAJQQ1LDQAgACANIA9Bf2oiDHQiCzYCVEEBIQ0gCCALQQF0akGEC2ohEEE/IA5rIRFBACEPA0AgECARIA1qQQF0aiEOAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA4vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACAOIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDUEBdEEBciENDAELIAAgAzYCACAOIAlBgBAgCWtBBXZqOwEAIA1BAXQhDQsgDCAPQQFqIg9HDQAMAgsLIA9Be2ohDgNAAkAgA0H///8HSw0AIAAgA0EIdCIDNgIAIAAgACgCECIJQQFqNgIQIARBCHQgCSAAKAIMai0AAHIhBAsgACADQQF2IgM2AgAgACAEIANrIgRBH3UiCSANQQF0akEBaiINNgJUIAAgCSADcSAEaiIENgIEIA5Bf2oiDg0ACyAAIA1BBHQiCzYCVEEAIQ9BASEOA0AgACAOQQF0Ig5qQbwNaiENAkACQCADQf///wdNDQAgAyEKDAELIAAgA0EIdCIKNgIAIAAgACgCECIDQQFqNgIQIAAgBEEIdCADIAAoAgxqLQAAciIENgIECwJAAkAgBCAKQQt2IA0vAQAiCWwiA0kNACAAIAQgA2siBDYCBCAAIAogA2siAzYCACANIAkgCUEFdms7AQAgAEEBIA90IAtqIgs2AlQgDkEBciEODAELIAAgAzYCACANIAlBgBAgCWtBBXZqOwEACyAPQQFqIg9BBEcNAAsLAkAgASAGIAAoAlQQnoCAgAANAEEADwsgACgCICECCyACIAAoAihJDQALC0EBIQMCQCAAKAIAIgRB////B0sNACAAIARBCHQ2AgBBASEDIAAgACgCECIEQQFqNgIQIAAgACgCBEEIdCAEIAAoAgxqLQAAcjYCBAsgAwtwAQF/AkBBqN4BEICAgIAAIgJFDQAgAkE0aiABNgIAIAJBPGogADYCAAJAAkACQCAAQX9qDgIAAQILIAIgARCAgICAACIANgIYIAANASACEIKAgIAADAILIAJBADYCGCACQThqQQA2AgALIAIPC0EAC9IBAQJ/QQYhAgJAIAFBJ0sNACAAQTBqIAFBAXFBAnIgAUEBdkELanQiATYCAAJAAkAgAEE8aigCACIDRQ0AQQQhAiABIABBNGooAgBLDQIgAEEsaiABNgIAIANBAkcNACAAQThqIgMoAgAgAU8NACAAIAE2AjggACgCGBCCgICAACAAIAAoAjAQgICAgAAiATYCGCABDQBBAyECDAELQQAhAiAAQQA2AkAgAEHQAGpBAToAACAAQegAakEANgIAIABB5N0BaiEDCyADQQA2AgALIAILIwACQCAAQTxqKAIARQ0AIAAoAhgQgoCAgAALIAAQgoCAgAAL9QEBBH9BACEDAkAgACgCDCACTQ0AIAAoAhggAk0NACABIAEoAgAiBCAAKAIQIAAoAggiBWsiBiAEIAYgBEkbIgRrNgIAIAUgAkF/c2ohAQJAIAUgAksNACAAKAIUIAFqIQELIAAoAgAiAiABai0AACEGQQEhAyAAIAVBAWo2AgggAiAFaiAGOgAAAkAgBEF/aiICRQ0AA0AgACgCACIFQQAgAUEBaiIBIAEgACgCFEYbIgFqLQAAIQQgACAAKAIIIgZBAWo2AgggBSAGaiAEOgAAIAJBf2oiAg0ACwsgACgCDCAAKAIIIgFPDQAgACABNgIMCyADC8gEAQd/AkACQCAAKAIAIgNBgICACEkNACAAKAIEIQQMAQsgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAAKAIEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIANBC3YgAS8BACIGbCIFTw0AIAEgBkGAECAGa0EFdmo7AQAgASACQQR0akEEaiEHQQghCEECIQkMAQsgACAEIAVrIgQ2AgQgASAGIAZBBXZrOwEAAkAgAyAFayIDQf///wdLDQAgACADQQh0IgM2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkAgBCADQQt2IAEvAQIiBmwiBU8NACABIAZBgBAgBmtBBXZqOwECIAEgAkEEdGpBhAJqIQdBCCEIQQohCQwBCyAAIAQgBWsiBDYCBCABIAYgBkEFdms7AQIgAUGEBGohByADIAVrIQVBgAIhCEESIQkLIABB6ABqIAk2AgBBASEBA0AgByABQQF0IgFqIQMCQAJAIAVB////B00NACAFIQIMAQsgACAFQQh0IgI2AgAgACAAKAIQIgVBAWo2AhAgACAEQQh0IAUgACgCDGotAAByIgQ2AgQLAkACQCAEIAJBC3YgAy8BACIGbCIFSQ0AIAAgBCAFayIENgIEIAAgAiAFayIFNgIAIAMgBiAGQQV2azsBACABQQFyIQEMAQsgACAFNgIAIAMgBkGAECAGa0EFdmo7AQALIAEgCEkNAAsgAEHoAGogASAIayAJajYCAAsLNQEAQYAICy4IAAAAEAAAABgAAAAgAAAAKAAAADAAAABAAAAAUAAAAIAAAAAAAQAA/Td6WFoA"},t=>{t.exports=e}],i={};function n(e){var r=i[e];if(void 0!==r)return r.exports;var s=i[e]={exports:{}};return t[e](s,s.exports,n),s.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{n.r(r),n.d(r,{XzReadableStream:()=>s});var e=n(1);const t=globalThis.ReadableStream||n(2).ReadableStream;class i{constructor(e){this.exports=e.exports,this.memory=this.exports.memory,this.ptr=this.exports.create_context(),this._refresh(),this.bufSize=this.mem32[0],this.inStart=this.mem32[1]-this.ptr,this.inEnd=this.inStart+this.bufSize,this.outStart=this.mem32[4]-this.ptr}supplyInput(e){this._refresh(),this.mem8.subarray(this.inStart,this.inEnd).set(e,0),this.exports.supply_input(this.ptr,e.byteLength),this._refresh()}getNextOutput(){const e=this.exports.get_next_output(this.ptr);if(this._refresh(),0!==e&&1!==e)throw new Error(`get_next_output failed with error code ${e}`);return{outChunk:this.mem8.slice(this.outStart,this.outStart+this.mem32[5]),finished:1===e}}needsMoreInput(){return this.mem32[2]===this.mem32[3]}outputBufferIsFull(){return this.mem32[5]===this.bufSize}resetOutputBuffer(){this.outPos=this.mem32[5]=0}dispose(){this.exports.destroy_context(this.ptr),this.exports=null}_refresh(){this.memory.buffer!==this.mem8?.buffer&&(this.mem8=new Uint8Array(this.memory.buffer,this.ptr),this.mem32=new Uint32Array(this.memory.buffer,this.ptr))}}class s extends t{static _moduleInstancePromise;static _moduleInstance;static async _getModuleInstance(){const t=e.replace("data:application/wasm;base64,",""),i=Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer,n=await WebAssembly.instantiate(i,{});s._moduleInstance=n.instance}constructor(e){let t,n=null;const r=e.getReader();super({async start(e){s._moduleInstance||await(s._moduleInstancePromise||(s._moduleInstancePromise=s._getModuleInstance())),t=new i(s._moduleInstance)},async pull(e){if(t.needsMoreInput()){if(null===n||0===n.byteLength){const{done:e,value:t}=await r.read();e||(n=t)}const e=Math.min(t.bufSize,n.byteLength);t.supplyInput(n.subarray(0,e)),n=n.subarray(e)}const i=t.getNextOutput();e.enqueue(i.outChunk),t.resetOutputBuffer(),i.finished&&(t.dispose(),e.close())},cancel:()=>(t.dispose(),r.cancel())})}}})(),r})(),e.exports=n(i(772))},7937:()=>{},772:()=>{},86:(e,t,i)=>{const n=i(1308).A;e.exports=n,e.exports.default=n},1308:(e,t)=>{let i=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];"undefined"!=typeof Int32Array&&(i=new Int32Array(i)),t.A=(e,t)=>{let n=0===t?0:~t;for(let t=0;t<e.length;t++)n=i[255&(n^e[t])]^n>>>8;return~n}}},t={};function i(n){var r=t[n];if(void 0!==r)return r.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,i),s.exports}return i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(7806)})();class sf{constructor(e,t){this.position=0,this.url=e,this.config=t,_(e)||!1===t.cacheFetches?this.useCache=!1:(this.useCache=!0,this.cache=new of({fetch:(e,t)=>this._fetch(e,t),fetchSize:t.fetchSize||1e4}))}async _fetch(e,t){const i={start:e,size:t};return await Mn.loadArrayBuffer(this.url,js(this.config,{range:i}))}async read(e,t=0){let i;return i=this.useCache?await this.cache.get(t,e):await this._fetch(t,e),new Uint8Array(i)}async readFile(){const e=await Mn.loadArrayBuffer(this.url,js(this.config));return new Uint8Array(e)}}class of{maxChunkCount=5;chunks=[];constructor({fetch:e,fetchSize:t=3e4}){this.fetch=e,this.fetchSize=t}async get(e,t){const i=e+t;for(let n of this.chunks)if(n.contains(e,i)){const i=e-n.start;return n.buffer.slice(i,i+t)}const n=Math.max(t,this.fetchSize),r=Math.max(0,e-1e3),s=e+n+1e3,o=await this.fetch(r,s-r),a=new af(r,s,o);this.chunks.length>this.maxChunkCount&&this.chunks.shift(),this.chunks.push(a);const c=e-a.start,l=c+t;return o.slice(c,l)}}class af{constructor(e,t,i){this.start=e,this.end=t,this.buffer=i}contains(e,t){return e>=this.start&&t<=this.end}}class cf{chrAliasTable=new Map;constructor(e,t,i){this.config=e,this.browser=i,this.genome=t,this.cramFile=new rf.CramFile({filehandle:e.fileHandle?e.fileHandle:new sf(e.url,e),seqFetch:e.seqFetch||async function(e,t,i){const n=this.genome,r=await this.getHeader(),s=n.getChromosomeName(r.indexToChr[e]);return this.genome.getSequence(s,t-1,i)}.bind(this),checkSequenceMD5:void 0===e.checkSequenceMD5||e.checkSequenceMD5});const n=e.indexFileHandle?e.indexFileHandle:new sf(e.indexURL,e);this.indexedCramFile=new rf.IndexedCramFile({cram:this.cramFile,index:new rf.CraiIndex({filehandle:n}),fetchSizeLimit:e.fetchSizeLimit||1e9}),ju.setReaderDefaults(this,e)}async getHeader(){if(!this.header){const e=await this.cramFile.getSamHeader(),t={},i=[],n=[];for(let r of e)if("SQ"===r.tag){for(let e of r.data)if("SN"===e.tag){const n=e.value;t[n]=i.length,i.push(n);break}}else"RG"===r.tag&&n.push(r.data);this.header={indexToChr:i,chrToIndex:t,chrNames:Object.keys(t),readGroups:n}}return this.header}async#x(e){if(await this.getHeader(),this.chrAliasTable.has(e)&&void 0===(e=this.chrAliasTable.get(e)))return;let t=this.header.chrToIndex[e];if(void 0===t){const i=await this.genome.getAliasRecord(e);let n;if(i){const e=Object.keys(i).filter((e=>"start"!==e&&"end"!==e)).map((e=>i[e])).filter((e=>void 0!==this.header.chrToIndex[e]));e.length>0&&(n=e[0],t=this.header.chrToIndex[e[0]])}this.chrAliasTable.set(e,n)}return t}async readAlignments(e,t,i){const n=await this.getHeader(),r=await this.#x(e),s=new pu(e,t,i,this.config);if(void 0===r)return s;try{const e=await this.indexedCramFile.getRecordsForRange(r,t,i);for(let a of e){const e=a.sequenceId,c=a.alignmentStart,l=c+a.lengthOnRef;if(e<0)continue;if(e>r||c>i)return;if(e<r)continue;if(l<t)continue;const h=o(a,n.chrNames);this.filter.pass(h)&&s.push(h)}return s.finish(),s}catch(e){let t=e.message;throw t&&t.indexOf("MD5")>=0&&(t="Sequence mismatch. Is this the correct genome for the loaded CRAM?"),this.browser.alert.present(new Error(t)),e}function o(e,t){const i=new Nu;if(i.chr=t[e.sequenceId],i.start=e.alignmentStart-1,i.lengthOnRef=e.lengthOnRef,i.flags=e.flags,i.strand=!(16&e.flags),i.fragmentLength=e.templateLength||e.templateSize,i.mq=e.mappingQuality,i.end=e.alignmentStart+e.lengthOnRef,i.readGroupId=e.readGroupId,e.mate&&void 0!==e.mate.sequenceId){const n=void 0!==e.mate.flags?!(1&e.mate.flags):!(32&e.flags);i.mate={chr:t[e.mate.sequenceId],position:e.mate.alignmentStart,strand:n}}return i.seq=e.getReadBases(),i.qual=e.qualityScores,i.tagDict=e.tags,i.readName=e.readName,function(e,t){const i=[];let n,r,s=0,o="";if(t.scStart=t.start,t.scLengthOnRef=t.lengthOnRef,e.readFeatures)for(let a of e.readFeatures){const e=a.code,c=a.data,l=a.pos-1,h=a.refPos-1;switch(e){case"S":case"I":case"i":case"N":case"D":if(l>s){const e=l-s;i.push(new Hu({start:h-e,seqOffset:s,len:e,type:"M"})),s+=e,o+=e+"M"}if("S"===e){let n=h;t.scLengthOnRef+=c.length,0===l&&(t.scStart-=c.length,n-=c.length);const r=c.length;i.push(new Hu({start:n,seqOffset:s,len:r,type:"S"})),s+=r,o+=r+e}else if("I"===e||"i"===e){void 0===n&&(n=[]);const t="i"===e?1:c.length;n.push(new Hu({start:h,len:t,seqOffset:s,type:"I"})),s+=t,o+=t+e}else"D"!==e&&"N"!==e||(r||(r=[]),r.push({start:h,len:c,type:e}),o+=c+e);break;case"H":case"P":o+=c+e}}const a=e.readLength-s;a>0&&(i.push(new Hu({start:e.alignmentStart+e.lengthOnRef-a-1,seqOffset:s,len:a,type:"M"})),o+=a+"M");t.blocks=i,t.insertions=n,t.gaps=r,t.cigar=o}(e,i),i.mate&&i.start>i.mate.position&&i.fragmentLength>0&&(i.fragmentLength=-i.fragmentLength),ju.setPairOrientation(i),i}}}const lf=2291137574,hf=2273964779,df=[84,68,70,52],uf=new Uint8Array([66,65,77,1]),ff=[67,82,65,77],pf=[31,139],gf=new Set(["narrowpeak","broadpeak","regionpeak","peaks","bedgraph","wig","gff3","gff","gtf","fusionjuncspan","refflat","seg","aed","bed","bedMethyl","vcf","bb","bigbed","biginteract","biggenepred","bignarrowpeak","bw","bigwig","bam","tdf","refgene","genepred","genepredext","bedpe","bp","snp","rmsk","cram","gwas","maf","mut","hiccups","fasta","fa","fna","pytor","hic","qtl"]);function mf(e,t){const i=Math.min(e.length,t.length);if(0==i)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}async function wf(e){let t;const i=e.filename||await Ks(e.url);return i&&(t=await function(e){if(!e)return;if((e=e.toLowerCase()).endsWith("refgene.txt.gz")||e.endsWith("refgene.txt.bgz")||e.endsWith("refgene.txt")||e.endsWith("refgene.sorted.txt.gz")||e.endsWith("refgene.sorted.txt.bgz"))return"refgene";e.endsWith(".gz")&&(e=e.substring(0,e.length-3));e.endsWith(".bgz")&&(e=e.substring(0,e.length-4));(e.endsWith(".txt")||e.endsWith(".tab")||e.endsWith(".tsv"))&&(e=e.substring(0,e.length-4));const t=e.lastIndexOf("."),i=t<0?e:e.substring(t+1);switch(i){case"bw":return"bigwig";case"bb":return"bigbed";case"fasta":case"fa":case"fna":return"fasta";default:return gf.has(i)?i:void 0}}(i)),t||(t=await async function(e){const t=e.url;let i=js(e,{range:{start:0,size:1e3}}),n=await Mn.loadArrayBuffer(t,i),r=new Uint8Array(n);if(mf(r,pf)){if(0!==(4&r[3])&&66===r[12]&&67===r[13]){i=js(e,{range:{start:0,size:tn(n)}}),n=await Mn.loadArrayBuffer(t,i),r=en(n)}else i=js(e,{}),n=await Mn.loadArrayBuffer(t,i),r=Ji(n),e._filecontents=r}if(mf(r,uf))return"bam";if(mf(r,ff))return"cram";const s=!0;let o=new Co(new DataView(n),s).getUInt();if(o===lf)return"bigwig";if(o===hf)return"bigbed";if(mf(r,df))return"tdf";const a=new TextDecoder("utf-8").decode(r),c=a.split(/\r?\n/)[0];if(c.startsWith("##fileformat=VCF"))return"vcf";if(c.startsWith("##gff-version 3"))return"gff3";if(c.startsWith("##gff-version"))return"gff";if(c.startsWith("##fileformat="))return c.substring(13).toLowerCase();if(kc.isQTL(c))return"qtl";if(ec.isGWAS(c))return"gwas";if(zo(c.split("\t")))return"hiccups";return null}(e)),t}class bf{constructor(e,t){const i=t.genome;if(this.config=e,this.genome=i,Xs(e.url)&&(this.config.indexed=!1),"ga4gh"===e.sourceType)throw Error("Unsupported source type 'ga4gh'");if("pysam"===e.sourceType)this.bamReader=new ef(e,i);else if("htsget"===e.sourceType)this.bamReader=new nf(e,i);else if("shardedBam"===e.sourceType)this.bamReader=new Ju(e,i);else if("cram"===e.format)this.bamReader=new cf(e,i,t);else{if(!this.config.indexURL&&!1!==e.indexed)if(b(this.config.url)){const e=function(e,t){if(b(e)){if(e.includes("?")){const i=e.indexOf("?");return e.substring(0,i)+"."+t+e.substring(i)}return e+"."+t}}(this.config.url,"bai");e?(console.warn(`Warning: no indexURL specified for ${this.config.url}. Guessing ${e}`),this.config.indexURL=e):(console.warning(`Warning: no indexURL specified for ${this.config.url}.`),this.config.indexed=!1)}else console.warning(`Warning: no indexURL specified for ${this.config.name}.`),this.config.indexed=!1;!1!==this.config.indexed?this.bamReader=new Zu(e,i):this.bamReader=new Xu(e,i)}}async getAlignments(e,t,i){const n=this.genome,r=await this.bamReader.readAlignments(e,t,i);if(r.hasAlignments){const t=await n.getSequence(e,r.start,r.end);if(t)return r.coverageMap.refSeq=t,r.sequence=t,r;console.error("No sequence for: "+e+":"+r.start+"-"+r.end)}return r}}class Ff{constructor({chr:e,start:t,end:i}){this.chr=e,this.start=t,this.end=i}contains(e){return e.chr===this.chr&&e.start>=this.start&&e.end<=this.end}overlaps(e){return e.chr===this.chr&&!(e.end<this.start||e.start>this.end)}extend(e){e.chr===this.chr&&(this.start=Math.min(e.start,this.start),this.end=Math.max(e.end,this.end))}getLocusString(){if("all"===this.chr)return"all";{const e=F(Math.floor(this.start)+1),t=F(Math.round(this.end));return`${this.chr}:${e}-${t}`}}static fromLocusString(e){if("all"===e)return new Ff({chr:"all"});const t=e.split(":"),i=t[0],n=t[1].split("-"),r=Number.parseInt(n[0].replace(/,/g,""))-1,s=Number.parseInt(n[1].replace(/,/g,""));return new Ff({chr:i,start:r,end:s})}}
|
|
27
27
|
/*!
|
|
28
28
|
* vanilla-picker v2.12.1
|
|
@@ -31,6 +31,6 @@ function e(e){const t=document.createElement("div");return t.innerHTML=e,t.first
|
|
|
31
31
|
* Copyright 2017-2021 Andreas Borgen (https://github.com/Sphinxxxx), Adam Brooks (https://github.com/dissimulate)
|
|
32
32
|
* Released under the ISC license.
|
|
33
33
|
*/var vf=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},yf=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),Af=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var i=[],n=!0,r=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done)&&(i.push(o.value),!t||i.length!==t);n=!0);}catch(e){r=!0,s=e}finally{try{!n&&a.return&&a.return()}finally{if(r)throw s}}return i}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var i=this;i.length<e;)i=t+i;return i};var Cf={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function _f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return(t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString())||"0"}var xf=function(){function e(t,i,n,r){vf(this,e);var s=this;if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===n){var o=t&&""+t;o&&function(t){if(t.startsWith("hsl")){var i=t.match(/([\-\d\.e]+)/g).map(Number),n=Af(i,4),r=n[0],o=n[1],a=n[2],c=n[3];void 0===c&&(c=1),r/=360,o/=100,a/=100,s.hsla=[r,o,a,c]}else if(t.startsWith("rgb")){var l=t.match(/([\-\d\.e]+)/g).map(Number),h=Af(l,4),d=h[0],u=h[1],f=h[2],p=h[3];void 0===p&&(p=1),s.rgba=[d,u,f,p]}else t.startsWith("#")?s.rgba=e.hexToRgb(t):s.rgba=e.nameToRgb(t)||e.hexToRgb(t)}(o.toLowerCase())}else this.rgba=[t,i,n,void 0===r?1:r]}return yf(e,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return _f(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],i=["","%","%",""],n=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,n){return _f(e*t[n],3===n?3:1)+i[n]}));return e?"hsla("+n+")":"hsl("+n+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=e.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=e.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)})).map((function(e){return e.padStart(2,"0")})).join("")},set:function(t){this.rgba=e.hexToRgb(t)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var i=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return i[3]=i[3]/255,i}},{key:"nameToRgb",value:function(t){var i=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),n=Cf[i];return void 0===n?n:e.hexToRgb(n.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=Af(e,4),i=t[0],n=t[1],r=t[2],s=t[3];i/=255,n/=255,r/=255;var o=Math.max(i,n,r),a=Math.min(i,n,r),c=void 0,l=void 0,h=(o+a)/2;if(o===a)c=l=0;else{var d=o-a;switch(l=h>.5?d/(2-o-a):d/(o+a),o){case i:c=(n-r)/d+(n<r?6:0);break;case n:c=(r-i)/d+2;break;case r:c=(i-n)/d+4}c/=6}return[c,l,h,s]}},{key:"hslToRgb",value:function(e){var t=Af(e,4),i=t[0],n=t[1],r=t[2],s=t[3],o=void 0,a=void 0,c=void 0;if(0===n)o=a=c=r;else{var l=function(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e},h=r<.5?r*(1+n):r+n-r*n,d=2*r-h;o=l(d,h,i+1/3),a=l(d,h,i),c=l(d,h,i-1/3)}var u=[255*o,255*a,255*c].map(Math.round);return u[3]=s,u}}]),e}(),kf=function(){function e(){vf(this,e),this._events=[]}return yf(e,[{key:"add",value:function(e,t,i){e.addEventListener(t,i,!1),this._events.push({target:e,type:t,handler:i})}},{key:"remove",value:function(t,i,n){this._events=this._events.filter((function(r){var s=!0;return t&&t!==r.target&&(s=!1),i&&i!==r.type&&(s=!1),n&&n!==r.handler&&(s=!1),s&&e._doRemove(r.target,r.type,r.handler),!s}))}},{key:"destroy",value:function(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,i){e.removeEventListener(t,i,!1)}}]),e}();function If(e,t,i){var n=!1;function r(e,t,i){return Math.max(t,Math.min(e,i))}function s(e,s,o){if(o&&(n=!0),n){e.preventDefault();var a=t.getBoundingClientRect(),c=a.width,l=a.height,h=s.clientX,d=s.clientY,u=r(h-a.left,0,c),f=r(d-a.top,0,l);i(u/c,f/l)}}function o(e,t){1===(void 0===e.buttons?e.which:e.buttons)?s(e,e,t):n=!1}function a(e,t){1===e.touches.length?s(e,e.touches[0],t):n=!1}e.add(t,"mousedown",(function(e){o(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",o),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){n=!1})),e.add(t,"touchend",(function(e){n=!1})),e.add(t,"touchcancel",(function(e){n=!1}))}var Sf="keydown",Ef="mousedown",Nf="focusin";function Mf(e,t){return(t||document).querySelector(e)}function Rf(e){e.preventDefault(),e.stopPropagation()}function Bf(e,t,i,n,r){e.add(t,Sf,(function(e){i.indexOf(e.key)>=0&&(r&&Rf(e),n(e))}))}var Df=function(){function e(t){vf(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new kf,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return yf(e,[{key:"setOptions",value:function(e){var t=this;if(e){var i=this.settings;if(e instanceof HTMLElement)i.parent=e;else{i.parent&&e.parent&&i.parent!==e.parent&&(this._events.remove(i.parent),this._popupInited=!1),function(e,t,i){for(var n in e)i&&i.indexOf(n)>=0||(t[n]=e[n])}(e,i),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var n=e.color||e.colour;n&&this._setColor(n)}var r=i.parent;if(r&&i.popup&&!this._popupInited){var s=function(e){return t.openHandler(e)};this._events.add(r,"click",s),Bf(this._events,r,[" ","Spacebar","Enter"],s),this._popupInited=!0}else e.parent&&!i.popup&&this.show()}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&e.type===Sf?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,i=!1;if(e)if(t===Ef||t===Nf){var n=(this.__containedEvent||0)+100;e.timeStamp>n&&(i=!0)}else Rf(e),i=!0;else i=!0;i&&this.hide()&&(this.settings.parent.style.pointerEvents="",t!==Ef&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function(e,t){if("string"==typeof e&&(e=e.trim()),e){t=t||{};var i=void 0;try{i=new xf(e)}catch(e){if(t.failSilently)return;throw e}if(!this.settings.alpha){var n=i.hsla;n[3]=1,i.hsla=n}this.colour=this.color=i,this._setHSLA(null,null,null,null,t)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstElementChild}(this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>');return this.domElement=t,this._domH=Mf(".picker_hue",t),this._domSL=Mf(".picker_sl",t),this._domA=Mf(".picker_alpha",t),this._domEdit=Mf(".picker_editor input",t),this._domSample=Mf(".picker_sample",t),this._domOkay=Mf(".picker_done button",t),this._domCancel=Mf(".picker_cancel button",t),t.classList.add("layout_"+this.settings.layout),this.settings.alpha||t.classList.add("no_alpha"),this.settings.editor||t.classList.add("no_editor"),this.settings.cancelButton||t.classList.add("no_cancel"),this._ifPopup((function(){return t.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,i=this.domElement,n=this._events;function r(e,t,i){n.add(e,t,i)}r(i,"click",(function(e){return e.preventDefault()})),If(n,this._domH,(function(e,i){return t._setHSLA(e)})),If(n,this._domSL,(function(e,i){return t._setHSLA(null,e,1-i)})),this.settings.alpha&&If(n,this._domA,(function(e,i){return t._setHSLA(null,null,null,1-i)}));var s=this._domEdit;r(s,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(s,"focus",(function(e){var t=this;t.selectionStart===t.selectionEnd&&t.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};r(window,Ef,t),r(window,Nf,t),Bf(n,i,["Esc","Escape"],t);var s=function(t){e.__containedEvent=t.timeStamp};r(i,Ef,s),r(i,Nf,s),r(e._domCancel,"click",t)}));var o=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};r(this._domOkay,"click",o),Bf(n,i,["Enter"],o)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(i){"static"===getComputedStyle(e).position&&(e.style.position="relative");var n=!0===i?"popup_right":"popup_"+i;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===n?t.classList.add(e):t.classList.remove(e)})),t.classList.add(n)}))}},{key:"_setHSLA",value:function(e,t,i,n,r){r=r||{};var s=this.colour,o=s.hsla;[e,t,i,n].forEach((function(e,t){(e||0===e)&&(o[t]=e)})),s.hsla=o,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(s)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,i=t.hsla,n="hsl("+360*i[0]+", 100%, 50%)",r=t.hslString,s=t.hslaString,o=this._domH,a=this._domSL,c=this._domA,l=Mf(".picker_selector",o),h=Mf(".picker_selector",a),d=Mf(".picker_selector",c);b(0,l,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,b(0,h,i[1]),F(0,h,1-i[2]),a.style.color=r,F(0,d,1-i[3]);var u=r,f=u.replace("hsl","hsla").replace(")",", 0)"),p="linear-gradient("+[u,f]+")";if(this._domA.style.background=p+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!e.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,w=void 0;switch(g){case"rgb":w=t.printRGB(m);break;case"hsl":w=t.printHSL(m);break;default:w=t.printHex(m)}this._domEdit.value=w}this._domSample.style.color=s}function b(e,t,i){t.style.left=100*i+"%"}function F(e,t,i){t.style.top=100*i+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var i=e?"":"none",n=t.style.display!==i;return n&&(t.style.display=i),n}}]),e}(),Tf=document.createElement("style");function zf(e){if(Lf[e])return Lf[e];if(Lf["chr"+e]){const t=Lf["chr"+e];return Lf[e]=t,t}{const r=(t=Math.round(255*Math.random()).toString(10),i=Math.round(255*Math.random()).toString(10),n=Math.round(255*Math.random()).toString(10),"rgb("+t+","+i+","+n+")");return Lf[e]=r,r}var t,i,n}Tf.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(Tf),Df.StyleElement=Tf;const Lf={chrX:"rgb(204, 153, 0)",chrY:"rgb(153, 204, 0",chrUn:"rgb(50, 50, 50)",chr1:"rgb(80, 80, 255)",chrI:"rgb(139, 155, 187)",chr2:"rgb(206, 61, 50)",chrII:"rgb(206, 61, 50)",chr2a:"rgb(216, 71, 60)",chr2b:"rgb(226, 81, 70)",chr3:"rgb(116, 155, 88)",chrIII:"rgb(116, 155, 88)",chr4:"rgb(240, 230, 133)",chrIV:"rgb(240, 230, 133)",chr5:"rgb(70, 105, 131)",chr6:"rgb(186, 99, 56)",chr7:"rgb(93, 177, 221)",chr8:"rgb(128, 34, 104)",chr9:"rgb(107, 215, 107)",chr10:"rgb(213, 149, 167)",chr11:"rgb(146, 72, 34)",chr12:"rgb(131, 123, 141)",chr13:"rgb(199, 81, 39)",chr14:"rgb(213, 143, 92)",chr15:"rgb(122, 101, 165)",chr16:"rgb(228, 175, 105)",chr17:"rgb(59, 27, 83)",chr18:"rgb(205, 222, 183)",chr19:"rgb(97, 42, 121)",chr20:"rgb(174, 31, 99)",chr21:"rgb(231, 199, 111)",chr22:"rgb(90, 101, 94)",chr23:"rgb(204, 153, 0)",chr24:"rgb(153, 204, 0)",chr25:"rgb(51, 204, 0)",chr26:"rgb(0, 204, 51)",chr27:"rgb(0, 204, 153)",chr28:"rgb(0, 153, 204)",chr29:"rgb(10, 71, 255)",chr30:"rgb(71, 117, 255)",chr31:"rgb(255, 194, 10)",chr32:"rgb(255, 209, 71)",chr33:"rgb(153, 0, 51)",chr34:"rgb(153, 26, 0)",chr35:"rgb(153, 102, 0)",chr36:"rgb(128, 153, 0)",chr37:"rgb(51, 153, 0)",chr38:"rgb(0, 153, 26)",chr39:"rgb(0, 153, 102)",chr40:"rgb(0, 128, 153)",chr41:"rgb(0, 51, 153)",chr42:"rgb(26, 0, 153)",chr43:"rgb(102, 0, 153)",chr44:"rgb(153, 0, 128)",chr45:"rgb(214, 0, 71)",chr46:"rgb(255, 20, 99)",chr47:"rgb(0, 214, 143)",chr48:"rgb(20, 255, 177)"};class Hf{constructor(e){this.tracks=[],this.chordSets=[]}addChordSet(e){this.chordSets=this.chordSets.filter((t=>t.name!==e.name)),this.chordSets.push(e);let t=this.tracks.find((t=>e.trackName===t.name));t&&(t.chordSets=t.chordSets.filter((t=>t.name!==e.name)),t.chordSets.push(e)),t||(t=new Pf(e),this.tracks.push(t))}clearChords(){this.tracks=[],this.chordSets=[]}getTrack(e){return this.tracks.find((t=>e===t.name))}getChordSet(e){return this.chordSets.find((t=>e===t.name))}}class Pf{constructor(e){this.name=e.trackName,this.color=e.trackColor,this.visible=!0,this.chordSets=[e],this.id=("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)}get chords(){if(1===this.chordSets.length)return this.chordSets[0].chords;const e=[];for(let t of this.chordSets)for(let i of t.chords)e.push(i);return e}}const Of=Math.exp(5);class Vf{static isInstalled(){return void 0!==window.JBrowseReactCircularGenomeView&&void 0!==window.React&&void 0!==window.ReactDOM}constructor(e,t){if(t=t||{},this.config=t,Vf.isInstalled()){this.parent=e,this.groupByTrack=!0===t.groupByTrack,this.chordManager=new Hf(t);const i=document.createElement("div");i.className="igv-circview-container",e.appendChild(i),this.createControls(i),this.resetControlPanel();const n=document.createElement("div");n.className="igv-circview-circular-genome-view",i.appendChild(n),this.container=n,t.assembly&&this.setAssembly(t.assembly),this.width=t.width||500,this.height=t.height||500,this.setSize(this.width,this.height)}else console.error("JBrowse circular view is not installed")}createControls(e){const t=document.createElement("div");t.className="igv-circview-toolbar",e.appendChild(t),this.toolbar=t;const i=document.createElement("div");i.className="igv-circview-track-panel",e.appendChild(i),this.controlPanel=i,this.controlPanel.style.display="none";const n=document.createElement("div");n.className="igv-circview-toolbar-button-container",this.toolbar.appendChild(n),this.showControlsButton=document.createElement("div"),this.showControlsButton.className="igv-circview-button",n.appendChild(this.showControlsButton),this.showControlsButton.innerText="none"===this.controlPanel.style.display?"Show Controls":"Hide Controls",this.showControlsButton.addEventListener("click",(e=>{this.controlPanel.querySelectorAll("div").length>0&&("none"===this.controlPanel.style.display?(this.controlPanel.style.display="flex",e.target.innerText="Hide Controls"):(this.controlPanel.style.display="none",e.target.innerText="Show Controls"))}));let r=document.createElement("div");r.className="igv-circview-button",n.appendChild(r),r.innerText="Clear All",r.addEventListener("click",(()=>{this.clearChords()})),!1!==this.config.showCloseButton&&(r=document.createElement("div"),r.className="igv-circview-button",n.appendChild(r),r.innerText="Close",r.addEventListener("click",(()=>{this.visible=!1})))}resetControlPanel(){this.controlPanel.innerHTML="",this.controlPanel.appendChild(this.createGroupByCB());const e=this.groupByTrack?this.chordManager.tracks:this.chordManager.chordSets;for(let t of e)this.addToControlPanel(t)}createGroupByCB(){const e=document.createElement("input");e.type="checkbox",e.id="groupByCB",e.style.width="1.4em",e.style.height="1.4em",e.checked=this.groupByTrack,e.onclick=e=>{this.groupByTrack=e.target.checked,this.resetControlPanel(),this.render()};const t=document.createElement("label");t.for="groupByCB",t.innerText="Group by track",t.style.color="black",t.style.paddingLeft="10px";const i=document.createElement("div");return i.style.width="100%",i.style.paddingTop="5px",i.style.paddingBottom="5px",i.style.background="rgb(216, 230, 234)",i.appendChild(e),i.appendChild(t),i}addToControlPanel(e){const t=document.createElement("div");this.controlPanel.appendChild(t);const i=document.createElement("div");i.className="igv-circview-button",t.appendChild(i),i.innerText=!0===e.visible?"Hide":"Show",i.addEventListener("click",(t=>{!0===e.visible?(this.hideChordSet(e.name),t.target.innerText="Show"):(this.showChordSet(e.name),t.target.innerText="Hide")}));const n=document.createElement("input"),r=e=>200*Math.log(e*Of),s=document.createElement("div");s.className="igv-circview-button",s.innerHTML=" ",t.appendChild(s),s.style.backgroundColor=qf(e.color,1);const o={parent:s,popup:"right",editorFormat:"rgb",color:e.color,onChange:({rgbaString:t})=>{s.style.backgroundColor=qf(t,1),this.setColor(e.name,t),n.value=r(Qf(e.color))}},a=new Df(o);n.setAttribute("title","Adjust transparency of arcs"),n.type="range",n.style.width="100px",n.style.marginRight="10px",n.setAttribute("class","range"),n.setAttribute("min","0"),n.setAttribute("max","1000"),n.value=r(Qf(e.color)),n.oninput=()=>{const t=(i=n.value,Math.exp(i/200)/Of);var i;this.setColor(e.name,qf(e.color,t)),a.setColor(e.color)},t.appendChild(n);const c=document.createElement("div");c.style.color="black",t.appendChild(c),c.innerText=c.title=e.name}setAssembly(e){const t=this.genomeId||Gf();if(this.genomeId===t)return;this.chordManager.clearChords(),this.genomeId=t,this.chrNames=new Set(e.chromosomes.map((e=>Uf(e.name))));const i=[],n=[];for(let t of e.chromosomes){const e=Uf(t.name);n.push(t.color||zf(e)),i.push({refName:e,uniqueId:e,start:0,end:t.bpLength})}this.assembly={name:e.name,sequence:{trackId:t,type:"ReferenceSequenceTrack",adapter:{type:"FromConfigSequenceAdapter",features:i}},refNameColors:n},this.render()}addChords(e,t={}){const i=t.name||t.track||"*",n=i.split(" ")[0].replaceAll("%20"," "),r={name:i.replaceAll("%20"," "),trackName:n,chords:e,color:t.color||"black",trackColor:t.trackColor||t.color||"black",visible:!0,id:t.id||Gf()};this.chordManager.addChordSet(r),this.resetControlPanel(),this.render()}setSize(e,t){if(t=t||e,this.width=e,this.height=t,this.viewState){const i=this.viewState.session.view;i.setWidth(e),i.setHeight(t),i.setBpPerPx(i.minBpPerPx)}}getSize(){return Math.min(this.width,this.height)}clearChords(){this.chordManager.clearChords(),this.resetControlPanel(),this.render()}clearSelection(){this.viewState.pluginManager.rootModel.session.clearSelection()}show(){this.parent.style.display="block"}hide(){this.parent.style.display="none"}get visible(){return"none"!==this.parent.style.display}set visible(e){this.parent.style.display=e?"block":"none"}hideChordSet(e){let t=this.getChordSet(e);t?(t.visible=!1,this.render()):console.warn(`No track with name: ${name}`)}showChordSet(e){let t=this.getChordSet(e);t?(t.visible=!0,this.render()):console.warn(`No track with name: ${e}`)}deleteTrack(e){let t=this.tracks.findIndex((t=>e===t.name));t>=0&&this.tracks.splice(t,1),this.render()}getChordSet(e){return this.groupByTrack?this.chordManager.getTrack(e):this.chordManager.getChordSet(e)}setColor(e,t){const i=this.getChordSet(e);if(i){i.color=t;const e=i.id;for(let i of this.viewState.config.tracks)if(e===i.trackId){i.displays[0].renderer.strokeColor.set(t);break}}}render(){const{createViewState:e,JBrowseCircularGenomeView:t}=JBrowseReactCircularGenomeView;ReactDOM.unmountComponentAtNode(this.container);const i=(this.groupByTrack?this.chordManager.tracks:this.chordManager.chordSets).filter((e=>e.visible)),n=[],r=[];for(let e of i)n.push({trackId:e.id,name:e.name,assemblyNames:["forIGV"],type:"VariantTrack",adapter:{type:"FromConfigAdapter",features:e.chords}}),r.push(e.color);this.viewState=e({assembly:this.assembly,tracks:n});for(let e=0;e<i.length;e++)this.viewState.config.tracks[e].displays[0].renderer.strokeColor.set(r[e]);this.element=React.createElement(t,{viewState:this.viewState}),this.setSize(this.width,this.height),ReactDOM.render(this.element,this.container);const s=this.config.onChordClick||jf;for(let e=0;e<i.length;e++)this.viewState.session.view.showTrack(this.viewState.config.tracks[e].trackId),s&&(this.viewState.pluginManager.jexl.addFunction("onChordClick",s),this.viewState.config.tracks[e].displays[0].onChordClick.set("jexl:onChordClick(feature, track, pluginManager)"))}}function qf(e,t){const[i,n,r,s]=e.split(",");return`${i},${n},${r},${t})`}function Qf(e){return e.startsWith("rgba(")?Number(e.split(",")[3].replace(")","")):1}function Uf(e){return e.startsWith("chr")?e.substring(3):e}function jf(e,t,i){console.log(e)}function Gf(){return("0000"+(Math.random()*Math.pow(36,4)|0).toString(36)).slice(-4)}if("undefined"!=typeof document){function Jv(e){for(let t of document.styleSheets)if(t=t.href?t.href.replace(/^.*[\\\/]/,""):"",t===e)return!0;return!1}Jv("circular-view.css")||function(){const e=document.createElement("style");e.setAttribute("type","text/css"),e.innerHTML='.igv-circview-container {\n width: fit-content;\n height: fit-content;\n box-sizing: content-box;\n color: dimgray;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n background-color: white;\n border-color: dimgray;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-circview-toolbar {\n position: relative;\n width: 100%;\n height: 32px;\n background-color: lightgrey;\n border-bottom-style: solid;\n border-bottom-color: dimgray;\n border-bottom-width: thin;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n\n.igv-circview-toolbar-button-container {\n height: 100%;\n width: fit-content;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-circview-toolbar-button-container > div {\n margin: 4px;\n}\n\n.igv-circview-track-panel {\n z-index: 1024;\n position: absolute;\n top: 33px;\n left: 0;\n width: 100%;\n height: fit-content;\n border-bottom-style: solid;\n border-bottom-color: dimgray;\n border-bottom-width: thin;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n}\n.igv-circview-track-panel > div {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-circview-track-panel > div > div {\n margin: 4px;\n}\n\n.igv-circview-swatch-button {\n cursor: pointer;\n padding: 5px;\n width: 8px;\n height: 8px;\n border: 1px solid #8d8b8b;\n border-radius: 16px;\n}\n\n.igv-circview-button {\n cursor: pointer;\n padding: 5px;\n color: #444;\n vertical-align: middle;\n text-align: center;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n border: 1px solid #8d8b8b;\n border-radius: 4px;\n background: #efefef;\n box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.2);\n}\n\n.igv-circview-button:hover {\n background: #efefef;\n box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.6);\n}\n\n.igv-circview-button:active {\n color: #007bff;\n box-shadow: 0 0 5px -1px rgba(0, 0, 0, 0.6);\n}\n\n/*# sourceMappingURL=circular-view.css.map */\n',document.head.insertBefore(e,document.head.childNodes[document.head.childNodes.length-1])}()}const Wf=e=>e.startsWith("chr")?e.substring(3):e;function $f(e){const t=[],i=[];if(e.wgChromosomeNames)for(let n of e.wgChromosomeNames){const r=e.getChromosome(n);i.push(Gh(r.name)),t.push({name:r.name,bpLength:r.bpLength})}return t}function Kf(e,t,i,n){const r=t.color||"rgb(0,0,255)",s=un.addAlpha("all"===i.chr?r:Gh(i.chr),n),o=un.addAlpha(r,n),a=t.name.replaceAll(" ","%20"),c="all"===i.chr?a:`${a} ${i.chr}:${i.start}-${i.end}`;t.browser.circularView.addChords(e,{track:c,color:s,trackColor:o}),t.browser.circularViewVisible||(t.browser.circularViewVisible=!0)}class Yf{constructor(e,{minTLENPercentile:t,maxTLENPercentile:i}){this.totalCount=0,this.frCount=0,this.rfCount=0,this.ffCount=0,this.sumF=0,this.sumF2=0,this.lp=void 0===t?.1:t,this.up=void 0===i?99.5:i,this.isizes=[],this.compute(e)}compute(e){for(let n of e)if(n.isProperPair()){var t=Math.abs(n.fragmentLength);this.sumF+=t,this.sumF2+=t*t,this.isizes.push(t);var i=n.pairOrientation;if("string"==typeof i&&4===i.length)switch(""+i.charAt(0)+i.charAt(2)){case"FF":case"RR":this.ffCount++;break;case"FR":this.frCount++;break;case"RF":this.rfCount++}this.totalCount++}this.ffCount/this.totalCount>.9?this.orienation="ff":this.frCount/this.totalCount>.9?this.orienation="fr":this.rfCount/this.totalCount>.9&&(this.orienation="rf"),this.minTLEN=0===this.lp?0:Xf(this.isizes,this.lp),this.maxTLEN=Xf(this.isizes,this.up)}}function Xf(e,t){if(0!==e.length){var i=Math.floor(e.length*(t/100));return e.sort((function(e,t){return e-t})),e[i]}}const Zf="rgb(255,0,255)",Jf="rgb(0,0,255)",ep="rgb(132, 178, 158)",tp=new Map;tp.set("m","rgb(255,0,0)"),tp.set("h",Zf),tp.set("o","rgb(111, 78, 129)"),tp.set("f","rgb(246, 200, 95)"),tp.set("c","rgb(157, 216, 102)"),tp.set("g","rgb(255, 160, 86)"),tp.set("e","rgb(141, 221, 208)"),tp.set("b","rgb(202, 71, 47)"),tp.set("h",Zf),tp.set("a","rgb(51,0,111)"),tp.set("NONE_A",Jf),tp.set("NONE_C",Jf),tp.set("NONE_T",Jf),tp.set("NONE_G",Jf),tp.set("NONE_N",Jf);const ip=new Map;function np(e,t,i){let n=function(e){return tp.has(e)?tp.get(e):ep}(e),r=hu(t);if(r>255)return n;const s=e+r+i;if(r<0&&(r=0),!ip.has(s)){const e="basemod2"===i?Math.max(20,Math.min(255,r*r/50-4*r+200+20)):Math.max(20,Math.min(255,.006127*r*r)),[t,o,a]=un.rgbComponents(n);ip.set(s,`rgba(${t},${o},${a},${e/255})`)}return ip.get(s)}class rp{constructor(e){this.alignmentTrack=e}updateContext(e){this.context=e}drawModifications(e,t,i,n,r,s){const{ctx:o,pixelEnd:a,bpStart:c,bpPerPixel:l}=n,h=e.getBaseModificationSets();if(h){let n;const d=r.split(":");2==d.length&&(r=d[0],n=d[1]);for(let d of e.blocks){if("S"===d.type)continue;const e=t,u=i;let f=Math.max(1,1/l);for(let t=d.seqOffset;t<d.seqOffset+d.len;t++){let i=(d.start+(t-d.seqOffset)-c)/l;if(i>a)break;if(i+f<0)continue;let p,g=-1,m=255,w=0;for(let e of h)if((!n||e.modification===n)&&e.containsPosition(t)){const i=hu(e.likelihoods.get(t));m-=i,(!p||i>g)&&(p=e.modification,w=e.canonicalBase,g=i)}if(p){const t=255*s;let n;m>g&&"basemod2"===r&&m>=t?n=np("NONE_"+w,m,r):g>=t&&(n=np(p,g,r)),o.fillStyle=n,f<3&&(f=3,i--),o.fillRect(i,e,f,Math.max(1,u-2))}}}}}}const sp=new Set(["firstOfPairStrand"]);class op extends Pa{static defaults={viewAsPairs:!1,showSoftClips:!1,showAllBases:!1,showInsertions:!0,showMismatches:!0,colorBy:void 0,groupBy:void 0,displayMode:"EXPANDED",alignmentRowHeight:14,squishedRowHeight:3,negStrandColor:"rgba(150, 150, 230, 0.75)",posStrandColor:"rgba(230, 150, 150, 0.75)",baseModPosStrandColor:"rgb(195, 195, 195)",baseModNegStrandColor:"rgb(195, 210, 195)",insertionColor:"rgb(138, 94, 161)",insertionTextColor:"white",showInsertionText:!1,deletionColor:"black",deletionTextColor:"black",showDeletionText:!1,skippedColor:"rgb(150, 170, 170)",pairConnectorColor:void 0,smallTLENColor:"rgb(0, 0, 150)",largeTLENColor:"rgb(200, 0, 0)",expectedPairOrientation:"fr",rlColor:"rgb(0, 150, 0)",rrColor:"rgb(20, 50, 200)",llColor:"rgb(0, 150, 150)",bamColorTag:"YC",hideSmallIndels:!1,indelSizeThreshold:1,highlightColor:void 0,minTLEN:void 0,maxTLEN:void 0,tagColorPallete:"Set1"};_colorTables=new Map;_baseModifications=new Set;constructor(e,t){super(e,t),(e.colorTable||e.tagColorTable)&&(this.colorTable=new Yn(e.tagColorTable)),e.largeFragmentLengthColor&&(this.largeTLENColor=e.largeFragmentLengthColor),e.pairOrienation&&(this.expectedPairOrientation=e.pairOrientation),e.smallFragmentLengthColor&&(this.smallTLENColor=e.smallFragmentLengthColor),e.largeFragmentLengthColor&&(this.largeTLENColor=e.largeFragmentLengthColor),e.minFragmentLength&&(this.minTLEN=e.minFragmentLength),e.maxFragmentLength&&(this.maxTLEN=e.maxFragmentLength),e.displayMode&&(this.displayMode=e.displayMode.toUpperCase()),e.colorBy&&e.colorByTag&&(this.colorBy=e.colorBy+":"+e.colorByTag),this.featureSource=this.parent.featureSource,this.top=0===e.coverageTrackHeight?0:e.coverageTrackHeight+5,this.pairColors={RL:this.rlColor,RR:this.rrColor,LL:this.llColor},e.highlightedReads&&this.setHighlightedReads(e.highlightedReads),this.hasPairs=!1,this.hasSupplemental=!1,this._groupByTags=[],this._groupByPositions=[],e.groupBy&&(this.groupBy=e.groupBy,e.groupBy.startsWith("base:")&&this._groupByPositions.push(e.groupBy.substring(5)),e.groupBy.startsWith("tag:")&&this._groupByTags.push(e.groupBy.substring(4))),this._locusChange=cp.bind(this),this.browser.on("locuschange",this._locusChange)}init(e){this.parent=e.parent,delete e.parent,super.init(e)}dispose(){this.browser.off("locuschage",this._locusChange)}get baseModRenderer(){return this._baseModRenderer||(this._baseModRenderer=new rp(this)),this._baseModRenderer}get baseModificationThreshold(){return this.parent.baseModificationThreshold}setTop(e,t){this.top=0===e.height||!1===t?0:5+e.height}setHighlightedReads(e,t){if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new Error("AlignmentTrack.setHighlightedReads() only accept array of strings");t&&(this.highlightColor=t),this.highlightedReads=new Set(e)}computePixelHeight(e){if(e.packedGroups){let t=e.hasDownsampledIntervals()?15:0;const i="SQUISHED"===this.displayMode?this.squishedRowHeight:this.alignmentRowHeight;for(let n of e.packedGroups.values())t+=i*n.length+10;return t+5}return 0}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=r+s*n+1,a=this.showSoftClips,c=this.showAllBases,l=this.browser.nucleotideColors;i.save();for(let e of t.baseModificationKeys)this._baseModifications.add(e.modification);let h=t.sequence;h&&(h=h.toUpperCase());let d=0;this.colorBy||(this.colorBy=this.hasPairs?"unexpectedPair":"none");let u=e.pixelTop;this.top&&i.translate(0,this.top);const f=u+e.pixelHeight;t.hasDownsampledIntervals()?(d=15,t.downsampledIntervals.forEach((function(e){var t=(e.start-r)/n,s=(e.end-r)/n;s-t>5&&(t+=1,s-=1),fr.fillRect(i,t,2,s-t,8,{fillStyle:"black"})}))):d=0,this.alignmentsYOffset=d;const p="SQUISHED"===this.displayMode?this.squishedRowHeight:this.alignmentRowHeight,g=t.packedGroups;if(g){let t=d;for(let n of g.keys()){const a=g.get(n),c=a.rows,l=c.length;a.pixelTop=t;for(let e=0;e<l;e++){const i=c[e],n=p<=4?p:p-2;if(t>f)break;if(t+n<u)t+=p;else{for(let e of i.alignments)if(this.browser.circularView&&(this.hasSupplemental=this.hasSupplemental||e.hasTag("SA")),!(e.start+e.lengthOnRef<r)){if(e.start>o)break;!0!==e.hidden&&(e instanceof iu?(m.call(this,e,t,n),w.call(this,e.firstAlignment,t,n),e.secondAlignment&&w.call(this,e.secondAlignment,t,n)):w.call(this,e,t,n))}t+=p}}if(a.pixelBottom=t,this.groupBy&&n){i.save(),i.font="400 12px sans-serif";const r=i.measureText(n),o=r.width+10,c=-e.pixelShift+e.viewportWidth-o-10,l=r.actualBoundingBoxAscent+r.actualBoundingBoxDescent+10,h=Math.min(a.pixelTop+l-1,a.pixelBottom);i.textAlign="center",i.fillStyle="white",i.strokeStyle="lightGray",fr.roundRect(i,c,h-r.actualBoundingBoxAscent-5,o,l,2,1,1),i.fillStyle="black",i.fillText(n,c+o/2,h),fr.dashedLine(i,0,t,s,t),i.restore(),t+=10}}}function m(e,t,s){var a=this.getConnectorColor(e.firstAlignment),c=(e.connectingStart-r)/n,l=(e.connectingEnd-r)/n,h=t+s/2;e.connectingEnd<r||e.connectingStart>o||(e.mq<=0&&(a=un.addAlpha(a,.15)),fr.setProperties(i,{fillStyle:a,strokeStyle:a}),fr.strokeLine(i,c,h,l,h))}function w(e,d,u){if(e.start+e.lengthOnRef<r||e.start>o)return;const f=a?e.blocks:e.blocks.filter((e=>"S"!==e.type));let g=this.getAlignmentColor(e);const m=g;e.mq<=0&&(g=un.addAlpha(g,.15)),fr.setProperties(i,{fillStyle:g,strokeStyle:m});const w=[];for(let e=0;e<f.length;e++){const t=f[e];if(!(e!==f.length-1&&f[e+1].start<r)&&(w.push(...b.call(this,t,e)),t.start+t.len>o))break}if(e.gaps){const t=d+u/2;for(let s of e.gaps){const e=(s.start-r)/n,o=(s.start+s.len-r)/n,a=o-e,c=s.len.toString(),l=6*c.length,h=e+a/2,u="D"===s.type?this.deletionColor:this.skippedColor;if(fr.strokeLine(i,e,t,o,t,{strokeStyle:u,lineWidth:2}),this.showDeletionText&&s.len>1&&a>=l+8){const e=h-l/2;fr.fillRect(i,e-1,d-1,l+2,12,{fillStyle:"white"}),fr.fillText(i,c,e,d+10,{font:"normal 10px monospace",fillStyle:this.deletionTextColor})}}}if(e.insertions&&this.showInsertions){let t=-1;for(let s of e.insertions){if(this.hideSmallIndels&&s.len<=this.indelSizeThreshold)continue;if(s.start<r)continue;if(s.start>o)break;const e=s.start-r,a=s.len.toString(),c=2+6*a.length,l=this.showInsertionText&&1!==s.len?Math.round(s.len/n):2,h=Math.max(Math.min(c,l),2),f=e/n-h/2;if(f-t>2){const e={fillStyle:this.insertionColor};fr.fillRect(i,f-2,d,h+4,2,e),fr.fillRect(i,f,d+2,h,u-4,e),fr.fillRect(i,f-2,d+u-2,h+4,2,e),this.showInsertionText&&s.len>1&&l>c&&fr.fillText(i,a,f+1,d+10,{font:"normal 10px monospace",fillStyle:this.insertionTextColor}),t=f}}}for(let{bbox:e,baseColor:t,readChar:r}of w){if(n<=.1&&e.height>=8){const n=Math.min(10,e.height);i.font=n+"px sans-serif";const s=e.x+e.width/2;fr.strokeText(i,r,s-i.measureText(r).width/2,n-1+e.y,{strokeStyle:t})}else fr.fillRect(i,e.x,e.y,e.width,e.height,{fillStyle:t})}if(this.colorBy&&this.colorBy.startsWith("basemod")){const t={ctx:i,bpPerPixel:n,bpStart:r,bpEnd:o,pixelEnd:s};this.baseModRenderer.drawModifications(e,d,u,t,this.colorBy,this.baseModificationThreshold)}function b(o,a){const w=[],b=o.start-t.start,F=(o.start-r)/n,v=(o.start+o.len-r)/n,y=Math.max(1,v-F),A=100/n,C=Math.min(p/2,A/6),_="S"===o.type,x=e.mq<=0||this.selectedReadName===e.readName||_||this.highlightedReads&&this.highlightedReads.has(e.readName);let k=m;this.selectedReadName===e.readName?k="red":_?k="rgb(50,50,50)":this.highlightedReads&&this.highlightedReads.has(e.readName)&&(k=this.highlightColor||"#00ff00");const I=!0===e.strand&&a===f.length-1,S=!1===e.strand&&0===a;if(I|S){let e,t;I?(e=[F,v,v+C,v,F,F],t=[d,d,d+u/2,d+u,d+u,d]):S&&(e=[v,F,F-C,F,v,v],t=[d,d,d+u/2,d+u,d+u,d]),fr.fillPolygon(i,e,t,{fillStyle:g}),x&&fr.strokePolygon(i,e,t,{strokeStyle:k})}else fr.fillRect(i,F,d,y,u,{fillStyle:g}),x&&(i.save(),i.strokeStyle=k,i.strokeRect(F,d,y,u),i.restore());if(_||c||this.showMismatches&&h&&e.seq&&"*"!==e.seq){const t=e.seq?e.seq.toUpperCase():void 0,i=e.qual,a=o.seqOffset,f=Math.max(1,1/n);for(let e=0,p=o.len;e<p;e++){const p=(o.start+e-r)/n;if(p+f<0)continue;if(p>s)break;let g=t?t.charAt(a+e):"";const m=b+e>=0?h.charAt(b+e):"";if("="===g&&(g=m),"X"===g||m!==g||_||c){let t=l[g]||"rgb(0,0,0)";if(!_&&void 0!==i&&i.length>a+e){t=ap(i[a+e],t)}w.push({bbox:{x:p,y:d,width:f,height:u},baseColor:t,readChar:g})}}}return w}}i.restore()}popupData(e){const t=this.getClickedObject(e);return t?t.popupData(e.genomicLocation):void 0}menuItemList(){let t=[];t.push("<hr/>");let i=e('<div class="igv-track-menu-category">');i.innerText="Color by:",t.push({name:void 0,element:i,click:void 0,init:void 0});const n=[];n.push({key:"none",label:"none"}),n.push({key:"strand",label:"read strand"}),this.hasPairs&&(n.push({key:"firstOfPairStrand",label:"first-of-pair strand"}),n.push({key:"pairOrientation",label:"pair orientation"}),n.push({key:"tlen",label:"insert size (TLEN)"}),n.push({key:"unexpectedPair",label:"pair orientation & insert size (TLEN)"})),n.push({key:"tag",label:"tag"});for(let e of n){const i=void 0===this.colorBy&&"none"===e.key||this.colorBy===e.key;t.push(this.colorByCB(e,i))}const r=this._baseModifications.size;if(r>0){t.push('<hr style="border-top:1px dotted;border-bottom: none;">');let e=1===r?"base modification":"base modification (all)";if(t.push(this.basemodColorByCB({key:"basemod",label:e})),r>1)for(let e of this._baseModifications)t.push(this.basemodColorByCB({key:"basemod:"+e,label:`base modification (${cu(e)})`}));if(t.push('<hr style="border-top:1px dotted;border-bottom: none;">'),e=1===r?"base modification 2-color":"base modification 2-color (all)",t.push(this.basemodColorByCB({key:"basemod2",label:e})),r>1)for(let e of this._baseModifications)t.push(this.basemodColorByCB({key:"basemod2:"+e,label:`base modification 2-color (${cu(e)})`}))}t.push("<hr/>"),i=document.createElement("div"),i.className="igv-track-menu-category",i.textContent="Group by:",t.push({name:void 0,element:i,click:void 0,init:void 0});const s=[];s.push({key:"none",label:"none"}),s.push({key:"strand",label:"read strand"}),this.hasPairs&&(s.push({key:"firstOfPairStrand",label:"first-of-pair strand"}),s.push({key:"pairOrientation",label:"pair orientation"}),s.push({key:"mateChr",label:"chromosome of mate"})),s.push({key:"chimeric",label:"chimeric"}),s.push({key:"supplementary",label:"supplementary flag"}),s.push({key:"readOrder",label:"read order"});for(let e of this._groupByTags)s.push({key:`tag:${e}`,label:`tag:${e}`});for(let e of this._groupByPositions)s.push({key:`base:${e}`,label:`base:${e}`});s.push({key:"tag",label:"tag..."});for(let e of s){const i=void 0===this.groupBy&&"none"===e.key||this.groupBy===e.key;t.push(this.groupByCB(e,i))}t.push("<hr/>"),t.push({element:Ta("Show all bases",this.showAllBases),click:function(){this.alignmentTrack.showAllBases=!this.alignmentTrack.showAllBases,this.trackView.repaintViews()}}),t.push({element:Ta("Show mismatches",this.showMismatches),click:function(){this.alignmentTrack.showMismatches=!this.alignmentTrack.showMismatches,this.trackView.repaintViews()}}),t.push({element:Ta("Show insertions",this.showInsertions),click:function(){this.alignmentTrack.showInsertions=!this.alignmentTrack.showInsertions,this.trackView.repaintViews()}}),t.push({element:Ta("Show soft clips",this.showSoftClips),click:function(){this.alignmentTrack.showSoftClips=!this.alignmentTrack.showSoftClips;const e=this.getCachedAlignmentContainers();for(let t of e)t.pack(this);this.trackView.repaintViews()}}),this.hasPairs&&(t.push("<hr/>"),t.push({element:Ta("View as pairs",this.viewAsPairs),click:function(){const e=!this.alignmentTrack.viewAsPairs;if(e&&this.groupBy&&!sp.has(this.groupBy))return void this.browser.alert.present(`'View as Pairs' is incompatible with 'Group By ${this.groupBy}'`);this.alignmentTrack.viewAsPairs=e;const t=this.getCachedAlignmentContainers();for(let e of t)e.pack(this);this.trackView.checkContentHeight(),this.trackView.repaintViews()}})),this.browser.circularView&&(this.hasPairs||this.hasSupplemental)&&(t.push("<hr/>"),this.hasPairs&&t.push({label:"Add discordant pairs to circular view",click:function(){for(let e of this.trackView.viewports)this.addPairedChordsForViewport(e)}}),this.hasSupplemental&&t.push({label:"Add split reads to circular view",click:function(){for(let e of this.trackView.viewports)this.addSplitChordsForViewport(e)}})),t.push("<hr/>"),i=document.createElement("div"),i.className="igv-track-menu-category",i.textContent="Display mode:",t.push({name:void 0,element:i,click:void 0,init:void 0});for(let e of["EXPANDED","SQUISHED","FULL"])t.push({element:Ta(e.toLowerCase(),this.displayMode===e),click:function(){this.alignmentTrack.setDisplayMode(e)}});return t}setDisplayMode(e){const t="FULL"===this.displayMode||"FULL"===e;if(this.displayMode=e,t){const e=this.getCachedAlignmentContainers();for(let t of e)t.pack(this)}this.trackView.checkContentHeight(),this.trackView.repaintViews()}colorByCB(e,t){const i=Ta(e.label,t);if("tag"!==e.key){function n(){this.alignmentTrack.colorBy=e.key,this.trackView.repaintViews()}return{name:void 0,element:i,click:n,init:void 0}}{function r(e){const t=this.alignmentTrack.colorBy.startsWith("tag:")?this.alignmentTrack.colorBy.substring(4):"";this.browser.inputDialog.present({label:"Tag Name",value:t,callback:e=>{const t=this.alignmentTrack;e?(t.colorBy="tag:"+e,t.colorTable||(t.colorTable=new Kn("Set1"))):t.colorBy=void 0,this.trackView.repaintViews()}},e)}return{name:void 0,element:i,dialog:r,init:void 0}}}basemodColorByCB(e){const t=this.colorBy===e.key;return{name:void 0,element:Ta(e.label,t),click:function(){this.alignmentTrack.colorBy=e.key,this.trackView.repaintViews()},init:void 0}}groupByCB(e,t){return{name:void 0,element:Ta(e.label,t),dialog:function(t){const i=()=>this.alignmentTrack.repackAlignments();if("tag"===e.key){let e="";this.alignmentTrack.groupBy&&this.alignmentTrack.groupBy.startsWith("tag:")&&(e=this.alignmentTrack.groupBy.substring(4)),this.browser.inputDialog.present({label:"Tag Name",value:e,callback:e=>{e&&(this.alignmentTrack.groupBy="tag:"+e,this.alignmentTrack._groupByTags.push(e),i())}},t)}else"none"===e.key?this.alignmentTrack.groupBy=void 0:this.alignmentTrack.groupBy=e.key,i()},init:void 0}}repackAlignments(){const e=this.getCachedAlignmentContainers();for(let t of e)"function"==typeof t.pack&&t.pack(this);this.trackView.checkContentHeight(),this.trackView.repaintViews()}contextMenuItemList(e){const t=e.viewport,i=[],n=i=>{const n=this.sortObject,r=!n||n.position!==Math.floor(e.genomicLocation)||!n.direction,s={chr:t.referenceFrame.chr,position:Math.floor(e.genomicLocation),option:i,direction:r,sortAsPairs:t.trackView.track.viewAsPairs};this.sortObject=s,t.cachedFeatures.sortRows(s),t.repaint()};i.push("<b>Sort by...</b>"),i.push({label:" base",click:()=>n("BASE")}),i.push({label:" read strand",click:()=>n("strand")}),i.push({label:" start location",click:()=>n("START")}),i.push({label:" insert size",click:()=>n("INSERT_SIZE")}),i.push({label:" gap size",click:()=>n("GAP_SIZE")}),i.push({label:" chromosome of mate",click:()=>n("MATE_CHR")}),i.push({label:" mapping quality",click:()=>n("MQ")}),i.push({label:" read name",click:()=>n("READ_NAME")}),i.push({label:" aligned read length",click:()=>n("ALIGNED_READ_LENGTH")}),i.push({label:" tag",click:()=>{const i=this.sortObject,n=!i||i.position!==Math.floor(e.genomicLocation)||!i.direction,r={label:"Tag Name",value:this.sortByTag?this.sortByTag:"",callback:i=>{if(i){const r={chr:t.referenceFrame.chr,position:Math.floor(e.genomicLocation),option:"TAG",tag:i,direction:n};this.sortByTag=i,this.sortObject=r,t.cachedFeatures.sortRows(r),t.repaint()}}};this.browser.inputDialog.present(r,e.event)}}),i.push("<hr/>");const r=`${t.referenceFrame.chr}:${F(Math.floor(e.genomicLocation)+1)}`;i.push({label:`Group by base @${r}`,click:()=>{this._groupByPositions.push(r),this.groupBy=`base:${r}`;const e=this.getCachedAlignmentContainers();for(let t of e)t.pack(this);this.trackView.checkContentHeight(),this.trackView.repaintViews()}}),i.push("<hr/>");const s=this.getClickedObject(e);if(s){const t=this.showSoftClips,n="function"==typeof s.alignmentContaining?s.alignmentContaining(e.genomicLocation,t):s;if(n){n.isPaired()&&n.isMateMapped()&&i.push({label:"View mate in split screen",click:()=>{if(n.mate){const t=e.viewport.referenceFrame,i=this.browser.genome.getChromosome(n.mate.chr);if(i){this.selectedReadName=n.readName;const r=t.bpPerPixel*e.viewport.getWidth(),s=n.mate.position-r/2,o=n.mate.position+r/2;this.browser.addMultiLocusPanel(i.name,s,o,t)}else this.browser.alert.present(`Reference does not contain chromosome: ${n.mate.chr}`)}},init:void 0}),i.push({label:"View read sequence",click:()=>{const e=n.seq;e&&"*"!==e?this.browser.alert.present(e):this.browser.alert.present("Read sequence: *")}}),to()&&i.push({label:"Copy read sequence",click:async()=>{const e=n.seq;try{await navigator.clipboard.writeText(e)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}});const t=n.seq;if(t&&"*"!==t){t.length<rh&&i.push({label:"BLAT read sequence",click:()=>{const e=n.isNegativeStrand()?lo(t):t,i=`${n.readName} - blat`,r=`${this.name} - ${i}`;oh({sequence:e,browser:this.browser,name:i,title:r})}});const e=n.softClippedBlocks();e.left&&e.left.len>20&&e.left.len<rh&&i.push({label:"BLAT left soft-clipped sequence",click:()=>{const i=t.substr(e.left.seqOffset,e.left.len),r=n.isNegativeStrand()?lo(i):i,s=`${n.readName} - blat left clip`,o=`${this.name} - ${s}`;oh({sequence:r,browser:this.browser,name:s,title:o})}}),e.right&&e.right.len>20&&e.right.len<rh&&i.push({label:"BLAT right soft-clipped sequence",click:()=>{const i=t.substr(e.right.seqOffset,e.right.len),r=n.isNegativeStrand()?lo(i):i,s=`${n.readName} - blat right clip`,o=`${this.name} - ${s}`;oh({sequence:r,browser:this.browser,name:s,title:o})}})}i.push("<hr/>")}}return this.browser.circularView&&(this.hasPairs||this.hasSupplemental)&&(this.hasPairs&&i.push({label:"Add discordant pairs to circular view",click:()=>{this.addPairedChordsForViewport(t)}}),this.hasSupplemental&&i.push({label:"Add split reads to circular view",click:()=>{this.addSplitChordsForViewport(t)}}),i.push("<hr/>")),i}getClickedObject(e){let t=e.viewport.cachedFeatures;if(!t)return;const i=e.y-this.top,n=e.genomicLocation;if(t.packedGroups){let e=Number.MAX_VALUE;for(let r of t.packedGroups.values())if(e=Math.min(e,r.pixelTop),i>r.pixelTop&&i<=r.pixelBottom){const e="SQUISHED"===this.displayMode?this.squishedRowHeight:this.alignmentRowHeight;let t=Math.floor((i-r.pixelTop)/e);if(t>=0&&t<r.length){const e=r.rows[t].alignments.filter((e=>e.containsLocation(n,this.showSoftClips)));if(e.length>0)return e[0]}}}if(i<minGroupY&&t.downsampledIntervals)for(const e of t.downsampledIntervals)if(e.start<=n&&e.end>=n)return e}getConnectorColor(e){if(this.pairConnectorColor)return this.pairConnectorColor;let t=this.colorBy;switch(t&&t.startsWith("tag:")&&(t.substring(4),t="tag"),t){case"strand":case"firstOfPairStrand":case"pairOrientation":case"tag":return this.color?"function"==typeof this.color?this.color(e):this.color:"rgb(200, 200, 200)";default:return this.getAlignmentColor(e)}}getAlignmentColor(e){let t;t=this.color?"function"==typeof this.color?this.color(e):this.color:"rgb(185, 185, 185)";let i,n=this.colorBy;switch(n&&n.startsWith("tag:")&&(i=n.substring(4),n="tag"),n){case"basemod":case"basemod2":t=e.strand?this.baseModPosStrandColor:this.baseModNegStrandColor;break;case"strand":t=e.strand?this.posStrandColor:this.negStrandColor;break;case"firstOfPairStrand":const r=e.firstOfPairStrand;void 0!==r&&(t=r?this.posStrandColor:this.negStrandColor);break;case"unexpectedPair":case"pairOrientation":if(e.pairOrientation){const i=fu[this.expectedPairOrientation];if(i){const n=this.pairColors[i[e.pairOrientation]];if(n){t=n;break}}}if("pairOrientation"===n)break;case"tlen":case"fragmentLength":e.mate&&e.isMateMapped()&&(e.mate.chr!==e.chr?t=Gh(e.mate.chr):this.minTemplateLength&&Math.abs(e.fragmentLength)<this.minTemplateLength?t=this.smallTLENColor:this.maxTemplateLength&&Math.abs(e.fragmentLength)>this.maxTemplateLength&&(t=this.largeTLENColor));break;case"tag":const s=e.tags()[i];void 0!==s&&(this.bamColorTag===i&&(t=un.createColorStringSafe(s)),this.colorTable||(this.colorTable=new Kn(this.tagColorPallete)),t=this.colorTable.getColor(s))}return t}get nucleotideColors(){return this.browser.nucleotideColors}get minTemplateLength(){return void 0!==this.minTLEN?this.minTLEN:this.parent._pairedEndStats?this.parent._pairedEndStats.minTLEN:0}get maxTemplateLength(){return void 0!==this.maxTLEN?this.maxTLEN:this.parent._pairedEndStats?this.parent._pairedEndStats.maxTLEN:1e3}getState(){const e=super.getState();return this.highlightedReads&&(e.highlightedReads=Array.from(this.highlightedReads)),e}get name(){return this.parent.name}set name(e){this.parent.name=e}get color(){return this.parent.color}set color(e){this.parent.color=e}get trackView(){return this.parent.trackView}get getCachedAlignmentContainers(){return this.parent.getCachedAlignmentContainers}get sortObject(){return this.parent.sortObject}set sortObject(e){this.parent.sortObject=e}addPairedChordsForViewport(e){return this.parent.addPairedChordsForViewport(e)}addSplitChordsForViewport(e){return this.parent.addSplitChordsForViewport(e)}}function ap(e,t){let i;return i=e<5?.1:Math.max(.1,Math.min(1,.1+.9*(e-5)/15)),i=Math.round(10*i)/10,i<1&&(t=un.addAlpha(t,i)),t}function cp(){"FULL"!==this.displayMode||this.browser.isTrackPanning()||this.repackAlignments()}function lp(e,t,i,n,r,s,o,a,c){const l=o.baseModCounts,h=o.coverageMap;if(l){let o;const d=a.split(":");2==d.length&&(a=d[0],o=d[1]);const u=Array.from(l.allModifications);u.sort(nu.compare);const f=h.getTotalCount(s);if(!u.filter((e=>o?o===e.modification:!e.modification.startsWith("NONE_"))).find((e=>l.getCount(s,e,0,!1)>0)))return;for(let d of u){if(d.modification.startsWith("NONE_")&&"basemod2"!==a)continue;if(o&&o!==d.modification&&!d.modification.startsWith("NONE_"))continue;const u=d.base,p=ao(u),g=h.getCount(s,u)+h.getCount(s,p),m=l.simplexModifications.has(d.modification)?h.getPosCount(s,u)+h.getNegCount(s,p):g;if(0==m)continue;const w="basemod2"===a,b=l.getCount(s,d,c,w);if(0==b)continue;const F=g/f*(b/m),v=Math.round(F*r),y=l.getLikelihoodSum(s,d,c,w)/b,A=i-v,C=np(d.modification,y,a);e.fillStyle=C,e.fillRect(t,A,n,v),i=A}}}class hp{constructor(e,t){this.featureType="numeric",this.parent=t,this.featureSource=t.featureSource,this.paintAxis=hl,this.top=0,this.autoscale=e.autoscale||void 0===e.max,e.coverageColor&&(this.color=e.coverageColor),this.autoscale||(this.dataRange={min:e.min||0,max:e.max})}get height(){return this.parent.coverageTrackHeight}draw(e){const t=e.pixelTop;e.pixelHeight;const i=this.parent.browser.nucleotideColors;if(t>this.height)return;const n=e.context,r=e.features,s=r.coverageMap;let o;s.refSeq&&(o=s.refSeq.toUpperCase());const a=e.bpPerPixel,c=e.bpStart,l=c+e.pixelWidth*a+1;let h;h=this.color?this.color:this.parent.color&&"function"!=typeof this.parent.color?un.darkenLighten(this.parent.color,-35):"rgb(150, 150, 150)",fr.setProperties(n,{fillStyle:h,strokeStyle:h});const d=Math.max(1,1/a);for(let e=0,t=s.coverage.length;e<t;e++){const t=s.bpStart+e;if(t<c)continue;if(t>l)break;const i=s.coverage[e];if(!i)continue;const r=i.total/this.dataRange.max*this.height,o=this.height-r,h=(t-c)/a;fr.fillRect(n,h,o,d,r)}if(o)for(let e=0,t=s.coverage.length;e<t;e++){const t=s.bpStart+e;if(t<c)continue;if(t>l)break;const h=s.coverage[e];if(!h)continue;const u=h.total/this.dataRange.max*this.height;let f=this.height-u;const p=Math.floor((t-c)/a),g=o[e];if(this.parent.colorBy&&this.parent.colorBy.startsWith("basemod"))lp(n,p,this.height,d,u,t,r,this.parent.colorBy,this.parent.baseModificationThreshold);else if(h.isMismatch(g)){fr.setProperties(n,{fillStyle:i[g]}),fr.fillRect(n,p,f,d,u);let e=0;for(let t of["A","C","T","G"]){const r=(h["pos"+t]+h["neg"+t])/this.dataRange.max*this.height;f=this.height-r-e,e+=r,fr.setProperties(n,{fillStyle:i[t]}),fr.fillRect(n,p,f,d,r)}}}}getClickedObject(e){let t=e.viewport.cachedFeatures;if(!t||0===t.length)return;const i=Math.floor(e.genomicLocation),n=t.coverageMap,r=Math.floor(i-n.bpStart),s=n.coverage[r];return s?{coverage:s,baseModCounts:t.baseModCounts,hoverText:()=>n.coverage[r].hoverText()}:void 0}popupData(e){const t=[],{coverage:i,baseModCounts:n}=this.getClickedObject(e);if(i){const r=Math.floor(e.genomicLocation),s=e.viewport.referenceFrame;t.push(s.chr+":"+F(1+r)),t.push({name:"Total Count",value:i.total});let o=i.posA+i.negA;o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posA+"+, "+i.negA+"- )"),t.push({name:"A",value:o}),o=i.posC+i.negC,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posC+"+, "+i.negC+"- )"),t.push({name:"C",value:o}),o=i.posG+i.negG,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posG+"+, "+i.negG+"- )"),t.push({name:"G",value:o}),o=i.posT+i.negT,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posT+"+, "+i.negT+"- )"),t.push({name:"T",value:o}),o=i.posN+i.negN,o>0&&(o=o.toString()+" ("+Math.round(o/i.total*100)+"%, "+i.posN+"+, "+i.negN+"- )"),t.push({name:"N",value:o}),t.push("<HR/>"),t.push({name:"DEL",value:i.del.toString()}),t.push({name:"INS",value:i.ins.toString()}),n&&(t.push("<hr/>"),t.push(...n.popupData(r,this.parent.colorBy)))}return t}}class dp extends Pa{static defaults={alleleFreqThreshold:.2,visibilityWindow:3e4,showCoverage:!0,showAlignments:!0,height:300,coverageTrackHeight:50,baseModificationThreshold:0};constructor(e,t){super(e,t)}init(e){this.type="alignment",this.featureSource=new bf(e,this.browser);const t=Object.assign({parent:this},e);this.coverageTrack=new hp(t,this);const i=Object.assign({parent:this},e);this.alignmentTrack=new op(i,this.browser),super.init(e),this.showAlignments||(this._height=this.coverageTrackHeight),e.sort&&(Array.isArray(e.sort)?this.assignSort(e.sort[0]):this.assignSort(e.sort))}dispose(){this.alignmentTrack.dispose()}setHighlightedReads(e,t){this.alignmentTrack.setHighlightedReads(e,t),this.updateViews()}get expectedPairOrientation(){return this.alignmentTrack.expectedPairOrientation}get viewAsPairs(){return this.alignmentTrack.viewAsPairs}get colorBy(){return this.alignmentTrack.colorBy}set height(e){this._height=e,this.showAlignments&&(this.alignmentTrack.height=this.showCoverage?e-this.coverageTrackHeight:e)}get height(){return this._height}sort(e){e=this.assignSort(e);for(let t of this.trackView.viewports)if(t.containsPosition(e.chr,e.position)){const i=t.cachedFeatures;i&&(i.sortRows(e),t.repaint())}}assignSort(e){if(e.locus){const t=function(e){const t=e.split(":"),i=t[1].split("-"),n={chr:t[0],start:Number.parseInt(i[0].replace(/,/g,""))-1};return i.length>1?n.end=Number.parseInt(i[1].replace(/,/g,"")):n.end=n.start+1,n}(e.locus);e.chr=t.chr,e.position=t.start}else e.position--;return e.direction="ASC"===e.direction||!0===e.direction,e.chr=this.browser.genome.getChromosomeName(e.chr),this.sortObject=e,this.sortObject}async getFeatures(e,t,i,n,r){const s=await this.featureSource.getAlignments(e,t,i);if(s.viewport=r,s.hasPairs&&!this._pairedEndStats&&!this.config.maxFragmentLength){const e=new Yf(s.allAlignments(),this.config);e.totalCount>99&&(this._pairedEndStats=e)}s.pack(this.alignmentTrack);const o=this.sortObject;return o&&o.chr===e&&o.position>=t&&o.position<=i&&s.sortRows(o),this.alignmentTrack.hasPairs=this.alignmentTrack.hasPairs||s.hasPairs,s}computePixelHeight(e){return(this.showCoverage?this.coverageTrackHeight:0)+(this.showAlignments?this.alignmentTrack.computePixelHeight(e):0)}draw(e){fr.fillRect(e.context,0,e.pixelTop,e.pixelWidth,e.pixelHeight,{fillStyle:"rgb(255, 255, 255)"}),!0===this.showCoverage&&this.coverageTrackHeight>0?(this.trackView.axisCanvas.style.display="block",this.coverageTrack.draw(e)):this.trackView.axisCanvas.style.display="none",!0===this.showAlignments&&(this.alignmentTrack.setTop(this.coverageTrack,this.showCoverage),this.alignmentTrack.draw(e))}paintAxis(e,t,i){this.coverageTrack.paintAxis(e,t,this.coverageTrackHeight)}contextMenuItemList(e){return this.alignmentTrack.contextMenuItemList(e)}popupData(e){return!0===this.showCoverage&&e.y>=this.coverageTrack.top&&e.y<this.coverageTrackHeight?this.coverageTrack.popupData(e):this.alignmentTrack.popupData(e)}clickedFeatures(e){let t;return t=!0===this.showCoverage&&e.y>=this.coverageTrack.top&&e.y<this.coverageTrackHeight?this.coverageTrack.getClickedObject(e):this.alignmentTrack.getClickedObject(e),t?[t]:void 0}hoverText(e){if(!0===this.showCoverage&&e.y>=this.coverageTrack.top&&e.y<this.coverageTrackHeight){const t=this.coverageTrack.getClickedObject(e);if(t)return t.hoverText()}}menuItemList(){let e=[];e=e.concat(this.numericDataMenuItems()),e=e.concat(this.alignmentTrack.menuItemList());const t=()=>{if(!this.autoHeight){const e=(this.showCoverage?this.coverageTrackHeight:0)+(this.showAlignments?this.alignmentTrack.height:0);this.trackView.setTrackHeight(e)}};return e.push("<hr/>"),e.push({element:Ta("Show Coverage",this.showCoverage),click:function(){this.showCoverage=!this.showCoverage,t(),this.trackView.checkContentHeight(),this.trackView.repaintViews()}}),e.push({element:Ta("Show Alignments",this.showAlignments),click:function(){this.showAlignments=!this.showAlignments,t(),this.trackView.checkContentHeight(),this.trackView.repaintViews()}}),e}getState(){const e=super.getState();return this.sortObject&&(e.sort={chr:this.sortObject.chr,position:this.sortObject.position+1,option:this.sortObject.option,direction:this.sortObject.direction?"ASC":"DESC"}),Object.assign(e,this.alignmentTrack.getState()),e}getCachedAlignmentContainers(){return this.trackView.viewports.map((e=>e.cachedFeatures))}get dataRange(){return this.coverageTrack.dataRange}set dataRange(e){this.coverageTrack.dataRange=e}get logScale(){return this.coverageTrack.logScale}set logScale(e){this.coverageTrack.logScale=e}get autoscale(){return this.coverageTrack.autoscale}set autoscale(e){this.coverageTrack.autoscale=e}addPairedChordsForViewport(e){const t=this.maxTemplateLength,i=[],n=e.referenceFrame;for(let r of e.cachedFeatures.allAlignments())r.end>=n.start&&r.start<=n.end&&(r.paired?r.end-r.start>t&&i.push(r):r.mate&&r.mate.chr&&(r.mate.chr!==r.chr||Math.max(r.fragmentLength)>t)&&i.push(r));Kf((e=>{const t=[];for(let i of e)if(i.paired)i.firstAlignment&&i.secondAlignment&&t.push({uniqueId:i.readName,refName:Wf(i.firstAlignment.chr),start:i.firstAlignment.start,end:i.firstAlignment.end,mate:{refName:Wf(i.secondAlignment.chr),start:i.secondAlignment.start,end:i.secondAlignment.end}});else{const e=i.mate;e&&e.chr&&e.position&&t.push({uniqueId:i.readName,refName:Wf(i.chr),start:i.start,end:i.end,mate:{refName:Wf(e.chr),start:e.position-1,end:e.position}})}return t})(i),this,n,.02)}addSplitChordsForViewport(e){const t=[],i=e.referenceFrame;for(let n of e.cachedFeatures.allAlignments()){const e=n.hasTag("SA");n.end>=i.start&&n.start<=i.end&&e&&t.push(n)}Kf((e=>{const t=e=>{const t=Su(e.tags().SA);let n=0;for(let r of t)r.start!==e.start&&i.push({uniqueId:`${e.readName}_${n++}`,refName:Wf(e.chr),start:e.start,end:e.end,mate:{refName:Wf(r.chr),start:r.start,end:r.start+r.lenOnRef}})},i=[];for(let i of e)i.paired?(t(i.firstAlignment),i.secondAlignment&&t(i.secondAlignment)):t(i);return i})(t),this,i,.02)}}const up="rgb(180,25,137)";class fp extends Pa{static defaults={height:250,theta:Math.PI/4,arcOrientation:"UP",showBlocks:!0,blockHeight:3,thickness:1,alpha:.02,logScale:!0};constructor(e,t){super(e,t)}init(e){super.init(e),!1===e.arcOrientation?this.arcOrientation="DOWN":!0===e.arcOrientation?this.arcOrientation="UP":e.arcOrientation?this.arcOrientation=e.arcOrientation.toUpperCase():this.arcOrientation="UP",this.sinTheta=Math.sin(this.theta),this.cosTheta=Math.cos(this.theta),this.arcType=function(e){if(!e.arcType)return"nested";switch(e.arcType){case"chiapet":return"inView";case"chiapetoutbound":return"partialInView";default:return e.arcType}}(e),this.painter={flipAxis:"DOWN"===this.arcOrientation,dataRange:this.dataRange,paintAxis:hl},e.valueColumn?(this.valueColumn=e.valueColumn,this.hasValue=!0):e.useScore&&(this.hasValue=!0,this.valueColumn="score"),e.max?(this.dataRange={min:e.min||0,max:e.max},this.autoscale=!1):this.autoscale=!0,e.featureSource?(this.featureSource=e.featureSource,delete e._featureSource):(this.featureSource=Hl(e,this.browser.genome),this.featureSource.getWGFeatures=bp)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow(),this.featureSource.visibilityWindow=this.visibilityWindow),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor,this}get supportsWholeGenome(){return"function"!=typeof this.featureSource.supportsWholeGenome||this.featureSource.supportsWholeGenome()}async getFeatures(e,t,i){const n=this.visibilityWindow,r=await this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n});return void 0===this.hasValue&&r&&r.length>0&&(this.hasValue=void 0!==r[0].score),r}draw(e){"proportional"===this.arcType||"inView"===this.arcType||"partialInView"===this.arcType?this.drawProportional(e):this.drawNested(e)}drawNested(e){const t=e.context,i=e.pixelWidth,n=e.pixelHeight,r=e.viewportWidth,s=e.bpPerPixel,o=e.bpStart,a=s;fr.fillRect(t,0,e.pixelTop,i,n,{fillStyle:"rgb(255, 255, 255)"});const c=e.features;if(c){(function(){let e=0;for(let t of c){let n=(t.start-o)/a,r=(t.end-o)/a;n>=0&&r<=i&&(e=Math.max(e,r-n))}let t=Math.min(r,e)/2;if(e>0){let e=(n-10)/t;this.theta=function(e){let t,i=[.01570925532366355,.15838444032453644,.3249196962329063,.5095254494944288,.7265425280053609,.9999999999999999],n=[.031415926535897934,.3141592653589793,.6283185307179586,.9424777960769379,1.2566370614359172,1.5707963267948966];for(t=0;t<i.length&&!(i[t]>e);t++);let r=0===t?0:i[t-1],s=t<i.length?i[t]:1,o=(e-r)/(s-r),a=0===t?0:n[t-1],c=t<n.length?n[t]:Math.PI/2;return Math.min(Math.PI/2,a+o*(c-a))}(e),this.sinTheta=Math.sin(this.theta),this.cosTheta=Math.cos(this.theta)}}).call(this);const s="UP"===this.arcOrientation,l=s?e.pixelHeight:0;t.font="8px sans-serif",t.textAlign="center";for(let e of c){let n;if(e.drawState=void 0,"function"==typeof this.color?n=this.color(e):(n=this.color||e.color||up,n&&this.config.useScore&&(n=wp(n,Zc(e.score)))),t.lineWidth=e.thickness||this.thickness||1,e.chr1===e.chr2||"all"===e.chr){const{m1:c,m2:h}=pp(e,this.browser.genome);let d=Math.round((c-o)/a),u=Math.round((h-o)/a);if(u<0||d>i)continue;let f=u-d;f<3&&(f=3,d--);const p=f/2,g=p/this.sinTheta,m=this.cosTheta*g,w=d+p;let b,F,v;if(s?(b=this.height+m,F=Math.PI+Math.PI/2-this.theta,v=Math.PI+Math.PI/2+this.theta):(b=-m,F=Math.PI/2-this.theta,v=Math.PI/2+this.theta),this.showBlocks&&"all"!==e.chr){const i=(e.start1-o)/a,n=(e.end1-o)/a,r=(e.start2-o)/a,c=(e.end2-o)/a,h=s?-this.blockHeight:this.blockHeight;t.fillRect(i,l,n-i,h),t.fillRect(r,l,c-r,h)}n&&!this.config.useScore&&f>r&&(n=wp(n,this.alpha)),t.strokeStyle=n,t.fillStyle=n,t.beginPath(),t.arc(w,b,g,F,v,!1),t.stroke(),e.drawState={xc:w,yc:b,r:g}}else{let r=Math.round((e.start-o)/a),c=Math.round((e.end-o)/a);if(c<0||r>i)continue;let l=c-r;l<3&&(l=3,r--);const h=e.chr===e.chr1?e.chr2:e.chr1;t.strokeStyle=n,t.fillStyle=wp(Gh(h),.5),s?(t.fillRect(r,this.height/2,l,this.height/2),t.fillText(h,r+l/2,this.height/2-5),e.drawState={x:r,y:this.height/2,w:l,h:this.height/2}):(t.fillRect(r,0,l,this.height/2),t.fillText(h,r+l/2,this.height/2+13),e.drawState={x:r,y:0,w:l,h:this.height/2})}}}}getScaleFactor(e,t,i,n){return n?i/(Math.log10(t+1)-(e<=0?0:Math.log10(e+1))):i/(t-e)}drawProportional(e){const t=e.context,i=e.pixelWidth,n=e.pixelHeight,r=e.bpPerPixel,s=e.bpStart,o=r,a=e.referenceFrame.start,c=e.referenceFrame.end,l="UP"===this.arcOrientation;fr.fillRect(t,0,e.pixelTop,i,n,{fillStyle:"rgb(255, 255, 255)"});const h=e.features;if(h&&h.length>0){const n=0,r=this.getScaleFactor(n,this.dataRange.max,e.pixelHeight-1,this.logScale),d=l?e.pixelHeight:0;for(let e of h){e.drawState=void 0;const n=this.valueColumn?e[this.valueColumn]:e.score;if(void 0===n||Number.isNaN(n))continue;const h=Math.round((this.logScale?Math.log10(n+1):n)*r);if(e.chr1===e.chr2||"all"===e.chr){const{m1:i,m2:r}=pp(e,this.browser.genome);let u=Math.round((i-s)/o),f=Math.round((r-s)/o)-u;if(f<3&&(f=3,u--),n<this.dataRange.min||n>this.dataRange.max)continue;if("proportional"!==this.arcType){const e="partialInView"===this.arcType,t=i>=a&&r<=c;let n=!1,s=!1;if(!t&&e&&(n=a<=i&&i<=c,n||(s=a<=r&&r<=c)),!(t||n||s))continue}const p=f/2,g=u+f/2;e.drawState={xc:g,yc:d,radiusX:p,radiusY:h};const m=l;let w;w="function"==typeof this.color?this.color(e):this.color||e.color||up;const b=this.config.useScore?wp(w,Zc(e.score)):w;if(t.strokeStyle=b,t.lineWidth=e.thickness||this.thickness||1,!0===t.isSVG?t.strokeEllipse(g,d,p,h,0,0,Math.PI,m):(t.beginPath(),t.ellipse(g,d,p,h,0,0,Math.PI,m),t.stroke()),this.alpha&&(t.fillStyle=wp(w,this.alpha),!0===t.isSVG?t.fillEllipse(g,d,p,h,0,0,Math.PI,m):t.fill()),this.showBlocks&&"all"!==e.chr){t.fillStyle=w;const i=(e.start1-s)/o,n=(e.end1-s)/o,r=(e.start2-s)/o,a=(e.end2-s)/o,c=l?-this.blockHeight:this.blockHeight;t.fillRect(i,d,n-i,c),t.fillRect(r,d,a-r,c)}}else{let r=Math.round((e.start-s)/o),a=Math.round((e.end-s)/o);if(a<0||r>i||n<this.dataRange.min||n>this.dataRange.max)continue;const c=Math.min(h,this.height-13);let d=a-r;d<3&&(d=3,r--);const u=e.chr===e.chr1?e.chr2:e.chr1;if(t.font="8px sans-serif",t.textAlign="center",t.fillStyle=wp(Gh(u),.5),l){const i=this.height-c;t.fillRect(r,i,d,c),t.fillText(u,r+d/2,i-5),e.drawState={x:r,y:i,w:d,h:c}}else t.fillRect(r,0,d,c),t.fillText(u,r+d/2,c+13),e.drawState={x:r,y:0,w:d,h:c}}}}}clearAxis(e,t,i){fr.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"})}paintAxis(e,t,i){const n={min:0,max:this.dataRange.max};"proportional"===this.arcType||"inView"===this.arcType||"partialInView"===this.arcType?(this.painter.flipAxis="DOWN"===this.arcOrientation,this.painter.dataRange=n,this.painter.paintAxis(e,t,i)):this.clearAxis(e,t,i)}menuItemList(){let e=[];if(this.hasValue){e.push("<hr/>");const t={nested:"Nested",proportional:"Proportional - All",inView:"Proportional - Both Ends in View",partialInView:"Proportional - One End in View"};e.push("<b>Arc Type</b>");for(let i of["nested","proportional","inView","partialInView"])e.push({element:Ta(t[i],i===this.arcType),click:function(){this.arcType=i,this.trackView.repaintViews()}})}return e.push("<hr/>"),e.push({name:"Toggle arc direction",click:function(){this.arcOrientation="UP"===this.arcOrientation?"DOWN":"UP",this.trackView.repaintViews()}}),e.push({name:this.showBlocks?"Hide Blocks":"Show Blocks",click:function(){this.showBlocks=!this.showBlocks,this.trackView.repaintViews()}}),"proportional"!==this.arcType&&"inView"!==this.arcType&&"partialInView"!==this.arcType||(e=e.concat(this.numericDataMenuItems())),this.browser.circularView&&(e.push("<hr/>"),e.push({label:"Add interactions to circular view",click:function(){for(let e of this.trackView.viewports)this.addChordsForViewport(e.referenceFrame)}})),e}contextMenuItemList(e){if(this.browser.circularView){const t=e.viewport,i=[];return i.push({label:"Add interactions to circular view",click:()=>{const e=t.referenceFrame;this.addChordsForViewport(e)}}),i.push("<hr/>"),i}}addChordsForViewport(e){let t;if("all"===e.chr)t=Object.values(this.featureSource.getAllFeatures()).flat();else{t=this.featureSource.featureCache.queryFeatures(e.chr,e.start,e.end).filter((e=>e.drawState))}if(0===t.length)return;Kf(t.map((e=>{const t=e._f||e;return{uniqueId:`${t.chr1}:${t.start1}-${t.end1}_${t.chr2}:${t.start2}-${t.end2}`,refName:Wf(t.chr1),start:t.start1,end:t.end1,mate:{refName:Wf(t.chr2),start:t.start2,end:t.end2}}})),this,e,.5)}doAutoscale(e){let t=0;if(e)for(let i of e){const e=this.valueColumn?i[this.valueColumn]:i.score;Number.isNaN(e)||(t=Math.max(t,e))}return{min:0,max:t}}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){const t=e._||e;if(i.push({name:"Region 1",value:gp(t.chr1,t.start1,t.end1,t.strand1)}),i.push({name:"Region 2",value:gp(t.chr2,t.start2,t.end2,t.strand2)}),t.name&&i.push({name:"Name",value:t.name}),void 0!==t.value&&i.push({name:"Value",value:t.value}),void 0!==t.score&&i.push({name:"Score",value:t.score}),t.extras&&this.header&&this.header.columnNames){const e=this.header.columnNames,n=this.header.hiccups?6:10;for(let r=n;r<e.length;r++)this.header.colorColumn!==r&&("info"===e[r]?Fp(i,t.extras[r-n]):i.push({name:e[r],value:t.extras[r-n]}))}break}return i}clickedFeatures(e){const t=e.viewport.cachedFeatures,i=[];if(t){const n="proportional"===this.arcType||"inView"===this.arcType||"partialInView"===this.arcType;for(let r of t)if(r.drawState)if(r.chr1===r.chr2||"all"===r.chr)if(n){const{xc:t,yc:n,radiusX:s,radiusY:o}=r.drawState,a=e.canvasX-t,c=e.canvasY-n,l=a/s*(a/s)+c/o*(c/o);l<=1&&i.push({score:1/l,feature:r})}else{const{xc:t,yc:n,r:s}=r.drawState,o=e.canvasX-t,a=e.canvasY-n,c=Math.abs(Math.sqrt(o*o+a*a)-s);c<5&&i.push({score:c,feature:r})}else{const{x:t,y:n,w:s,h:o}=r.drawState,a=5;if(e.canvasX>=t-a&&e.canvasX<=t+s+a&&e.canvasY>=n&&e.canvasY<=n+o){const n=-Math.abs(e.canvasX-(t+s/2));i.push({score:n,feature:r});break}}}return i.length>1&&i.sort(((e,t)=>e.score-t.score)),i.map((e=>e.feature))}}function pp(e,t){let i=(e.start1+e.end1)/2,n=(e.start2+e.end2)/2;if("all"===e.chr&&(i=t.getGenomeCoordinate(e.chr1,i),n=t.getGenomeCoordinate(e.chr2,n)),i>n){const e=i;i=n,n=e}return{m1:i,m2:n}}function gp(e,t,i,n){return n&&"."!==n?`${e}:${F(t+1)}-${F(i)} (${n})`:`${e}:${F(t+1)}-${F(i)}`}const mp=new Map;function wp(e,t){const i=`${e}_${t}`;let n=mp.get(i);return n||(n=un.addAlpha(e,t),mp.set(i,n)),n}function bp(e){const t=e=>{const t=Object.assign({},e);return t.chr="all",t.start=i.getGenomeCoordinate(e.chr1,e.start1),t.end=i.getGenomeCoordinate(e.chr2,e.end2),t},i=this.genome;let n,r=0;for(let t of i.wgChromosomeNames){let i=e[t];if(i)for(let e of i)e.dup||(r++,e.score&&(!n||e.score>n.score)&&(n=e))}const s=this.maxWGCount,o=n&&n.score>0&&r>s?5:1,a=Math.floor(s/o),c=n&&n.score>0?Math.log(n.score)/o:Number.MAX_SAFE_INTEGER;let l,h=[],d=[];for(let e=0;e<o;e++)d.push([0]),h.push([]);for(let n of i.wgChromosomeNames){let i=e[n];if(i)for(let e of i)if(!e.dup){const i=e.score?Math.max(0,Math.min(o-1,Math.floor(Math.log(e.score)/c))):0;if(h[i].length<a)h[i].push(t(e));else{const n=a/(d[i]+1);if(Math.random()<n){const n=Math.floor(Math.random()*(a-1));h[i][n]=t(e)}}d[i]++}}if(1===o)l=h[0];else{l=[];for(let e of h)for(let t of e)l.push(t);n&&l.push(t(n)),l.sort((function(e,t){return e.start-t.start})),console.log(l.length)}return l}function Fp(e,t){const i=t.split(";");for(let t of i){const i=t.split("=");2===i.length&&e.push({name:i[0],value:i[1]})}}class vp{constructor(e){var t;this.config=e,this.url=(t=e.path||e.url).includes("//www.dropbox.com")?t.replace("//www.dropbox.com","//dl.dropboxusercontent.com"):t.startsWith("ftp://ftp.ncbi.nlm.nih.gov")?t.replace("ftp://","https://"):t}async read(e,t){const i=this.config.headers||{};if(void 0!==e&&t){const n="bytes="+e+"-"+(e+t-1);i.Range=n}let n=this.url.slice();if(this.config.oauthToken){const e=async function(e){return"function"==typeof e?await Promise.resolve(e()):e}(this.config.oauthToken);i.Authorization=`Bearer ${e}`}this.config.apiKey&&(n=function(e,t,i){const n=e.includes("?")?"&":"?";return e+n+t+"="+i}(n,"key",this.config.apiKey));const r=await fetch(n,{method:"GET",headers:i,redirect:"follow",mode:"cors"}),s=r.status;if(s>=400){const e=Error(r.statusText);throw e.code=s,e}return r.arrayBuffer()}}class yp{constructor(e){this.file=e.file,this.fetchSize=e.fetchSize||16e3,this.maxSize=e.maxSize||1e6,this.buffers=[]}async read(e,t){let i=this.buffers.filter((i=>i.overlaps(e,e+t)));for(let n of i)if(n.contains(e,e+t))return n.slice(e,e+t);if(0===i.length){let i=Math.max(t,this.fetchSize);this.buffers.sort(((e,t)=>e.start-t.start));const n=function(e,t,i){let n=i-1,r=e.length;for(;1+n<r;){const i=n+(r-n>>1);t(e[i])?r=i:n=i}return r}(this.buffers,(t=>t.start>e),0);n<this.buffers.length&&(i=Math.min(i,this.buffers[n].start-e));const r=e,s=await this.file.read(r,i),o=new Ap(r,s);return this.addBuffer(o),o.slice(e,e+t)}{i.sort(((e,t)=>e.start-t.start));const n=[];let r=e;for(let e of i){if(r<e.start){const t=r,i=e.start-r,s=await this.file.read(t,i),o=new Ap(t,s);n.push(o)}n.push(e),r=e.end}const s=e+t;if(s>r){const e=r,t=s-e,i=await this.file.read(e,t),o=new Ap(e,i);n.push(o)}const o=n[0].start,a=function(e){const t=e.reduce(((e,t)=>e+t.byteLength),0),i=new Uint8Array(t);let n=0;for(let t of e)i.set(new Uint8Array(t),n),n+=t.byteLength;return i.buffer}(n.map((e=>e.buffer))),c=new Ap(o,a),l=new Set(i);return this.buffers=this.buffers.filter((e=>!l.has(e))),this.addBuffer(c),c.slice(e,e+t)}}addBuffer(e){const t=this.buffers.reduce(((e,t)=>e+t.size),0)+e.size;if(t>this.maxSize){const e=t-this.maxSize;this.buffers.sort(((e,t)=>e.creationTime-t.creationTime));let i,n=0;for(i=0;i<this.buffers.length&&(n+=this.buffers[i].size,!(n>e));i++);this.buffers=i<this.buffers.length-1?this.buffers.slice(i):[]}e.size<=this.maxSize&&this.buffers.push(e)}}class Ap{constructor(e,t){this.creationTime=Date.now(),this.start=e,this.buffer=t}slice(e,t){if(e<this.start||t-e>this.buffer.byteLength)throw Error("buffer bounds error");return this.buffer.slice(e-this.start,t-this.start)}get end(){return this.start+this.buffer.byteLength}get size(){return this.buffer.byteLength}contains(e,t){return e>=this.start&&t<=this.end}overlaps(e,t){return e>this.start&&e<this.end||t>this.start&&t<this.end}toString(){return`Buffer ${this.creationTime} ${this.start} - ${this.end}`}}class Cp{constructor(e){this.file=e}async read(e,t){if(0===t)return new ArrayBuffer;return(null!=e&&t?this.file.slice(e,e+t):this.file).arrayBuffer()}}var _p=Object.defineProperty,xp=(e,t,i)=>(((e,t,i)=>{t in e?_p(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i);async function kp(e,t,i=0){var n=new Map;for(let[r,s]of e.entries()){let e=await Bp.unpack_from_async("<"+s,t,i);i+=Bp.calcsize(s),1==e.length&&(e=e[0]),n.set(r,e)}return n}function Ip(e,t,i=0){var n=new Map;for(let[r,s]of e.entries()){let e=Bp.unpack_from("<"+s,t,i);i+=Bp.calcsize(s),1==e.length&&(e=e[0]),n.set(r,e)}return n}function Sp(e){e||e()}function Ep(e){var t="<"+Array.from(e.values()).join("");return Bp.calcsize(t)}function Np(e,t=8){return Math.ceil(e/t)*t}var Mp={u:"Uint",i:"Int",f:"Float"};function Rp(e){var t,i,n=Bp._is_big_endian(e);if(/S/.test(e))t="getString",i=0|((e.match(/S(\d*)/)||[])[1]||1);else{let[n,r,s]=e.match(/[<>=!@]?(i|u|f)(\d*)/);i=parseInt(s||4,10),t="get"+Mp[r]+(8*i).toFixed()}return[t,n,i]}var Bp=new class{constructor(){this.big_endian=function(){const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])}(),this.getters={s:"getUint8",b:"getInt8",B:"getUint8",h:"getInt16",H:"getUint16",i:"getInt32",I:"getUint32",l:"getInt32",L:"getUint32",q:"getInt64",Q:"getUint64",f:"getFloat32",d:"getFloat64"},this.byte_lengths={s:1,b:1,B:1,h:2,H:2,i:4,I:4,l:4,L:4,q:8,Q:8,f:4,d:8};let e=Object.keys(this.byte_lengths).join("");this.fmt_size_regex="(\\d*)(["+e+"])"}calcsize(e){for(var t,i=0,n=new RegExp(this.fmt_size_regex,"g");null!==(t=n.exec(e));){let e=parseInt(t[1]||1,10),n=t[2];i+=e*this.byte_lengths[n]}return i}_is_big_endian(e){return!/^</.test(e)&&(!!/^(!|>)/.test(e)||this.big_endian)}async unpack_from_async(e,t,i){i=Number.parseInt(i||0);const n=this.calcsize(e),r=await t.slice(i,i+n);let s=0;for(var o,a=new Dp(r),c=[],l=this._is_big_endian(e),h=new RegExp(this.fmt_size_regex,"g");null!==(o=h.exec(e));){let e=parseInt(o[1]||1,10),t=o[2],i=this.getters[t],n=this.byte_lengths[t];if("s"==t)c.push((new TextDecoder).decode(r.slice(s,s+e))),s+=e;else for(var d=0;d<e;d++)c.push(a[i](s,!l)),s+=n}return c}unpack_from(e,t,i){i=Number.parseInt(i||0);const n=this.calcsize(e),r=t.slice(i,i+n);let s=0;for(var o,a=new Dp(r),c=[],l=this._is_big_endian(e),h=new RegExp(this.fmt_size_regex,"g");null!==(o=h.exec(e));){let e=parseInt(o[1]||1,10),t=o[2],i=this.getters[t],n=this.byte_lengths[t];if("s"==t)c.push((new TextDecoder).decode(r.slice(s,s+e))),s+=e;else for(var d=0;d<e;d++)c.push(a[i](s,!l)),s+=n}return c}};var Dp=class extends DataView{getUint64(e,t){const i=BigInt(this.getUint32(e,t)),n=BigInt(this.getUint32(e+4,t));let r=t?i+(n<<32n):(i<<32n)+n;return Number.parseInt(r)}getInt64(e,t){var i,n;t?(i=this.getUint32(e,!0),n=this.getInt32(e+4,!0)):(n=this.getInt32(e,!1),i=this.getUint32(e+4,!1));let r=BigInt(i)+(BigInt(n)<<32n);return Number.parseInt(r)}getString(e,t,i){const n=this.buffer.slice(e,e+i);return(new TextDecoder).decode(n)}getVLENStruct(e,t,i){return[this.getUint32(e,t),this.getUint64(e+4,t),this.getUint32(e+12,t)]}};function Tp(e){return e.toString(2).length}function zp(e,t,i=0,n=!0){const r=t.slice(i,i+e);let s=new Uint8Array(r);n||s.reverse();let o=s.reduce(((e,t,i)=>e+(t<<8*i)),0);return o}var Lp=class{constructor(e,t){this.buf=e,this.offset=t,this.dtype=this.determine_dtype()}async determine_dtype(){let e=await kp(Hp,this.buf,this.offset);this.offset+=Pp;let t=15&e.get("class_and_version");if(t==Op)return this._determine_dtype_fixed_point(e);if(t==Vp)return this._determine_dtype_floating_point(e);if(t==qp)throw"Time datatype class not supported.";if(t==Qp)return this._determine_dtype_string(e);if(t==Up)throw"Bitfield datatype class not supported.";if(t==jp)return{datatype_class:jp,size:e.get("size")};if(t==Gp)return this._determine_dtype_compound(e);if(t==Wp)return["REFERENCE",e.get("size")];if(t==$p)return this.determine_dtype();if(t==Yp)throw"Array datatype class not supported.";if(t==Kp){let t=this._determine_dtype_vlen(e);if("VLEN_SEQUENCE"==t[0]){t=["VLEN_SEQUENCE",this.determine_dtype()]}return t}throw"Invalid datatype class "+t}_determine_dtype_fixed_point(e){let t=e.get("size");if(![1,2,4,8].includes(t))throw"Unsupported datatype size";var i;var n;return i=(8&e.get("class_bit_field_0"))>0?"i":"u",n=0==(1&e.get("class_bit_field_0"))?"<":">",this.offset+=4,n+i+t.toFixed()}_determine_dtype_floating_point(e){let t=e.get("size");if(![1,2,4,8].includes(t))throw"Unsupported datatype size";var i;return i=0==(1&e.get("class_bit_field_0"))?"<":">",this.offset+=12,i+"f"+t.toFixed()}_determine_dtype_string(e){return"S"+e.get("size").toFixed()}_determine_dtype_vlen(e){return 1!=(1&e.get("class_bit_field_0"))?["VLEN_SEQUENCE",0,0]:["VLEN_STRING",e.get("class_bit_field_0")>>4,1&e.get("class_bit_field_1")]}_determine_dtype_compound(e){throw"Compound type not yet implemented!"}},Hp=new Map([["class_and_version","B"],["class_bit_field_0","B"],["class_bit_field_1","B"],["class_bit_field_2","B"],["size","I"]]),Pp=Ep(Hp);Ep(new Map([["offset","I"],["dimensionality","B"],["reserved_0","B"],["reserved_1","B"],["reserved_2","B"],["permutation","I"],["reserved_3","I"],["dim_size_1","I"],["dim_size_2","I"],["dim_size_3","I"],["dim_size_4","I"]]));var Op=0,Vp=1,qp=2,Qp=3,Up=4,jp=5,Gp=6,Wp=7,$p=8,Kp=9,Yp=10;function Xp(e){let t=e.length;for(;--t>=0;)e[t]=0}Xp(new Array(576)),Xp(new Array(60)),Xp(new Array(512)),Xp(new Array(256)),Xp(new Array(29)),Xp(new Array(30));var Zp=(e,t,i,n)=>{let r=65535&e,s=e>>>16&65535,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do{r=r+t[n++]|0,s=s+r|0}while(--o);r%=65521,s%=65521}return r|s<<16},Jp=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})()),eg=(e,t,i,n)=>{const r=Jp,s=n+i;e^=-1;for(let i=n;i<s;i++)e=e>>>8^r[255&(e^t[i])];return~e},tg={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ig={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},ng=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),rg=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)ng(i,t)&&(e[t]=i[t])}}return e},sg=e=>{let t=0;for(let i=0,n=e.length;i<n;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,n=0,r=e.length;t<r;t++){let r=e[t];i.set(r,n),n+=r.length}return i},og=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(ey){og=!1}var ag=new Uint8Array(256);for(let ty=0;ty<256;ty++)ag[ty]=ty>=252?6:ty>=248?5:ty>=240?4:ty>=224?3:ty>=192?2:1;ag[254]=ag[254]=1;var cg=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,n,r,s,o=e.length,a=0;for(r=0;r<o;r++)i=e.charCodeAt(r),55296==(64512&i)&&r+1<o&&(n=e.charCodeAt(r+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),a+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(a),s=0,r=0;s<a;r++)i=e.charCodeAt(r),55296==(64512&i)&&r+1<o&&(n=e.charCodeAt(r+1),56320==(64512&n)&&(i=65536+(i-55296<<10)+(n-56320),r++)),i<128?t[s++]=i:i<2048?(t[s++]=192|i>>>6,t[s++]=128|63&i):i<65536?(t[s++]=224|i>>>12,t[s++]=128|i>>>6&63,t[s++]=128|63&i):(t[s++]=240|i>>>18,t[s++]=128|i>>>12&63,t[s++]=128|i>>>6&63,t[s++]=128|63&i);return t},lg=(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,r;const s=new Array(2*i);for(r=0,n=0;n<i;){let t=e[n++];if(t<128){s[r++]=t;continue}let o=ag[t];if(o>4)s[r++]=65533,n+=o-1;else{for(t&=2===o?31:3===o?15:7;o>1&&n<i;)t=t<<6|63&e[n++],o--;o>1?s[r++]=65533:t<65536?s[r++]=t:(t-=65536,s[r++]=55296|t>>10&1023,s[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&og)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let n=0;n<t;n++)i+=String.fromCharCode(e[n]);return i})(s,r)},hg=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+ag[e[i]]>t?i:t};var dg=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ug=function(e,t){let i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v,y,A,C,_,x;const k=e.state;i=e.next_in,_=e.input,n=i+(e.avail_in-5),r=e.next_out,x=e.output,s=r-(t-e.avail_out),o=r+(e.avail_out-257),a=k.dmax,c=k.wsize,l=k.whave,h=k.wnext,d=k.window,u=k.hold,f=k.bits,p=k.lencode,g=k.distcode,m=(1<<k.lenbits)-1,w=(1<<k.distbits)-1;e:do{f<15&&(u+=_[i++]<<f,f+=8,u+=_[i++]<<f,f+=8),b=p[u&m];t:for(;;){if(F=b>>>24,u>>>=F,f-=F,F=b>>>16&255,0===F)x[r++]=65535&b;else{if(!(16&F)){if(64&F){if(32&F){k.mode=12;break e}e.msg="invalid literal/length code",k.mode=30;break e}b=p[(65535&b)+(u&(1<<F)-1)];continue t}for(v=65535&b,F&=15,F&&(f<F&&(u+=_[i++]<<f,f+=8),v+=u&(1<<F)-1,u>>>=F,f-=F),f<15&&(u+=_[i++]<<f,f+=8,u+=_[i++]<<f,f+=8),b=g[u&w];;){if(F=b>>>24,u>>>=F,f-=F,F=b>>>16&255,16&F){if(y=65535&b,F&=15,f<F&&(u+=_[i++]<<f,f+=8,f<F&&(u+=_[i++]<<f,f+=8)),y+=u&(1<<F)-1,y>a){e.msg="invalid distance too far back",k.mode=30;break e}if(u>>>=F,f-=F,F=r-s,y>F){if(F=y-F,F>l&&k.sane){e.msg="invalid distance too far back",k.mode=30;break e}if(A=0,C=d,0===h){if(A+=c-F,F<v){v-=F;do{x[r++]=d[A++]}while(--F);A=r-y,C=x}}else if(h<F){if(A+=c+h-F,F-=h,F<v){v-=F;do{x[r++]=d[A++]}while(--F);if(A=0,h<v){F=h,v-=F;do{x[r++]=d[A++]}while(--F);A=r-y,C=x}}}else if(A+=h-F,F<v){v-=F;do{x[r++]=d[A++]}while(--F);A=r-y,C=x}for(;v>2;)x[r++]=C[A++],x[r++]=C[A++],x[r++]=C[A++],v-=3;v&&(x[r++]=C[A++],v>1&&(x[r++]=C[A++]))}else{A=r-y;do{x[r++]=x[A++],x[r++]=x[A++],x[r++]=x[A++],v-=3}while(v>2);v&&(x[r++]=x[A++],v>1&&(x[r++]=x[A++]))}break}if(64&F){e.msg="invalid distance code",k.mode=30;break e}b=g[(65535&b)+(u&(1<<F)-1)]}}break}}while(i<n&&r<o);v=f>>3,i-=v,f-=v<<3,u&=(1<<f)-1,e.next_in=i,e.next_out=r,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=r<o?o-r+257:257-(r-o),k.hold=u,k.bits=f},fg=15,pg=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),gg=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),mg=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),wg=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),bg=(e,t,i,n,r,s,o,a)=>{const c=a.bits;let l,h,d,u,f,p,g=0,m=0,w=0,b=0,F=0,v=0,y=0,A=0,C=0,_=0,x=null,k=0;const I=new Uint16Array(16),S=new Uint16Array(16);let E,N,M,R=null,B=0;for(g=0;g<=fg;g++)I[g]=0;for(m=0;m<n;m++)I[t[i+m]]++;for(F=c,b=fg;b>=1&&0===I[b];b--);if(F>b&&(F=b),0===b)return r[s++]=20971520,r[s++]=20971520,a.bits=1,0;for(w=1;w<b&&0===I[w];w++);for(F<w&&(F=w),A=1,g=1;g<=fg;g++)if(A<<=1,A-=I[g],A<0)return-1;if(A>0&&(0===e||1!==b))return-1;for(S[1]=0,g=1;g<fg;g++)S[g+1]=S[g]+I[g];for(m=0;m<n;m++)0!==t[i+m]&&(o[S[t[i+m]]++]=m);if(0===e?(x=R=o,p=19):1===e?(x=pg,k-=257,R=gg,B-=257,p=256):(x=mg,R=wg,p=-1),_=0,m=0,g=w,f=s,v=F,y=0,d=-1,C=1<<F,u=C-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){E=g-y,o[m]<p?(N=0,M=o[m]):o[m]>p?(N=R[B+o[m]],M=x[k+o[m]]):(N=96,M=0),l=1<<g-y,h=1<<v,w=h;do{h-=l,r[f+(_>>y)+h]=E<<24|N<<16|M}while(0!==h);for(l=1<<g-1;_&l;)l>>=1;if(0!==l?(_&=l-1,_+=l):_=0,m++,0==--I[g]){if(g===b)break;g=t[i+o[m]]}if(g>F&&(_&u)!==d){for(0===y&&(y=F),f+=w,v=g-y,A=1<<v;v+y<b&&(A-=I[v+y],!(A<=0));)v++,A<<=1;if(C+=1<<v,1===e&&C>852||2===e&&C>592)return 1;d=_&u,r[d]=F<<24|v<<16|f-s}}return 0!==_&&(r[f+_]=g-y<<24|64<<16),a.bits=F,0},{Z_FINISH:Fg,Z_BLOCK:vg,Z_TREES:yg,Z_OK:Ag,Z_STREAM_END:Cg,Z_NEED_DICT:_g,Z_STREAM_ERROR:xg,Z_DATA_ERROR:kg,Z_MEM_ERROR:Ig,Z_BUF_ERROR:Sg,Z_DEFLATED:Eg}=ig,Ng=12,Mg=30,Rg=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Bg(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var Dg,Tg,zg=e=>{if(!e||!e.state)return xg;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Ag},Lg=e=>{if(!e||!e.state)return xg;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,zg(e)},Hg=(e,t)=>{let i;if(!e||!e.state)return xg;const n=e.state;return t<0?(i=0,t=-t):(i=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?xg:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=i,n.wbits=t,Lg(e))},Pg=(e,t)=>{if(!e)return xg;const i=new Bg;e.state=i,i.window=null;const n=Hg(e,t);return n!==Ag&&(e.state=null),n},Og=!0,Vg=e=>{if(Og){Dg=new Int32Array(512),Tg=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(bg(1,e.lens,0,288,Dg,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;bg(2,e.lens,0,32,Tg,0,e.work,{bits:5}),Og=!1}e.lencode=Dg,e.lenbits=9,e.distcode=Tg,e.distbits=5},qg=(e,t,i,n)=>{let r;const s=e.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(t.subarray(i-s.wsize,i),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>n&&(r=n),s.window.set(t.subarray(i-n,i-n+r),s.wnext),(n-=r)?(s.window.set(t.subarray(i-n,i),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},Qg={inflateReset:Lg,inflateReset2:Hg,inflateResetKeep:zg,inflateInit:e=>Pg(e,15),inflateInit2:Pg,inflate:(e,t)=>{let i,n,r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v,y,A,C,_=0;const x=new Uint8Array(4);let k,I;const S=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return xg;i=e.state,i.mode===Ng&&(i.mode=13),o=e.next_out,r=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,l=i.hold,h=i.bits,d=a,u=c,C=Ag;e:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(2&i.wrap&&35615===l){i.check=0,x[0]=255&l,x[1]=l>>>8&255,i.check=eg(i.check,x,2,0),l=0,h=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=Mg;break}if((15&l)!==Eg){e.msg="unknown compression method",i.mode=Mg;break}if(l>>>=4,h-=4,A=8+(15&l),0===i.wbits)i.wbits=A;else if(A>i.wbits){e.msg="invalid window size",i.mode=Mg;break}i.dmax=1<<i.wbits,e.adler=i.check=1,i.mode=512&l?10:Ng,l=0,h=0;break;case 2:for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(i.flags=l,(255&i.flags)!==Eg){e.msg="unknown compression method",i.mode=Mg;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=Mg;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=eg(i.check,x,2,0)),l=0,h=0,i.mode=3;case 3:for(;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.head&&(i.head.time=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,x[2]=l>>>16&255,x[3]=l>>>24&255,i.check=eg(i.check,x,4,0)),l=0,h=0,i.mode=4;case 4:for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=eg(i.check,x,2,0)),l=0,h=0,i.mode=5;case 5:if(1024&i.flags){for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&(x[0]=255&l,x[1]=l>>>8&255,i.check=eg(i.check,x,2,0)),l=0,h=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(f=i.length,f>a&&(f=a),f&&(i.head&&(A=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(n.subarray(s,s+f),A)),512&i.flags&&(i.check=eg(i.check,n,f,s)),a-=f,s+=f,i.length-=f),i.length))break e;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===a)break e;f=0;do{A=n[s+f++],i.head&&A&&i.length<65536&&(i.head.name+=String.fromCharCode(A))}while(A&&f<a);if(512&i.flags&&(i.check=eg(i.check,n,f,s)),a-=f,s+=f,A)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===a)break e;f=0;do{A=n[s+f++],i.head&&A&&i.length<65536&&(i.head.comment+=String.fromCharCode(A))}while(A&&f<a);if(512&i.flags&&(i.check=eg(i.check,n,f,s)),a-=f,s+=f,A)break e}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;h<16;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(l!==(65535&i.check)){e.msg="header crc mismatch",i.mode=Mg;break}l=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=Ng;break;case 10:for(;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}e.adler=i.check=Rg(l),l=0,h=0,i.mode=11;case 11:if(0===i.havedict)return e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,i.hold=l,i.bits=h,_g;e.adler=i.check=1,i.mode=Ng;case Ng:if(t===vg||t===yg)break e;case 13:if(i.last){l>>>=7&h,h-=7&h,i.mode=27;break}for(;h<3;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}switch(i.last=1&l,l>>>=1,h-=1,3&l){case 0:i.mode=14;break;case 1:if(Vg(i),i.mode=20,t===yg){l>>>=2,h-=2;break e}break;case 2:i.mode=17;break;case 3:e.msg="invalid block type",i.mode=Mg}l>>>=2,h-=2;break;case 14:for(l>>>=7&h,h-=7&h;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=Mg;break}if(i.length=65535&l,l=0,h=0,i.mode=15,t===yg)break e;case 15:i.mode=16;case 16:if(f=i.length,f){if(f>a&&(f=a),f>c&&(f=c),0===f)break e;r.set(n.subarray(s,s+f),o),a-=f,s+=f,c-=f,o+=f,i.length-=f;break}i.mode=Ng;break;case 17:for(;h<14;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(i.nlen=257+(31&l),l>>>=5,h-=5,i.ndist=1+(31&l),l>>>=5,h-=5,i.ncode=4+(15&l),l>>>=4,h-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=Mg;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;h<3;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.lens[S[i.have++]]=7&l,l>>>=3,h-=3}for(;i.have<19;)i.lens[S[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,k={bits:i.lenbits},C=bg(0,i.lens,0,19,i.lencode,0,i.work,k),i.lenbits=k.bits,C){e.msg="invalid code lengths set",i.mode=Mg;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;_=i.lencode[l&(1<<i.lenbits)-1],m=_>>>24,w=_>>>16&255,b=65535&_,!(m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(b<16)l>>>=m,h-=m,i.lens[i.have++]=b;else{if(16===b){for(I=m+2;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(l>>>=m,h-=m,0===i.have){e.msg="invalid bit length repeat",i.mode=Mg;break}A=i.lens[i.have-1],f=3+(3&l),l>>>=2,h-=2}else if(17===b){for(I=m+3;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=m,h-=m,A=0,f=3+(7&l),l>>>=3,h-=3}else{for(I=m+7;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=m,h-=m,A=0,f=11+(127&l),l>>>=7,h-=7}if(i.have+f>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=Mg;break}for(;f--;)i.lens[i.have++]=A}}if(i.mode===Mg)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=Mg;break}if(i.lenbits=9,k={bits:i.lenbits},C=bg(1,i.lens,0,i.nlen,i.lencode,0,i.work,k),i.lenbits=k.bits,C){e.msg="invalid literal/lengths set",i.mode=Mg;break}if(i.distbits=6,i.distcode=i.distdyn,k={bits:i.distbits},C=bg(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,k),i.distbits=k.bits,C){e.msg="invalid distances set",i.mode=Mg;break}if(i.mode=20,t===yg)break e;case 20:i.mode=21;case 21:if(a>=6&&c>=258){e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,i.hold=l,i.bits=h,ug(e,u),o=e.next_out,r=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,l=i.hold,h=i.bits,i.mode===Ng&&(i.back=-1);break}for(i.back=0;_=i.lencode[l&(1<<i.lenbits)-1],m=_>>>24,w=_>>>16&255,b=65535&_,!(m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(w&&!(240&w)){for(F=m,v=w,y=b;_=i.lencode[y+((l&(1<<F+v)-1)>>F)],m=_>>>24,w=_>>>16&255,b=65535&_,!(F+m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=F,h-=F,i.back+=F}if(l>>>=m,h-=m,i.back+=m,i.length=b,0===w){i.mode=26;break}if(32&w){i.back=-1,i.mode=Ng;break}if(64&w){e.msg="invalid literal/length code",i.mode=Mg;break}i.extra=15&w,i.mode=22;case 22:if(i.extra){for(I=i.extra;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;_=i.distcode[l&(1<<i.distbits)-1],m=_>>>24,w=_>>>16&255,b=65535&_,!(m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(!(240&w)){for(F=m,v=w,y=b;_=i.distcode[y+((l&(1<<F+v)-1)>>F)],m=_>>>24,w=_>>>16&255,b=65535&_,!(F+m<=h);){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}l>>>=F,h-=F,i.back+=F}if(l>>>=m,h-=m,i.back+=m,64&w){e.msg="invalid distance code",i.mode=Mg;break}i.offset=b,i.extra=15&w,i.mode=24;case 24:if(i.extra){for(I=i.extra;h<I;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=Mg;break}i.mode=25;case 25:if(0===c)break e;if(f=u-c,i.offset>f){if(f=i.offset-f,f>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=Mg;break}f>i.wnext?(f-=i.wnext,p=i.wsize-f):p=i.wnext-f,f>i.length&&(f=i.length),g=i.window}else g=r,p=o-i.offset,f=i.length;f>c&&(f=c),c-=f,i.length-=f;do{r[o++]=g[p++]}while(--f);0===i.length&&(i.mode=21);break;case 26:if(0===c)break e;r[o++]=i.length,c--,i.mode=21;break;case 27:if(i.wrap){for(;h<32;){if(0===a)break e;a--,l|=n[s++]<<h,h+=8}if(u-=c,e.total_out+=u,i.total+=u,u&&(e.adler=i.check=i.flags?eg(i.check,r,u,o-u):Zp(i.check,r,u,o-u)),u=c,(i.flags?l:Rg(l))!==i.check){e.msg="incorrect data check",i.mode=Mg;break}l=0,h=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;h<32;){if(0===a)break e;a--,l+=n[s++]<<h,h+=8}if(l!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=Mg;break}l=0,h=0}i.mode=29;case 29:C=Cg;break e;case Mg:C=kg;break e;case 31:return Ig;default:return xg}return e.next_out=o,e.avail_out=c,e.next_in=s,e.avail_in=a,i.hold=l,i.bits=h,(i.wsize||u!==e.avail_out&&i.mode<Mg&&(i.mode<27||t!==Fg))&&qg(e,e.output,e.next_out,u-e.avail_out),d-=e.avail_in,u-=e.avail_out,e.total_in+=d,e.total_out+=u,i.total+=u,i.wrap&&u&&(e.adler=i.check=i.flags?eg(i.check,r,u,e.next_out-u):Zp(i.check,r,u,e.next_out-u)),e.data_type=i.bits+(i.last?64:0)+(i.mode===Ng?128:0)+(20===i.mode||15===i.mode?256:0),(0===d&&0===u||t===Fg)&&C===Ag&&(C=Sg),C},inflateEnd:e=>{if(!e||!e.state)return xg;let t=e.state;return t.window&&(t.window=null),e.state=null,Ag},inflateGetHeader:(e,t)=>{if(!e||!e.state)return xg;const i=e.state;return 2&i.wrap?(i.head=t,t.done=!1,Ag):xg},inflateSetDictionary:(e,t)=>{const i=t.length;let n,r,s;return e&&e.state?(n=e.state,0!==n.wrap&&11!==n.mode?xg:11===n.mode&&(r=1,r=Zp(r,t,i,0),r!==n.check)?kg:(s=qg(e,t,i,i),s?(n.mode=31,Ig):(n.havedict=1,Ag))):xg},inflateInfo:"pako inflate (from Nodeca project)"};var Ug=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},jg=Object.prototype.toString,{Z_NO_FLUSH:Gg,Z_FINISH:Wg,Z_OK:$g,Z_STREAM_END:Kg,Z_NEED_DICT:Yg,Z_STREAM_ERROR:Xg,Z_DATA_ERROR:Zg,Z_MEM_ERROR:Jg}=ig;function em(e){this.options=rg({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dg,this.strm.avail_out=0;let i=Qg.inflateInit2(this.strm,t.windowBits);if(i!==$g)throw new Error(tg[i]);if(this.header=new Ug,Qg.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=cg(t.dictionary):"[object ArrayBuffer]"===jg.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=Qg.inflateSetDictionary(this.strm,t.dictionary),i!==$g)))throw new Error(tg[i])}function tm(e,t){const i=new em(t);if(i.push(e),i.err)throw i.msg||tg[i.err];return i.result}em.prototype.push=function(e,t){const i=this.strm,n=this.options.chunkSize,r=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Wg:Gg,"[object ArrayBuffer]"===jg.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(n),i.next_out=0,i.avail_out=n),s=Qg.inflate(i,o),s===Yg&&r&&(s=Qg.inflateSetDictionary(i,r),s===$g?s=Qg.inflate(i,o):s===Zg&&(s=Yg));i.avail_in>0&&s===Kg&&i.state.wrap>0&&0!==e[i.next_in];)Qg.inflateReset(i),s=Qg.inflate(i,o);switch(s){case Xg:case Zg:case Yg:case Jg:return this.onEnd(s),this.ended=!0,!1}if(a=i.avail_out,i.next_out&&(0===i.avail_out||s===Kg))if("string"===this.options.to){let e=hg(i.output,i.next_out),t=i.next_out-e,r=lg(i.output,e);i.next_out=t,i.avail_out=n-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(r)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(s!==$g||0!==a){if(s===Kg)return s=Qg.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},em.prototype.onData=function(e){this.chunks.push(e)},em.prototype.onEnd=function(e){e===$g&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=sg(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var im=function(e,t){return(t=t||{}).raw=!0,tm(e,t)},nm={Inflate:em,inflate:tm,inflateRaw:im,ungzip:tm,constants:ig},{Inflate:rm,inflate:sm,inflateRaw:om,ungzip:am}=nm,cm=sm,lm=am;var hm=new Map([[1,function(e,t){let i=new Uint8Array(e);return cm(i).buffer}],[2,function(e,t){let i=e.byteLength,n=new Uint8Array(i),r=Math.floor(i/t),s=new DataView(e);for(var o=0;o<t;o++)for(var a=0;a<r;a++)n[o+a*t]=s.getUint8(o*r+a);return n.buffer}],[3,function(e,t){return function(e){for(var t=e.byteLength%2!=0,i=e.byteLength-4,n=new DataView(e),r=0,s=0,o=0;o<i-1;o+=2){s=(s+(r=(r+n.getUint16(o,!0))%65535))%65535}if(t){s=(s+(r=(r+n.getUint8(i-1))%65535))%65535}var[a,c]=Bp.unpack_from(">HH",e,i);if(c%=65535,r!=(a%=65535)||s!=c)throw'ValueError("fletcher32 checksum invalid")'}(e),e.slice(0,-4)}]]),dm=class{constructor(e,t){this.fh=e,this.offset=t,this.depth=null}async init(){this.all_nodes=new Map,await this._read_root_node(),await this._read_children()}async _read_children(){let e=this.depth;for(;e>0;){for(var t of this.all_nodes.get(e))for(var i of t.get("addresses"))this._add_node(await this._read_node(i,e-1));e--}}async _read_root_node(){let e=await this._read_node(this.offset,null);this._add_node(e),this.depth=e.get("node_level")}_add_node(e){let t=e.get("node_level");this.all_nodes.has(t)?this.all_nodes.get(t).push(e):this.all_nodes.set(t,[e])}async _read_node(e,t){let i=await this._read_node_header(e,t);return i.set("keys",[]),i.set("addresses",[]),i}async _read_node_header(e){throw"NotImplementedError: must define _read_node_header in implementation class"}},um=class extends dm{constructor(){super(...arguments),xp(this,"B_LINK_NODE",new Map([["signature","4s"],["node_type","B"],["node_level","B"],["entries_used","H"],["left_sibling","Q"],["right_sibling","Q"]]))}async _read_node_header(e,t){let i=await kp(this.B_LINK_NODE,this.fh,e);if(null!=t&&i.get("node_level")!=t)throw"node level does not match";return i}},fm=class extends um{constructor(e,t){super(e,t),xp(this,"NODE_TYPE",0),this.ready=this.init()}async _read_node(e,t){let i=await this._read_node_header(e,t);e+=Ep(this.B_LINK_NODE);let n=[],r=[],s=i.get("entries_used");for(var o=0;o<s;o++){let t=(await Bp.unpack_from_async("<Q",this.fh,e))[0];e+=8;let i=(await Bp.unpack_from_async("<Q",this.fh,e))[0];e+=8,n.push(t),r.push(i)}return n.push((await Bp.unpack_from_async("<Q",this.fh,e))[0]),i.set("keys",n),i.set("addresses",r),i}symbol_table_addresses(){var e=[],t=this.all_nodes.get(0);for(var i of t)e=e.concat(i.get("addresses"));return e}},pm=class extends um{constructor(e,t,i){super(e,t),xp(this,"NODE_TYPE",1),this.dims=i,this.ready=this.init()}async _read_node(e,t){let i=await this._read_node_header(e,t);e+=Ep(this.B_LINK_NODE);var n=[],r=[];let s=i.get("entries_used");for(var o=0;o<s;o++){let[t,i]=await Bp.unpack_from_async("<II",this.fh,e);e+=8;let s="<"+this.dims.toFixed()+"Q",o=Bp.calcsize(s),a=await Bp.unpack_from_async(s,this.fh,e);e+=o;let c=(await Bp.unpack_from_async("<Q",this.fh,e))[0];e+=8,n.push(new Map([["chunk_size",t],["filter_mask",i],["chunk_offset",a]])),r.push(c)}return i.set("keys",n),i.set("addresses",r),i}async construct_data_from_chunks(e,t,i,n){var r,s,o;if(i instanceof Array){let e=i[0];if("REFERENCE"==e){if(8!=i[1])throw"NotImplementedError('Unsupported Reference type')";i="<u8",r="getUint64",s=!1,o=8}else{if("VLEN_STRING"!=e&&"VLEN_SEQUENCE"!=e)throw"NotImplementedError('datatype not implemented')";r="getVLENStruct",s=!1,o=16}}else[r,s,o]=Rp(i);var a=t.reduce((function(e,t){return e*t}),1),c=e.reduce((function(e,t){return e*t}),1);let l=t.length;var h=1;e.slice().map((function(e){let t=h;return h*=e,t}));h=1;var d=t.slice().reverse().map((function(e){let t=h;return h*=e,t})).reverse(),u=new Array(a);let f=c*o;for(var p of this.all_nodes.get(0)){let i=p.get("keys"),a=p.get("addresses"),h=i.length;for(var g=0;g<h;g++){let h=i[g],p=a[g];var m;if(null==n)m=await this.fh.slice(p,p+f);else{m=await this.fh.slice(p,p+h.get("chunk_size"));let e=h.get("filter_mask");m=this._filter_chunk(m,e,n,o)}for(var w=h.get("chunk_offset").slice(),b=w.slice(),F=b.map((function(){return 0})),v=new Dp(m),y=0;y<c;y++){for(var A=l-1;A>=0&&F[A]>=e[A];A--)F[A]=0,b[A]=w[A],A>0&&(F[A-1]+=1,b[A-1]+=1);if(b.slice(0,-1).every((function(e,i){return e<t[i]}))){let e=y*o,t=v[r](e,!s,o),i=b.slice(0,-1).reduce((function(e,t,i){return t*d[i]+e}),0);u[i]=t}F[l-1]+=1,b[l-1]+=1}}}return u}_filter_chunk(e,t,i,n){let r=i.length,s=e.slice();for(var o=r-1;o>=0;o--){if(t&1<<o)continue;let e=i[o],r=e.get("filter_id"),a=e.get("client_data");if(!hm.has(r))throw'NotImplementedError("Filter with id:'+r.toFixed()+' not supported")';s=hm.get(r)(s,n,a)}return s}},gm=class extends dm{constructor(e,t){super(e,t),xp(this,"B_TREE_HEADER",new Map([["signature","4s"],["version","B"],["node_type","B"],["node_size","I"],["record_size","H"],["depth","H"],["split_percent","B"],["merge_percent","B"],["root_address","Q"],["root_nrecords","H"],["total_nrecords","Q"]])),xp(this,"B_LINK_NODE",new Map([["signature","4s"],["version","B"],["node_type","B"]])),this.ready=this.init()}async _read_root_node(){let e=await this._read_tree_header(this.offset);this.address_formats=this._calculate_address_formats(e),this.header=e,this.depth=e.get("depth");let t=[e.get("root_address"),e.get("root_nrecords"),e.get("total_nrecords")],i=await this._read_node(t,this.depth);this._add_node(i)}async _read_tree_header(e){return await kp(this.B_TREE_HEADER,this.fh,this.offset)}_calculate_address_formats(e){let t=e.get("node_size"),i=e.get("record_size"),n=0,r=0,s=new Map,o=e.get("depth");for(var a=0;a<=o;a++){let e,c,l,h="",d="",u="";if(0==a?(e=0,c=0,l=0):1==a?(e=8,h="<Q",c=this._required_bytes(n),d=this._int_format(c),l=0):(e=8,h="<Q",c=this._required_bytes(n),d=this._int_format(c),l=this._required_bytes(r),u=this._int_format(l)),s.set(a,[e,c,l,h,d,u]),a<o){let s=e+c+l;n=this._nrecords_max(t,i,s),r>0?r*=n:r=n}}return s}_nrecords_max(e,t,i){return Math.floor((e-10-i)/(t+i))}_required_bytes(e){return Math.ceil(Tp(e)/8)}_int_format(e){return["<B","<H","<I","<Q"][e-1]}async _read_node(e,t){let[i,n,r]=e,s=this._read_node_header(i,t);i+=Ep(this.B_LINK_NODE);let o=this.header.get("record_size"),a=[];for(let e=0;e<n;e++){let e=await this._parse_record(this.fh,i,o);i+=o,a.push(e)}let c=[],l=this.address_formats.get(t);if(0!=t){let[e,t,r,s,o,a]=l;for(let l=0;l<=n;l++){let n=(await Bp.unpack_from_async(s,this.fh,i))[0];i+=e;let l=(await Bp.unpack_from_async(o,this.fh,i))[0];i+=t;let h=l;r>0&&(h=(await Bp.unpack_from_async(a,this.fh,i))[0],i+=r),c.push([n,l,h])}}return s.set("keys",a),s.set("addresses",c),s}async _read_node_header(e,t){let i=await kp(this.B_LINK_NODE,this.fh,e);return i.set("node_level",t),i}*iter_records(){for(let e of this.all_nodes.values())for(let t of e)for(let e of t.get("keys"))yield e}_parse_record(e){throw"NotImplementedError"}},mm=class extends gm{constructor(){super(...arguments),xp(this,"NODE_TYPE",5)}async _parse_record(e,t,i){let n=(await Bp.unpack_from_async("<I",e,t))[0];t+=4;const r=await e.slice(t,t+7);return new Map([["namehash",n],["heapid",r]])}},wm=class extends gm{constructor(){super(...arguments),xp(this,"NODE_TYPE",6)}async _parse_record(e,t,i){let n=(await Bp.unpack_from_async("<Q",e,t))[0];t+=8;const r=await e.slice(t,t+7);return new Map([["creationorder",n],["heapid",r]])}},bm=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=await Bp.unpack_from_async("<B",e,t+8);var n;if(0==i)n=await kp(xm,e,t),this._end_of_sblock=t+km;else{if(2!=i&&3!=i)throw"unsupported superblock version: "+i.toFixed();n=await kp(Im,e,t),this._end_of_sblock=t+Sm}if(n.get("format_signature")!=Cm)throw"Incorrect file signature: "+n.get("format_signature");if(8!=n.get("offset_size")||8!=n.get("length_size"))throw"File uses non-64-bit addressing";this.version=n.get("superblock_version"),this._contents=n,this._root_symbol_table=null,this._fh=e}async get_offset_to_dataobjects(){if(0==this.version){var e=new vm(this._fh,this._end_of_sblock,!0);return await e.ready,this._root_symbol_table=e,e.group_offset}if(2==this.version||3==this.version)return this._contents.get("root_group_address");throw"Not implemented version = "+this.version.toFixed()}},Fm=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=await kp(Bm,e,t);Sp("HEAP"==i.get("signature")),Sp(0==i.get("version"));let n=i.get("address_of_data_segment"),r=await e.slice(n,n+i.get("data_segment_size"));i.set("heap_data",r),this._contents=i,this.data=r}get_object_name(e){let t=new Uint8Array(this.data).indexOf(0,e)-e;return Bp.unpack_from("<"+t.toFixed()+"s",this.data,e)[0]}},vm=class{constructor(e,t,i=!1){this.ready=this.init(e,t,i)}async init(e,t,i){var n;if(i)n=new Map([["symbols",1]]);else{if("SNOD"!=(n=await kp(Mm,e,t)).get("signature"))throw"incorrect node type";t+=Rm}for(var r=[],s=n.get("symbols"),o=0;o<s;o++)r.push(await kp(Em,e,t)),t+=Nm;return i&&(this.group_offset=r[0].get("object_header_address")),this.entries=r,this._contents=n,this}assign_name(e){this.entries.forEach((function(t){let i=t.get("link_name_offset"),n=e.get_object_name(i);t.set("link_name",n)}))}get_links(e){var t={};return this.entries.forEach((function(i){let n=i.get("cache_type"),r=i.get("link_name");if(0==n||1==n)t[r]=i.get("object_header_address");else if(2==n){let n=i.get("scratch"),o=new ArrayBuffer(4),a=new Uint8Array(o);for(var s=0;s<4;s++)a[s]=n.charCodeAt(s);let c=Bp.unpack_from("<I",o,0)[0];t[r]=e.get_object_name(c)}})),t}},ym=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=await kp(Dm,e,t);t+=Tm;let n=i.get("collection_size")-Tm,r=await e.slice(t,t+n);this.heap_data=r,this._header=i,this._objects=null}get objects(){if(null==this._objects){this._objects=new Map;for(var e=0;e<=this.heap_data.byteLength-Lm;){let t=Ip(zm,this.heap_data,e);if(0==t.get("object_index"))break;e+=Lm;let i=this.heap_data.slice(e,e+t.get("object_size"));this._objects.set(t.get("object_index"),i),e+=Np(t.get("object_size"))}}return this._objects}},Am=class{constructor(e,t){this.fh=e,this.ready=this.init(t)}async init(e){let t=await kp(Hm,this.fh,e);if(e+=Ep(Hm),Sp("FRHP"==t.get("signature")),Sp(0==t.get("version")),t.get("filter_info_size")>0)throw"Filter info size not supported on FractalHeap";if(t.get("btree_address_huge_objects")!=_m)throw"Huge objects not implemented in FractalHeap";t.set("btree_address_huge_objects",null),t.get("root_block_address")==_m&&t.set("root_block_address",null);let i=t.get("log2_maximum_heap_size"),n=this._min_size_nbits(i),r=new Map([["signature","4s"],["version","B"],["heap_header_adddress","Q"],["block_offset",`${n}B`]]);this.indirect_block_header=new Map(r),this.indirect_block_header_size=Ep(r),2&~t.get("flags")||r.set("checksum","I"),this.direct_block_header=r,this.direct_block_header_size=Ep(r);let s=t.get("maximum_direct_block_size");this._managed_object_offset_size=this._min_size_nbits(i);let o=Math.min(s,t.get("max_managed_object_size"));this._managed_object_length_size=this._min_size_integer(o);let a=t.get("starting_block_size"),c=t.get("table_width");if(!(a>0))throw"Starting block size == 0 not implemented";let l=Number(Math.floor(Math.log2(s)));Sp(1n<<BigInt(l)==s);let h=Number(Math.floor(Math.log2(a)));Sp(1n<<BigInt(h)==a),this._max_direct_nrows=l-h+2;let d=Math.floor(Math.log2(c));Sp(1<<d==c),this._indirect_nrows_sub=d+h-1,this.header=t,this.nobjects=t.get("managed_object_count")+t.get("huge_object_count")+t.get("tiny_object_count");let u=[],f=t.get("root_block_address"),p=0;if(null!=f&&(p=t.get("indirect_current_rows_count")),p>0)for await(let e of this._iter_indirect_block(this.fh,f,p))u.push(e);else{let e=await this._read_direct_block(this.fh,f,a);u.push(e)}let g=u.reduce(((e,t)=>e+t.byteLength),0),m=new Uint8Array(g),w=0;u.forEach((e=>{m.set(new Uint8Array(e),w),w+=e.byteLength})),this.managed=m.buffer}async _read_direct_block(e,t,i){let n=await e.slice(t,t+i);return Sp("FHDB"==Ip(this.direct_block_header,n).get("signature")),n}get_data(e){let t=Bp.unpack_from("<B",e,0)[0],i=t>>4&3,n=1;if(0==i){Sp(0==t>>6);let i=this._managed_object_offset_size,r=zp(i,e,n);n+=i,i=this._managed_object_length_size;let s=zp(i,e,n);return this.managed.slice(r,r+s)}throw 1==i?"tiny objectID not supported in FractalHeap":2==i?"huge objectID not supported in FractalHeap":"unknown objectID type in FractalHeap"}_min_size_integer(e){return this._min_size_nbits(Tp(e))}_min_size_nbits(e){return Math.ceil(e/8)}async*_iter_indirect_block(e,t,i){let n=await kp(this.indirect_block_header,e,t);t+=this.indirect_block_header_size,Sp("FHIB"==n.get("signature"));let r=n.get("block_offset").reduce(((e,t,i)=>e+(t<<8*i)),0);n.set("block_offset",r);let[s,o]=this._indirect_info(i),a=[];for(let i=0;i<s;i++){let n=(await Bp.unpack_from_async("<Q",e,t))[0];if(t+=8,n==_m)break;let r=this._calc_block_size(i);a.push([n,r])}let c=[];for(let i=s;i<s+o;i++){let n=(await Bp.unpack_from_async("<Q",e,t))[0];if(t+=8,n==_m)break;let r=this._calc_block_size(i),s=this._iblock_nrows_from_block_size(r);c.push([n,s])}for(let[t,i]of a){let n=await this._read_direct_block(e,t,i);yield n}for(let[t,i]of c)for await(let n of this._iter_indirect_block(e,t,i))yield n}_calc_block_size(e){let t=Math.floor(e/this.header.get("table_width"));return 2**Math.max(t-1,0)*this.header.get("starting_block_size")}_iblock_nrows_from_block_size(e){let t=Math.floor(Math.log2(e));return Sp(2**t==e),t-this._indirect_nrows_sub}_indirect_info(e){let t,i,n=this.header.get("table_width"),r=e*n,s=this._max_direct_nrows*n;return e<=s?(t=r,i=0):(t=s,i=r-s),[t,i]}_int_format(e){return["B","H","I","Q"][e-1]}},Cm=Bp.unpack_from("8s",new Uint8Array([137,72,68,70,13,10,26,10]).buffer)[0],_m=Bp.unpack_from("<Q",new Uint8Array([255,255,255,255,255,255,255,255]).buffer)[0],xm=new Map([["format_signature","8s"],["superblock_version","B"],["free_storage_version","B"],["root_group_version","B"],["reserved_0","B"],["shared_header_version","B"],["offset_size","B"],["length_size","B"],["reserved_1","B"],["group_leaf_node_k","H"],["group_internal_node_k","H"],["file_consistency_flags","L"],["base_address_lower","Q"],["free_space_address","Q"],["end_of_file_address","Q"],["driver_information_address","Q"]]),km=Ep(xm),Im=new Map([["format_signature","8s"],["superblock_version","B"],["offset_size","B"],["length_size","B"],["file_consistency_flags","B"],["base_address","Q"],["superblock_extension_address","Q"],["end_of_file_address","Q"],["root_group_address","Q"],["superblock_checksum","I"]]),Sm=Ep(Im),Em=new Map([["link_name_offset","Q"],["object_header_address","Q"],["cache_type","I"],["reserved","I"],["scratch","16s"]]),Nm=Ep(Em),Mm=new Map([["signature","4s"],["version","B"],["reserved_0","B"],["symbols","H"]]),Rm=Ep(Mm),Bm=new Map([["signature","4s"],["version","B"],["reserved","3s"],["data_segment_size","Q"],["offset_to_free_list","Q"],["address_of_data_segment","Q"]]),Dm=new Map([["signature","4s"],["version","B"],["reserved","3s"],["collection_size","Q"]]),Tm=Ep(Dm),zm=new Map([["object_index","H"],["reference_count","H"],["reserved","I"],["object_size","Q"]]),Lm=Ep(zm),Hm=new Map([["signature","4s"],["version","B"],["object_index_size","H"],["filter_info_size","H"],["flags","B"],["max_managed_object_size","I"],["next_huge_object_index","Q"],["btree_address_huge_objects","Q"],["managed_freespace_size","Q"],["freespace_manager_address","Q"],["managed_space_size","Q"],["managed_alloc_size","Q"],["next_directblock_iterator_address","Q"],["managed_object_count","Q"],["huge_objects_total_size","Q"],["huge_object_count","Q"],["tiny_objects_total_size","Q"],["tiny_object_count","Q"],["table_width","H"],["starting_block_size","Q"],["maximum_direct_block_size","Q"],["log2_maximum_heap_size","H"],["indirect_starting_rows_count","H"],["root_block_address","Q"],["indirect_current_rows_count","H"]]),Pm=class{constructor(e,t){this.ready=this.init(e,t)}async init(e,t){let i=(await Bp.unpack_from_async("<B",e,t))[0];if(1==i)var[n,r,s]=await this._parse_v1_objects(e,t);else{if(i!="O".charCodeAt(0))throw"InvalidHDF5File('unknown Data Object Header')";var[n,r,s]=await this._parse_v2_objects(e,t)}this.fh=e,this.msgs=n,this.msg_data=r,this.offset=t,this._global_heaps={},this._header=s,this._filter_pipeline=null,this._chunk_params_set=!1,this._chunks=null,this._chunk_dims=null,this._chunk_address=null}get dtype(){let e=this.find_msg_type(fw)[0].get("offset_to_message");return new Lp(this.fh,e).dtype}get chunks(){return this._get_chunk_params().then((()=>this._chunks))}get shape(){let e=this.find_msg_type(dw)[0].get("offset_to_message");return async function(e,t){let i=(await Bp.unpack_from_async("<B",e,t))[0];var n;if(1==i)Sp(1==(n=await kp($m,e,t)).get("version")),t+=Km;else{if(2!=i)throw"InvalidHDF5File('unknown dataspace message version')";Sp(2==(n=await kp(Ym,e,t)).get("version")),t+=Xm}let r=n.get("dimensionality");return(await Bp.unpack_from_async("<"+(2*r).toFixed()+"I",e,t)).filter((function(e,t){return t%2==0}))}(this.fh,e)}async get_filter_pipeline(){if(null!=this._filter_pipeline)return this._filter_pipeline;let e=this.find_msg_type(ww);if(!e.length)return this._filter_pipeline=null,this._filter_pipeline;var t=e[0].get("offset_to_message");let[i,n]=await Bp.unpack_from_async("<BB",this.fh,t);t+=Bp.calcsize("<BB");var r=[];if(1==i){await Bp.unpack_from_async("<HI",this.fh,t),t+=Bp.calcsize("<HI");for(var s=0;s<n;s++){let e=await kp(lw,this.fh,t);t+=hw;let i=Np(e.get("name_length"),8),n="<"+i.toFixed()+"s",s=(await Bp.unpack_from_async(n,this.fh,t))[0];e.set("filter_name",s),t+=i,n="<"+e.get("client_data_values").toFixed()+"I";let o=await Bp.unpack_from_async(n,this.fh,t);e.set("client_data",o),t+=4*e.get("client_data_values"),e.get("client_data_values")%2&&(t+=4),r.push(e)}}else{if(2!=i)throw`version ${i} is not supported`;for(let e=0;e<n;e++){let e=new Map,i=this.fh,n=(await Bp.unpack_from_async("<H",i,t))[0];t+=2,e.set("filter_id",n);let s=0;n>255&&(s=(await Bp.unpack_from_async("<H",i,t))[0],t+=2);let o=(await Bp.unpack_from_async("<H",i,t))[0];t+=2;let a=(1&o)>0;e.set("optional",a);let c,l=(await Bp.unpack_from_async("<H",i,t))[0];t+=2,s>0&&(c=(await Bp.unpack_from_async(`${s}s`,i,t))[0],t+=s),e.set("name",c);let h=await Bp.unpack_from_async(`<${l}i`,i,t);t+=4*l,e.set("client_data_values",h),r.push(e)}}return this._filter_pipeline=r,this._filter_pipeline}find_msg_type(e){return this.msgs.filter((function(t){return t.get("type")==e}))}async get_attributes(){let e={},t=this.find_msg_type(bw);for(let i of t){let t=i.get("offset_to_message"),[n,r]=await this.unpack_attribute(t);e[n]=r}return e}async get_fillvalue(){var e,t=this.find_msg_type(pw)[0].get("offset_to_message");let i=(await Bp.unpack_from_async("<B",this.fh,t))[0];var n,r,s;if(1==i||2==i)n=await kp(sw,this.fh,t),t+=ow,e=n.get("fillvalue_defined");else{if(3!=i)throw'InvalidHDF5File("Unknown fillvalue msg version: "'+String(i);n=await kp(aw,this.fh,t),t+=cw,e=32&n.get("flags")}if(e?(r=(await Bp.unpack_from_async("<I",this.fh,t))[0],t+=4):r=0,r){let[e,i,n]=Rp(await this.dtype);s=new Dp(await this.fh.slice(t,t+n))[e](t,!i,n)}else s=0;return s}async unpack_attribute(e){let t=(await Bp.unpack_from_async("<B",this.fh,e))[0];var i,n;if(1==t)Sp(1==(i=await kp(qm,this.fh,e)).get("version")),e+=Qm,n=8;else{if(3!=t)throw"unsupported attribute message version: "+t;Sp(3==(i=await kp(Um,this.fh,e)).get("version")),e+=jm,n=1}let r=i.get("name_size"),s=(await Bp.unpack_from_async("<"+r.toFixed()+"s",this.fh,e))[0];var o;s=s.replace(/\x00$/,""),e+=Np(r,n);try{o=await new Lp(this.fh,e).dtype}catch(e){return console.warn("Attribute "+s+" type not implemented, set to null."),[s,null]}e+=Np(i.get("datatype_size"),n);let a=await this.determine_data_shape(this.fh,e),c=a.reduce((function(e,t){return e*t}),1);if(e+=Np(i.get("dataspace_size"),n),5===o.datatype_class)l=await this.fh.slice(e,e+o.size);else{var l=await this._attr_value(o,this.fh,c,e);0==a.length&&(l=l[0])}return[s,l]}async determine_data_shape(e,t){let i=(await Bp.unpack_from_async("<B",e,t))[0];var n;if(1==i)Sp(1==(n=await kp($m,e,t)).get("version")),t+=Km;else{if(2!=i)throw"unknown dataspace message version";Sp(2==(n=await kp(Ym,e,t)).get("version")),t+=Xm}let r=n.get("dimensionality");return await Bp.unpack_from_async("<"+r.toFixed()+"Q",e,t)}async _attr_value(e,t,i,n){var r=new Array(i);if(e instanceof Array){let l=e[0];for(var s=0;s<i;s++)if("VLEN_STRING"==l){let i=e[2];var[o,a]=await this._vlen_size_and_data(t,n);const c=new TextDecoder(0==i?"ascii":"utf-8");r[s]=c.decode(a),n+=16}else if("REFERENCE"==l){var c=await Bp.unpack_from_async("<Q",t,n);r[s]=c,n+=8}else{if("VLEN_SEQUENCE"!=l)throw"NotImplementedError";{let i=e[1];var[o,a]=this._vlen_size_and_data(t,n);r[s]=this._attr_value(i,a,o,0),n+=16}}}else{let[o,a,c]=Rp(e);const l=await t.slice(n,n+i*c);let h=new Dp(l,0),d=0;for(s=0;s<i;s++)r[s]=h[o](d,!a,c),d+=c}return r}async _vlen_size_and_data(e,t){let i=(await Bp.unpack_from_async("<I",e,t))[0],n=await kp(Vm,e,t+4),r=n.get("collection_address");var s;return Sp(n.get("collection_address")<Number.MAX_SAFE_INTEGER),r in this._global_heaps||(s=new ym(this.fh,r),await s.ready,this._global_heaps[r]=s),[i,(s=this._global_heaps[r]).objects.get(n.get("object_index"))]}async _parse_v1_objects(e,t){let i=await kp(Gm,e,t);Sp(1==i.get("version"));let n=i.get("total_header_messages");for(var r=i.get("object_header_size"),s=t+Ep(Gm),o=await e.slice(s,s+r),a=[[s,r]],c=0,l=0,h=new Array(n),d=0;d<n;d++){l>=r&&([s,r]=a[++c],l=0);let t=await kp(Zm,e,s+l),i=s+l+Jm;if(t.set("offset_to_message",i),t.get("type")==Fw){var[u,f]=await Bp.unpack_from_async("<QQ",e,i);a.push([u,f])}l+=Jm+t.get("size"),h[d]=t}return[h,o,i]}async _parse_v2_objects(e,t){var[i,n,r]=await this._parse_v2_header(e,t);t=r;for(var s=[],o=i.get("size_of_chunk_0"),a=e.slice(t,t+=o),c=[[r,o]],l=0,h=0;;){if(h>=o-tw){let e=c[++l];if(null==e)break;[r,o]=e,h=0}let t=await kp(ew,e,r+h),i=r+h+tw+n;if(t.set("offset_to_message",i),t.get("type")==Fw){var[d,u]=await Bp.unpack_from_async("<QQ",e,i);c.push([d+4,u-4])}h+=tw+t.get("size")+n,s.push(t)}return[s,a,i]}async _parse_v2_header(e,t){let i=await kp(Wm,e,t);var n;if(t+=Ep(Wm),Sp(2==i.get("version")),n=4&i.get("flags")?2:0,Sp(!(16&i.get("flags"))),32&i.get("flags")){let n=await Bp.unpack_from_async("<4I",e,t);t+=16,i.set("access_time",n[0]),i.set("modification_time",n[1]),i.set("change_time",n[2]),i.set("birth_time",n[3])}let r=["<B","<H","<I","<Q"][3&i.get("flags")];return i.set("size_of_chunk_0",(await Bp.unpack_from_async(r,e,t))[0]),[i,n,t+=Bp.calcsize(r)]}async find_link(e){if(this._links){for(link of this._links)if(e===link[0])return link}else{const t=[];for await(const i of this.iter_links()){if(e===i[0])return i;t.push(i)}this._links=t}}async get_links(){const e=[];for await(const t of this.iter_links())e.push(t);return Object.fromEntries(e)}async*iter_links(){for(let e of this.msgs)e.get("type")==vw?yield*this._iter_links_from_symbol_tables(e):e.get("type")==gw?yield this._get_link_from_link_msg(e):e.get("type")==uw&&(yield*this._iter_link_from_link_info_msg(e))}async*_iter_links_from_symbol_tables(e){Sp(16==e.get("size"));let t=await kp(iw,this.fh,e.get("offset_to_message"));yield*this._iter_links_btree_v1(t.get("btree_address"),t.get("heap_address"))}async*_iter_links_btree_v1(e,t){let i=new fm(this.fh,e);await i.ready;let n=new Fm(this.fh,t);await n.ready;for(let e of i.symbol_table_addresses()){let t=new vm(this.fh,e);await t.ready,t.assign_name(n),yield*Object.entries(t.get_links(n))}}async _get_link_from_link_msg(e){let t=e.get("offset_to_message");return await this._decode_link_msg(this.fh,t)[1]}async _decode_link_msg(e,t){let[i,n]=await Bp.unpack_from_async("<BB",e,t);t+=2,Sp(1==i);let r,s,o=2**(3&n),a=(16&n)>0,c=(4&n)>0;(8&n)>0?(r=(await Bp.unpack_from_async("<B",e,t))[0],t+=1):r=0,Sp([0,1].includes(r)),c&&(s=(await Bp.unpack_from_async("<Q",e,t))[0],t+=8);let l=0;a&&(l=(await Bp.unpack_from_async("<B",e,t))[0],t+=1);let h=0==l?"ascii":"utf-8",d=["<B","<H","<I","<Q"][3&n],u=(await Bp.unpack_from_async(d,e,t))[0];t+=o;let f,p=new TextDecoder(h).decode(await e.slice(t,t+u));if(t+=u,0==r)f=(await Bp.unpack_from_async("<Q",e,t))[0];else if(1==r){let i=(await Bp.unpack_from_async("<H",e,t))[0];t+=2,f=new TextDecoder(h).decode(await e.slice(t,t+i))}return[s,[p,f]]}async*_iter_link_from_link_info_msg(e){let t=e.get("offset_to_message"),i=await this._decode_link_info_msg(this.fh,t),n=i.get("heap_address"),r=i.get("name_btree_address"),s=i.get("order_btree_address");null!=r&&(yield*this._iter_links_btree_v2(r,s,n))}async*_iter_links_btree_v2(e,t,i){let n,r=new Am(this.fh,i);await r.ready;const s=null!=t;s?(n=new wm(this.fh,t),await n.ready):(n=new mm(this.fh,e),await n.ready);let o=new Map;for(let e of n.iter_records()){let t=r.get_data(e.get("heapid")),[i,n]=await this._decode_link_msg(t,0);const a=s?i:n[0];o.set(a,n)}let a=Array.from(o.keys()).sort();for(let e of a)yield o.get(e)}async _decode_link_info_msg(e,t){let[i,n]=await Bp.unpack_from_async("<BB",e,t);Sp(0==i),t+=2,(1&n)>0&&(t+=8);let r=(2&n)>0?rw:nw,s=await kp(r,e,t),o=new Map;for(let[e,t]of s.entries())o.set(e,t==Om?null:t);return o}get is_dataset(){return this.find_msg_type(dw).length>0}async get_data(){let e=this.find_msg_type(mw)[0].get("offset_to_message");var[t,i,n,r]=await this._get_data_message_properties(e);if(0==n)throw"Compact storage of DataObject not implemented";return 1==n?this._get_contiguous_data(r):2==n?this._get_chunked_data(e):void 0}async _get_data_message_properties(e){let t,i,n,[r,s,o]=await Bp.unpack_from_async("<BBB",this.fh,e);return 1==r||2==r?(t=s,i=o,n=e,n+=Bp.calcsize("<BBB"),n+=Bp.calcsize("<BI"),Sp(1==i||2==i)):3!=r&&4!=r||(i=s,n=e,n+=Bp.calcsize("<BB")),Sp(r>=1&&r<=4),[r,t,i,n]}async _get_contiguous_data(e){let[t]=await Bp.unpack_from_async("<Q",this.fh,e);const i=await this.shape,n=await this.dtype;if(t==Om){let e=i.reduce((function(e,t){return e*t}),1);return new Array(e)}var r=i.reduce((function(e,t){return e*t}),1);if(n instanceof Array){let e=n[0];if("REFERENCE"==e){if(8!=n[1])throw"NotImplementedError('Unsupported Reference type')";return await this.fh.slice(t,t+r)}if("VLEN_STRING"==e){let e=n[2];const i=new TextDecoder(0==e?"ascii":"utf-8");var s=[];for(o=0;o<r;o++){const[e,n]=await this._vlen_size_and_data(this.fh,t);s[o]=i.decode(n),t+=16}return s}throw"NotImplementedError('datatype not implemented')"}if(/[<>=!@\|]?(i|u|f|S)(\d*)/.test(n)){let[e,i,s]=Rp(n),a=new Array(r);const c=await this.fh.slice(t,t+s*r);let l=new Dp(c);for(var o=0;o<r;o++)a[o]=l[e](o*s,!i,s);return a}if(5===n.datatype_class)return this.fh.slice(t,t+n.size);throw"not Implemented - no proper dtype defined"}async _get_chunked_data(e){if(await this._get_chunk_params(),this._chunk_address==Om)return[];var t=new pm(this.fh,this._chunk_address,this._chunk_dims);await t.ready;const i=await this.dtype,n=await this.shape,r=await this.chunks,s=await this.get_filter_pipeline();let o=await t.construct_data_from_chunks(r,n,i,s);if(i instanceof Array&&/^VLEN/.test(i[0])){let e=i[0];for(var a=0;a<o.length;a++){let[t,n,r]=o[a];var c;n in this._global_heaps?c=this._global_heaps[n]:(c=new ym(this.fh,n),await c.ready,this._global_heaps[n]=c);let s=c.objects.get(r);if("VLEN_STRING"==e){let e=i[2];const t=new TextDecoder(0==e?"ascii":"utf-8");o[a]=t.decode(s)}}}return o}async _get_chunk_params(){if(!this._chunk_params_set){this._chunk_params_set=!0;var e=this.find_msg_type(mw)[0].get("offset_to_message"),[t,i,n,r]=await this._get_data_message_properties(e);if(2==n){var s;if(1==t||2==t){var o=(await Bp.unpack_from_async("<Q",this.fh,r))[0];s=r+Bp.calcsize("<Q")}else if(3==t){var[i,o]=await Bp.unpack_from_async("<BQ",this.fh,r);s=r+Bp.calcsize("<BQ")}Sp(t>=1&&t<=3);var a="<"+(i-1).toFixed()+"I",c=await Bp.unpack_from_async(a,this.fh,s);this._chunks=c,this._chunk_dims=i,this._chunk_address=o}}}};var Om=Bp.unpack_from("<Q",new Uint8Array([255,255,255,255,255,255,255,255]).buffer),Vm=new Map([["collection_address","Q"],["object_index","I"]]);Ep(Vm);var qm=new Map([["version","B"],["reserved","B"],["name_size","H"],["datatype_size","H"],["dataspace_size","H"]]),Qm=Ep(qm),Um=new Map([["version","B"],["flags","B"],["name_size","H"],["datatype_size","H"],["dataspace_size","H"],["character_set_encoding","B"]]),jm=Ep(Um),Gm=new Map([["version","B"],["reserved","B"],["total_header_messages","H"],["object_reference_count","I"],["object_header_size","I"],["padding","I"]]),Wm=new Map([["signature","4s"],["version","B"],["flags","B"]]),$m=new Map([["version","B"],["dimensionality","B"],["flags","B"],["reserved_0","B"],["reserved_1","I"]]),Km=Ep($m),Ym=new Map([["version","B"],["dimensionality","B"],["flags","B"],["type","B"]]),Xm=Ep(Ym),Zm=new Map([["type","H"],["size","H"],["flags","B"],["reserved","3s"]]),Jm=Ep(Zm),ew=new Map([["type","B"],["size","H"],["flags","B"]]),tw=Ep(ew),iw=new Map([["btree_address","Q"],["heap_address","Q"]]),nw=new Map([["heap_address","Q"],["name_btree_address","Q"]]),rw=new Map([["heap_address","Q"],["name_btree_address","Q"],["order_btree_address","Q"]]),sw=new Map([["version","B"],["space_allocation_time","B"],["fillvalue_write_time","B"],["fillvalue_defined","B"]]),ow=Ep(sw),aw=new Map([["version","B"],["flags","B"]]),cw=Ep(aw),lw=new Map([["filter_id","H"],["name_length","H"],["flags","H"],["client_data_values","H"]]),hw=Ep(lw),dw=1,uw=2,fw=3,pw=5,gw=6,mw=8,ww=11,bw=12,Fw=16,vw=17,yw=class{constructor(e,t){null==t?(this.parent=this,this.file=this):(this.parent=t,this.file=t.file),this.name=e}async init(e){const t=this.file.index;t&&this.name in t?this._links=t[this.name]:this._links=await e.get_links(),this._dataobjects=e,this._attrs=null,this._keys=null}get keys(){return null==this._keys&&(this._keys=Object.keys(this._links)),this._keys.slice()}get values(){return this.keys.map((e=>this.get(e)))}length(){return this.keys.length}_dereference(e){if(!e)throw"cannot deference null reference";let t=this.file._get_object_by_address(e);if(null==t)throw"reference not found in file";return t}async get(e){if("number"==typeof e)return this._dereference(e);var t=_w(e);if("/"==t)return this.file;if("."==t)return this;if(/^\//.test(t))return this.file.get(t.slice(1));if(""!=function(e){let t="/",i=e.lastIndexOf(t)+1,n=e.slice(0,i),r=new RegExp("^"+t+"+$"),s=new RegExp(t+"$");n&&!r.test(n)&&(n=n.replace(s,""));return n}(t))var[i,n]=t.split(/\/(.*)/);else var i=t,n=".";if(!(i in this._links))throw i+" not found in group";var r=_w(this.name+"/"+i);let s=this._links[i];if("string"==typeof s)try{return this.get(s)}catch(e){return null}var o=new Pm(this.file._fh,s);if(await o.ready,o.is_dataset){if("."!=n)throw r+" is a dataset, not a group";return new Cw(r,o,this)}var a=new yw(r,this);return await a.init(o),a.get(n)}visit(e){return this.visititems(((t,i)=>e(t)))}visititems(e){var t=this.name.length;/\/$/.test(this.name)||(t+=1);for(var i=this.values.slice();i;){let n=i.shift();1==i.length&&console.log(n);let r=e(n.name.slice(t),n);if(null!=r)return r;n instanceof yw&&(i=i.concat(n.values))}return null}get attrs(){return null==this._attrs&&(this._attrs=this._dataobjects.get_attributes()),this._attrs}},Aw=class extends yw{constructor(e,t,i){super("/",null),this.ready=this.init(e,t,i)}async init(e,t,i){var n=new bm(e,0);await n.ready;var r=await n.get_offset_to_dataobjects(),s=new Pm(e,r);if(await s.ready,this.parent=this,this.file=this,this.name="/",this._dataobjects=s,this._attrs=null,this._keys=null,this._fh=e,this.filename=t||"",this.mode="r",this.userblock_size=0,i&&i.index)this.index=i.index;else{let t;if(i&&i.indexOffset)t=i.indexOffset;else{const e=await this.attrs;if(e.hasOwnProperty("_index_offset"))t=e._index_offset;else{const e=this.indexName||"_index",i=await s.find_link(e);i&&(t=i[1])}}if(t)try{const i=new Pm(e,t);await i.ready;const n=await i.get_data(),r=lm(n),s=(new TextDecoder).decode(r);this.index=JSON.parse(s)}catch(e){console.error(`Error loading index by offset ${e}`)}}this.index&&this.name in this.index?this._links=this.index[this.name]:this._links=await s.get_links()}_get_object_by_address(e){return this._dataobjects.offset==e?this:this.visititems((e=>{e._dataobjects.offset}))}},Cw=class extends Array{constructor(e,t,i){super(),this.parent=i,this.file=i.file,this.name=e,this._dataobjects=t,this._attrs=null,this._astype=null}get value(){var e=this._dataobjects.get_data();return null==this._astype?this.getValue(e):e.astype(this._astype)}get shape(){return this._dataobjects.shape}get attrs(){return this._dataobjects.get_attributes()}get dtype(){return this._dataobjects.dtype}get fillvalue(){return this._dataobjects.get_fillvalue()}async to_array(){return function(e,t){const i=e.length,n=t.reduce(((e,t)=>e*t),1);i!==n&&console.warn(`shape product: ${n} does not match length of flattened array: ${i}`);let r=e;const s=t.slice(1).reverse();for(let e of s){const t=[],{length:i}=r;let n=0;for(;n<i;)t.push(r.slice(n,n+=e));r=t}return r}
|
|
34
|
-
/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */(await this.value,await this.shape)}async getValue(e){const t=await this.dtype;return("string"==typeof t||t instanceof String)&&t.startsWith("S")?(await e).map((e=>{let t=e.indexOf("\0");return t>=0?e.substring(0,t):e})):e}};function _w(e){return e.replace(/\/(\/)+/g,"/")}async function xw(e){var t;e.url&&("function"==typeof(t=e.url).slice&&"function"==typeof t.arrayBuffer)&&(e.file=e.url,e.url=void 0);const i=void 0!==e.url;let n=e.reader?e.reader:function(e){if(e.url)return new vp(e);if(e.path)return new NodeLocalFile(e);if(e.file)return new Cp(e.file);throw Error("One of 'url', 'path (node only)', or 'file (browser only)' must be specified")}(e);const r=e.fetchSize||2e3,s=e.maxSize||2e5;i&&(n=new yp({file:n,fetchSize:r,maxSize:s}));const o=new kw(n),a=await async function(e){let t;if(e.indexReader)t=e.indexReader;else{if(e.index)return e.index;e.indexURL?t=new vp({url:e.indexURL}):e.indexPath?t=new NodeLocalFile({path:e.indexPath}):e.indexFile&&(t=new Cp({file:e.indexFile}))}if(t){const e=await t.read(),i=(new TextDecoder).decode(e);return JSON.parse(i)}return}(e),c=e.indexOffset,l=function(e){if(e.url)return Iw(e.url);if(e.path)return Iw(e.path);if(e.file)return e.file.name}(e),h=new Aw(o,l,{index:a,indexOffset:c});return await h.ready,h}class kw{constructor(e){this.fileReader=e}async slice(e,t){return this.fileReader.read(e,t-e)}}function Iw(e){const t=e.lastIndexOf("/");return t>0?e.substring(t+1):e}class Sw{constructor(e,t){this.chrom=e,this.signal_bin_size=t;this.signals={raw_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}`,gc_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}_GC`,gc_partition:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_merge`,baf:`snp_likelihood_${this.chrom}_${this.signal_bin_size}_mask`,baf_i1:`snp_i1_${this.chrom}_${this.signal_bin_size}_mask`,Mosaic_segments:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_segments_2d`,Mosaic_calls:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_call_2d`}}}class Ew{constructor(e,t=1e5){this.h5_file=e,this.bin_size=t,this.h5_obj=void 0,this.pytorKeys=[],this.availableBins=[]}async fetch(){return this.h5_obj||(this.h5_obj=await xw({url:this.h5_file,fetchSize:1e6,maxSize:2e8})),this.h5_obj}async get_keys(){return(await this.fetch()).keys}async get_rd_signal(e=this.bin_size,t=void 0){const i=await this.fetch();this.pytorKeys=i.keys;const n=new Nw(this.pytorKeys);this.availableBins=n.getAllBins(),this.availableBins.includes(e)||(e=this.availableBins.at(-1));const r=await this.getChromosomes(t);let s=await this.rd_stat(e);const o=await this.getWigFeatures(r,e,s);return this.setCallers(o),{[e]:o}}async getWigFeatures(e,t,i){const n={RD_Raw:[],RD_Raw_gc_coor:[],ReadDepth:[],"2D":[],BAF1:[],BAF2:[]};for(const r of e){const e=new Sw(r,t);n.RD_Raw.push(...await this.get_chr_signal(r,t,e.signals.raw_RD,i)),n.RD_Raw_gc_coor.push(...await this.get_chr_signal(r,t,e.signals.gc_RD,i)),n.ReadDepth.push(...await this.get_chr_signal(r,t,e.signals.gc_partition,i)),n["2D"].push(...await this.rd_call_combined(r,t,i,e));const[s,o]=await this.getBafSignals(r,t,e.signals.baf_i1);n.BAF1.push(...s),n.BAF2.push(...o)}return n}async getChromosomes(e){const t=await this.h5_obj.get("rd_chromosomes"),i=await t.value;if(e){let t=new Set(e);return i.filter((e=>t.has(e)))}return i}setCallers(e){this.callers=[],e.ReadDepth.length&&this.callers.push("ReadDepth"),e["2D"].length&&this.callers.push("2D")}decode_segments(e){let t=[],i=[];for(let n of e)4294967295==n?(t.push(i),i=[]):i.push(n);return t}async rd_call_combined(e,t,i,n){let r,s=[],o=n.signals.Mosaic_segments;if(this.pytorKeys.includes(o)){const e=await this.h5_obj.get(o);let t=await e.value;r=this.decode_segments(t)}let a=n.signals.Mosaic_calls;if(this.pytorKeys.includes(a)){const n=await this.h5_obj.get(a);let o=await n.to_array();r.forEach(((n,r)=>{n.forEach(((n,a)=>{s.push({chr:e,start:n*t,end:(n+1)*t,value:o[0][r]/i[4]*2})}))}))}return s}async rd_stat(e){let t,i=`rd_stat_${e}_auto`;if(this.pytorKeys.includes(i)){const e=await this.h5_obj.get(i);t=await e.value}return t}async get_chr_signal(e,t,i,n){let r=[];if(this.pytorKeys.includes(i)){const s=await this.h5_obj.get(i);(await s.value).forEach(((i,s)=>{r.push({chr:e,start:s*t,end:(s+1)*t,value:i/n[4]*2})}))}return r}async getBafSignals(e,t,i,n=-1){const r=[],s=[];if(this.pytorKeys.includes(i)){const o=await this.h5_obj.get(i);(await o.to_array()).forEach(((i,o)=>{isNaN(i)||(r.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5-i)}),.5!==i&&s.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5+i)}))}))}return[r,s]}}class Nw{constructor(e){this.signals=e}getAllBins(){const e=this.getRdBins(),t=this.getSnpBins();return[...new Set([...e,...t])].sort(((e,t)=>e-t))}getRdBins(){return this.extractBins(/^his_rd_p_(.*)_(\d+)$/)}getSnpBins(){return this.extractBins(/^snp_likelihood_(.*)_(\d+)_mask$/)}extractBins(e){return[...new Set(this.signals.map((t=>t.match(e))).filter((e=>null!==e)).map((e=>Number(e[2]))))]}}function Mw(e){if(e.length<4)return e;let t,i,n,r,s,o;return t=e.slice().sort(((e,t)=>e-t)),t.length/4%1==0?(i=.5*(t[t.length/4]+t[t.length/4+1]),n=.5*(t[t.length*(3/4)]+t[t.length*(3/4)+1])):(i=t[Math.floor(t.length/4+1)],n=t[Math.ceil(t.length*(3/4)+1)]),r=n-i,s=n+1.5*r,o=i-1.5*r,t.filter((e=>e>=o&&e<=s))}function Rw(e){let t=Mw(e);const i=t.length,n=t.reduce(((e,t)=>e+t))/i,r=Math.sqrt(t.map((e=>Math.pow(e-n,2))).reduce(((e,t)=>e+t))/i);return[n,r]}var Bw={range_function:function(e,t,i){return Array(Math.ceil((t-e)/i)).fill(e).map(((e,t)=>e+t*i))},getDistParams:Rw,linspace:function(e,t,i){if(void 0===i&&(i=Math.max(Math.round(t-e)+1,1)),i<2)return 1===i?[e]:[];var n=Array(i);for(let r=--i;r>=0;r--)n[r]=(r*t+(i-r)*e)/i;return n},GetFit:class{constructor(e){this.allBins=e}getValues(){return Object.values(this.allBins).reduce(((e,t)=>e.concat(t.filter((e=>e.binScore>0)).map((e=>e.binScore)))),[])}getMean(e){return e.reduce((function(e,t){return e+t}))/e.length}fit_data(){return Rw(this.getValues())}histogram(e,t){const i=t[1]-t[0],n=[];e.forEach(((e,r)=>{t.forEach(((t,r)=>{if(n[t]||(n[t]={count:0}),t<=e&&e<t+i)return n[t].count++,!1}))}));const r=[];return n.forEach(((e,t)=>{r.push(e.count)})),r}},filterOutliers:Mw};function Dw(e,t){return isNaN(e)||isNaN(t)||t<=0?NaN:0===e?.5:.5+.5*(Tw(.5*t,.5,1)-Tw(.5*t,.5,t/(t+e*e)))*Math.sign(e)}function Tw(e,t,i){if(0==i)return 0;if(1==i)return 1;{let n=Pw(e+t)-Pw(e)-Pw(t)+e*Math.log(i)+t*Math.log(1-i);return i<(e+1)/(e+t+2)?Math.exp(n)*zw(e,t,i)/e:1-Math.exp(n)*zw(t,e,1-i)/t}}function zw(e,t,i,n=1e3){let r=1,s=1,o=1,a=e+t,c=e+1,l=e-1,h=1-a*i/c;for(let d=0;d<=n;d++){let n=parseFloat(d+1),u=n+n,f=n*(t-n)*i/((l+u)*(e+u)),p=r+f*s,g=h+f*o;f=-(e+n)*(a+n)*i/((c+u)*(e+u));let m=g+f*h,w=r;if(s=p/m,o=g/m,r=(p+f*r)/m,h=1,Math.abs(r-w)<3e-7*Math.abs(r))return r}}function Lw(e){if(0==e||1==e)return 1;return e*Lw(e-1)}function Hw(e){let t;var i=[75122.633153,80916.6278952,36308.2951477,8687.24529705,1168.92649479,83.8676043424,2.50662827511],n=0,r=1;if(0==e)t=1e99;else if(e%1==0)t=Lw(e-1);else{for(let t=0;t<i.length;t++)n+=i[t]*Math.pow(e,t),r*=e+t;t=n*Math.pow(e+5.5,e+.5)*Math.exp(-(e+5.5))/r}return t}function Pw(e){return Math.log(Hw(e))}var Ow={TdistributionCDF:Dw,gamma:Hw,t_test_1_sample:function(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-Dw(Math.abs(r),n-1)},t_test_2_samples:function(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-Dw(Math.abs(o),parseInt(a+.5))}};const Vw=Object.prototype.toString;function qw(e){return Vw.call(e).endsWith("Array]")}function Qw(e,t,i,n){let r=0;const s=i(t);for(let t=0;t<e.x.length;t++)r+=Math.pow(e.y[t]-s(e.x[t]),2)/n[t];return r}function Uw(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})})),t}var jw={};const Gw=Object.prototype.toString;var Ww=Uw(Object.freeze({__proto__:null,isAnyArray:function(e){const t=Gw.call(e);return t.endsWith("Array]")&&!t.includes("Big")}}));const $w=Object.prototype.toString;function Kw(e){const t=$w.call(e);return t.endsWith("Array]")&&!t.includes("Big")}const Yw=Object.prototype.toString;function Xw(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function(e){const t=Yw.call(e);return t.endsWith("Array]")&&!t.includes("Big")}(e))throw new TypeError("input must be an array");if(0===e.length)throw new TypeError("input must not be empty");var i=t.fromIndex,n=void 0===i?0:i,r=t.toIndex,s=void 0===r?e.length:r;if(n<0||n>=e.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(s<=n||s>e.length||!Number.isInteger(s))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=e[n],a=n+1;a<s;a++)e[a]>o&&(o=e[a]);return o}const Zw=Object.prototype.toString;function Jw(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function(e){const t=Zw.call(e);return t.endsWith("Array]")&&!t.includes("Big")}(e))throw new TypeError("input must be an array");if(0===e.length)throw new TypeError("input must not be empty");var i=t.fromIndex,n=void 0===i?0:i,r=t.toIndex,s=void 0===r?e.length:r;if(n<0||n>=e.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(s<=n||s>e.length||!Number.isInteger(s))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=e[n],a=n+1;a<s;a++)e[a]<o&&(o=e[a]);return o}var eb=Object.freeze({__proto__:null,default:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Kw(e))throw new TypeError("input must be an array");if(0===e.length)throw new TypeError("input must not be empty");if(void 0!==i.output){if(!Kw(i.output))throw new TypeError("output option must be an array if specified");t=i.output}else t=new Array(e.length);var n=Jw(e),r=Xw(e);if(n===r)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var s=i.min,o=void 0===s?i.autoMinMax?n:0:s,a=i.max,c=void 0===a?i.autoMinMax?r:1:a;if(o>=c)throw new RangeError("min option must be smaller than max option");for(var l=(c-o)/(r-n),h=0;h<e.length;h++)t[h]=(e[h]-n)*l+o;return t}}),tb=Uw(eb);Object.defineProperty(jw,"__esModule",{value:!0});var ib=Ww,nb=tb;const rb=" ".repeat(2),sb=" ".repeat(4);function ob(e,t={}){const{maxRows:i=15,maxColumns:n=10,maxNumSize:r=8,padMinus:s="auto"}=t;return`${e.constructor.name} {\n${rb}[\n${sb}${function(e,t,i,n,r){const{rows:s,columns:o}=e,a=Math.min(s,t),c=Math.min(o,i),l=[];if("auto"===r){r=!1;e:for(let t=0;t<a;t++)for(let i=0;i<c;i++)if(e.get(t,i)<0){r=!0;break e}}for(let t=0;t<a;t++){let i=[];for(let s=0;s<c;s++)i.push(ab(e.get(t,s),n,r));l.push(`${i.join(" ")}`)}c!==o&&(l[l.length-1]+=` ... ${o-i} more columns`);a!==s&&l.push(`... ${s-t} more rows`);return l.join(`\n${sb}`)}(e,i,n,r,s)}\n${rb}]\n${rb}rows: ${e.rows}\n${rb}columns: ${e.columns}\n}`}function ab(e,t,i){return(e>=0&&i?` ${cb(e,t-1)}`:cb(e,t)).padEnd(t)}function cb(e,t){let i=e.toString();if(i.length<=t)return i;let n=e.toFixed(t);if(n.length>t&&(n=e.toFixed(Math.max(0,t-(n.length-t)))),n.length<=t&&!n.startsWith("0.000")&&!n.startsWith("-0.000"))return n;let r=e.toExponential(t);return r.length>t&&(r=e.toExponential(Math.max(0,t-(r.length-t)))),r.slice(0)}function lb(e,t,i){let n=i?e.rows:e.rows-1;if(t<0||t>n)throw new RangeError("Row index out of range")}function hb(e,t,i){let n=i?e.columns:e.columns-1;if(t<0||t>n)throw new RangeError("Column index out of range")}function db(e,t){if(t.to1DArray&&(t=t.to1DArray()),t.length!==e.columns)throw new RangeError("vector size must be the same as the number of columns");return t}function ub(e,t){if(t.to1DArray&&(t=t.to1DArray()),t.length!==e.rows)throw new RangeError("vector size must be the same as the number of rows");return t}function fb(e,t){if(!ib.isAnyArray(t))throw new TypeError("row indices must be an array");for(let i=0;i<t.length;i++)if(t[i]<0||t[i]>=e.rows)throw new RangeError("row indices are out of range")}function pb(e,t){if(!ib.isAnyArray(t))throw new TypeError("column indices must be an array");for(let i=0;i<t.length;i++)if(t[i]<0||t[i]>=e.columns)throw new RangeError("column indices are out of range")}function gb(e,t,i,n,r){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(wb("startRow",t),wb("endRow",i),wb("startColumn",n),wb("endColumn",r),t>i||n>r||t<0||t>=e.rows||i<0||i>=e.rows||n<0||n>=e.columns||r<0||r>=e.columns)throw new RangeError("Submatrix indices are out of range")}function mb(e,t=0){let i=[];for(let n=0;n<e;n++)i.push(t);return i}function wb(e,t){if("number"!=typeof t)throw new TypeError(`${e} must be a number`)}function bb(e){if(e.isEmpty())throw new Error("Empty matrix has no elements to index")}class Fb{static from1DArray(e,t,i){if(e*t!==i.length)throw new RangeError("data length does not match given dimensions");let n=new yb(e,t);for(let r=0;r<e;r++)for(let e=0;e<t;e++)n.set(r,e,i[r*t+e]);return n}static rowVector(e){let t=new yb(1,e.length);for(let i=0;i<e.length;i++)t.set(0,i,e[i]);return t}static columnVector(e){let t=new yb(e.length,1);for(let i=0;i<e.length;i++)t.set(i,0,e[i]);return t}static zeros(e,t){return new yb(e,t)}static ones(e,t){return new yb(e,t).fill(1)}static rand(e,t,i={}){if("object"!=typeof i)throw new TypeError("options must be an object");const{random:n=Math.random}=i;let r=new yb(e,t);for(let i=0;i<e;i++)for(let e=0;e<t;e++)r.set(i,e,n());return r}static randInt(e,t,i={}){if("object"!=typeof i)throw new TypeError("options must be an object");const{min:n=0,max:r=1e3,random:s=Math.random}=i;if(!Number.isInteger(n))throw new TypeError("min must be an integer");if(!Number.isInteger(r))throw new TypeError("max must be an integer");if(n>=r)throw new RangeError("min must be smaller than max");let o=r-n,a=new yb(e,t);for(let i=0;i<e;i++)for(let e=0;e<t;e++){let t=n+Math.round(s()*o);a.set(i,e,t)}return a}static eye(e,t,i){void 0===t&&(t=e),void 0===i&&(i=1);let n=Math.min(e,t),r=this.zeros(e,t);for(let e=0;e<n;e++)r.set(e,e,i);return r}static diag(e,t,i){let n=e.length;void 0===t&&(t=n),void 0===i&&(i=t);let r=Math.min(n,t,i),s=this.zeros(t,i);for(let t=0;t<r;t++)s.set(t,t,e[t]);return s}static min(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let i=e.rows,n=e.columns,r=new yb(i,n);for(let s=0;s<i;s++)for(let i=0;i<n;i++)r.set(s,i,Math.min(e.get(s,i),t.get(s,i)));return r}static max(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let i=e.rows,n=e.columns,r=new this(i,n);for(let s=0;s<i;s++)for(let i=0;i<n;i++)r.set(s,i,Math.max(e.get(s,i),t.get(s,i)));return r}static checkMatrix(e){return Fb.isMatrix(e)?e:new yb(e)}static isMatrix(e){return null!=e&&"Matrix"===e.klass}get size(){return this.rows*this.columns}apply(e){if("function"!=typeof e)throw new TypeError("callback must be a function");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e.call(this,t,i);return this}to1DArray(){let e=[];for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e.push(this.get(t,i));return e}to2DArray(){let e=[];for(let t=0;t<this.rows;t++){e.push([]);for(let i=0;i<this.columns;i++)e[t].push(this.get(t,i))}return e}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let e=0;e<this.rows;e++)for(let t=0;t<=e;t++)if(this.get(e,t)!==this.get(t,e))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let e=0;e<this.rows;e++)if(0!==this.get(e,e))return!1;return!0}isEchelonForm(){let e=0,t=0,i=-1,n=!0,r=!1;for(;e<this.rows&&n;){for(t=0,r=!1;t<this.columns&&!1===r;)0===this.get(e,t)?t++:1===this.get(e,t)&&t>i?(r=!0,i=t):(n=!1,r=!0);e++}return n}isReducedEchelonForm(){let e=0,t=0,i=-1,n=!0,r=!1;for(;e<this.rows&&n;){for(t=0,r=!1;t<this.columns&&!1===r;)0===this.get(e,t)?t++:1===this.get(e,t)&&t>i?(r=!0,i=t):(n=!1,r=!0);for(let i=t+1;i<this.rows;i++)0!==this.get(e,i)&&(n=!1);e++}return n}echelonForm(){let e=this.clone(),t=0,i=0;for(;t<e.rows&&i<e.columns;){let n=t;for(let r=t;r<e.rows;r++)e.get(r,i)>e.get(n,i)&&(n=r);if(0===e.get(n,i))i++;else{e.swapRows(t,n);let r=e.get(t,i);for(let n=i;n<e.columns;n++)e.set(t,n,e.get(t,n)/r);for(let n=t+1;n<e.rows;n++){let r=e.get(n,i)/e.get(t,i);e.set(n,i,0);for(let s=i+1;s<e.columns;s++)e.set(n,s,e.get(n,s)-e.get(t,s)*r)}t++,i++}}return e}reducedEchelonForm(){let e=this.echelonForm(),t=e.columns,i=e.rows,n=i-1;for(;n>=0;)if(0===e.maxRow(n))n--;else{let r=0,s=!1;for(;r<i&&!1===s;)1===e.get(n,r)?s=!0:r++;for(let i=0;i<n;i++){let s=e.get(i,r);for(let o=r;o<t;o++){let t=e.get(i,o)-s*e.get(n,o);e.set(i,o,t)}}n--}return e}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(e={}){if("object"!=typeof e)throw new TypeError("options must be an object");const{rows:t=1,columns:i=1}=e;if(!Number.isInteger(t)||t<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");let n=new yb(this.rows*t,this.columns*i);for(let e=0;e<t;e++)for(let t=0;t<i;t++)n.setSubMatrix(this,this.rows*e,this.columns*t);return n}fill(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,e);return this}neg(){return this.mulS(-1)}getRow(e){lb(this,e);let t=[];for(let i=0;i<this.columns;i++)t.push(this.get(e,i));return t}getRowVector(e){return yb.rowVector(this.getRow(e))}setRow(e,t){lb(this,e),t=db(this,t);for(let i=0;i<this.columns;i++)this.set(e,i,t[i]);return this}swapRows(e,t){lb(this,e),lb(this,t);for(let i=0;i<this.columns;i++){let n=this.get(e,i);this.set(e,i,this.get(t,i)),this.set(t,i,n)}return this}getColumn(e){hb(this,e);let t=[];for(let i=0;i<this.rows;i++)t.push(this.get(i,e));return t}getColumnVector(e){return yb.columnVector(this.getColumn(e))}setColumn(e,t){hb(this,e),t=ub(this,t);for(let i=0;i<this.rows;i++)this.set(i,e,t[i]);return this}swapColumns(e,t){hb(this,e),hb(this,t);for(let i=0;i<this.rows;i++){let n=this.get(i,e);this.set(i,e,this.get(i,t)),this.set(i,t,n)}return this}addRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e[i]);return this}subRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e[i]);return this}mulRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e[i]);return this}divRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e[i]);return this}addColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e[t]);return this}subColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e[t]);return this}mulColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e[t]);return this}divColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e[t]);return this}mulRow(e,t){lb(this,e);for(let i=0;i<this.columns;i++)this.set(e,i,this.get(e,i)*t);return this}mulColumn(e,t){hb(this,e);for(let i=0;i<this.rows;i++)this.set(i,e,this.get(i,e)*t);return this}max(e){if(this.isEmpty())return NaN;switch(e){case"row":{const e=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)>e[t]&&(e[t]=this.get(t,i));return e}case"column":{const e=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)>e[i]&&(e[i]=this.get(t,i));return e}case void 0:{let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)>e&&(e=this.get(t,i));return e}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){bb(this);let e=this.get(0,0),t=[0,0];for(let i=0;i<this.rows;i++)for(let n=0;n<this.columns;n++)this.get(i,n)>e&&(e=this.get(i,n),t[0]=i,t[1]=n);return t}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const e=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)<e[t]&&(e[t]=this.get(t,i));return e}case"column":{const e=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)<e[i]&&(e[i]=this.get(t,i));return e}case void 0:{let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)<e&&(e=this.get(t,i));return e}default:throw new Error(`invalid option: ${e}`)}}minIndex(){bb(this);let e=this.get(0,0),t=[0,0];for(let i=0;i<this.rows;i++)for(let n=0;n<this.columns;n++)this.get(i,n)<e&&(e=this.get(i,n),t[0]=i,t[1]=n);return t}maxRow(e){if(lb(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let i=1;i<this.columns;i++)this.get(e,i)>t&&(t=this.get(e,i));return t}maxRowIndex(e){lb(this,e),bb(this);let t=this.get(e,0),i=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n),i[1]=n);return i}minRow(e){if(lb(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let i=1;i<this.columns;i++)this.get(e,i)<t&&(t=this.get(e,i));return t}minRowIndex(e){lb(this,e),bb(this);let t=this.get(e,0),i=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n),i[1]=n);return i}maxColumn(e){if(hb(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let i=1;i<this.rows;i++)this.get(i,e)>t&&(t=this.get(i,e));return t}maxColumnIndex(e){hb(this,e),bb(this);let t=this.get(0,e),i=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)>t&&(t=this.get(n,e),i[0]=n);return i}minColumn(e){if(hb(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let i=1;i<this.rows;i++)this.get(i,e)<t&&(t=this.get(i,e));return t}minColumnIndex(e){hb(this,e),bb(this);let t=this.get(0,e),i=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)<t&&(t=this.get(n,e),i[0]=n);return i}diag(){let e=Math.min(this.rows,this.columns),t=[];for(let i=0;i<e;i++)t.push(this.get(i,i));return t}norm(e="frobenius"){switch(e){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${e}`)}}cumulativeSum(){let e=0;for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e+=this.get(t,i),this.set(t,i,e);return this}dot(e){Fb.isMatrix(e)&&(e=e.to1DArray());let t=this.to1DArray();if(t.length!==e.length)throw new RangeError("vectors do not have the same size");let i=0;for(let n=0;n<t.length;n++)i+=t[n]*e[n];return i}mmul(e){e=yb.checkMatrix(e);let t=this.rows,i=this.columns,n=e.columns,r=new yb(t,n),s=new Float64Array(i);for(let o=0;o<n;o++){for(let t=0;t<i;t++)s[t]=e.get(t,o);for(let e=0;e<t;e++){let t=0;for(let n=0;n<i;n++)t+=this.get(e,n)*s[n];r.set(e,o,t)}}return r}mpow(e){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(e)||e<0)throw new RangeError("Exponent must be a non-negative integer");let t=yb.eye(this.rows),i=this;for(let n=e;n>1;n/=2)1&n&&(t=t.mmul(i)),i=i.mmul(i);return t}strassen2x2(e){e=yb.checkMatrix(e);let t=new yb(2,2);const i=this.get(0,0),n=e.get(0,0),r=this.get(0,1),s=e.get(0,1),o=this.get(1,0),a=e.get(1,0),c=this.get(1,1),l=e.get(1,1),h=(i+c)*(n+l),d=(o+c)*n,u=i*(s-l),f=c*(a-n),p=(i+r)*l,g=h+f-p+(r-c)*(a+l),m=u+p,w=d+f,b=h-d+u+(o-i)*(n+s);return t.set(0,0,g),t.set(0,1,m),t.set(1,0,w),t.set(1,1,b),t}strassen3x3(e){e=yb.checkMatrix(e);let t=new yb(3,3);const i=this.get(0,0),n=this.get(0,1),r=this.get(0,2),s=this.get(1,0),o=this.get(1,1),a=this.get(1,2),c=this.get(2,0),l=this.get(2,1),h=this.get(2,2),d=e.get(0,0),u=e.get(0,1),f=e.get(0,2),p=e.get(1,0),g=e.get(1,1),m=e.get(1,2),w=e.get(2,0),b=e.get(2,1),F=e.get(2,2),v=(i-s)*(-u+g),y=(-i+s+o)*(d-u+g),A=(s+o)*(-d+u),C=i*d,_=(-i+c+l)*(d-f+m),x=(-i+c)*(f-m),k=(c+l)*(-d+f),I=(-r+l+h)*(g+w-b),S=(r-h)*(g-b),E=r*w,N=(l+h)*(-w+b),M=(-r+o+a)*(m+w-F),R=(r-a)*(m-F),B=(o+a)*(-w+F),D=C+E+n*p,T=(i+n+r-s-o-l-h)*g+y+A+C+I+E+N,z=C+_+k+(i+n+r-o-a-c-l)*m+E+M+B,L=v+o*(-d+u+p-g-m-w+F)+y+C+E+M+R,H=v+y+A+C+a*b,P=E+M+R+B+s*f,O=C+_+x+l*(-d+f+p-g-m-w+b)+I+S+E,V=I+S+E+N+c*u,q=C+_+x+k+h*F;return t.set(0,0,D),t.set(0,1,T),t.set(0,2,z),t.set(1,0,L),t.set(1,1,H),t.set(1,2,P),t.set(2,0,O),t.set(2,1,V),t.set(2,2,q),t}mmulStrassen(e){e=yb.checkMatrix(e);let t=this.clone(),i=t.rows,n=t.columns,r=e.rows,s=e.columns;function o(e,t,i){let n=e.rows,r=e.columns;if(n===t&&r===i)return e;{let n=Fb.zeros(t,i);return n=n.setSubMatrix(e,0,0),n}}n!==r&&console.warn(`Multiplying ${i} x ${n} and ${r} x ${s} matrix: dimensions do not match.`);let a=Math.max(i,r),c=Math.max(n,s);return t=o(t,a,c),function e(t,i,n,r){if(n<=512||r<=512)return t.mmul(i);n%2==1&&r%2==1?(t=o(t,n+1,r+1),i=o(i,n+1,r+1)):n%2==1?(t=o(t,n+1,r),i=o(i,n+1,r)):r%2==1&&(t=o(t,n,r+1),i=o(i,n,r+1));let s=parseInt(t.rows/2,10),a=parseInt(t.columns/2,10),c=t.subMatrix(0,s-1,0,a-1),l=i.subMatrix(0,s-1,0,a-1),h=t.subMatrix(0,s-1,a,t.columns-1),d=i.subMatrix(0,s-1,a,i.columns-1),u=t.subMatrix(s,t.rows-1,0,a-1),f=i.subMatrix(s,i.rows-1,0,a-1),p=t.subMatrix(s,t.rows-1,a,t.columns-1),g=i.subMatrix(s,i.rows-1,a,i.columns-1),m=e(Fb.add(c,p),Fb.add(l,g),s,a),w=e(Fb.add(u,p),l,s,a),b=e(c,Fb.sub(d,g),s,a),F=e(p,Fb.sub(f,l),s,a),v=e(Fb.add(c,h),g,s,a),y=e(Fb.sub(u,c),Fb.add(l,d),s,a),A=e(Fb.sub(h,p),Fb.add(f,g),s,a),C=Fb.add(m,F);C.sub(v),C.add(A);let _=Fb.add(b,v),x=Fb.add(w,F),k=Fb.sub(m,w);k.add(b),k.add(y);let I=Fb.zeros(2*C.rows,2*C.columns);return I=I.setSubMatrix(C,0,0),I=I.setSubMatrix(_,C.rows,0),I=I.setSubMatrix(x,0,C.columns),I=I.setSubMatrix(k,C.rows,C.columns),I.subMatrix(0,n-1,0,r-1)}(t,e=o(e,a,c),a,c)}scaleRows(e={}){if("object"!=typeof e)throw new TypeError("options must be an object");const{min:t=0,max:i=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(t>=i)throw new RangeError("min must be smaller than max");let n=new yb(this.rows,this.columns);for(let e=0;e<this.rows;e++){const r=this.getRow(e);r.length>0&&nb(r,{min:t,max:i,output:r}),n.setRow(e,r)}return n}scaleColumns(e={}){if("object"!=typeof e)throw new TypeError("options must be an object");const{min:t=0,max:i=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(t>=i)throw new RangeError("min must be smaller than max");let n=new yb(this.rows,this.columns);for(let e=0;e<this.columns;e++){const r=this.getColumn(e);r.length&&nb(r,{min:t,max:i,output:r}),n.setColumn(e,r)}return n}flipRows(){const e=Math.ceil(this.columns/2);for(let t=0;t<this.rows;t++)for(let i=0;i<e;i++){let e=this.get(t,i),n=this.get(t,this.columns-1-i);this.set(t,i,n),this.set(t,this.columns-1-i,e)}return this}flipColumns(){const e=Math.ceil(this.rows/2);for(let t=0;t<this.columns;t++)for(let i=0;i<e;i++){let e=this.get(i,t),n=this.get(this.rows-1-i,t);this.set(i,t,n),this.set(this.rows-1-i,t,e)}return this}kroneckerProduct(e){e=yb.checkMatrix(e);let t=this.rows,i=this.columns,n=e.rows,r=e.columns,s=new yb(t*n,i*r);for(let o=0;o<t;o++)for(let t=0;t<i;t++)for(let i=0;i<n;i++)for(let a=0;a<r;a++)s.set(n*o+i,r*t+a,this.get(o,t)*e.get(i,a));return s}kroneckerSum(e){if(e=yb.checkMatrix(e),!this.isSquare()||!e.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let t=this.rows,i=e.rows,n=this.kroneckerProduct(yb.eye(i,i)),r=yb.eye(t,t).kroneckerProduct(e);return n.add(r)}transpose(){let e=new yb(this.columns,this.rows);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e.set(i,t,this.get(t,i));return e}sortRows(e=vb){for(let t=0;t<this.rows;t++)this.setRow(t,this.getRow(t).sort(e));return this}sortColumns(e=vb){for(let t=0;t<this.columns;t++)this.setColumn(t,this.getColumn(t).sort(e));return this}subMatrix(e,t,i,n){gb(this,e,t,i,n);let r=new yb(t-e+1,n-i+1);for(let s=e;s<=t;s++)for(let t=i;t<=n;t++)r.set(s-e,t-i,this.get(s,t));return r}subMatrixRow(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=this.columns-1),t>i||t<0||t>=this.columns||i<0||i>=this.columns)throw new RangeError("Argument out of range");let n=new yb(e.length,i-t+1);for(let r=0;r<e.length;r++)for(let s=t;s<=i;s++){if(e[r]<0||e[r]>=this.rows)throw new RangeError(`Row index out of range: ${e[r]}`);n.set(r,s-t,this.get(e[r],s))}return n}subMatrixColumn(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=this.rows-1),t>i||t<0||t>=this.rows||i<0||i>=this.rows)throw new RangeError("Argument out of range");let n=new yb(i-t+1,e.length);for(let r=0;r<e.length;r++)for(let s=t;s<=i;s++){if(e[r]<0||e[r]>=this.columns)throw new RangeError(`Column index out of range: ${e[r]}`);n.set(s-t,r,this.get(s,e[r]))}return n}setSubMatrix(e,t,i){if((e=yb.checkMatrix(e)).isEmpty())return this;gb(this,t,t+e.rows-1,i,i+e.columns-1);for(let n=0;n<e.rows;n++)for(let r=0;r<e.columns;r++)this.set(t+n,i+r,e.get(n,r));return this}selection(e,t){fb(this,e),pb(this,t);let i=new yb(e.length,t.length);for(let n=0;n<e.length;n++){let r=e[n];for(let e=0;e<t.length;e++){let s=t[e];i.set(n,e,this.get(r,s))}}return i}trace(){let e=Math.min(this.rows,this.columns),t=0;for(let i=0;i<e;i++)t+=this.get(i,i);return t}clone(){return this.constructor.copy(this,new yb(this.rows,this.columns))}static copy(e,t){for(const[i,n,r]of e.entries())t.set(i,n,r);return t}sum(e){switch(e){case"row":return function(e){let t=mb(e.rows);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[i]+=e.get(i,n);return t}(this);case"column":return function(e){let t=mb(e.columns);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[n]+=e.get(i,n);return t}(this);case void 0:return function(e){let t=0;for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)t+=e.get(i,n);return t}(this);default:throw new Error(`invalid option: ${e}`)}}product(e){switch(e){case"row":return function(e){let t=mb(e.rows,1);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[i]*=e.get(i,n);return t}(this);case"column":return function(e){let t=mb(e.columns,1);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[n]*=e.get(i,n);return t}(this);case void 0:return function(e){let t=1;for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)t*=e.get(i,n);return t}(this);default:throw new Error(`invalid option: ${e}`)}}mean(e){const t=this.sum(e);switch(e){case"row":for(let e=0;e<this.rows;e++)t[e]/=this.columns;return t;case"column":for(let e=0;e<this.columns;e++)t[e]/=this.rows;return t;case void 0:return t/this.size;default:throw new Error(`invalid option: ${e}`)}}variance(e,t={}){if("object"==typeof e&&(t=e,e=void 0),"object"!=typeof t)throw new TypeError("options must be an object");const{unbiased:i=!0,mean:n=this.mean(e)}=t;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(e){case"row":if(!ib.isAnyArray(n))throw new TypeError("mean must be an array");return function(e,t,i){const n=e.rows,r=e.columns,s=[];for(let o=0;o<n;o++){let n=0,a=0,c=0;for(let t=0;t<r;t++)c=e.get(o,t)-i[o],n+=c,a+=c*c;t?s.push((a-n*n/r)/(r-1)):s.push((a-n*n/r)/r)}return s}(this,i,n);case"column":if(!ib.isAnyArray(n))throw new TypeError("mean must be an array");return function(e,t,i){const n=e.rows,r=e.columns,s=[];for(let o=0;o<r;o++){let r=0,a=0,c=0;for(let t=0;t<n;t++)c=e.get(t,o)-i[o],r+=c,a+=c*c;t?s.push((a-r*r/n)/(n-1)):s.push((a-r*r/n)/n)}return s}(this,i,n);case void 0:if("number"!=typeof n)throw new TypeError("mean must be a number");return function(e,t,i){const n=e.rows,r=e.columns,s=n*r;let o=0,a=0,c=0;for(let t=0;t<n;t++)for(let n=0;n<r;n++)c=e.get(t,n)-i,o+=c,a+=c*c;return t?(a-o*o/s)/(s-1):(a-o*o/s)/s}(this,i,n);default:throw new Error(`invalid option: ${e}`)}}standardDeviation(e,t){"object"==typeof e&&(t=e,e=void 0);const i=this.variance(e,t);if(void 0===e)return Math.sqrt(i);for(let e=0;e<i.length;e++)i[e]=Math.sqrt(i[e]);return i}center(e,t={}){if("object"==typeof e&&(t=e,e=void 0),"object"!=typeof t)throw new TypeError("options must be an object");const{center:i=this.mean(e)}=t;switch(e){case"row":if(!ib.isAnyArray(i))throw new TypeError("center must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)-t[i])}(this,i),this;case"column":if(!ib.isAnyArray(i))throw new TypeError("center must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)-t[n])}(this,i),this;case void 0:if("number"!=typeof i)throw new TypeError("center must be a number");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)-t)}(this,i),this;default:throw new Error(`invalid option: ${e}`)}}scale(e,t={}){if("object"==typeof e&&(t=e,e=void 0),"object"!=typeof t)throw new TypeError("options must be an object");let i=t.scale;switch(e){case"row":if(void 0===i)i=function(e){const t=[];for(let i=0;i<e.rows;i++){let n=0;for(let t=0;t<e.columns;t++)n+=e.get(i,t)**2/(e.columns-1);t.push(Math.sqrt(n))}return t}(this);else if(!ib.isAnyArray(i))throw new TypeError("scale must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)/t[i])}(this,i),this;case"column":if(void 0===i)i=function(e){const t=[];for(let i=0;i<e.columns;i++){let n=0;for(let t=0;t<e.rows;t++)n+=e.get(t,i)**2/(e.rows-1);t.push(Math.sqrt(n))}return t}(this);else if(!ib.isAnyArray(i))throw new TypeError("scale must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)/t[n])}(this,i),this;case void 0:if(void 0===i)i=function(e){const t=e.size-1;let i=0;for(let n=0;n<e.columns;n++)for(let r=0;r<e.rows;r++)i+=e.get(r,n)**2/t;return Math.sqrt(i)}(this);else if("number"!=typeof i)throw new TypeError("scale must be a number");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)/t)}(this,i),this;default:throw new Error(`invalid option: ${e}`)}}toString(e){return ob(this,e)}[Symbol.iterator](){return this.entries()}*entries(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield[e,t,this.get(e,t)]}*values(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield this.get(e,t)}}function vb(e,t){return e-t}Fb.prototype.klass="Matrix","undefined"!=typeof Symbol&&(Fb.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return ob(this)}),Fb.random=Fb.rand,Fb.randomInt=Fb.randInt,Fb.diagonal=Fb.diag,Fb.prototype.diagonal=Fb.prototype.diag,Fb.identity=Fb.eye,Fb.prototype.negate=Fb.prototype.neg,Fb.prototype.tensorProduct=Fb.prototype.kroneckerProduct;class yb extends Fb{data;#k(e,t){if(this.data=[],!(Number.isInteger(t)&&t>=0))throw new TypeError("nColumns must be a positive integer");for(let i=0;i<e;i++)this.data.push(new Float64Array(t));this.rows=e,this.columns=t}constructor(e,t){if(super(),yb.isMatrix(e))this.#k(e.rows,e.columns),yb.copy(e,this);else if(Number.isInteger(e)&&e>=0)this.#k(e,t);else{if(!ib.isAnyArray(e))throw new TypeError("First argument must be a positive number or an array");{const i=e;if("number"!=typeof(t=(e=i.length)?i[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let n=0;n<e;n++){if(i[n].length!==t)throw new RangeError("Inconsistent array dimensions");if(!i[n].every((e=>"number"==typeof e)))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(i[n]))}this.rows=e,this.columns=t}}}set(e,t,i){return this.data[e][t]=i,this}get(e,t){return this.data[e][t]}removeRow(e){return lb(this,e),this.data.splice(e,1),this.rows-=1,this}addRow(e,t){return void 0===t&&(t=e,e=this.rows),lb(this,e,!0),t=Float64Array.from(db(this,t)),this.data.splice(e,0,t),this.rows+=1,this}removeColumn(e){hb(this,e);for(let t=0;t<this.rows;t++){const i=new Float64Array(this.columns-1);for(let n=0;n<e;n++)i[n]=this.data[t][n];for(let n=e+1;n<this.columns;n++)i[n-1]=this.data[t][n];this.data[t]=i}return this.columns-=1,this}addColumn(e,t){void 0===t&&(t=e,e=this.columns),hb(this,e,!0),t=ub(this,t);for(let i=0;i<this.rows;i++){const n=new Float64Array(this.columns+1);let r=0;for(;r<e;r++)n[r]=this.data[i][r];for(n[r++]=t[i];r<this.columns+1;r++)n[r]=this.data[i][r-1];this.data[i]=n}return this.columns+=1,this}}!function(e,t){e.prototype.add=function(e){return"number"==typeof e?this.addS(e):this.addM(e)},e.prototype.addS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e);return this},e.prototype.addM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e.get(t,i));return this},e.add=function(e,i){return new t(e).add(i)},e.prototype.sub=function(e){return"number"==typeof e?this.subS(e):this.subM(e)},e.prototype.subS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e);return this},e.prototype.subM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e.get(t,i));return this},e.sub=function(e,i){return new t(e).sub(i)},e.prototype.subtract=e.prototype.sub,e.prototype.subtractS=e.prototype.subS,e.prototype.subtractM=e.prototype.subM,e.subtract=e.sub,e.prototype.mul=function(e){return"number"==typeof e?this.mulS(e):this.mulM(e)},e.prototype.mulS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e);return this},e.prototype.mulM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e.get(t,i));return this},e.mul=function(e,i){return new t(e).mul(i)},e.prototype.multiply=e.prototype.mul,e.prototype.multiplyS=e.prototype.mulS,e.prototype.multiplyM=e.prototype.mulM,e.multiply=e.mul,e.prototype.div=function(e){return"number"==typeof e?this.divS(e):this.divM(e)},e.prototype.divS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e);return this},e.prototype.divM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e.get(t,i));return this},e.div=function(e,i){return new t(e).div(i)},e.prototype.divide=e.prototype.div,e.prototype.divideS=e.prototype.divS,e.prototype.divideM=e.prototype.divM,e.divide=e.div,e.prototype.mod=function(e){return"number"==typeof e?this.modS(e):this.modM(e)},e.prototype.modS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)%e);return this},e.prototype.modM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)%e.get(t,i));return this},e.mod=function(e,i){return new t(e).mod(i)},e.prototype.modulus=e.prototype.mod,e.prototype.modulusS=e.prototype.modS,e.prototype.modulusM=e.prototype.modM,e.modulus=e.mod,e.prototype.and=function(e){return"number"==typeof e?this.andS(e):this.andM(e)},e.prototype.andS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)&e);return this},e.prototype.andM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)&e.get(t,i));return this},e.and=function(e,i){return new t(e).and(i)},e.prototype.or=function(e){return"number"==typeof e?this.orS(e):this.orM(e)},e.prototype.orS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)|e);return this},e.prototype.orM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)|e.get(t,i));return this},e.or=function(e,i){return new t(e).or(i)},e.prototype.xor=function(e){return"number"==typeof e?this.xorS(e):this.xorM(e)},e.prototype.xorS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)^e);return this},e.prototype.xorM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)^e.get(t,i));return this},e.xor=function(e,i){return new t(e).xor(i)},e.prototype.leftShift=function(e){return"number"==typeof e?this.leftShiftS(e):this.leftShiftM(e)},e.prototype.leftShiftS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)<<e);return this},e.prototype.leftShiftM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)<<e.get(t,i));return this},e.leftShift=function(e,i){return new t(e).leftShift(i)},e.prototype.signPropagatingRightShift=function(e){return"number"==typeof e?this.signPropagatingRightShiftS(e):this.signPropagatingRightShiftM(e)},e.prototype.signPropagatingRightShiftS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>e);return this},e.prototype.signPropagatingRightShiftM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>e.get(t,i));return this},e.signPropagatingRightShift=function(e,i){return new t(e).signPropagatingRightShift(i)},e.prototype.rightShift=function(e){return"number"==typeof e?this.rightShiftS(e):this.rightShiftM(e)},e.prototype.rightShiftS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>>e);return this},e.prototype.rightShiftM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>>e.get(t,i));return this},e.rightShift=function(e,i){return new t(e).rightShift(i)},e.prototype.zeroFillRightShift=e.prototype.rightShift,e.prototype.zeroFillRightShiftS=e.prototype.rightShiftS,e.prototype.zeroFillRightShiftM=e.prototype.rightShiftM,e.zeroFillRightShift=e.rightShift,e.prototype.not=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,~this.get(e,t));return this},e.not=function(e){return new t(e).not()},e.prototype.abs=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.abs(this.get(e,t)));return this},e.abs=function(e){return new t(e).abs()},e.prototype.acos=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.acos(this.get(e,t)));return this},e.acos=function(e){return new t(e).acos()},e.prototype.acosh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.acosh(this.get(e,t)));return this},e.acosh=function(e){return new t(e).acosh()},e.prototype.asin=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.asin(this.get(e,t)));return this},e.asin=function(e){return new t(e).asin()},e.prototype.asinh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.asinh(this.get(e,t)));return this},e.asinh=function(e){return new t(e).asinh()},e.prototype.atan=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.atan(this.get(e,t)));return this},e.atan=function(e){return new t(e).atan()},e.prototype.atanh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.atanh(this.get(e,t)));return this},e.atanh=function(e){return new t(e).atanh()},e.prototype.cbrt=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.cbrt(this.get(e,t)));return this},e.cbrt=function(e){return new t(e).cbrt()},e.prototype.ceil=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.ceil(this.get(e,t)));return this},e.ceil=function(e){return new t(e).ceil()},e.prototype.clz32=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.clz32(this.get(e,t)));return this},e.clz32=function(e){return new t(e).clz32()},e.prototype.cos=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.cos(this.get(e,t)));return this},e.cos=function(e){return new t(e).cos()},e.prototype.cosh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.cosh(this.get(e,t)));return this},e.cosh=function(e){return new t(e).cosh()},e.prototype.exp=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.exp(this.get(e,t)));return this},e.exp=function(e){return new t(e).exp()},e.prototype.expm1=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.expm1(this.get(e,t)));return this},e.expm1=function(e){return new t(e).expm1()},e.prototype.floor=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.floor(this.get(e,t)));return this},e.floor=function(e){return new t(e).floor()},e.prototype.fround=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.fround(this.get(e,t)));return this},e.fround=function(e){return new t(e).fround()},e.prototype.log=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log(this.get(e,t)));return this},e.log=function(e){return new t(e).log()},e.prototype.log1p=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log1p(this.get(e,t)));return this},e.log1p=function(e){return new t(e).log1p()},e.prototype.log10=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log10(this.get(e,t)));return this},e.log10=function(e){return new t(e).log10()},e.prototype.log2=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log2(this.get(e,t)));return this},e.log2=function(e){return new t(e).log2()},e.prototype.round=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.round(this.get(e,t)));return this},e.round=function(e){return new t(e).round()},e.prototype.sign=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sign(this.get(e,t)));return this},e.sign=function(e){return new t(e).sign()},e.prototype.sin=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sin(this.get(e,t)));return this},e.sin=function(e){return new t(e).sin()},e.prototype.sinh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sinh(this.get(e,t)));return this},e.sinh=function(e){return new t(e).sinh()},e.prototype.sqrt=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sqrt(this.get(e,t)));return this},e.sqrt=function(e){return new t(e).sqrt()},e.prototype.tan=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.tan(this.get(e,t)));return this},e.tan=function(e){return new t(e).tan()},e.prototype.tanh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.tanh(this.get(e,t)));return this},e.tanh=function(e){return new t(e).tanh()},e.prototype.trunc=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.trunc(this.get(e,t)));return this},e.trunc=function(e){return new t(e).trunc()},e.pow=function(e,i){return new t(e).pow(i)},e.prototype.pow=function(e){return"number"==typeof e?this.powS(e):this.powM(e)},e.prototype.powS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)**e);return this},e.prototype.powM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)**e.get(t,i));return this}}(Fb,yb);class Ab extends Fb{#I;get size(){return this.#I.size}get rows(){return this.#I.rows}get columns(){return this.#I.columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(e){return yb.isMatrix(e)&&"SymmetricMatrix"===e.klassType}static zeros(e){return new this(e)}static ones(e){return new this(e).fill(1)}constructor(e){if(super(),yb.isMatrix(e)){if(!e.isSymmetric())throw new TypeError("not symmetric data");this.#I=yb.copy(e,new yb(e.rows,e.rows))}else if(Number.isInteger(e)&&e>=0)this.#I=new yb(e,e);else if(this.#I=new yb(e),!this.isSymmetric())throw new TypeError("not symmetric data")}clone(){const e=new Ab(this.diagonalSize);for(const[t,i,n]of this.upperRightEntries())e.set(t,i,n);return e}toMatrix(){return new yb(this)}get(e,t){return this.#I.get(e,t)}set(e,t,i){return this.#I.set(e,t,i),this.#I.set(t,e,i),this}removeCross(e){return this.#I.removeRow(e),this.#I.removeColumn(e),this}addCross(e,t){void 0===t&&(t=e,e=this.diagonalSize);const i=t.slice();return i.splice(e,1),this.#I.addRow(e,i),this.#I.addColumn(e,t),this}applyMask(e){if(e.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const t=[];for(const[i,n]of e.entries())n||t.push(i);t.reverse();for(const e of t)this.removeCross(e);return this}toCompact(){const{diagonalSize:e}=this,t=new Array(e*(e+1)/2);for(let i=0,n=0,r=0;r<t.length;r++)t[r]=this.get(n,i),++i>=e&&(i=++n);return t}static fromCompact(e){const t=e.length,i=(Math.sqrt(8*t+1)-1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(e)}`);const n=new Ab(i);for(let r=0,s=0,o=0;o<t;o++)n.set(r,s,e[o]),++r>=i&&(r=++s);return n}*upperRightEntries(){for(let e=0,t=0;e<this.diagonalSize;void 0){const i=this.get(e,t);yield[e,t,i],++t>=this.diagonalSize&&(t=++e)}}*upperRightValues(){for(let e=0,t=0;e<this.diagonalSize;void 0){const i=this.get(e,t);yield i,++t>=this.diagonalSize&&(t=++e)}}}Ab.prototype.klassType="SymmetricMatrix";class Cb extends Ab{static isDistanceMatrix(e){return Ab.isSymmetricMatrix(e)&&"DistanceMatrix"===e.klassSubType}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,t,i){return e===t&&(i=0),super.set(e,t,i)}addCross(e,t){return void 0===t&&(t=e,e=this.diagonalSize),(t=t.slice())[e]=0,super.addCross(e,t)}toSymmetricMatrix(){return new Ab(this)}clone(){const e=new Cb(this.diagonalSize);for(const[t,i,n]of this.upperRightEntries())t!==i&&e.set(t,i,n);return e}toCompact(){const{diagonalSize:e}=this,t=new Array((e-1)*e/2);for(let i=1,n=0,r=0;r<t.length;r++)t[r]=this.get(n,i),++i>=e&&(i=1+ ++n);return t}static fromCompact(e){const t=e.length;if(0===t)return new this(0);const i=(Math.sqrt(8*t+1)+1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const n=new this(i);for(let r=1,s=0,o=0;o<t;o++)n.set(r,s,e[o]),++r>=i&&(r=1+ ++s);return n}}Cb.prototype.klassSubType="DistanceMatrix";class _b extends Fb{constructor(e,t,i){super(),this.matrix=e,this.rows=t,this.columns=i}}class xb extends _b{constructor(e,t,i){fb(e,t),pb(e,i),super(e,t.length,i.length),this.rowIndices=t,this.columnIndices=i}set(e,t,i){return this.matrix.set(this.rowIndices[e],this.columnIndices[t],i),this}get(e,t){return this.matrix.get(this.rowIndices[e],this.columnIndices[t])}}class kb extends Fb{constructor(e,t={}){const{rows:i=1}=t;if(e.length%i!=0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=i,this.columns=e.length/i,this.data=e}set(e,t,i){let n=this._calculateIndex(e,t);return this.data[n]=i,this}get(e,t){let i=this._calculateIndex(e,t);return this.data[i]}_calculateIndex(e,t){return e*this.columns+t}}class Ib extends Fb{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,i){return this.data[e][t]=i,this}get(e,t){return this.data[e][t]}}class Sb{constructor(e){let t,i,n,r,s,o,a,c,l,h=(e=Ib.checkMatrix(e)).clone(),d=h.rows,u=h.columns,f=new Float64Array(d),p=1;for(t=0;t<d;t++)f[t]=t;for(c=new Float64Array(d),i=0;i<u;i++){for(t=0;t<d;t++)c[t]=h.get(t,i);for(t=0;t<d;t++){for(l=Math.min(t,i),s=0,n=0;n<l;n++)s+=h.get(t,n)*c[n];c[t]-=s,h.set(t,i,c[t])}for(r=i,t=i+1;t<d;t++)Math.abs(c[t])>Math.abs(c[r])&&(r=t);if(r!==i){for(n=0;n<u;n++)o=h.get(r,n),h.set(r,n,h.get(i,n)),h.set(i,n,o);a=f[r],f[r]=f[i],f[i]=a,p=-p}if(i<d&&0!==h.get(i,i))for(t=i+1;t<d;t++)h.set(t,i,h.get(t,i)/h.get(i,i))}this.LU=h,this.pivotVector=f,this.pivotSign=p}isSingular(){let e=this.LU,t=e.columns;for(let i=0;i<t;i++)if(0===e.get(i,i))return!0;return!1}solve(e){e=yb.checkMatrix(e);let t=this.LU;if(t.rows!==e.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let i,n,r,s=e.columns,o=e.subMatrixRow(this.pivotVector,0,s-1),a=t.columns;for(r=0;r<a;r++)for(i=r+1;i<a;i++)for(n=0;n<s;n++)o.set(i,n,o.get(i,n)-o.get(r,n)*t.get(i,r));for(r=a-1;r>=0;r--){for(n=0;n<s;n++)o.set(r,n,o.get(r,n)/t.get(r,r));for(i=0;i<r;i++)for(n=0;n<s;n++)o.set(i,n,o.get(i,n)-o.get(r,n)*t.get(i,r))}return o}get determinant(){let e=this.LU;if(!e.isSquare())throw new Error("Matrix must be square");let t=this.pivotSign,i=e.columns;for(let n=0;n<i;n++)t*=e.get(n,n);return t}get lowerTriangularMatrix(){let e=this.LU,t=e.rows,i=e.columns,n=new yb(t,i);for(let r=0;r<t;r++)for(let t=0;t<i;t++)r>t?n.set(r,t,e.get(r,t)):r===t?n.set(r,t,1):n.set(r,t,0);return n}get upperTriangularMatrix(){let e=this.LU,t=e.rows,i=e.columns,n=new yb(t,i);for(let r=0;r<t;r++)for(let t=0;t<i;t++)r<=t?n.set(r,t,e.get(r,t)):n.set(r,t,0);return n}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function Eb(e,t){let i=0;return Math.abs(e)>Math.abs(t)?(i=t/e,Math.abs(e)*Math.sqrt(1+i*i)):0!==t?(i=e/t,Math.abs(t)*Math.sqrt(1+i*i)):0}class Nb{constructor(e){let t,i,n,r,s=(e=Ib.checkMatrix(e)).clone(),o=e.rows,a=e.columns,c=new Float64Array(a);for(n=0;n<a;n++){let e=0;for(t=n;t<o;t++)e=Eb(e,s.get(t,n));if(0!==e){for(s.get(n,n)<0&&(e=-e),t=n;t<o;t++)s.set(t,n,s.get(t,n)/e);for(s.set(n,n,s.get(n,n)+1),i=n+1;i<a;i++){for(r=0,t=n;t<o;t++)r+=s.get(t,n)*s.get(t,i);for(r=-r/s.get(n,n),t=n;t<o;t++)s.set(t,i,s.get(t,i)+r*s.get(t,n))}}c[n]=-e}this.QR=s,this.Rdiag=c}solve(e){e=yb.checkMatrix(e);let t=this.QR,i=t.rows;if(e.rows!==i)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let n,r,s,o,a=e.columns,c=e.clone(),l=t.columns;for(s=0;s<l;s++)for(r=0;r<a;r++){for(o=0,n=s;n<i;n++)o+=t.get(n,s)*c.get(n,r);for(o=-o/t.get(s,s),n=s;n<i;n++)c.set(n,r,c.get(n,r)+o*t.get(n,s))}for(s=l-1;s>=0;s--){for(r=0;r<a;r++)c.set(s,r,c.get(s,r)/this.Rdiag[s]);for(n=0;n<s;n++)for(r=0;r<a;r++)c.set(n,r,c.get(n,r)-c.get(s,r)*t.get(n,s))}return c.subMatrix(0,l-1,0,a-1)}isFullRank(){let e=this.QR.columns;for(let t=0;t<e;t++)if(0===this.Rdiag[t])return!1;return!0}get upperTriangularMatrix(){let e,t,i=this.QR,n=i.columns,r=new yb(n,n);for(e=0;e<n;e++)for(t=0;t<n;t++)e<t?r.set(e,t,i.get(e,t)):e===t?r.set(e,t,this.Rdiag[e]):r.set(e,t,0);return r}get orthogonalMatrix(){let e,t,i,n,r=this.QR,s=r.rows,o=r.columns,a=new yb(s,o);for(i=o-1;i>=0;i--){for(e=0;e<s;e++)a.set(e,i,0);for(a.set(i,i,1),t=i;t<o;t++)if(0!==r.get(i,i)){for(n=0,e=i;e<s;e++)n+=r.get(e,i)*a.get(e,t);for(n=-n/r.get(i,i),e=i;e<s;e++)a.set(e,t,a.get(e,t)+n*r.get(e,i))}}return a}}class Mb{constructor(e,t={}){if((e=Ib.checkMatrix(e)).isEmpty())throw new Error("Matrix must be non-empty");let i=e.rows,n=e.columns;const{computeLeftSingularVectors:r=!0,computeRightSingularVectors:s=!0,autoTranspose:o=!1}=t;let a,c=Boolean(r),l=Boolean(s),h=!1;if(i<n)if(o){a=e.transpose(),i=a.rows,n=a.columns,h=!0;let t=c;c=l,l=t}else a=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else a=e.clone();let d=Math.min(i,n),u=Math.min(i+1,n),f=new Float64Array(u),p=new yb(i,d),g=new yb(n,n),m=new Float64Array(n),w=new Float64Array(i),b=new Float64Array(u);for(let e=0;e<u;e++)b[e]=e;let F=Math.min(i-1,n),v=Math.max(0,Math.min(n-2,i)),y=Math.max(F,v);for(let e=0;e<y;e++){if(e<F){f[e]=0;for(let t=e;t<i;t++)f[e]=Eb(f[e],a.get(t,e));if(0!==f[e]){a.get(e,e)<0&&(f[e]=-f[e]);for(let t=e;t<i;t++)a.set(t,e,a.get(t,e)/f[e]);a.set(e,e,a.get(e,e)+1)}f[e]=-f[e]}for(let t=e+1;t<n;t++){if(e<F&&0!==f[e]){let n=0;for(let r=e;r<i;r++)n+=a.get(r,e)*a.get(r,t);n=-n/a.get(e,e);for(let r=e;r<i;r++)a.set(r,t,a.get(r,t)+n*a.get(r,e))}m[t]=a.get(e,t)}if(c&&e<F)for(let t=e;t<i;t++)p.set(t,e,a.get(t,e));if(e<v){m[e]=0;for(let t=e+1;t<n;t++)m[e]=Eb(m[e],m[t]);if(0!==m[e]){m[e+1]<0&&(m[e]=0-m[e]);for(let t=e+1;t<n;t++)m[t]/=m[e];m[e+1]+=1}if(m[e]=-m[e],e+1<i&&0!==m[e]){for(let t=e+1;t<i;t++)w[t]=0;for(let t=e+1;t<i;t++)for(let i=e+1;i<n;i++)w[t]+=m[i]*a.get(t,i);for(let t=e+1;t<n;t++){let n=-m[t]/m[e+1];for(let r=e+1;r<i;r++)a.set(r,t,a.get(r,t)+n*w[r])}}if(l)for(let t=e+1;t<n;t++)g.set(t,e,m[t])}}let A=Math.min(n,i+1);if(F<n&&(f[F]=a.get(F,F)),i<A&&(f[A-1]=0),v+1<A&&(m[v]=a.get(v,A-1)),m[A-1]=0,c){for(let e=F;e<d;e++){for(let t=0;t<i;t++)p.set(t,e,0);p.set(e,e,1)}for(let e=F-1;e>=0;e--)if(0!==f[e]){for(let t=e+1;t<d;t++){let n=0;for(let r=e;r<i;r++)n+=p.get(r,e)*p.get(r,t);n=-n/p.get(e,e);for(let r=e;r<i;r++)p.set(r,t,p.get(r,t)+n*p.get(r,e))}for(let t=e;t<i;t++)p.set(t,e,-p.get(t,e));p.set(e,e,1+p.get(e,e));for(let t=0;t<e-1;t++)p.set(t,e,0)}else{for(let t=0;t<i;t++)p.set(t,e,0);p.set(e,e,1)}}if(l)for(let e=n-1;e>=0;e--){if(e<v&&0!==m[e])for(let t=e+1;t<n;t++){let i=0;for(let r=e+1;r<n;r++)i+=g.get(r,e)*g.get(r,t);i=-i/g.get(e+1,e);for(let r=e+1;r<n;r++)g.set(r,t,g.get(r,t)+i*g.get(r,e))}for(let t=0;t<n;t++)g.set(t,e,0);g.set(e,e,1)}let C=A-1,_=Number.EPSILON;for(;A>0;){let e,t;for(e=A-2;e>=-1&&-1!==e;e--){const t=Number.MIN_VALUE+_*Math.abs(f[e]+Math.abs(f[e+1]));if(Math.abs(m[e])<=t||Number.isNaN(m[e])){m[e]=0;break}}if(e===A-2)t=4;else{let i;for(i=A-1;i>=e&&i!==e;i--){let t=(i!==A?Math.abs(m[i]):0)+(i!==e+1?Math.abs(m[i-1]):0);if(Math.abs(f[i])<=_*t){f[i]=0;break}}i===e?t=3:i===A-1?t=1:(t=2,e=i)}switch(e++,t){case 1:{let t=m[A-2];m[A-2]=0;for(let i=A-2;i>=e;i--){let r=Eb(f[i],t),s=f[i]/r,o=t/r;if(f[i]=r,i!==e&&(t=-o*m[i-1],m[i-1]=s*m[i-1]),l)for(let e=0;e<n;e++)r=s*g.get(e,i)+o*g.get(e,A-1),g.set(e,A-1,-o*g.get(e,i)+s*g.get(e,A-1)),g.set(e,i,r)}break}case 2:{let t=m[e-1];m[e-1]=0;for(let n=e;n<A;n++){let r=Eb(f[n],t),s=f[n]/r,o=t/r;if(f[n]=r,t=-o*m[n],m[n]=s*m[n],c)for(let t=0;t<i;t++)r=s*p.get(t,n)+o*p.get(t,e-1),p.set(t,e-1,-o*p.get(t,n)+s*p.get(t,e-1)),p.set(t,n,r)}break}case 3:{const t=Math.max(Math.abs(f[A-1]),Math.abs(f[A-2]),Math.abs(m[A-2]),Math.abs(f[e]),Math.abs(m[e])),r=f[A-1]/t,s=f[A-2]/t,o=m[A-2]/t,a=f[e]/t,h=m[e]/t,d=((s+r)*(s-r)+o*o)/2,u=r*o*(r*o);let w=0;0===d&&0===u||(w=d<0?0-Math.sqrt(d*d+u):Math.sqrt(d*d+u),w=u/(d+w));let b=(a+r)*(a-r)+w,F=a*h;for(let t=e;t<A-1;t++){let r=Eb(b,F);0===r&&(r=Number.MIN_VALUE);let s=b/r,o=F/r;if(t!==e&&(m[t-1]=r),b=s*f[t]+o*m[t],m[t]=s*m[t]-o*f[t],F=o*f[t+1],f[t+1]=s*f[t+1],l)for(let e=0;e<n;e++)r=s*g.get(e,t)+o*g.get(e,t+1),g.set(e,t+1,-o*g.get(e,t)+s*g.get(e,t+1)),g.set(e,t,r);if(r=Eb(b,F),0===r&&(r=Number.MIN_VALUE),s=b/r,o=F/r,f[t]=r,b=s*m[t]+o*f[t+1],f[t+1]=-o*m[t]+s*f[t+1],F=o*m[t+1],m[t+1]=s*m[t+1],c&&t<i-1)for(let e=0;e<i;e++)r=s*p.get(e,t)+o*p.get(e,t+1),p.set(e,t+1,-o*p.get(e,t)+s*p.get(e,t+1)),p.set(e,t,r)}m[A-2]=b;break}case 4:if(f[e]<=0&&(f[e]=f[e]<0?-f[e]:0,l))for(let t=0;t<=C;t++)g.set(t,e,-g.get(t,e));for(;e<C&&!(f[e]>=f[e+1]);){let t=f[e];if(f[e]=f[e+1],f[e+1]=t,l&&e<n-1)for(let i=0;i<n;i++)t=g.get(i,e+1),g.set(i,e+1,g.get(i,e)),g.set(i,e,t);if(c&&e<i-1)for(let n=0;n<i;n++)t=p.get(n,e+1),p.set(n,e+1,p.get(n,e)),p.set(n,e,t);e++}A--}}if(h){let e=g;g=p,p=e}this.m=i,this.n=n,this.s=f,this.U=p,this.V=g}solve(e){let t=e,i=this.threshold,n=this.s.length,r=yb.zeros(n,n);for(let e=0;e<n;e++)Math.abs(this.s[e])<=i?r.set(e,e,0):r.set(e,e,1/this.s[e]);let s=this.U,o=this.rightSingularVectors,a=o.mmul(r),c=o.rows,l=s.rows,h=yb.zeros(c,l);for(let e=0;e<c;e++)for(let t=0;t<l;t++){let i=0;for(let r=0;r<n;r++)i+=a.get(e,r)*s.get(t,r);h.set(e,t,i)}return h.mmul(t)}solveForDiagonal(e){return this.solve(yb.diag(e))}inverse(){let e=this.V,t=this.threshold,i=e.rows,n=e.columns,r=new yb(i,this.s.length);for(let s=0;s<i;s++)for(let i=0;i<n;i++)Math.abs(this.s[i])>t&&r.set(s,i,e.get(s,i)/this.s[i]);let s=this.U,o=s.rows,a=s.columns,c=new yb(i,o);for(let e=0;e<i;e++)for(let t=0;t<o;t++){let i=0;for(let n=0;n<a;n++)i+=r.get(e,n)*s.get(t,n);c.set(e,t,i)}return c}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let e=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,t=0,i=this.s;for(let n=0,r=i.length;n<r;n++)i[n]>e&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return yb.diag(this.s)}}function Rb(e,t,i=!1){return e=Ib.checkMatrix(e),t=Ib.checkMatrix(t),i?new Mb(e).solve(t):e.isSquare()?new Sb(e).solve(t):new Nb(e).solve(t)}function Bb(e,t){let i=[];for(let n=0;n<e;n++)n!==t&&i.push(n);return i}function Db(e,t,i,n=1e-9,r=1e-9){if(e>r)return new Array(t.rows+1).fill(0);{let e=t.addRow(i,[0]);for(let t=0;t<e.rows;t++)Math.abs(e.get(t,0))<n&&e.set(t,0,0);return e.to1DArray()}}class Tb{constructor(e,t={}){const{assumeSymmetric:i=!1}=t;if(!(e=Ib.checkMatrix(e)).isSquare())throw new Error("Matrix is not a square matrix");if(e.isEmpty())throw new Error("Matrix must be non-empty");let n,r,s=e.columns,o=new yb(s,s),a=new Float64Array(s),c=new Float64Array(s),l=e,h=!1;if(h=!!i||e.isSymmetric(),h){for(n=0;n<s;n++)for(r=0;r<s;r++)o.set(n,r,l.get(n,r));!function(e,t,i,n){let r,s,o,a,c,l,h,d;for(c=0;c<e;c++)i[c]=n.get(e-1,c);for(a=e-1;a>0;a--){for(d=0,o=0,l=0;l<a;l++)d+=Math.abs(i[l]);if(0===d)for(t[a]=i[a-1],c=0;c<a;c++)i[c]=n.get(a-1,c),n.set(a,c,0),n.set(c,a,0);else{for(l=0;l<a;l++)i[l]/=d,o+=i[l]*i[l];for(r=i[a-1],s=Math.sqrt(o),r>0&&(s=-s),t[a]=d*s,o-=r*s,i[a-1]=r-s,c=0;c<a;c++)t[c]=0;for(c=0;c<a;c++){for(r=i[c],n.set(c,a,r),s=t[c]+n.get(c,c)*r,l=c+1;l<=a-1;l++)s+=n.get(l,c)*i[l],t[l]+=n.get(l,c)*r;t[c]=s}for(r=0,c=0;c<a;c++)t[c]/=o,r+=t[c]*i[c];for(h=r/(o+o),c=0;c<a;c++)t[c]-=h*i[c];for(c=0;c<a;c++){for(r=i[c],s=t[c],l=c;l<=a-1;l++)n.set(l,c,n.get(l,c)-(r*t[l]+s*i[l]));i[c]=n.get(a-1,c),n.set(a,c,0)}}i[a]=o}for(a=0;a<e-1;a++){if(n.set(e-1,a,n.get(a,a)),n.set(a,a,1),o=i[a+1],0!==o){for(l=0;l<=a;l++)i[l]=n.get(l,a+1)/o;for(c=0;c<=a;c++){for(s=0,l=0;l<=a;l++)s+=n.get(l,a+1)*n.get(l,c);for(l=0;l<=a;l++)n.set(l,c,n.get(l,c)-s*i[l])}}for(l=0;l<=a;l++)n.set(l,a+1,0)}for(c=0;c<e;c++)i[c]=n.get(e-1,c),n.set(e-1,c,0);n.set(e-1,e-1,1),t[0]=0}(s,c,a,o),function(e,t,i,n){let r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F;for(o=1;o<e;o++)t[o-1]=t[o];t[e-1]=0;let v=0,y=0,A=Number.EPSILON;for(l=0;l<e;l++){for(y=Math.max(y,Math.abs(i[l])+Math.abs(t[l])),h=l;h<e&&!(Math.abs(t[h])<=A*y);)h++;if(h>l)do{for(r=i[l],d=(i[l+1]-r)/(2*t[l]),u=Eb(d,1),d<0&&(u=-u),i[l]=t[l]/(d+u),i[l+1]=t[l]*(d+u),f=i[l+1],s=r-i[l],o=l+2;o<e;o++)i[o]-=s;for(v+=s,d=i[h],p=1,g=p,m=p,w=t[l+1],b=0,F=0,o=h-1;o>=l;o--)for(m=g,g=p,F=b,r=p*t[o],s=p*d,u=Eb(d,t[o]),t[o+1]=b*u,b=t[o]/u,p=d/u,d=p*i[o]-b*r,i[o+1]=s+b*(p*r+b*i[o]),c=0;c<e;c++)s=n.get(c,o+1),n.set(c,o+1,b*n.get(c,o)+p*s),n.set(c,o,p*n.get(c,o)-b*s);d=-b*F*m*w*t[l]/f,t[l]=b*d,i[l]=p*d}while(Math.abs(t[l])>A*y);i[l]=i[l]+v,t[l]=0}for(o=0;o<e-1;o++){for(c=o,d=i[o],a=o+1;a<e;a++)i[a]<d&&(c=a,d=i[a]);if(c!==o)for(i[c]=i[o],i[o]=d,a=0;a<e;a++)d=n.get(a,o),n.set(a,o,n.get(a,c)),n.set(a,c,d)}}(s,c,a,o)}else{let e=new yb(s,s),t=new Float64Array(s);for(r=0;r<s;r++)for(n=0;n<s;n++)e.set(n,r,l.get(n,r));!function(e,t,i,n){let r,s,o,a,c,l,h,d=0,u=e-1;for(l=d+1;l<=u-1;l++){for(h=0,a=l;a<=u;a++)h+=Math.abs(t.get(a,l-1));if(0!==h){for(o=0,a=u;a>=l;a--)i[a]=t.get(a,l-1)/h,o+=i[a]*i[a];for(s=Math.sqrt(o),i[l]>0&&(s=-s),o-=i[l]*s,i[l]=i[l]-s,c=l;c<e;c++){for(r=0,a=u;a>=l;a--)r+=i[a]*t.get(a,c);for(r/=o,a=l;a<=u;a++)t.set(a,c,t.get(a,c)-r*i[a])}for(a=0;a<=u;a++){for(r=0,c=u;c>=l;c--)r+=i[c]*t.get(a,c);for(r/=o,c=l;c<=u;c++)t.set(a,c,t.get(a,c)-r*i[c])}i[l]=h*i[l],t.set(l,l-1,h*s)}}for(a=0;a<e;a++)for(c=0;c<e;c++)n.set(a,c,a===c?1:0);for(l=u-1;l>=d+1;l--)if(0!==t.get(l,l-1)){for(a=l+1;a<=u;a++)i[a]=t.get(a,l-1);for(c=l;c<=u;c++){for(s=0,a=l;a<=u;a++)s+=i[a]*n.get(a,c);for(s=s/i[l]/t.get(l,l-1),a=l;a<=u;a++)n.set(a,c,n.get(a,c)+s*i[a])}}}(s,e,t,o),function(e,t,i,n,r){let s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v=e-1,y=0,A=e-1,C=Number.EPSILON,_=0,x=0,k=0,I=0,S=0,E=0,N=0,M=0;for(s=0;s<e;s++)for((s<y||s>A)&&(i[s]=r.get(s,s),t[s]=0),o=Math.max(s-1,0);o<e;o++)x+=Math.abs(r.get(s,o));for(;v>=y;){for(c=v;c>y&&(E=Math.abs(r.get(c-1,c-1))+Math.abs(r.get(c,c)),0===E&&(E=x),!(Math.abs(r.get(c,c-1))<C*E));)c--;if(c===v)r.set(v,v,r.get(v,v)+_),i[v]=r.get(v,v),t[v]=0,v--,M=0;else if(c===v-1){if(d=r.get(v,v-1)*r.get(v-1,v),k=(r.get(v-1,v-1)-r.get(v,v))/2,I=k*k+d,N=Math.sqrt(Math.abs(I)),r.set(v,v,r.get(v,v)+_),r.set(v-1,v-1,r.get(v-1,v-1)+_),u=r.get(v,v),I>=0){for(N=k>=0?k+N:k-N,i[v-1]=u+N,i[v]=i[v-1],0!==N&&(i[v]=u-d/N),t[v-1]=0,t[v]=0,u=r.get(v,v-1),E=Math.abs(u)+Math.abs(N),k=u/E,I=N/E,S=Math.sqrt(k*k+I*I),k/=S,I/=S,o=v-1;o<e;o++)N=r.get(v-1,o),r.set(v-1,o,I*N+k*r.get(v,o)),r.set(v,o,I*r.get(v,o)-k*N);for(s=0;s<=v;s++)N=r.get(s,v-1),r.set(s,v-1,I*N+k*r.get(s,v)),r.set(s,v,I*r.get(s,v)-k*N);for(s=y;s<=A;s++)N=n.get(s,v-1),n.set(s,v-1,I*N+k*n.get(s,v)),n.set(s,v,I*n.get(s,v)-k*N)}else i[v-1]=u+k,i[v]=u+k,t[v-1]=N,t[v]=-N;v-=2,M=0}else{if(u=r.get(v,v),f=0,d=0,c<v&&(f=r.get(v-1,v-1),d=r.get(v,v-1)*r.get(v-1,v)),10===M){for(_+=u,s=y;s<=v;s++)r.set(s,s,r.get(s,s)-u);E=Math.abs(r.get(v,v-1))+Math.abs(r.get(v-1,v-2)),u=f=.75*E,d=-.4375*E*E}if(30===M&&(E=(f-u)/2,E=E*E+d,E>0)){for(E=Math.sqrt(E),f<u&&(E=-E),E=u-d/((f-u)/2+E),s=y;s<=v;s++)r.set(s,s,r.get(s,s)-E);_+=E,u=f=d=.964}for(M+=1,l=v-2;l>=c&&(N=r.get(l,l),S=u-N,E=f-N,k=(S*E-d)/r.get(l+1,l)+r.get(l,l+1),I=r.get(l+1,l+1)-N-S-E,S=r.get(l+2,l+1),E=Math.abs(k)+Math.abs(I)+Math.abs(S),k/=E,I/=E,S/=E,l!==c)&&!(Math.abs(r.get(l,l-1))*(Math.abs(I)+Math.abs(S))<C*(Math.abs(k)*(Math.abs(r.get(l-1,l-1))+Math.abs(N)+Math.abs(r.get(l+1,l+1)))));)l--;for(s=l+2;s<=v;s++)r.set(s,s-2,0),s>l+2&&r.set(s,s-3,0);for(a=l;a<=v-1&&(b=a!==v-1,a!==l&&(k=r.get(a,a-1),I=r.get(a+1,a-1),S=b?r.get(a+2,a-1):0,u=Math.abs(k)+Math.abs(I)+Math.abs(S),0!==u&&(k/=u,I/=u,S/=u)),0!==u);a++)if(E=Math.sqrt(k*k+I*I+S*S),k<0&&(E=-E),0!==E){for(a!==l?r.set(a,a-1,-E*u):c!==l&&r.set(a,a-1,-r.get(a,a-1)),k+=E,u=k/E,f=I/E,N=S/E,I/=k,S/=k,o=a;o<e;o++)k=r.get(a,o)+I*r.get(a+1,o),b&&(k+=S*r.get(a+2,o),r.set(a+2,o,r.get(a+2,o)-k*N)),r.set(a,o,r.get(a,o)-k*u),r.set(a+1,o,r.get(a+1,o)-k*f);for(s=0;s<=Math.min(v,a+3);s++)k=u*r.get(s,a)+f*r.get(s,a+1),b&&(k+=N*r.get(s,a+2),r.set(s,a+2,r.get(s,a+2)-k*S)),r.set(s,a,r.get(s,a)-k),r.set(s,a+1,r.get(s,a+1)-k*I);for(s=y;s<=A;s++)k=u*n.get(s,a)+f*n.get(s,a+1),b&&(k+=N*n.get(s,a+2),n.set(s,a+2,n.get(s,a+2)-k*S)),n.set(s,a,n.get(s,a)-k),n.set(s,a+1,n.get(s,a+1)-k*I)}}}if(0===x)return;for(v=e-1;v>=0;v--)if(k=i[v],I=t[v],0===I)for(c=v,r.set(v,v,1),s=v-1;s>=0;s--){for(d=r.get(s,s)-k,S=0,o=c;o<=v;o++)S+=r.get(s,o)*r.get(o,v);if(t[s]<0)N=d,E=S;else if(c=s,0===t[s]?r.set(s,v,0!==d?-S/d:-S/(C*x)):(u=r.get(s,s+1),f=r.get(s+1,s),I=(i[s]-k)*(i[s]-k)+t[s]*t[s],h=(u*E-N*S)/I,r.set(s,v,h),r.set(s+1,v,Math.abs(u)>Math.abs(N)?(-S-d*h)/u:(-E-f*h)/N)),h=Math.abs(r.get(s,v)),C*h*h>1)for(o=s;o<=v;o++)r.set(o,v,r.get(o,v)/h)}else if(I<0)for(c=v-1,Math.abs(r.get(v,v-1))>Math.abs(r.get(v-1,v))?(r.set(v-1,v-1,I/r.get(v,v-1)),r.set(v-1,v,-(r.get(v,v)-k)/r.get(v,v-1))):(F=zb(0,-r.get(v-1,v),r.get(v-1,v-1)-k,I),r.set(v-1,v-1,F[0]),r.set(v-1,v,F[1])),r.set(v,v-1,0),r.set(v,v,1),s=v-2;s>=0;s--){for(p=0,g=0,o=c;o<=v;o++)p+=r.get(s,o)*r.get(o,v-1),g+=r.get(s,o)*r.get(o,v);if(d=r.get(s,s)-k,t[s]<0)N=d,S=p,E=g;else if(c=s,0===t[s]?(F=zb(-p,-g,d,I),r.set(s,v-1,F[0]),r.set(s,v,F[1])):(u=r.get(s,s+1),f=r.get(s+1,s),m=(i[s]-k)*(i[s]-k)+t[s]*t[s]-I*I,w=2*(i[s]-k)*I,0===m&&0===w&&(m=C*x*(Math.abs(d)+Math.abs(I)+Math.abs(u)+Math.abs(f)+Math.abs(N))),F=zb(u*S-N*p+I*g,u*E-N*g-I*p,m,w),r.set(s,v-1,F[0]),r.set(s,v,F[1]),Math.abs(u)>Math.abs(N)+Math.abs(I)?(r.set(s+1,v-1,(-p-d*r.get(s,v-1)+I*r.get(s,v))/u),r.set(s+1,v,(-g-d*r.get(s,v)-I*r.get(s,v-1))/u)):(F=zb(-S-f*r.get(s,v-1),-E-f*r.get(s,v),N,I),r.set(s+1,v-1,F[0]),r.set(s+1,v,F[1]))),h=Math.max(Math.abs(r.get(s,v-1)),Math.abs(r.get(s,v))),C*h*h>1)for(o=s;o<=v;o++)r.set(o,v-1,r.get(o,v-1)/h),r.set(o,v,r.get(o,v)/h)}for(s=0;s<e;s++)if(s<y||s>A)for(o=s;o<e;o++)n.set(s,o,r.get(s,o));for(o=e-1;o>=y;o--)for(s=y;s<=A;s++){for(N=0,a=y;a<=Math.min(o,A);a++)N+=n.get(s,a)*r.get(a,o);n.set(s,o,N)}}(s,c,a,o,e)}this.n=s,this.e=c,this.d=a,this.V=o}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let e,t,i=this.n,n=this.e,r=this.d,s=new yb(i,i);for(e=0;e<i;e++){for(t=0;t<i;t++)s.set(e,t,0);s.set(e,e,r[e]),n[e]>0?s.set(e,e+1,n[e]):n[e]<0&&s.set(e,e-1,n[e])}return s}}function zb(e,t,i,n){let r,s;return Math.abs(i)>Math.abs(n)?(r=n/i,s=i+r*n,[(e+r*t)/s,(t-r*e)/s]):(r=i/n,s=n+r*i,[(r*e+t)/s,(r*t-e)/s])}class Lb{constructor(e){if(!(e=Ib.checkMatrix(e)).isSymmetric())throw new Error("Matrix is not symmetric");let t,i,n,r=e,s=r.rows,o=new yb(s,s),a=!0;for(i=0;i<s;i++){let e=0;for(n=0;n<i;n++){let s=0;for(t=0;t<n;t++)s+=o.get(n,t)*o.get(i,t);s=(r.get(i,n)-s)/o.get(n,n),o.set(i,n,s),e+=s*s}for(e=r.get(i,i)-e,a&&=e>0,o.set(i,i,Math.sqrt(Math.max(e,0))),n=i+1;n<s;n++)o.set(i,n,0)}this.L=o,this.positiveDefinite=a}isPositiveDefinite(){return this.positiveDefinite}solve(e){e=Ib.checkMatrix(e);let t=this.L,i=t.rows;if(e.rows!==i)throw new Error("Matrix dimensions do not match");if(!1===this.isPositiveDefinite())throw new Error("Matrix is not positive definite");let n,r,s,o=e.columns,a=e.clone();for(s=0;s<i;s++)for(r=0;r<o;r++){for(n=0;n<s;n++)a.set(s,r,a.get(s,r)-a.get(n,r)*t.get(s,n));a.set(s,r,a.get(s,r)/t.get(s,s))}for(s=i-1;s>=0;s--)for(r=0;r<o;r++){for(n=s+1;n<i;n++)a.set(s,r,a.get(s,r)-a.get(n,r)*t.get(n,s));a.set(s,r,a.get(s,r)/t.get(s,s))}return a}get lowerTriangularMatrix(){return this.L}}class Hb{constructor(e,t={}){e=Ib.checkMatrix(e);let{Y:i}=t;const{scaleScores:n=!1,maxIterations:r=1e3,terminationCriteria:s=1e-10}=t;let o;if(i){if(i=ib.isAnyArray(i)&&"number"==typeof i[0]?yb.columnVector(i):Ib.checkMatrix(i),i.rows!==e.rows)throw new Error("Y should have the same number of rows as X");o=i.getColumnVector(0)}else o=e.getColumnVector(0);let a,c,l,h,d=1;for(let t=0;t<r&&d>s;t++)l=e.transpose().mmul(o).div(o.transpose().mmul(o).get(0,0)),l=l.div(l.norm()),a=e.mmul(l).div(l.transpose().mmul(l).get(0,0)),t>0&&(d=a.clone().sub(h).pow(2).sum()),h=a.clone(),i?(c=i.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),c=c.div(c.norm()),o=i.mmul(c).div(c.transpose().mmul(c).get(0,0))):o=a;if(i){let t=e.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0));t=t.div(t.norm());let n=e.clone().sub(a.clone().mmul(t.transpose())),r=o.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),s=i.clone().sub(a.clone().mulS(r.get(0,0)).mmul(c.transpose()));this.t=a,this.p=t.transpose(),this.w=l.transpose(),this.q=c,this.u=o,this.s=a.transpose().mmul(a),this.xResidual=n,this.yResidual=s,this.betas=r}else this.w=l.transpose(),this.s=a.transpose().mmul(a).sqrt(),this.t=n?a.clone().div(this.s.get(0,0)):a,this.xResidual=e.sub(a.mmul(l.transpose()))}}jw.AbstractMatrix=Fb,jw.CHO=Lb,jw.CholeskyDecomposition=Lb,jw.DistanceMatrix=Cb,jw.EVD=Tb,jw.EigenvalueDecomposition=Tb,jw.LU=Sb,jw.LuDecomposition=Sb;var Pb=jw.Matrix=yb;jw.MatrixColumnSelectionView=class extends _b{constructor(e,t){pb(e,t),super(e,e.rows,t.length),this.columnIndices=t}set(e,t,i){return this.matrix.set(e,this.columnIndices[t],i),this}get(e,t){return this.matrix.get(e,this.columnIndices[t])}},jw.MatrixColumnView=class extends _b{constructor(e,t){hb(e,t),super(e,e.rows,1),this.column=t}set(e,t,i){return this.matrix.set(e,this.column,i),this}get(e){return this.matrix.get(e,this.column)}},jw.MatrixFlipColumnView=class extends _b{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(e,this.columns-t-1,i),this}get(e,t){return this.matrix.get(e,this.columns-t-1)}},jw.MatrixFlipRowView=class extends _b{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(this.rows-e-1,t,i),this}get(e,t){return this.matrix.get(this.rows-e-1,t)}},jw.MatrixRowSelectionView=class extends _b{constructor(e,t){fb(e,t),super(e,t.length,e.columns),this.rowIndices=t}set(e,t,i){return this.matrix.set(this.rowIndices[e],t,i),this}get(e,t){return this.matrix.get(this.rowIndices[e],t)}},jw.MatrixRowView=class extends _b{constructor(e,t){lb(e,t),super(e,1,e.columns),this.row=t}set(e,t,i){return this.matrix.set(this.row,t,i),this}get(e,t){return this.matrix.get(this.row,t)}},jw.MatrixSelectionView=xb,jw.MatrixSubView=class extends _b{constructor(e,t,i,n,r){gb(e,t,i,n,r),super(e,i-t+1,r-n+1),this.startRow=t,this.startColumn=n}set(e,t,i){return this.matrix.set(this.startRow+e,this.startColumn+t,i),this}get(e,t){return this.matrix.get(this.startRow+e,this.startColumn+t)}},jw.MatrixTransposeView=class extends _b{constructor(e){super(e,e.columns,e.rows)}set(e,t,i){return this.matrix.set(t,e,i),this}get(e,t){return this.matrix.get(t,e)}},jw.NIPALS=Hb,jw.Nipals=Hb,jw.QR=Nb,jw.QrDecomposition=Nb,jw.SVD=Mb,jw.SingularValueDecomposition=Mb,jw.SymmetricMatrix=Ab,jw.WrapperMatrix1D=kb,jw.WrapperMatrix2D=Ib,jw.correlation=function(e,t=e,i={}){e=new yb(e);let n=!1;if("object"!=typeof t||yb.isMatrix(t)||ib.isAnyArray(t)?t=new yb(t):(i=t,t=e,n=!0),e.rows!==t.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:r=!0,scale:s=!0}=i;r&&(e.center("column"),n||t.center("column")),s&&(e.scale("column"),n||t.scale("column"));const o=e.standardDeviation("column",{unbiased:!0}),a=n?o:t.standardDeviation("column",{unbiased:!0}),c=e.transpose().mmul(t);for(let t=0;t<c.rows;t++)for(let i=0;i<c.columns;i++)c.set(t,i,c.get(t,i)*(1/(o[t]*a[i]))*(1/(e.rows-1)));return c},jw.covariance=function(e,t=e,i={}){e=new yb(e);let n=!1;if("object"!=typeof t||yb.isMatrix(t)||ib.isAnyArray(t)?t=new yb(t):(i=t,t=e,n=!0),e.rows!==t.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:r=!0}=i;r&&(e=e.center("column"),n||(t=t.center("column")));const s=e.transpose().mmul(t);for(let t=0;t<s.rows;t++)for(let i=0;i<s.columns;i++)s.set(t,i,s.get(t,i)*(1/(e.rows-1)));return s};var Ob=jw.default=yb;jw.determinant=function e(t){if((t=yb.checkMatrix(t)).isSquare()){if(0===t.columns)return 1;let i,n,r,s;if(2===t.columns)return i=t.get(0,0),n=t.get(0,1),r=t.get(1,0),s=t.get(1,1),i*s-n*r;if(3===t.columns){let s,o,a;return s=new xb(t,[1,2],[1,2]),o=new xb(t,[1,2],[0,2]),a=new xb(t,[1,2],[0,1]),i=t.get(0,0),n=t.get(0,1),r=t.get(0,2),i*e(s)-n*e(o)+r*e(a)}return new Sb(t).determinant}throw Error("determinant can only be calculated for a square matrix")};var Vb=jw.inverse=function(e,t=!1){return e=Ib.checkMatrix(e),t?new Mb(e).inverse():Rb(e,yb.eye(e.rows))};jw.linearDependencies=function(e,t={}){const{thresholdValue:i=1e-9,thresholdError:n=1e-9}=t;let r=(e=yb.checkMatrix(e)).rows,s=new yb(r,r);for(let t=0;t<r;t++){let o=yb.columnVector(e.getRow(t)),a=e.subMatrixRow(Bb(r,t)).transpose(),c=new Mb(a).solve(o),l=yb.sub(o,a.mmul(c)).abs().max();s.setRow(t,Db(l,c,t,i,n))}return s},jw.pseudoInverse=function(e,t=Number.EPSILON){if((e=yb.checkMatrix(e)).isEmpty())return e.transpose();let i=new Mb(e,{autoTranspose:!0}),n=i.leftSingularVectors,r=i.rightSingularVectors,s=i.diagonal;for(let e=0;e<s.length;e++)Math.abs(s[e])>t?s[e]=1/s[e]:s[e]=0;return r.mmul(yb.diag(s).mmul(n.transpose()))},jw.solve=Rb,jw.wrap=function(e,t){if(ib.isAnyArray(e))return e[0]&&ib.isAnyArray(e[0])?new Ib(e):new kb(e,t);throw new Error("the argument is not an array")};const qb=Pb;Ob.Matrix&&Ob.Matrix;const Qb=Vb;function Ub(e,t,i,n,r,s,o){let a=i,c=qb.eye(t.length,t.length,a);const l=r(t);let h=new Float64Array(e.x.length);for(let t=0;t<e.x.length;t++)h[t]=l(e.x[t]);let d=function(e,t,i,n,r,s){const o=i.length,a=e.x.length;let c=qb.zeros(o,a),l=0;for(let h=0;h<o;h++){if(0===n[h])continue;let o=n[h],d=i.slice();d[h]+=o;let u=r(d);if(s){d=i.slice(),d[h]-=o,o*=2;let t=r(d);for(let i=0;i<a;i++)c.set(l,i,(t(e.x[i])-u(e.x[i]))/o)}else for(let i=0;i<a;i++)c.set(l,i,(t[i]-u(e.x[i]))/o);l++}return c}(e,h,t,n,r,s),u=function(e,t){const i=e.x.length;let n=new qb(i,1);for(let r=0;r<i;r++)n.set(r,0,e.y[r]-t[r]);return n}(e,h),f=Qb(c.add(d.mmul(d.transpose().scale("row",{scale:o})))),p=d.mmul(u.scale("row",{scale:o}));return{perturbations:f.mmul(p),jacobianWeigthResidualError:p}}function jb(e,t,i={}){let{checkTimeout:n,minValues:r,maxValues:s,parameters:o,weightSquare:a,damping:c,dampingStepUp:l,dampingStepDown:h,maxIterations:d,errorTolerance:u,centralDifference:f,gradientDifference:p,improvementThreshold:g}=function(e,t,i){let{timeout:n,minValues:r,maxValues:s,initialValues:o,weights:a=1,damping:c=.01,dampingStepUp:l=11,dampingStepDown:h=9,maxIterations:d=100,errorTolerance:u=1e-7,centralDifference:f=!1,gradientDifference:p=.1,improvementThreshold:g=.001}=i;if(c<=0)throw new Error("The damping option must be a positive number");if(!e.x||!e.y)throw new Error("The data parameter must have x and y elements");if(!qw(e.x)||e.x.length<2||!qw(e.y)||e.y.length<2)throw new Error("The data parameter elements must be an array with more than 2 points");if(e.x.length!==e.y.length)throw new Error("The data parameter elements must have the same size");let m,w,b=o||new Array(t.length).fill(1),F=e.y.length,v=b.length;if(s=s||new Array(v).fill(Number.MAX_SAFE_INTEGER),r=r||new Array(v).fill(Number.MIN_SAFE_INTEGER),s.length!==r.length)throw new Error("minValues and maxValues must be the same size");if(!qw(b))throw new Error("initialValues must be an array");if("number"==typeof p)p=new Array(b.length).fill(p);else{if(!qw(p))throw new Error("gradientDifference should be a number or array with length equal to the number of parameters");p.length!==v&&(p=new Array(v).fill(p[0]))}if("number"==typeof a){let e=1/a**2;m=()=>e}else{if(!qw(a))throw new Error("weights should be a number or array with length equal to the number of data points");if(a.length<e.x.length){let e=1/a[0]**2;m=()=>e}else m=e=>1/a[e]**2}if(void 0!==n){if("number"!=typeof n)throw new Error("timeout should be a number");let e=Date.now()+1e3*n;w=()=>Date.now()>e}else w=()=>!1;let y=new Array(e.x.length);for(let e=0;e<F;e++)y[e]=m(e);return{checkTimeout:w,minValues:r,maxValues:s,parameters:b,weightSquare:y,damping:c,dampingStepUp:l,dampingStepDown:h,maxIterations:d,errorTolerance:u,centralDifference:f,gradientDifference:p,improvementThreshold:g}}(e,t,i),m=Qw(e,o,t,a),w=m<=u,b=0;for(;b<d&&!w;b++){let d=m,{perturbations:b,jacobianWeigthResidualError:F}=Ub(e,o,c,p,t,f,a);for(let e=0;e<o.length;e++)o[e]=Math.min(Math.max(r[e],o[e]-b.get(e,0)),s[e]);if(m=Qw(e,o,t,a),isNaN(m))break;if((d-m)/b.transpose().mmul(b.mulS(c).add(F)).get(0,0)>g?c=Math.max(c/h,1e-7):(m=d,c=Math.min(c*l,1e7)),n())throw new Error(`The execution time is over to ${i.timeout} seconds`);w=m<=u}return{parameterValues:o,parameterError:m,iterations:b}}class Gb{constructor(e){this.binScores=e}get_histogram(){let e=Math.max(...this.binScores),t=Math.floor(e/1e3),i=this.range(0,Math.floor(e/t)*t+t,t);const{counts:n,bins:r}=this.histogram(this.binScores,i);return{counts:n,bins:r}}range(e,t,i){const n=[];for(let r=e;r<t;r+=i)n.push(r);return n}histogram(e,t){const i=Array(t.length).fill(0);return e.forEach((e=>{for(let n=0;n<t.length-1;n++)if(e>=t[n]&&e<t[n+1]){i[n]++;break}})),{counts:i,bins:t}}normal_distribution([e,t,i]){return n=>e*Math.exp(-Math.pow(n-t,2)/(2*Math.pow(i,2)))/(Math.sqrt(2*Math.PI)*i)}get_initial_model_values(e,t){const i=t.slice(1,-1).reduce(((e,t)=>e+t),0);if(0===i)return console.debug("Problem with fit: all data points have zero value. Return zeros instead fit parameters!"),null;const n=(e[1]-e[0])*i,r=e.reduce(((e,i,n)=>e+i*t[n]),0)/i,s=e.reduce(((e,i,n)=>e+t[n]*Math.pow(i-r,2)),0),o=Math.sqrt(s/i);return[n,r,o]}normal_fit(e,t){const i={initialValues:this.get_initial_model_values(e,t),maxIterations:100};return jb({x:e,y:t},this.normal_distribution,i)}}class Wb{constructor(e,t){this.binSize=e,this.refGenome=t,this.gcBin=this.getGCbinSize()}getGCbinSize(){for(let e of[1e5,1e4])if(this.binSize%e==0)return e;return!1}async getBinGC(){const e={};if(!this.gcBin)return e;const t="https://storage.googleapis.com/cnvpytor_data/gcInfoData/GCinfo.json";try{const i=(await Mn.loadJson(t,{timeout:5e3})).find((e=>e.id===this.refGenome));if(!i)return console.warn("GC data not found for ",this.refGenome),e;const n=i.Bins.find((e=>e.BinSize===this.gcBin));if(!n)return console.warn("GC data not found for ",this.refGenome," Bin : ",this.gcBin),e;let r=`${t.split("/").slice(0,-1).join("/")}${n.fileURL}`;(await Mn.load(r,{})).split("\n").forEach((t=>{if(""!==t.trim()){const[i,n,r,s,o]=t.split("\t");e[i]||(e[i]=[]),e[i].push({start:+n,gcContent:+r,gcCount:+s,atCount:+o})}}))}catch(e){console.error(e),console.warn("Errors loading GC correction data.")}return e}}class $b extends Wb{constructor(e,t,i){super(t,i),this.wigFeatures=e,this.binSize=t,this.refGenome=i}async apply_gcCorrection(){if(!this.wigFeatures)return console.error("BinScore data is not available."),null;const e=Object.values(this.wigFeatures).reduce(((e,t)=>e.concat(t.filter((e=>e.binScore>0)).map((e=>e.binScore)))),[]);let t=new Gb(e);const{counts:i,bins:n}=t.get_histogram();let r=t.normal_fit(n,i);this.globalMean=r.parameterValues[1],this.globalStd=r.parameterValues[2],this.gcData=await this.getBinGC(),this.gcFlag=Object.keys(this.gcData).length>0,this.binScoreField=this.gcFlag?"gcCorrectedBinScore":"binScore",this.getGcCorrectionSignal(this.globalMean)}getGcCorrectionSignal(e){let t=this.getGcCorrection(e);Object.keys(this.wigFeatures).forEach((e=>{this.wigFeatures[e].forEach((e=>{e.binScore?e.gcCorrectedBinScore=Math.round(t[e.gc]*e.binScore):e.gcCorrectedBinScore=null}))}))}getGcCorrection(e){const t={};if(this.gcFlag){let i=this.getGCbinSize();const n={};let r=parseInt(this.binSize/i);for(let e in this.wigFeatures)for(let t=0;t<this.wigFeatures[e].length;t++){let i={AT:0,GC:0};for(let n=t*r;n<t*r+r;n++)this.gcData[e][n]&&(i.GC+=this.gcData[e][n].gcCount,i.AT+=this.gcData[e][n].atCount);let s=Math.round(100*i.GC/(i.GC+i.AT));this.wigFeatures[e][t].gc=s,n[s]||(n[s]=[]),this.wigFeatures[e][t].binScore&&n[s].push(this.wigFeatures[e][t].binScore)}Object.keys(n).forEach((i=>{let r,s=n[i];if(s.length<4)r=s.reduce(((e,t)=>e+t),0)/s.length;else{let e=new Gb(n[i]);const{counts:t,bins:s}=e.get_histogram();r=e.normal_fit(s,t).parameterValues[1]}t[i]=e/r}))}return t}formatDataStructure(e,t=1){const i=[];for(const[r,s]of Object.entries(this.wigFeatures))for(let r of s){var n={...r};1!=t&&(n.value=r[e]/t*2),i.push(n)}return i}formatDataStructure_BAF(e,t=-1){const i=[],n=[];for(const[r,s]of Object.entries(this.wigFeatures))s.forEach((r=>{var s={...r},o={...r};let a=r[e];.5!=a&&(o.value=t*(1-a),n.push(o)),s.value=t*a,i.push(s)}));return[i,n]}}function Kb(e){return e.reduce((function(e,t){return e>t?e:t}))}function Yb(e,t,i,n){return t*Math.exp(-1*(e-i)**2/(2*n**2))/Math.sqrt(2*Math.PI)/n}function Xb(e,t,i,n){return Math.exp(-1*(e-i)**2/(t**2+n**2))}function Zb(e,t){let i;try{i=e.reduce(((e,i,n)=>e+Math.min(i,t[n])))}catch{return console.log("Failed to find likelihood overlap: ",e,t),0}return i}function Jb(e,t,i,n){return 0==t&&0==n?{nl:.5*(e+i),ne:0}:{nl:(e*n*n+i*t*t)/(t*t+n*n),ne:Math.sqrt(t*t*n*n/(t*t+n*n))}}function eF(e,t){let i=parseInt(t*(e.length-1)),n=t*(e.length-1)-i;return i<e.length-1?e[i]*(1-n)+e[i+1]*n:e[i]}function tF(e){const t=e.length,i=Math.max(...e);let n=e.indexOf(i);n>Math.floor(t/2)&&(n=t-1-n);const r=(t/2-n)/(t+1),s=Math.floor((t/2+n)/2),o=t-1-s;let a=e.slice(s,o+1).reduce(((e,t)=>e+t),0)/e.reduce(((e,t)=>e+t),0);return n===Math.floor(t/2)&&(a=1),{mean:r,p:a}}var iF={CombinedCaller:class extends $b{constructor(e,t,i){super(e,t,i)}async call_2d(e=null,t=null,i="both",n=.1,r=0,s=10,o=0){await this.apply_gcCorrection();let a=this.gcFlag?"gcCorrectedBinScore":"binScore",c=null==e?.05*this.binSize/3e9:e,l=null==t?parseInt(this.binSize/1e4):t,h=[],d=[],u=[],f=[],p=[],g=[];for(const[e,t]of Object.entries(this.wigFeatures)){let e=[],i=[],s=[];t.forEach(((t,n)=>{t.hets_count>4&&t.dp_count>l&&t[a]&&(e.push([n]),i.push(t[a]),s.push(t.likelihood_score),delete t.likelihood_score)}));let o=[];for(let e=1;e<i.length;e++)o.push(Math.abs(i[e]-i[e-1]));let g=[0];for(let e=1;e<o.length;e++)g.push(Math.min(o[e-1],o[e]));g.push(0);let m=i.map(((e,t)=>Math.sqrt(Math.sqrt(e)**2+this.globalStd**2+Math.pow(g[t]/2,2)))),w=[];for(let t=0;t<e.length-1;t++){let n=0;try{n=Zb(s[t],s[t+1])}catch{console.log("Overlap failed: ",t,s[t],e[t+1],s[t+1])}let r=Xb(i[t],m[t],i[t+1],m[t+1]);w.push(r*n)}for(;w.length>0;){w=w.filter((e=>"number"==typeof e));let t=Kb(w);if(isNaN(t)&&console.log("NaN value",w),t<c)break;let n,r,o=w.indexOf(t),a=Jb(i[o],m[o],i[o+1],m[o+1]);try{n=s[o].map(((e,t)=>e*s[o+1][t])),r=n.reduce(((e,t)=>e+t))}catch{console.log(s),console.log("max_overlap:",t,o,w.length),console.log("likelihood: ",o,s[o],s[o+1]),console.log("nlh: ",r)}if(i[o]=a.nl,m[o]=a.ne,s[o]=n.map((function(e){return e/r})),e[o].push(...e[o+1]),i.splice(o+1,1),m.splice(o+1,1),e.splice(o+1,1),s.splice(o+1,1),w.splice(o,1),o<w.length){let e=Xb(i[o],m[o],i[o+1],m[o+1])*Zb(s[o],s[o+1]);w[o]=e}if(o>0){let e=Xb(i[o-1],m[o-1],i[o],m[o])*Zb(s[o-1],s[o]);w[o-1]=e}}let b=-1;for(;;){w=[];for(let t=0;t<i.length;t++)for(let r=t;r<i.length;r++)e[r][0]-e[t].at(-1)<n*(e[t].length+e[r].length)&&w.push(Xb(i[t],m[t],i[r],m[r])*Zb(s[t],s[r]));if(0==w.length)break;let t=Kb(w);if(t<c)break;let r=0,o=1;for(;r<e.length-1;){let a=Xb(i[r],m[r],i[o],m[o])*Zb(s[r],s[o]);if(e[o][0]-e[r].at(-1)<n*(e[r].length+e[o].length)&&a==t){let t=Jb(i[r],m[r],i[r+1],m[r+1]);i[r]=t.nl,m[r]=t.ne;let n=s[r].map(((e,t)=>e*s[r+1][t])),a=n.reduce(((e,t)=>e+t));s[r]=n.map((function(e){return e/a})),e[r].push(...e[r+1]),e[r]=e[r].sort(((e,t)=>e-t)),i.splice(o,1),m.splice(o,1),e.splice(o,1),s.splice(o,1),o>=e.length&&(r+=1,o=r+1)}else o+=1,o>=e.length&&(r+=1,o=r+1)}if(b==e.length)break;b=e.length}e.forEach(((e,n)=>{let o=tF(s[n]);e.length>1&&(e.forEach(((e,s)=>{d.push(t[e]),o.mean<=r&&h.push(t[e]),t[e].segment_score=i[n]})),u.push(i[n]),f.push(m[n]),p.push(s[n]))}))}let m=parseInt(1e3*(1-o));0==m&&(m=1);let w=Bw.linspace(o,1,m),b={},F={};for(let e=10;e>-1;e--)for(let t=0;t<e/2+1;t++){let n,r,s=e-t,o=w.map(((t,i)=>1-t+t*e/2)),a=e/2;e>0?(n=.5-t/(t+s),r=w.map(((e,i)=>.5-(1-e+e*t)/(2-2*e+(t+s)*e)))):(n=0,r=w.map(((e,t)=>0*e)));for(let i=0;i<u.length;i++){let c=Yb(a*this.globalMean,1,u[i],f[i])*eF(p[i],.5+n);i in F?F[i].push([e,t,s,c,1]):F[i]=[e,t,s,c,1];let l=0,h=0,d=0;o.forEach(((e,t)=>{if(!isNaN(r[t])){let n=Yb(e*this.globalMean,1,u[i],f[i])*eF(p[i],.5+r[t]);l+=n,n>h&&(h=n,d=w[t])}})),i in b?b[i].push([e,t,s,l/w.length,d]):b[i]=[e,t,s,l/w.length,d]}for(let e=0;e<u.length;e++)if("germline"==i)b[e].sort(((e,t)=>e[3]-t[3]));else if(b[e].sort(((e,t)=>e[3]-t[3])),"both"==i&&(F[e].sort(((e,t)=>e[3]-t[3])),F[e][0][3]>b[e][0][3])){let t=b[e].filter((t=>t[0]!=F[e][0][0]&&t[1]<=F[e][0][1]));b[e]=[F[e][0]].push(...t)}for(let e=0;e<u.length;e++)b[e][0][0],b[e][0][0],u[e],this.globalMean,Ow.t_test_1_sample(this.globalMean,u[e],f[e],g[e])}var v=this.formatDataStructure(this.wigFeatures,"binScore",this.globalMean);let y=[];return this.gcFlag&&(y=this.formatDataStructure(this.wigFeatures,"gcCorrectedBinScore",this.globalMean)),{binScore:v,gcCorrectedBinScore:y,segmentScore:this.formatDataStructure(this.wigFeatures,"segment_score",this.globalMean)}}formatDataStructure(e,t,i=1){const n=[];for(const[r,s]of Object.entries(e))s.forEach((e=>{var r={...e};1!=i&&(r.value=e[t]/i*2),n.push(r)}));return n}}};const nF=2871e6;function rF(e){for(var t=1,i=1,n=1*e,r=1;r<50;r++)t*=r,n+=(i*=-1)*Math.pow(e,2*r+1)/(t*(2*r+1));return 2*n/Math.sqrt(3.14159265358979)}function sF(e,t,i,n,r){var s=new cF(i.slice(n,r));return 0==s.std&&(s.std=t>0?t*s.mean/e:1),lF(e,s.mean,s.std,r-n)/(r-n)}function oF(e,t,i,n,r){var s=new cF(i.slice(n,r));if(s.mean<e){var o=(s.max-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1+rF(o)),r-n)}o=(s.min-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1-rF(o)),r-n)}function aF(e,t,i,n,r,s,o=1e3){for(var a=sF(e,t,i,n,r),c=0,l=!1;a>s&!l&c<o;){l=!0,c+=1;var[h,d,u,f]=[1e10,1e10,1e10,1e10];if(n>0&&(h=sF(e,t,i,n-1,r)),r-n>2)var d=sF(e,t,i,n+1,r),u=sF(e,t,i,n,r-1);if(r<i.length)var f=sF(e,t,i,n,r+1);Math.min[f]<a&&(l=!1,h==Math.min[f]&&(n-=1,a=h),elif(d==Math.min[f]),n+=1,a=d,elif(u==Math.min[f]),r-=1,a=u,elif(f==Math.min[f]),r+=1,a=f)}return a<=s?r:0}class cF{constructor(e){this.data=e,this.mean=e.reduce(((e,t)=>e+t))/e.length,this.std=Math.sqrt(e.reduce(((e,t)=>(t-this.mean)**2))/e.length)}}function lF(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-Ow.TdistributionCDF(Math.abs(r),n-1)}function hF(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-Ow.TdistributionCDF(Math.abs(o),parseInt(a+.5))}var dF={Partition:class{constructor(e,t,i){this.rd=e,this.mean=t,this.std=i,this.bin_bands=[2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128]}get_rd_signal_bandwidth(e){var t=[];return e.forEach(((e,i)=>{var n=0;n=e>this.mean/4?this.mean/(this.std**2*e):4/this.std**2,t.push(n)})),t}meanShiftCaller(e,t=3){var i={};return Object.entries(this.rd).forEach((([e,n])=>{var r=new Array(n.length).fill(!1),s=new Array(n.length);for(let e=0;e<n.length;e++)r[e]||(s[e]=n[e]);this.bin_bands.forEach(((e,i)=>{var o=r.map(((e,t)=>!e)),a=[];Object.entries(n).forEach((([e,t])=>{a.push(t.binScore)}));var c=[0],l=0;for(let e=0;e<r.length;e++)r[e]?l>0&&(c.push(c[c.length-1]+l-1),l=0):l+=1;c.shift();for(let i=0;i<t;i++){var h=this.get_rd_signal_bandwidth(a),d=new Array(a.length).fill(0);for(let t=0;t<a.length;t++)for(let i=t-3*e;i<=t+3*e+1;i++)if(!(i<0||i>=a.length||Math.abs(t-i)>=a.length)){var u=(i-t)*Math.exp(-.5*(i-t)**2/e**2)*Math.exp(-.5*(a[t]-a[i])**2*h[t]);d[t]+=u}for(var f=new Array,p=0;p<d.length-1;p++)d[p]<0&d[p+1]>=0&&f.push(p);f.push(d.length-1),f=f.concat(c).sort(((e,t)=>e-t)),f=Array.from(new Set(f));var g=0;for(p=0;p<f.length;p++){var m=a.slice(g,f[p]+1),w=m.reduce(((e,t)=>e+t))/m.length;a.fill(w,g,f[p]+1),g=f[p]+1}}p=0;for(var b=0;p<s.length;p++)o[p]&&(s[p]=a[b],b++);for(f=new Array,p=0;p<s.length-1;p++){Math.abs(s[p+1]-s[p])>.01&&f.push(p+1)}f.unshift(0),f.push(s.length),r=new Array(this.rd.length).fill(!1);for(p=1;p<f.length;p++){var F=[f[p-1],f[p]],v=[f[p-1],f[p-1]];if(!(p>1))continue;v[0]=f[p-2];var y=[f[p],f[p]];if(!(p<f.length-1))continue;y[1]=f[p+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(A<=1)continue;var x=new cF(s.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(s[v[0]]/this.mean)*this.std;if(Math.abs(s[v[0]]-s[F[0]])<k)continue;if(k=1.8*Math.sqrt(s[y[0]]/this.mean)*this.std,Math.abs(s[y[0]]-s[F[0]])<k)continue}else{var I=s.slice(v[0],v[1]),S=new cF(I),E=s.slice(y[0],y[1]),N=new cF(E);if(hF(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>.01/nF*bin_size*(A+C))continue;if(hF(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>.01/nF*bin_size*(A+_))continue}if(lF(this.mean,x.mean,x.std,x.data.length)>.05)continue;let e=a.slice(F[0],F[1]);var M=new cF(e);r.fill(!0,F[0],F[1]),s.fill(M.mean,F[0],F[1])}})),i[e]=s})),i}call_mean_shift(e=3){for(var t=new Array(this.rd.length).fill(!1),i=new Array(this.rd.length),n=0;n<this.rd.length;n++)t[n]||(i[n]=this.rd[n]);return this.bin_bands.forEach(((n,r)=>{var s=t.map(((e,t)=>!e)),o=[];s.forEach(((e,t)=>{e&&o.push(this.rd[t])}));for(var a=[0],c=0,l=0;l<t.length;l++)t[l]?c>0&&(a.push(a[a.length-1]+c-1),c=0):c+=1;a.shift();for(var h=0;h<e;h++){var d=this.get_rd_signal_bandwidth(o),u=new Array(o.length).fill(0);for(l=0;l<o.length;l++)for(var f=l-3*n;f<=l+3*n+1;f++)if(!(f<0||f>=o.length||Math.abs(l-f)>=o.length)){var p=(f-l)*Math.exp(-.5*(f-l)**2/n**2)*Math.exp(-.5*(o[l]-o[f])**2*d[l]);u[l]+=p}var g=new Array;for(l=0;l<u.length-1;l++)u[l]<0&u[l+1]>=0&&g.push(l);g.push(u.length-1),g=g.concat(a).sort(((e,t)=>e-t)),g=Array.from(new Set(g));var m=0;for(l=0;l<g.length;l++){var w=o.slice(m,g[l]+1),b=w.reduce(((e,t)=>e+t))/w.length;o.fill(b,m,g[l]+1),m=g[l]+1}}for(l=0,f=0;l<i.length;l++)s[l]&&(i[l]=o[f],f++);for(g=new Array,l=0;l<i.length-1;l++){Math.abs(i[l+1]-i[l])>.01&&g.push(l+1)}g.unshift(0),g.push(i.length),t=new Array(this.rd.length).fill(!1);for(l=1;l<g.length;l++){var F=[g[l-1],g[l]],v=[g[l-1],g[l-1]];if(l>1){v[0]=g[l-2];var y=[g[l],g[l]];if(l<g.length-1){y[1]=g[l+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(!(A<=1)){var x=new cF(i.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(i[v[0]]/this.mean)*this.std;if(Math.abs(i[v[0]]-i[F[0]])<k)continue;if(k=1.8*Math.sqrt(i[y[0]]/this.mean)*this.std,Math.abs(i[y[0]]-i[F[0]])<k)continue}else{var I=i.slice(v[0],v[1]),S=new cF(I),E=i.slice(y[0],y[1]),N=new cF(E);if(hF(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>3.483106931382794e-9*(A+C))continue;if(hF(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>3.483106931382794e-9*(A+_))continue}if(!(lF(this.mean,x.mean,x.std,x.data.length)>.05)){var M=new cF(this.rd.slice(F[0],F[1]));t.fill(!0,F[0],F[1]),i.fill(M.mean,F[0],F[1])}}}}}})),i}cnv_calling(e=1e5){var t=.25*this.mean,i=this.mean-t,n=this.mean+t,r=2971e6,s=this.meanShiftCaller(e),o={},a=[];return Object.entries(s).forEach((([c,l])=>{for(var h=!1;!h;){h=!0;var d=new Array(1).fill(0);for(let e=0;e<l.length-1;e++){Math.abs(l[e+1]-l[e])>.01&&d.push(e+1)}d.push(l.length);for(let e=0;e<d.length-2;e++){var u=Math.abs(l[d[e]]-l[d[e+1]]);if(u<t){var f=u+1,p=u+1;if(e>0&&(f=Math.abs(l[d[e]]-l[d[e-1]])),e<d.length-3&&(p=Math.abs(s[d[e+1]]-l[d[e+2]])),u<f&&u<p){h=!1;var g=new cF(l.slice(d[e],d[e+2]));l.fill(g.mean,d[e],d[e+2]),d.splice(e+1,e+1)}}}}var m=[];Object.entries(this.rd[c]).forEach((([e,t])=>{m.push(t.binScore)}));for(var w,b=new Array(l.length).fill(""),F=0,v=.05*e/r;F<l.length;){for(var y=F,A=F;F<l.length&l[F]<i;)F+=1;if((_=F)>A+1){var C=aF(this.mean,this.std,m,A,_,v);if(C){var _=C;b.fill("D",A,_)}}for(A=F;F<l.length&l[F]>n;)F+=1;(_=F)>A+1&&(C=aF(this.mean,this.std,m,A,_,v))&&(_=C,b.fill("A",A,_)),F==y&&(F+=1)}for(F=0;F<l.length;){for(;F<l.length&""!=b[F];)F+=1;for(A=F;F<l.length&l[F]<i;)F+=1;(_=F)>A+1&&(oF(this.mean,this.std,m,A,_)<1682935038707506e-26&&b.fill(["d"]*(_-A),A,_),F-=1),F+=1}(F=0)<l.length&&(w=b[F]),A=0;for(var x=[...m];F<l.length;){for(;b[F]==w&&!((F+=1)>=b.length););if(F>A){var k=new cF(x.slice(A,F));x.fill(k.mean,A,F)}F<l.length&&(w=b[F]),A=F}for(o[c]=x,F=0;F<l.length;){if(""==(w=b[F])){F+=1;continue}for(A=F;F<l.length&w==b[F];)F+=1;let t,i=new cF(x.slice(A,F)).mean/this.mean;t="D"==w?"deletion":"duplication";let n={chr:c,start:e*A+1,end:e*F,size:e*(F-A+1),value:2*i,event_type:t};a.push(n)}})),[o,a]}},MeanShiftCaller:class extends $b{constructor(e,t,i){super(e,t,i),this.binBands=[2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128]}async callMeanshift(e=3){await this.apply_gcCorrection();let t=this.partition();Object.entries(this.wigFeatures).forEach((([e,i])=>{i.forEach(((i,n)=>{t[e]&&(i.partitionLevel=parseInt(t[e][n]))}))}));return{binScore:this.formatDataStructure("binScore",this.globalMean),gcCorrectedBinScore:this.formatDataStructure("gcCorrectedBinScore",this.globalMean),segmentsCNV:this.formatDataStructure("partitionLevel",this.globalMean)}}getRDSignalBandWidth(e){const t=this.globalMean/4,i=4/this.globalStd**2;return e.map((e=>e>t?this.globalMean/(this.globalStd**2*e):i))}partition(e=3){let t={};Object.keys(this.wigFeatures).sort(((e,t)=>e.localeCompare(t,void 0,{numeric:!0}))).forEach((e=>{t[e]=this.wigFeatures[e]}));let i=this.gcFlag?"gcCorrectedBinScore":"binScore";var n={};for(const[o,a]of Object.entries(t)){var r=new Array(a.length).fill(!1),s=a.map(((e,t)=>r[t]?void 0:e[i]));this.binBands.forEach(((t,i)=>{var n=r.map(((e,t)=>!e)),o=s.filter(((e,t)=>!r[t])),a=[0],c=0;r.forEach((e=>{e?c>0&&(a.push(a[a.length-1]+c-1),c=0):e||c++})),a.shift();for(let i=0;i<e;i++){var l=this.getRDSignalBandWidth(o),h=new Array(o.length).fill(0);for(let e=0;e<o.length;e++){const i=Math.max(0,e-3*t),n=Math.min(o.length-1,e+3*t+1);for(let r=i;r<=n;r++){var d=(r-e)*Math.exp(-.5*(r-e)**2/t**2)*Math.exp(-.5*(o[e]-o[r])**2*l[e]);h[e]+=d}}for(var u=new Array,f=0;f<h.length-1;f++)h[f]<0&h[f+1]>=0&&u.push(f);u.push(h.length-1),u=u.concat(a).sort(((e,t)=>e-t)),u=Array.from(new Set(u));var p=0;for(f=0;f<u.length;f++){var g=o.slice(p,u[f]+1),m=g.reduce(((e,t)=>e+t))/g.length;o.fill(m,p,u[f]+1),p=u[f]+1}}f=0;for(var w=0;f<s.length;f++)n[f]&&(s[f]=o[w],w++);for(u=new Array,f=0;f<s.length-1;f++){Math.abs(s[f+1]-s[f])>.01&&u.push(f+1)}u.unshift(0),u.push(s.length),r=new Array(this.wigFeatures.length).fill(!1);for(f=1;f<u.length;f++){var b=[u[f-1],u[f]],F=[u[f-1],u[f-1]];if(!(f>1))continue;F[0]=u[f-2];var v=[u[f],u[f]];if(!(f<u.length-1))continue;v[1]=u[f+1];var y=b[1]-b[0],A=F[1]-F[0],C=v[1]-v[0];if(y<=1)continue;var _=new cF(s.slice(b[0],b[1]));if(C<=15||A<=15||y<=15){var x=1.8*Math.sqrt(s[F[0]]/this.globalMean)*this.globalStd;if(Math.abs(s[F[0]]-s[b[0]])<x)continue;if(x=1.8*Math.sqrt(s[v[0]]/this.globalMean)*this.globalStd,Math.abs(s[v[0]]-s[b[0]])<x)continue}else{var k=s.slice(F[0],F[1]),I=new cF(k),S=s.slice(v[0],v[1]),E=new cF(S);if(hF(_.mean,_.std,_.data.length,I.mean,I.std,I.data.length)>.01/nF*this.binSize*(y+A))continue;if(hF(_.mean,_.std,_.data.length,E.mean,E.std,E.data.length)>.01/nF*this.binSize*(y+C))continue}if(lF(this.globalMean,_.mean,_.std,_.data.length)>.05)continue;let e=o.slice(b[0],b[1]);var N=new cF(e);r.fill(!0,b[0],b[1]),s.fill(N.mean,b[0],b[1])}})),n[o]=s}return n}cnvCalling(e){var t=.25*this.globalMean,i=this.globalMean-t,n=this.globalMean+t,r=2971e6,s={},o=[];return Object.entries(e).forEach((([a,c])=>{for(var l=!1;!l;){l=!0;var h=new Array(1).fill(0);for(let e=0;e<c.length-1;e++){Math.abs(c[e+1]-c[e])>.01&&h.push(e+1)}h.push(c.length);for(let i=0;i<h.length-2;i++){var d=Math.abs(c[h[i]]-c[h[i+1]]);if(d<t){var u=d+1,f=d+1;if(i>0&&(u=Math.abs(c[h[i]]-c[h[i-1]])),i<h.length-3&&(f=Math.abs(e[h[i+1]]-c[h[i+2]])),d<u&&d<f){l=!1;var p=new cF(c.slice(h[i],h[i+2]));c.fill(p.mean,h[i],h[i+2]),h.splice(i+1,i+1)}}}}var g=[];Object.entries(this.wigFeatures[a]).forEach((([e,t])=>{g.push(t.binScore)}));for(var m,w=new Array(c.length).fill(""),b=0,F=.05*this.binSize/r;b<c.length;){for(var v=b,y=b;b<c.length&c[b]<i;)b+=1;if((C=b)>y+1){var A=aF(this.globalMean,this.std,g,y,C,F);if(A){var C=A;w.fill("D",y,C)}}for(y=b;b<c.length&c[b]>n;)b+=1;(C=b)>y+1&&(A=aF(this.globalMean,this.std,g,y,C,F))&&(C=A,w.fill("A",y,C)),b==v&&(b+=1)}for(b=0;b<c.length;){for(;b<c.length&""!=w[b];)b+=1;for(y=b;b<c.length&c[b]<i;)b+=1;(C=b)>y+1&&(oF(this.globalMean,this.std,g,y,C)<1682935038707506e-26&&w.fill(["d"]*(C-y),y,C),b-=1),b+=1}(b=0)<c.length&&(m=w[b]),y=0;for(var _=[...g];b<c.length;){for(;w[b]==m&&!((b+=1)>=w.length););if(b>y){var x=new cF(_.slice(y,b));_.fill(x.mean,y,b)}b<c.length&&(m=w[b]),y=b}for(s[a]=_,b=0;b<c.length;){if(""==(m=w[b])){b+=1;continue}for(y=b;b<c.length&m==w[b];)b+=1;let e,t=new cF(_.slice(y,b)).mean/this.globalMean;e="D"==m?"deletion":"duplication";let i={chr:a,start:this.binSize*y+1,end:this.binSize*b,size:this.binSize*(b-y+1),value:2*t,event_type:e};o.push(i)}})),[s,o]}}};class uF{constructor(e,t,i){this.allVariants=e,this.rowBinSize=1e4,this.binSize=t,this.binFactor=parseInt(t/this.rowBinSize),this.refGenome=i}async read_rd_baf(e="ReadDepth"){var t={};for(let e=this.allVariants.length-1;e>=0;e--){var i;let n=this.allVariants[e];this.allVariants.splice(e,1);let r=n.chr;i=Math.max(Math.floor(n.start/this.rowBinSize),0),t[r]||(t[r]=[]),t[r][i]||(t[r][i]={chr:r,start:i*this.rowBinSize,end:(i+1)*this.rowBinSize,dp_sum_score:0,dp_count:0,hets_count:0,hets:[]});const s=Object.values(n.calls);if(1!==s.length)throw Error(`Unexpected number of genotypes: ${s.length}. CNVPytor expects 1 and only 1 genotype`);const o=s[0],a=o.info.DP;a&&(t[r][i].dp_sum_score+=Number.parseInt(a),t[r][i].dp_count++);let c=o.info.AD.split(","),l=o.genotype;if(0==l[0]&&1==l[1]||1==l[0]&&0==l[1]){t[r][i].hets_count++;let e=parseInt(c[0]),n=parseInt(c[1]);t[r][i].hets.push({ref:e,alt:n})}}this.chromosomes=Object.keys(t);let n="ReadDepth"==e;var r,s=this.adjust_bin_size(t,n);if("ReadDepth"==e){let e=new dF.MeanShiftCaller(s,this.binSize,this.refGenome),t=await e.callMeanshift();r=[t.binScore,t.gcCorrectedBinScore,t.segmentsCNV];var o=e.formatDataStructure_BAF("max_likelihood",-1)}else if("2D"==e){let e=new iF.CombinedCaller(s,this.binSize,this.refGenome),t=await e.call_2d();r=[t.binScore,t.gcCorrectedBinScore,t.segmentScore];o=e.formatDataStructure_BAF("max_likelihood",-1)}return[r,o]}format_BAF_likelihood(e){const t=[];for(const[n,r]of Object.entries(e))for(let e of r){var i={...e};.5!=e.value&&(i.value=1-e.value,t.push(i))}return t}get_max_min_score(e){if(e.likelihood_score.length>0){const t=Math.max(...e.likelihood_score),i=e.likelihood_score.indexOf(t);e.value=Math.max(i/100,1-i/100),e.min_score=Math.min(i/100,1-i/100)}else e.score=0;return e}adjust_bin_size(e,t=!1){var i={};const n=this.binSize/150;for(let o of this.chromosomes){i[o]||(i[o]=[]);for(let a=0;a<e[o].length/this.binFactor;a++){const c=a;i[o][a]||(i[o][a]={chr:o,start:c*this.binSize,end:(c+1)*this.binSize,dp_count:0,hets_count:0,binScore:null,likelihood_score:[],dp_sum_score:0});for(var r=a*this.binFactor;r<this.binFactor*a+this.binFactor;r++)if(e[o][r]&&(i[o][a].dp_sum_score+=e[o][r].dp_sum_score,i[o][a].dp_count+=e[o][r].dp_count,i[o][a].hets_count+=e[o][r].hets_count,0!=e[o][r].hets.length))for(let t of e[o][r].hets)if(0==i[o][a].likelihood_score.length)i[o][a].likelihood_score=Bw.linspace(0,1,100).map(((e,i)=>fF(t.ref,t.alt,e)));else{var s=0;i[o][a].likelihood_score=Bw.linspace(0,1,100).map(((e,n)=>{var r=i[o][a].likelihood_score[n]*fF(t.ref,t.alt,e);return s+=r,r})),i[o][a].likelihood_score=Bw.linspace(0,1,100).map(((e,t)=>i[o][a].likelihood_score[t]/s))}i[o][a].dp_count>0&&(i[o][a].binScore=i[o][a].dp_sum_score/i[o][a].dp_count*n);const l=this.get_max_min_score(i[o][a]);i[o][a].max_likelihood=l.value,t&&delete i[o][a].likelihood_score}}return i}}function fF(e,t,i,n=!0){return Math.pow(i,e)*Math.pow(1-i,t)+Math.pow(i,t)*Math.pow(1-i,e)}class pF extends Pa{static DEFAULT_TRACK_HEIGHT=250;constructor(e,t){super(e,t)}init(e){this.featureType="numeric",this.type="cnvpytor",e.max||(this.defaultScale=!0,this.autoscale=!1),e.height||(e.height=pF.DEFAULT_TRACK_HEIGHT),this.type="cnvpytor",this.graphType=e.graphType||"points",this.bin_size=e.bin_size||1e5,this.signal_name=e.signal_name||"rd_snp",this.cnv_caller=e.cnv_caller||"2D",this.colors=e.colors||["gray","black","green","blue"],this.hasChroms={},super.init(e)}get supportsWholeGenome(){return!0}get_signals(){let e=[];return"rd_snp"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller,"BAF1","BAF2"]:"rd"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller]:"snp"==this.signal_name?e=["BAF1","BAF2"]:"cnh"==this.signal_name&&(e=[this.cnv_caller]),e}get_signal_colors(){return[{singal_name:"RD_Raw",color:this.colors[0]},{singal_name:"RD_Raw_gc_coor",color:this.colors[1]},{singal_name:"ReadDepth",color:this.colors[2]},{singal_name:"2D",color:this.colors[2]},{singal_name:"BAF1",color:this.colors[3]},{singal_name:"BAF2",color:this.colors[3]}]}async postInit(){if("vcf"==this.config.format){let e;this.featureSource?e=Object.values(this.featureSource.getAllFeatures()).flat():(this.featureSource=this.featureSource||Hl(this.config,this.browser.genome),this.header=await this.getHeader(),e=this.featureSource.reader.features);const t=this.browser.config.genome,i=new uF(e,this.bin_size,t);let n,r,s;this.wigFeatures_obj={},this.wigFeatures_obj[this.bin_size]={},"2D"==this.cnv_caller?(s=await i.read_rd_baf("2D"),n=s[0],r=s[1],this.wigFeatures_obj[this.bin_size]["2D"]=n[2],this.available_callers=["2D"]):(s=await i.read_rd_baf(),n=s[0],r=s[1],this.wigFeatures_obj[this.bin_size].ReadDepth=n[2],this.available_callers=["ReadDepth"]),this.wigFeatures_obj[this.bin_size].RD_Raw=n[0],this.wigFeatures_obj[this.bin_size].RD_Raw_gc_coor=n[1],this.wigFeatures_obj[this.bin_size].BAF1=r[0],this.wigFeatures_obj[this.bin_size].BAF2=r[1],this.available_bins=[this.bin_size],this.set_available_callers()}else{this.cnvpytor_obj=new Ew(this.config.url,this.bin_size);let e=[...new Set(this.browser.referenceFrameList.map((e=>e.chr)))],t=this.getAliasChromsList(e);this.wigFeatures_obj=await this.cnvpytor_obj.get_rd_signal(this.bin_size,t),this.update_hasChroms(this.wigFeatures_obj,e),this.available_bins=this.cnvpytor_obj.availableBins,this.available_bins.includes(this.bin_size)||(this.bin_size=this.available_bins.at(-1)),this.available_callers=this.cnvpytor_obj.callers,this.set_available_callers()}this.tracks=[];const e=[];this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(let t in this.wigFeatures_obj)for(const[i,n]of Object.entries(this.wigFeatures_obj[t]))if(this.signals.includes(i)){let t={type:"wig",isMergedTrack:!0};t.features=n,t.name=i,t.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(t);r?(r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+t),"function"==typeof r.postInit&&e.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(e)}getAliasChromsList(e){let t=e.map((e=>{let t=this.browser.genome.chromAlias.aliasRecordCache.get(e);return Object.values(t)}));return t=t.flat(),t}set_available_callers(){this.available_callers.includes(this.cnv_caller)||(this.available_callers.length>0?this.cnv_caller=this.available_callers[0]:this.cnv_caller=null)}async getHeader(){if(!this.header){if("function"==typeof this.featureSource.getHeader){const e=await this.featureSource.getHeader();e&&(this.callSets=e.callSets||[]),this.header=e}this.sampleKeys=this.callSets?this.callSets.map((e=>e.sample)):[],this.sampleNames=this.sampleKeys}return this.header}get height(){return this._height}set height(e){if(this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}menuItemList(){let e=[];void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e=e.concat(this.numericDataMenuItems()),e.push("<hr/>"),e.push("Bin Sizes");for(let t of this.available_bins)e.push({element:Ta(t,t===this.bin_size),click:async function(){this.bin_size=t,this.trackView.startSpinner(),await this.recreate_tracks(t),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}});e.push("<hr/>"),e.push("Signal Type");let t={rd_snp:"RD and BAF Likelihood",rd:"RD Signal",snp:"BAF Likelihood"};for(let i in t)e.push({element:Ta(t[i],i===this.signal_name),click:async function(){this.signal_name=i,await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}});e.push("<hr/>"),e.push("CNV caller");for(let t of this.available_callers)e.push({element:Ta(t,t===this.cnv_caller),click:async function(){this.cnv_caller=t,this.trackView.startSpinner(),await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}});if(this.variantState){e.push("<hr/>");for(let t of this.available_callers)e.push({label:"Convert to variant track",click:()=>{this.convertToVariant()}})}return e}async recreate_tracks(e){this.tracks=[];const t=[];if(!(e in this.wigFeatures_obj))if(Object.keys(this.hasChroms).length>0){let t=[...new Set(this.browser.referenceFrameList.map((e=>e.chr)))];"all"==t[0]&&(t=this.browser.genome.chromosomeNames),this.wigFeatures_obj={...this.wigFeatures_obj,...await this.cnvpytor_obj.get_rd_signal(e,t)},this.update_hasChroms(this.wigFeatures_obj,t)}else this.wigFeatures_obj={...this.wigFeatures_obj,...await this.cnvpytor_obj.get_rd_signal(e)};this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(const[i,n]of Object.entries(this.wigFeatures_obj[e]))if(this.signals.includes(i)){let e={type:"wig",isMergedTrack:!0};e.features=n,e.name=i,e.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(e);r?(r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+e),"function"==typeof r.postInit&&t.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(t)}update_hasChroms(e,t){for(let i in e)this.hasChroms[i]||(this.hasChroms[i]=new Set),t.forEach((e=>this.hasChroms[i].add(e)));return this.hasChroms}async getFeatures(e,t,i,n){if(Object.keys(this.hasChroms).length>0&&0!=this.hasChroms[this.bin_size].size){let e=[...new Set(this.browser.referenceFrameList.map((e=>e.chr)))];"all"==e[0]&&(e=this.browser.genome.chromosomeNames);let t=e.filter((e=>!this.hasChroms[this.bin_size].has(e)));if(0!=t.length){let e=this.getAliasChromsList(t),i=await this.cnvpytor_obj.get_rd_signal(this.bin_size,e);this.update_hasChroms(i,t);for(let e in i)for(const[t,n]of Object.entries(i[e]))await this.wigFeatures_obj[e][t].push(...n);for(let e of this.tracks)await e.featureSource.updateFeatures(this.wigFeatures_obj[this.bin_size][e.name])}}if(this.tracks){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n)));return Promise.all(r)}}getScaleFactor(e,t,i,n){return n?i/(Math.log10(t+1)-(e<=0?0:Math.log10(e+1))):i/(t-e)}computeYPixelValue(e,t){return(this.flipAxis?e-this.dataRange.min:this.dataRange.max-e)*t}computeYPixelValueInLogScale(e,t){let i=this.dataRange.max,n=this.dataRange.min;return i<=0?0:(n<=-1&&(n=0),n=n<=0?0:Math.log10(n+1),i=Math.log10(i+1),e=Math.log10(e+1),(this.flipAxis?e-n:i-e)*t)}draw(e){const t=e.features;if(!t)return;if(this.defaultScale&&("rd_snp"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||5}:"rd"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||0,max:this.config.max||this.dataRange.max||5}:"snp"==this.signal_name&&(this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||0})),this.autoscale&&(this.dataRange=function(e,t){let i=0,n=-Number.MAX_VALUE;for(let e of t)for(let t of e)void 0===t.value||Number.isNaN(t.value)||(i=Math.min(i,t.value),n=Math.max(n,t.value));return{min:i,max:n}}(e.referenceFrame.chr,t)),this.tracks)for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t[i],this.tracks[i].dataRange=this.dataRange,this.tracks[i].flipAxis=this.flipAxis,this.tracks[i].logScale=this.logScale,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}const i=this.getScaleFactor(this.dataRange.min,this.dataRange.max,e.pixelHeight,this.logScale),n=e=>this.logScale?this.computeYPixelValueInLogScale(e,i):this.computeYPixelValue(e,i);if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=n(t.y),r={strokeStyle:t.color,strokeWidth:1};t.dotted?fr.dashedLine(e.context,0,i,e.pixelWidth,i,5,r):fr.strokeLine(e.context,0,i,e.pixelWidth,i,r)}let r=n(2);fr.dashedLine(e.context,0,r,e.pixelWidth,r,5,{strokeStyle:"lightgray",strokeWidth:.5})}paintAxis(e,t,i){var n,r,s,o,a,c,l,h={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};if(void 0===this.dataRange||void 0===this.dataRange.max||void 0===this.dataRange.min)return;let d=void 0!==this.flipAxis&&this.flipAxis;function u(e){return e<0?Math.abs(e):0===e?"0":Math.abs(e)>=10||e%1==0?e.toFixed():Math.abs(e)>=1?e.toFixed(1):e.toFixed(2)}fr.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"}),n=(l=.95*t)-8,a={x:r=l,y:s=o=.01*i},fr.strokeLine(e,n,s,r,o,h),fr.fillText(e,u(d?this.dataRange.min:this.dataRange.max),n+4,s+12,h),c={x:r,y:s=o=.99*i},fr.strokeLine(e,n,s,r,o,h),fr.fillText(e,u(d?this.dataRange.max:this.dataRange.min),n+4,s-4,h),fr.strokeLine(e,a.x,a.y,c.x,c.y,h);const f=this.getScaleFactor(this.dataRange.min,this.dataRange.max,i,this.logScale),p=e=>this.logScale?this.computeYPixelValueInLogScale(e,f):this.computeYPixelValue(e,f),g=Math.ceil((this.dataRange.max-this.dataRange.min)/10);for(let t=Math.ceil(this.dataRange.min+1);t<Math.round(this.dataRange.max-.4);t+=g){const i=p(t);fr.strokeLine(e,45,i,50,i,h),fr.fillText(e,u(d?this.dataRange.max-t:t),44,i+4,h)}}popupData(e,t){const i=t||e.viewport.cachedFeatures;if(i&&i.length===this.tracks.length){const t=[];for(let n=0;n<this.tracks.length;n++){n>0&&t.push("<hr/>"),t.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${this.tracks[n].name}</div>`);const r=this.tracks[n].popupData(e,i[n]);t.push(...r)}return t}}async convertToVariant(){this.variantState&&(Object.setPrototypeOf(this,wF.prototype),this.init(this.variantState),await this.postInit(),this.trackView.clearCachedFeatures(),this.variantState.trackHeight&&this.trackView.setTrackHeight(this.variantState.trackHeight),this.trackView.checkContentHeight(),this.trackView.updateViews(),delete this.variantState)}}const gF=b,mF=10;class wF extends Pa{static defaultColor="rgb(0,0,150)";static defaults={displayMode:"EXPANDED",sortDirection:"ASC",showGenotypes:!0,expandedVariantHeight:10,squishedVariantHeight:2,squishedCallHeight:1,expandedCallHeight:10,expandedVGap:2,squishedVGap:1,expandedGroupGap:10,squishedGroupGap:5,featureHeight:14,noGenotypeColor:"rgb(200,180,180)",noCallColor:"rgb(225, 225, 225)",nonRefColor:"rgb(200, 200, 215)",mixedColor:"rgb(200, 220, 200)",homrefColor:"rgb(200, 200, 200)",homvarColor:"rgb(17,248,254)",hetvarColor:"rgb(34,12,253)",refColor:"rgb(0,0,220)",altColor:"rgb(255,0,0)",visibilityWindow:void 0,labelDisplayMode:void 0,type:"variant"};_sortDirections=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),e.variantHeight&&(this.expandedVariantHeight=e.variantHeight),this.featureSource=Hl(e,this.browser.genome),this.colorTables=new Map,e.colorTable){const t=e.colorBy||"*";this.colorTables.set(t,new Yn(e.colorTable))}if(this.strokecolor=e.strokecolor,this._context_hook=e.context_hook,e.color&&(this.colorBy=void 0),this.nVariantRows=1,e.samples)for(let t of e.samples)this.sampleKeys=e.samples;e.sort&&(this.initialSort=e.sort),this._colorByItems=new Map([["none","None"]])}async postInit(){if(this.header=await this.getHeader(),this.header.INFO){const e=new Set(Object.keys(this.header.INFO));this.config.colorBy?this.colorBy=this.config.colorBy:!this.config.color&&e.has("AF")&&(this.colorBy="AF"),e.has("AF")&&this._colorByItems.set("AF","Allele frequency"),e.has("VT")&&this._colorByItems.set("VT","Variant Type"),e.has("SVTYPE")&&this._colorByItems.set("SVTYPE","SV Type")}if(this.config.colorBy&&!this._colorByItems.has(this.config.colorBy)&&this._colorByItems.set(this.config.colorBy,this.config.colorBy),!this.disposed){if(this.header&&!this.sampleKeys&&(this.sampleKeys=this.header.sampleNameMap?Array.from(this.header.sampleNameMap.keys()):[]),void 0===this.visibilityWindow&&!1!==this.config.indexed){const e=_(this.config.url)?this.config.url.name:this.config.url;gF(e)&&e.toLowerCase().includes("gnomad")?this.visibilityWindow=1e3:"function"==typeof this.featureSource.defaultVisibilityWindow?this.visibilityWindow=await this.featureSource.defaultVisibilityWindow():this.visibilityWindow=1e6}return this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor,this}}get supportsWholeGenome(){return!this.config.indexURL||!0===this.config.supportsWholeGenome}get color(){return this._color||wF.defaultColor}set color(e){this._color=e,e&&(this.colorBy=void 0)}async getHeader(){return this.header||"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader()),this.header}getSampleCount(){return this.sampleKeys?this.sampleKeys.length:0}async getFeatures(e,t,i,n){void 0===this.header&&(this.header=await this.getHeader());const r=await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:this.visibilityWindow});if(this.initialSort){const e=this.initialSort;if(void 0===e.option||"GENOTYPE"===e.option.toUpperCase())this.sortSamplesByGenotype(e,r);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="ASC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return r}hasSamples(){return this.getSampleCount()>0}getSamples(){const e="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=t*(("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight)+e),r=mF+t*(i+e);return{names:this.sampleKeys,yOffset:r,height:n}}computePixelHeight(e){if(!e||0===e.length)return mF;const t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,n="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,r="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s=!1===this.showGenotypes?0:this.getSampleCount()*t;return mF+t*(n+i)+i+(s+1)*(r+i)}variantRowCount(e){this.nVariantRows=e}draw({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n,bpStart:r,pixelTop:s,features:o}){fr.fillRect(e,0,s,t,i,{fillStyle:"rgb(255, 255, 255)"});const a="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,c="COLLAPSED"===this.displayMode?1:this.nVariantRows,l="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight;this.variantBandHeight=mF+c*(l+a);let h=this.sampleColumns;const d=this.hasSamples();if(h&&d&&!1!==this.showGenotypes&&fr.strokeLine(e,0,this.variantBandHeight,t,this.variantBandHeight,{strokeStyle:"rgb(224,224,224) "}),o){const i="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,a=r+t*n+1;for(let t of o){if(this._filter&&!this._filter(t))continue;if(t.end<r)continue;if(t.start>a)break;const o="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,c=mF+("COLLAPSED"===this.displayMode?0:t.row*(o+s)),l=o;let h=(t.start-r)/n,u=(t.end-r)/n,f=Math.max(1,u-h);f<3?(f=3,h-=1):f>5&&(h+=1,f-=2);const p=t._f||t;let g;try{g=p.alleleFreq()}catch(e){console.log(e)}if("AF"===this.colorBy&&g){const t=Math.min(1,g)*l,i=l-t;e.fillStyle=p.isFiltered()?this.refColorFiltered:this.refColor,e.fillRect(h,c,f,i),e.fillStyle=p.isFiltered()?this.altColorFiltered:this.altColor,e.fillRect(h,c+i,f,t)}else e.fillStyle=this.getColorForFeature(p),e.fillRect(h,c,f,l);let m=this.getVariantStrokecolor(p);if(m&&(e.strokeStyle=m,e.strokeRect(h,c,f,l)),this.callContextHook(p,e,h,c,f,l),d&&!1!==this.showGenotypes){const t="COLLAPSED"===this.displayMode?1:this.nVariantRows;this.sampleYOffset=this.variantBandHeight+s,this.sampleHeight=t*(i+s);let n=0;for(let t of this.sampleKeys){const r=this.header.sampleNameMap.get(t),o=p.calls[r];if(o){const t="COLLAPSED"===this.displayMode?0:p.row,r=this.sampleYOffset+n*this.sampleHeight+t*(i+s);let a=!0,c=!0,l=!1;if(o.genotype)for(let e of o.genotype){if("."===e){l=!0;break}0!==e&&(c=!1),0===e&&(a=!1)}o.genotype?e.fillStyle=l?this.noCallColor:c?this.homrefColor:a?this.homvarColor:this.hetvarColor:e.fillStyle=this.noGenotypeColor,e.fillRect(h,r,f,i)}n++}}}}else console.log("No feature list")}get refColorFiltered(){return this._refColorFiltered||(this._refColorFiltered=un.addAlpha(this.refColor,.2)),this._refColorFiltered}get altColorFiltered(){return this._altColorFiltered||(this._altColorFiltered=un.addAlpha(this.altColor,.2)),this._altColorFiltered}getColorForFeature(e){const t=e._f||e;let i;if(this.colorBy&&"none"!==this.colorBy){const e=t.getAttributeValue(this.colorBy);i=void 0!==e?this.getVariantColorTable(this.colorBy).getColor(e):"gray"}else i=this.color?"function"==typeof this.color?this.color(e):this.color:"NONVARIANT"===t.type?this.nonRefColor:"MIXED"===t.type?this.mixedColor:this.color;return t.isFiltered()&&(i=un.addAlpha(i,.2)),i}getVariantStrokecolor(e){const t=e._f||e;let i;return i=this.strokecolor?"function"==typeof this.strokecolor?this.strokecolor(t):this.strokecolor:void 0,i}callContextHook(e,t,i,n,r,s){if(this._context_hook&&"function"==typeof this._context_hook){const o=e._f||e;t.save(),this._context_hook(o,t,i,n,r,s),t.restore()}}clickedFeatures(e){let t=super.clickedFeatures(e);const i="EXPANDED"===this.displayMode?this.expandedVGap:this.squishedVGap,n=i+("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight),r=e.y;if(r<=this.variantBandHeight){const e="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=Math.floor((r-mF)/(e+i));"COLLAPSED"!==this.displayMode&&(t=t.filter((e=>e.row===n)))}else if(this.sampleKeys){const e=r-this.variantBandHeight,i=Math.floor(e/this.sampleHeight);if(i>=0&&i<this.sampleKeys.length){const r=Math.floor((e-i*this.sampleHeight)/n),s="COLLAPSED"===this.displayMode?t:t.filter((e=>e.row===r)),o=this.sampleKeys[i],a=this.header.sampleNameMap.get(o);t=s.map((e=>{const t=e.calls[a];return t.genotypeString=function(e,t){if(e.genotype){let i="";if("."===t.alternateBases)i="No Call";else{const n=t.alternateBases.split(",");for(let r of e.genotype)if(i.length>0&&(i+=" | "),"."===r)i+=".";else if(0===r)i+=t.referenceBases;else{i+=n[r-1].replace("<","<")}}return i}}(t,e),t}))}}return t}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=this.browser.genome.id;let r=[];for(let e of t){const t=e._f||e;if(r.length>0&&r.push({html:'<hr style="border-top-width:2px ;border-color: #c9c3ba" />'}),"function"==typeof t.popupData){const e=t.popupData(i,n);Array.prototype.push.apply(r,e)}}return r}menuItemList(){const t=[];if(this.header.INFO&&this.header.INFO){const i=this._colorByItems;t.push("<hr/>");const n=e('<div class="igv-track-menu-category igv-track-menu-border-top">');n.textContent="Color by:",t.push({name:void 0,element:n,click:void 0,init:void 0});for(let e of i.keys()){const n=this.colorBy===e;t.push(this.colorByCB({key:e,label:i.get(e)},n))}t.push(this.colorByCB({key:"info",label:"Info field..."}))}if(!0===Xd(this.browser.sampleInfo,this.sampleKeys)){t.push("<hr/>"),t.push("Sort by attribute:");for(const e of this.browser.sampleInfo.attributeNames)if(this.sampleKeys.some((t=>{const i=this.browser.sampleInfo.getAttributes(t);return i&&i[e]}))){const i=document.createElement("div");i.innerHTML=` ${e.split(rd.emptySpaceReplacement).join(" ")}`;const n=()=>{const t=this._sortDirections.get(e)||1;this.sortByAttribute(e,t),this.config.sort={option:"ATTRIBUTE",attribute:e,direction:t>0?"ASC":"DESC"},this._sortDirections.set(e,-1*t)};t.push({element:i,click:n})}}t.push("<hr/>"),this.getSampleCount()>0&&(t.push({element:e('<div class="igv-track-menu-border-top">')}),t.push({element:Ta("Show Genotypes",this.showGenotypes),click:function(){this.showGenotypes=!this.showGenotypes,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.browser.sampleNameControl.performClickWithState(this.browser,this.showGenotypes),this.browser.sampleInfoControl.performClickWithState(this.browser,this.showGenotypes)}})),t.push({element:e('<div class="igv-track-menu-border-top">')});for(let e of["COLLAPSED","SQUISHED","EXPANDED"]){t.push({element:Ta({COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"}[e],e===this.displayMode),click:function(){this.displayMode=e,this.trackView.checkContentHeight(),this.trackView.repaintViews()}})}return this.browser.circularView&&(t.push("<hr>"),t.push({label:"Add SVs to circular view",click:function(){for(let e of this.trackView.viewports)this.sendChordsForViewport(e)}})),this.canCovertToPytor()&&(t.push("<hr>"),t.push({label:"Convert to CNVpytor track",click:function(){this.convertToPytor()}})),t}contextMenuItemList(e){const t=[];if(this.hasSamples()&&this.showGenotypes){const i=e.viewport.referenceFrame,n=e.genomicLocation,r=i.toBP(2.5),s=this._sortDirections.get("genotype")||1;this._sortDirections.set("genotype",-1*s),t.push({label:"Sort by genotype",click:t=>{const i={direction:s,option:"genotype",chr:e.viewport.referenceFrame.chr,start:Math.floor(n-r),end:Math.ceil(n+r)},o=e.viewport.cachedFeatures;this.sortSamplesByGenotype(i,o),this.config.sort=i}}),t.push("<hr/>")}if(this.browser.circularView){const i=e.viewport;t.push({label:"Add SVs to Circular View",click:()=>{this.sendChordsForViewport(i)}}),t.push("<hr/>")}return t}async sortSamplesByGenotype({chr:e,position:t,start:i,end:n,direction:r},s){if(void 0===i&&(i=t-1),void 0===n&&(n=t),s||(s=await this.featureSource.getFeatures({chr:e,start:i,end:n})),!s)return;const o=new Map,a="ASC"===r?1:-1;for(let e of s)if(!(e.end<i)){if(e.start>n)break;for(let t of e.calls){const e=t.sample,i=t.zygosityScore();o.set(e,o.has(e)?o.get(e)+i:i)}}this.sampleKeys.sort((function(e,t){let i=o.get(e)||0,n=o.get(t)||0;return a*(i-n)})),this.trackView.repaintViews()}sortByAttribute(e,t){this.config.sort={option:"ATTRIBUTE",attribute:e,direction:1===t?"ASC":"DESC"},this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}sendChordsForViewport(e){const t=e.referenceFrame;let i;if("all"===t.chr){const e=this.featureSource.getAllFeatures(),t=Object.keys(e).map((t=>e[t]));i=[].concat(...t)}else i=this.featureSource.featureCache.queryFeatures(t.chr,t.start,t.end);Kf(i.filter((e=>{const t=e._f||e;return t.info&&t.info.CHR2&&t.info.END&&(t.info.CHR2!==t.chr||Math.abs(Number.parseInt(t.info.END)-t.pos)>1e6)})).map((e=>{const t=e._f||e,i=Number.parseInt(t.info.END),n=i-100,r=i+100;return{uniqueId:`${t.chr}:${t.start}-${t.end}_${t.info.CHR2}:${t.info.END}`,refName:Wf(t.chr),start:t.start,end:t.end,mate:{refName:Wf(t.info.CHR2),start:n,end:r}}})),this,t,.5)}colorByCB(e,t){const i=Ta(e.label,t);if("info"!==e.key){function n(){const t="none"===e.key?void 0:e.key;this.colorBy=t,this.config.colorBy=t,this.trackView.repaintViews()}return{name:void 0,element:i,click:n,init:void 0}}{function r(e){this.browser.inputDialog.present({label:"Info field",value:"",callback:e=>{e?(this.colorBy=e,this._colorByItems.set(e,e)):this.colorBy=void 0,this.trackView.repaintViews()}},e)}return{name:void 0,element:i,dialog:r,init:void 0}}}getState(){const e=super.getState();return this.color&&"function"!=typeof this.color&&(e.color=this.color),e}getVariantColorTable(e){if(this.colorTables.has(e))return this.colorTables.get(e);if(this.colorTables.has("*"))return this.colorTables.get("*");{let t;if("SVTYPE"===e)t=bF;else t=new Kn("Set1");return this.colorTables.set(e,t),t}}paintAxis(){}canCovertToPytor(){return!this.config.indexURL&&(!!this.header&&(1===Object.keys(this.sampleKeys).length&&this.header.FORMAT&&this.header.FORMAT.AD&&this.header.FORMAT.DP))}async convertToPytor(){this.variantState={...this.config,...this.getState()},this.variantState.trackHeight=this.height,this.trackView.startSpinner(),setTimeout((async()=>{try{const e=Object.assign({},this.config);Object.setPrototypeOf(this,pF.prototype),this.init(e),await this.postInit(),this.trackView.clearCachedFeatures(),this.trackView.setTrackHeight(this.config.height||pF.DEFAULT_TRACK_HEIGHT),this.trackView.checkContentHeight(),this.trackView.updateViews()}finally{this.trackView.stopSpinner()}}),100)}getFilterableAttributes(){return this.header.INFO}_repackCachedFeatures(){for(let e of this.trackView.viewports)if(e.cachedFeatures){const t=this.config.maxRows||Number.MAX_SAFE_INTEGER;Ha(e.cachedFeatures,t,this._filter)}}}const bF=new Yn({DEL:"#ff2101",INS:"#001888",DUP:"#028401",INV:"#008688",CNV:"#8931ff",BND:"#891100","*":"#002eff"}),FF={timeout:5e3,type:"plain",url:"https://igv.org/genomes/locus.php?genome=$GENOME$&name=$FEATURE$",coords:0};async function vF(e,t){const i=e.searchConfig||FF;let n;t=t.toUpperCase();const r=e.tracks.filter((e=>e.searchable));for(let e of r){const i=await e.search(t);if(i)return i}if(e.config&&!1!==e.config.search)try{return n=await async function(e,t,i){let n=i.url.replace("$FEATURE$",t.toUpperCase());n.indexOf("$GENOME$")>-1&&(n=n.replace("$GENOME$",e.genome.id?e.genome.id:"hg19"));const r=i.timeout?{timeout:i.timeout}:void 0,s=await Mn.loadString(n,r);return function(e,t,i){let n;n="plain"===i.type?function(e,t){const i=[],n=v(t);for(let t of n){const n=t.split("\t");if(n.length>=3){const t=n[1].split(":"),r=t[1].split("-");i.push({chromosome:e.genome.getChromosomeName(t[0].trim()),start:parseInt(r[0].replace(/,/g,"")),end:parseInt(r[1].replace(/,/g,"")),name:n[0].toUpperCase()})}}return i}(e,t):JSON.parse(t);i.resultsField&&(n=n[i.resultsField]);if(n&&0!==n.length){const e=i.chromosomeField||"chromosome",t=i.startField||"start",r=i.endField||"end",s=i.coords||1;let o;o=Array.isArray(n)?n[0]:n,o.hasOwnProperty(e)&&o.hasOwnProperty(t)||console.error("Search service results must include chromosome and start fields: "+o);const a=o[e];let c=o[t]-s,l=o[r];void 0===l&&(l=c+1);const h={chr:a,start:c,end:l};if(!o.type||o.type,i.geneField&&i.snpField){const e=o[i.geneField]||o[i.snpField];e&&(h.name=e.toUpperCase())}return h}return}(e,s,i)}(e,t,i),n}catch(e){console.log("Search service not available "+e)}}function yF(e,t=!1){const i=e.split("\t");if(i.length>2)try{const e=i[0],t=parseInt(i[1].replace(/,/g,""),10)-1,n=parseInt(i[2].replace(/,/g,""),10);if(!isNaN(t)&&!isNaN(n))return{chr:e,start:t,end:n}}catch(e){}const n=e.split(":"),r={chr:n[0]};if(n.length>1){let e,i=n[1].split("-");if(i.length>2){if(!n[1].startsWith("-"))return;{const e=n[1].indexOf("-",1);if(e>0){i=[n[1].substring(0,e),n[1].substring(e+1)]}}}if(e=i[0].replace(/,/g,""),isNaN(e))return;if(r.start=parseInt(e,10)-1,r.end=r.start+1,1===i.length&&(r.start-=20,r.end+=20),2===i.length){if(e=i[1].replace(/,/g,""),isNaN(e))return;if(r.end=parseInt(e,10),r.start<0&&!t){const e=-extent.start;r.start+=e,r.end+=e}}}return r}class AF extends Pa{constructor(e,t){super(e,t)}init(e){super.init(e),this.type="qtl",this.name=e.name;const t=e.minLogP||e.min,i=e.maxLogP||e.max;this.dataRange={min:void 0!==t?t:3.5,max:i||25},this.autoscale=!i||e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||2,this.height=e.height||100,this.disableButtons=e.disableButtons,this.featureSource=Hl(e,this.browser.genome)}paintAxis(e,t,i){const n=(this.dataRange.max-this.dataRange.min)/i,r={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};fr.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});const s=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let o=4;o<=this.dataRange.max;o+=s){const s=.85*t,a=s-5,c=s,l=i-(o-this.dataRange.min)/n;fr.strokeLine(e,a,l,c,l,r),l>8&&fr.fillText(e,o,a-1,l+2,r)}r.textAlign="center",fr.fillText(e,"-log10(pvalue)",t/4,i/2,r,{rotate:{angle:-90}})}async getFeatures(e,t,i){const n=this.visibilityWindow;return await this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const{context:t,referenceFrame:i,pixelWidth:n,pixelHeight:r}=e;this.background&&fr.fillRect(t,0,0,n,r,{fillStyle:this.background}),fr.strokeLine(t,0,r-1,n,r-1,{strokeStyle:this.divider}),i.feature&&i.feature.match(/RS[0-9]+/);const s=i=>{const s=i?2*this.dotSize:this.dotSize,o=e.bpStart,a=(this.dataRange.max-this.dataRange.min)/r;for(let d of e.features){const u=(d.start-o+.5)/e.bpPerPixel;if(u<0)continue;if(u>n)break;const f=d.phenotype;let p;if(this.browser.qtlSelections.qtl?(l=this.browser.qtlSelections.qtl,h=d,p=l.chr===h.chr&&l.start===h.start&&l.pValue===h.pValue):p=this.browser.qtlSelections.snps.size>0?this.browser.qtlSelections.hasSnp(d.snp)&&this.browser.qtlSelections.hasPhenotype(f):this.browser.qtlSelections.hasPhenotype(f),!i||p){var c=-Math.log(d.pValue)/Math.LN10;if(c>=this.dataRange.min){let e;c>this.dataRange.max?(c=this.dataRange.max,e=!0):e=!1;const n=Math.max(0+s,r-Math.round((c-this.dataRange.min)/a));let o;d.px=u,d.py=n,d.radius=s,i&&p?(o=this.browser.qtlSelections.colorForGene(f),fr.setProperties(t,{fillStyle:o,strokeStyle:"black"})):(o=e?"rgb(150, 150, 150)":"rgb(180, 180, 180)",fr.setProperties(t,{fillStyle:o,strokeStyle:o})),fr.fillCircle(t,u,n,s),fr.strokeCircle(t,u,n,s)}}}var l,h};s(!1),s(!0)}popupData(e,t){if(void 0===t&&(t=e.viewport.cachedFeatures),!t||0===t.length)return[];const i=this.name,n=[];for(let r of this._clickedFeatures(e,t))n.length>0&&n.push("<hr/>"),"function"==typeof r.popupData?n.push(...r.popupData(e)):n.push({name:"snp id",value:r.snp},{name:"gene id",value:r.gencodeId},{name:"gene name",value:r.geneSymbol},{name:"p value",value:r.pValue},{name:"tissue",value:i});return n}_clickedFeatures(e,t){const i=(e,t)=>Math.sqrt((e.px-t.canvasX)*(e.px-t.canvasX)+(e.py-t.canvasY)*(e.py-t.canvasY)),n=t.filter((t=>i(t,e)<6));if(n.length>1){n.sort(((t,n)=>i(t,e)-i(n,e)));const t=i(n[0],e);return n.filter((n=>i(n,e)<=t))}return n}contextMenuItemList(e){const t=[],i=e.viewport.cachedFeatures;if(i){const n=this._clickedFeatures(e,i);n.length>0&&(t.push({label:"Highlight associated features",click:async()=>{this.browser.qtlSelections.clear();for(let e of n)this.browser.qtlSelections.qtl=e,this.browser.qtlSelections.addPhenotype(e.phenotype);this.browser.repaintViews()}}),t.push("<hr>"))}return t}menuItemList(){const e=[];return e.push(...this.numericDataMenuItems()),e.push("<hr/>"),e.push({label:"Search for...",dialog:function(e){this.browser.inputDialog.present({label:"Search for snp or phenotype",value:"",callback:async e=>{if(e){e=e.trim().toUpperCase();const t=t=>((t.phenotype&&t.phenotype.toUpperCase())===e||t.snp&&t.snp.toUpperCase()===e)&&-Math.log(t.pValue)/Math.LN10>this.dataRange.min;let i,n,r,s=await this.featureSource.findFeatures(t);if(0==s.length){await this.browser.search(e)&&(s=await this.featureSource.findFeatures(t))}if(s.length>0){this.browser.qtlSelections.clear();const t=new Set;i=s[0].chr,n=s[0].start,r=s[0].end;for(let o of s)o.snp&&o.snp.toUpperCase()===e&&this.browser.qtlSelections.addSnp(o.snp),this.browser.qtlSelections.addPhenotype(o.phenotype),t.add(o.phenotype),o.chr===i&&(n=Math.min(n,o.start),r=Math.max(r,o.end));const o=this.browser.genome.getChromosomeName(i);for(let e of t){const t=await vF(this.browser,e);t&&o===this.browser.genome.getChromosomeName(t.chr)&&(n=Math.min(n,t.start),r=Math.max(r,t.end))}const a=Math.floor(.1*(r-n));n=Math.max(0,n-a),r+=a,await this.browser.search(`${i}:${n}-${r}`)}}}},e)}}),e}doAutoscale(e){let t=this.config.max||25;if(e.length>0){const i=e.map((e=>-Math.log(e.pValue)/Math.LN10));i.sort(((e,t)=>e-t));t=i[Math.floor(i.length*(this.autoscalePercentile/100))]}return this.dataRange.max=Math.max(t,10),this.dataRange}}const CF={X:"rgb(204, 153, 0)",Y:"rgb(153, 204, 0)",Un:"darkGray)",1:"rgb(80, 80, 255)",2:"rgb(206, 61, 50)","2a":"rgb(210, 65, 55)","2b":"rgb(215, 70, 60)",3:"rgb(116, 155, 88)",4:"rgb(240, 230, 133)",5:"rgb(70, 105, 131)",6:"rgb(186, 99, 56)",7:"rgb(93, 177, 221)",8:"rgb(128, 34, 104)",9:"rgb(107, 215, 107)",10:"rgb(213, 149, 167)",11:"rgb(146, 72, 34)",12:"rgb(131, 123, 141)",13:"rgb(199, 81, 39)",14:"rgb(213, 143, 92)",15:"rgb(122, 101, 165)",16:"rgb(228, 175, 105)",17:"rgb(59, 27, 83)",18:"rgb(205, 222, 183)",19:"rgb(97, 42, 121)",20:"rgb(174, 31, 99)",21:"rgb(231, 199, 111)",22:"rgb(90, 101, 94)",23:"rgb(204, 153, 0)",24:"rgb(153, 204, 0)",25:"rgb(51, 204, 0)",26:"rgb(0, 204, 51)",27:"rgb(0, 204, 153)",28:"rgb(0, 153, 204)",29:"rgb(10, 71, 255)",30:"rgb(71, 117, 255)",31:"rgb(255, 194, 10)",32:"rgb(255, 209, 71)",33:"rgb(153, 0, 51)",34:"rgb(153, 26, 0)",35:"rgb(153, 102, 0)",36:"rgb(128, 153, 0)",37:"rgb(51, 153, 0)",38:"rgb(0, 153, 26)",39:"rgb(0, 153, 102)",40:"rgb(0, 128, 153)",41:"rgb(0, 51, 153)",42:"rgb(26, 0, 153)",43:"rgb(102, 0, 153)",44:"rgb(153, 0, 128)",45:"rgb(214, 0, 71)",46:"rgb(255, 20, 99)",47:"rgb(0, 214, 143)",48:"rgb(20, 255, 177)"};for(let iy of Object.keys(CF)){CF["chr"+iy]=CF[iy]}for(let ny=1;ny<=48;ny++){if(10===ny)continue;const ry=_F(ny);CF[ry]=CF[ny.toString()]}function _F(e){if(!+e)return!1;for(var t=String(+e).split(""),i=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],n="",r=3;r--;)n=(i[+t.pop()+10*r]||"")+n;return Array(+t.join("")+1).join("M")+n}class xF extends Pa{constructor(e,t){super(e,t)}init(e){super.init(e),this.useChrColors=void 0===e.useChrColors||e.useChrColors,this.trait=e.trait,this.posteriorProbability=e.posteriorProbability,this.valueProperty="bed"===e.format?"score":"value",this.height=e.height||100,this.autoscale=e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||3,this.popoverWindow=void 0===e.popoverWindow?1e8:e.popoverWindow,this.useChrColors?this.colorScale=new Yn(e.colorTable||CF):e.color?this.colorScale=new wl(e.color):this.colorScale=new pl(e.colorScale||{thresholds:[5e-8,5e-4,.5],colors:["rgb(255,50,50)","rgb(251,100,100)","rgb(251,170,170)","rgb(227,238,249)"]}),this.featureSource=Hl(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),this.autoscale||(this.posteriorProbability?this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?1:this.config.max}:this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?25:this.config.max}),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor,this}get supportsWholeGenome(){return!0}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.features,i=e.context,n=e.pixelWidth,r=e.pixelHeight;if(this.background&&fr.fillRect(i,0,0,n,r,{fillStyle:this.background}),fr.strokeLine(i,0,r-1,n,r-1,{strokeStyle:this.divider}),t){const s=e.bpPerPixel,o=e.bpStart,a=o+n*s+1;for(let e of t){const t=e.start;if(t<o)continue;if(t>a)break;let n;if(this.posteriorProbability)n=e[this.valueProperty];else{const t=e[this.valueProperty];if(!t)continue;n=-Math.log10(t)}const c=this.useChrColors?e._f?e._f.chr:e.chr:n,l=this.colorScale.getColor(c),h=(this.dataRange.max-this.dataRange.min)/r,d=Math.round((t-o)/s),u=Math.max(this.dotSize,r-Math.round((n-this.dataRange.min)/h));l&&fr.setProperties(i,{fillStyle:l,strokeStyle:"black"}),fr.fillCircle(i,d,u,this.dotSize),e.px=d,e.py=u}}}paintAxis(e,t,i){fr.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});var n={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};const r=(this.dataRange.max-this.dataRange.min)/i;if(this.posteriorProbability){const t=.1;for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);fr.strokeLine(e,45,t-2,50,t-2,n),fr.fillText(e,s.toFixed(1),44,t+2,n)}}else{const t=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);fr.strokeLine(e,45,t,50,t,n),fr.fillText(e,Math.floor(s),44,t+4,n)}}n.textAlign="center",this.posteriorProbability?fr.fillText(e,"PPA",t/2,i/2,n,{rotate:{angle:-90}}):fr.fillText(e,"-log10(pvalue)",t/2,i/2,n,{rotate:{angle:-90}})}popupData(e,t){void 0===t&&(t=e.viewport.cachedFeatures);let i=[];const n=e.viewport.trackView.track;if(t){let r=0;for(let s of t){const t=Math.abs(e.canvasX-s.px),o=Math.abs(e.canvasY-s.py);if(t<this.dotSize&&o<this.dotSize){if(r>0&&i.push("<HR/>"),5==r){i.push("...");break}if(s=s._f||s,"function"==typeof s.popupData)i=i.concat(s.popupData());else{const e=s[this.valueProperty],t=s.chr,r=F(s.start+1);i.push({name:"chromosome",value:t}),i.push({name:"position",value:r}),i.push({name:"name",value:s.name}),n.posteriorProbability?i.push({name:"posterior probability",value:e}):i.push({name:"pValue",value:e})}r++}}}return i}menuItemList(){return this.numericDataMenuItems()}doAutoscale(e){if(e.length>0){const t=this.valueProperty,i=this.posteriorProbability,n=e.map((function(e){const n=e[t];return{value:i?n:-Math.log(n)/Math.LN10}}));this.dataRange=Gs(n)}else this.posteriorProbability?this.dataRange={min:this.config.min||0,max:this.config.max||1}:this.dataRange={min:this.config.max||25,max:this.config.min||0};return this.dataRange}}class kF extends Pa{constructor(e,t){super(e,t)}init(e){super.init(e),this.autoscale=e.autoscale||void 0===e.max,this.dataRange={min:e.min||0,max:e.max},this.windowFunction=e.windowFunction||"mean",this.paintAxis=hl,this.graphType=e.graphType||"bar",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=Hl(this.config,this.browser.genome),this.visibilityWindow=-1,this.featureSource.visibilityWindow=this.visibilityWindow}async postInit(){if("function"==typeof this.featureSource.getHeader){if(this.header=await this.featureSource.getHeader(),this.disposed)return;if(this.sampleKeys=this.header.columnNames.slice(3),this.setTrackProperties(this.header),this.header.hasOwnProperty("clickToHighlight")){let e=this.header.clickToHighlight;this.config.clickToHighlight=e,this.config.samplesClickedToHighlight={}}if(this.header.hasOwnProperty("onlyHandleClicksForHighlightedSamples")&&(this.config.onlyHandleClicksForHighlightedSamples=!0),this.header.hasOwnProperty("highlight")){this.config.highlightSamples={};let e=this.header.highlight;Array.isArray(e)||(e=[e]);for(let t of e){const e=t.split(";");2===e.length&&(this.config.highlightSamples[e[0]]=e[1])}}}this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor}menuItemList(){return this.numericDataMenuItems()}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:0,end:Number.MAX_SAFE_INTEGER,visibilityWindow:this.visibilityWindow});let r,s;for(let e=1;e<n.length-1;e++)if(void 0===r&&n[e].end>t&&(r=e-1),void 0===s&&n[e].start>i){s=e+1;break}return void 0===r&&(r=0),void 0===s&&(s=n.length),n.slice(r,s)}draw(e){const{features:t,context:i,bpPerPixel:n,bpStart:r,pixelWidth:s,pixelHeight:o}=e,a=e=>(this.dataRange.max-e)/(this.dataRange.max-this.dataRange.min)*o,c=function(e){let t=Math.floor((e-r)/n);return isNaN(t)&&console.warn("isNaN(x). feature start "+F(e)+" bp start "+F(r)),t};if(t&&t.length>0&&(void 0===this.dataRange.min&&(this.dataRange.min=0),this.dataRange.max>this.dataRange.min)){const e=this.config.highlightSamples,n=this.config.onlyHandleClicksForHighlightedSamples,r=this.config.clickToHighlight;let s=-1,o={},l=[],h=[];this.clickDetectorCache={};for(let d of t){const t=c(d.start),u=c(d.end),f=s>=0?c(s):t;if(!isNaN(t)&&!isNaN(u)){this.clickDetectorCache[t]=[],this.clickDetectorCache[u]=[];for(let s=0;s<d.values.length;s++){const c=this.sampleKeys[s],p=d.values[s],g=a(p);if(t-f>=1){const s=o[c],h=a(s),d=e&&e[c];d?l.push([f,h,t,g,d]):r&&c in this.config.samplesClickedToHighlight?l.push([f,h,t,g,this.config.samplesClickedToHighlight[c]]):fr.strokeLine(i,f,h,t,g,{strokeStyle:"#D9D9D9"}),n&&!(c in e)||this.clickDetectorCache[t].push([f,h,t,g,c,d||"gray"])}if(u-t>=1){const s=e&&e[c];s?h.push([t,g,u,g,s]):r&&c in this.config.samplesClickedToHighlight?h.push([t,g,u,g,this.config.samplesClickedToHighlight[c]]):fr.strokeLine(i,t,g,u,g,{strokeStyle:"gray"}),n&&!(c in e)||this.clickDetectorCache[u].push([t,g,u,g,c,s||"gray"])}o[c]=p}s=d.end}}for(let e of l)fr.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:1.3});for(let e of h)fr.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:2})}(e=>{if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=a(t.y),n={strokeStyle:t.color,strokeWidth:2};t.dotted?fr.dashedLine(e.context,0,i,e.pixelWidth,i,5,n):fr.strokeLine(e.context,0,i,e.pixelWidth,i,n)}})(e)}doAutoscale(e){let t,i;return e.length>0?(t=Number.MAX_VALUE,i=-Number.MAX_VALUE,e.forEach((function(e){t=Math.min(t,...e.values),i=Math.max(i,...e.values)})),t-=.01,i+=.01):(t=0,i=100),{min:t,max:i}}clickedFeatures(e){const t=e.canvasX,i=e.canvasY;let n=null;for(n of Object.keys(this.clickDetectorCache))if(n=parseInt(n),n>=t)break;if(n){let e=Number.MAX_VALUE,o=[];const a=this.clickDetectorCache[n];for(let n of a){const r=n[0],s=n[2];if(t<r||t>s)return[];const a=n[1],c=n[3];if(i<Math.min(a,c)-10||i>Math.max(a,c)+10)continue;const l=IF(t,i,r,a,s,c);l<e&&(o=[{name:n[4],color:n[5]}],e=l)}if(e<5){if(this.config.clickToHighlight){if(o[0].name in this.config.samplesClickedToHighlight)delete this.config.samplesClickedToHighlight[o[0].name];else if("any"===this.config.clickToHighlight){var r=["red","darkblue","green","teal","olivedrab","orange","maroon","purple","blue","gold"],s=r[Math.floor(Math.random()*(r.length+1))];this.config.samplesClickedToHighlight[o[0].name]=s}else this.config.samplesClickedToHighlight[o[0].name]=this.config.clickToHighlight;this.trackView.repaintViews()}return o}}return[]}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];return t.forEach((function(e){for(let t of Object.keys(e))Us(e[t])&&i.push({name:t,value:e[t]})})),i}get supportsWholeGenome(){return!1}}function IF(e,t,i,n,r,s){const o=r-i,a=s-n,c=Math.abs(o*(n-t)-(i-e)*a),l=Math.sqrt(o*o+a*a);return l>0?c/l:0}class SF extends Pa{static defaults={height:300,theta:Math.PI/2,arcOrientation:"UP"};constructor(e,t){super(e,t),!1===e.arcOrientation?this.arcOrientation="DOWN":!0===e.arcOrientation?this.arcOrientation="UP":e.arcOrientation?this.arcOrientation=e.arcOrientation.toUpperCase():this.arcOrientation="UP","bp"===e.format?this.featureSource=new NF(e,t.genome):this.featureSource=new Sl(e,t.genome)}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.context,i=Math.PI/2,n=e.pixelWidth,r=e.pixelHeight;e.viewportWidth;const s=e.bpPerPixel,o=e.bpStart,a=s,c="UP"===this.arcOrientation;fr.fillRect(t,0,e.pixelTop,n,r,{fillStyle:"rgb(255, 255, 255)"});const l=e.features;if(l){EF(l,1);for(let e of l)if(e.startLeft){let n=Math.round((e.startLeft-o)/a),r=Math.round((e.startRight-o)/a),s=Math.round((e.endLeft-o)/a),l=Math.round((e.endRight-o)/a);t.fillStyle=e.color,t.strokeStyle=e.color,t.beginPath();let h=(n+l)/2,d=(l-n)/2,u=this.height,f=Math.PI+(Math.PI/2-i),p=2*Math.PI-(Math.PI/2-i);c?(t.arc(h,u,d,f,p),t.lineTo(s,u)):(u=0,t.arc(h,u,d,p,f),t.lineTo(l,u));const g=(r+s)/2,m=(s-r)/2,w=u;c?(t.arc(g,w,m,p,f,!0),t.lineTo(n,w)):(t.arc(g,w,m,f,p,!0),t.lineTo(s,w)),t.stroke(),t.fill(),e.drawState={x1:h,y1:u,r1:d,x2:g,y2:w,r2:m,sa:f,ea:p}}else{let n=Math.round((e.start-o)/a),r=Math.round((e.end-o)/a);t.strokeStyle=e.color,t.beginPath();let s=(n+r)/2,l=(r-n)/2,h=this.height,d=Math.PI+(Math.PI/2-i),u=2*Math.PI-(Math.PI/2-i);c?t.arc(s,h,l,d,u):(h=0,t.arc(s,h,l,u,d)),t.stroke(),e.drawState={x1:s,y1:h,r1:l,sa:d,ea:u}}}}clickedFeatures(e){const t=super.clickedFeatures(e),i=[];EF(t,-1);for(let n of t){const t=n.drawState,r=e.canvasX-t.x1,s=e.canvasY-t.y1,o=Math.sqrt(r*r+s*s),a=t.r1+3;let c,l;if(void 0===t.x2)c=o,l=t.r1-3;else{const i=e.canvasX-t.x2,n=e.canvasY-t.y2;c=Math.sqrt(i*i+n*n),l=t.r2-3}if(o<a&&c>l){i.push(n);break}}return i}popupData(e,t){if(void 0===t&&(t=this.clickedFeatures(e)),t&&t.length>0)return this.extractPopupData(t[0],this.getGenomeId())}menuItemList(){return[{name:"Toggle arc direction",click:function(){this.arcOrientation="UP"===this.arcOrientation?"DOWN":"UP",this.trackView.repaintViews()}}]}}function EF(e,t){e.sort((function(e,i){const n=void 0===e.score?-Number.MAX_VALUE:e.score,r=void 0===i.score?-Number.MAX_VALUE:i.score;return(void 0===t?1:t)*(n-r)}))}class NF{constructor(e,t){this.config=e,this.genome=t}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){const s=this.genome;if(this.featureCache)return this.featureCache.queryFeatures(e,t,i);{const n=js(this.config),r=await Mn.loadByteArray(this.config.url,n);return this.featureCache=new On(function(e){if(!e)return null;const t=wc(e);let i,n=!0;const r=[],s=[],o=[];for(;void 0!==(i=t.nextLine());){const e=i.split("\t");if(n&&i.startsWith("color:")){const t="rgb("+e[1]+","+e[2]+","+e[3]+")";r.push(t),e.length>4&&s.push(e[4])}else{n=!1;const t=e[0],i=Number.parseInt(e[1])-1,c=Number.parseInt(e[2])-1,l=Number.parseInt(e[3]),h=Number.parseInt(e[4]);var a=Number.parseInt(e[5]);const d=r[a];let u;u=i<=h?{chr:t,startLeft:Math.min(i,c),startRight:Math.max(i,c),endLeft:Math.min(l,h),endRight:Math.max(l,h),color:d,score:a}:{chr:t,startLeft:Math.min(l,h),startRight:Math.max(l,h),endLeft:Math.min(i,c),endRight:Math.max(i,c),color:d,score:a},u.start=u.startLeft,u.end=u.endRight,s.length>a&&(u.description=s[a]),o.push(u)}}return o}(r),s),this.featureCache.queryFeatures(e,t,i)}}}class MF{constructor(e){this.browser=e,this.type="ideogram",this.id="ideogram",this.height=e.config.showCytobandNames?20:16,this.order=Number.MIN_SAFE_INTEGER,this.disableButtons=!0,this.ignoreTrackMenu=!0,this.showCytobandNames=e.config.showCytobandNames}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,features:r}){const s=t.chr,o=t.genome.getChromosome(s);if(void 0===o||i<=0||n<=0||"all"===s.toLowerCase())return;!function({ctx:e,chr:t,referenceFrame:i,genome:n,width:r,height:s,stainColors:o,features:a,showCytobandNames:c}){const l=1,h=.5*l,d=0;if(void 0===n)return;fr.fillRect(e,0,0,r,s,{fillStyle:un.greyScale(255)});const u=a;if(u){const t=d+s/2,i=[],n=[];if(0===u.length)return;const a=r/u[u.length-1].end;e.beginPath(),fr.roundRect(e,h,h+d,r-2*h,s-2*h,(s-2*h)/2,0,1),e.clip();for(let r=0;r<u.length;r++){const h=u[r],f=a*h.start,p=a*h.end;if("c"===h.type)"p"===h.name.charAt(0)?(i[0]=f,n[0]=s+d,i[1]=f,n[1]=d,i[2]=p,n[2]=t):(i[0]=p,n[0]=s+d,i[1]=p,n[1]=d,i[2]=f,n[2]=t),e.fillStyle="rgb(150, 0, 0)",e.strokeStyle="rgb(150, 0, 0)",fr.polygon(e,i,n,1,0);else{const t=BF(o,h);e.fillStyle=t.color,fr.fillRect(e,f,l+d,p-f,s-2*l),c&&RF(e,h.name,f,p,d,s,t.shade)}}}e.strokeStyle=un.greyScale(41),fr.roundRect(e,h,h+d,r-2*h,s-2*h,(s-2*h)/2,0,1)}({ctx:e,features:r,chr:s,referenceFrame:t,genome:t.genome,width:i,height:n,stainColors:[],showCytobandNames:this.showCytobandNames});const a=Math.round(t.bpPerPixel*i),c=t.start;let l=o.bpLength;const h=t.genome.getCytobands(s);if(h&&h.length>0&&h[h.length-1].end&&(l=Math.max(l,h[h.length-1].end),o.bpLength=l),a<l){const t=a/l,r=c/l;let s=Math.floor(r*i),o=Math.floor(t*i);s=Math.max(0,s),s=Math.min(i-o,s),e.save(),e.strokeStyle="red",e.lineWidth=o<2?1:2;const h=s+e.lineWidth/2;o=o<2?1:o-e.lineWidth;const d=e.lineWidth/2,u=n-e.lineWidth;e.strokeRect(h,d,o,u),e.restore()}}dispose(){this.trackView=void 0}}function RF(e,t,i,n,r,s,o){const a=s-4,c=n-i;let l=a-4;do{e.font=`${l}px sans-serif`;if(e.measureText(t).width<=c)break;l-=1}while(l>4);e.save(),e.beginPath(),e.rect(i,2+r,c,a),e.clip();const h=i+c/2,d=2+r+a/2+1;let u;u=null!==o?.2126*o+.7152*o+.0722*o:39.764;const f=u<128?"white":"black";fr.fillText(e,t,h,d,{fillStyle:f,textAlign:"center",textBaseline:"middle",font:`${l}px sans-serif`}),e.restore()}function BF(e,t){if("c"===t.type)return{color:"rgb(150, 10, 10)",shade:null};{let n=t.stain,r=230;"p"===t.type&&(r=Math.floor(230-n/100*230));var i=e[r];return i||(i="rgb("+r+","+r+","+r+")",e[r]=i),{color:i,shade:r}}}let DF=new Kn("Dark2");["GT/AG","CT/AC","GC/AG","CT/GC","AT/AC","GT/AT","non-canonical"].forEach((e=>{DF.getColor(e)}));class TF extends Pa{static defaults={margin:10,colorByNumReadsThreshold:5,height:100};constructor(e,t){super(e,t)}init(e){super.init(e),this.type=e.type||"junctions",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=e.featureSource?e.featureSource:Hl(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow()),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor,this}get supportsWholeGenome(){return!1}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}computePixelHeight(e){return this.height}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=e.pixelHeight,a=r+s*n+1;if(this.isMergedTrack||fr.fillRect(i,0,e.pixelTop,s,o,{fillStyle:"rgb(255, 255, 255)"}),t){const s={};s.referenceFrame=e.viewport.referenceFrame,s.referenceFrameStart=s.referenceFrame.start,s.referenceFrameEnd=s.referenceFrameStart+s.referenceFrame.toBP(e.viewport.getWidth()),s.featureZoomOutTracker={};for(let e of t)if(!(e.end<r)){if(e.start>a)break;this.renderJunction(e,r,n,o,i,s)}}else console.log("No feature list")}renderJunction(e,t,i,n,r,s){e.isVisible=!1;const o=Math.round((e.start-t)/i),a=Math.round((e.end-t)/i),c=(o+a)/2;if(a-o<=3){if(c in s.featureZoomOutTracker)return;s.featureZoomOutTracker[c]=!0}if(this.config.hideAnnotatedJunctions&&"true"===e.attributes.annotated_junction)return;if(this.config.hideUnannotatedJunctions&&"false"===e.attributes.annotated_junction)return;if(this.config.hideMotifs&&this.config.hideMotifs.includes(e.attributes.motif))return;if(this.config.hideStrand===e.strand)return;if(this.config.minJunctionEndsVisible){let t=0;if(e.start>=s.referenceFrameStart&&e.start<=s.referenceFrameEnd&&(t+=1),e.end>=s.referenceFrameStart&&e.end<=s.referenceFrameEnd&&(t+=1),t<this.config.minJunctionEndsVisible)return}let l,h,d,u;if(e.attributes.uniquely_mapped){if(l=parseInt(e.attributes.uniquely_mapped),l<this.config.minUniquelyMappedReads)return;if(h=parseInt(e.attributes.multi_mapped),d=l+h,d<this.config.minTotalReads)return;if(d>0&&h/d>this.config.maxFractionMultiMappedReads)return;if(e.attributes.maximum_spliced_alignment_overhang&&parseInt(e.attributes.maximum_spliced_alignment_overhang)<this.config.minSplicedAlignmentOverhang)return}if(e.attributes.num_samples_with_this_junction){if(u=parseInt(e.attributes.num_samples_with_this_junction),this.config.minSamplesWithThisJunction&&u<this.config.minSamplesWithThisJunction)return;if(this.config.maxSamplesWithThisJunction&&u>this.config.maxSamplesWithThisJunction)return;if(e.attributes.num_samples_total&&(e.attributes.percent_samples_with_this_junction=100*u/Number(e.attributes.num_samples_total),this.config.minPercentSamplesWithThisJunction&&(e.attributes.percent_samples_with_this_junction<this.config.minPercentSamplesWithThisJunction||e.attributes.percent_samples_with_this_junction>this.config.maxPercentSamplesWithThisJunction)))return}const f=this.margin,p=n,g=f+.5*p;let m=f;const w=f+p-10,b=(o+c)/2,F=(c+a)/2;let v,y,A=1;e.attributes.line_width?A=Number(e.attributes.line_width):(void 0===this.config.thicknessBasedOn||"numUniqueReads"===this.config.thicknessBasedOn?A=l:"numReads"===this.config.thicknessBasedOn?A=d:"numSamplesWithThisJunction"===this.config.thicknessBasedOn&&void 0!==u&&(A=u),A=1+Math.log(A+1)/Math.log(12)),void 0===this.config.bounceHeightBasedOn||"random"===this.config.bounceHeightBasedOn?v=(e.start+e.end)%7:"distance"===this.config.bounceHeightBasedOn?v=6*(e.end-e.start)/(s.referenceFrameEnd-s.referenceFrameStart):"thickness"===this.config.bounceHeightBasedOn&&(v=2*A),m+=p*Math.max(7-v,0)/10,y=e.attributes.color?e.attributes.color:void 0===this.config.colorBy||"numUniqueReads"===this.config.colorBy?l>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"numReads"===this.config.colorBy?d>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"isAnnotatedJunction"===this.config.colorBy?"true"===e.attributes.annotated_junction?"#b0b0ec":"orange":"strand"===this.config.colorBy?"+"===e.strand?"#b0b0ec":"#ecb0b0":"motif"===this.config.colorBy?DF.getColor(e.attributes.motif):"#AAAAAA";let C="";e.attributes.label?C=e.attributes.label.replace(/_/g," "):void 0===this.config.labelWith||"uniqueReadCount"===this.config.labelWith?C=l:"totalReadCount"===this.config.labelWith?C=d:"numSamplesWithThisJunction"===this.config.labelWith?void 0!==u&&(C=u):"percentSamplesWithThisJunction"===this.config.labelWith?void 0!==e.attributes.percent_samples_with_this_junction&&(C=e.attributes.percent_samples_with_this_junction.toFixed(0)+"%"):"motif"===this.config.labelWith&&void 0!==e.attributes.motif&&(C+=e.attributes.motif),"uniqueReadCount"===this.config.labelWithInParen?C+=" ("+l+")":"totalReadCount"===this.config.labelWithInParen?C+=" ("+d+")":"multiMappedReadCount"===this.config.labelWithInParen?h>0&&(C+=" (+"+h+")"):"numSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==u&&(C+=" ("+u+")"):"percentSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==e.attributes.percent_samples_with_this_junction&&(C+=" ("+e.attributes.percent_samples_with_this_junction.toFixed(0)+"%)"):"motif"===this.config.labelWithInParen&&void 0!==e.attributes.motif&&(C+=` ${e.attributes.motif}`),e.isVisible=!0,r.beginPath(),r.moveTo(o,w),r.bezierCurveTo(b,m,F,m,a,w),r.lineWidth=A,r.strokeStyle=y,r.stroke();const _=(e,t,i,n)=>{e.beginPath(),e.moveTo(t,i),e.lineTo(t-n/2,i-n),e.lineTo(t+n/2,i-n),e.lineTo(t,i),e.closePath(),e.fill()};if(e.attributes.left_shape||e.attributes.right_shape){r.fillStyle=y;const t=r.lineWidth>2?10:7;e.attributes.left_shape&&_(r,o,w,t),e.attributes.right_shape&&_(r,a,w,t)}r.fillText(C,c-r.measureText(C).width/2,(7*m+g)/8)}clickedFeatures(e){return super.clickedFeatures(e).filter((function(e){return e.isVisible&&e.attributes}))}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=[];for(let e of t){const t="function"==typeof e.popupData?e.popupData(i):this.extractPopupData(e._f||e,this.getGenomeId());t&&(n.length>0&&n.push("<hr/><hr/>"),Array.prototype.push.apply(n,t))}return n}dispose(){this.trackView=void 0}}const zF={min:0,max:3e3,color:"rgb(0,0,255)"};class LF{constructor(e){e=e||zF,this.max=e.max,this.min=e.min||0,this.cache=[],this.nbins=1e3,this.binsize=(this.max-this.min)/this.nbins,this.updateColor(e.color||"rgb(0,0,255)"),this.br=255,this.bg=255,this.bb=255}updateColor(e){const t=e.substring(4).replace(")","").split(",");3===t.length&&(this.r=Number.parseInt(t[0].trim()),this.g=Number.parseInt(t[1].trim()),this.b=Number.parseInt(t[2].trim())),this.cache=[]}setMinMax(e,t){this.min=e,this.max=t,this.cache=[],this.binsize=(this.max-this.min)/this.nbins}getColor(e){if(e<=this.min)return"white";if(e>=this.max)return`rgb(${this.r},${this.g},${this.b})`;const t=Math.floor((Math.min(this.max,e)-this.min)/this.binsize);if(void 0===this.cache[t]){const i=(e-this.min)/(this.max-this.min),n=1-i;this.cache[t]=`rgb(${Math.floor(i*this.r+n*this.br)},${Math.floor(i*this.g+n*this.bg)},${Math.floor(i*this.b+n*this.bb)})`}return this.cache[t]}toJson(){return{min:this.min,max:this.max,color:`rgb(${this.r},${this.g},${this.b})`}}static parse(e){const t=e.split(","),i={min:Number.parseFloat(t[0]),max:Number.parseFloat(t[1]),color:`${t[2]},${t[3]},${t[4]}`};return new LF(i)}}class HF extends Pa{static defaults={height:300,rowHeight:3,min:.5,max:3,scale:1,visibilityWindow:1e4,supportHiDPI:!1,startSize:4,stepSize:2};constructor(e,t){super(e,t)}init(e){super.init(e),this.type="shoebox",e.max&&(this.dataRange={min:e.min||0,max:e.max});const t=Object.assign({},this.config);t.format="shoebox",this.featureSource=Hl(t,this.browser.genome)}async postInit(){if("function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader(),this.disposed))return;this.header&&(this.header.scale&&(this.header.scale=Number.parseFloat(this.header.scale)),this.setTrackProperties(this.header),this.rowCount=this.header.firstFeature?this.header.firstFeature.values.length:100);const e=this.dataRange.min,t=this.dataRange.max;this.colorScale=new LF({min:e,max:t,color:this.color}),this.scale||(this.scale=1),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor}get color(){return this._color||"rgb(0,0,255)"}set color(e){this._color=e,this.colorScale&&this.colorScale.updateColor(e)}menuItemList(){const e=[];e.push("<hr/>");let t=document.createElement("div");t.textContent="Set row height";const i=this.browser;return e.push({element:t,dialog:function(e){const t={label:"Row Height",value:this.rowHeight,callback:()=>{const e=parseInt(this.browser.inputDialog.value,10);if(void 0!==e){i.sampleNameViewportWidth=void 0;const t=[];this.trackView.track.selected?t.push(...this.trackView.browser.getSelectedTrackViews().map((({track:e})=>e))):t.push(this);for(const i of t)i.rowHeight=e,i.rowHeight*i.rowCount<i.height&&i.trackView.setTrackHeight(i.rowHeight*i.rowCount,!0),i.trackView.checkContentHeight(),i.trackView.repaintViews()}}};this.browser.inputDialog.present(t,e)}}),e.push("<hr/>"),t=document.createElement("div"),t.textContent="Set data range",e.push({element:t,dialog:function(){this.trackView.track.selected?this.browser.dataRangeDialog.configure(this.trackView.browser.getSelectedTrackViews()):this.browser.dataRangeDialog.configure(this.trackView),this.browser.dataRangeDialog.present(this.browser.columnContainer)}}),e}setDataRange({min:e,max:t}){this.dataRange.min=e,this.dataRange.max=t,this.colorScale.setMinMax(e,t),this.trackView.repaintViews()}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}draw({context:e,pixelTop:t,pixelWidth:i,pixelHeight:n,features:r,bpPerPixel:s,bpStart:o}){if(fr.fillRect(e,0,t,i,n,{fillStyle:"rgb(255, 255, 255)"}),r&&r.length>0){const a=this.rowHeight,c=t+n,l=o+i*s+1,h=a;for(let i of r){if(i.end<o||i.start>l)continue;const n=Math.floor((i.start-o)/s),r=Math.floor((i.end-o)/s),d=Math.max(1,r-n);for(let r=i.values.length-1;r>=0;r--){const s=i.values[r];if(s>=this.dataRange.min){const o=(i.values.length-1-r)*a;if(o+a<t||o>c)continue;const l=this.colorScale.getColor(s);e.fillStyle=l,e.fillRect(n,o,d,h)}}}}}paintAxis(e,t,i){var n={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};const r=this.startSize+this.rowCount*this.stepSize,s=this.startSize,o=(r-s)/i;for(let t=50;t<=r;t+=50){const r=Math.max(10,i-Math.round((t-s)/o));fr.strokeLine(e,35,r,40,r,n),t>s&&fr.fillText(e,PF(t),30,r+4,n)}n.textAlign="center",n.font="normal 10px Arial",fr.fillText(e,"Footprint size (bp)",10,i/2,n,{rotate:{angle:-90}})}computePixelHeight(e){return e&&0!==e.length?e[0].values.length*this.rowHeight:0}clickedFeatures(e){const t=super.clickedFeatures(e),i=e.y;return t.filter((function(e){const t=e.pixelRect;return t&&i>=t.y&&i<=t.y+t.h}))}hoverText(e){const t=this.clickedFeatures(e);if(t&&t.length>0)return`${t[0].sample}: ${t[0].value}`}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){i.length>0&&(i.push("<hr/>"),i.push("<hr/>"));const t=e._f||e,n="function"==typeof t.popupData?t.popupData(this.type,this.browser.genome.id):this.extractPopupData(t);Array.prototype.push.apply(i,n)}return i}get supportsWholeGenome(){return!1}getState(){const e=super.getState();return e.colorScale=this.colorScale.toJson(),e}}function PF(e){return Number.isInteger(e)||e%1==0?e:Math.abs(e)>=10?e.toFixed():Math.abs(e)>=1?e.toFixed(1):Math.abs(e)>=.1?e.toFixed(2):e.toExponential(1)}const OF=new Map([["ideogram",(e,t)=>new MF(e,t)],["sequence",(e,t)=>new fh(e,t)],["feature",(e,t)=>new eh(e,t)],["seg",(e,t)=>new Zd(e,t)],["mut",(e,t)=>new Zd(e,t)],["maf",(e,t)=>new Zd(e,t)],["shoebox",(e,t)=>new HF(e,t)],["wig",(e,t)=>new xl(e,t)],["merged",(e,t)=>new bd(e,t)],["alignment",(e,t)=>new dp(e,t)],["interaction",(e,t)=>new fp(e,t)],["interact",(e,t)=>new fp(e,t)],["variant",(e,t)=>new wF(e,t)],["qtl",(e,t)=>new AF(e,t)],["eqtl",(e,t)=>new AF(e,t)],["gwas",(e,t)=>new xF(e,t)],["arc",(e,t)=>new SF(e,t)],["gcnv",(e,t)=>new kF(e,t)],["junction",(e,t)=>new TF(e,t)],["blat",(e,t)=>new sh(e,t)],["cnvpytor",(e,t)=>new pF(e,t)]]);class VF{constructor(e,t){const i=(new DOMParser).parseFromString(e,"text/xml");this.processRootNode(i,t);const n=i.getElementsByTagName("Resource"),r=i.getElementsByTagName("Track"),s=r&&r.length>0,o=[];this.tracks=o;const a=new Map;Array.from(n).forEach((function(e,t){var i={url:e.getAttribute("path"),indexURL:e.getAttribute("index"),order:t};a.set(i.url,i),s||o.push(i)})),s&&Array.from(r).forEach((function(e){const t=e.getElementsByTagName("Track");if(t&&t.length>0){const i={type:"merged",tracks:[]};qF(e,i),o.push(i),Array.from(t).forEach((function(e){e.processed=!0;const t=e.getAttribute("id"),n=a.get(t);n&&(i.tracks.push(n),qF(e,n),n.autoscale=!1,i.height=n.height)}))}else if(!e.processed){const t=e.getAttribute("id"),i=a.get(t);i&&(o.push(i),qF(e,i))}}))}processRootNode(e,t){const i=e.getElementsByTagName("Session");!i||i.length;const n=i.item(0),r=n.getAttribute("genome"),s=n.getAttribute("locus"),o=n.getAttribute("ucscID");t&&t.hasOwnProperty(r)?this.genome=r:(this.reference={fastaURL:r},o&&(this.reference.id=o)),s&&(this.locus=s)}}function qF(e,t){t.name=e.getAttribute("name");const i=e.getAttribute("color");i&&(t.color="rgb("+i+")");const n=e.getAttribute("altColor");i&&(t.altColor="rgb("+n+")");const r=e.getAttribute("height");r&&(t.height=parseInt(r));const s=e.getAttribute("autoScale");s&&(t.autoscale="true"===s);const o=e.getAttribute("autoscaleGroup");o&&(t.autoscaleGroup=o);const a=e.getAttribute("windowFunction");a&&(t.windowFunction=a);const c=e.getAttribute("visibilityWindow")||e.getAttribute("featureVisibilityWindow");c&&(t.visibilityWindow=c);const l=e.getAttribute("indexed");l&&(t.indexed="true"===l);const h=e.getAttribute("normalize");h&&(t.normalize="true"===h);const d=e.getElementsByTagName("DataRange");if(d.length>0){const e=d.item(0);t.min=Number(e.getAttribute("minimum")),t.max=Number(e.getAttribute("maximum")),t.logScale="LOG"===e.getAttribute("type")}}class QF{constructor(e,t,i,n,r){this.genome=e,this.chr=t,this.start=i,this.end=n,this.bpPerPixel=r,this.id=o()}get center(){return(this.start+this.end)/2}get locusSearchString(){return`${this.chr}:${this.start+1}-${this.end}`}extend(e){const t=Math.min(e.start,this.start),i=Math.max(e.end,this.end),n=(i-t)/(this.end-this.start);this.start=t,this.end=i,this.bpPerPixel*=n}calculateEnd(e){return this.start+this.bpPerPixel*e}calculateCenter(e){return this.start+this.bpPerPixel*e/2}calculateBPP(e,t){return(e-this.start)/t}set(e){this.chr=e.chr,this.start=e.start,this.bpPerPixel=e.bpPerPixel}toPixels(e){return e/this.bpPerPixel}toBP(e){return this.bpPerPixel*e}shift(e){this.start+=e,this.end+=e}shiftPixels(e,t,i){const n=this.start,r=e*this.bpPerPixel;return this.start+=r,i&&this.clampStart(t),this.end=this.start+t*this.bpPerPixel,n!==this.start}clampStart(e){const t=this.genome.getChromosome(this.chr).bpStart||0;if(this.start=Math.max(t,this.start),e){const{bpLength:t}=this.genome.getChromosome(this.chr),i=t-e*this.bpPerPixel;this.start>i&&(this.start=i)}}async zoomWithScaleFactor(e,t,i,n){const r=void 0===n?this.start+this.toBP(i/2):n,s=this.start,o=this.bpPerPixel,a=this.getChromosome().bpLength,c=t<1?e.minimumBases()/i:a/i;this.bpPerPixel=t<1?Math.max(this.bpPerPixel*t,c):Math.min(this.bpPerPixel*t,c);const l=this.bpPerPixel*i;this.start=r-.5*l,this.clampStart(i),this.end=this.start+l;(s!==this.start||o!==this.bpPerPixel)&&await e.updateViews(!0)}getChromosome(){return this.genome.getChromosome(this.chr)}getMultiLocusLabelBPLengthOnly(e){const t=" ",i=Math.floor(this.start)+1,n=Math.round(this.start+this.bpPerPixel*e);return`${t}${this.chr}${t}${Ys(n-i)}${t}`}getMultiLocusLabelLocusOnly(e){const t=" ",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e);return`${t}${i}:${n}-${r}${t}`}getMultiLocusLabel(e){const t=" ",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e),s=Math.floor(this.start)+1;return`${t}${i}:${n}-${r}${t}${t}(${Ys(Math.round(this.start+this.bpPerPixel*e)-s)})${t}`}getPresentationLocusComponents(e){if("all"===this.chr)return{chr:this.chr};{const t=F(Math.floor(this.start)+1),i=F(Math.round(this.start+this.bpPerPixel*e));return{chr:this.chr,start:t,end:i}}}getLocusString(){if("all"===this.chr)return"all";return`${this.genome.getChromosomeDisplayName(this.chr)}:${F(Math.floor(this.start)+1)}-${F(Math.round(this.end))}`}description(e){console.log(` ${e||""} referenceFrame - ${this.chr} bpp ${this.bpPerPixel.toFixed(3)} start ${F(Math.round(this.start))} end ${F(Math.round(this.end))} `)}overlaps(e){return this.chr===e.chr&&this.end>=e.start&&e.end>=this.start}}function UF(){return"3.2.1"}const jF="Maximum sequence count exceeded";class GF{constructor(e,i){this.container=t({class:"igv-chromosome-select-widget-container"}),i.appendChild(this.container),this.select=document.createElement("select"),this.select.setAttribute("name","chromosome-select-widget"),this.container.appendChild(this.select),this.select.addEventListener("change",(()=>{this.select.blur(),""!==this.select.value&&jF!==this.select.value&&e.search(this.select.value)})),this.showAllChromosomes=!1!==e.config.showAllChromosomes,this.genome=e.genome}show(){this.container.style.display="flex"}hide(){this.container.style.display="none"}setValue(e){this.select.value=this.genome.getChromosomeDisplayName(e)}update(e){this.genome=e;const t=e.wgChromosomeNames.map((t=>e.getChromosomeDisplayName(t)))||[];if(this.showAllChromosomes&&e.chromosomeNames.length>1){const i=new Set(t);let n=0;for(let r of e.chromosomeNames){if(1e3==++n){t.push(jF);break}i.has(r)||(r=e.getChromosomeDisplayName(r),t.push(r))}}this.select.innerHTML="",e.showWholeGenomeView()&&t.unshift("all");for(let i of t){const t=document.createElement("option");t.setAttribute("value",i),t.innerText=e.getChromosomeDisplayName(i),this.select.appendChild(t)}}}class WF{constructor(e,i){this.container=t({class:"igv-windowsize-panel-container"}),e.appendChild(this.container),i.on("locuschange",(e=>{this.updatePanel(e)})),this.browser=i}show(){this.container.style.display="block"}hide(){this.container.style.display="none"}updatePanel(e){const t=this.browser.calculateViewportWidth(this.browser.referenceFrameList.length);this.container.innerText=1===e.length?Ys(Math.round(t*e[0].bpPerPixel)):""}}class $F extends md{constructor(e,t,i,n){super(e,t,"Select Tracks",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select">\n <rect id="backdrop-copy-3" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.32659528" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select-hover">\n <rect id="backdrop-copy-4" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.33" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>',!1),this.navbar=i,this.enableMultiTrackSelection=!1,this.button.addEventListener("mouseenter",(e=>{!1===n&&this.setState(!0)})),this.button.addEventListener("mouseleave",(e=>{!1===n&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{this.setMultiTrackSelection(!this.enableMultiTrackSelection)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler)}setMultiTrackSelection(e){this.enableMultiTrackSelection=e,this.setState(this.enableMultiTrackSelection),!1===this.enableMultiTrackSelection&&this.navbar.overlayTrackButton.setVisibility(!1);for(const t of this.browser.trackViews)t.enableTrackSelection(e)}}class KF extends md{constructor(e,t){super(e,t,"Crosshairs",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor" stroke="#737373">\n <rect id="Rectangle-Copy-3" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group" transform="translate(5, 9)" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor-hover">\n <rect id="Rectangle-Copy-5" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-Copy-2" transform="translate(5, 9)" stroke="#FFFFFF" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke="#FFFFFF" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>',t.doShowCursorGuide),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowCursorGuide&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowCursorGuide&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowCursorGuide=!t.doShowCursorGuide,t.setCursorGuideVisibility(t.doShowCursorGuide),this.setState(t.doShowCursorGuide)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showCursorTrackingGuideButton)}}class YF extends md{constructor(e,t){super(e,t,"Center Line",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline" stroke="#737373">\n <rect id="Rectangle-Copy-2" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline-hover">\n <rect id="Rectangle-Copy-9" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke="#FFFFFF" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>',t.config.showCenterGuide),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowCenterLine&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowCenterLine&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowCenterLine=!t.doShowCenterLine,t.setCenterLineVisibility(t.doShowCenterLine),this.setState(t.doShowCenterLine)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showCenterGuideButton)}}class XF extends md{constructor(e,t){super(e,t,"Track Labels",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels" fill="#FFFFFF" stroke="#737373">\n <rect id="Rectangle-Copy-27" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" stroke-width="24">\n <path d="M448.444444,87.1189616 L448.444444,322.431462 L166.619398,322.431462 L19.2344421,204.775212 L166.619398,87.1189616 L448.444444,87.1189616 Z M244.028212,163.997434 C232.925565,163.997434 222.874656,168.493347 215.598982,175.760254 C208.318067,183.032394 203.815972,193.079106 203.815972,204.175675 C203.815972,215.272243 208.318067,225.318955 215.598982,232.591095 C222.874656,239.858002 232.925565,244.353915 244.028212,244.353915 C255.130858,244.353915 265.181767,239.858002 272.457442,232.591095 C279.738356,225.318955 284.240451,215.272243 284.240451,204.175675 C284.240451,193.079106 279.738356,183.032394 272.457442,175.760254 C265.181767,168.493347 255.130858,163.997434 244.028212,163.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels-hover" stroke="#737373">\n <rect id="Rectangle-Copy-29" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" fill="#FFFFFF" stroke-width="24">\n <path d="M448.444444,85.1189616 L448.444444,320.431462 L166.619398,320.431462 L19.2344421,202.775212 L166.619398,85.1189616 L448.444444,85.1189616 Z M244.028212,161.997434 C232.925565,161.997434 222.874656,166.493347 215.598982,173.760254 C208.318067,181.032394 203.815972,191.079106 203.815972,202.175675 C203.815972,213.272243 208.318067,223.318955 215.598982,230.591095 C222.874656,237.858002 232.925565,242.353915 244.028212,242.353915 C255.130858,242.353915 265.181767,237.858002 272.457442,230.591095 C279.738356,223.318955 284.240451,213.272243 284.240451,202.175675 C284.240451,191.079106 279.738356,181.032394 272.457442,173.760254 C265.181767,166.493347 255.130858,161.997434 244.028212,161.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>',t.config.showTrackLabels),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowTrackLabels&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowTrackLabels&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowTrackLabels=!t.doShowTrackLabels,t.setTrackLabelVisibility(t.doShowTrackLabels),this.setState(t.doShowTrackLabels)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showTrackLabelButton)}}class ZF extends md{constructor(e,t){super(e,t,["ROI","Regions of Interest Table"],wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi">\n <rect id="Rectangle-Copy-23" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#737373">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi-hover">\n <rect id="Rectangle-Copy-24" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#FFFFFF">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowROITable&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowROITable&&this.setState(!1)})),this.button.addEventListener("click",(()=>this.buttonHandler(!t.doShowROITable))),this.setVisibility(!1)}buttonHandler(e){this.setState(e),this.browser.setROITableVisibility(e)}}class JF extends md{constructor(e,t){super(e,t,"Sample Info",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info">\n <rect id="Rectangle-Copy-6" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-2" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-10" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info-hover">\n <rect id="Rectangle-Copy-14" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-1" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-0" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-15" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <rect id="scrim" fill="#000000" style="mix-blend-mode: hue;" x="8" y="149" width="612" height="306"></rect>\n </g>\n </g>\n</svg>',!1),this.showSampleInfo=!1,this.button.addEventListener("mouseenter",(()=>{!1===this.showSampleInfo&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===this.showSampleInfo&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)}))}performClickWithState(e,t){this.showSampleInfo=void 0===t?!this.showSampleInfo:t;e.columnContainer.querySelector(".igv-sample-info-column").style.display=!1===this.showSampleInfo?"none":"flex",this.setState(this.showSampleInfo),e.layoutChange()}setButtonVisibility(e){this.showSampleInfo=e,this.setState(this.showSampleInfo),!0===this.showSampleInfo?this.show():this.hide()}}class ev extends md{constructor(e,t){super(e,t,"Sample Names",'<svg width="90px" height="20px" viewBox="0 0 90 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="89" height="18" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names" stroke="#737373">\n <rect id="Rectangle-Copy-13" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke-width="32"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke-width="32"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke-width="32"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names-hover">\n <rect id="Rectangle-Copy-18" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n </g>\n </g>\n</svg>',t.config.showSampleNames),this.button.addEventListener("mouseenter",(()=>{!1===t.showSampleNames&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.showSampleNames&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)})),!0===t.config.showSampleNameButton?this.show():this.hide()}performClickWithState(e,t){e.showSampleNames=void 0===t?!e.showSampleNames:t;e.columnContainer.querySelector(".igv-sample-name-column").style.display=!1===e.showSampleNames?"none":"flex",this.setState(e.showSampleNames),e.layoutChange()}}class tv{constructor(e,i){this.parent=e,this.popover=t({class:"igv-ui-dropdown"}),e.appendChild(this.popover),this.popoverContent=t(),this.popover.appendChild(this.popoverContent),this.popover.style.display="none",this.shim=i}configure(e){if(0===e.length)return;const t=ro(e,this.popover);for(const{element:e}of t)this.popoverContent.appendChild(e)}present(e){this.popover.style.display="block";let{x:t,y:i}=a(e,this.parent);this.popover.style.left=`${t+this.shim.left}px`,this.popover.style.top=`${i+this.shim.top}px`}_present(e){this.popover.style.display="block";let{x:t,y:i,width:n}=a(e,this.parent);t+=this.shim.left,i+=this.shim.top,this.popover.style.top=`${i}px`;const{width:r}=this.popover.getBoundingClientRect(),s=t+r,o=s-n;this.popover.style.left=`${s>n?t-o:t}px`}dismiss(){this.popover.style.display="none"}}class iv extends md{constructor(e,t){super(e,t,"Save Image",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>{for(const e of this.button.querySelectorAll("div"))if("block"===e.style.display)return;this.setState(!1)})),this.dropdown=new tv(this.button.parentNode,{top:24,left:-88});const i=[{label:"Save as SVG",click:e=>{this.browser.saveSVGtoFile("igvjs.svg"),this.dropdown.dismiss()}},{label:"Save as PNG",click:e=>{this.browser.savePNGtoFile("igvjs.png"),this.dropdown.dismiss()}}];this.dropdown.configure(i),this.button.addEventListener("click",(e=>{let t;if(e.target===this.button)t=!0;else if(e.target.closest("svg")){e.target.closest("div")===this.button&&(t=!0)}!0===t&&("none"===this.dropdown.popover.style.display?this.dropdown.present(e):this.dropdown.dismiss())})),this.setVisibility(t.config.showSVGButton)}navbarResizeHandler(e){this.dropdown.dismiss(),super.navbarResizeHandler(e)}}const nv=function(e,i,n){const r=t({class:"igv-navbar-button"});e.appendChild(r),r.textContent=n.label,r.addEventListener("click",(()=>n.callback(i)))};let rv=23,sv=0;class ov{constructor(e,i,n){this.browser=i,this.zoomContainer=t({class:"igv-zoom-widget"}),n.appendChild(this.zoomContainer),this.zoomOutButton=t(),this.zoomContainer.appendChild(this.zoomOutButton),this.zoomOutButton.appendChild(l("minus-circle")),this.zoomOutButton.addEventListener("click",(()=>{i.zoomOut()}));const r=t();this.zoomContainer.appendChild(r),this.slider=document.createElement("input"),this.slider.type="range",this.slider.min="0",this.slider.max=`${rv}`,r.appendChild(this.slider),this.slider.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation();const t=i.referenceFrameList[0],{bpLength:n}=t.genome.getChromosome(t.chr),{end:r,start:s}=t,o=r-s,a=n/Math.pow(2,e.target.valueAsNumber);i.zoomWithScaleFactor(a/o)})),this.zoomInButton=t(),this.zoomContainer.appendChild(this.zoomInButton),this.zoomInButton.appendChild(l("plus-circle")),this.zoomInButton.addEventListener("click",(()=>{i.zoomIn()})),i.on("locuschange",(e=>{this.browser.isMultiLocusMode()?this.disable():(this.enable(),this.update(e))}))}update(e){if(this.slider){const t=e[0],{bpLength:i}=t.genome.getChromosome(t.chr),{start:n,end:r}=t;rv=Math.ceil(Math.log2(i/this.browser.minimumBases())),this.slider.max=`${rv}`;const s=i/(r-n);sv=Math.log2(s),this.slider.value=`${Math.round(sv)}`}}enable(){this.slider&&(this.slider.disabled=!1)}disable(){this.slider&&(this.slider.disabled=!0)}hide(){this.zoomContainer.style.display="none"}show(){this.zoomContainer.style.display="block"}hideSlider(){this.slider&&(this.slider.style.display="none")}showSlider(){this.slider&&(this.slider.style.display="block")}}class av{constructor(e,t){this.browser=t,this.config=e,this.currentClass="igv-navbar-text-button";const i=document.createElement("div");i.className="igv-navbar",this.navigation=i;const n=document.createElement("div");n.className="igv-navbar-left-container",i.appendChild(n),this.navbarLeftContainer=n;const r=document.createElement("div");r.className="igv-logo",n.appendChild(r);const s=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("width","690px"),e.setAttribute("height","324px"),e.setAttribute("viewBox","0 0 690 324"),e.setAttribute("version","1.1"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const t=document.createElementNS("http://www.w3.org/2000/svg","title");t.textContent="IGV",e.appendChild(t);const i=document.createElementNS("http://www.w3.org/2000/svg","g");i.setAttribute("id","Page-1"),i.setAttribute("stroke","none"),i.setAttribute("stroke-width","1"),i.setAttribute("fill","none"),i.setAttribute("fill-rule","evenodd"),e.appendChild(i);const n=document.createElementNS("http://www.w3.org/2000/svg","g");n.setAttribute("id","IGV"),n.setAttribute("fill","#666666"),i.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","polygon");r.setAttribute("id","Path"),r.setAttribute("points","379.54574 8.00169252 455.581247 8.00169252 515.564813 188.87244 532.884012 253.529506 537.108207 253.529506 554.849825 188.87244 614.833392 8.00169252 689.60164 8.00169252 582.729511 320.722144 486.840288 320.722144"),n.appendChild(r);const s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d","M261.482414,323.793286 C207.975678,323.793286 168.339046,310.552102 142.571329,284.069337 C116.803612,257.586572 103.919946,217.158702 103.919946,162.784513 C103.919946,108.410325 117.437235,67.8415913 144.472217,41.0770945 C171.507199,14.3125977 212.903894,0.930550071 268.663545,0.930550071 C283.025879,0.930550071 298.232828,1.84616386 314.284849,3.6774189 C330.33687,5.50867394 344.839793,7.97378798 357.794056,11.072835 L357.794056,68.968378 C339.48912,65.869331 323.578145,63.5450806 310.060654,61.9955571 C296.543163,60.4460336 284.574731,59.6712835 274.154998,59.6712835 C255.850062,59.6712835 240.502308,61.4320792 228.111274,64.9537236 C215.720241,68.4753679 205.793482,74.2507779 198.330701,82.2801269 C190.867919,90.309476 185.587729,100.87425 182.48997,113.974767 C179.392212,127.075284 177.843356,143.345037 177.843356,162.784513 C177.843356,181.942258 179.251407,198.000716 182.067551,210.960367 C184.883695,223.920018 189.671068,234.41436 196.429813,242.443709 C203.188559,250.473058 212.059279,256.178037 223.042241,259.558815 C234.025202,262.939594 247.683295,264.629958 264.01693,264.629958 C268.241146,264.629958 273.098922,264.489094 278.590403,264.207362 C284.081883,263.925631 289.643684,263.50304 295.275972,262.939577 L295.275972,159.826347 L361.595831,159.826347 L361.595831,308.579859 C344.698967,313.087564 327.239137,316.750019 309.215815,319.567334 C291.192494,322.38465 275.281519,323.793286 261.482414,323.793286 L261.482414,323.793286 L261.482414,323.793286 Z"),s.setAttribute("id","Path"),n.appendChild(s);const o=document.createElementNS("http://www.w3.org/2000/svg","polygon");return o.setAttribute("id","Path"),o.setAttribute("points","0.81355666 5.00169252 73.0472883 5.00169252 73.0472883 317.722144 0.81355666 317.722144"),n.appendChild(o),e}();s.style.width="34px",s.style.height="32px",r.appendChild(s),this.currentGenome=document.createElement("div"),this.currentGenome.className="igv-current-genome",n.appendChild(this.currentGenome),this.currentGenome.textContent="";const o=document.createElement("div");o.className="igv-navbar-genomic-location",n.appendChild(o),this.chromosomeSelectWidget=new GF(t,o),!1!==e.showChromosomeWidget?this.chromosomeSelectWidget.show():this.chromosomeSelectWidget.hide();const a=document.createElement("div");a.className="igv-locus-size-group",o.appendChild(a);const c=document.createElement("div");c.className="igv-search-container",a.appendChild(c),this.searchInput=document.createElement("input"),this.searchInput.className="igv-search-input",this.searchInput.type="text",this.searchInput.placeholder="Locus Search",c.appendChild(this.searchInput),this.searchInput.addEventListener("keyup",(e=>{e.stopImmediatePropagation()})),this.searchInput.addEventListener("change",(()=>{t.doSearch(this.searchInput.value)}));const h=document.createElement("div");h.className="igv-search-icon-container",c.appendChild(h);const d=l("search");h.appendChild(d),h.addEventListener("click",(()=>{t.doSearch(this.searchInput.value)})),this.windowSizePanel=new WF(a,t);const u=document.createElement("div");u.className="igv-navbar-right-container",i.appendChild(u),this.navbarRightContainer=u;const f=document.createElement("div");f.className="igv-navbar-toggle-button-container",u.appendChild(f),this.toggleButtonContainer=f,this.overlayTrackButton=new yd(f,t),this.overlayTrackButton.setVisibility(!1);const p=!1!==e.showMultiSelectButton;if(this.multiTrackSelectButton=new $F(f,t,this,p),this.cursorGuideButton=new KF(f,t),this.centerLineButton=new YF(f,t),this.trackLabelControl=new XF(f,t),this.roiTableControl=new ZF(f,t),this.sampleInfoControl=new JF(f,t),this.sampleNameControl=new ev(f,t),!0===e.showSVGButton&&(this.saveImageControl=new iv(f,t)),e.customButtons)for(let i of e.customButtons)new nv(f,t,i);this.zoomWidget=new ov(e,t,u),!1===e.showNavigation&&(this.navigation.style.display="none")}navbarDidResize(){const e=this.currentNavbarButtonClass();"igv-navbar-text-button"===e&&(this.textButtonContainerWidth=this.navbarRightContainer.getBoundingClientRect().width);const t=this.browser,i=t.isMultiLocusWholeGenomeView()||t.referenceFrameList&&Mh.isWholeGenomeView(t.referenceFrameList[0].chr);i?this.windowSizePanel.hide():this.windowSizePanel.show();const{x:n,width:r}=this.navbarLeftContainer.getBoundingClientRect(),s=n+r,{x:o}=this.navbarRightContainer.getBoundingClientRect();let a;if("igv-navbar-text-button"===e&&o-s<8)a="igv-navbar-icon-button";else if(this.textButtonContainerWidth&&"igv-navbar-icon-button"===e){this.navigation.offsetWidth-s-this.textButtonContainerWidth>8&&(a="igv-navbar-text-button")}let c;a&&e!==a&&(this.currentClass=a,this.browser.fireEvent("navbar-resize",[a])),c=i?"igv-zoom-widget-hidden":this.navigation.offsetWidth>860?"igv-zoom-widget":"igv-zoom-widget-900",this.zoomWidget.zoomContainer.className="",this.zoomWidget.zoomContainer.classList.add(c)}updateGenome(e){let t=e.id&&e.id.length<20?e.id:`${e.id.substring(0,8)}...${e.id.substring(e.id.length-8)}`;this.currentGenome.textContent=t,this.currentGenome.setAttribute("title",e.description);!1!==this.config.showChromosomeWidget&&!1!==e.showChromosomeWidget&&e.chromosomeNames&&e.chromosomeNames.length>1?(this.chromosomeSelectWidget.update(e),this.chromosomeSelectWidget.show()):this.chromosomeSelectWidget.hide()}updateLocus(e,t){this.searchInput&&(this.searchInput.value=e),this.chromosomeSelectWidget&&(this.chromosomeSelectWidget.select.value=t)}currentNavbarButtonClass(){return this.currentClass}setEnableTrackSelection(e){this.multiTrackSelectButton.setMultiTrackSelection(e)}getEnableTrackSelection(){return this.multiTrackSelectButton.enableMultiTrackSelection}hide(){this.navigation.style.display="none"}show(){this.navigation.style.display="flex"}}const cv=(e,t)=>{const i=0===e?t.nextElementSibling:t.previousElementSibling;t.remove(),i.remove()},lv=e=>{const i=t({class:"igv-column-shim"});eo(i,e);const n=t({class:"igv-column"});return eo(n,i),n},hv=(e,i)=>{for(let n=0;n<i;n++){const r=t({class:"igv-column"});if(Js(r,e),i>1&&n>0){Js(t({class:"igv-column-shim"}),r)}}};class dv{constructor(e,i,n){this.browser=e,this.referenceFrame=i,this.column=n,this.container=t({class:"igv-center-line"}),n.appendChild(this.container),e.doShowCenterLine?this.show():this.hide()}repaint(){if(this.referenceFrame){if(1/this.referenceFrame.bpPerPixel>1){const e=Math.floor(this.referenceFrame.toPixels(1));this.container.style.width=`${e}px`,this.container.classList.remove("igv-center-line-thin"),this.container.classList.add("igv-center-line-wide")}else this.container.style.width="1px",this.container.classList.remove("igv-center-line-wide"),this.container.classList.add("igv-center-line-thin")}}show(){this.isVisible=!0,this.container.style.display="block",this.repaint()}hide(){this.isVisible=!1,this.container.style.display="none"}resize(){this.repaint()}}const uv=function(e,i){this.button=t({class:"igv-navbar-button"}),e.appendChild(this.button),this.button.textContent="circular view",this.button.addEventListener("click",(()=>{i.circularViewVisible=!i.circularViewVisible})),this.browser=i,this.setVisibility(i.config.showCircularViewButton),this.setState(i.circularViewVisible)};uv.prototype.setVisibility=function(e){!0===e?this.show():this.hide()},uv.prototype.setState=function(e){!0===e?this.button.classList.add("igv-navbar-button-clicked"):this.button.classList.remove("igv-navbar-button-clicked")},uv.prototype.show=function(){this.button.style.display="block",this.setState(this.browser.circularViewVisible)},uv.prototype.hide=function(){this.button.style.display="none"};class fv{constructor(e,i){this.browser=e,this.container=t({class:"igv-roi-menu"}),i.appendChild(this.container);const n=t();this.container.appendChild(n),u(n,(()=>this.container.style.display="none")),this.body=t(),this.container.appendChild(this.body),this.container.style.display="none"}async present(e,t,i,n,r,s){const o=this.menuItems(e,t,i,n,r,s);this.browser.menuPopup.presentTrackContextMenu(i,o)}menuItems(e,t,i,n,r,s){const o=e.name?[`<b>${e.name}</b><br/>`]:[];return"name"in t&&o.push(`<b>ROI Set: ${t.name}</b>`),o.length>0&&o.push("<hr/>"),t.isUserDefined&&o.push({label:"Set description ...",click:()=>{const t={label:"Description",value:e.name||"",callback:()=>{const t=this.browser.inputDialog.value||"";e.name=t.trim(),this.browser.roiManager.repaintTable()}};this.browser.inputDialog.present(t,i)}}),to()&&e.end-e.start<1e6&&o.push({label:"Copy reference sequence",click:async()=>{this.container.style.display="none";let t=await this.browser.genome.getSequence(e.chr,e.start,e.end);t||(t="Unknown sequence");try{await navigator.clipboard.writeText(t)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),e.end-e.start<=25e3&&o.push({label:"BLAT reference sequence",click:async()=>{this.container.style.display="none";const{chr:t,start:i,end:n}=e;let r=await this.browser.genome.getSequence(t,i,n);if(r){const e=`blat: ${t}:${i+1}-${n}`,s=`blat: ${t}:${i+1}-${n}`;oh({sequence:r,browser:this.browser,name:e,title:s})}}}),t.isUserDefined&&o.push("<hr/>",{label:"Delete",click:async()=>{t.removeFeature(e);const i=await t.getAllFeatures();0===Object.keys(i).length&&n.deleteUserDefinedROISet(),n.deleteRegionWithKey(s.dataset.region,r),n.repaintTable()}}),o}dispose(){this.container.innerHTML=""}}class pv extends th{constructor(e){const t={browser:e,parent:e.columnContainer,headerTitle:"Regions of Interest",dismissHandler:()=>e.roiTableControl.buttonHandler(!1),gotoButtonHandler:pv.gotoButtonHandler};t.columnFormat=pv.getColumnFormatConfiguration(!0),super(Object.assign({width:"640px"},t))}tableRowDOM(e){const i=t({class:"igv-roi-table-row"}),{setName:n,feature:r}=e;i.dataset.region=bv(r.chr,r.start,r.end);let s=[r.chr,F(r.start),F(r.end),r.name||"",n];4===this.columnFormat.length&&(s=s.slice(0,4));for(let e=0;e<s.length;e++){const n=t();i.appendChild(n),n.style.width=this.columnFormat[e].width,n.innerText=s[e]}return this.tableRowDOMHelper(i),i}renderTable(e){if(Array.from(this.tableRowContainer.querySelectorAll(".igv-roi-table-row")).forEach((e=>e.remove())),e.length>0){const t=e.sort(((e,t)=>e.feature.chr.localeCompare(t.feature.chr)||e.feature.start-t.feature.start||e.feature.end-t.feature.end));for(let e of t){const t=this.tableRowDOM(e);this.tableRowContainer.appendChild(t)}}}set footerDOM(e){super.footerDOM=e,this.gotoButton.textContent="Go to selected region(s)";const i=t({class:"igv-roi-table-button"});this._footerDOM.appendChild(i),i.id="igv-roi-hide-show-button",i.textContent="Copy Sequence",i.title="One region only of max size 1 mb",this.copySequenceButton=i,gv(this.copySequenceButton,!1),this.boundCopySequenceButtonHandler=async function(e){e.preventDefault(),e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0){const e=[];for(let i of t){const{locus:t}=vv(i.dataset.region);e.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");if(this.setTableRowSelectionState(!1),e.length>0){const{chr:t,start:i,end:n}=yF(e[0],this.browser.isSoftclipped()),r=await this.browser.genome.getSequence(t,i,n);await navigator.clipboard.writeText(r)}}}.bind(this),this.copySequenceButton.addEventListener("click",this.boundCopySequenceButtonHandler);const n=t({class:"igv-roi-table-button"});this._footerDOM.appendChild(n),n.id="igv-roi-hide-show-button",n.textContent="Hide Overlays",this.toggleROIButton=n,this.boundToggleDisplayButtonHandler=function(e){e.preventDefault(),e.stopPropagation(),this.roiManager.toggleROIs()}.bind(this),this.toggleROIButton.addEventListener("click",this.boundToggleDisplayButtonHandler)}get roiManager(){return this.browser.roiManager}setTableRowSelectionState(e){super.setTableRowSelectionState(e);const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0&&t.length<2){const{locus:e}=vv(t[0].dataset.region),{chr:i,start:n,end:r}=yF(e,this.browser.isSoftclipped());gv(this.copySequenceButton,r-n<1e6)}else gv(this.copySequenceButton,!1)}dispose(){document.removeEventListener("click",this.boundGotoButtonHandler),document.removeEventListener("click",this.boundCopySequenceButtonHandler),document.removeEventListener("click",this.boundToggleDisplayButtonHandler),this.browser.roiTableControl.buttonHandler(!1),super.dispose()}static getColumnFormatConfiguration(e){return!0===e?[{label:"Chr",width:"20%"},{label:"Start",width:"15%"},{label:"End",width:"15%"},{label:"Description",width:"30%"},{label:"ROI Set",width:"20%"}]:[{label:"Chr",width:"25%"},{label:"Start",width:"20%"},{label:"End",width:"20%"},{label:"Description",width:"35%"}]}static gotoButtonHandler(e){e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected"),i=[];for(let e of t){const{locus:t}=vv(e.dataset.region);i.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");this.setTableRowSelectionState(!1),i.length>0&&this.browser.search(i.join(" "))}}function gv(e,t){e.style.pointerEvents=t?"auto":"none",e.style.color=Wn(t?"licorice":"silver"),e.style.borderColor=Wn(t?"licorice":"silver")}class mv{constructor(e){this.browser=e,this.roiMenu=new fv(e,e.columnContainer),this.roiTable=new pv(e,e.columnContainer),this.top=0,this.roiSets=[],this.showOverlays=!0,this.boundLocusChangeHandler=wv.bind(this),e.on("locuschange",this.boundLocusChangeHandler)}async reset(){this.roiSets.length>0&&this.browser.roiTableControl.setVisibility(!0);const e=this.roiSets.map((e=>this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})));e.length>0&&await Promise.all(e);const t=await this.getTableRecords();this.roiTable.renderTable(t),this.roiSets.length>0&&this.setOverlayVisibility(this.showOverlays)}setOverlayVisibility(e){const t=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let i=0;i<t.length;i++){const n=t[i];n.style.backgroundColor=e?n.dataset.color:"rgba(0, 0, 0, 0)"}this.roiTable.toggleROIButton.textContent=!1===e?"Show Overlays":"Hide Overlays"}async loadROI(e,t){const i=Array.isArray(e)?e:[e];i.length>0&&!1===i[0].isVisible&&(this.showOverlays=!1);for(let e of i)!e.name&&e.url&&(e.name=await Ks(e.url)),e.url&&!e.format&&(e.format=await wf(e)),this.roiSets.push(new qh(e,t));await this.reset()}clearROIs(){this.roiTable.clearTable();const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();for(let e of this.roiSets)e.dispose();this.roiSets=[]}async getTableRecords(){const e=[];for(let t of this.roiSets){const i=t.name||"",n=await t.getAllFeatures();for(let t of Object.keys(n))for(let r of n[t])e.push({setName:i,feature:r})}return e}presentTable(){this.roiTable.present()}async repaintTable(){const e=await this.getTableRecords();this.roiTable.renderTable(e)}dismissTable(){this.roiTable.dismiss()}roiTableIsVisible(){return this.roiTable.isVisible()}async updateUserDefinedROISet(e){let t=await this.getUserDefinedROISet();void 0===t&&(t=this.initializeUserDefinedROISet()),t.addFeature(e),this.setROITableButtonVisibility(!0),await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:t});const i=await this.getTableRecords();this.roiTable.renderTable(i)}setROITableButtonVisibility(e){this.browser.roiTableControl.setVisibility(e)}toggleROIs(){this.showOverlays=!this.showOverlays,this.setOverlayVisibility(this.showOverlays)}async renderAllROISets(){for(let e of this.roiSets)await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})}async renderROISet({browser:e,pixelTop:t,roiSet:i}){const n=e.columnContainer.querySelectorAll(".igv-column");for(let r=0;r<n.length;r++){let{chr:s,start:o,end:a,bpPerPixel:c}=e.referenceFrameList[r];const l=n[r].querySelectorAll(".igv-roi-region");for(let e of l){const t=e.dataset.region,{chr:i,start:n,end:r}=vv(t);(i!==s||r<o||n>a)&&e.remove()}const h=await i.getFeatures(s,o,a);if(h)for(let l of h){const h=bv(s,l.start,l.end),{x:d,width:u}=Qh(Math.max(o,l.start),Math.min(a,l.end),o,c),f=n[r].querySelector(Fv(h));if(f)f.style.left=`${d}px`,f.style.width=`${u}px`;else{const s=this.createRegionElement(e.columnContainer,t,d,u,i,h,l);n[r].appendChild(s)}}}}createRegionElement(e,i,n,r,s,o,c){const l=t({class:"igv-roi-region"});l.style.top=`${i}px`,l.style.left=`${n}px`,l.style.width=`${r}px`;const h=`${this.getROIRegionTopMargin()}px`;l.style.marginTop=h,l.dataset.color=s.color,l.dataset.region=o,this.showOverlays?l.style.backgroundColor=s.color:l.style.backgroundColor="rgba(0, 0, 0, 0)";const d=t();return l.appendChild(d),d.style.backgroundColor=s.headerColor,d.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),a(t,e),this.roiMenu.present(c,s,t,this,e,l)})),l}updateROIRegionPositions(){const e=`${this.getROIRegionTopMargin()}px`,t=this.browser.columnContainer.querySelectorAll(".igv-column");for(let i=0;i<t.length;i++){const n=t[i].querySelectorAll(".igv-roi-region");for(let t=0;t<n.length;t++)n[t].style.marginTop=e}}getROIRegionTopMargin(){const e=this.browser.findTracks((e=>new Set(["ideogram","ruler"]).has(e.type))),[t,i]=e.map((e=>e.trackView.viewports[0].viewportElement)).map((e=>function(e){const t=window.getComputedStyle(e),i=parseInt(t.marginTop),n=parseInt(t.marginBottom),{top:r,bottom:s,height:o}=e.getBoundingClientRect();return{top:Math.floor(r)-i,bottom:Math.floor(s)+n,height:Math.floor(o)+i+n}}(e)));return(t?t.height:0)+(i?i.height:0)+-.5}renderSVGContext(e,t,{deltaX:i,deltaY:n}){for(const r of e.querySelectorAll(".igv-roi-region")){const{x:e,y:s,width:o,height:a}=r.getBoundingClientRect();t.fillStyle=r.style.backgroundColor,t.fillRect(e-i,s+n,o,a);const c=r.querySelector("div"),{x:l,y:h,width:d,height:u}=c.getBoundingClientRect();t.fillStyle=c.style.backgroundColor,t.fillRect(l-i,h+n,d,u)}}getUserDefinedROISet(){return this.roiSets.find((e=>!0===e.isUserDefined))}deleteUserDefinedROISet(){this.roiSets=this.roiSets.filter((e=>!0!==e.isUserDefined))}initializeUserDefinedROISet(){const e=new qh({name:"user defined",isUserDefined:!0,features:[]},this.browser.genome);return this.roiSets.push(e),e}async deleteRegionWithKey(e,t){t.querySelectorAll(Fv(e)).forEach((e=>e.remove()));0===(await this.getTableRecords()).length&&(this.browser.roiTableControl.buttonHandler(!1),this.setROITableButtonVisibility(!1))}toJSON(){return this.roiSets.map((e=>e.toJSON()))}dispose(){this.browser.off("locuschange",this.boundLocusChangeHandler);const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();this.roiMenu&&this.roiMenu.dispose(),this.roiTable&&this.roiTable.dispose();for(let e of this.roiSets)e.dispose();for(let e of Object.keys(this))this[e]=void 0}}function wv(){this.renderAllROISets()}function bv(e,t,i){return`${e}-${t}-${i}`}function Fv(e){return`[data-region="${e}"]`}function vv(e){let t=e.split("-"),i=parseInt(t.pop()),n=parseInt(t.pop()),r=t.join("-");return{chr:r,start:n,end:i,locus:`${r}:${n}-${i}`,bedRecord:`${r}\t${n}\t${i}`}}class yv{constructor(e,t){this.name=e.name,this.featureSource=e.featureSource||Hl(e,t),this.color=e.color||Oh}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}draw(e){const{context:t,bpPerPixel:i,bpStart:n,pixelTop:r,pixelHeight:s,pixelWidth:o,features:a}=e;if(!a)return;const c=n+o*i+1;for(let{start:e,end:o}of a){if(o<n)continue;if(e>c)break;const{x:a,width:l}=Qh(e,o,n,i);fr.fillRect(t,a,r,l,s,{fillStyle:this.color})}}}class Av{aliasRecordCache=new Map;constructor(e,t){this.genomeID=e,this.update(e,t)}async preload(){}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}update(e,t){if(t){const i=[];for(let n of t){if(this.aliasRecordCache.has(n))continue;const t={chr:n};if(i.push(t),n.startsWith("gi|")){const e=Av.getNCBIName(n);t["ncbi-gi-versioned"]=e;const i=e.lastIndexOf(".");if(i>0){const e=e.substring(0,i);t["ncbi-gi"]=e}}else if("chrM"===n?t.ncbi="MT":"MT"===n?t.ucsc="chrM":n.toLowerCase().startsWith("chr")&&Number.isInteger(Number(n.substring(3)))?t.ncbi=n.substring(3):Number.isInteger(Number(n))&&(t.ucsc="chr"+n),e.startsWith("hg")||e.startsWith("GRCh")||"1kg_ref"===e||"b37"===e)switch(n){case"23":t.ucsc="chrX",t.assembly="X";break;case"24":t.ucsc="chrY",t.assembly="Y";break;case"chrX":t.ncbi="23",t.assembly="X";break;case"chrY":t.ncbi="24",t.assembly="Y";break;case"X":t.ucsc="chrX",t.ncbi="23";break;case"Y":t.ucsc="chrY",t.ncbi="24"}else if(e.startsWith("mm")||e.startsWith("GRCm")||e.startsWith("rheMac"))switch(n){case"21":t.ucsc="chrX",t.assembly="X";break;case"22":t.ucsc="chrY",t.assembly="Y";break;case"chrX":t.ncbi="21",t.assembly="X";break;case"chrY":t.ncbi="22",t.assembly="Y";break;case"X":t.ucsc="chrX",t.ncbi="21";break;case"Y":t.ucsc="chrY",t.ncbi="22"}}for(let e of i){Av.addCaseAliases(e);for(let t of Object.values(e))this.aliasRecordCache.set(t,e)}}}search(e){return this.aliasRecordCache.get(e)}static getNCBIName(e){const t=e.split("\\|");return t[t.length-1]}static addCaseAliases(e){const t=e.chr.toUpperCase(),i=e.chr.toLowerCase(),n=e.chr.charAt(0).toUpperCase()+e.chr.slice(1);e.chr!==t&&(e._uppercase=t),e.chr!==i&&(e._lowercase=i),e.chr!==n&&(e._cap=n)}}class Cv{aliasRecordCache=new Map;constructor(e,t,i){(t=t||{}).url=e,this.reader=new el(t,i)}async preload(e){await this.reader.preload();for(let t of e)await this.search(t)}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async search(e){if(!this.aliasRecordCache.has(e)){const t=await this.reader.search(e);if(t){Av.addCaseAliases(t);for(let e of Object.keys(t))"start"!==e&&"end"!==e&&this.aliasRecordCache.set(t[e],t)}}return this.aliasRecordCache.get(e)}async getChromosomeNames(){return await this.reader.loadHeader(),Array.from(this.reader.chrNames)}}class _v{aliasRecordCache=new Map;constructor(e,t,i){this.aliasURL=e,this.config=t,this.genome=i}async preload(){return this.loadAliases()}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async loadAliases(){const e=await Mn.loadString(this.aliasURL,js(this.config)),t=v(e),i=t[0];i.startsWith("#")&&(this.headings=i.substring(1).split("\t").map((e=>e.trim())),this.altNameSets=this.headings.slice(1));const n=this.genome.chromosomeNames?new Set(this.genome.chromosomeNames):new Set;for(let e of t)if(!e.startsWith("#")&&e.length>0){const t=e.split("\t");let i=t.find((e=>n.has(e)));i||(i=t[0]);const r={chr:i};Av.addCaseAliases(r);for(let e=0;e<t.length;e++){r[this.headings?this.headings[e]:e]=t[e]}for(let e of Object.values(r))this.aliasRecordCache.set(e,r)}}async search(e){return 0===this.aliasRecordCache.size&&await this.loadAliases(),this.aliasRecordCache.get(e)}}class xv{constructor(e,t,i,n){this.start=e,this.end=t,this.name=i,this.stain=0,"acen"===n?this.type="c":(this.type=n.charAt(1),"p"===this.type&&(this.stain=parseInt(n.substring(4))))}}class kv{cytobandMap=new Map;constructor(e,t,i){(t=t||{}).url=e,this.source=new cl(t,i)}async getCytobands(e){if(this.cytobandMap.has(e))return this.cytobandMap.get(e);{let t=await this.#S(e);return t||(t=[]),this.cytobandMap.set(e,t),t}}async#S(e){return(await this.source.getFeatures({chr:e})).map((e=>new xv(e.start,e.end,e.name,e.gieStain)))}}class Iv{cytobands=new Map;constructor(e,t){this.url=e,this.config=t}async getCytobands(e){return 0===this.cytobands.size&&await this.#E(),this.cytobands.get(e)}async#E(){let e,t;if(Xs(this.url)){const t=on(this.url);e="";const i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n])}else e=await Mn.loadString(this.url,js(this.config));let i=[];const n=v(e);for(let e of n){const n=e.split("\t"),r=n[0];if(t||(t=r),r!==t&&(this.cytobands.set(t,i),i=[],t=r),5===n.length){const e=parseInt(n[1]),t=parseInt(n[2]),r=n[3],s=n[4];i.push(new xv(e,t,r,s))}}}async getChromosomeNames(){return 0===this.cytobands.size&&await this.#E(),Array.from(this.cytobands.keys())}async getChromosomes(){0===this.cytobands.size&&await this.#E();const e=[];let t=0;for(let[i,n]of this.cytobands.entries())e.push(new ho(i,t++,n[n.length-1].end));return e}}class Sv{#N;#M=new Map;static async createGenome(e,t){const i=new Sv(e,t);return await i.init(),i}constructor(e,t){this.config=e,this.browser=t,this.id=e.id||function(e){return void 0!==e.id?e.id:e.fastaURL&&b(e.fastaURL)&&!e.fastaURL.startsWith("data:")?e.fastaURL:e.fastaURL&&e.fastaURL.name?e.fastaURL.name:""}(e),this.name=e.name,this.nameSet=e.nameSet}async init(){const e=this.config;if(this.sequence=await Ro(e,this.browser),e.chromSizesURL?this.chromosomes=await async function(e){const t=new Map;let i;if(Xs(e)){let t=on(e);i="";for(let e of t)i+=String.fromCharCode(e)}else i=await Mn.load(e,{});const n=yo(i);let r=0;for(let e of n){const i=e.split("\t");if(i.length>1){const e=Number.parseInt(i[1]);t.set(i[0],new ho(i[0],r++,e))}}return t}(e.chromSizesURL):this.chromosomes=this.sequence.chromosomes||new Map,this.chromosomes.size>0&&(this.chromosomeNames=Array.from(this.chromosomes.keys())),e.chromAliasBbURL?(this.chromAlias=new Cv(e.chromAliasBbURL,Object.assign({},e),this),this.chromosomeNames||(this.chromosomeNames=await this.chromAlias.getChromosomeNames())):e.aliasURL?this.chromAlias=new _v(e.aliasURL,Object.assign({},e),this):this.chromosomeNames&&(this.chromAlias=new Av(this.id,this.chromosomeNames)),e.cytobandBbURL?this.cytobandSource=new kv(e.cytobandBbURL,Object.assign({},e),this):e.cytobandURL&&(this.cytobandSource=new Iv(e.cytobandURL,Object.assign({},e))),this.chromosomeNames||"function"!=typeof this.cytobandSource.getChromosomeNames||(this.chromosomeNames=await this.cytobandSource.getChromosomeNames()),0===this.chromosomes.size&&"function"==typeof this.cytobandSource.getChromosomes){const e=await this.cytobandSource.getChromosomes();for(let t of e)this.chromosomes.set(e.name,e)}if(!1!==e.wholeGenomeView&&this.chromosomes.size>0&&(e.chromosomeOrder?Array.isArray(e.chromosomeOrder)?this.#N=e.chromosomeOrder:this.#N=e.chromosomeOrder.split(",").map((e=>e.trim())):this.#N=function(e){const t=[];let i,n=1;for(let r of e.values()){if(i){if(r.bpLength<i/100)continue;i=((n-1)*i+r.bpLength)/n,t.push(r.name)}else i=r.bpLength,t.push(r.name);n++}return t}(this.chromosomes),await this.chromAlias.preload(this.#N)),this.wholeGenomeView=!1!==e.wholeGenomeView&&this.#N&&this.chromosomes.size>1,this.wholeGenomeView){const e=this.#N.reduce(((e,t)=>e+this.chromosomes.get(t).bpLength),0);this.chromosomes.set("all",new ho("all",0,e))}}get description(){return this.config.description||`${this.id}\n${this.name}`}get infoURL(){return this.config.infoURL}showWholeGenomeView(){return this.wholeGenomeView}toJSON(){return Object.assign({},this.config,{tracks:void 0})}get initialLocus(){return this.config.locus?this.config.locus:this.getHomeChromosomeName()}getHomeChromosomeName(){return this.showWholeGenomeView()&&this.chromosomes.has("all")?"all":this.chromosomeNames[0]}getChromosomeName(e){return this.chromAlias?this.chromAlias.getChromosomeName(e,this.chromosomes.keys()):e}getChromosomeDisplayName(e){return this.nameSet&&this.chromAlias&&this.chromAlias.getChromosomeAlias(e,this.nameSet)||e}getChromosome(e){return this.chromAlias&&(e=this.chromAlias.getChromosomeName(e)),this.chromosomes.get(e)}async loadChromosome(e){const t=await this.getAliasRecord(e);if(t&&(e=t.chr),!this.chromosomes.has(e)){let t;const i=await this.sequence.getSequenceRecord(e);i&&(t=new ho(e,0,i.bpLength)),this.chromosomes.set(e,t)}return this.chromosomes.get(e)}async getAliasRecord(e){if(this.#M.has(e))return this.#M.get(e);if(this.chromAlias){let t=await this.chromAlias.search(e);if(t||e===e.toLowerCase()||(t=await this.chromAlias.search(e.toLowerCase())),t){const e=t.chr.toUpperCase(),i=t.chr.toLowerCase(),n=t.chr.charAt(0).toUpperCase()+t.chr.slice(1);t.chr!==e&&(t._uppercase=e),t.chr!==i&&(t._lowercase=i),t.chr!==n&&(t._cap=n)}return this.#M.set(e,t),t}}async getCytobands(e){if(this.cytobandSource){const t=this.getChromosomeName(e);return await this.cytobandSource.getCytobands(t)}}getChromosomes(){return this.chromosomes}get wgChromosomeNames(){return this.#N?this.#N.slice():void 0}get showChromosomeWidget(){return this.config.showChromosomeWidget}getGenomeCoordinate(e,t){var i=this.getCumulativeOffset(e);if(void 0!==i)return i+t}getChromosomeCoordinate(e){let t;void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=computeCumulativeOffsets.call(this));let i=0;for(let n of this.#N){const r=this.cumulativeOffsets[n];if(r>e){return{chr:t,position:e-i}}t=n,i=r}return{chr:this.#N[this.#N.length-1],position:0}}getCumulativeOffset(e){void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=function(){let e={},t=0;for(let i of this.#N){e[i]=Math.floor(t);t+=this.getChromosome(i).bpLength}return e}.call(this));const t=this.getChromosomeName(e);return this.cumulativeOffsets[t]}getGenomeLength(){if(!this.bpLength){let e=0;for(let t of this.#N){e+=this.chromosomes.get(t).bpLength}this.bpLength=e}return this.bpLength}async getSequence(e,t,i){return e=this.getChromosomeName(e),this.sequence.getSequence(e,t,i)}getSequenceInterval(e,t,i){return"function"==typeof this.sequence.getSequenceInterval?this.sequence.getSequenceInterval(e,t,i):void 0}}class Ev{constructor(){this.clear()}clear(){this.phenotypeColors=new Map,this.snps=new Set,this.qtl=null}isEmpty(){return 0===this.phenotypeColors.size&&0===this.snps.size&&null===this.qtl}addSnp(e){e=e.toUpperCase(),this.snps.add(e)}addPhenotype(e){e=e.toUpperCase();const t=this.phenotypeColors.size;if(!this.phenotypeColors.has(e.toUpperCase())){const i=t<Nv.length?Nv[t]:un.randomRGB(0,255);this.phenotypeColors.set(e.toUpperCase(),i)}}hasSnp(e){return e&&this.snps.has(e.toUpperCase())}hasPhenotype(e){return e&&this.phenotypeColors.has(e.toUpperCase())}hasQTL(e){return this.qtls.has(e)}colorForGene(e){return e?this.phenotypeColors.get(e.toUpperCase()):"black"}toJSON(){const e={};return this.phenotypeColors.size>0&&(e.phenotypes=Array.from(this.phenotypeColors.keys())),this.snps.size>0&&(e.snps=Array.from(this.snps)),this.qtl&&(e.qtl=this.qtl),e}static fromJSON(e){const t=new Ev;if(e.phenotypes)for(let i of e.phenotypes)t.addPhenotype(i);if(e.snps)for(let i of e.snps)t.addSnp(i);return e.qtl&&(t.qtl=e.qtl),t}}const Nv=[];Nv.push("rgb(228,26,28)"),Nv.push("rgb(55,126,184)"),Nv.push("rgb(77,175,74)"),Nv.push("rgb(166,86,40)"),Nv.push("rgb(152,78,163)"),Nv.push("rgb(255,127,0)"),Nv.push("rgb(247,129,191)"),Nv.push("rgb(255,255,51)"),Nv.push("rgb(102,194,165)"),Nv.push("rgb(252,141,98)"),Nv.push("rgb(141, 160, 203)"),Nv.push("rgb(231, 138, 195)"),Nv.push("rgb(166, 216, 84)"),Nv.push("rgb(255, 217, 47)"),Nv.push("rgb(229, 196, 148)"),Nv.push("rgb( 141, 211, 199)"),Nv.push("rgb(255, 255, 179)"),Nv.push("rgb(190, 186, 218)"),Nv.push("rgb(251, 128, 114)"),Nv.push("rgb(128, 177, 211)"),Nv.push("rgb(253, 180, 98)"),Nv.push("rgb(179, 222, 105)"),Nv.push("rgb(252, 205, 229)"),Nv.push("rgb(188, 128, 189)"),Nv.push("rgb(204, 235, 197)"),Nv.push("rgb(255, 237, 111)");class Mv{constructor(e,i){this.browser=i,this.columnContainer=e,this.horizontalGuide=t({class:"igv-cursor-guide-horizontal"}),e.appendChild(this.horizontalGuide),this.verticalGuide=t({class:"igv-cursor-guide-vertical"}),e.appendChild(this.verticalGuide),this.addMouseHandler(i),this.setVisibility(i.config.showCursorGuide)}addMouseHandler(e){this.boundMouseMoveHandler=function(t){t.target.tagName;const{x:i,y:n}=a(t,this.columnContainer);if(this.horizontalGuide.style.top=`${n}px`,"CANVAS"===t.target.tagName){const n=function(e,t){for(;e.parentElement;){if(e.parentElement.classList.contains(t))return e.parentElement;e=e.parentElement}return}(t.target,"igv-viewport");if(n&&e.getRulerTrackView()){this.verticalGuide.style.left=`${i}px`;const r=e.root.querySelectorAll(".igv-column");let s;const o=n.parentElement;for(let e=0;e<r.length;e++)void 0===s&&o===r[e]&&(s=e);if(void 0!==s){const i=e.getRulerTrackView().viewports[s].mouseMove(t);if(i){const{start:e,bp:t,end:n}=i,r=(t-e)/(n-e);this.customMouseHandler&&this.customMouseHandler({start:e,bp:t,end:n,interpolant:r})}}}}}.bind(this),this.columnContainer.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandler(){this.columnContainer.removeEventListener("mousemove",this.boundMouseMoveHandler)}setVisibility(e){!0===e?this.show():this.hide()}show(){this.verticalGuide.style.display="block",this.horizontalGuide.style.display="block"}hide(){if(this.verticalGuide.style.display="none",this.horizontalGuide.style.display="none",this.browser.getRulerTrackView())for(let e of this.browser.getRulerTrackView().viewports)e.tooltip.style.display="none"}}class Rv{constructor(e){this.parent=e,this.container=t({class:"igv-ui-generic-dialog-container"}),e.appendChild(this.container);const i=t({class:"igv-ui-generic-dialog-header"});this.container.appendChild(i),this.label=t({class:"igv-ui-generic-dialog-one-liner"}),this.container.appendChild(this.label),this.label.textContent="Unlabeled",this.input_container=t({class:"igv-ui-generic-dialog-input"}),this.container.appendChild(this.input_container);let r='<input type="range" id="igv-slider-dialog-input" name="igv-slider-dialog-input" />';this._input=document.createRange().createContextualFragment(r).firstChild,this.input_container.appendChild(this._input),r='<output id="igv-slider-dialog-output" name="igv-slider-dialog-output" for="igv-slider-dialog-input"></output>',this._output=document.createRange().createContextualFragment(r).firstChild,this.input_container.appendChild(this._output);const s=t({class:"igv-ui-generic-dialog-ok-cancel"});this.container.appendChild(s),this.ok=t(),s.appendChild(this.ok),this.ok.textContent="OK",this.cancel=t(),s.appendChild(this.cancel),this.cancel.textContent="Cancel",n(this.container),this._input.addEventListener("input",(()=>{const e=parseFloat(this._input.value)/this._scaleFactor;this.callback(e),this._output.value=`${e.toFixed(this._precision)}`}),!1),this.ok.addEventListener("click",(()=>{if("function"==typeof this.callback){const e=parseFloat(this._input.value)/this._scaleFactor;this.callback(e),this.callback=void 0}this._input.value=void 0,n(this.container)}));const o=()=>{this._input.value=void 0,n(this.container)};this.cancel.addEventListener("click",o),u(i,o),p(this.container,i)}get value(){return Fs.sanitize(this._input.value)}present(e,t){this.label.textContent=e.label,this._scaleFactor=e.scaleFactor,this._precision=e.precision||2;const[i,n,s]=[e.min,e.max,e.value].map((e=>Math.floor(this._scaleFactor*e).toString()));this._input.min=i,this._input.max=n,this._input.value=s;const o=parseFloat(s)/this._scaleFactor;this._output.value=`${o.toFixed(this._precision)}`,this.callback=e.callback||e.click,r(this.container),this.clampLocation(t.clientX,t.clientY)}clampLocation(e,t){const{width:i,height:n}=this.container.getBoundingClientRect(),r=window.innerHeight,s=window.innerWidth,o=Math.min(r-n,t),a=Math.min(s-i,e);this.container.style.left=`${a}px`,this.container.style.top=`${o}px`}}class Bv{qtlSelections=new Ev;constructor(e,i){this.config=e,this.guid=o(),this.namespace=".browser_"+this.guid,this.parent=i;let n=i.shadowRoot;if(!n){n=i.attachShadow({mode:"open"});const e=new CSSStyleSheet;e.replaceSync('.igv-ui-dropdown {\n cursor: default;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2048;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n background-color: white;\n}\n.igv-ui-dropdown > div {\n overflow-y: auto;\n overflow-x: hidden;\n background-color: white;\n}\n.igv-ui-dropdown > div > div {\n padding: 4px;\n width: 100%;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: 1px;\n background-color: white;\n}\n.igv-ui-dropdown > div > div:last-child {\n border-bottom-color: transparent;\n border-bottom-width: 0;\n}\n.igv-ui-dropdown > div > div:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.igv-ui-popover {\n cursor: default;\n position: absolute;\n z-index: 2048;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n background-color: white;\n}\n.igv-ui-popover > div:first-child {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-width: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-popover > div:first-child > div:first-child {\n margin-left: 4px;\n}\n.igv-ui-popover > div:first-child > div:last-child {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-popover > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-popover > div:last-child {\n user-select: text;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 400px;\n max-width: 800px;\n background-color: white;\n border-bottom-width: 0;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-ui-popover > div:last-child > div {\n margin-left: 4px;\n margin-right: 4px;\n min-width: 220px;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.igv-ui-popover > div:last-child > div > span {\n font-weight: bolder;\n}\n.igv-ui-popover > div:last-child hr {\n width: 100%;\n}\n\n.igv-ui-alert-dialog-container {\n position: fixed;\n top: 20%;\n left: 50%;\n transform: translateX(-50%);\n z-index: 2048;\n box-sizing: content-box;\n width: 400px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n outline: none;\n font-family: "Open Sans", sans-serif;\n font-size: 15px;\n font-weight: 400;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:first-child {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-alert-dialog-container > div:first-child div:first-child {\n padding-left: 8px;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body {\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n color: #373737;\n width: 100%;\n height: calc(100% - 24px - 64px);\n overflow-y: scroll;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body .igv-ui-alert-dialog-body-copy {\n margin: 16px;\n width: auto;\n height: auto;\n overflow-wrap: break-word;\n word-break: break-word;\n background-color: white;\n border: unset;\n}\n.igv-ui-alert-dialog-container > div:last-child {\n width: 100%;\n margin-bottom: 10px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:last-child div {\n margin: unset;\n width: 40px;\n height: 30px;\n line-height: 30px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n border-color: #2B81AF;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-alert-dialog-container > div:last-child div:hover {\n cursor: pointer;\n border-color: #25597f;\n background-color: #25597f;\n}\n\n.igv-ui-generic-dialog-container {\n box-sizing: content-box;\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n width: 300px;\n height: fit-content;\n padding-bottom: 16px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input > div {\n width: fit-content;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input[type=range] {\n width: 70%;\n -webkit-appearance: none;\n background: linear-gradient(90deg, white, black);\n outline: none;\n margin: 0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input output {\n display: block;\n height: 100%;\n width: 20%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n padding-top: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div {\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n\n.igv-ui-generic-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n width: 300px;\n height: 200px;\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n box-sizing: content-box;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-container > div:first-child {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-ui-generic-container > div:first-child > div {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-ui-generic-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n background-color: #eee;\n}\n.igv-ui-generic-container > div:nth-child(2) {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-container > div:nth-child(3) {\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n padding: 0.5rem;\n font-family: "Open Sans", sans-serif;\n font-size: 1rem;\n font-weight: 400;\n width: 100%;\n border-top-style: solid;\n border-top-width: thin;\n border-top-color: #373737;\n}\n.igv-ui-generic-container > div:nth-child(4) {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n\n.igv-ui-color-swatch {\n position: relative;\n box-sizing: content-box;\n display: flex;\n flex-flow: row;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin: 2px;\n width: 32px;\n height: 32px;\n border-style: solid;\n border-width: 0;\n border-color: white;\n border-radius: 3px;\n}\n\n.igv-ui-color-swatch-shim {\n cursor: pointer;\n position: relative;\n box-sizing: content-box;\n display: flex;\n flex-flow: row;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n background-color: white;\n border-style: solid;\n border-width: thin;\n border-color: white;\n border-radius: 4px;\n}\n\n.igv-ui-dialog {\n z-index: 2048;\n position: fixed;\n width: fit-content;\n height: fit-content;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n background-color: white;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n}\n.igv-ui-dialog .igv-ui-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-dialog .igv-ui-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-dialog .igv-ui-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-dialog .igv-ui-dialog-one-liner {\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin: 8px;\n overflow-wrap: break-word;\n background-color: white;\n font-weight: bold;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel {\n width: 100%;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div {\n margin: 16px;\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child {\n background-color: #5ea4e0;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child {\n background-color: #c4c4c4;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-ui-panel, .igv-ui-panel-row, .igv-ui-panel-column {\n z-index: 2048;\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-panel-column {\n display: flex;\n flex-direction: column;\n}\n\n.igv-ui-panel-row {\n display: flex;\n flex-direction: row;\n}\n\n.igv-ui-textbox {\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-table {\n background-color: white;\n}\n\n.igv-ui-table thead {\n position: sticky;\n top: 0;\n}\n\n.igv-ui-table th {\n text-align: left;\n}\n\n.igv-ui-table td {\n padding-right: 20px;\n}\n\n.igv-ui-table tr:hover {\n background-color: lightblue;\n}\n\n.igv-ui-center-fixed {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.igv-navbar {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n color: #444;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n line-height: 32px;\n padding-left: 8px;\n padding-right: 8px;\n margin-top: 2px;\n margin-bottom: 6px;\n height: 32px;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: #f3f3f3;\n}\n.igv-navbar .igv-navbar-left-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 32px;\n line-height: 32px;\n}\n.igv-navbar .igv-navbar-left-container .igv-logo {\n width: 34px;\n height: 32px;\n margin-right: 8px;\n}\n.igv-navbar .igv-navbar-left-container .igv-current-genome {\n height: 32px;\n margin-left: 4px;\n margin-right: 4px;\n user-select: none;\n line-height: 32px;\n vertical-align: middle;\n text-align: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n height: 100%;\n width: 125px;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container select {\n display: block;\n cursor: pointer;\n width: 100px;\n height: 75%;\n outline: none;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n margin-left: 8px;\n height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 240px;\n height: 22px;\n line-height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container input.igv-search-input {\n cursor: text;\n width: 85%;\n height: 22px;\n line-height: 22px;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n text-align: left;\n padding-left: 8px;\n margin-right: 8px;\n outline: none;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: white;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container .igv-search-icon-container {\n cursor: pointer;\n height: 16px;\n width: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-windowsize-panel-container {\n margin-left: 4px;\n user-select: none;\n}\n.igv-navbar .igv-navbar-right-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container {\n position: relative;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container-hidden {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget {\n color: #737373;\n font-size: 18px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:nth-child(even) {\n display: block;\n height: fit-content;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget input {\n display: block;\n width: 125px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 {\n color: #737373;\n font-size: 18px;\n height: 32px;\n line-height: 32px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:nth-child(even) {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 input {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-hidden {\n display: none;\n}\n\n.igv-navbar-button {\n display: block;\n box-sizing: unset;\n padding-left: 6px;\n padding-right: 6px;\n height: 18px;\n text-transform: capitalize;\n user-select: none;\n line-height: 18px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 11px;\n font-weight: 200;\n color: #737373;\n background-color: #f3f3f3;\n border-color: #737373;\n border-style: solid;\n border-width: thin;\n border-radius: 6px;\n}\n\n.igv-navbar-button:hover {\n cursor: pointer;\n}\n\n.igv-navbar-button-clicked {\n color: white;\n background-color: #737373;\n}\n\n.igv-navbar-icon-button {\n cursor: pointer;\n position: relative;\n width: 24px;\n height: 24px;\n margin-left: 4px;\n margin-right: 4px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:first-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: -18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:last-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.igv-navbar-text-button {\n cursor: pointer;\n position: relative;\n margin-left: 2px;\n margin-right: 2px;\n border: none;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar-text-button > div:nth-child(2) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 0;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-text-button > div:nth-child(3) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 42px;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n#igv-text-button-label {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-inactive rect {\n stroke: #737373;\n fill: white;\n}\n.igv-navbar-text-button-svg-inactive text {\n fill: #737373;\n}\n.igv-navbar-text-button-svg-inactive tspan {\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-hover rect {\n stroke: #737373;\n fill: #737373;\n}\n.igv-navbar-text-button-svg-hover text {\n fill: white;\n}\n.igv-navbar-text-button-svg-hover tspan {\n dominant-baseline: middle;\n}\n\n#igv-save-svg-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-svg-group text {\n fill: #737373;\n}\n\n#igv-save-svg-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-svg-group:hover text {\n fill: white;\n}\n\n#igv-save-png-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-png-group text {\n fill: #737373;\n}\n\n#igv-save-png-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-png-group:hover text {\n fill: white;\n}\n\n.igv-zoom-in-notice-container {\n z-index: 256;\n position: absolute;\n top: 8px;\n left: 50%;\n transform: translate(-50%, 0%);\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n background-color: white;\n}\n.igv-zoom-in-notice-container > div {\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n width: 100%;\n height: 100%;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: #3f3f3f;\n}\n\n.igv-zoom-in-notice {\n position: absolute;\n top: 10px;\n left: 50%;\n}\n.igv-zoom-in-notice div {\n position: relative;\n left: -50%;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #3f3f3f;\n background-color: rgba(255, 255, 255, 0.51);\n z-index: 64;\n}\n\n.igv-container-spinner {\n position: absolute;\n top: 90%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1024;\n width: 24px;\n height: 24px;\n pointer-events: none;\n color: #737373;\n}\n\n.igv-multi-locus-close-button {\n position: absolute;\n top: 2px;\n right: 0;\n padding-left: 2px;\n padding-right: 2px;\n width: 12px;\n height: 12px;\n color: #666666;\n background-color: white;\n z-index: 1000;\n}\n.igv-multi-locus-close-button > svg {\n vertical-align: top;\n}\n\n.igv-multi-locus-close-button:hover {\n cursor: pointer;\n color: #434343;\n}\n\n.igv-multi-locus-ruler-label {\n z-index: 64;\n position: absolute;\n top: 2px;\n left: 0;\n width: 100%;\n height: 12px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-multi-locus-ruler-label > div {\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n color: rgb(16, 16, 16);\n background-color: white;\n}\n.igv-multi-locus-ruler-label > div {\n cursor: pointer;\n}\n\n.igv-multi-locus-ruler-label-square-dot {\n z-index: 64;\n position: absolute;\n left: 50%;\n top: 5%;\n transform: translate(-50%, 0%);\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-multi-locus-ruler-label-square-dot > div:first-child {\n width: 14px;\n height: 14px;\n}\n.igv-multi-locus-ruler-label-square-dot > div:last-child {\n margin-left: 16px;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: rgb(16, 16, 16);\n}\n\n.igv-ruler-sweeper {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 26px;\n bottom: 0;\n left: 0;\n width: 0;\n z-index: 99999;\n background-color: rgba(68, 134, 247, 0.25);\n}\n\n.igv-ruler-tooltip {\n pointer-events: none;\n z-index: 128;\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 32px;\n background-color: transparent;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ruler-tooltip > div {\n pointer-events: none;\n width: 128px;\n height: auto;\n padding: 1px;\n color: #373737;\n font-size: 10px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n background-color: white;\n border-style: solid;\n border-width: thin;\n border-color: #373737;\n}\n\n.igv-track-label {\n position: absolute;\n left: 8px;\n top: 8px;\n width: auto;\n height: auto;\n max-width: 50%;\n padding-left: 4px;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-color: #444;\n border-radius: 2px;\n border-style: solid;\n border-width: thin;\n background-color: white;\n z-index: 128;\n cursor: pointer;\n}\n\n.igv-track-label:hover,\n.igv-track-label:focus,\n.igv-track-label:active {\n background-color: #e8e8e8;\n}\n\n.igv-track-label-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-top: 4px;\n}\n\n.igv-center-line {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n z-index: 8;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-left-style: dashed;\n border-left-width: thin;\n border-right-style: dashed;\n border-right-width: thin;\n}\n\n.igv-center-line-wide {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(127, 127, 127, 0.51);\n}\n\n.igv-center-line-thin {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(0, 0, 0, 0);\n}\n\n.igv-cursor-guide-horizontal {\n display: none;\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 50%;\n height: 1px;\n z-index: 32;\n margin-left: 50px;\n margin-right: 54px;\n border-top-style: dotted;\n border-top-width: thin;\n border-top-color: rgba(127, 127, 127, 0.76);\n}\n\n.igv-cursor-guide-vertical {\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n width: 1px;\n z-index: 32;\n border-left-style: dotted;\n border-left-width: thin;\n border-left-color: rgba(127, 127, 127, 0.76);\n display: none;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-generic-dialog-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n width: 300px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n z-index: 2048;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-generic-dialog-container .igv-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input div {\n width: 30%;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div {\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-generic-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-container > div:nth-child(1) {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-generic-container > div:nth-child(1) i {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-menu-popup {\n position: absolute;\n top: 0;\n left: 0;\n width: max-content;\n max-width: 400px;\n z-index: 512;\n cursor: pointer;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background: white;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-end;\n text-align: left;\n}\n.igv-menu-popup > div:not(:first-child) {\n width: 100%;\n}\n.igv-menu-popup > div:not(:first-child) > div {\n background: white;\n}\n.igv-menu-popup > div:not(:first-child) > div.context-menu {\n padding-left: 4px;\n padding-right: 4px;\n}\n.igv-menu-popup > div:not(:first-child) > div:last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-menu-popup > div:not(:first-child) > div:hover {\n background: #efefef;\n}\n\n.igv-menu-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-bottom: 1px;\n padding-top: 1px;\n}\n\n.igv-menu-popup-header {\n position: relative;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-menu-popup-header div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-menu-popup-header div:hover {\n cursor: pointer;\n color: #444;\n}\n\n.igv-menu-popup-check-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 20px;\n margin-right: 4px;\n background-color: transparent;\n}\n.igv-menu-popup-check-container div {\n padding-top: 2px;\n padding-left: 8px;\n}\n.igv-menu-popup-check-container div:first-child {\n position: relative;\n width: 12px;\n height: 12px;\n}\n.igv-menu-popup-check-container div:first-child svg {\n position: absolute;\n width: 12px;\n height: 12px;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-loading-spinner-container {\n z-index: 1024;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 32px;\n height: 32px;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-loading-spinner-container > div {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: 4px solid rgba(128, 128, 128, 0.5);\n border-top-color: rgb(255, 255, 255);\n animation: spin 1s ease-in-out infinite;\n -webkit-animation: spin 1s ease-in-out infinite;\n}\n\n@keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@-webkit-keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.igv-roi-menu {\n position: absolute;\n z-index: 512;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background-color: white;\n width: 192px;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-menu > div:first-child {\n height: 24px;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-roi-menu > div:first-child > div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-roi-menu > div:first-child > div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-menu > div:last-child {\n background-color: white;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: 0;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n text-align: start;\n vertical-align: middle;\n}\n.igv-roi-menu > div:last-child > div {\n height: 24px;\n padding-left: 4px;\n border-bottom-style: solid;\n border-bottom-width: thin;\n border-bottom-color: #7f7f7f;\n}\n.igv-roi-menu > div:last-child > div:not(:first-child):hover {\n cursor: pointer;\n background-color: rgba(127, 127, 127, 0.1);\n}\n.igv-roi-menu > div:last-child div:first-child {\n font-style: italic;\n text-align: center;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.igv-roi-menu > div:last-child > div:last-child {\n border-bottom-width: 0;\n border-bottom-color: transparent;\n}\n\n.igv-roi-placeholder {\n font-style: normal;\n color: rgba(75, 75, 75, 0.6);\n}\n\n.igv-roi-table {\n position: absolute;\n z-index: 1024;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n resize: both;\n overflow: hidden;\n width: min-content;\n max-width: 1600px;\n border-color: #7f7f7f;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 400;\n background-color: white;\n cursor: default;\n}\n.igv-roi-table > div {\n height: 24px;\n font-size: 14px;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n}\n.igv-roi-table > div:first-child {\n border-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-top-width: 0;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-roi-table > div:first-child > div:first-child {\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n margin-left: 4px;\n margin-right: 4px;\n width: calc(100% - 4px - 12px);\n}\n.igv-roi-table > div:first-child > div:last-child {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7f7f7f;\n}\n.igv-roi-table > div:first-child > div:last-child > svg {\n display: block;\n}\n.igv-roi-table > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-table > .igv-roi-table-description {\n padding: 4px;\n margin-left: 4px;\n word-break: break-all;\n overflow-y: auto;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-goto-explainer {\n margin-top: 5px;\n margin-left: 4px;\n color: #7F7F7F;\n font-style: italic;\n height: 24px;\n border-top: solid lightgray;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-column-titles {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n padding-right: 16px;\n background-color: white;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: #7f7f7f;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n overflow: auto;\n height: 360px;\n flex: 1 1 auto;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: transparent;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row-hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.igv-roi-table > div:last-child {\n min-height: 32px;\n height: 32px;\n line-height: 32px;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: transparent;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-width: 0;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n\n.igv-roi-table-row-selected {\n background-color: rgba(0, 0, 0, 0.125);\n}\n\n.igv-roi-table-button {\n cursor: pointer;\n height: 20px;\n user-select: none;\n line-height: 20px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 13px;\n font-weight: 400;\n color: black;\n padding-left: 6px;\n padding-right: 6px;\n background-color: rgb(239, 239, 239);\n border-color: black;\n border-style: solid;\n border-width: thin;\n border-radius: 3px;\n}\n\n.igv-roi-table-button:hover {\n font-weight: 400;\n background-color: rgba(0, 0, 0, 0.13);\n}\n\n.igv-roi-region {\n z-index: 64;\n position: absolute;\n top: 0;\n bottom: 0;\n pointer-events: none;\n overflow: visible;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-region > div {\n position: relative;\n width: 100%;\n height: 8px;\n pointer-events: auto;\n}\n\n.igv-roi-menu-row {\n height: 24px;\n padding-left: 8px;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n background-color: white;\n}\n\n.igv-roi-menu-row-edit-description {\n width: -webkit-fill-available;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n background-color: white;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-menu-row-edit-description > label {\n margin-left: 2px;\n margin-bottom: 0;\n display: block;\n width: -webkit-fill-available;\n}\n.igv-roi-menu-row-edit-description > input {\n display: block;\n margin-left: 2px;\n margin-right: 2px;\n margin-bottom: 1px;\n width: -webkit-fill-available;\n}\n\n.picker_wrapper.no_alpha .picker_alpha {\n display: none;\n}\n\n.picker_wrapper.no_editor .picker_editor {\n position: absolute;\n z-index: -1;\n opacity: 0;\n}\n\n.picker_wrapper.no_cancel .picker_cancel {\n display: none;\n}\n\n.layout_default.picker_wrapper {\n display: flex;\n flex-flow: row wrap;\n justify-content: space-between;\n align-items: stretch;\n font-size: 10px;\n width: 25em;\n padding: 0.5em;\n}\n\n.layout_default.picker_wrapper input, .layout_default.picker_wrapper button {\n font-size: 1rem;\n}\n\n.layout_default.picker_wrapper > * {\n margin: 0.5em;\n}\n\n.layout_default.picker_wrapper::before {\n content: "";\n display: block;\n width: 100%;\n height: 0;\n order: 1;\n}\n\n.layout_default .picker_slider, .layout_default .picker_selector {\n padding: 1em;\n}\n\n.layout_default .picker_hue {\n width: 100%;\n}\n\n.layout_default .picker_sl {\n flex: 1 1 auto;\n}\n\n.layout_default .picker_sl::before {\n content: "";\n display: block;\n padding-bottom: 100%;\n}\n\n.layout_default .picker_editor {\n order: 1;\n width: 6.5rem;\n}\n\n.layout_default .picker_editor input {\n width: 100%;\n height: 100%;\n}\n\n.layout_default .picker_sample {\n order: 1;\n flex: 1 1 auto;\n}\n\n.layout_default .picker_done, .layout_default .picker_cancel {\n order: 1;\n}\n\n.picker_wrapper {\n box-sizing: border-box;\n background: #f2f2f2;\n box-shadow: 0 0 0 1px silver;\n cursor: default;\n font-family: sans-serif;\n color: #444;\n pointer-events: auto;\n}\n\n.picker_wrapper:focus {\n outline: none;\n}\n\n.picker_wrapper button, .picker_wrapper input {\n box-sizing: border-box;\n border: none;\n box-shadow: 0 0 0 1px silver;\n outline: none;\n}\n\n.picker_wrapper button:focus, .picker_wrapper button:active, .picker_wrapper input:focus, .picker_wrapper input:active {\n box-shadow: 0 0 2px 1px #1e90ff;\n}\n\n.picker_wrapper button {\n padding: 0.4em 0.6em;\n cursor: pointer;\n background-color: #f5f5f5;\n background-image: linear-gradient(0deg, gainsboro, transparent);\n}\n\n.picker_wrapper button:active {\n background-image: linear-gradient(0deg, transparent, gainsboro);\n}\n\n.picker_wrapper button:hover {\n background-color: #fff;\n}\n\n.picker_selector {\n position: absolute;\n z-index: 1;\n display: block;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid #fff;\n border-radius: 100%;\n box-shadow: 0 0 3px 1px #67b9ff;\n background: currentColor;\n cursor: pointer;\n}\n\n.picker_slider .picker_selector {\n border-radius: 2px;\n}\n\n.picker_hue {\n position: relative;\n background-image: linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);\n box-shadow: 0 0 0 1px silver;\n}\n\n.picker_sl {\n position: relative;\n box-shadow: 0 0 0 1px silver;\n background-image: linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%), linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%), linear-gradient(90deg, #808080, rgba(128, 128, 128, 0));\n}\n\n.picker_alpha, .picker_sample {\n position: relative;\n background: linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em, linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;\n box-shadow: 0 0 0 1px silver;\n}\n\n.picker_alpha .picker_selector, .picker_sample .picker_selector {\n background: none;\n}\n\n.picker_editor input {\n font-family: monospace;\n padding: 0.2em 0.4em;\n}\n\n.picker_sample::before {\n content: "";\n position: absolute;\n display: block;\n width: 100%;\n height: 100%;\n background: currentColor;\n}\n\n.picker_arrow {\n position: absolute;\n z-index: -1;\n}\n\n.picker_wrapper.popup {\n position: absolute;\n z-index: 2;\n margin: 1.5em;\n}\n\n.picker_wrapper.popup, .picker_wrapper.popup .picker_arrow::before, .picker_wrapper.popup .picker_arrow::after {\n background: #f2f2f2;\n box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.4);\n}\n\n.picker_wrapper.popup .picker_arrow {\n width: 3em;\n height: 3em;\n margin: 0;\n}\n\n.picker_wrapper.popup .picker_arrow::before, .picker_wrapper.popup .picker_arrow::after {\n content: "";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n z-index: -99;\n}\n\n.picker_wrapper.popup .picker_arrow::before {\n width: 100%;\n height: 100%;\n -webkit-transform: skew(45deg);\n transform: skew(45deg);\n -webkit-transform-origin: 0 100%;\n transform-origin: 0 100%;\n}\n\n.picker_wrapper.popup .picker_arrow::after {\n width: 150%;\n height: 150%;\n box-shadow: none;\n}\n\n.popup.popup_top {\n bottom: 100%;\n left: 0;\n}\n\n.popup.popup_top .picker_arrow {\n bottom: 0;\n left: 0;\n -webkit-transform: rotate(-90deg);\n transform: rotate(-90deg);\n}\n\n.popup.popup_bottom {\n top: 100%;\n left: 0;\n}\n\n.popup.popup_bottom .picker_arrow {\n top: 0;\n left: 0;\n -webkit-transform: rotate(90deg) scale(1, -1);\n transform: rotate(90deg) scale(1, -1);\n}\n\n.popup.popup_left {\n top: 0;\n right: 100%;\n}\n\n.popup.popup_left .picker_arrow {\n top: 0;\n right: 0;\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.popup.popup_right {\n top: 0;\n left: 100%;\n}\n\n.popup.popup_right .picker_arrow {\n top: 0;\n left: 0;\n}\n\n.igv-container {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-top: 4px;\n user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n min-height: 160px;\n}\n\n.igv-viewport {\n position: relative;\n margin-top: 5px;\n line-height: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.igv-viewport-content {\n position: relative;\n width: 100%;\n}\n.igv-viewport-content > canvas {\n position: relative;\n display: block;\n}\n\n.igv-column-container {\n position: relative;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n width: 100%;\n}\n\n.igv-column-shim {\n width: 1px;\n margin-left: 2px;\n margin-right: 2px;\n background-color: #545453;\n}\n\n.igv-axis-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 50px;\n}\n.igv-axis-column > div {\n position: relative;\n margin-top: 5px;\n width: 100%;\n}\n.igv-axis-column > div > div {\n z-index: 512;\n position: absolute;\n top: 8px;\n left: 8px;\n width: fit-content;\n height: fit-content;\n background-color: transparent;\n display: grid;\n align-items: start;\n justify-items: center;\n}\n.igv-axis-column > div > div > input {\n display: block;\n margin: unset;\n cursor: pointer;\n}\n\n.igv-column {\n position: relative;\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-info-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-name-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-scrollbar-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 14px;\n}\n.igv-scrollbar-column > div {\n position: relative;\n margin-top: 5px;\n width: 14px;\n}\n.igv-scrollbar-column > div > div {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 2px;\n width: 8px;\n border-width: 1px;\n border-style: solid;\n border-color: #c4c4c4;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-scrollbar-column > div > div:hover {\n background-color: #c4c4c4;\n}\n\n.igv-track-drag-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 12px;\n background-color: white;\n}\n.igv-track-drag-column > .igv-track-drag-handle {\n z-index: 512;\n position: relative;\n cursor: pointer;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n.igv-track-drag-column .igv-track-drag-handle-color {\n background-color: #c4c4c4;\n}\n.igv-track-drag-column .igv-track-drag-handle-hover-color {\n background-color: #787878;\n}\n.igv-track-drag-column .igv-track-drag-handle-selected-color {\n background-color: #0963fa;\n}\n.igv-track-drag-column > .igv-track-drag-shim {\n position: relative;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n}\n\n.igv-gear-menu-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 28px;\n}\n.igv-gear-menu-column > div {\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 5px;\n width: 100%;\n background: white;\n}\n.igv-gear-menu-column > div > div {\n position: relative;\n margin-top: 4px;\n width: 16px;\n height: 16px;\n color: #7F7F7F;\n}\n.igv-gear-menu-column > div > div:hover {\n cursor: pointer;\n color: #444;\n}\n\n.igv-vertical-center {\n margin: 0 !important;\n top: 50% !important;\n -ms-transform: translateY(-50%) !important;\n transform: translateY(-50%) !important;\n}\n\n/*# sourceMappingURL=igv.css.map */\n'),n.adoptedStyleSheets=[e]}if(this.root=t({class:"igv-container"}),n.appendChild(this.root),this.alert=new Os(this.root),this.columnContainer=t({class:"igv-column-container"}),this.root.appendChild(this.columnContainer),this.menuPopup=new pd(this.columnContainer),this.menuUtils=new or(this),this.initialize(e),this.trackViews=[],this.constants={dragThreshold:3,scrollThreshold:5,defaultColor:"rgb(0,0,150)",doubleClickDelay:e.doubleClickDelay||500},this.eventHandlers={},e.listeners)for(let t of Object.keys(e.listeners))this.on(t,e.listeners[t]);this.on("trackremoved",(()=>{0===this.findTracks((e=>"function"==typeof e.getSamples)).length&&(this.sampleInfoControl.setButtonVisibility(!1),this.sampleNameViewportWidth=void 0,this.showSampleNames=!1,this.sampleNameControl.setState(this.showSampleNames),this.sampleNameControl.hide(),this.layoutChange())})),this.on("didchangecolumnlayout",(()=>{if(zh.length>0){const e=zh.length;for(let t=0;t<e;t++)zh[t].dispose();zh.length=0}})),this.addEventHandlers(),this.sampleInfo=new rd(this),this.createStandardControls(e),this.roiManager=new mv(this),this.previousTrackColors=[]}get doShowROITable(){return this.roiManager.roiTableIsVisible()}initialize(e){this.flanking=e.flanking,this.crossDomainProxy=e.crossDomainProxy,this.formats=e.formats,this.trackDefaults=e.trackDefaults,this.nucleotideColors=e.nucleotideColors||Bo;for(let e of Object.keys(this.nucleotideColors))this.nucleotideColors[e.toLowerCase()]=this.nucleotideColors[e];this.doShowTrackLabels=e.showTrackLabels,this.doShowCenterLine=e.showCenterGuide,this.doShowCursorGuide=e.showCursorGuide,this.showSampleNames=e.showSampleNames,this.sampleNameViewportWidth=void 0,e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),e.search&&(this.searchConfig={type:"json",url:e.search.url,coords:void 0===e.search.coords?1:e.search.coords,chromosomeField:e.search.chromosomeField||"chromosome",startField:e.search.startField||"start",endField:e.search.endField||"end",geneField:e.search.geneField||"gene",snpField:e.search.snpField||"snp",resultsField:e.search.resultsField})}createStandardControls(e){this.setTrackLabelVisibility(e.showTrackLabels),this.navbar=new av(e,this),this.columnContainer.parentNode.insertBefore(this.navbar.navigation,this.columnContainer),!1===e.showControls&&this.navbar.hide(),this.cursorGuide=new Mv(this.columnContainer,this),this.inputDialog=new vs(this.root),this.inputDialog.container.id=`igv-input-dialog-${o()}`,this.dataRangeDialog=new ur(this,this.root),this.dataRangeDialog.container.id=`igv-data-range-dialog-${o()}`,this.genericColorPicker=new Ls({parent:this.root,width:180}),this.genericColorPicker.container.id=`igv-track-color-picker-${o()}`,this.sliderDialog=new Rv(this.root),this.sliderDialog.container.id=`igv-slider-dialog-${o()}`}getSampleNameViewportWidth(){return void 0===this.sampleNameViewportWidth||!1===this.showSampleNames?0:this.sampleNameViewportWidth}getSampleInfoViewportWidth(){return this.getSampleInfoColumnWidth()}isMultiLocusMode(){return this.referenceFrameList&&this.referenceFrameList.length>1}isMultiLocusWholeGenomeView(){if(void 0===this.referenceFrameList||1===this.referenceFrameList.length)return!1;for(let e of this.referenceFrameList)if("all"===e.chr.toLowerCase())return!0;return!1}currentLoci(){const e=e=>`${e.chr}:${e.start+1}-${e.end}`;return void 0===this.referenceFrameList||0===this.referenceFrameList.length?"":1===this.referenceFrameList.length?e(this.referenceFrameList[0]):this.referenceFrameList.map((t=>e(t)))}toSVG(){const{x:e,y:t,width:i,height:n}=this.columnContainer.getBoundingClientRect(),r=new _h({width:i,height:n,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:i,height:n}}),s={deltaX:0,deltaY:-t};for(let e of this.trackViews)e.renderSVGContext(r,s);return s.deltaX=e,this.roiManager.renderSVGContext(this.columnContainer,r,s),r.getSerializedSvg(!0)}saveSVGtoFile(e,t){let i=this.toSVG();if(t){const e=document.createElement("svg");e.innerHTML=i,t.appendChild(e)}const n=e||"igvjs.svg",r=URL.createObjectURL(new Blob([i],{type:"application/octet-stream"}));x(n,r),URL.revokeObjectURL(r)}savePNGtoFile(e){const t=this.toSVG(),i=new Blob([t],{type:"image/svg+xml"}),n=URL.createObjectURL(i),r=document.createElement("img");r.addEventListener("load",(()=>{const t=this.columnContainer.getBoundingClientRect(),i=window.devicePixelRatio,s=t.width*i,o=t.height*i,a=document.createElement("canvas");a.width=s,a.height=o;const c=a.getContext("2d");c.scale(i,i),c.drawImage(r,0,0);const l=a.toDataURL("image/png");x(e=e||"igvjs.png",l),URL.revokeObjectURL(n)})),r.src=n}async loadSession(e){let t;return this.sampleInfo.initialize(),this.roiSets=[],t=e.url||e.file?await Bv.loadSessionFile(e):e,this.loadSessionObject(t)}static async loadSessionFile(e){const t=e.url||e.file;let i;if(e.url&&b(e.url)&&(e.url.startsWith("blob:")||e.url.startsWith("data:"))){const t=Bv.uncompressSession(e.url);i=JSON.parse(t)}else{let n=e.filename;if(n||(n=e.url?await Ks(e.url):e.file.name),n.endsWith(".xml")){const e=Mh.KNOWN_GENOMES,n=await Mn.loadString(t);i=new VF(n,e)}else if(n.endsWith("hub.txt")){i={reference:(await kh.loadHub(t,e)).getGenomeConfig()}}else{if(!n.endsWith(".json"))throw Error("Unrecognized session file format:"+n);i=await Mn.loadJson(t)}}return Ov(i)}async loadSessionObject(e){this.cleanHouseForSession(),this.config=e,e.browsers&&(e=await async function(e){const t=e.browsers[0],i={},n=new jd({url:t.url});await n.readHeaderAndFooter(),i.sampleNameViewportWidth=20,i.genome="hg38";const r=t.state.split(","),s=n.bpResolutions[Number.parseInt(r[2])],o=Number.parseInt(r[0]),a=Math.floor(Number.parseFloat(r[3])*s),c=a+Math.floor(1700*s);return i.locus=`${n.chromosomes[o].name}:${a}-${c}`,i.tracks=(t.tracks||[]).filter((e=>!("refgene"===e.format||"cellType"===e.name))),i.tracks.push({type:"shoebox",url:t.url,name:t.name,colorScale:t.colorScale,_hicFile:n}),i}(e)),this.navbar.sampleInfoControl.setButtonVisibility(!1),this.showSampleNames=e.showSampleNames||!1,this.navbar.sampleNameControl.setState(!0===this.showSampleNames),e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),Zs(this.columnContainer,"igv-axis-column"),Zs(this.columnContainer,"igv-sample-info-column"),Zs(this.columnContainer,"igv-sample-name-column"),Zs(this.columnContainer,"igv-scrollbar-column"),Zs(this.columnContainer,"igv-track-drag-column"),Zs(this.columnContainer,"igv-gear-menu-column");const t=e.reference||e.genome;if(!t)return void console.warn("No genome or reference object specified");const i=b(t)?await Mh.expandReference(this.alert,t):t;if(await this.loadReference(i,i.locus||e.locus),this.centerLineList=this.createCenterLineList(this.columnContainer),!1!==e.showIdeogram){const e=new MF(this),t=new kd(this,this.columnContainer,e);this.trackViews.push(t)}if(!1!==e.showRuler){const e=new ld(this),t=new kd(this,this.columnContainer,e);this.trackViews.push(t)}e.qtlSelections&&(this.qtlSelections=Ev.fromJSON(e.qtlSelections)),void 0!==e.showROIOverlays&&(this.roiManager.showOverlays=e.showROIOverlays),this.roiManager.clearROIs(),e.roi?this.roiManager.loadROI(e.roi):await this.roiManager.reset();const n=[];if(e.sampleinfo)for(const t of e.sampleinfo)t.file?n.push(t.file):this.loadSampleInfo(t);const r=i.tracks||[],s=e.tracks?r.concat(e.tracks):r;0===s.filter((e=>"sequence"===e.type&&!e.url&&!e.fastaURL)).length&&s.push({type:"sequence",order:ah,removable:!1});const o=s.filter((e=>void 0!==e.file)).map((({file:e})=>e)),a=s.filter((e=>void 0!==e.indexFile)).map((({indexFile:e})=>e));a.length>0&&o.push(...a),n.length>0&&o.push(...n),o.length>0&&alert(`Local files cannot be loaded automatically.\nThis session contains references to these local files:\n${o.map((e=>` ${e}`)).join("\n")}`);const c=s.filter((e=>void 0===e.file));let l=1;for(let e of c)void 0===e.order&&(e.order=l++);await this.loadTrackList(c);for(let e of this.trackViews.filter((e=>"ruler"===e.track.type||"ideogram"===e.track.type)))await e.updateViews();return this.trackViews.some((e=>e.track.selected))&&this.navbar.setEnableTrackSelection(!0),this.updateUIWithReferenceFrameList(),this.updateLocusSearchWidget(),s}cleanHouseForSession(){for(let e of this.trackViews)e.removeDOMFromColumnContainer();this.columnContainer.querySelectorAll(".igv-axis-column, .igv-column-shim, .igv-column, .igv-sample-info-column, .igv-sample-name-column, .igv-scrollbar-column, .igv-track-drag-column, .igv-gear-menu-column").forEach((e=>e.remove())),this.trackViews=[],this.circularView&&this.circularView.clearChords()}async loadReference(e,t){let i;this.removeAllTracks(),this.roiManager.clearROIs(),this.navbar.setEnableTrackSelection(!1),i=e.gbkURL?await Bl(e.gbkURL):await Sv.createGenome(e,this);const n=void 0===this.genome||this.genome.id!==i.id;this.genome=i,this.navbar.updateGenome(i);let r=t||i.initialLocus;Array.isArray(r)&&(r=r.join(" "));if(!await this.search(r,!0))throw new Error(`Cannot set initial locus ${r}`);if(n){let t;if(e.hubURL){t=(await kh.loadHub(e.hubURL)).getGroupedTrackConfigurations()}this.fireEvent("genomechange",[{genome:i,trackConfigurations:t}]),this.circularView&&this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:$f(this.genome)})}}async loadGenome(e){let t;e.genarkAccession&&(e.url=xh(e.genarkAccession)),e.url&&(b(e.url)&&e.url.endsWith("/hub.txt")?(e.hubURL=e.url,delete e.url):"gbk"===function(e){let t;if(e instanceof File)t=e.name;else{if("string"!=typeof e)throw new Error("Input must be a File object or a URL string");t=e}const i=t.split(".").pop();return i.split("?")[0]}(e.url)&&(e.gbkURL=e.url,delete e.url));if(e.hubURL||e.url&&b(e.url)&&e.url.endsWith("/hub.txt")){t=(await kh.loadHub(e.hubURL||e.url,e)).getGenomeConfig()}else t=b(e)||!(e.url||e.fastaURL||e.twoBitURL||e.gbkURL)?await Mh.expandReference(this.alert,e):e;let i;await this.loadReference(t),i=t.gbkURL||"gbk"===t.format?[{name:"Annotations",format:"gbk",url:t.gbkURL}]:t.tracks||[];return 0===i.filter((e=>"sequence"===e.type)).length&&i.push({type:"sequence",order:ah}),await this.loadTrackList(i),await this.updateViews(),this.genome}async loadTrackHub(e){const t=Ov((await kh.loadHub(e.url,e)).getGenomeConfig());return this.loadGenome(t)}updateUIWithReferenceFrameList(){const e=this.referenceFrameList;this.isMultiLocusWholeGenomeView()||Mh.isWholeGenomeView(e[0].chr),this.navbar.navbarDidResize(),Hv(this.trackViews,this.doShowTrackLabels),this.doShowCenterLine&&Mh.isWholeGenomeView(e[0].chr)&&this.navbar.centerLineButton.boundMouseClickHandler(),this.doShowCursorGuide&&Mh.isWholeGenomeView(e[0].chr)&&this.navbar.cursorGuideButton.boundMouseClickHandler(),this.setCenterLineAndCenterLineButtonVisibility(Mh.isWholeGenomeView(e[0].chr))}setCenterLineAndCenterLineButtonVisibility(e){e?this.navbar.centerLineButton.setVisibility(!1):this.navbar.centerLineButton.setVisibility(this.config.showCenterGuideButton);for(let t of this.centerLineList)e?this.setCenterLineVisibility(!e):this.setCenterLineVisibility(this.doShowCenterLine)}setTrackLabelVisibility(e){Hv(this.trackViews,e)}setROITableVisibility(e){!0===e?this.roiManager.presentTable():this.roiManager.dismissTable()}setCursorGuideVisibility(e){e?this.cursorGuide.show():this.cursorGuide.hide()}setCustomCursorGuideMouseHandler(e){this.cursorGuide.customMouseHandler=e}setCenterLineVisibility(e){for(let t of this.centerLineList)!0===e?(t.show(),t.repaint()):t.hide()}async loadTrackList(e){let t=0;for(let i of e)void 0===i.order&&(i.order=t++);const i=[];for(let t of e)i.push(this._loadTrack(t));const n=await Promise.all(i);return this.trackViews.filter((function(e){return e.track.autoscaleGroup})).length>0&&this.updateViews(),n}async loadTrack(e){e.sync=!1!==e.sync;const t=this._loadTrack(e);return t&&e.autoscaleGroup&&(await t,this.updateViews()),t}async _loadTrack(e){b(e)&&(e=JSON.parse(e));try{if(e.hidden){const t=Hl(e,this.genome);return void await t.getFeatures({chr:"1",start:0,end:Number.MAX_SAFE_INTEGER})}const t=await this.createTrack(e);if("sampleinfo"===e.type)return void this.layoutChange();if(void 0===t)return;return this.addTrack(e,t)}catch(t){let i=t.message||t.error||t.toString();const n={401:"Access unauthorized",403:"Access forbidden",404:"Not found"};n.hasOwnProperty(i)&&(i=n[i]),i=`${i} : ${_(e.url)?e.url.name:e.url}`;const r=new Error(i);throw console.error(r),r}}async addTrack(e,t){void 0===t.order&&(t.order=this.trackViews.length);const i=new kd(this,this.columnContainer,t);if(this.trackViews.push(i),Hv(this.trackViews,this.doShowTrackLabels),"function"==typeof t.postInit)try{i.startSpinner(),await t.postInit()}finally{i.stopSpinner()}return t.autoscaleGroup||(e.sync?await i.updateViews():i.updateViews()),"function"==typeof t.hasSamples&&t.hasSamples()&&(this.sampleInfo.hasAttributes()&&this.sampleInfoControl.setButtonVisibility(!0),!1!==this.config.showSampleNameButton&&this.sampleNameControl.show()),this.reorderTracks(),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),t.trackView.enableTrackSelection(this.navbar.getEnableTrackSelection()),t}async loadROI(e){return this.roiManager.loadROI(e,this.genome)}clearROIs(){this.roiManager.clearROIs()}async getUserDefinedROIs(){if(this.roiManager){const e=this.roiManager.getUserDefinedROISet();if(void 0===e)return[];const t=await e.getAllFeatures(),i=[];for(let e of Object.values(t))i.push(...e);return i}return[]}getRulerTrackView(){const e=this.trackViews.filter((({track:e})=>"ruler"===e.id));return e.length>0?e[0]:void 0}async createTrack(e){let t=await async function(e){return"function"==typeof e?e():e}
|
|
35
|
-
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(e.url||e.fastaURL);if(b(t)&&(t=t.trim()),t)if(e.format)e.format=e.format.toLowerCase();else if(e.fastaURL)e.format="fasta";else if(e.sourceType)"htsget"===e.sourceType&&await Dc.inferFormat(e);else{const t=await wf(e);t&&(e.format=t)}e.type&&qs(e);let i=e.type?e.type.toLowerCase():void 0;if(!i){if(!e.format)throw Error(`Unrecognized track: ${JSON.stringify(e)}`);if("hic"===e.format){const t=new jd(e);if(await t.readHeaderAndFooter(),!t.chromosomeIndexMap.celltype)throw Error("'.hic' files not supported");i="shoebox",e._hicFile=t}else if(i=Vs(e.format),"bedtype"===i){const t=Hl(e,this.genome);e._featureSource=t;const n=await t.trackType();i=n||"annotation"}e.type=i}if(this.trackDefaults&&i){const t=this.trackDefaults[i];if(t)for(let i in t)t.hasOwnProperty(i)&&void 0===e[i]&&(e[i]=t[i])}const n=function(e,t,i){let n;switch(e){case"annotation":case"genes":case"fusionjuncspan":case"snp":n="feature";break;case"seg":case"maf":case"mut":n="seg";break;case"junctions":case"splicejunctions":n="junction";break;default:n=e}return OF.has(n)?OF.get(n)(t,i):void 0}(i,e,this);if(void 0!==n)return e.roi&&e.roi.length>0&&(n.roiSets=e.roi.map((e=>new yv(e,this.genome)))),n;this.alert.present(new Error(`Error creating track. Could not determine track type for file: ${e.url||e}`),void 0)}reorderTracks(){this.trackViews.sort((function(e,t){const i=e=>"ideogram"===e.track.id?1:"ruler"===e.track.id?2:3,n=i(e),r=i(t);if(n===r){return(e.track.order||0)-(t.track.order||0)}return n-r}));for(let{axis:e,viewports:t,sampleInfoViewport:i,sampleNameViewport:n,outerScroll:r,dragHandle:s,gearContainer:o}of this.trackViews){e.remove();for(let{viewportElement:e}of t)e.parentNode.removeChild(e);i.viewport.remove(),n.viewport.remove(),r.remove(),s.remove(),o.remove()}const e=this.columnContainer.querySelectorAll(".igv-column");for(let{axis:t,viewports:i,sampleInfoViewport:n,sampleNameViewport:r,outerScroll:s,dragHandle:o,gearContainer:a}of this.trackViews){this.columnContainer.querySelector(".igv-axis-column").appendChild(t);for(let t=0;t<e.length;t++){const{viewportElement:n}=i[t];e[t].appendChild(n)}this.columnContainer.querySelector(".igv-sample-info-column").appendChild(n.viewport),this.columnContainer.querySelector(".igv-sample-name-column").appendChild(r.viewport),this.columnContainer.querySelector(".igv-scrollbar-column").appendChild(s),this.columnContainer.querySelector(".igv-track-drag-column").appendChild(o),this.columnContainer.querySelector(".igv-gear-menu-column").appendChild(a)}}getTrackOrder(){return this.trackViews.filter((e=>e.track&&e.track.name)).map((e=>e.track.name))}getSelectedTrackViews(){return this.trackViews.filter((e=>!0===e.track.selected))}removeTrackByName(e){const t=this.trackViews.slice();for(let i of t)e===i.track.name&&this.removeTrack(i.track)}removeTrack(e){for(let t of this.trackViews)if(e===t.track){this._removeTrack(t.track);break}}_removeTrack(e){e.disposed||(this.trackViews.splice(this.trackViews.indexOf(e.trackView),1),this.fireEvent("trackremoved",[e]),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),e.trackView&&e.trackView.dispose())}removeAllTracks(){const e=this.trackViews;this.trackViews=[];for(let t of e)"ruler"!==t.track.id&&"ideogram"!==t.track.id?(this.fireEvent("trackremoved",[t.track]),t.dispose()):this.trackViews.push(t)}get ideogramTrackView(){return this.trackViews[0]}get rulerTrackView(){return this.trackViews[1]}findTracks(e,t){let i="function"==typeof e?t=>e(t.track):i=>t===i.track[e];return this.trackViews.filter(i).map((e=>e.track))}get tracks(){return this.trackViews.map((e=>e.track)).filter((e=>void 0!==e))}setTrackHeight(e){this.trackHeight=e,this.trackViews.forEach((function(t){t.setTrackHeight(e)}))}async visibilityChange(){this.layoutChange()}async layoutChange(){if(this.referenceFrameList.find((e=>e.bpPerPixel<0))){const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel=(t.end-t.start)/e}this.referenceFrameList&&this.navbar.navbarDidResize(),Dv.call(this),this.roiManager.updateROIRegionPositions(),await this.updateViews()}async updateViews(){const e=this.trackViews;this.updateLocusSearchWidget();for(let e of this.referenceFrameList)e.bpPerPixel<=10&&await this.genome.getSequence(e.chr,e.start,e.start+1);for(let e of this.centerLineList)e.repaint();if(this.dragObject)for(let t of e)await t.updateViews();else{const t={},i=[];for(const n of e)if(n.track.autoscaleGroup){const e=n.track.autoscaleGroup;t[e]||(t[e]=[]),t[e].push(n)}else i.push(n);if(Object.entries(t).length>0)for(const[e,i]of Object.entries(t)){const e=await Promise.all(i.map((e=>e.getInViewFeatures()))),t=Gs(e.flat());for(const e of i)e.track.dataRange=Object.assign({},t),e.track.autoscale=!1;await Promise.all(i.map((e=>e.updateViews())))}await Promise.all(i.map((e=>e.updateViews())))}}repaintViews(){for(let e of this.trackViews)e.repaintViews()}updateLocusSearchWidget(){if(!this.referenceFrameList)return;const e=this.referenceFrameList,t=this.calculateViewportWidth(this.referenceFrameList.length);for(let i of e)i.end=i.start+i.bpPerPixel*t;const i=1===e.length?this.referenceFrameList[0].chr:"",n=this.referenceFrameList.map((e=>e.getLocusString())).join(" ");this.navbar.updateLocus(n,i),this.fireEvent("locuschange",[this.referenceFrameList])}calculateViewportWidth(e){let{width:t}=this.columnContainer.getBoundingClientRect();return t-=50+this.getSampleInfoViewportWidth()+this.getSampleNameViewportWidth()+14+12+28,t-=5*(e-1),Math.floor(t/e)}minimumBases(){return this.config.minimumBases}zoomIn(){this.zoomWithScaleFactor(.5)}zoomOut(){this.zoomWithScaleFactor(2)}async zoomWithScaleFactor(e,t,i){if(!this.referenceFrameList)return;const n=this.calculateViewportWidth(this.referenceFrameList.length);let r=i?[i]:this.referenceFrameList;for(let i of r)i.zoomWithScaleFactor(this,e,n,t)}async addMultiLocusPanel(e,t,i,n){if(!this.referenceFrameList)return;const r=this.calculateViewportWidth(1+this.referenceFrameList.length),s=this.calculateViewportWidth(this.referenceFrameList.length)/this.calculateViewportWidth(1+this.referenceFrameList.length);for(let e of this.referenceFrameList)e.bpPerPixel*=s;const o=(i-t)/r,a=new QF(this.genome,e,t,i,o),c=n?this.referenceFrameList.indexOf(n):this.referenceFrameList.length-1,l=1+c,{viewportElement:h}=this.trackViews[0].viewports[c],d=lv(h.parentElement);if(this.fireEvent("didchangecolumnlayout"),l===this.referenceFrameList.length){this.referenceFrameList.push(a);for(let e of this.trackViews){const t=ed(e,d,a);e.viewports.push(t)}}else{this.referenceFrameList.splice(l,0,a);for(let e of this.trackViews){const t=ed(e,d,a);e.viewports.splice(l,0,t)}}this.centerLineList=this.createCenterLineList(this.columnContainer),Dv.call(this),await this.updateViews(!0)}createCenterLineList(e){const t=e.querySelectorAll(".igv-center-line");for(let e=0;e<t.length;e++)t[e].remove();const i=[],n=e.querySelectorAll(".igv-column");for(let e=0;e<n.length;e++)i.push(new dv(this,this.referenceFrameList[e],n[e]));return i}async removeMultiLocusPanel(e){const t=this.referenceFrameList.indexOf(e),{viewportElement:i}=this.trackViews[0].viewports[t];cv(t,i.parentElement),this.fireEvent("didchangecolumnlayout");for(let{viewports:e}of this.trackViews)e[t].dispose(),e.splice(t,1);if(this.referenceFrameList.splice(t,1),1===this.referenceFrameList.length&&this.getRulerTrackView())for(let e of this.getRulerTrackView().viewports)e.dismissLocusLabel();const n=this.calculateViewportWidth(1+this.referenceFrameList.length)/this.calculateViewportWidth(this.referenceFrameList.length);await this.rescaleForMultiLocus(n)}async gotoMultilocusPanel(e){const t=this.referenceFrameList.indexOf(e);this.columnContainer.querySelectorAll(".igv-column").forEach(((e,i)=>{i===t||e.remove()})),this.columnContainer.querySelectorAll(".igv-column-shim").forEach((e=>e.remove()));for(let e of this.trackViews){const i=e.viewports[t];e.viewports.filter(((e,i)=>i!==t)).forEach((e=>e.dispose())),e.viewports=[i]}const i=this.calculateViewportWidth(1);e.bpPerPixel=(e.end-e.start)/i,this.referenceFrameList=[e],this.trackViews.forEach((({viewports:e})=>e.forEach((e=>e.setWidth(i))))),this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}async rescaleForMultiLocus(e){const t=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel*=e;for(let{viewports:e}of this.trackViews)for(let i of e)i.setWidth(t);this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews()}async goto(e,t,i){await this.search(e+":"+t+"-"+i)}async doSearch(e,t){const i=await this.search(e,t);return i||this.alert.present(new Error(`Unrecognized locus: <b> ${e} </b>`)),i}async search(e,t){const i=await async function(e,t){if(void 0===t||""===t.trim())return;const i=t.split(" ");let n=[];const r=async t=>{if("all"===t.trim().toLowerCase()||"*"===t)return e.genome.wholeGenomeView?{chr:"all",start:0,end:e.genome.getChromosome("all").bpLength}:void 0;let i,n;if(t.includes(":")&&(i=yF(t,e.isSoftclipped()),i&&(n=await e.genome.loadChromosome(i.chr))),!n){i=void 0;const r=await vF(e,t);r&&(i={chr:r.chr,start:r.start,end:r.end,name:(r.name||t).toUpperCase()}),i||(n=await e.genome.loadChromosome(t),n&&(i={chr:n.name}))}return i&&(n=n||await e.genome.loadChromosome(i.chr),i.chr=n.name,void 0===i.start&&void 0===i.end&&(i.start=0,i.end=n.bpLength)),i};for(let e of i){const t=await r(e);t&&n.push(t)}if(0===n.length){const e=await r(t.replaceAll(" ","+"));e&&n.push(e)}return 0===n.length?void 0:n}(this,e);if(i&&i.length>0){this.referenceFrameList=function(e,t,i,n,r,s){return e.map((e=>{const o=Object.assign({},e);if(i&&o.name&&(o.start=Math.max(0,o.start-i),o.end+=i),!s){const e=t.getChromosome(o.chr);Ws(e.bpLength,o,n)}return new QF(t,o.chr,o.start,o.end,(o.end-o.start)/r)}))}(i,this.genome,this.flanking,this.minimumBases(),this.calculateViewportWidth(i.length),this.isSoftclipped());for(let e of this.trackViews)e.removeViewportsFromColumnContainer();this.columnContainer.querySelectorAll(".igv-column-shim, .igv-column").forEach((e=>e.remove())),hv(this.columnContainer.querySelector(".igv-sample-info-column"),this.referenceFrameList.length),this.fireEvent("didchangecolumnlayout");for(let e of this.trackViews)e.createViewports(this,this.columnContainer,this.referenceFrameList);return this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),t||await this.updateViews(),!0}return!1}async loadSampleInfo(e){await this.sampleInfo.loadSampleInfoFile(e.url);for(const{sampleInfoViewport:e}of this.trackViews)e.setWidth(this.getSampleInfoColumnWidth());this.findTracks((e=>"function"==typeof e.getSamples)).length>0&&(this.sampleInfoControl.performClickWithState(this,!0),this.sampleInfoControl.setButtonVisibility(!0));for(const{sampleInfoViewport:e}of this.trackViews)e.repaint()}getSampleInfoColumnWidth(){if(this.sampleInfo.attributeCount){const e=this.findTracks((e=>"function"==typeof e.getSamples)).length>0,t=this.sampleInfo.hasAttributes(),i=this.sampleInfoControl.showSampleInfo;return e&&t&&i?this.sampleInfo.attributeCount*ad+8:0}return 0}on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)}un(e,t){this.off(e,t)}off(e,t){if(e)if(t){const i=this.eventHandlers[e];if(i&&0!==i.length){const n=i.indexOf(t);-1!==n&&this.eventHandlers[e].splice(n,1)}else console.warn("No handlers to remove for event: "+e)}else this.eventHandlers[e]=[];else this.eventHandlers={}}fireEvent(e,t,i){const n=this.eventHandlers[e];if(void 0===n||0===n.length)return;const r=i||window;return n.map((function(e){return e.apply(r,t)}))[0]}dispose(){this.removeEventHandlers();for(let e of this.trackViews)e.dispose();this.roiManager&&this.roiManager.dispose()}toJSON(){const e={version:"3.2.1"};if(void 0!==this.showSampleNames&&(e.showSampleNames=this.showSampleNames),this.sampleNameViewportWidth&&(e.sampleNameViewportWidth=this.sampleNameViewportWidth),e.reference=this.genome.toJSON(),e.reference.fastaURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.fastaURL.name}.`);if(e.reference.indexURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.indexURL.name}.`);const t=[];let i=this.trackViews[0];for(let{referenceFrame:e}of i.viewports){const i=e.getLocusString();t.push(i)}e.locus=1===t.length?t[0]:t;const n=this.roiManager.toJSON();n&&(e.roi=n,this.roiManager.showOverlays||(e.showROIOverlays=!1)),this.qtlSelections.isEmpty()||(e.qtlSelections=this.qtlSelections.toJSON());const r=[],s=[];for(const{track:e}of this.trackViews)try{let t;"function"==typeof e.getState?t=Pa.localFileInspection(e.getState()):e.config&&(t=Pa.localFileInspection(e.config)),t&&(t.browser&&delete t.browser,t.order=e.order,r.push(t))}catch(t){const i=`Track: ${e.name}: ${t}`;console.error(i),s.push(i)}if(s.length>0){let e=1,t="Errors encountered saving session: </br>";for(let i of s)t+=` (${e++}) ${i.toString()} <br/>`;throw Error(t)}e.tracks=r;const o=[];for(const e of r)for(const t of Object.keys(e))"file"!==t&&"indexFile"!==t||o.push(e[t]);const a=[];if(this.sampleInfo.sampleInfoFiles.length>0){const t=this.sampleInfo.toJSON();t.length>0&&(e.sampleinfo=t);for(const e of this.sampleInfo.sampleInfoFiles){const t=Pa.localFileInspection({url:e});t.file&&a.push(t.file)}a.length>0&&o.push(...a)}return o.length>0&&alert(`This session includes reference(s) to local file(s):\n${o.map((e=>` ${e}`)).join("\n")}\nLocal files cannot be loaded automatically when a saved session is restored.`),e}compressedSession(){return function(e){const t=new Uint8Array(e.length);for(var i=0;i<e.length;i++)t[i]=e.charCodeAt(i);const n=new $i(t),r=String.fromCharCode.apply(null,n);return btoa(r).replace(/\+/g,".").replace(/\//g,"_").replace(/=/g,"-")}(JSON.stringify(this.toJSON()))}sessionURL(){const e=window.location.href.slice(),t=e.indexOf("?");return(t>0?e.substring(0,t):e)+"?sessionURL=blob:"+this.compressedSession()}mouseDownOnViewport(e,t){var i;i=s(e),this.vpMouseDown={viewport:t,lastMouseX:i.x,mouseDownX:i.x,lastMouseY:i.y,mouseDownY:i.y,referenceFrame:t.referenceFrame}}cancelTrackPan(){const e=this.dragObject;this.dragObject=void 0,this.isScrolling=!1,this.vpMouseDown=void 0,e&&e.viewport.referenceFrame.start!==e.start&&(this.updateViews(),this.fireEvent("trackdragend",[e.viewport]))}isTrackPanning(){return this.dragObject}isSoftclipped(){return void 0!==this.trackViews.find((e=>!0===e.track.showSoftClips))}startTrackDrag(e){this.dragTrack=e}updateTrackDrag(e){if(e&&this.dragTrack){const t=this.dragTrack,i=this.trackViews.indexOf(e),n=this.trackViews.indexOf(t),r=this.trackViews;r[i]=t,r[n]=e;const s=this.trackViews[i].track.order;this.trackViews[n].track.order=s;const o=r.length;let a=s;if(i<n)for(let e=i+1;e<o;e++){const t=r[e].track;if(!(t.order<=a))break;t.order=Math.min(Number.MAX_SAFE_INTEGER,a+1),a=t.order}else for(let e=i-1;e>0;e--){const t=r[e].track;if(!(t.order>=a))break;t.order=Math.max(-Number.MAX_SAFE_INTEGER,a-1),a=t.order}this.reorderTracks()}}endTrackDrag(){this.dragTrack?(this.dragTrack=void 0,this.fireEvent("trackorderchanged",[this.getTrackOrder()])):this.dragTrack=void 0}addEventHandlers(){this.addWindowResizeHandler(),this.addRootMouseUpHandler(),this.addRootMouseLeaveHandler(),this.addColumnContainerEventHandlers(),this.addKeyboardHandler()}removeEventHandlers(){this.removeWindowResizeHandler(),this.removeRootMouseUpHandler(),this.removeRootMouseLeaveHandler(),this.removeColumnContainerEventHandlers(),this.removeKeyboardHandler()}addWindowResizeHandler(){this.boundWindowResizeHandler=Dv.bind(this),window.addEventListener("resize",this.boundWindowResizeHandler)}removeWindowResizeHandler(){window.removeEventListener("resize",this.boundWindowResizeHandler)}addRootMouseUpHandler(){this.boundRootMouseUpHandler=zv.bind(this),this.root.addEventListener("mouseup",this.boundRootMouseUpHandler)}removeRootMouseUpHandler(){this.root.removeEventListener("mouseup",this.boundRootMouseUpHandler)}addRootMouseLeaveHandler(){this.boundRootMouseLeaveHandler=zv.bind(this),this.root.addEventListener("mouseleave",this.boundRootMouseLeaveHandler)}removeRootMouseLeaveHandler(){this.root.removeEventListener("mouseleave",this.boundRootMouseLeaveHandler)}addColumnContainerEventHandlers(){this.boundColumnContainerMouseMoveHandler=Tv.bind(this),this.boundColumnContainerTouchMoveHandler=Tv.bind(this),this.boundColumnContainerMouseLeaveHandler=zv.bind(this),this.boundColumnContainerMouseUpHandler=zv.bind(this),this.boundColumnContainerTouchEndHandler=zv.bind(this),this.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.addEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.addEventListener("touchend",this.boundColumnContainerTouchEndHandler)}removeColumnContainerEventHandlers(){this.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.removeEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.removeEventListener("touchend",this.boundColumnContainerTouchEndHandler)}addKeyboardHandler(){this.keyUpHandler=Lv.bind(this),document.addEventListener("keyup",this.keyUpHandler)}removeKeyboardHandler(){console.log("Remove handler"),document.addEventListener("keyup",this.keyUpHandler)}static uncompressSession(e){let t;if(e.indexOf("/gzip;base64")>0){t=on(e);let i="";for(let e of t)i+=String.fromCharCode(e);return i}return function(e){e=e.replace(/\./g,"+").replace(/_/g,"/").replace(/-/g,"=");const t=atob(e),i=[];for(let e=0;e<t.length;e++)i.push(t.charCodeAt(e));const n=Yi(i);let r="";for(let e of n)r+=String.fromCharCode(e);return r}(e.substring(5))}createCircularView(e,t){var i;return t=!0===t,this.circularView=(i=this,new Vf(e,{onChordClick:(e,t,n)=>{const r=e.data,s=r.mate;function o(e){e.chr=i.genome.getChromosomeName(e.refName);let t=!1;for(let n of i.referenceFrameList){const i=Ff.fromLocusString(n.getLocusString());if(i.contains(e)){t=!0;break}if(i.overlaps(e)){n.extend(e),t=!0;break}}if(!t){const t=2e3,n=(e.start+e.end)/2;i.addMultiLocusPanel(e.chr,n-t,n+t)}}o(r),o(s)}})),this.circularViewControl=new uv(this.navbar.toggleButtonContainer,this),this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:$f(this.genome)}),this.circularViewVisible=t,this.circularView}get circularViewVisible(){return void 0!==this.circularView&&this.circularView.visible}set circularViewVisible(e){this.circularView&&(this.circularView.visible=e,this.circularViewControl.setState(e))}get sampleInfoControl(){return this.navbar.sampleInfoControl}get overlayTrackButton(){return this.navbar.overlayTrackButton}get roiTableControl(){return this.navbar.roiTableControl}get sampleInfoControl(){return this.navbar.sampleInfoControl}get sampleNameControl(){return this.navbar.sampleNameControl}}async function Dv(){if(!this.referenceFrameList)return;const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList){const i=this.referenceFrameList.indexOf(t),{chr:n,genome:r}=t,{bpLength:s}=r.getChromosome(t.chr),o=t.toBP(e);Mh.isWholeGenomeView(n)||o>s?t.bpPerPixel=s/e:t.end=t.start+t.toBP(e);for(let{viewports:t}of this.trackViews)t[i].setWidth(e)}this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}function Tv(e){e.preventDefault();const{x:t,y:i}=s(e);if(this.vpMouseDown){const{viewport:e,referenceFrame:n}=this.vpMouseDown,r=Math.abs(t-this.vpMouseDown.mouseDownX)>Math.abs(i-this.vpMouseDown.mouseDownY);if(!this.dragObject&&!this.isScrolling)if(r)this.vpMouseDown.mouseDownX&&Math.abs(t-this.vpMouseDown.mouseDownX)>this.constants.dragThreshold&&(this.dragObject={viewport:e,start:n.start});else if(this.vpMouseDown.mouseDownY&&Math.abs(i-this.vpMouseDown.mouseDownY)>this.constants.scrollThreshold){this.isScrolling=!0;const t=e.viewportElement.clientHeight,i=e.trackView.maxViewportContentHeight();this.vpMouseDown.r=t/i}if(this.dragObject){const i=!this.isSoftclipped();let r=this.vpMouseDown.lastMouseX-t;n.shiftPixels(r,e.viewportElement.clientWidth,i)&&this.updateViews(),this.fireEvent("trackdrag")}if(this.isScrolling){const t=this.vpMouseDown.r*(this.vpMouseDown.lastMouseY-i);e.trackView.moveScroller(t)}this.vpMouseDown.lastMouseX=t,this.vpMouseDown.lastMouseY=i}}function zv(e){this.cancelTrackPan(),this.endTrackDrag()}async function Lv(e){if(this.referenceFrameList&&!(this.referenceFrameList.length>1)&&("KeyF"===e.code||"KeyB"===e.code)){const t=this.getSelectedTrackViews();if(t.length>0){const i=t[0].track;if("function"==typeof i.nextFeatureAfter){const t=this.referenceFrameList[0],n=t.viewport?t.viewport.getWidth():this.calculateViewportWidth(this.referenceFrameList.length),r="all"===t.chr.toLowerCase(),s=i.visibilityWindow;if(r||s&&s>0&&t.bpPerPixel*n>s)return;const o="KeyF"===e.code,a=t.chr,c=t.center,l=await i.nextFeatureAfter(a,c,o);if(l){const i=await this.genome.getChromosomeName(l.chr);if(a===i){const i=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,r=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,i-r/2),t.end=i+r/2,t.bpPerPixel=(t.end-t.start)/n}else t.shift(i-c);this.updateViews()}else{t.chr=i;const r=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,i=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,r-i/2),t.end=t.start+i,t.bpPerPixel=(t.end-t.start)/n}else t.start=r-n*t.bpPerPixel/2,t.end=t.start+n*t.bpPerPixel;this.updateViews()}}}}}}function Hv(e,t){for(let{viewports:i}of e)for(let e of i)e.trackLabelElement&&(0===i.indexOf(e)&&!0===t?e.trackLabelElement.style.display="block":e.trackLabelElement.style.display="none")}let Pv=[];function Ov(e){return void 0===e.minimumBases&&(e.minimumBases=40),void 0===e.showIdeogram&&(e.showIdeogram=!0),null==e.showCytobandNames&&(e.showCytobandNames=!1),void 0===e.showCircularView&&(e.showCircularView=!1),void 0===e.showCircularViewButton&&(e.showCircularViewButton=!1),void 0===e.showTrackLabelButton&&(e.showTrackLabelButton=!0),void 0===e.showTrackLabels&&(e.showTrackLabels=!0),void 0===e.showCursorTrackingGuideButton&&(e.showCursorTrackingGuideButton=!0),void 0===e.showCursorGuide&&(e.showCursorGuide=e.showCursorTrackingGuide||!1),void 0===e.showCenterGuideButton&&(e.showCenterGuideButton=!0),void 0===e.showCenterGuide&&(e.showCenterGuide=!1),void 0===e.showSampleNames&&(e.showSampleNames=!1),void 0===e.showSVGButton&&(e.showSVGButton=!0),void 0===e.showControls&&(e.showControls=!0),void 0===e.showNavigation&&(e.showNavigation=!0),void 0===e.showRuler&&(e.showRuler=!0),void 0===e.flanking&&(e.flanking=1e3),void 0===e.pairsSupported&&(e.pairsSupported=!0),e.tracks||(e.tracks=[]),e}const Vv=Mn.setApiKey;const qv=Mn.oauth;var Qv={AlertDialog:Ps,TrackUtils:Qs,IGVGraphics:fr,MenuUtils:or,DataRangeDialog:ur,createTrack:async function(e,t){return await Bv.prototype.createTrack.call(t,e)},createBrowser:async function(e,t){void 0===t&&(t={}),Mh.KNOWN_GENOMES||await Mh.initializeGenomes(t),Ov(t),t.queryParametersSupported&&function(e){var t,i,n,r,s,o,a,c,l;let h,d,u;if(a=window.location.href,s={},t=a.indexOf("?"),i=a.lastIndexOf("#"),t>=0)for(i<0&&(i=a.length),n=t+1;n<i;)(r=a.indexOf("&",n))<0&&(r=i),2===(o=a.substring(n,r).split("=",2)).length?(c=o[0],l=decodeURIComponent(o[1]),"file"===c?h=l.split(","):"index"===c?d=l.split(","):"name"===c?u=l.split(","):"genome"===c?!l.startsWith("https://")&&!l.startsWith("http://")||l.endsWith(".json")?(e[c]=l,e.reference=void 0):e.reference={fastaURL:l,indexURL:l+".fai"}:("reference"===c&&(e.genome=void 0),e[c]=l),n=r+1):n++;if(h){e.tracks||(e.tracks=[]);for(let t=0;t<h.length;t++){if(h[t].endsWith(".xml")||h[t].endsWith(".json")){e.sessionURL=h[t];break}const i={url:h[t]};d&&d.length>t&&(i.indexURL=d[t]),u&&u.length>t&&(i.name=u[t]),e.tracks.push(i)}}}(t),t.apiKey&&Mn.setApiKey(t.apiKey),t.oauthToken&&Mn.setOauthToken(t.oauthToken),t.clientId&&!Cn()&&await async function(e){if(!google.accounts.oauth2.initTokenClient)throw new Error("Google accounts token client not loaded (https://accounts.google.com/gsi/client)");if(Cn())throw new Error("Google client is already initialized");const t={client_id:e.client_id||e.clientId,scope:e.scope||"https://www.googleapis.com/auth/userinfo.profile",state:e.state||"igv",error:e=>{throw new Error(e.type)},hint:e.hint,hosted_domain:e.hosted_domain},i=google.accounts.oauth2.initTokenClient(t);google.igv={tokenClient:i,apiKey:e.apiKey}}({client_id:t.clientId,apiKey:t.apiKey,scope:"https://www.googleapis.com/auth/userinfo.profile"});const i=new Bv(t,e);Pv.push(i);const n=t.sessionURL||t.session||t.hubURL;return n?await i.loadSession({url:n}):await i.loadSessionObject(t),i.navbar.navbarDidResize(),i},removeBrowser:function(e){e.dispose(),e.root.remove(),Pv=Pv.filter((t=>t!==e))},removeAllBrowsers:function(){for(let e of Pv)e.dispose(),e.root.remove();Pv=[]},visibilityChange:async function(){for(let e of Pv)await e.visibilityChange()},setGoogleOauthToken:function(e){return Mn.setOauthToken(e)},setOauthToken:function(e,t){return Mn.setOauthToken(e,t)},oauth:qv,version:UF,setApiKey:Vv,TrackBase:Pa,registerTrackClass:function(e,t){OF.set(e,((e,i)=>new t(e,i)))},registerTrackCreatorFunction:function(e,t){OF.set(e,t)},registerFileFormats:function(e,t){Ea[e]={fields:t}},loadSessionFile:Bv.loadSessionFile};export{Qv as default};
|
|
34
|
+
/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */(await this.value,await this.shape)}async getValue(e){const t=await this.dtype;return("string"==typeof t||t instanceof String)&&t.startsWith("S")?(await e).map((e=>{let t=e.indexOf("\0");return t>=0?e.substring(0,t):e})):e}};function _w(e){return e.replace(/\/(\/)+/g,"/")}async function xw(e){var t;e.url&&("function"==typeof(t=e.url).slice&&"function"==typeof t.arrayBuffer)&&(e.file=e.url,e.url=void 0);const i=void 0!==e.url;let n=e.reader?e.reader:function(e){if(e.url)return new vp(e);if(e.path)return new NodeLocalFile(e);if(e.file)return new Cp(e.file);throw Error("One of 'url', 'path (node only)', or 'file (browser only)' must be specified")}(e);const r=e.fetchSize||2e3,s=e.maxSize||2e5;i&&(n=new yp({file:n,fetchSize:r,maxSize:s}));const o=new kw(n),a=await async function(e){let t;if(e.indexReader)t=e.indexReader;else{if(e.index)return e.index;e.indexURL?t=new vp({url:e.indexURL}):e.indexPath?t=new NodeLocalFile({path:e.indexPath}):e.indexFile&&(t=new Cp({file:e.indexFile}))}if(t){const e=await t.read(),i=(new TextDecoder).decode(e);return JSON.parse(i)}return}(e),c=e.indexOffset,l=function(e){if(e.url)return Iw(e.url);if(e.path)return Iw(e.path);if(e.file)return e.file.name}(e),h=new Aw(o,l,{index:a,indexOffset:c});return await h.ready,h}class kw{constructor(e){this.fileReader=e}async slice(e,t){return this.fileReader.read(e,t-e)}}function Iw(e){const t=e.lastIndexOf("/");return t>0?e.substring(t+1):e}class Sw{constructor(e,t){this.chrom=e,this.signal_bin_size=t;this.signals={raw_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}`,gc_RD:`his_rd_p_${this.chrom}_${this.signal_bin_size}_GC`,gc_partition:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_merge`,baf:`snp_likelihood_${this.chrom}_${this.signal_bin_size}_mask`,baf_i1:`snp_i1_${this.chrom}_${this.signal_bin_size}_mask`,Mosaic_segments:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_segments_2d`,Mosaic_calls:`his_rd_p_${this.chrom}_${this.signal_bin_size}_partition_GC_mosaic_call_2d`}}}class Ew{constructor(e,t=1e5){this.h5_file=e,this.bin_size=t,this.h5_obj=void 0,this.pytorKeys=[],this.availableBins=[]}async fetch(){return this.h5_obj||(this.h5_obj=await xw({url:this.h5_file,fetchSize:1e6,maxSize:2e8})),this.h5_obj}async get_keys(){return(await this.fetch()).keys}async get_rd_signal(e=this.bin_size,t=void 0){const i=await this.fetch();this.pytorKeys=i.keys;const n=new Nw(this.pytorKeys);this.availableBins=n.getAllBins(),this.availableBins.includes(e)||(e=this.availableBins.at(-1));const r=await this.getChromosomes(t);let s=await this.rd_stat(e);const o=await this.getWigFeatures(r,e,s);return this.setCallers(o),{[e]:o}}async getWigFeatures(e,t,i){const n={RD_Raw:[],RD_Raw_gc_coor:[],ReadDepth:[],"2D":[],BAF1:[],BAF2:[]};for(const r of e){const e=new Sw(r,t);n.RD_Raw.push(...await this.get_chr_signal(r,t,e.signals.raw_RD,i)),n.RD_Raw_gc_coor.push(...await this.get_chr_signal(r,t,e.signals.gc_RD,i)),n.ReadDepth.push(...await this.get_chr_signal(r,t,e.signals.gc_partition,i)),n["2D"].push(...await this.rd_call_combined(r,t,i,e));const[s,o]=await this.getBafSignals(r,t,e.signals.baf_i1);n.BAF1.push(...s),n.BAF2.push(...o)}return n}async getChromosomes(e){const t=await this.h5_obj.get("rd_chromosomes"),i=await t.value;if(e){let t=new Set(e);return i.filter((e=>t.has(e)))}return i}setCallers(e){this.callers=[],e.ReadDepth.length&&this.callers.push("ReadDepth"),e["2D"].length&&this.callers.push("2D")}decode_segments(e){let t=[],i=[];for(let n of e)4294967295==n?(t.push(i),i=[]):i.push(n);return t}async rd_call_combined(e,t,i,n){let r,s=[],o=n.signals.Mosaic_segments;if(this.pytorKeys.includes(o)){const e=await this.h5_obj.get(o);let t=await e.value;r=this.decode_segments(t)}let a=n.signals.Mosaic_calls;if(this.pytorKeys.includes(a)){const n=await this.h5_obj.get(a);let o=await n.to_array();r.forEach(((n,r)=>{n.forEach(((n,a)=>{s.push({chr:e,start:n*t,end:(n+1)*t,value:o[0][r]/i[4]*2})}))}))}return s}async rd_stat(e){let t,i=`rd_stat_${e}_auto`;if(this.pytorKeys.includes(i)){const e=await this.h5_obj.get(i);t=await e.value}return t}async get_chr_signal(e,t,i,n){let r=[];if(this.pytorKeys.includes(i)){const s=await this.h5_obj.get(i);(await s.value).forEach(((i,s)=>{r.push({chr:e,start:s*t,end:(s+1)*t,value:i/n[4]*2})}))}return r}async getBafSignals(e,t,i,n=-1){const r=[],s=[];if(this.pytorKeys.includes(i)){const o=await this.h5_obj.get(i);(await o.to_array()).forEach(((i,o)=>{isNaN(i)||(r.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5-i)}),.5!==i&&s.push({chr:e,start:o*t,end:(o+1)*t,value:n*(.5+i)}))}))}return[r,s]}}class Nw{constructor(e){this.signals=e}getAllBins(){const e=this.getRdBins(),t=this.getSnpBins();return[...new Set([...e,...t])].sort(((e,t)=>e-t))}getRdBins(){return this.extractBins(/^his_rd_p_(.*)_(\d+)$/)}getSnpBins(){return this.extractBins(/^snp_likelihood_(.*)_(\d+)_mask$/)}extractBins(e){return[...new Set(this.signals.map((t=>t.match(e))).filter((e=>null!==e)).map((e=>Number(e[2]))))]}}function Mw(e){if(e.length<4)return e;let t,i,n,r,s,o;return t=e.slice().sort(((e,t)=>e-t)),t.length/4%1==0?(i=.5*(t[t.length/4]+t[t.length/4+1]),n=.5*(t[t.length*(3/4)]+t[t.length*(3/4)+1])):(i=t[Math.floor(t.length/4+1)],n=t[Math.ceil(t.length*(3/4)+1)]),r=n-i,s=n+1.5*r,o=i-1.5*r,t.filter((e=>e>=o&&e<=s))}function Rw(e){let t=Mw(e);const i=t.length,n=t.reduce(((e,t)=>e+t))/i,r=Math.sqrt(t.map((e=>Math.pow(e-n,2))).reduce(((e,t)=>e+t))/i);return[n,r]}var Bw={range_function:function(e,t,i){return Array(Math.ceil((t-e)/i)).fill(e).map(((e,t)=>e+t*i))},getDistParams:Rw,linspace:function(e,t,i){if(void 0===i&&(i=Math.max(Math.round(t-e)+1,1)),i<2)return 1===i?[e]:[];var n=Array(i);for(let r=--i;r>=0;r--)n[r]=(r*t+(i-r)*e)/i;return n},GetFit:class{constructor(e){this.allBins=e}getValues(){return Object.values(this.allBins).reduce(((e,t)=>e.concat(t.filter((e=>e.binScore>0)).map((e=>e.binScore)))),[])}getMean(e){return e.reduce((function(e,t){return e+t}))/e.length}fit_data(){return Rw(this.getValues())}histogram(e,t){const i=t[1]-t[0],n=[];e.forEach(((e,r)=>{t.forEach(((t,r)=>{if(n[t]||(n[t]={count:0}),t<=e&&e<t+i)return n[t].count++,!1}))}));const r=[];return n.forEach(((e,t)=>{r.push(e.count)})),r}},filterOutliers:Mw};function Dw(e,t){return isNaN(e)||isNaN(t)||t<=0?NaN:0===e?.5:.5+.5*(Tw(.5*t,.5,1)-Tw(.5*t,.5,t/(t+e*e)))*Math.sign(e)}function Tw(e,t,i){if(0==i)return 0;if(1==i)return 1;{let n=Pw(e+t)-Pw(e)-Pw(t)+e*Math.log(i)+t*Math.log(1-i);return i<(e+1)/(e+t+2)?Math.exp(n)*zw(e,t,i)/e:1-Math.exp(n)*zw(t,e,1-i)/t}}function zw(e,t,i,n=1e3){let r=1,s=1,o=1,a=e+t,c=e+1,l=e-1,h=1-a*i/c;for(let d=0;d<=n;d++){let n=parseFloat(d+1),u=n+n,f=n*(t-n)*i/((l+u)*(e+u)),p=r+f*s,g=h+f*o;f=-(e+n)*(a+n)*i/((c+u)*(e+u));let m=g+f*h,w=r;if(s=p/m,o=g/m,r=(p+f*r)/m,h=1,Math.abs(r-w)<3e-7*Math.abs(r))return r}}function Lw(e){if(0==e||1==e)return 1;return e*Lw(e-1)}function Hw(e){let t;var i=[75122.633153,80916.6278952,36308.2951477,8687.24529705,1168.92649479,83.8676043424,2.50662827511],n=0,r=1;if(0==e)t=1e99;else if(e%1==0)t=Lw(e-1);else{for(let t=0;t<i.length;t++)n+=i[t]*Math.pow(e,t),r*=e+t;t=n*Math.pow(e+5.5,e+.5)*Math.exp(-(e+5.5))/r}return t}function Pw(e){return Math.log(Hw(e))}var Ow={TdistributionCDF:Dw,gamma:Hw,t_test_1_sample:function(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-Dw(Math.abs(r),n-1)},t_test_2_samples:function(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-Dw(Math.abs(o),parseInt(a+.5))}};const Vw=Object.prototype.toString;function qw(e){return Vw.call(e).endsWith("Array]")}function Qw(e,t,i,n){let r=0;const s=i(t);for(let t=0;t<e.x.length;t++)r+=Math.pow(e.y[t]-s(e.x[t]),2)/n[t];return r}function Uw(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})})),t}var jw={};const Gw=Object.prototype.toString;var Ww=Uw(Object.freeze({__proto__:null,isAnyArray:function(e){const t=Gw.call(e);return t.endsWith("Array]")&&!t.includes("Big")}}));const $w=Object.prototype.toString;function Kw(e){const t=$w.call(e);return t.endsWith("Array]")&&!t.includes("Big")}const Yw=Object.prototype.toString;function Xw(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function(e){const t=Yw.call(e);return t.endsWith("Array]")&&!t.includes("Big")}(e))throw new TypeError("input must be an array");if(0===e.length)throw new TypeError("input must not be empty");var i=t.fromIndex,n=void 0===i?0:i,r=t.toIndex,s=void 0===r?e.length:r;if(n<0||n>=e.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(s<=n||s>e.length||!Number.isInteger(s))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=e[n],a=n+1;a<s;a++)e[a]>o&&(o=e[a]);return o}const Zw=Object.prototype.toString;function Jw(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function(e){const t=Zw.call(e);return t.endsWith("Array]")&&!t.includes("Big")}(e))throw new TypeError("input must be an array");if(0===e.length)throw new TypeError("input must not be empty");var i=t.fromIndex,n=void 0===i?0:i,r=t.toIndex,s=void 0===r?e.length:r;if(n<0||n>=e.length||!Number.isInteger(n))throw new Error("fromIndex must be a positive integer smaller than length");if(s<=n||s>e.length||!Number.isInteger(s))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var o=e[n],a=n+1;a<s;a++)e[a]<o&&(o=e[a]);return o}var eb=Object.freeze({__proto__:null,default:function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Kw(e))throw new TypeError("input must be an array");if(0===e.length)throw new TypeError("input must not be empty");if(void 0!==i.output){if(!Kw(i.output))throw new TypeError("output option must be an array if specified");t=i.output}else t=new Array(e.length);var n=Jw(e),r=Xw(e);if(n===r)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var s=i.min,o=void 0===s?i.autoMinMax?n:0:s,a=i.max,c=void 0===a?i.autoMinMax?r:1:a;if(o>=c)throw new RangeError("min option must be smaller than max option");for(var l=(c-o)/(r-n),h=0;h<e.length;h++)t[h]=(e[h]-n)*l+o;return t}}),tb=Uw(eb);Object.defineProperty(jw,"__esModule",{value:!0});var ib=Ww,nb=tb;const rb=" ".repeat(2),sb=" ".repeat(4);function ob(e,t={}){const{maxRows:i=15,maxColumns:n=10,maxNumSize:r=8,padMinus:s="auto"}=t;return`${e.constructor.name} {\n${rb}[\n${sb}${function(e,t,i,n,r){const{rows:s,columns:o}=e,a=Math.min(s,t),c=Math.min(o,i),l=[];if("auto"===r){r=!1;e:for(let t=0;t<a;t++)for(let i=0;i<c;i++)if(e.get(t,i)<0){r=!0;break e}}for(let t=0;t<a;t++){let i=[];for(let s=0;s<c;s++)i.push(ab(e.get(t,s),n,r));l.push(`${i.join(" ")}`)}c!==o&&(l[l.length-1]+=` ... ${o-i} more columns`);a!==s&&l.push(`... ${s-t} more rows`);return l.join(`\n${sb}`)}(e,i,n,r,s)}\n${rb}]\n${rb}rows: ${e.rows}\n${rb}columns: ${e.columns}\n}`}function ab(e,t,i){return(e>=0&&i?` ${cb(e,t-1)}`:cb(e,t)).padEnd(t)}function cb(e,t){let i=e.toString();if(i.length<=t)return i;let n=e.toFixed(t);if(n.length>t&&(n=e.toFixed(Math.max(0,t-(n.length-t)))),n.length<=t&&!n.startsWith("0.000")&&!n.startsWith("-0.000"))return n;let r=e.toExponential(t);return r.length>t&&(r=e.toExponential(Math.max(0,t-(r.length-t)))),r.slice(0)}function lb(e,t,i){let n=i?e.rows:e.rows-1;if(t<0||t>n)throw new RangeError("Row index out of range")}function hb(e,t,i){let n=i?e.columns:e.columns-1;if(t<0||t>n)throw new RangeError("Column index out of range")}function db(e,t){if(t.to1DArray&&(t=t.to1DArray()),t.length!==e.columns)throw new RangeError("vector size must be the same as the number of columns");return t}function ub(e,t){if(t.to1DArray&&(t=t.to1DArray()),t.length!==e.rows)throw new RangeError("vector size must be the same as the number of rows");return t}function fb(e,t){if(!ib.isAnyArray(t))throw new TypeError("row indices must be an array");for(let i=0;i<t.length;i++)if(t[i]<0||t[i]>=e.rows)throw new RangeError("row indices are out of range")}function pb(e,t){if(!ib.isAnyArray(t))throw new TypeError("column indices must be an array");for(let i=0;i<t.length;i++)if(t[i]<0||t[i]>=e.columns)throw new RangeError("column indices are out of range")}function gb(e,t,i,n,r){if(5!==arguments.length)throw new RangeError("expected 4 arguments");if(wb("startRow",t),wb("endRow",i),wb("startColumn",n),wb("endColumn",r),t>i||n>r||t<0||t>=e.rows||i<0||i>=e.rows||n<0||n>=e.columns||r<0||r>=e.columns)throw new RangeError("Submatrix indices are out of range")}function mb(e,t=0){let i=[];for(let n=0;n<e;n++)i.push(t);return i}function wb(e,t){if("number"!=typeof t)throw new TypeError(`${e} must be a number`)}function bb(e){if(e.isEmpty())throw new Error("Empty matrix has no elements to index")}class Fb{static from1DArray(e,t,i){if(e*t!==i.length)throw new RangeError("data length does not match given dimensions");let n=new yb(e,t);for(let r=0;r<e;r++)for(let e=0;e<t;e++)n.set(r,e,i[r*t+e]);return n}static rowVector(e){let t=new yb(1,e.length);for(let i=0;i<e.length;i++)t.set(0,i,e[i]);return t}static columnVector(e){let t=new yb(e.length,1);for(let i=0;i<e.length;i++)t.set(i,0,e[i]);return t}static zeros(e,t){return new yb(e,t)}static ones(e,t){return new yb(e,t).fill(1)}static rand(e,t,i={}){if("object"!=typeof i)throw new TypeError("options must be an object");const{random:n=Math.random}=i;let r=new yb(e,t);for(let i=0;i<e;i++)for(let e=0;e<t;e++)r.set(i,e,n());return r}static randInt(e,t,i={}){if("object"!=typeof i)throw new TypeError("options must be an object");const{min:n=0,max:r=1e3,random:s=Math.random}=i;if(!Number.isInteger(n))throw new TypeError("min must be an integer");if(!Number.isInteger(r))throw new TypeError("max must be an integer");if(n>=r)throw new RangeError("min must be smaller than max");let o=r-n,a=new yb(e,t);for(let i=0;i<e;i++)for(let e=0;e<t;e++){let t=n+Math.round(s()*o);a.set(i,e,t)}return a}static eye(e,t,i){void 0===t&&(t=e),void 0===i&&(i=1);let n=Math.min(e,t),r=this.zeros(e,t);for(let e=0;e<n;e++)r.set(e,e,i);return r}static diag(e,t,i){let n=e.length;void 0===t&&(t=n),void 0===i&&(i=t);let r=Math.min(n,t,i),s=this.zeros(t,i);for(let t=0;t<r;t++)s.set(t,t,e[t]);return s}static min(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let i=e.rows,n=e.columns,r=new yb(i,n);for(let s=0;s<i;s++)for(let i=0;i<n;i++)r.set(s,i,Math.min(e.get(s,i),t.get(s,i)));return r}static max(e,t){e=this.checkMatrix(e),t=this.checkMatrix(t);let i=e.rows,n=e.columns,r=new this(i,n);for(let s=0;s<i;s++)for(let i=0;i<n;i++)r.set(s,i,Math.max(e.get(s,i),t.get(s,i)));return r}static checkMatrix(e){return Fb.isMatrix(e)?e:new yb(e)}static isMatrix(e){return null!=e&&"Matrix"===e.klass}get size(){return this.rows*this.columns}apply(e){if("function"!=typeof e)throw new TypeError("callback must be a function");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e.call(this,t,i);return this}to1DArray(){let e=[];for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e.push(this.get(t,i));return e}to2DArray(){let e=[];for(let t=0;t<this.rows;t++){e.push([]);for(let i=0;i<this.columns;i++)e[t].push(this.get(t,i))}return e}toJSON(){return this.to2DArray()}isRowVector(){return 1===this.rows}isColumnVector(){return 1===this.columns}isVector(){return 1===this.rows||1===this.columns}isSquare(){return this.rows===this.columns}isEmpty(){return 0===this.rows||0===this.columns}isSymmetric(){if(this.isSquare()){for(let e=0;e<this.rows;e++)for(let t=0;t<=e;t++)if(this.get(e,t)!==this.get(t,e))return!1;return!0}return!1}isDistance(){if(!this.isSymmetric())return!1;for(let e=0;e<this.rows;e++)if(0!==this.get(e,e))return!1;return!0}isEchelonForm(){let e=0,t=0,i=-1,n=!0,r=!1;for(;e<this.rows&&n;){for(t=0,r=!1;t<this.columns&&!1===r;)0===this.get(e,t)?t++:1===this.get(e,t)&&t>i?(r=!0,i=t):(n=!1,r=!0);e++}return n}isReducedEchelonForm(){let e=0,t=0,i=-1,n=!0,r=!1;for(;e<this.rows&&n;){for(t=0,r=!1;t<this.columns&&!1===r;)0===this.get(e,t)?t++:1===this.get(e,t)&&t>i?(r=!0,i=t):(n=!1,r=!0);for(let i=t+1;i<this.rows;i++)0!==this.get(e,i)&&(n=!1);e++}return n}echelonForm(){let e=this.clone(),t=0,i=0;for(;t<e.rows&&i<e.columns;){let n=t;for(let r=t;r<e.rows;r++)e.get(r,i)>e.get(n,i)&&(n=r);if(0===e.get(n,i))i++;else{e.swapRows(t,n);let r=e.get(t,i);for(let n=i;n<e.columns;n++)e.set(t,n,e.get(t,n)/r);for(let n=t+1;n<e.rows;n++){let r=e.get(n,i)/e.get(t,i);e.set(n,i,0);for(let s=i+1;s<e.columns;s++)e.set(n,s,e.get(n,s)-e.get(t,s)*r)}t++,i++}}return e}reducedEchelonForm(){let e=this.echelonForm(),t=e.columns,i=e.rows,n=i-1;for(;n>=0;)if(0===e.maxRow(n))n--;else{let r=0,s=!1;for(;r<i&&!1===s;)1===e.get(n,r)?s=!0:r++;for(let i=0;i<n;i++){let s=e.get(i,r);for(let o=r;o<t;o++){let t=e.get(i,o)-s*e.get(n,o);e.set(i,o,t)}}n--}return e}set(){throw new Error("set method is unimplemented")}get(){throw new Error("get method is unimplemented")}repeat(e={}){if("object"!=typeof e)throw new TypeError("options must be an object");const{rows:t=1,columns:i=1}=e;if(!Number.isInteger(t)||t<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(i)||i<=0)throw new TypeError("columns must be a positive integer");let n=new yb(this.rows*t,this.columns*i);for(let e=0;e<t;e++)for(let t=0;t<i;t++)n.setSubMatrix(this,this.rows*e,this.columns*t);return n}fill(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,e);return this}neg(){return this.mulS(-1)}getRow(e){lb(this,e);let t=[];for(let i=0;i<this.columns;i++)t.push(this.get(e,i));return t}getRowVector(e){return yb.rowVector(this.getRow(e))}setRow(e,t){lb(this,e),t=db(this,t);for(let i=0;i<this.columns;i++)this.set(e,i,t[i]);return this}swapRows(e,t){lb(this,e),lb(this,t);for(let i=0;i<this.columns;i++){let n=this.get(e,i);this.set(e,i,this.get(t,i)),this.set(t,i,n)}return this}getColumn(e){hb(this,e);let t=[];for(let i=0;i<this.rows;i++)t.push(this.get(i,e));return t}getColumnVector(e){return yb.columnVector(this.getColumn(e))}setColumn(e,t){hb(this,e),t=ub(this,t);for(let i=0;i<this.rows;i++)this.set(i,e,t[i]);return this}swapColumns(e,t){hb(this,e),hb(this,t);for(let i=0;i<this.rows;i++){let n=this.get(i,e);this.set(i,e,this.get(i,t)),this.set(i,t,n)}return this}addRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e[i]);return this}subRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e[i]);return this}mulRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e[i]);return this}divRowVector(e){e=db(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e[i]);return this}addColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e[t]);return this}subColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e[t]);return this}mulColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e[t]);return this}divColumnVector(e){e=ub(this,e);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e[t]);return this}mulRow(e,t){lb(this,e);for(let i=0;i<this.columns;i++)this.set(e,i,this.get(e,i)*t);return this}mulColumn(e,t){hb(this,e);for(let i=0;i<this.rows;i++)this.set(i,e,this.get(i,e)*t);return this}max(e){if(this.isEmpty())return NaN;switch(e){case"row":{const e=new Array(this.rows).fill(Number.NEGATIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)>e[t]&&(e[t]=this.get(t,i));return e}case"column":{const e=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)>e[i]&&(e[i]=this.get(t,i));return e}case void 0:{let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)>e&&(e=this.get(t,i));return e}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){bb(this);let e=this.get(0,0),t=[0,0];for(let i=0;i<this.rows;i++)for(let n=0;n<this.columns;n++)this.get(i,n)>e&&(e=this.get(i,n),t[0]=i,t[1]=n);return t}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const e=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)<e[t]&&(e[t]=this.get(t,i));return e}case"column":{const e=new Array(this.columns).fill(Number.POSITIVE_INFINITY);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)<e[i]&&(e[i]=this.get(t,i));return e}case void 0:{let e=this.get(0,0);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.get(t,i)<e&&(e=this.get(t,i));return e}default:throw new Error(`invalid option: ${e}`)}}minIndex(){bb(this);let e=this.get(0,0),t=[0,0];for(let i=0;i<this.rows;i++)for(let n=0;n<this.columns;n++)this.get(i,n)<e&&(e=this.get(i,n),t[0]=i,t[1]=n);return t}maxRow(e){if(lb(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let i=1;i<this.columns;i++)this.get(e,i)>t&&(t=this.get(e,i));return t}maxRowIndex(e){lb(this,e),bb(this);let t=this.get(e,0),i=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)>t&&(t=this.get(e,n),i[1]=n);return i}minRow(e){if(lb(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let i=1;i<this.columns;i++)this.get(e,i)<t&&(t=this.get(e,i));return t}minRowIndex(e){lb(this,e),bb(this);let t=this.get(e,0),i=[e,0];for(let n=1;n<this.columns;n++)this.get(e,n)<t&&(t=this.get(e,n),i[1]=n);return i}maxColumn(e){if(hb(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let i=1;i<this.rows;i++)this.get(i,e)>t&&(t=this.get(i,e));return t}maxColumnIndex(e){hb(this,e),bb(this);let t=this.get(0,e),i=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)>t&&(t=this.get(n,e),i[0]=n);return i}minColumn(e){if(hb(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let i=1;i<this.rows;i++)this.get(i,e)<t&&(t=this.get(i,e));return t}minColumnIndex(e){hb(this,e),bb(this);let t=this.get(0,e),i=[0,e];for(let n=1;n<this.rows;n++)this.get(n,e)<t&&(t=this.get(n,e),i[0]=n);return i}diag(){let e=Math.min(this.rows,this.columns),t=[];for(let i=0;i<e;i++)t.push(this.get(i,i));return t}norm(e="frobenius"){switch(e){case"max":return this.max();case"frobenius":return Math.sqrt(this.dot(this));default:throw new RangeError(`unknown norm type: ${e}`)}}cumulativeSum(){let e=0;for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e+=this.get(t,i),this.set(t,i,e);return this}dot(e){Fb.isMatrix(e)&&(e=e.to1DArray());let t=this.to1DArray();if(t.length!==e.length)throw new RangeError("vectors do not have the same size");let i=0;for(let n=0;n<t.length;n++)i+=t[n]*e[n];return i}mmul(e){e=yb.checkMatrix(e);let t=this.rows,i=this.columns,n=e.columns,r=new yb(t,n),s=new Float64Array(i);for(let o=0;o<n;o++){for(let t=0;t<i;t++)s[t]=e.get(t,o);for(let e=0;e<t;e++){let t=0;for(let n=0;n<i;n++)t+=this.get(e,n)*s[n];r.set(e,o,t)}}return r}mpow(e){if(!this.isSquare())throw new RangeError("Matrix must be square");if(!Number.isInteger(e)||e<0)throw new RangeError("Exponent must be a non-negative integer");let t=yb.eye(this.rows),i=this;for(let n=e;n>1;n/=2)1&n&&(t=t.mmul(i)),i=i.mmul(i);return t}strassen2x2(e){e=yb.checkMatrix(e);let t=new yb(2,2);const i=this.get(0,0),n=e.get(0,0),r=this.get(0,1),s=e.get(0,1),o=this.get(1,0),a=e.get(1,0),c=this.get(1,1),l=e.get(1,1),h=(i+c)*(n+l),d=(o+c)*n,u=i*(s-l),f=c*(a-n),p=(i+r)*l,g=h+f-p+(r-c)*(a+l),m=u+p,w=d+f,b=h-d+u+(o-i)*(n+s);return t.set(0,0,g),t.set(0,1,m),t.set(1,0,w),t.set(1,1,b),t}strassen3x3(e){e=yb.checkMatrix(e);let t=new yb(3,3);const i=this.get(0,0),n=this.get(0,1),r=this.get(0,2),s=this.get(1,0),o=this.get(1,1),a=this.get(1,2),c=this.get(2,0),l=this.get(2,1),h=this.get(2,2),d=e.get(0,0),u=e.get(0,1),f=e.get(0,2),p=e.get(1,0),g=e.get(1,1),m=e.get(1,2),w=e.get(2,0),b=e.get(2,1),F=e.get(2,2),v=(i-s)*(-u+g),y=(-i+s+o)*(d-u+g),A=(s+o)*(-d+u),C=i*d,_=(-i+c+l)*(d-f+m),x=(-i+c)*(f-m),k=(c+l)*(-d+f),I=(-r+l+h)*(g+w-b),S=(r-h)*(g-b),E=r*w,N=(l+h)*(-w+b),M=(-r+o+a)*(m+w-F),R=(r-a)*(m-F),B=(o+a)*(-w+F),D=C+E+n*p,T=(i+n+r-s-o-l-h)*g+y+A+C+I+E+N,z=C+_+k+(i+n+r-o-a-c-l)*m+E+M+B,L=v+o*(-d+u+p-g-m-w+F)+y+C+E+M+R,H=v+y+A+C+a*b,P=E+M+R+B+s*f,O=C+_+x+l*(-d+f+p-g-m-w+b)+I+S+E,V=I+S+E+N+c*u,q=C+_+x+k+h*F;return t.set(0,0,D),t.set(0,1,T),t.set(0,2,z),t.set(1,0,L),t.set(1,1,H),t.set(1,2,P),t.set(2,0,O),t.set(2,1,V),t.set(2,2,q),t}mmulStrassen(e){e=yb.checkMatrix(e);let t=this.clone(),i=t.rows,n=t.columns,r=e.rows,s=e.columns;function o(e,t,i){let n=e.rows,r=e.columns;if(n===t&&r===i)return e;{let n=Fb.zeros(t,i);return n=n.setSubMatrix(e,0,0),n}}n!==r&&console.warn(`Multiplying ${i} x ${n} and ${r} x ${s} matrix: dimensions do not match.`);let a=Math.max(i,r),c=Math.max(n,s);return t=o(t,a,c),function e(t,i,n,r){if(n<=512||r<=512)return t.mmul(i);n%2==1&&r%2==1?(t=o(t,n+1,r+1),i=o(i,n+1,r+1)):n%2==1?(t=o(t,n+1,r),i=o(i,n+1,r)):r%2==1&&(t=o(t,n,r+1),i=o(i,n,r+1));let s=parseInt(t.rows/2,10),a=parseInt(t.columns/2,10),c=t.subMatrix(0,s-1,0,a-1),l=i.subMatrix(0,s-1,0,a-1),h=t.subMatrix(0,s-1,a,t.columns-1),d=i.subMatrix(0,s-1,a,i.columns-1),u=t.subMatrix(s,t.rows-1,0,a-1),f=i.subMatrix(s,i.rows-1,0,a-1),p=t.subMatrix(s,t.rows-1,a,t.columns-1),g=i.subMatrix(s,i.rows-1,a,i.columns-1),m=e(Fb.add(c,p),Fb.add(l,g),s,a),w=e(Fb.add(u,p),l,s,a),b=e(c,Fb.sub(d,g),s,a),F=e(p,Fb.sub(f,l),s,a),v=e(Fb.add(c,h),g,s,a),y=e(Fb.sub(u,c),Fb.add(l,d),s,a),A=e(Fb.sub(h,p),Fb.add(f,g),s,a),C=Fb.add(m,F);C.sub(v),C.add(A);let _=Fb.add(b,v),x=Fb.add(w,F),k=Fb.sub(m,w);k.add(b),k.add(y);let I=Fb.zeros(2*C.rows,2*C.columns);return I=I.setSubMatrix(C,0,0),I=I.setSubMatrix(_,C.rows,0),I=I.setSubMatrix(x,0,C.columns),I=I.setSubMatrix(k,C.rows,C.columns),I.subMatrix(0,n-1,0,r-1)}(t,e=o(e,a,c),a,c)}scaleRows(e={}){if("object"!=typeof e)throw new TypeError("options must be an object");const{min:t=0,max:i=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(t>=i)throw new RangeError("min must be smaller than max");let n=new yb(this.rows,this.columns);for(let e=0;e<this.rows;e++){const r=this.getRow(e);r.length>0&&nb(r,{min:t,max:i,output:r}),n.setRow(e,r)}return n}scaleColumns(e={}){if("object"!=typeof e)throw new TypeError("options must be an object");const{min:t=0,max:i=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(t>=i)throw new RangeError("min must be smaller than max");let n=new yb(this.rows,this.columns);for(let e=0;e<this.columns;e++){const r=this.getColumn(e);r.length&&nb(r,{min:t,max:i,output:r}),n.setColumn(e,r)}return n}flipRows(){const e=Math.ceil(this.columns/2);for(let t=0;t<this.rows;t++)for(let i=0;i<e;i++){let e=this.get(t,i),n=this.get(t,this.columns-1-i);this.set(t,i,n),this.set(t,this.columns-1-i,e)}return this}flipColumns(){const e=Math.ceil(this.rows/2);for(let t=0;t<this.columns;t++)for(let i=0;i<e;i++){let e=this.get(i,t),n=this.get(this.rows-1-i,t);this.set(i,t,n),this.set(this.rows-1-i,t,e)}return this}kroneckerProduct(e){e=yb.checkMatrix(e);let t=this.rows,i=this.columns,n=e.rows,r=e.columns,s=new yb(t*n,i*r);for(let o=0;o<t;o++)for(let t=0;t<i;t++)for(let i=0;i<n;i++)for(let a=0;a<r;a++)s.set(n*o+i,r*t+a,this.get(o,t)*e.get(i,a));return s}kroneckerSum(e){if(e=yb.checkMatrix(e),!this.isSquare()||!e.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");let t=this.rows,i=e.rows,n=this.kroneckerProduct(yb.eye(i,i)),r=yb.eye(t,t).kroneckerProduct(e);return n.add(r)}transpose(){let e=new yb(this.columns,this.rows);for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)e.set(i,t,this.get(t,i));return e}sortRows(e=vb){for(let t=0;t<this.rows;t++)this.setRow(t,this.getRow(t).sort(e));return this}sortColumns(e=vb){for(let t=0;t<this.columns;t++)this.setColumn(t,this.getColumn(t).sort(e));return this}subMatrix(e,t,i,n){gb(this,e,t,i,n);let r=new yb(t-e+1,n-i+1);for(let s=e;s<=t;s++)for(let t=i;t<=n;t++)r.set(s-e,t-i,this.get(s,t));return r}subMatrixRow(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=this.columns-1),t>i||t<0||t>=this.columns||i<0||i>=this.columns)throw new RangeError("Argument out of range");let n=new yb(e.length,i-t+1);for(let r=0;r<e.length;r++)for(let s=t;s<=i;s++){if(e[r]<0||e[r]>=this.rows)throw new RangeError(`Row index out of range: ${e[r]}`);n.set(r,s-t,this.get(e[r],s))}return n}subMatrixColumn(e,t,i){if(void 0===t&&(t=0),void 0===i&&(i=this.rows-1),t>i||t<0||t>=this.rows||i<0||i>=this.rows)throw new RangeError("Argument out of range");let n=new yb(i-t+1,e.length);for(let r=0;r<e.length;r++)for(let s=t;s<=i;s++){if(e[r]<0||e[r]>=this.columns)throw new RangeError(`Column index out of range: ${e[r]}`);n.set(s-t,r,this.get(s,e[r]))}return n}setSubMatrix(e,t,i){if((e=yb.checkMatrix(e)).isEmpty())return this;gb(this,t,t+e.rows-1,i,i+e.columns-1);for(let n=0;n<e.rows;n++)for(let r=0;r<e.columns;r++)this.set(t+n,i+r,e.get(n,r));return this}selection(e,t){fb(this,e),pb(this,t);let i=new yb(e.length,t.length);for(let n=0;n<e.length;n++){let r=e[n];for(let e=0;e<t.length;e++){let s=t[e];i.set(n,e,this.get(r,s))}}return i}trace(){let e=Math.min(this.rows,this.columns),t=0;for(let i=0;i<e;i++)t+=this.get(i,i);return t}clone(){return this.constructor.copy(this,new yb(this.rows,this.columns))}static copy(e,t){for(const[i,n,r]of e.entries())t.set(i,n,r);return t}sum(e){switch(e){case"row":return function(e){let t=mb(e.rows);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[i]+=e.get(i,n);return t}(this);case"column":return function(e){let t=mb(e.columns);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[n]+=e.get(i,n);return t}(this);case void 0:return function(e){let t=0;for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)t+=e.get(i,n);return t}(this);default:throw new Error(`invalid option: ${e}`)}}product(e){switch(e){case"row":return function(e){let t=mb(e.rows,1);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[i]*=e.get(i,n);return t}(this);case"column":return function(e){let t=mb(e.columns,1);for(let i=0;i<e.rows;++i)for(let n=0;n<e.columns;++n)t[n]*=e.get(i,n);return t}(this);case void 0:return function(e){let t=1;for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)t*=e.get(i,n);return t}(this);default:throw new Error(`invalid option: ${e}`)}}mean(e){const t=this.sum(e);switch(e){case"row":for(let e=0;e<this.rows;e++)t[e]/=this.columns;return t;case"column":for(let e=0;e<this.columns;e++)t[e]/=this.rows;return t;case void 0:return t/this.size;default:throw new Error(`invalid option: ${e}`)}}variance(e,t={}){if("object"==typeof e&&(t=e,e=void 0),"object"!=typeof t)throw new TypeError("options must be an object");const{unbiased:i=!0,mean:n=this.mean(e)}=t;if("boolean"!=typeof i)throw new TypeError("unbiased must be a boolean");switch(e){case"row":if(!ib.isAnyArray(n))throw new TypeError("mean must be an array");return function(e,t,i){const n=e.rows,r=e.columns,s=[];for(let o=0;o<n;o++){let n=0,a=0,c=0;for(let t=0;t<r;t++)c=e.get(o,t)-i[o],n+=c,a+=c*c;t?s.push((a-n*n/r)/(r-1)):s.push((a-n*n/r)/r)}return s}(this,i,n);case"column":if(!ib.isAnyArray(n))throw new TypeError("mean must be an array");return function(e,t,i){const n=e.rows,r=e.columns,s=[];for(let o=0;o<r;o++){let r=0,a=0,c=0;for(let t=0;t<n;t++)c=e.get(t,o)-i[o],r+=c,a+=c*c;t?s.push((a-r*r/n)/(n-1)):s.push((a-r*r/n)/n)}return s}(this,i,n);case void 0:if("number"!=typeof n)throw new TypeError("mean must be a number");return function(e,t,i){const n=e.rows,r=e.columns,s=n*r;let o=0,a=0,c=0;for(let t=0;t<n;t++)for(let n=0;n<r;n++)c=e.get(t,n)-i,o+=c,a+=c*c;return t?(a-o*o/s)/(s-1):(a-o*o/s)/s}(this,i,n);default:throw new Error(`invalid option: ${e}`)}}standardDeviation(e,t){"object"==typeof e&&(t=e,e=void 0);const i=this.variance(e,t);if(void 0===e)return Math.sqrt(i);for(let e=0;e<i.length;e++)i[e]=Math.sqrt(i[e]);return i}center(e,t={}){if("object"==typeof e&&(t=e,e=void 0),"object"!=typeof t)throw new TypeError("options must be an object");const{center:i=this.mean(e)}=t;switch(e){case"row":if(!ib.isAnyArray(i))throw new TypeError("center must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)-t[i])}(this,i),this;case"column":if(!ib.isAnyArray(i))throw new TypeError("center must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)-t[n])}(this,i),this;case void 0:if("number"!=typeof i)throw new TypeError("center must be a number");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)-t)}(this,i),this;default:throw new Error(`invalid option: ${e}`)}}scale(e,t={}){if("object"==typeof e&&(t=e,e=void 0),"object"!=typeof t)throw new TypeError("options must be an object");let i=t.scale;switch(e){case"row":if(void 0===i)i=function(e){const t=[];for(let i=0;i<e.rows;i++){let n=0;for(let t=0;t<e.columns;t++)n+=e.get(i,t)**2/(e.columns-1);t.push(Math.sqrt(n))}return t}(this);else if(!ib.isAnyArray(i))throw new TypeError("scale must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)/t[i])}(this,i),this;case"column":if(void 0===i)i=function(e){const t=[];for(let i=0;i<e.columns;i++){let n=0;for(let t=0;t<e.rows;t++)n+=e.get(t,i)**2/(e.rows-1);t.push(Math.sqrt(n))}return t}(this);else if(!ib.isAnyArray(i))throw new TypeError("scale must be an array");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)/t[n])}(this,i),this;case void 0:if(void 0===i)i=function(e){const t=e.size-1;let i=0;for(let n=0;n<e.columns;n++)for(let r=0;r<e.rows;r++)i+=e.get(r,n)**2/t;return Math.sqrt(i)}(this);else if("number"!=typeof i)throw new TypeError("scale must be a number");return function(e,t){for(let i=0;i<e.rows;i++)for(let n=0;n<e.columns;n++)e.set(i,n,e.get(i,n)/t)}(this,i),this;default:throw new Error(`invalid option: ${e}`)}}toString(e){return ob(this,e)}[Symbol.iterator](){return this.entries()}*entries(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield[e,t,this.get(e,t)]}*values(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)yield this.get(e,t)}}function vb(e,t){return e-t}Fb.prototype.klass="Matrix","undefined"!=typeof Symbol&&(Fb.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return ob(this)}),Fb.random=Fb.rand,Fb.randomInt=Fb.randInt,Fb.diagonal=Fb.diag,Fb.prototype.diagonal=Fb.prototype.diag,Fb.identity=Fb.eye,Fb.prototype.negate=Fb.prototype.neg,Fb.prototype.tensorProduct=Fb.prototype.kroneckerProduct;class yb extends Fb{data;#k(e,t){if(this.data=[],!(Number.isInteger(t)&&t>=0))throw new TypeError("nColumns must be a positive integer");for(let i=0;i<e;i++)this.data.push(new Float64Array(t));this.rows=e,this.columns=t}constructor(e,t){if(super(),yb.isMatrix(e))this.#k(e.rows,e.columns),yb.copy(e,this);else if(Number.isInteger(e)&&e>=0)this.#k(e,t);else{if(!ib.isAnyArray(e))throw new TypeError("First argument must be a positive number or an array");{const i=e;if("number"!=typeof(t=(e=i.length)?i[0].length:0))throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let n=0;n<e;n++){if(i[n].length!==t)throw new RangeError("Inconsistent array dimensions");if(!i[n].every((e=>"number"==typeof e)))throw new TypeError("Input data contains non-numeric values");this.data.push(Float64Array.from(i[n]))}this.rows=e,this.columns=t}}}set(e,t,i){return this.data[e][t]=i,this}get(e,t){return this.data[e][t]}removeRow(e){return lb(this,e),this.data.splice(e,1),this.rows-=1,this}addRow(e,t){return void 0===t&&(t=e,e=this.rows),lb(this,e,!0),t=Float64Array.from(db(this,t)),this.data.splice(e,0,t),this.rows+=1,this}removeColumn(e){hb(this,e);for(let t=0;t<this.rows;t++){const i=new Float64Array(this.columns-1);for(let n=0;n<e;n++)i[n]=this.data[t][n];for(let n=e+1;n<this.columns;n++)i[n-1]=this.data[t][n];this.data[t]=i}return this.columns-=1,this}addColumn(e,t){void 0===t&&(t=e,e=this.columns),hb(this,e,!0),t=ub(this,t);for(let i=0;i<this.rows;i++){const n=new Float64Array(this.columns+1);let r=0;for(;r<e;r++)n[r]=this.data[i][r];for(n[r++]=t[i];r<this.columns+1;r++)n[r]=this.data[i][r-1];this.data[i]=n}return this.columns+=1,this}}!function(e,t){e.prototype.add=function(e){return"number"==typeof e?this.addS(e):this.addM(e)},e.prototype.addS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e);return this},e.prototype.addM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)+e.get(t,i));return this},e.add=function(e,i){return new t(e).add(i)},e.prototype.sub=function(e){return"number"==typeof e?this.subS(e):this.subM(e)},e.prototype.subS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e);return this},e.prototype.subM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)-e.get(t,i));return this},e.sub=function(e,i){return new t(e).sub(i)},e.prototype.subtract=e.prototype.sub,e.prototype.subtractS=e.prototype.subS,e.prototype.subtractM=e.prototype.subM,e.subtract=e.sub,e.prototype.mul=function(e){return"number"==typeof e?this.mulS(e):this.mulM(e)},e.prototype.mulS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e);return this},e.prototype.mulM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)*e.get(t,i));return this},e.mul=function(e,i){return new t(e).mul(i)},e.prototype.multiply=e.prototype.mul,e.prototype.multiplyS=e.prototype.mulS,e.prototype.multiplyM=e.prototype.mulM,e.multiply=e.mul,e.prototype.div=function(e){return"number"==typeof e?this.divS(e):this.divM(e)},e.prototype.divS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e);return this},e.prototype.divM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)/e.get(t,i));return this},e.div=function(e,i){return new t(e).div(i)},e.prototype.divide=e.prototype.div,e.prototype.divideS=e.prototype.divS,e.prototype.divideM=e.prototype.divM,e.divide=e.div,e.prototype.mod=function(e){return"number"==typeof e?this.modS(e):this.modM(e)},e.prototype.modS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)%e);return this},e.prototype.modM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)%e.get(t,i));return this},e.mod=function(e,i){return new t(e).mod(i)},e.prototype.modulus=e.prototype.mod,e.prototype.modulusS=e.prototype.modS,e.prototype.modulusM=e.prototype.modM,e.modulus=e.mod,e.prototype.and=function(e){return"number"==typeof e?this.andS(e):this.andM(e)},e.prototype.andS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)&e);return this},e.prototype.andM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)&e.get(t,i));return this},e.and=function(e,i){return new t(e).and(i)},e.prototype.or=function(e){return"number"==typeof e?this.orS(e):this.orM(e)},e.prototype.orS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)|e);return this},e.prototype.orM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)|e.get(t,i));return this},e.or=function(e,i){return new t(e).or(i)},e.prototype.xor=function(e){return"number"==typeof e?this.xorS(e):this.xorM(e)},e.prototype.xorS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)^e);return this},e.prototype.xorM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)^e.get(t,i));return this},e.xor=function(e,i){return new t(e).xor(i)},e.prototype.leftShift=function(e){return"number"==typeof e?this.leftShiftS(e):this.leftShiftM(e)},e.prototype.leftShiftS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)<<e);return this},e.prototype.leftShiftM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)<<e.get(t,i));return this},e.leftShift=function(e,i){return new t(e).leftShift(i)},e.prototype.signPropagatingRightShift=function(e){return"number"==typeof e?this.signPropagatingRightShiftS(e):this.signPropagatingRightShiftM(e)},e.prototype.signPropagatingRightShiftS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>e);return this},e.prototype.signPropagatingRightShiftM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>e.get(t,i));return this},e.signPropagatingRightShift=function(e,i){return new t(e).signPropagatingRightShift(i)},e.prototype.rightShift=function(e){return"number"==typeof e?this.rightShiftS(e):this.rightShiftM(e)},e.prototype.rightShiftS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>>e);return this},e.prototype.rightShiftM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)>>>e.get(t,i));return this},e.rightShift=function(e,i){return new t(e).rightShift(i)},e.prototype.zeroFillRightShift=e.prototype.rightShift,e.prototype.zeroFillRightShiftS=e.prototype.rightShiftS,e.prototype.zeroFillRightShiftM=e.prototype.rightShiftM,e.zeroFillRightShift=e.rightShift,e.prototype.not=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,~this.get(e,t));return this},e.not=function(e){return new t(e).not()},e.prototype.abs=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.abs(this.get(e,t)));return this},e.abs=function(e){return new t(e).abs()},e.prototype.acos=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.acos(this.get(e,t)));return this},e.acos=function(e){return new t(e).acos()},e.prototype.acosh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.acosh(this.get(e,t)));return this},e.acosh=function(e){return new t(e).acosh()},e.prototype.asin=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.asin(this.get(e,t)));return this},e.asin=function(e){return new t(e).asin()},e.prototype.asinh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.asinh(this.get(e,t)));return this},e.asinh=function(e){return new t(e).asinh()},e.prototype.atan=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.atan(this.get(e,t)));return this},e.atan=function(e){return new t(e).atan()},e.prototype.atanh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.atanh(this.get(e,t)));return this},e.atanh=function(e){return new t(e).atanh()},e.prototype.cbrt=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.cbrt(this.get(e,t)));return this},e.cbrt=function(e){return new t(e).cbrt()},e.prototype.ceil=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.ceil(this.get(e,t)));return this},e.ceil=function(e){return new t(e).ceil()},e.prototype.clz32=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.clz32(this.get(e,t)));return this},e.clz32=function(e){return new t(e).clz32()},e.prototype.cos=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.cos(this.get(e,t)));return this},e.cos=function(e){return new t(e).cos()},e.prototype.cosh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.cosh(this.get(e,t)));return this},e.cosh=function(e){return new t(e).cosh()},e.prototype.exp=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.exp(this.get(e,t)));return this},e.exp=function(e){return new t(e).exp()},e.prototype.expm1=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.expm1(this.get(e,t)));return this},e.expm1=function(e){return new t(e).expm1()},e.prototype.floor=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.floor(this.get(e,t)));return this},e.floor=function(e){return new t(e).floor()},e.prototype.fround=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.fround(this.get(e,t)));return this},e.fround=function(e){return new t(e).fround()},e.prototype.log=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log(this.get(e,t)));return this},e.log=function(e){return new t(e).log()},e.prototype.log1p=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log1p(this.get(e,t)));return this},e.log1p=function(e){return new t(e).log1p()},e.prototype.log10=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log10(this.get(e,t)));return this},e.log10=function(e){return new t(e).log10()},e.prototype.log2=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.log2(this.get(e,t)));return this},e.log2=function(e){return new t(e).log2()},e.prototype.round=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.round(this.get(e,t)));return this},e.round=function(e){return new t(e).round()},e.prototype.sign=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sign(this.get(e,t)));return this},e.sign=function(e){return new t(e).sign()},e.prototype.sin=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sin(this.get(e,t)));return this},e.sin=function(e){return new t(e).sin()},e.prototype.sinh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sinh(this.get(e,t)));return this},e.sinh=function(e){return new t(e).sinh()},e.prototype.sqrt=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.sqrt(this.get(e,t)));return this},e.sqrt=function(e){return new t(e).sqrt()},e.prototype.tan=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.tan(this.get(e,t)));return this},e.tan=function(e){return new t(e).tan()},e.prototype.tanh=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.tanh(this.get(e,t)));return this},e.tanh=function(e){return new t(e).tanh()},e.prototype.trunc=function(){for(let e=0;e<this.rows;e++)for(let t=0;t<this.columns;t++)this.set(e,t,Math.trunc(this.get(e,t)));return this},e.trunc=function(e){return new t(e).trunc()},e.pow=function(e,i){return new t(e).pow(i)},e.prototype.pow=function(e){return"number"==typeof e?this.powS(e):this.powM(e)},e.prototype.powS=function(e){for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)**e);return this},e.prototype.powM=function(e){if(e=t.checkMatrix(e),this.rows!==e.rows||this.columns!==e.columns)throw new RangeError("Matrices dimensions must be equal");for(let t=0;t<this.rows;t++)for(let i=0;i<this.columns;i++)this.set(t,i,this.get(t,i)**e.get(t,i));return this}}(Fb,yb);class Ab extends Fb{#I;get size(){return this.#I.size}get rows(){return this.#I.rows}get columns(){return this.#I.columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(e){return yb.isMatrix(e)&&"SymmetricMatrix"===e.klassType}static zeros(e){return new this(e)}static ones(e){return new this(e).fill(1)}constructor(e){if(super(),yb.isMatrix(e)){if(!e.isSymmetric())throw new TypeError("not symmetric data");this.#I=yb.copy(e,new yb(e.rows,e.rows))}else if(Number.isInteger(e)&&e>=0)this.#I=new yb(e,e);else if(this.#I=new yb(e),!this.isSymmetric())throw new TypeError("not symmetric data")}clone(){const e=new Ab(this.diagonalSize);for(const[t,i,n]of this.upperRightEntries())e.set(t,i,n);return e}toMatrix(){return new yb(this)}get(e,t){return this.#I.get(e,t)}set(e,t,i){return this.#I.set(e,t,i),this.#I.set(t,e,i),this}removeCross(e){return this.#I.removeRow(e),this.#I.removeColumn(e),this}addCross(e,t){void 0===t&&(t=e,e=this.diagonalSize);const i=t.slice();return i.splice(e,1),this.#I.addRow(e,i),this.#I.addColumn(e,t),this}applyMask(e){if(e.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const t=[];for(const[i,n]of e.entries())n||t.push(i);t.reverse();for(const e of t)this.removeCross(e);return this}toCompact(){const{diagonalSize:e}=this,t=new Array(e*(e+1)/2);for(let i=0,n=0,r=0;r<t.length;r++)t[r]=this.get(n,i),++i>=e&&(i=++n);return t}static fromCompact(e){const t=e.length,i=(Math.sqrt(8*t+1)-1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(e)}`);const n=new Ab(i);for(let r=0,s=0,o=0;o<t;o++)n.set(r,s,e[o]),++r>=i&&(r=++s);return n}*upperRightEntries(){for(let e=0,t=0;e<this.diagonalSize;void 0){const i=this.get(e,t);yield[e,t,i],++t>=this.diagonalSize&&(t=++e)}}*upperRightValues(){for(let e=0,t=0;e<this.diagonalSize;void 0){const i=this.get(e,t);yield i,++t>=this.diagonalSize&&(t=++e)}}}Ab.prototype.klassType="SymmetricMatrix";class Cb extends Ab{static isDistanceMatrix(e){return Ab.isSymmetricMatrix(e)&&"DistanceMatrix"===e.klassSubType}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,t,i){return e===t&&(i=0),super.set(e,t,i)}addCross(e,t){return void 0===t&&(t=e,e=this.diagonalSize),(t=t.slice())[e]=0,super.addCross(e,t)}toSymmetricMatrix(){return new Ab(this)}clone(){const e=new Cb(this.diagonalSize);for(const[t,i,n]of this.upperRightEntries())t!==i&&e.set(t,i,n);return e}toCompact(){const{diagonalSize:e}=this,t=new Array((e-1)*e/2);for(let i=1,n=0,r=0;r<t.length;r++)t[r]=this.get(n,i),++i>=e&&(i=1+ ++n);return t}static fromCompact(e){const t=e.length;if(0===t)return new this(0);const i=(Math.sqrt(8*t+1)+1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const n=new this(i);for(let r=1,s=0,o=0;o<t;o++)n.set(r,s,e[o]),++r>=i&&(r=1+ ++s);return n}}Cb.prototype.klassSubType="DistanceMatrix";class _b extends Fb{constructor(e,t,i){super(),this.matrix=e,this.rows=t,this.columns=i}}class xb extends _b{constructor(e,t,i){fb(e,t),pb(e,i),super(e,t.length,i.length),this.rowIndices=t,this.columnIndices=i}set(e,t,i){return this.matrix.set(this.rowIndices[e],this.columnIndices[t],i),this}get(e,t){return this.matrix.get(this.rowIndices[e],this.columnIndices[t])}}class kb extends Fb{constructor(e,t={}){const{rows:i=1}=t;if(e.length%i!=0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=i,this.columns=e.length/i,this.data=e}set(e,t,i){let n=this._calculateIndex(e,t);return this.data[n]=i,this}get(e,t){let i=this._calculateIndex(e,t);return this.data[i]}_calculateIndex(e,t){return e*this.columns+t}}class Ib extends Fb{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,i){return this.data[e][t]=i,this}get(e,t){return this.data[e][t]}}class Sb{constructor(e){let t,i,n,r,s,o,a,c,l,h=(e=Ib.checkMatrix(e)).clone(),d=h.rows,u=h.columns,f=new Float64Array(d),p=1;for(t=0;t<d;t++)f[t]=t;for(c=new Float64Array(d),i=0;i<u;i++){for(t=0;t<d;t++)c[t]=h.get(t,i);for(t=0;t<d;t++){for(l=Math.min(t,i),s=0,n=0;n<l;n++)s+=h.get(t,n)*c[n];c[t]-=s,h.set(t,i,c[t])}for(r=i,t=i+1;t<d;t++)Math.abs(c[t])>Math.abs(c[r])&&(r=t);if(r!==i){for(n=0;n<u;n++)o=h.get(r,n),h.set(r,n,h.get(i,n)),h.set(i,n,o);a=f[r],f[r]=f[i],f[i]=a,p=-p}if(i<d&&0!==h.get(i,i))for(t=i+1;t<d;t++)h.set(t,i,h.get(t,i)/h.get(i,i))}this.LU=h,this.pivotVector=f,this.pivotSign=p}isSingular(){let e=this.LU,t=e.columns;for(let i=0;i<t;i++)if(0===e.get(i,i))return!0;return!1}solve(e){e=yb.checkMatrix(e);let t=this.LU;if(t.rows!==e.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");let i,n,r,s=e.columns,o=e.subMatrixRow(this.pivotVector,0,s-1),a=t.columns;for(r=0;r<a;r++)for(i=r+1;i<a;i++)for(n=0;n<s;n++)o.set(i,n,o.get(i,n)-o.get(r,n)*t.get(i,r));for(r=a-1;r>=0;r--){for(n=0;n<s;n++)o.set(r,n,o.get(r,n)/t.get(r,r));for(i=0;i<r;i++)for(n=0;n<s;n++)o.set(i,n,o.get(i,n)-o.get(r,n)*t.get(i,r))}return o}get determinant(){let e=this.LU;if(!e.isSquare())throw new Error("Matrix must be square");let t=this.pivotSign,i=e.columns;for(let n=0;n<i;n++)t*=e.get(n,n);return t}get lowerTriangularMatrix(){let e=this.LU,t=e.rows,i=e.columns,n=new yb(t,i);for(let r=0;r<t;r++)for(let t=0;t<i;t++)r>t?n.set(r,t,e.get(r,t)):r===t?n.set(r,t,1):n.set(r,t,0);return n}get upperTriangularMatrix(){let e=this.LU,t=e.rows,i=e.columns,n=new yb(t,i);for(let r=0;r<t;r++)for(let t=0;t<i;t++)r<=t?n.set(r,t,e.get(r,t)):n.set(r,t,0);return n}get pivotPermutationVector(){return Array.from(this.pivotVector)}}function Eb(e,t){let i=0;return Math.abs(e)>Math.abs(t)?(i=t/e,Math.abs(e)*Math.sqrt(1+i*i)):0!==t?(i=e/t,Math.abs(t)*Math.sqrt(1+i*i)):0}class Nb{constructor(e){let t,i,n,r,s=(e=Ib.checkMatrix(e)).clone(),o=e.rows,a=e.columns,c=new Float64Array(a);for(n=0;n<a;n++){let e=0;for(t=n;t<o;t++)e=Eb(e,s.get(t,n));if(0!==e){for(s.get(n,n)<0&&(e=-e),t=n;t<o;t++)s.set(t,n,s.get(t,n)/e);for(s.set(n,n,s.get(n,n)+1),i=n+1;i<a;i++){for(r=0,t=n;t<o;t++)r+=s.get(t,n)*s.get(t,i);for(r=-r/s.get(n,n),t=n;t<o;t++)s.set(t,i,s.get(t,i)+r*s.get(t,n))}}c[n]=-e}this.QR=s,this.Rdiag=c}solve(e){e=yb.checkMatrix(e);let t=this.QR,i=t.rows;if(e.rows!==i)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");let n,r,s,o,a=e.columns,c=e.clone(),l=t.columns;for(s=0;s<l;s++)for(r=0;r<a;r++){for(o=0,n=s;n<i;n++)o+=t.get(n,s)*c.get(n,r);for(o=-o/t.get(s,s),n=s;n<i;n++)c.set(n,r,c.get(n,r)+o*t.get(n,s))}for(s=l-1;s>=0;s--){for(r=0;r<a;r++)c.set(s,r,c.get(s,r)/this.Rdiag[s]);for(n=0;n<s;n++)for(r=0;r<a;r++)c.set(n,r,c.get(n,r)-c.get(s,r)*t.get(n,s))}return c.subMatrix(0,l-1,0,a-1)}isFullRank(){let e=this.QR.columns;for(let t=0;t<e;t++)if(0===this.Rdiag[t])return!1;return!0}get upperTriangularMatrix(){let e,t,i=this.QR,n=i.columns,r=new yb(n,n);for(e=0;e<n;e++)for(t=0;t<n;t++)e<t?r.set(e,t,i.get(e,t)):e===t?r.set(e,t,this.Rdiag[e]):r.set(e,t,0);return r}get orthogonalMatrix(){let e,t,i,n,r=this.QR,s=r.rows,o=r.columns,a=new yb(s,o);for(i=o-1;i>=0;i--){for(e=0;e<s;e++)a.set(e,i,0);for(a.set(i,i,1),t=i;t<o;t++)if(0!==r.get(i,i)){for(n=0,e=i;e<s;e++)n+=r.get(e,i)*a.get(e,t);for(n=-n/r.get(i,i),e=i;e<s;e++)a.set(e,t,a.get(e,t)+n*r.get(e,i))}}return a}}class Mb{constructor(e,t={}){if((e=Ib.checkMatrix(e)).isEmpty())throw new Error("Matrix must be non-empty");let i=e.rows,n=e.columns;const{computeLeftSingularVectors:r=!0,computeRightSingularVectors:s=!0,autoTranspose:o=!1}=t;let a,c=Boolean(r),l=Boolean(s),h=!1;if(i<n)if(o){a=e.transpose(),i=a.rows,n=a.columns,h=!0;let t=c;c=l,l=t}else a=e.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else a=e.clone();let d=Math.min(i,n),u=Math.min(i+1,n),f=new Float64Array(u),p=new yb(i,d),g=new yb(n,n),m=new Float64Array(n),w=new Float64Array(i),b=new Float64Array(u);for(let e=0;e<u;e++)b[e]=e;let F=Math.min(i-1,n),v=Math.max(0,Math.min(n-2,i)),y=Math.max(F,v);for(let e=0;e<y;e++){if(e<F){f[e]=0;for(let t=e;t<i;t++)f[e]=Eb(f[e],a.get(t,e));if(0!==f[e]){a.get(e,e)<0&&(f[e]=-f[e]);for(let t=e;t<i;t++)a.set(t,e,a.get(t,e)/f[e]);a.set(e,e,a.get(e,e)+1)}f[e]=-f[e]}for(let t=e+1;t<n;t++){if(e<F&&0!==f[e]){let n=0;for(let r=e;r<i;r++)n+=a.get(r,e)*a.get(r,t);n=-n/a.get(e,e);for(let r=e;r<i;r++)a.set(r,t,a.get(r,t)+n*a.get(r,e))}m[t]=a.get(e,t)}if(c&&e<F)for(let t=e;t<i;t++)p.set(t,e,a.get(t,e));if(e<v){m[e]=0;for(let t=e+1;t<n;t++)m[e]=Eb(m[e],m[t]);if(0!==m[e]){m[e+1]<0&&(m[e]=0-m[e]);for(let t=e+1;t<n;t++)m[t]/=m[e];m[e+1]+=1}if(m[e]=-m[e],e+1<i&&0!==m[e]){for(let t=e+1;t<i;t++)w[t]=0;for(let t=e+1;t<i;t++)for(let i=e+1;i<n;i++)w[t]+=m[i]*a.get(t,i);for(let t=e+1;t<n;t++){let n=-m[t]/m[e+1];for(let r=e+1;r<i;r++)a.set(r,t,a.get(r,t)+n*w[r])}}if(l)for(let t=e+1;t<n;t++)g.set(t,e,m[t])}}let A=Math.min(n,i+1);if(F<n&&(f[F]=a.get(F,F)),i<A&&(f[A-1]=0),v+1<A&&(m[v]=a.get(v,A-1)),m[A-1]=0,c){for(let e=F;e<d;e++){for(let t=0;t<i;t++)p.set(t,e,0);p.set(e,e,1)}for(let e=F-1;e>=0;e--)if(0!==f[e]){for(let t=e+1;t<d;t++){let n=0;for(let r=e;r<i;r++)n+=p.get(r,e)*p.get(r,t);n=-n/p.get(e,e);for(let r=e;r<i;r++)p.set(r,t,p.get(r,t)+n*p.get(r,e))}for(let t=e;t<i;t++)p.set(t,e,-p.get(t,e));p.set(e,e,1+p.get(e,e));for(let t=0;t<e-1;t++)p.set(t,e,0)}else{for(let t=0;t<i;t++)p.set(t,e,0);p.set(e,e,1)}}if(l)for(let e=n-1;e>=0;e--){if(e<v&&0!==m[e])for(let t=e+1;t<n;t++){let i=0;for(let r=e+1;r<n;r++)i+=g.get(r,e)*g.get(r,t);i=-i/g.get(e+1,e);for(let r=e+1;r<n;r++)g.set(r,t,g.get(r,t)+i*g.get(r,e))}for(let t=0;t<n;t++)g.set(t,e,0);g.set(e,e,1)}let C=A-1,_=Number.EPSILON;for(;A>0;){let e,t;for(e=A-2;e>=-1&&-1!==e;e--){const t=Number.MIN_VALUE+_*Math.abs(f[e]+Math.abs(f[e+1]));if(Math.abs(m[e])<=t||Number.isNaN(m[e])){m[e]=0;break}}if(e===A-2)t=4;else{let i;for(i=A-1;i>=e&&i!==e;i--){let t=(i!==A?Math.abs(m[i]):0)+(i!==e+1?Math.abs(m[i-1]):0);if(Math.abs(f[i])<=_*t){f[i]=0;break}}i===e?t=3:i===A-1?t=1:(t=2,e=i)}switch(e++,t){case 1:{let t=m[A-2];m[A-2]=0;for(let i=A-2;i>=e;i--){let r=Eb(f[i],t),s=f[i]/r,o=t/r;if(f[i]=r,i!==e&&(t=-o*m[i-1],m[i-1]=s*m[i-1]),l)for(let e=0;e<n;e++)r=s*g.get(e,i)+o*g.get(e,A-1),g.set(e,A-1,-o*g.get(e,i)+s*g.get(e,A-1)),g.set(e,i,r)}break}case 2:{let t=m[e-1];m[e-1]=0;for(let n=e;n<A;n++){let r=Eb(f[n],t),s=f[n]/r,o=t/r;if(f[n]=r,t=-o*m[n],m[n]=s*m[n],c)for(let t=0;t<i;t++)r=s*p.get(t,n)+o*p.get(t,e-1),p.set(t,e-1,-o*p.get(t,n)+s*p.get(t,e-1)),p.set(t,n,r)}break}case 3:{const t=Math.max(Math.abs(f[A-1]),Math.abs(f[A-2]),Math.abs(m[A-2]),Math.abs(f[e]),Math.abs(m[e])),r=f[A-1]/t,s=f[A-2]/t,o=m[A-2]/t,a=f[e]/t,h=m[e]/t,d=((s+r)*(s-r)+o*o)/2,u=r*o*(r*o);let w=0;0===d&&0===u||(w=d<0?0-Math.sqrt(d*d+u):Math.sqrt(d*d+u),w=u/(d+w));let b=(a+r)*(a-r)+w,F=a*h;for(let t=e;t<A-1;t++){let r=Eb(b,F);0===r&&(r=Number.MIN_VALUE);let s=b/r,o=F/r;if(t!==e&&(m[t-1]=r),b=s*f[t]+o*m[t],m[t]=s*m[t]-o*f[t],F=o*f[t+1],f[t+1]=s*f[t+1],l)for(let e=0;e<n;e++)r=s*g.get(e,t)+o*g.get(e,t+1),g.set(e,t+1,-o*g.get(e,t)+s*g.get(e,t+1)),g.set(e,t,r);if(r=Eb(b,F),0===r&&(r=Number.MIN_VALUE),s=b/r,o=F/r,f[t]=r,b=s*m[t]+o*f[t+1],f[t+1]=-o*m[t]+s*f[t+1],F=o*m[t+1],m[t+1]=s*m[t+1],c&&t<i-1)for(let e=0;e<i;e++)r=s*p.get(e,t)+o*p.get(e,t+1),p.set(e,t+1,-o*p.get(e,t)+s*p.get(e,t+1)),p.set(e,t,r)}m[A-2]=b;break}case 4:if(f[e]<=0&&(f[e]=f[e]<0?-f[e]:0,l))for(let t=0;t<=C;t++)g.set(t,e,-g.get(t,e));for(;e<C&&!(f[e]>=f[e+1]);){let t=f[e];if(f[e]=f[e+1],f[e+1]=t,l&&e<n-1)for(let i=0;i<n;i++)t=g.get(i,e+1),g.set(i,e+1,g.get(i,e)),g.set(i,e,t);if(c&&e<i-1)for(let n=0;n<i;n++)t=p.get(n,e+1),p.set(n,e+1,p.get(n,e)),p.set(n,e,t);e++}A--}}if(h){let e=g;g=p,p=e}this.m=i,this.n=n,this.s=f,this.U=p,this.V=g}solve(e){let t=e,i=this.threshold,n=this.s.length,r=yb.zeros(n,n);for(let e=0;e<n;e++)Math.abs(this.s[e])<=i?r.set(e,e,0):r.set(e,e,1/this.s[e]);let s=this.U,o=this.rightSingularVectors,a=o.mmul(r),c=o.rows,l=s.rows,h=yb.zeros(c,l);for(let e=0;e<c;e++)for(let t=0;t<l;t++){let i=0;for(let r=0;r<n;r++)i+=a.get(e,r)*s.get(t,r);h.set(e,t,i)}return h.mmul(t)}solveForDiagonal(e){return this.solve(yb.diag(e))}inverse(){let e=this.V,t=this.threshold,i=e.rows,n=e.columns,r=new yb(i,this.s.length);for(let s=0;s<i;s++)for(let i=0;i<n;i++)Math.abs(this.s[i])>t&&r.set(s,i,e.get(s,i)/this.s[i]);let s=this.U,o=s.rows,a=s.columns,c=new yb(i,o);for(let e=0;e<i;e++)for(let t=0;t<o;t++){let i=0;for(let n=0;n<a;n++)i+=r.get(e,n)*s.get(t,n);c.set(e,t,i)}return c}get condition(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}get norm2(){return this.s[0]}get rank(){let e=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,t=0,i=this.s;for(let n=0,r=i.length;n<r;n++)i[n]>e&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return yb.diag(this.s)}}function Rb(e,t,i=!1){return e=Ib.checkMatrix(e),t=Ib.checkMatrix(t),i?new Mb(e).solve(t):e.isSquare()?new Sb(e).solve(t):new Nb(e).solve(t)}function Bb(e,t){let i=[];for(let n=0;n<e;n++)n!==t&&i.push(n);return i}function Db(e,t,i,n=1e-9,r=1e-9){if(e>r)return new Array(t.rows+1).fill(0);{let e=t.addRow(i,[0]);for(let t=0;t<e.rows;t++)Math.abs(e.get(t,0))<n&&e.set(t,0,0);return e.to1DArray()}}class Tb{constructor(e,t={}){const{assumeSymmetric:i=!1}=t;if(!(e=Ib.checkMatrix(e)).isSquare())throw new Error("Matrix is not a square matrix");if(e.isEmpty())throw new Error("Matrix must be non-empty");let n,r,s=e.columns,o=new yb(s,s),a=new Float64Array(s),c=new Float64Array(s),l=e,h=!1;if(h=!!i||e.isSymmetric(),h){for(n=0;n<s;n++)for(r=0;r<s;r++)o.set(n,r,l.get(n,r));!function(e,t,i,n){let r,s,o,a,c,l,h,d;for(c=0;c<e;c++)i[c]=n.get(e-1,c);for(a=e-1;a>0;a--){for(d=0,o=0,l=0;l<a;l++)d+=Math.abs(i[l]);if(0===d)for(t[a]=i[a-1],c=0;c<a;c++)i[c]=n.get(a-1,c),n.set(a,c,0),n.set(c,a,0);else{for(l=0;l<a;l++)i[l]/=d,o+=i[l]*i[l];for(r=i[a-1],s=Math.sqrt(o),r>0&&(s=-s),t[a]=d*s,o-=r*s,i[a-1]=r-s,c=0;c<a;c++)t[c]=0;for(c=0;c<a;c++){for(r=i[c],n.set(c,a,r),s=t[c]+n.get(c,c)*r,l=c+1;l<=a-1;l++)s+=n.get(l,c)*i[l],t[l]+=n.get(l,c)*r;t[c]=s}for(r=0,c=0;c<a;c++)t[c]/=o,r+=t[c]*i[c];for(h=r/(o+o),c=0;c<a;c++)t[c]-=h*i[c];for(c=0;c<a;c++){for(r=i[c],s=t[c],l=c;l<=a-1;l++)n.set(l,c,n.get(l,c)-(r*t[l]+s*i[l]));i[c]=n.get(a-1,c),n.set(a,c,0)}}i[a]=o}for(a=0;a<e-1;a++){if(n.set(e-1,a,n.get(a,a)),n.set(a,a,1),o=i[a+1],0!==o){for(l=0;l<=a;l++)i[l]=n.get(l,a+1)/o;for(c=0;c<=a;c++){for(s=0,l=0;l<=a;l++)s+=n.get(l,a+1)*n.get(l,c);for(l=0;l<=a;l++)n.set(l,c,n.get(l,c)-s*i[l])}}for(l=0;l<=a;l++)n.set(l,a+1,0)}for(c=0;c<e;c++)i[c]=n.get(e-1,c),n.set(e-1,c,0);n.set(e-1,e-1,1),t[0]=0}(s,c,a,o),function(e,t,i,n){let r,s,o,a,c,l,h,d,u,f,p,g,m,w,b,F;for(o=1;o<e;o++)t[o-1]=t[o];t[e-1]=0;let v=0,y=0,A=Number.EPSILON;for(l=0;l<e;l++){for(y=Math.max(y,Math.abs(i[l])+Math.abs(t[l])),h=l;h<e&&!(Math.abs(t[h])<=A*y);)h++;if(h>l)do{for(r=i[l],d=(i[l+1]-r)/(2*t[l]),u=Eb(d,1),d<0&&(u=-u),i[l]=t[l]/(d+u),i[l+1]=t[l]*(d+u),f=i[l+1],s=r-i[l],o=l+2;o<e;o++)i[o]-=s;for(v+=s,d=i[h],p=1,g=p,m=p,w=t[l+1],b=0,F=0,o=h-1;o>=l;o--)for(m=g,g=p,F=b,r=p*t[o],s=p*d,u=Eb(d,t[o]),t[o+1]=b*u,b=t[o]/u,p=d/u,d=p*i[o]-b*r,i[o+1]=s+b*(p*r+b*i[o]),c=0;c<e;c++)s=n.get(c,o+1),n.set(c,o+1,b*n.get(c,o)+p*s),n.set(c,o,p*n.get(c,o)-b*s);d=-b*F*m*w*t[l]/f,t[l]=b*d,i[l]=p*d}while(Math.abs(t[l])>A*y);i[l]=i[l]+v,t[l]=0}for(o=0;o<e-1;o++){for(c=o,d=i[o],a=o+1;a<e;a++)i[a]<d&&(c=a,d=i[a]);if(c!==o)for(i[c]=i[o],i[o]=d,a=0;a<e;a++)d=n.get(a,o),n.set(a,o,n.get(a,c)),n.set(a,c,d)}}(s,c,a,o)}else{let e=new yb(s,s),t=new Float64Array(s);for(r=0;r<s;r++)for(n=0;n<s;n++)e.set(n,r,l.get(n,r));!function(e,t,i,n){let r,s,o,a,c,l,h,d=0,u=e-1;for(l=d+1;l<=u-1;l++){for(h=0,a=l;a<=u;a++)h+=Math.abs(t.get(a,l-1));if(0!==h){for(o=0,a=u;a>=l;a--)i[a]=t.get(a,l-1)/h,o+=i[a]*i[a];for(s=Math.sqrt(o),i[l]>0&&(s=-s),o-=i[l]*s,i[l]=i[l]-s,c=l;c<e;c++){for(r=0,a=u;a>=l;a--)r+=i[a]*t.get(a,c);for(r/=o,a=l;a<=u;a++)t.set(a,c,t.get(a,c)-r*i[a])}for(a=0;a<=u;a++){for(r=0,c=u;c>=l;c--)r+=i[c]*t.get(a,c);for(r/=o,c=l;c<=u;c++)t.set(a,c,t.get(a,c)-r*i[c])}i[l]=h*i[l],t.set(l,l-1,h*s)}}for(a=0;a<e;a++)for(c=0;c<e;c++)n.set(a,c,a===c?1:0);for(l=u-1;l>=d+1;l--)if(0!==t.get(l,l-1)){for(a=l+1;a<=u;a++)i[a]=t.get(a,l-1);for(c=l;c<=u;c++){for(s=0,a=l;a<=u;a++)s+=i[a]*n.get(a,c);for(s=s/i[l]/t.get(l,l-1),a=l;a<=u;a++)n.set(a,c,n.get(a,c)+s*i[a])}}}(s,e,t,o),function(e,t,i,n,r){let s,o,a,c,l,h,d,u,f,p,g,m,w,b,F,v=e-1,y=0,A=e-1,C=Number.EPSILON,_=0,x=0,k=0,I=0,S=0,E=0,N=0,M=0;for(s=0;s<e;s++)for((s<y||s>A)&&(i[s]=r.get(s,s),t[s]=0),o=Math.max(s-1,0);o<e;o++)x+=Math.abs(r.get(s,o));for(;v>=y;){for(c=v;c>y&&(E=Math.abs(r.get(c-1,c-1))+Math.abs(r.get(c,c)),0===E&&(E=x),!(Math.abs(r.get(c,c-1))<C*E));)c--;if(c===v)r.set(v,v,r.get(v,v)+_),i[v]=r.get(v,v),t[v]=0,v--,M=0;else if(c===v-1){if(d=r.get(v,v-1)*r.get(v-1,v),k=(r.get(v-1,v-1)-r.get(v,v))/2,I=k*k+d,N=Math.sqrt(Math.abs(I)),r.set(v,v,r.get(v,v)+_),r.set(v-1,v-1,r.get(v-1,v-1)+_),u=r.get(v,v),I>=0){for(N=k>=0?k+N:k-N,i[v-1]=u+N,i[v]=i[v-1],0!==N&&(i[v]=u-d/N),t[v-1]=0,t[v]=0,u=r.get(v,v-1),E=Math.abs(u)+Math.abs(N),k=u/E,I=N/E,S=Math.sqrt(k*k+I*I),k/=S,I/=S,o=v-1;o<e;o++)N=r.get(v-1,o),r.set(v-1,o,I*N+k*r.get(v,o)),r.set(v,o,I*r.get(v,o)-k*N);for(s=0;s<=v;s++)N=r.get(s,v-1),r.set(s,v-1,I*N+k*r.get(s,v)),r.set(s,v,I*r.get(s,v)-k*N);for(s=y;s<=A;s++)N=n.get(s,v-1),n.set(s,v-1,I*N+k*n.get(s,v)),n.set(s,v,I*n.get(s,v)-k*N)}else i[v-1]=u+k,i[v]=u+k,t[v-1]=N,t[v]=-N;v-=2,M=0}else{if(u=r.get(v,v),f=0,d=0,c<v&&(f=r.get(v-1,v-1),d=r.get(v,v-1)*r.get(v-1,v)),10===M){for(_+=u,s=y;s<=v;s++)r.set(s,s,r.get(s,s)-u);E=Math.abs(r.get(v,v-1))+Math.abs(r.get(v-1,v-2)),u=f=.75*E,d=-.4375*E*E}if(30===M&&(E=(f-u)/2,E=E*E+d,E>0)){for(E=Math.sqrt(E),f<u&&(E=-E),E=u-d/((f-u)/2+E),s=y;s<=v;s++)r.set(s,s,r.get(s,s)-E);_+=E,u=f=d=.964}for(M+=1,l=v-2;l>=c&&(N=r.get(l,l),S=u-N,E=f-N,k=(S*E-d)/r.get(l+1,l)+r.get(l,l+1),I=r.get(l+1,l+1)-N-S-E,S=r.get(l+2,l+1),E=Math.abs(k)+Math.abs(I)+Math.abs(S),k/=E,I/=E,S/=E,l!==c)&&!(Math.abs(r.get(l,l-1))*(Math.abs(I)+Math.abs(S))<C*(Math.abs(k)*(Math.abs(r.get(l-1,l-1))+Math.abs(N)+Math.abs(r.get(l+1,l+1)))));)l--;for(s=l+2;s<=v;s++)r.set(s,s-2,0),s>l+2&&r.set(s,s-3,0);for(a=l;a<=v-1&&(b=a!==v-1,a!==l&&(k=r.get(a,a-1),I=r.get(a+1,a-1),S=b?r.get(a+2,a-1):0,u=Math.abs(k)+Math.abs(I)+Math.abs(S),0!==u&&(k/=u,I/=u,S/=u)),0!==u);a++)if(E=Math.sqrt(k*k+I*I+S*S),k<0&&(E=-E),0!==E){for(a!==l?r.set(a,a-1,-E*u):c!==l&&r.set(a,a-1,-r.get(a,a-1)),k+=E,u=k/E,f=I/E,N=S/E,I/=k,S/=k,o=a;o<e;o++)k=r.get(a,o)+I*r.get(a+1,o),b&&(k+=S*r.get(a+2,o),r.set(a+2,o,r.get(a+2,o)-k*N)),r.set(a,o,r.get(a,o)-k*u),r.set(a+1,o,r.get(a+1,o)-k*f);for(s=0;s<=Math.min(v,a+3);s++)k=u*r.get(s,a)+f*r.get(s,a+1),b&&(k+=N*r.get(s,a+2),r.set(s,a+2,r.get(s,a+2)-k*S)),r.set(s,a,r.get(s,a)-k),r.set(s,a+1,r.get(s,a+1)-k*I);for(s=y;s<=A;s++)k=u*n.get(s,a)+f*n.get(s,a+1),b&&(k+=N*n.get(s,a+2),n.set(s,a+2,n.get(s,a+2)-k*S)),n.set(s,a,n.get(s,a)-k),n.set(s,a+1,n.get(s,a+1)-k*I)}}}if(0===x)return;for(v=e-1;v>=0;v--)if(k=i[v],I=t[v],0===I)for(c=v,r.set(v,v,1),s=v-1;s>=0;s--){for(d=r.get(s,s)-k,S=0,o=c;o<=v;o++)S+=r.get(s,o)*r.get(o,v);if(t[s]<0)N=d,E=S;else if(c=s,0===t[s]?r.set(s,v,0!==d?-S/d:-S/(C*x)):(u=r.get(s,s+1),f=r.get(s+1,s),I=(i[s]-k)*(i[s]-k)+t[s]*t[s],h=(u*E-N*S)/I,r.set(s,v,h),r.set(s+1,v,Math.abs(u)>Math.abs(N)?(-S-d*h)/u:(-E-f*h)/N)),h=Math.abs(r.get(s,v)),C*h*h>1)for(o=s;o<=v;o++)r.set(o,v,r.get(o,v)/h)}else if(I<0)for(c=v-1,Math.abs(r.get(v,v-1))>Math.abs(r.get(v-1,v))?(r.set(v-1,v-1,I/r.get(v,v-1)),r.set(v-1,v,-(r.get(v,v)-k)/r.get(v,v-1))):(F=zb(0,-r.get(v-1,v),r.get(v-1,v-1)-k,I),r.set(v-1,v-1,F[0]),r.set(v-1,v,F[1])),r.set(v,v-1,0),r.set(v,v,1),s=v-2;s>=0;s--){for(p=0,g=0,o=c;o<=v;o++)p+=r.get(s,o)*r.get(o,v-1),g+=r.get(s,o)*r.get(o,v);if(d=r.get(s,s)-k,t[s]<0)N=d,S=p,E=g;else if(c=s,0===t[s]?(F=zb(-p,-g,d,I),r.set(s,v-1,F[0]),r.set(s,v,F[1])):(u=r.get(s,s+1),f=r.get(s+1,s),m=(i[s]-k)*(i[s]-k)+t[s]*t[s]-I*I,w=2*(i[s]-k)*I,0===m&&0===w&&(m=C*x*(Math.abs(d)+Math.abs(I)+Math.abs(u)+Math.abs(f)+Math.abs(N))),F=zb(u*S-N*p+I*g,u*E-N*g-I*p,m,w),r.set(s,v-1,F[0]),r.set(s,v,F[1]),Math.abs(u)>Math.abs(N)+Math.abs(I)?(r.set(s+1,v-1,(-p-d*r.get(s,v-1)+I*r.get(s,v))/u),r.set(s+1,v,(-g-d*r.get(s,v)-I*r.get(s,v-1))/u)):(F=zb(-S-f*r.get(s,v-1),-E-f*r.get(s,v),N,I),r.set(s+1,v-1,F[0]),r.set(s+1,v,F[1]))),h=Math.max(Math.abs(r.get(s,v-1)),Math.abs(r.get(s,v))),C*h*h>1)for(o=s;o<=v;o++)r.set(o,v-1,r.get(o,v-1)/h),r.set(o,v,r.get(o,v)/h)}for(s=0;s<e;s++)if(s<y||s>A)for(o=s;o<e;o++)n.set(s,o,r.get(s,o));for(o=e-1;o>=y;o--)for(s=y;s<=A;s++){for(N=0,a=y;a<=Math.min(o,A);a++)N+=n.get(s,a)*r.get(a,o);n.set(s,o,N)}}(s,c,a,o,e)}this.n=s,this.e=c,this.d=a,this.V=o}get realEigenvalues(){return Array.from(this.d)}get imaginaryEigenvalues(){return Array.from(this.e)}get eigenvectorMatrix(){return this.V}get diagonalMatrix(){let e,t,i=this.n,n=this.e,r=this.d,s=new yb(i,i);for(e=0;e<i;e++){for(t=0;t<i;t++)s.set(e,t,0);s.set(e,e,r[e]),n[e]>0?s.set(e,e+1,n[e]):n[e]<0&&s.set(e,e-1,n[e])}return s}}function zb(e,t,i,n){let r,s;return Math.abs(i)>Math.abs(n)?(r=n/i,s=i+r*n,[(e+r*t)/s,(t-r*e)/s]):(r=i/n,s=n+r*i,[(r*e+t)/s,(r*t-e)/s])}class Lb{constructor(e){if(!(e=Ib.checkMatrix(e)).isSymmetric())throw new Error("Matrix is not symmetric");let t,i,n,r=e,s=r.rows,o=new yb(s,s),a=!0;for(i=0;i<s;i++){let e=0;for(n=0;n<i;n++){let s=0;for(t=0;t<n;t++)s+=o.get(n,t)*o.get(i,t);s=(r.get(i,n)-s)/o.get(n,n),o.set(i,n,s),e+=s*s}for(e=r.get(i,i)-e,a&&=e>0,o.set(i,i,Math.sqrt(Math.max(e,0))),n=i+1;n<s;n++)o.set(i,n,0)}this.L=o,this.positiveDefinite=a}isPositiveDefinite(){return this.positiveDefinite}solve(e){e=Ib.checkMatrix(e);let t=this.L,i=t.rows;if(e.rows!==i)throw new Error("Matrix dimensions do not match");if(!1===this.isPositiveDefinite())throw new Error("Matrix is not positive definite");let n,r,s,o=e.columns,a=e.clone();for(s=0;s<i;s++)for(r=0;r<o;r++){for(n=0;n<s;n++)a.set(s,r,a.get(s,r)-a.get(n,r)*t.get(s,n));a.set(s,r,a.get(s,r)/t.get(s,s))}for(s=i-1;s>=0;s--)for(r=0;r<o;r++){for(n=s+1;n<i;n++)a.set(s,r,a.get(s,r)-a.get(n,r)*t.get(n,s));a.set(s,r,a.get(s,r)/t.get(s,s))}return a}get lowerTriangularMatrix(){return this.L}}class Hb{constructor(e,t={}){e=Ib.checkMatrix(e);let{Y:i}=t;const{scaleScores:n=!1,maxIterations:r=1e3,terminationCriteria:s=1e-10}=t;let o;if(i){if(i=ib.isAnyArray(i)&&"number"==typeof i[0]?yb.columnVector(i):Ib.checkMatrix(i),i.rows!==e.rows)throw new Error("Y should have the same number of rows as X");o=i.getColumnVector(0)}else o=e.getColumnVector(0);let a,c,l,h,d=1;for(let t=0;t<r&&d>s;t++)l=e.transpose().mmul(o).div(o.transpose().mmul(o).get(0,0)),l=l.div(l.norm()),a=e.mmul(l).div(l.transpose().mmul(l).get(0,0)),t>0&&(d=a.clone().sub(h).pow(2).sum()),h=a.clone(),i?(c=i.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),c=c.div(c.norm()),o=i.mmul(c).div(c.transpose().mmul(c).get(0,0))):o=a;if(i){let t=e.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0));t=t.div(t.norm());let n=e.clone().sub(a.clone().mmul(t.transpose())),r=o.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),s=i.clone().sub(a.clone().mulS(r.get(0,0)).mmul(c.transpose()));this.t=a,this.p=t.transpose(),this.w=l.transpose(),this.q=c,this.u=o,this.s=a.transpose().mmul(a),this.xResidual=n,this.yResidual=s,this.betas=r}else this.w=l.transpose(),this.s=a.transpose().mmul(a).sqrt(),this.t=n?a.clone().div(this.s.get(0,0)):a,this.xResidual=e.sub(a.mmul(l.transpose()))}}jw.AbstractMatrix=Fb,jw.CHO=Lb,jw.CholeskyDecomposition=Lb,jw.DistanceMatrix=Cb,jw.EVD=Tb,jw.EigenvalueDecomposition=Tb,jw.LU=Sb,jw.LuDecomposition=Sb;var Pb=jw.Matrix=yb;jw.MatrixColumnSelectionView=class extends _b{constructor(e,t){pb(e,t),super(e,e.rows,t.length),this.columnIndices=t}set(e,t,i){return this.matrix.set(e,this.columnIndices[t],i),this}get(e,t){return this.matrix.get(e,this.columnIndices[t])}},jw.MatrixColumnView=class extends _b{constructor(e,t){hb(e,t),super(e,e.rows,1),this.column=t}set(e,t,i){return this.matrix.set(e,this.column,i),this}get(e){return this.matrix.get(e,this.column)}},jw.MatrixFlipColumnView=class extends _b{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(e,this.columns-t-1,i),this}get(e,t){return this.matrix.get(e,this.columns-t-1)}},jw.MatrixFlipRowView=class extends _b{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(this.rows-e-1,t,i),this}get(e,t){return this.matrix.get(this.rows-e-1,t)}},jw.MatrixRowSelectionView=class extends _b{constructor(e,t){fb(e,t),super(e,t.length,e.columns),this.rowIndices=t}set(e,t,i){return this.matrix.set(this.rowIndices[e],t,i),this}get(e,t){return this.matrix.get(this.rowIndices[e],t)}},jw.MatrixRowView=class extends _b{constructor(e,t){lb(e,t),super(e,1,e.columns),this.row=t}set(e,t,i){return this.matrix.set(this.row,t,i),this}get(e,t){return this.matrix.get(this.row,t)}},jw.MatrixSelectionView=xb,jw.MatrixSubView=class extends _b{constructor(e,t,i,n,r){gb(e,t,i,n,r),super(e,i-t+1,r-n+1),this.startRow=t,this.startColumn=n}set(e,t,i){return this.matrix.set(this.startRow+e,this.startColumn+t,i),this}get(e,t){return this.matrix.get(this.startRow+e,this.startColumn+t)}},jw.MatrixTransposeView=class extends _b{constructor(e){super(e,e.columns,e.rows)}set(e,t,i){return this.matrix.set(t,e,i),this}get(e,t){return this.matrix.get(t,e)}},jw.NIPALS=Hb,jw.Nipals=Hb,jw.QR=Nb,jw.QrDecomposition=Nb,jw.SVD=Mb,jw.SingularValueDecomposition=Mb,jw.SymmetricMatrix=Ab,jw.WrapperMatrix1D=kb,jw.WrapperMatrix2D=Ib,jw.correlation=function(e,t=e,i={}){e=new yb(e);let n=!1;if("object"!=typeof t||yb.isMatrix(t)||ib.isAnyArray(t)?t=new yb(t):(i=t,t=e,n=!0),e.rows!==t.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:r=!0,scale:s=!0}=i;r&&(e.center("column"),n||t.center("column")),s&&(e.scale("column"),n||t.scale("column"));const o=e.standardDeviation("column",{unbiased:!0}),a=n?o:t.standardDeviation("column",{unbiased:!0}),c=e.transpose().mmul(t);for(let t=0;t<c.rows;t++)for(let i=0;i<c.columns;i++)c.set(t,i,c.get(t,i)*(1/(o[t]*a[i]))*(1/(e.rows-1)));return c},jw.covariance=function(e,t=e,i={}){e=new yb(e);let n=!1;if("object"!=typeof t||yb.isMatrix(t)||ib.isAnyArray(t)?t=new yb(t):(i=t,t=e,n=!0),e.rows!==t.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:r=!0}=i;r&&(e=e.center("column"),n||(t=t.center("column")));const s=e.transpose().mmul(t);for(let t=0;t<s.rows;t++)for(let i=0;i<s.columns;i++)s.set(t,i,s.get(t,i)*(1/(e.rows-1)));return s};var Ob=jw.default=yb;jw.determinant=function e(t){if((t=yb.checkMatrix(t)).isSquare()){if(0===t.columns)return 1;let i,n,r,s;if(2===t.columns)return i=t.get(0,0),n=t.get(0,1),r=t.get(1,0),s=t.get(1,1),i*s-n*r;if(3===t.columns){let s,o,a;return s=new xb(t,[1,2],[1,2]),o=new xb(t,[1,2],[0,2]),a=new xb(t,[1,2],[0,1]),i=t.get(0,0),n=t.get(0,1),r=t.get(0,2),i*e(s)-n*e(o)+r*e(a)}return new Sb(t).determinant}throw Error("determinant can only be calculated for a square matrix")};var Vb=jw.inverse=function(e,t=!1){return e=Ib.checkMatrix(e),t?new Mb(e).inverse():Rb(e,yb.eye(e.rows))};jw.linearDependencies=function(e,t={}){const{thresholdValue:i=1e-9,thresholdError:n=1e-9}=t;let r=(e=yb.checkMatrix(e)).rows,s=new yb(r,r);for(let t=0;t<r;t++){let o=yb.columnVector(e.getRow(t)),a=e.subMatrixRow(Bb(r,t)).transpose(),c=new Mb(a).solve(o),l=yb.sub(o,a.mmul(c)).abs().max();s.setRow(t,Db(l,c,t,i,n))}return s},jw.pseudoInverse=function(e,t=Number.EPSILON){if((e=yb.checkMatrix(e)).isEmpty())return e.transpose();let i=new Mb(e,{autoTranspose:!0}),n=i.leftSingularVectors,r=i.rightSingularVectors,s=i.diagonal;for(let e=0;e<s.length;e++)Math.abs(s[e])>t?s[e]=1/s[e]:s[e]=0;return r.mmul(yb.diag(s).mmul(n.transpose()))},jw.solve=Rb,jw.wrap=function(e,t){if(ib.isAnyArray(e))return e[0]&&ib.isAnyArray(e[0])?new Ib(e):new kb(e,t);throw new Error("the argument is not an array")};const qb=Pb;Ob.Matrix&&Ob.Matrix;const Qb=Vb;function Ub(e,t,i,n,r,s,o){let a=i,c=qb.eye(t.length,t.length,a);const l=r(t);let h=new Float64Array(e.x.length);for(let t=0;t<e.x.length;t++)h[t]=l(e.x[t]);let d=function(e,t,i,n,r,s){const o=i.length,a=e.x.length;let c=qb.zeros(o,a),l=0;for(let h=0;h<o;h++){if(0===n[h])continue;let o=n[h],d=i.slice();d[h]+=o;let u=r(d);if(s){d=i.slice(),d[h]-=o,o*=2;let t=r(d);for(let i=0;i<a;i++)c.set(l,i,(t(e.x[i])-u(e.x[i]))/o)}else for(let i=0;i<a;i++)c.set(l,i,(t[i]-u(e.x[i]))/o);l++}return c}(e,h,t,n,r,s),u=function(e,t){const i=e.x.length;let n=new qb(i,1);for(let r=0;r<i;r++)n.set(r,0,e.y[r]-t[r]);return n}(e,h),f=Qb(c.add(d.mmul(d.transpose().scale("row",{scale:o})))),p=d.mmul(u.scale("row",{scale:o}));return{perturbations:f.mmul(p),jacobianWeigthResidualError:p}}function jb(e,t,i={}){let{checkTimeout:n,minValues:r,maxValues:s,parameters:o,weightSquare:a,damping:c,dampingStepUp:l,dampingStepDown:h,maxIterations:d,errorTolerance:u,centralDifference:f,gradientDifference:p,improvementThreshold:g}=function(e,t,i){let{timeout:n,minValues:r,maxValues:s,initialValues:o,weights:a=1,damping:c=.01,dampingStepUp:l=11,dampingStepDown:h=9,maxIterations:d=100,errorTolerance:u=1e-7,centralDifference:f=!1,gradientDifference:p=.1,improvementThreshold:g=.001}=i;if(c<=0)throw new Error("The damping option must be a positive number");if(!e.x||!e.y)throw new Error("The data parameter must have x and y elements");if(!qw(e.x)||e.x.length<2||!qw(e.y)||e.y.length<2)throw new Error("The data parameter elements must be an array with more than 2 points");if(e.x.length!==e.y.length)throw new Error("The data parameter elements must have the same size");let m,w,b=o||new Array(t.length).fill(1),F=e.y.length,v=b.length;if(s=s||new Array(v).fill(Number.MAX_SAFE_INTEGER),r=r||new Array(v).fill(Number.MIN_SAFE_INTEGER),s.length!==r.length)throw new Error("minValues and maxValues must be the same size");if(!qw(b))throw new Error("initialValues must be an array");if("number"==typeof p)p=new Array(b.length).fill(p);else{if(!qw(p))throw new Error("gradientDifference should be a number or array with length equal to the number of parameters");p.length!==v&&(p=new Array(v).fill(p[0]))}if("number"==typeof a){let e=1/a**2;m=()=>e}else{if(!qw(a))throw new Error("weights should be a number or array with length equal to the number of data points");if(a.length<e.x.length){let e=1/a[0]**2;m=()=>e}else m=e=>1/a[e]**2}if(void 0!==n){if("number"!=typeof n)throw new Error("timeout should be a number");let e=Date.now()+1e3*n;w=()=>Date.now()>e}else w=()=>!1;let y=new Array(e.x.length);for(let e=0;e<F;e++)y[e]=m(e);return{checkTimeout:w,minValues:r,maxValues:s,parameters:b,weightSquare:y,damping:c,dampingStepUp:l,dampingStepDown:h,maxIterations:d,errorTolerance:u,centralDifference:f,gradientDifference:p,improvementThreshold:g}}(e,t,i),m=Qw(e,o,t,a),w=m<=u,b=0;for(;b<d&&!w;b++){let d=m,{perturbations:b,jacobianWeigthResidualError:F}=Ub(e,o,c,p,t,f,a);for(let e=0;e<o.length;e++)o[e]=Math.min(Math.max(r[e],o[e]-b.get(e,0)),s[e]);if(m=Qw(e,o,t,a),isNaN(m))break;if((d-m)/b.transpose().mmul(b.mulS(c).add(F)).get(0,0)>g?c=Math.max(c/h,1e-7):(m=d,c=Math.min(c*l,1e7)),n())throw new Error(`The execution time is over to ${i.timeout} seconds`);w=m<=u}return{parameterValues:o,parameterError:m,iterations:b}}class Gb{constructor(e){this.binScores=e}get_histogram(){let e=Math.max(...this.binScores),t=Math.floor(e/1e3),i=this.range(0,Math.floor(e/t)*t+t,t);const{counts:n,bins:r}=this.histogram(this.binScores,i);return{counts:n,bins:r}}range(e,t,i){const n=[];for(let r=e;r<t;r+=i)n.push(r);return n}histogram(e,t){const i=Array(t.length).fill(0);return e.forEach((e=>{for(let n=0;n<t.length-1;n++)if(e>=t[n]&&e<t[n+1]){i[n]++;break}})),{counts:i,bins:t}}normal_distribution([e,t,i]){return n=>e*Math.exp(-Math.pow(n-t,2)/(2*Math.pow(i,2)))/(Math.sqrt(2*Math.PI)*i)}get_initial_model_values(e,t){const i=t.slice(1,-1).reduce(((e,t)=>e+t),0);if(0===i)return console.debug("Problem with fit: all data points have zero value. Return zeros instead fit parameters!"),null;const n=(e[1]-e[0])*i,r=e.reduce(((e,i,n)=>e+i*t[n]),0)/i,s=e.reduce(((e,i,n)=>e+t[n]*Math.pow(i-r,2)),0),o=Math.sqrt(s/i);return[n,r,o]}normal_fit(e,t){const i={initialValues:this.get_initial_model_values(e,t),maxIterations:100};return jb({x:e,y:t},this.normal_distribution,i)}}class Wb{constructor(e,t){this.binSize=e,this.refGenome=t,this.gcBin=this.getGCbinSize()}getGCbinSize(){for(let e of[1e5,1e4])if(this.binSize%e==0)return e;return!1}async getBinGC(){const e={};if(!this.gcBin)return e;const t="https://storage.googleapis.com/cnvpytor_data/gcInfoData/GCinfo.json";try{const i=(await Mn.loadJson(t,{timeout:5e3})).find((e=>e.id===this.refGenome));if(!i)return console.warn("GC data not found for ",this.refGenome),e;const n=i.Bins.find((e=>e.BinSize===this.gcBin));if(!n)return console.warn("GC data not found for ",this.refGenome," Bin : ",this.gcBin),e;let r=`${t.split("/").slice(0,-1).join("/")}${n.fileURL}`;(await Mn.load(r,{})).split("\n").forEach((t=>{if(""!==t.trim()){const[i,n,r,s,o]=t.split("\t");e[i]||(e[i]=[]),e[i].push({start:+n,gcContent:+r,gcCount:+s,atCount:+o})}}))}catch(e){console.error(e),console.warn("Errors loading GC correction data.")}return e}}class $b extends Wb{constructor(e,t,i){super(t,i),this.wigFeatures=e,this.binSize=t,this.refGenome=i}async apply_gcCorrection(){if(!this.wigFeatures)return console.error("BinScore data is not available."),null;const e=Object.values(this.wigFeatures).reduce(((e,t)=>e.concat(t.filter((e=>e.binScore>0)).map((e=>e.binScore)))),[]);let t=new Gb(e);const{counts:i,bins:n}=t.get_histogram();let r=t.normal_fit(n,i);this.globalMean=r.parameterValues[1],this.globalStd=r.parameterValues[2],this.gcData=await this.getBinGC(),this.gcFlag=Object.keys(this.gcData).length>0,this.binScoreField=this.gcFlag?"gcCorrectedBinScore":"binScore",this.getGcCorrectionSignal(this.globalMean)}getGcCorrectionSignal(e){let t=this.getGcCorrection(e);Object.keys(this.wigFeatures).forEach((e=>{this.wigFeatures[e].forEach((e=>{e.binScore?e.gcCorrectedBinScore=Math.round(t[e.gc]*e.binScore):e.gcCorrectedBinScore=null}))}))}getGcCorrection(e){const t={};if(this.gcFlag){let i=this.getGCbinSize();const n={};let r=parseInt(this.binSize/i);for(let e in this.wigFeatures)for(let t=0;t<this.wigFeatures[e].length;t++){let i={AT:0,GC:0};for(let n=t*r;n<t*r+r;n++)this.gcData[e][n]&&(i.GC+=this.gcData[e][n].gcCount,i.AT+=this.gcData[e][n].atCount);let s=Math.round(100*i.GC/(i.GC+i.AT));this.wigFeatures[e][t].gc=s,n[s]||(n[s]=[]),this.wigFeatures[e][t].binScore&&n[s].push(this.wigFeatures[e][t].binScore)}Object.keys(n).forEach((i=>{let r,s=n[i];if(s.length<4)r=s.reduce(((e,t)=>e+t),0)/s.length;else{let e=new Gb(n[i]);const{counts:t,bins:s}=e.get_histogram();r=e.normal_fit(s,t).parameterValues[1]}t[i]=e/r}))}return t}formatDataStructure(e,t=1){const i=[];for(const[r,s]of Object.entries(this.wigFeatures))for(let r of s){var n={...r};1!=t&&(n.value=r[e]/t*2),i.push(n)}return i}formatDataStructure_BAF(e,t=-1){const i=[],n=[];for(const[r,s]of Object.entries(this.wigFeatures))s.forEach((r=>{var s={...r},o={...r};let a=r[e];.5!=a&&(o.value=t*(1-a),n.push(o)),s.value=t*a,i.push(s)}));return[i,n]}}function Kb(e){return e.reduce((function(e,t){return e>t?e:t}))}function Yb(e,t,i,n){return t*Math.exp(-1*(e-i)**2/(2*n**2))/Math.sqrt(2*Math.PI)/n}function Xb(e,t,i,n){return Math.exp(-1*(e-i)**2/(t**2+n**2))}function Zb(e,t){let i;try{i=e.reduce(((e,i,n)=>e+Math.min(i,t[n])))}catch{return console.log("Failed to find likelihood overlap: ",e,t),0}return i}function Jb(e,t,i,n){return 0==t&&0==n?{nl:.5*(e+i),ne:0}:{nl:(e*n*n+i*t*t)/(t*t+n*n),ne:Math.sqrt(t*t*n*n/(t*t+n*n))}}function eF(e,t){let i=parseInt(t*(e.length-1)),n=t*(e.length-1)-i;return i<e.length-1?e[i]*(1-n)+e[i+1]*n:e[i]}function tF(e){const t=e.length,i=Math.max(...e);let n=e.indexOf(i);n>Math.floor(t/2)&&(n=t-1-n);const r=(t/2-n)/(t+1),s=Math.floor((t/2+n)/2),o=t-1-s;let a=e.slice(s,o+1).reduce(((e,t)=>e+t),0)/e.reduce(((e,t)=>e+t),0);return n===Math.floor(t/2)&&(a=1),{mean:r,p:a}}var iF={CombinedCaller:class extends $b{constructor(e,t,i){super(e,t,i)}async call_2d(e=null,t=null,i="both",n=.1,r=0,s=10,o=0){await this.apply_gcCorrection();let a=this.gcFlag?"gcCorrectedBinScore":"binScore",c=null==e?.05*this.binSize/3e9:e,l=null==t?parseInt(this.binSize/1e4):t,h=[],d=[],u=[],f=[],p=[],g=[];for(const[e,t]of Object.entries(this.wigFeatures)){let e=[],i=[],s=[];t.forEach(((t,n)=>{t.hets_count>4&&t.dp_count>l&&t[a]&&(e.push([n]),i.push(t[a]),s.push(t.likelihood_score),delete t.likelihood_score)}));let o=[];for(let e=1;e<i.length;e++)o.push(Math.abs(i[e]-i[e-1]));let g=[0];for(let e=1;e<o.length;e++)g.push(Math.min(o[e-1],o[e]));g.push(0);let m=i.map(((e,t)=>Math.sqrt(Math.sqrt(e)**2+this.globalStd**2+Math.pow(g[t]/2,2)))),w=[];for(let t=0;t<e.length-1;t++){let n=0;try{n=Zb(s[t],s[t+1])}catch{console.log("Overlap failed: ",t,s[t],e[t+1],s[t+1])}let r=Xb(i[t],m[t],i[t+1],m[t+1]);w.push(r*n)}for(;w.length>0;){w=w.filter((e=>"number"==typeof e));let t=Kb(w);if(isNaN(t)&&console.log("NaN value",w),t<c)break;let n,r,o=w.indexOf(t),a=Jb(i[o],m[o],i[o+1],m[o+1]);try{n=s[o].map(((e,t)=>e*s[o+1][t])),r=n.reduce(((e,t)=>e+t))}catch{console.log(s),console.log("max_overlap:",t,o,w.length),console.log("likelihood: ",o,s[o],s[o+1]),console.log("nlh: ",r)}if(i[o]=a.nl,m[o]=a.ne,s[o]=n.map((function(e){return e/r})),e[o].push(...e[o+1]),i.splice(o+1,1),m.splice(o+1,1),e.splice(o+1,1),s.splice(o+1,1),w.splice(o,1),o<w.length){let e=Xb(i[o],m[o],i[o+1],m[o+1])*Zb(s[o],s[o+1]);w[o]=e}if(o>0){let e=Xb(i[o-1],m[o-1],i[o],m[o])*Zb(s[o-1],s[o]);w[o-1]=e}}let b=-1;for(;;){w=[];for(let t=0;t<i.length;t++)for(let r=t;r<i.length;r++)e[r][0]-e[t].at(-1)<n*(e[t].length+e[r].length)&&w.push(Xb(i[t],m[t],i[r],m[r])*Zb(s[t],s[r]));if(0==w.length)break;let t=Kb(w);if(t<c)break;let r=0,o=1;for(;r<e.length-1;){let a=Xb(i[r],m[r],i[o],m[o])*Zb(s[r],s[o]);if(e[o][0]-e[r].at(-1)<n*(e[r].length+e[o].length)&&a==t){let t=Jb(i[r],m[r],i[r+1],m[r+1]);i[r]=t.nl,m[r]=t.ne;let n=s[r].map(((e,t)=>e*s[r+1][t])),a=n.reduce(((e,t)=>e+t));s[r]=n.map((function(e){return e/a})),e[r].push(...e[r+1]),e[r]=e[r].sort(((e,t)=>e-t)),i.splice(o,1),m.splice(o,1),e.splice(o,1),s.splice(o,1),o>=e.length&&(r+=1,o=r+1)}else o+=1,o>=e.length&&(r+=1,o=r+1)}if(b==e.length)break;b=e.length}e.forEach(((e,n)=>{let o=tF(s[n]);e.length>1&&(e.forEach(((e,s)=>{d.push(t[e]),o.mean<=r&&h.push(t[e]),t[e].segment_score=i[n]})),u.push(i[n]),f.push(m[n]),p.push(s[n]))}))}let m=parseInt(1e3*(1-o));0==m&&(m=1);let w=Bw.linspace(o,1,m),b={},F={};for(let e=10;e>-1;e--)for(let t=0;t<e/2+1;t++){let n,r,s=e-t,o=w.map(((t,i)=>1-t+t*e/2)),a=e/2;e>0?(n=.5-t/(t+s),r=w.map(((e,i)=>.5-(1-e+e*t)/(2-2*e+(t+s)*e)))):(n=0,r=w.map(((e,t)=>0*e)));for(let i=0;i<u.length;i++){let c=Yb(a*this.globalMean,1,u[i],f[i])*eF(p[i],.5+n);i in F?F[i].push([e,t,s,c,1]):F[i]=[e,t,s,c,1];let l=0,h=0,d=0;o.forEach(((e,t)=>{if(!isNaN(r[t])){let n=Yb(e*this.globalMean,1,u[i],f[i])*eF(p[i],.5+r[t]);l+=n,n>h&&(h=n,d=w[t])}})),i in b?b[i].push([e,t,s,l/w.length,d]):b[i]=[e,t,s,l/w.length,d]}for(let e=0;e<u.length;e++)if("germline"==i)b[e].sort(((e,t)=>e[3]-t[3]));else if(b[e].sort(((e,t)=>e[3]-t[3])),"both"==i&&(F[e].sort(((e,t)=>e[3]-t[3])),F[e][0][3]>b[e][0][3])){let t=b[e].filter((t=>t[0]!=F[e][0][0]&&t[1]<=F[e][0][1]));b[e]=[F[e][0]].push(...t)}for(let e=0;e<u.length;e++)b[e][0][0],b[e][0][0],u[e],this.globalMean,Ow.t_test_1_sample(this.globalMean,u[e],f[e],g[e])}var v=this.formatDataStructure(this.wigFeatures,"binScore",this.globalMean);let y=[];return this.gcFlag&&(y=this.formatDataStructure(this.wigFeatures,"gcCorrectedBinScore",this.globalMean)),{binScore:v,gcCorrectedBinScore:y,segmentScore:this.formatDataStructure(this.wigFeatures,"segment_score",this.globalMean)}}formatDataStructure(e,t,i=1){const n=[];for(const[r,s]of Object.entries(e))s.forEach((e=>{var r={...e};1!=i&&(r.value=e[t]/i*2),n.push(r)}));return n}}};const nF=2871e6;function rF(e){for(var t=1,i=1,n=1*e,r=1;r<50;r++)t*=r,n+=(i*=-1)*Math.pow(e,2*r+1)/(t*(2*r+1));return 2*n/Math.sqrt(3.14159265358979)}function sF(e,t,i,n,r){var s=new cF(i.slice(n,r));return 0==s.std&&(s.std=t>0?t*s.mean/e:1),lF(e,s.mean,s.std,r-n)/(r-n)}function oF(e,t,i,n,r){var s=new cF(i.slice(n,r));if(s.mean<e){var o=(s.max-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1+rF(o)),r-n)}o=(s.min-s.mean)/(t*Math.sqrt(2));return Math.pow(.5*(1-rF(o)),r-n)}function aF(e,t,i,n,r,s,o=1e3){for(var a=sF(e,t,i,n,r),c=0,l=!1;a>s&!l&c<o;){l=!0,c+=1;var[h,d,u,f]=[1e10,1e10,1e10,1e10];if(n>0&&(h=sF(e,t,i,n-1,r)),r-n>2)var d=sF(e,t,i,n+1,r),u=sF(e,t,i,n,r-1);if(r<i.length)var f=sF(e,t,i,n,r+1);Math.min[f]<a&&(l=!1,h==Math.min[f]&&(n-=1,a=h),elif(d==Math.min[f]),n+=1,a=d,elif(u==Math.min[f]),r-=1,a=u,elif(f==Math.min[f]),r+=1,a=f)}return a<=s?r:0}class cF{constructor(e){this.data=e,this.mean=e.reduce(((e,t)=>e+t))/e.length,this.std=Math.sqrt(e.reduce(((e,t)=>(t-this.mean)**2))/e.length)}}function lF(e,t,i,n){0==i&&(i=1);var r=(e-t)/i*Math.sqrt(n);return 1-Ow.TdistributionCDF(Math.abs(r),n-1)}function hF(e,t,i,n,r,s){0==t&&(t=1),0==r&&(r=1);var o=(e-n)/Math.sqrt(t**2/i+r**2/s),a=(t**2/i+r**2/s)**2*(i-1)*(s-1)/(t**4*(s-1)/i**2+r**4*(i-1)/s**2);return 1-Ow.TdistributionCDF(Math.abs(o),parseInt(a+.5))}var dF={Partition:class{constructor(e,t,i){this.rd=e,this.mean=t,this.std=i,this.bin_bands=[2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128]}get_rd_signal_bandwidth(e){var t=[];return e.forEach(((e,i)=>{var n=0;n=e>this.mean/4?this.mean/(this.std**2*e):4/this.std**2,t.push(n)})),t}meanShiftCaller(e,t=3){var i={};return Object.entries(this.rd).forEach((([e,n])=>{var r=new Array(n.length).fill(!1),s=new Array(n.length);for(let e=0;e<n.length;e++)r[e]||(s[e]=n[e]);this.bin_bands.forEach(((e,i)=>{var o=r.map(((e,t)=>!e)),a=[];Object.entries(n).forEach((([e,t])=>{a.push(t.binScore)}));var c=[0],l=0;for(let e=0;e<r.length;e++)r[e]?l>0&&(c.push(c[c.length-1]+l-1),l=0):l+=1;c.shift();for(let i=0;i<t;i++){var h=this.get_rd_signal_bandwidth(a),d=new Array(a.length).fill(0);for(let t=0;t<a.length;t++)for(let i=t-3*e;i<=t+3*e+1;i++)if(!(i<0||i>=a.length||Math.abs(t-i)>=a.length)){var u=(i-t)*Math.exp(-.5*(i-t)**2/e**2)*Math.exp(-.5*(a[t]-a[i])**2*h[t]);d[t]+=u}for(var f=new Array,p=0;p<d.length-1;p++)d[p]<0&d[p+1]>=0&&f.push(p);f.push(d.length-1),f=f.concat(c).sort(((e,t)=>e-t)),f=Array.from(new Set(f));var g=0;for(p=0;p<f.length;p++){var m=a.slice(g,f[p]+1),w=m.reduce(((e,t)=>e+t))/m.length;a.fill(w,g,f[p]+1),g=f[p]+1}}p=0;for(var b=0;p<s.length;p++)o[p]&&(s[p]=a[b],b++);for(f=new Array,p=0;p<s.length-1;p++){Math.abs(s[p+1]-s[p])>.01&&f.push(p+1)}f.unshift(0),f.push(s.length),r=new Array(this.rd.length).fill(!1);for(p=1;p<f.length;p++){var F=[f[p-1],f[p]],v=[f[p-1],f[p-1]];if(!(p>1))continue;v[0]=f[p-2];var y=[f[p],f[p]];if(!(p<f.length-1))continue;y[1]=f[p+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(A<=1)continue;var x=new cF(s.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(s[v[0]]/this.mean)*this.std;if(Math.abs(s[v[0]]-s[F[0]])<k)continue;if(k=1.8*Math.sqrt(s[y[0]]/this.mean)*this.std,Math.abs(s[y[0]]-s[F[0]])<k)continue}else{var I=s.slice(v[0],v[1]),S=new cF(I),E=s.slice(y[0],y[1]),N=new cF(E);if(hF(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>.01/nF*bin_size*(A+C))continue;if(hF(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>.01/nF*bin_size*(A+_))continue}if(lF(this.mean,x.mean,x.std,x.data.length)>.05)continue;let e=a.slice(F[0],F[1]);var M=new cF(e);r.fill(!0,F[0],F[1]),s.fill(M.mean,F[0],F[1])}})),i[e]=s})),i}call_mean_shift(e=3){for(var t=new Array(this.rd.length).fill(!1),i=new Array(this.rd.length),n=0;n<this.rd.length;n++)t[n]||(i[n]=this.rd[n]);return this.bin_bands.forEach(((n,r)=>{var s=t.map(((e,t)=>!e)),o=[];s.forEach(((e,t)=>{e&&o.push(this.rd[t])}));for(var a=[0],c=0,l=0;l<t.length;l++)t[l]?c>0&&(a.push(a[a.length-1]+c-1),c=0):c+=1;a.shift();for(var h=0;h<e;h++){var d=this.get_rd_signal_bandwidth(o),u=new Array(o.length).fill(0);for(l=0;l<o.length;l++)for(var f=l-3*n;f<=l+3*n+1;f++)if(!(f<0||f>=o.length||Math.abs(l-f)>=o.length)){var p=(f-l)*Math.exp(-.5*(f-l)**2/n**2)*Math.exp(-.5*(o[l]-o[f])**2*d[l]);u[l]+=p}var g=new Array;for(l=0;l<u.length-1;l++)u[l]<0&u[l+1]>=0&&g.push(l);g.push(u.length-1),g=g.concat(a).sort(((e,t)=>e-t)),g=Array.from(new Set(g));var m=0;for(l=0;l<g.length;l++){var w=o.slice(m,g[l]+1),b=w.reduce(((e,t)=>e+t))/w.length;o.fill(b,m,g[l]+1),m=g[l]+1}}for(l=0,f=0;l<i.length;l++)s[l]&&(i[l]=o[f],f++);for(g=new Array,l=0;l<i.length-1;l++){Math.abs(i[l+1]-i[l])>.01&&g.push(l+1)}g.unshift(0),g.push(i.length),t=new Array(this.rd.length).fill(!1);for(l=1;l<g.length;l++){var F=[g[l-1],g[l]],v=[g[l-1],g[l-1]];if(l>1){v[0]=g[l-2];var y=[g[l],g[l]];if(l<g.length-1){y[1]=g[l+1];var A=F[1]-F[0],C=v[1]-v[0],_=y[1]-y[0];if(!(A<=1)){var x=new cF(i.slice(F[0],F[1]));if(_<=15||C<=15||A<=15){var k=1.8*Math.sqrt(i[v[0]]/this.mean)*this.std;if(Math.abs(i[v[0]]-i[F[0]])<k)continue;if(k=1.8*Math.sqrt(i[y[0]]/this.mean)*this.std,Math.abs(i[y[0]]-i[F[0]])<k)continue}else{var I=i.slice(v[0],v[1]),S=new cF(I),E=i.slice(y[0],y[1]),N=new cF(E);if(hF(x.mean,x.std,x.data.length,S.mean,S.std,S.data.length)>3.483106931382794e-9*(A+C))continue;if(hF(x.mean,x.std,x.data.length,N.mean,N.std,N.data.length)>3.483106931382794e-9*(A+_))continue}if(!(lF(this.mean,x.mean,x.std,x.data.length)>.05)){var M=new cF(this.rd.slice(F[0],F[1]));t.fill(!0,F[0],F[1]),i.fill(M.mean,F[0],F[1])}}}}}})),i}cnv_calling(e=1e5){var t=.25*this.mean,i=this.mean-t,n=this.mean+t,r=2971e6,s=this.meanShiftCaller(e),o={},a=[];return Object.entries(s).forEach((([c,l])=>{for(var h=!1;!h;){h=!0;var d=new Array(1).fill(0);for(let e=0;e<l.length-1;e++){Math.abs(l[e+1]-l[e])>.01&&d.push(e+1)}d.push(l.length);for(let e=0;e<d.length-2;e++){var u=Math.abs(l[d[e]]-l[d[e+1]]);if(u<t){var f=u+1,p=u+1;if(e>0&&(f=Math.abs(l[d[e]]-l[d[e-1]])),e<d.length-3&&(p=Math.abs(s[d[e+1]]-l[d[e+2]])),u<f&&u<p){h=!1;var g=new cF(l.slice(d[e],d[e+2]));l.fill(g.mean,d[e],d[e+2]),d.splice(e+1,e+1)}}}}var m=[];Object.entries(this.rd[c]).forEach((([e,t])=>{m.push(t.binScore)}));for(var w,b=new Array(l.length).fill(""),F=0,v=.05*e/r;F<l.length;){for(var y=F,A=F;F<l.length&l[F]<i;)F+=1;if((_=F)>A+1){var C=aF(this.mean,this.std,m,A,_,v);if(C){var _=C;b.fill("D",A,_)}}for(A=F;F<l.length&l[F]>n;)F+=1;(_=F)>A+1&&(C=aF(this.mean,this.std,m,A,_,v))&&(_=C,b.fill("A",A,_)),F==y&&(F+=1)}for(F=0;F<l.length;){for(;F<l.length&""!=b[F];)F+=1;for(A=F;F<l.length&l[F]<i;)F+=1;(_=F)>A+1&&(oF(this.mean,this.std,m,A,_)<1682935038707506e-26&&b.fill(["d"]*(_-A),A,_),F-=1),F+=1}(F=0)<l.length&&(w=b[F]),A=0;for(var x=[...m];F<l.length;){for(;b[F]==w&&!((F+=1)>=b.length););if(F>A){var k=new cF(x.slice(A,F));x.fill(k.mean,A,F)}F<l.length&&(w=b[F]),A=F}for(o[c]=x,F=0;F<l.length;){if(""==(w=b[F])){F+=1;continue}for(A=F;F<l.length&w==b[F];)F+=1;let t,i=new cF(x.slice(A,F)).mean/this.mean;t="D"==w?"deletion":"duplication";let n={chr:c,start:e*A+1,end:e*F,size:e*(F-A+1),value:2*i,event_type:t};a.push(n)}})),[o,a]}},MeanShiftCaller:class extends $b{constructor(e,t,i){super(e,t,i),this.binBands=[2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128]}async callMeanshift(e=3){await this.apply_gcCorrection();let t=this.partition();Object.entries(this.wigFeatures).forEach((([e,i])=>{i.forEach(((i,n)=>{t[e]&&(i.partitionLevel=parseInt(t[e][n]))}))}));return{binScore:this.formatDataStructure("binScore",this.globalMean),gcCorrectedBinScore:this.formatDataStructure("gcCorrectedBinScore",this.globalMean),segmentsCNV:this.formatDataStructure("partitionLevel",this.globalMean)}}getRDSignalBandWidth(e){const t=this.globalMean/4,i=4/this.globalStd**2;return e.map((e=>e>t?this.globalMean/(this.globalStd**2*e):i))}partition(e=3){let t={};Object.keys(this.wigFeatures).sort(((e,t)=>e.localeCompare(t,void 0,{numeric:!0}))).forEach((e=>{t[e]=this.wigFeatures[e]}));let i=this.gcFlag?"gcCorrectedBinScore":"binScore";var n={};for(const[o,a]of Object.entries(t)){var r=new Array(a.length).fill(!1),s=a.map(((e,t)=>r[t]?void 0:e[i]));this.binBands.forEach(((t,i)=>{var n=r.map(((e,t)=>!e)),o=s.filter(((e,t)=>!r[t])),a=[0],c=0;r.forEach((e=>{e?c>0&&(a.push(a[a.length-1]+c-1),c=0):e||c++})),a.shift();for(let i=0;i<e;i++){var l=this.getRDSignalBandWidth(o),h=new Array(o.length).fill(0);for(let e=0;e<o.length;e++){const i=Math.max(0,e-3*t),n=Math.min(o.length-1,e+3*t+1);for(let r=i;r<=n;r++){var d=(r-e)*Math.exp(-.5*(r-e)**2/t**2)*Math.exp(-.5*(o[e]-o[r])**2*l[e]);h[e]+=d}}for(var u=new Array,f=0;f<h.length-1;f++)h[f]<0&h[f+1]>=0&&u.push(f);u.push(h.length-1),u=u.concat(a).sort(((e,t)=>e-t)),u=Array.from(new Set(u));var p=0;for(f=0;f<u.length;f++){var g=o.slice(p,u[f]+1),m=g.reduce(((e,t)=>e+t))/g.length;o.fill(m,p,u[f]+1),p=u[f]+1}}f=0;for(var w=0;f<s.length;f++)n[f]&&(s[f]=o[w],w++);for(u=new Array,f=0;f<s.length-1;f++){Math.abs(s[f+1]-s[f])>.01&&u.push(f+1)}u.unshift(0),u.push(s.length),r=new Array(this.wigFeatures.length).fill(!1);for(f=1;f<u.length;f++){var b=[u[f-1],u[f]],F=[u[f-1],u[f-1]];if(!(f>1))continue;F[0]=u[f-2];var v=[u[f],u[f]];if(!(f<u.length-1))continue;v[1]=u[f+1];var y=b[1]-b[0],A=F[1]-F[0],C=v[1]-v[0];if(y<=1)continue;var _=new cF(s.slice(b[0],b[1]));if(C<=15||A<=15||y<=15){var x=1.8*Math.sqrt(s[F[0]]/this.globalMean)*this.globalStd;if(Math.abs(s[F[0]]-s[b[0]])<x)continue;if(x=1.8*Math.sqrt(s[v[0]]/this.globalMean)*this.globalStd,Math.abs(s[v[0]]-s[b[0]])<x)continue}else{var k=s.slice(F[0],F[1]),I=new cF(k),S=s.slice(v[0],v[1]),E=new cF(S);if(hF(_.mean,_.std,_.data.length,I.mean,I.std,I.data.length)>.01/nF*this.binSize*(y+A))continue;if(hF(_.mean,_.std,_.data.length,E.mean,E.std,E.data.length)>.01/nF*this.binSize*(y+C))continue}if(lF(this.globalMean,_.mean,_.std,_.data.length)>.05)continue;let e=o.slice(b[0],b[1]);var N=new cF(e);r.fill(!0,b[0],b[1]),s.fill(N.mean,b[0],b[1])}})),n[o]=s}return n}cnvCalling(e){var t=.25*this.globalMean,i=this.globalMean-t,n=this.globalMean+t,r=2971e6,s={},o=[];return Object.entries(e).forEach((([a,c])=>{for(var l=!1;!l;){l=!0;var h=new Array(1).fill(0);for(let e=0;e<c.length-1;e++){Math.abs(c[e+1]-c[e])>.01&&h.push(e+1)}h.push(c.length);for(let i=0;i<h.length-2;i++){var d=Math.abs(c[h[i]]-c[h[i+1]]);if(d<t){var u=d+1,f=d+1;if(i>0&&(u=Math.abs(c[h[i]]-c[h[i-1]])),i<h.length-3&&(f=Math.abs(e[h[i+1]]-c[h[i+2]])),d<u&&d<f){l=!1;var p=new cF(c.slice(h[i],h[i+2]));c.fill(p.mean,h[i],h[i+2]),h.splice(i+1,i+1)}}}}var g=[];Object.entries(this.wigFeatures[a]).forEach((([e,t])=>{g.push(t.binScore)}));for(var m,w=new Array(c.length).fill(""),b=0,F=.05*this.binSize/r;b<c.length;){for(var v=b,y=b;b<c.length&c[b]<i;)b+=1;if((C=b)>y+1){var A=aF(this.globalMean,this.std,g,y,C,F);if(A){var C=A;w.fill("D",y,C)}}for(y=b;b<c.length&c[b]>n;)b+=1;(C=b)>y+1&&(A=aF(this.globalMean,this.std,g,y,C,F))&&(C=A,w.fill("A",y,C)),b==v&&(b+=1)}for(b=0;b<c.length;){for(;b<c.length&""!=w[b];)b+=1;for(y=b;b<c.length&c[b]<i;)b+=1;(C=b)>y+1&&(oF(this.globalMean,this.std,g,y,C)<1682935038707506e-26&&w.fill(["d"]*(C-y),y,C),b-=1),b+=1}(b=0)<c.length&&(m=w[b]),y=0;for(var _=[...g];b<c.length;){for(;w[b]==m&&!((b+=1)>=w.length););if(b>y){var x=new cF(_.slice(y,b));_.fill(x.mean,y,b)}b<c.length&&(m=w[b]),y=b}for(s[a]=_,b=0;b<c.length;){if(""==(m=w[b])){b+=1;continue}for(y=b;b<c.length&m==w[b];)b+=1;let e,t=new cF(_.slice(y,b)).mean/this.globalMean;e="D"==m?"deletion":"duplication";let i={chr:a,start:this.binSize*y+1,end:this.binSize*b,size:this.binSize*(b-y+1),value:2*t,event_type:e};o.push(i)}})),[s,o]}}};class uF{constructor(e,t,i){this.allVariants=e,this.rowBinSize=1e4,this.binSize=t,this.binFactor=parseInt(t/this.rowBinSize),this.refGenome=i}async read_rd_baf(e="ReadDepth"){var t={};for(let e=this.allVariants.length-1;e>=0;e--){var i;let n=this.allVariants[e];this.allVariants.splice(e,1);let r=n.chr;i=Math.max(Math.floor(n.start/this.rowBinSize),0),t[r]||(t[r]=[]),t[r][i]||(t[r][i]={chr:r,start:i*this.rowBinSize,end:(i+1)*this.rowBinSize,dp_sum_score:0,dp_count:0,hets_count:0,hets:[]});const s=Object.values(n.calls);if(1!==s.length)throw Error(`Unexpected number of genotypes: ${s.length}. CNVPytor expects 1 and only 1 genotype`);const o=s[0],a=o.info.DP;a&&(t[r][i].dp_sum_score+=Number.parseInt(a),t[r][i].dp_count++);let c=o.info.AD.split(","),l=o.genotype;if(0==l[0]&&1==l[1]||1==l[0]&&0==l[1]){t[r][i].hets_count++;let e=parseInt(c[0]),n=parseInt(c[1]);t[r][i].hets.push({ref:e,alt:n})}}this.chromosomes=Object.keys(t);let n="ReadDepth"==e;var r,s=this.adjust_bin_size(t,n);if("ReadDepth"==e){let e=new dF.MeanShiftCaller(s,this.binSize,this.refGenome),t=await e.callMeanshift();r=[t.binScore,t.gcCorrectedBinScore,t.segmentsCNV];var o=e.formatDataStructure_BAF("max_likelihood",-1)}else if("2D"==e){let e=new iF.CombinedCaller(s,this.binSize,this.refGenome),t=await e.call_2d();r=[t.binScore,t.gcCorrectedBinScore,t.segmentScore];o=e.formatDataStructure_BAF("max_likelihood",-1)}return[r,o]}format_BAF_likelihood(e){const t=[];for(const[n,r]of Object.entries(e))for(let e of r){var i={...e};.5!=e.value&&(i.value=1-e.value,t.push(i))}return t}get_max_min_score(e){if(e.likelihood_score.length>0){const t=Math.max(...e.likelihood_score),i=e.likelihood_score.indexOf(t);e.value=Math.max(i/100,1-i/100),e.min_score=Math.min(i/100,1-i/100)}else e.score=0;return e}adjust_bin_size(e,t=!1){var i={};const n=this.binSize/150;for(let o of this.chromosomes){i[o]||(i[o]=[]);for(let a=0;a<e[o].length/this.binFactor;a++){const c=a;i[o][a]||(i[o][a]={chr:o,start:c*this.binSize,end:(c+1)*this.binSize,dp_count:0,hets_count:0,binScore:null,likelihood_score:[],dp_sum_score:0});for(var r=a*this.binFactor;r<this.binFactor*a+this.binFactor;r++)if(e[o][r]&&(i[o][a].dp_sum_score+=e[o][r].dp_sum_score,i[o][a].dp_count+=e[o][r].dp_count,i[o][a].hets_count+=e[o][r].hets_count,0!=e[o][r].hets.length))for(let t of e[o][r].hets)if(0==i[o][a].likelihood_score.length)i[o][a].likelihood_score=Bw.linspace(0,1,100).map(((e,i)=>fF(t.ref,t.alt,e)));else{var s=0;i[o][a].likelihood_score=Bw.linspace(0,1,100).map(((e,n)=>{var r=i[o][a].likelihood_score[n]*fF(t.ref,t.alt,e);return s+=r,r})),i[o][a].likelihood_score=Bw.linspace(0,1,100).map(((e,t)=>i[o][a].likelihood_score[t]/s))}i[o][a].dp_count>0&&(i[o][a].binScore=i[o][a].dp_sum_score/i[o][a].dp_count*n);const l=this.get_max_min_score(i[o][a]);i[o][a].max_likelihood=l.value,t&&delete i[o][a].likelihood_score}}return i}}function fF(e,t,i,n=!0){return Math.pow(i,e)*Math.pow(1-i,t)+Math.pow(i,t)*Math.pow(1-i,e)}class pF extends Pa{static DEFAULT_TRACK_HEIGHT=250;constructor(e,t){super(e,t)}init(e){this.featureType="numeric",this.type="cnvpytor",e.max||(this.defaultScale=!0,this.autoscale=!1),e.height||(e.height=pF.DEFAULT_TRACK_HEIGHT),this.type="cnvpytor",this.graphType=e.graphType||"points",this.bin_size=e.bin_size||1e5,this.signal_name=e.signal_name||"rd_snp",this.cnv_caller=e.cnv_caller||"2D",this.colors=e.colors||["gray","black","green","blue"],this.hasChroms={},super.init(e)}get supportsWholeGenome(){return!0}get_signals(){let e=[];return"rd_snp"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller,"BAF1","BAF2"]:"rd"==this.signal_name?e=["RD_Raw","RD_Raw_gc_coor",this.cnv_caller]:"snp"==this.signal_name?e=["BAF1","BAF2"]:"cnh"==this.signal_name&&(e=[this.cnv_caller]),e}get_signal_colors(){return[{singal_name:"RD_Raw",color:this.colors[0]},{singal_name:"RD_Raw_gc_coor",color:this.colors[1]},{singal_name:"ReadDepth",color:this.colors[2]},{singal_name:"2D",color:this.colors[2]},{singal_name:"BAF1",color:this.colors[3]},{singal_name:"BAF2",color:this.colors[3]}]}async postInit(){if("vcf"==this.config.format){let e;this.featureSource?e=Object.values(this.featureSource.getAllFeatures()).flat():(this.featureSource=this.featureSource||Hl(this.config,this.browser.genome),this.header=await this.getHeader(),e=this.featureSource.reader.features);const t=this.browser.config.genome,i=new uF(e,this.bin_size,t);let n,r,s;this.wigFeatures_obj={},this.wigFeatures_obj[this.bin_size]={},"2D"==this.cnv_caller?(s=await i.read_rd_baf("2D"),n=s[0],r=s[1],this.wigFeatures_obj[this.bin_size]["2D"]=n[2],this.available_callers=["2D"]):(s=await i.read_rd_baf(),n=s[0],r=s[1],this.wigFeatures_obj[this.bin_size].ReadDepth=n[2],this.available_callers=["ReadDepth"]),this.wigFeatures_obj[this.bin_size].RD_Raw=n[0],this.wigFeatures_obj[this.bin_size].RD_Raw_gc_coor=n[1],this.wigFeatures_obj[this.bin_size].BAF1=r[0],this.wigFeatures_obj[this.bin_size].BAF2=r[1],this.available_bins=[this.bin_size],this.set_available_callers()}else{this.cnvpytor_obj=new Ew(this.config.url,this.bin_size);let e=[...new Set(this.browser.referenceFrameList.map((e=>e.chr)))],t=this.getAliasChromsList(e);this.wigFeatures_obj=await this.cnvpytor_obj.get_rd_signal(this.bin_size,t),this.update_hasChroms(this.wigFeatures_obj,e),this.available_bins=this.cnvpytor_obj.availableBins,this.available_bins.includes(this.bin_size)||(this.bin_size=this.available_bins.at(-1)),this.available_callers=this.cnvpytor_obj.callers,this.set_available_callers()}this.tracks=[];const e=[];this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(let t in this.wigFeatures_obj)for(const[i,n]of Object.entries(this.wigFeatures_obj[t]))if(this.signals.includes(i)){let t={type:"wig",isMergedTrack:!0};t.features=n,t.name=i,t.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(t);r?(r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+t),"function"==typeof r.postInit&&e.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(e)}getAliasChromsList(e){let t=e.map((e=>{let t=this.browser.genome.chromAlias.aliasRecordCache.get(e);return Object.values(t)}));return t=t.flat(),t}set_available_callers(){this.available_callers.includes(this.cnv_caller)||(this.available_callers.length>0?this.cnv_caller=this.available_callers[0]:this.cnv_caller=null)}async getHeader(){if(!this.header){if("function"==typeof this.featureSource.getHeader){const e=await this.featureSource.getHeader();e&&(this.callSets=e.callSets||[]),this.header=e}this.sampleKeys=this.callSets?this.callSets.map((e=>e.sample)):[],this.sampleNames=this.sampleKeys}return this.header}get height(){return this._height}set height(e){if(this._height=e,this.tracks)for(let t of this.tracks)t.height=e,t.config.height=e}menuItemList(){let e=[];void 0!==this.flipAxis&&e.push({label:"Flip y-axis",click:function(){this.flipAxis=!this.flipAxis,this.trackView.repaintViews()}}),e=e.concat(this.numericDataMenuItems()),e.push("<hr/>"),e.push("Bin Sizes");for(let t of this.available_bins)e.push({element:Ta(t,t===this.bin_size),click:async function(){this.bin_size=t,this.trackView.startSpinner(),await this.recreate_tracks(t),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}});e.push("<hr/>"),e.push("Signal Type");let t={rd_snp:"RD and BAF Likelihood",rd:"RD Signal",snp:"BAF Likelihood"};for(let i in t)e.push({element:Ta(t[i],i===this.signal_name),click:async function(){this.signal_name=i,await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}});e.push("<hr/>"),e.push("CNV caller");for(let t of this.available_callers)e.push({element:Ta(t,t===this.cnv_caller),click:async function(){this.cnv_caller=t,this.trackView.startSpinner(),await this.recreate_tracks(this.bin_size),this.clearCachedFeatures(),this.trackView.updateViews(),this.trackView.repaintViews()}});if(this.variantState){e.push("<hr/>");for(let t of this.available_callers)e.push({label:"Convert to variant track",click:()=>{this.convertToVariant()}})}return e}async recreate_tracks(e){this.tracks=[];const t=[];if(!(e in this.wigFeatures_obj))if(Object.keys(this.hasChroms).length>0){let t=[...new Set(this.browser.referenceFrameList.map((e=>e.chr)))];"all"==t[0]&&(t=this.browser.genome.chromosomeNames),this.wigFeatures_obj={...this.wigFeatures_obj,...await this.cnvpytor_obj.get_rd_signal(e,t)},this.update_hasChroms(this.wigFeatures_obj,t)}else this.wigFeatures_obj={...this.wigFeatures_obj,...await this.cnvpytor_obj.get_rd_signal(e)};this.signals=this.get_signals(),this.signal_colors=this.get_signal_colors();for(const[i,n]of Object.entries(this.wigFeatures_obj[e]))if(this.signals.includes(i)){let e={type:"wig",isMergedTrack:!0};e.features=n,e.name=i,e.color=this.signal_colors.filter((e=>e.singal_name===i)).map((e=>e.color));const r=await this.browser.createTrack(e);r?(r.autoscale=!1,this.tracks.push(r)):console.warn("Could not create track "+e),"function"==typeof r.postInit&&t.push(r.postInit())}this.flipAxis=!!this.config.flipAxis&&this.config.flipAxis,this.logScale=!!this.config.logScale&&this.config.logScale,this.autoscale=this.config.autoscale,this.autoscale||(this.dataRange={min:this.config.min||0,max:this.config.max});for(let e of this.tracks)e.autoscale=!1,e.dataRange=this.dataRange;return Promise.all(t)}update_hasChroms(e,t){for(let i in e)this.hasChroms[i]||(this.hasChroms[i]=new Set),t.forEach((e=>this.hasChroms[i].add(e)));return this.hasChroms}async getFeatures(e,t,i,n){if(Object.keys(this.hasChroms).length>0&&0!=this.hasChroms[this.bin_size].size){let e=[...new Set(this.browser.referenceFrameList.map((e=>e.chr)))];"all"==e[0]&&(e=this.browser.genome.chromosomeNames);let t=e.filter((e=>!this.hasChroms[this.bin_size].has(e)));if(0!=t.length){let e=this.getAliasChromsList(t),i=await this.cnvpytor_obj.get_rd_signal(this.bin_size,e);this.update_hasChroms(i,t);for(let e in i)for(const[t,n]of Object.entries(i[e]))await this.wigFeatures_obj[e][t].push(...n);for(let e of this.tracks)await e.featureSource.updateFeatures(this.wigFeatures_obj[this.bin_size][e.name])}}if(this.tracks){const r=this.tracks.map((r=>r.getFeatures(e,t,i,n)));return Promise.all(r)}}getScaleFactor(e,t,i,n){return n?i/(Math.log10(t+1)-(e<=0?0:Math.log10(e+1))):i/(t-e)}computeYPixelValue(e,t){return(this.flipAxis?e-this.dataRange.min:this.dataRange.max-e)*t}computeYPixelValueInLogScale(e,t){let i=this.dataRange.max,n=this.dataRange.min;return i<=0?0:(n<=-1&&(n=0),n=n<=0?0:Math.log10(n+1),i=Math.log10(i+1),e=Math.log10(e+1),(this.flipAxis?e-n:i-e)*t)}draw(e){const t=e.features;if(!t)return;if(this.defaultScale&&("rd_snp"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||5}:"rd"==this.signal_name?this.dataRange={min:this.config.min||this.dataRange.min||0,max:this.config.max||this.dataRange.max||5}:"snp"==this.signal_name&&(this.dataRange={min:this.config.min||this.dataRange.min||-1,max:this.config.max||this.dataRange.max||0})),this.autoscale&&(this.dataRange=function(e,t){let i=0,n=-Number.MAX_VALUE;for(let e of t)for(let t of e)void 0===t.value||Number.isNaN(t.value)||(i=Math.min(i,t.value),n=Math.max(n,t.value));return{min:i,max:n}}(e.referenceFrame.chr,t)),this.tracks)for(let i=0,n=this.tracks.length;i<n;i++){const n=Object.assign({},e);n.features=t[i],this.tracks[i].dataRange=this.dataRange,this.tracks[i].flipAxis=this.flipAxis,this.tracks[i].logScale=this.logScale,this.graphType&&(this.tracks[i].graphType=this.graphType),this.tracks[i].draw(n)}const i=this.getScaleFactor(this.dataRange.min,this.dataRange.max,e.pixelHeight,this.logScale),n=e=>this.logScale?this.computeYPixelValueInLogScale(e,i):this.computeYPixelValue(e,i);if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=n(t.y),r={strokeStyle:t.color,strokeWidth:1};t.dotted?fr.dashedLine(e.context,0,i,e.pixelWidth,i,5,r):fr.strokeLine(e.context,0,i,e.pixelWidth,i,r)}let r=n(2);fr.dashedLine(e.context,0,r,e.pixelWidth,r,5,{strokeStyle:"lightgray",strokeWidth:.5})}paintAxis(e,t,i){var n,r,s,o,a,c,l,h={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};if(void 0===this.dataRange||void 0===this.dataRange.max||void 0===this.dataRange.min)return;let d=void 0!==this.flipAxis&&this.flipAxis;function u(e){return e<0?Math.abs(e):0===e?"0":Math.abs(e)>=10||e%1==0?e.toFixed():Math.abs(e)>=1?e.toFixed(1):e.toFixed(2)}fr.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"}),n=(l=.95*t)-8,a={x:r=l,y:s=o=.01*i},fr.strokeLine(e,n,s,r,o,h),fr.fillText(e,u(d?this.dataRange.min:this.dataRange.max),n+4,s+12,h),c={x:r,y:s=o=.99*i},fr.strokeLine(e,n,s,r,o,h),fr.fillText(e,u(d?this.dataRange.max:this.dataRange.min),n+4,s-4,h),fr.strokeLine(e,a.x,a.y,c.x,c.y,h);const f=this.getScaleFactor(this.dataRange.min,this.dataRange.max,i,this.logScale),p=e=>this.logScale?this.computeYPixelValueInLogScale(e,f):this.computeYPixelValue(e,f),g=Math.ceil((this.dataRange.max-this.dataRange.min)/10);for(let t=Math.ceil(this.dataRange.min+1);t<Math.round(this.dataRange.max-.4);t+=g){const i=p(t);fr.strokeLine(e,45,i,50,i,h),fr.fillText(e,u(d?this.dataRange.max-t:t),44,i+4,h)}}popupData(e,t){const i=t||e.viewport.cachedFeatures;if(i&&i.length===this.tracks.length){const t=[];for(let n=0;n<this.tracks.length;n++){n>0&&t.push("<hr/>"),t.push(`<div style=background-color:rgb(245,245,245);border-bottom-style:dashed;border-bottom-width:1px;padding-bottom:5px;padding-top:10px;font-weight:bold;font-size:larger >${this.tracks[n].name}</div>`);const r=this.tracks[n].popupData(e,i[n]);t.push(...r)}return t}}async convertToVariant(){this.variantState&&(Object.setPrototypeOf(this,wF.prototype),this.init(this.variantState),await this.postInit(),this.trackView.clearCachedFeatures(),this.variantState.trackHeight&&this.trackView.setTrackHeight(this.variantState.trackHeight),this.trackView.checkContentHeight(),this.trackView.updateViews(),delete this.variantState)}}const gF=b,mF=10;class wF extends Pa{static defaultColor="rgb(0,0,150)";static defaults={displayMode:"EXPANDED",sortDirection:"ASC",showGenotypes:!0,expandedVariantHeight:10,squishedVariantHeight:2,squishedCallHeight:1,expandedCallHeight:10,expandedVGap:2,squishedVGap:1,expandedGroupGap:10,squishedGroupGap:5,featureHeight:14,noGenotypeColor:"rgb(200,180,180)",noCallColor:"rgb(225, 225, 225)",nonRefColor:"rgb(200, 200, 215)",mixedColor:"rgb(200, 220, 200)",homrefColor:"rgb(200, 200, 200)",homvarColor:"rgb(17,248,254)",hetvarColor:"rgb(34,12,253)",refColor:"rgb(0,0,220)",altColor:"rgb(255,0,0)",visibilityWindow:void 0,labelDisplayMode:void 0,type:"variant"};_sortDirections=new Map;constructor(e,t){super(e,t)}init(e){if(super.init(e),e.variantHeight&&(this.expandedVariantHeight=e.variantHeight),this.featureSource=Hl(e,this.browser.genome),this.colorTables=new Map,e.colorTable){const t=e.colorBy||"*";this.colorTables.set(t,new Yn(e.colorTable))}if(this.strokecolor=e.strokecolor,this._context_hook=e.context_hook,e.color&&(this.colorBy=void 0),this.nVariantRows=1,e.samples)for(let t of e.samples)this.sampleKeys=e.samples;e.sort&&(this.initialSort=e.sort),this._colorByItems=new Map([["none","None"]])}async postInit(){if(this.header=await this.getHeader(),this.header.INFO){const e=new Set(Object.keys(this.header.INFO));this.config.colorBy?this.colorBy=this.config.colorBy:!this.config.color&&e.has("AF")&&(this.colorBy="AF"),e.has("AF")&&this._colorByItems.set("AF","Allele frequency"),e.has("VT")&&this._colorByItems.set("VT","Variant Type"),e.has("SVTYPE")&&this._colorByItems.set("SVTYPE","SV Type")}if(this.config.colorBy&&!this._colorByItems.has(this.config.colorBy)&&this._colorByItems.set(this.config.colorBy,this.config.colorBy),!this.disposed){if(this.header&&!this.sampleKeys&&(this.sampleKeys=this.header.sampleNameMap?Array.from(this.header.sampleNameMap.keys()):[]),void 0===this.visibilityWindow&&!1!==this.config.indexed){const e=_(this.config.url)?this.config.url.name:this.config.url;gF(e)&&e.toLowerCase().includes("gnomad")?this.visibilityWindow=1e3:"function"==typeof this.featureSource.defaultVisibilityWindow?this.visibilityWindow=await this.featureSource.defaultVisibilityWindow():this.visibilityWindow=1e6}return this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor,this}}get supportsWholeGenome(){return!this.config.indexURL||!0===this.config.supportsWholeGenome}get color(){return this._color||wF.defaultColor}set color(e){this._color=e,e&&(this.colorBy=void 0)}async getHeader(){return this.header||"function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader()),this.header}getSampleCount(){return this.sampleKeys?this.sampleKeys.length:0}async getFeatures(e,t,i,n){void 0===this.header&&(this.header=await this.getHeader());const r=await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:this.visibilityWindow});if(this.initialSort){const e=this.initialSort;if(void 0===e.option||"GENOTYPE"===e.option.toUpperCase())this.sortSamplesByGenotype(e,r);else if("ATTRIBUTE"===e.option.toUpperCase()&&e.attribute){const t="ASC"===e.direction?1:-1;this.sortByAttribute(e.attribute,t)}this.initialSort=void 0}return r}hasSamples(){return this.getSampleCount()>0}getSamples(){const e="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=t*(("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight)+e),r=mF+t*(i+e);return{names:this.sampleKeys,yOffset:r,height:n}}computePixelHeight(e){if(!e||0===e.length)return mF;const t="COLLAPSED"===this.displayMode?1:this.nVariantRows,i="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,n="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,r="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s=!1===this.showGenotypes?0:this.getSampleCount()*t;return mF+t*(n+i)+i+(s+1)*(r+i)}variantRowCount(e){this.nVariantRows=e}draw({context:e,pixelWidth:t,pixelHeight:i,bpPerPixel:n,bpStart:r,pixelTop:s,features:o}){fr.fillRect(e,0,s,t,i,{fillStyle:"rgb(255, 255, 255)"});const a="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,c="COLLAPSED"===this.displayMode?1:this.nVariantRows,l="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight;this.variantBandHeight=mF+c*(l+a);let h=this.sampleColumns;const d=this.hasSamples();if(h&&d&&!1!==this.showGenotypes&&fr.strokeLine(e,0,this.variantBandHeight,t,this.variantBandHeight,{strokeStyle:"rgb(224,224,224) "}),o){const i="SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight,s="SQUISHED"===this.displayMode?this.squishedVGap:this.expandedVGap,a=r+t*n+1;for(let t of o){if(this._filter&&!this._filter(t))continue;if(t.end<r)continue;if(t.start>a)break;const o="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,c=mF+("COLLAPSED"===this.displayMode?0:t.row*(o+s)),l=o;let h=(t.start-r)/n,u=(t.end-r)/n,f=Math.max(1,u-h);f<3?(f=3,h-=1):f>5&&(h+=1,f-=2);const p=t._f||t;let g;try{g=p.alleleFreq()}catch(e){console.log(e)}if("AF"===this.colorBy&&g){const t=Math.min(1,g)*l,i=l-t;e.fillStyle=p.isFiltered()?this.refColorFiltered:this.refColor,e.fillRect(h,c,f,i),e.fillStyle=p.isFiltered()?this.altColorFiltered:this.altColor,e.fillRect(h,c+i,f,t)}else e.fillStyle=this.getColorForFeature(p),e.fillRect(h,c,f,l);let m=this.getVariantStrokecolor(p);if(m&&(e.strokeStyle=m,e.strokeRect(h,c,f,l)),this.callContextHook(p,e,h,c,f,l),d&&!1!==this.showGenotypes){const t="COLLAPSED"===this.displayMode?1:this.nVariantRows;this.sampleYOffset=this.variantBandHeight+s,this.sampleHeight=t*(i+s);let n=0;for(let t of this.sampleKeys){const r=this.header.sampleNameMap.get(t),o=p.calls[r];if(o){const t="COLLAPSED"===this.displayMode?0:p.row,r=this.sampleYOffset+n*this.sampleHeight+t*(i+s);let a=!0,c=!0,l=!1;if(o.genotype)for(let e of o.genotype){if("."===e){l=!0;break}0!==e&&(c=!1),0===e&&(a=!1)}o.genotype?e.fillStyle=l?this.noCallColor:c?this.homrefColor:a?this.homvarColor:this.hetvarColor:e.fillStyle=this.noGenotypeColor,e.fillRect(h,r,f,i)}n++}}}}else console.log("No feature list")}get refColorFiltered(){return this._refColorFiltered||(this._refColorFiltered=un.addAlpha(this.refColor,.2)),this._refColorFiltered}get altColorFiltered(){return this._altColorFiltered||(this._altColorFiltered=un.addAlpha(this.altColor,.2)),this._altColorFiltered}getColorForFeature(e){const t=e._f||e;let i;if(this.colorBy&&"none"!==this.colorBy){const e=t.getAttributeValue(this.colorBy);i=void 0!==e?this.getVariantColorTable(this.colorBy).getColor(e):"gray"}else i=this.color?"function"==typeof this.color?this.color(e):this.color:"NONVARIANT"===t.type?this.nonRefColor:"MIXED"===t.type?this.mixedColor:this.color;return t.isFiltered()&&(i=un.addAlpha(i,.2)),i}getVariantStrokecolor(e){const t=e._f||e;let i;return i=this.strokecolor?"function"==typeof this.strokecolor?this.strokecolor(t):this.strokecolor:void 0,i}callContextHook(e,t,i,n,r,s){if(this._context_hook&&"function"==typeof this._context_hook){const o=e._f||e;t.save(),this._context_hook(o,t,i,n,r,s),t.restore()}}clickedFeatures(e){let t=super.clickedFeatures(e);const i="EXPANDED"===this.displayMode?this.expandedVGap:this.squishedVGap,n=i+("SQUISHED"===this.displayMode?this.squishedCallHeight:this.expandedCallHeight),r=e.y;if(r<=this.variantBandHeight){const e="SQUISHED"===this.displayMode?this.squishedVariantHeight:this.expandedVariantHeight,n=Math.floor((r-mF)/(e+i));"COLLAPSED"!==this.displayMode&&(t=t.filter((e=>e.row===n)))}else if(this.sampleKeys){const e=r-this.variantBandHeight,i=Math.floor(e/this.sampleHeight);if(i>=0&&i<this.sampleKeys.length){const r=Math.floor((e-i*this.sampleHeight)/n),s="COLLAPSED"===this.displayMode?t:t.filter((e=>e.row===r)),o=this.sampleKeys[i],a=this.header.sampleNameMap.get(o);t=s.map((e=>{const t=e.calls[a];return t.genotypeString=function(e,t){if(e.genotype){let i="";if("."===t.alternateBases)i="No Call";else{const n=t.alternateBases.split(",");for(let r of e.genotype)if(i.length>0&&(i+=" | "),"."===r)i+=".";else if(0===r)i+=t.referenceBases;else{i+=n[r-1].replace("<","<")}}return i}}(t,e),t}))}}return t}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=this.browser.genome.id;let r=[];for(let e of t){const t=e._f||e;if(r.length>0&&r.push({html:'<hr style="border-top-width:2px ;border-color: #c9c3ba" />'}),"function"==typeof t.popupData){const e=t.popupData(i,n);Array.prototype.push.apply(r,e)}}return r}menuItemList(){const t=[];if(this.header.INFO&&this.header.INFO){const i=this._colorByItems;t.push("<hr/>");const n=e('<div class="igv-track-menu-category igv-track-menu-border-top">');n.textContent="Color by:",t.push({name:void 0,element:n,click:void 0,init:void 0});for(let e of i.keys()){const n=this.colorBy===e;t.push(this.colorByCB({key:e,label:i.get(e)},n))}t.push(this.colorByCB({key:"info",label:"Info field..."}))}if(!0===Xd(this.browser.sampleInfo,this.sampleKeys)){t.push("<hr/>"),t.push("Sort by attribute:");for(const e of this.browser.sampleInfo.attributeNames)if(this.sampleKeys.some((t=>{const i=this.browser.sampleInfo.getAttributes(t);return i&&i[e]}))){const i=document.createElement("div");i.innerHTML=` ${e.split(rd.emptySpaceReplacement).join(" ")}`;const n=()=>{const t=this._sortDirections.get(e)||1;this.sortByAttribute(e,t),this.config.sort={option:"ATTRIBUTE",attribute:e,direction:t>0?"ASC":"DESC"},this._sortDirections.set(e,-1*t)};t.push({element:i,click:n})}}t.push("<hr/>"),this.getSampleCount()>0&&(t.push({element:e('<div class="igv-track-menu-border-top">')}),t.push({element:Ta("Show Genotypes",this.showGenotypes),click:function(){this.showGenotypes=!this.showGenotypes,this.trackView.checkContentHeight(),this.trackView.repaintViews(),this.browser.sampleNameControl.performClickWithState(this.browser,this.showGenotypes),this.browser.sampleInfoControl.performClickWithState(this.browser,this.showGenotypes)}})),t.push({element:e('<div class="igv-track-menu-border-top">')});for(let e of["COLLAPSED","SQUISHED","EXPANDED"]){t.push({element:Ta({COLLAPSED:"Collapse",SQUISHED:"Squish",EXPANDED:"Expand"}[e],e===this.displayMode),click:function(){this.displayMode=e,this.trackView.checkContentHeight(),this.trackView.repaintViews()}})}return this.browser.circularView&&(t.push("<hr>"),t.push({label:"Add SVs to circular view",click:function(){for(let e of this.trackView.viewports)this.sendChordsForViewport(e)}})),this.canCovertToPytor()&&(t.push("<hr>"),t.push({label:"Convert to CNVpytor track",click:function(){this.convertToPytor()}})),t}contextMenuItemList(e){const t=[];if(this.hasSamples()&&this.showGenotypes){const i=e.viewport.referenceFrame,n=e.genomicLocation,r=i.toBP(2.5),s=this._sortDirections.get("genotype")||1;this._sortDirections.set("genotype",-1*s),t.push({label:"Sort by genotype",click:t=>{const i={direction:s,option:"genotype",chr:e.viewport.referenceFrame.chr,start:Math.floor(n-r),end:Math.ceil(n+r)},o=e.viewport.cachedFeatures;this.sortSamplesByGenotype(i,o),this.config.sort=i}}),t.push("<hr/>")}if(this.browser.circularView){const i=e.viewport;t.push({label:"Add SVs to Circular View",click:()=>{this.sendChordsForViewport(i)}}),t.push("<hr/>")}return t}async sortSamplesByGenotype({chr:e,position:t,start:i,end:n,direction:r},s){if(void 0===i&&(i=t-1),void 0===n&&(n=t),s||(s=await this.featureSource.getFeatures({chr:e,start:i,end:n})),!s)return;const o=new Map,a="ASC"===r?1:-1;for(let e of s)if(!(e.end<i)){if(e.start>n)break;for(let t of e.calls){const e=t.sample,i=t.zygosityScore();o.set(e,o.has(e)?o.get(e)+i:i)}}this.sampleKeys.sort((function(e,t){let i=o.get(e)||0,n=o.get(t)||0;return a*(i-n)})),this.trackView.repaintViews()}sortByAttribute(e,t){this.config.sort={option:"ATTRIBUTE",attribute:e,direction:1===t?"ASC":"DESC"},this.sampleKeys=this.browser.sampleInfo.getSortedSampleKeysByAttribute(this.sampleKeys,e,t),this.trackView.repaintViews()}sendChordsForViewport(e){const t=e.referenceFrame;let i;if("all"===t.chr){const e=this.featureSource.getAllFeatures(),t=Object.keys(e).map((t=>e[t]));i=[].concat(...t)}else i=this.featureSource.featureCache.queryFeatures(t.chr,t.start,t.end);Kf(i.filter((e=>{const t=e._f||e;return t.info&&t.info.CHR2&&t.info.END&&(t.info.CHR2!==t.chr||Math.abs(Number.parseInt(t.info.END)-t.pos)>1e6)})).map((e=>{const t=e._f||e,i=Number.parseInt(t.info.END),n=i-100,r=i+100;return{uniqueId:`${t.chr}:${t.start}-${t.end}_${t.info.CHR2}:${t.info.END}`,refName:Wf(t.chr),start:t.start,end:t.end,mate:{refName:Wf(t.info.CHR2),start:n,end:r}}})),this,t,.5)}colorByCB(e,t){const i=Ta(e.label,t);if("info"!==e.key){function n(){const t="none"===e.key?void 0:e.key;this.colorBy=t,this.config.colorBy=t,this.trackView.repaintViews()}return{name:void 0,element:i,click:n,init:void 0}}{function r(e){this.browser.inputDialog.present({label:"Info field",value:"",callback:e=>{e?(this.colorBy=e,this._colorByItems.set(e,e)):this.colorBy=void 0,this.trackView.repaintViews()}},e)}return{name:void 0,element:i,dialog:r,init:void 0}}}getState(){const e=super.getState();return this.color&&"function"!=typeof this.color&&(e.color=this.color),e}getVariantColorTable(e){if(this.colorTables.has(e))return this.colorTables.get(e);if(this.colorTables.has("*"))return this.colorTables.get("*");{let t;if("SVTYPE"===e)t=bF;else t=new Kn("Set1");return this.colorTables.set(e,t),t}}paintAxis(){}canCovertToPytor(){return!this.config.indexURL&&(!!this.header&&(1===Object.keys(this.sampleKeys).length&&this.header.FORMAT&&this.header.FORMAT.AD&&this.header.FORMAT.DP))}async convertToPytor(){this.variantState={...this.config,...this.getState()},this.variantState.trackHeight=this.height,this.trackView.startSpinner(),setTimeout((async()=>{try{const e=Object.assign({},this.config);Object.setPrototypeOf(this,pF.prototype),this.init(e),await this.postInit(),this.trackView.clearCachedFeatures(),this.trackView.setTrackHeight(this.config.height||pF.DEFAULT_TRACK_HEIGHT),this.trackView.checkContentHeight(),this.trackView.updateViews()}finally{this.trackView.stopSpinner()}}),100)}getFilterableAttributes(){return this.header.INFO}_repackCachedFeatures(){for(let e of this.trackView.viewports)if(e.cachedFeatures){const t=this.config.maxRows||Number.MAX_SAFE_INTEGER;Ha(e.cachedFeatures,t,this._filter)}}}const bF=new Yn({DEL:"#ff2101",INS:"#001888",DUP:"#028401",INV:"#008688",CNV:"#8931ff",BND:"#891100","*":"#002eff"}),FF={timeout:5e3,type:"plain",url:"https://igv.org/genomes/locus.php?genome=$GENOME$&name=$FEATURE$",coords:0};async function vF(e,t){const i=e.searchConfig||FF;let n;t=t.toUpperCase();const r=e.tracks.filter((e=>e.searchable));for(let e of r){const i=await e.search(t);if(i)return i}if(e.config&&!1!==e.config.search)try{return n=await async function(e,t,i){let n=i.url.replace("$FEATURE$",t.toUpperCase());n.indexOf("$GENOME$")>-1&&(n=n.replace("$GENOME$",e.genome.id?e.genome.id:"hg19"));const r=i.timeout?{timeout:i.timeout}:void 0,s=await Mn.loadString(n,r);return function(e,t,i){let n;n="plain"===i.type?function(e,t){const i=[],n=v(t);for(let t of n){const n=t.split("\t");if(n.length>=3){const t=n[1].split(":"),r=t[1].split("-");i.push({chromosome:e.genome.getChromosomeName(t[0].trim()),start:parseInt(r[0].replace(/,/g,"")),end:parseInt(r[1].replace(/,/g,"")),name:n[0].toUpperCase()})}}return i}(e,t):JSON.parse(t);i.resultsField&&(n=n[i.resultsField]);if(n&&0!==n.length){const e=i.chromosomeField||"chromosome",t=i.startField||"start",r=i.endField||"end",s=i.coords||1;let o;o=Array.isArray(n)?n[0]:n,o.hasOwnProperty(e)&&o.hasOwnProperty(t)||console.error("Search service results must include chromosome and start fields: "+o);const a=o[e];let c=o[t]-s,l=o[r];void 0===l&&(l=c+1);const h={chr:a,start:c,end:l};if(!o.type||o.type,i.geneField&&i.snpField){const e=o[i.geneField]||o[i.snpField];e&&(h.name=e.toUpperCase())}return h}return}(e,s,i)}(e,t,i),n}catch(e){console.log("Search service not available "+e)}}function yF(e,t=!1){const i=e.split("\t");if(i.length>2)try{const e=i[0],t=parseInt(i[1].replace(/,/g,""),10)-1,n=parseInt(i[2].replace(/,/g,""),10);if(!isNaN(t)&&!isNaN(n))return{chr:e,start:t,end:n}}catch(e){}const n=e.split(":"),r={chr:n[0]};if(n.length>1){let e,i=n[1].split("-");if(i.length>2){if(!n[1].startsWith("-"))return;{const e=n[1].indexOf("-",1);if(e>0){i=[n[1].substring(0,e),n[1].substring(e+1)]}}}if(e=i[0].replace(/,/g,""),isNaN(e))return;if(r.start=parseInt(e,10)-1,r.end=r.start+1,1===i.length&&(r.start-=20,r.end+=20),2===i.length){if(e=i[1].replace(/,/g,""),isNaN(e))return;if(r.end=parseInt(e,10),r.start<0&&!t){const e=-extent.start;r.start+=e,r.end+=e}}}return r}class AF extends Pa{constructor(e,t){super(e,t)}init(e){super.init(e),this.type="qtl",this.name=e.name;const t=e.minLogP||e.min,i=e.maxLogP||e.max;this.dataRange={min:void 0!==t?t:3.5,max:i||25},this.autoscale=!i||e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||2,this.height=e.height||100,this.disableButtons=e.disableButtons,this.featureSource=Hl(e,this.browser.genome)}paintAxis(e,t,i){const n=(this.dataRange.max-this.dataRange.min)/i,r={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};fr.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});const s=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let o=4;o<=this.dataRange.max;o+=s){const s=.85*t,a=s-5,c=s,l=i-(o-this.dataRange.min)/n;fr.strokeLine(e,a,l,c,l,r),l>8&&fr.fillText(e,o,a-1,l+2,r)}r.textAlign="center",fr.fillText(e,"-log10(pvalue)",t/4,i/2,r,{rotate:{angle:-90}})}async getFeatures(e,t,i){const n=this.visibilityWindow;return await this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const{context:t,referenceFrame:i,pixelWidth:n,pixelHeight:r}=e;this.background&&fr.fillRect(t,0,0,n,r,{fillStyle:this.background}),fr.strokeLine(t,0,r-1,n,r-1,{strokeStyle:this.divider}),i.feature&&i.feature.match(/RS[0-9]+/);const s=i=>{const s=i?2*this.dotSize:this.dotSize,o=e.bpStart,a=(this.dataRange.max-this.dataRange.min)/r;for(let d of e.features){const u=(d.start-o+.5)/e.bpPerPixel;if(u<0)continue;if(u>n)break;const f=d.phenotype;let p;if(this.browser.qtlSelections.qtl?(l=this.browser.qtlSelections.qtl,h=d,p=l.chr===h.chr&&l.start===h.start&&l.pValue===h.pValue):p=this.browser.qtlSelections.snps.size>0?this.browser.qtlSelections.hasSnp(d.snp)&&this.browser.qtlSelections.hasPhenotype(f):this.browser.qtlSelections.hasPhenotype(f),!i||p){var c=-Math.log(d.pValue)/Math.LN10;if(c>=this.dataRange.min){let e;c>this.dataRange.max?(c=this.dataRange.max,e=!0):e=!1;const n=Math.max(0+s,r-Math.round((c-this.dataRange.min)/a));let o;d.px=u,d.py=n,d.radius=s,i&&p?(o=this.browser.qtlSelections.colorForGene(f),fr.setProperties(t,{fillStyle:o,strokeStyle:"black"})):(o=e?"rgb(150, 150, 150)":"rgb(180, 180, 180)",fr.setProperties(t,{fillStyle:o,strokeStyle:o})),fr.fillCircle(t,u,n,s),fr.strokeCircle(t,u,n,s)}}}var l,h};s(!1),s(!0)}popupData(e,t){if(void 0===t&&(t=e.viewport.cachedFeatures),!t||0===t.length)return[];const i=this.name,n=[];for(let r of this._clickedFeatures(e,t))n.length>0&&n.push("<hr/>"),"function"==typeof r.popupData?n.push(...r.popupData(e)):n.push({name:"snp id",value:r.snp},{name:"gene id",value:r.gencodeId},{name:"gene name",value:r.geneSymbol},{name:"p value",value:r.pValue},{name:"tissue",value:i});return n}_clickedFeatures(e,t){const i=(e,t)=>Math.sqrt((e.px-t.canvasX)*(e.px-t.canvasX)+(e.py-t.canvasY)*(e.py-t.canvasY)),n=t.filter((t=>i(t,e)<6));if(n.length>1){n.sort(((t,n)=>i(t,e)-i(n,e)));const t=i(n[0],e);return n.filter((n=>i(n,e)<=t))}return n}contextMenuItemList(e){const t=[],i=e.viewport.cachedFeatures;if(i){const n=this._clickedFeatures(e,i);n.length>0&&(t.push({label:"Highlight associated features",click:async()=>{this.browser.qtlSelections.clear();for(let e of n)this.browser.qtlSelections.qtl=e,this.browser.qtlSelections.addPhenotype(e.phenotype);this.browser.repaintViews()}}),t.push("<hr>"))}return t}menuItemList(){const e=[];return e.push(...this.numericDataMenuItems()),e.push("<hr/>"),e.push({label:"Search for...",dialog:function(e){this.browser.inputDialog.present({label:"Search for snp or phenotype",value:"",callback:async e=>{if(e){e=e.trim().toUpperCase();const t=t=>((t.phenotype&&t.phenotype.toUpperCase())===e||t.snp&&t.snp.toUpperCase()===e)&&-Math.log(t.pValue)/Math.LN10>this.dataRange.min;let i,n,r,s=await this.featureSource.findFeatures(t);if(0==s.length){await this.browser.search(e)&&(s=await this.featureSource.findFeatures(t))}if(s.length>0){this.browser.qtlSelections.clear();const t=new Set;i=s[0].chr,n=s[0].start,r=s[0].end;for(let o of s)o.snp&&o.snp.toUpperCase()===e&&this.browser.qtlSelections.addSnp(o.snp),this.browser.qtlSelections.addPhenotype(o.phenotype),t.add(o.phenotype),o.chr===i&&(n=Math.min(n,o.start),r=Math.max(r,o.end));const o=this.browser.genome.getChromosomeName(i);for(let e of t){const t=await vF(this.browser,e);t&&o===this.browser.genome.getChromosomeName(t.chr)&&(n=Math.min(n,t.start),r=Math.max(r,t.end))}const a=Math.floor(.1*(r-n));n=Math.max(0,n-a),r+=a,await this.browser.search(`${i}:${n}-${r}`)}}}},e)}}),e}doAutoscale(e){let t=this.config.max||25;if(e.length>0){const i=e.map((e=>-Math.log(e.pValue)/Math.LN10));i.sort(((e,t)=>e-t));t=i[Math.floor(i.length*(this.autoscalePercentile/100))]}return this.dataRange.max=Math.max(t,10),this.dataRange}}const CF={X:"rgb(204, 153, 0)",Y:"rgb(153, 204, 0)",Un:"darkGray)",1:"rgb(80, 80, 255)",2:"rgb(206, 61, 50)","2a":"rgb(210, 65, 55)","2b":"rgb(215, 70, 60)",3:"rgb(116, 155, 88)",4:"rgb(240, 230, 133)",5:"rgb(70, 105, 131)",6:"rgb(186, 99, 56)",7:"rgb(93, 177, 221)",8:"rgb(128, 34, 104)",9:"rgb(107, 215, 107)",10:"rgb(213, 149, 167)",11:"rgb(146, 72, 34)",12:"rgb(131, 123, 141)",13:"rgb(199, 81, 39)",14:"rgb(213, 143, 92)",15:"rgb(122, 101, 165)",16:"rgb(228, 175, 105)",17:"rgb(59, 27, 83)",18:"rgb(205, 222, 183)",19:"rgb(97, 42, 121)",20:"rgb(174, 31, 99)",21:"rgb(231, 199, 111)",22:"rgb(90, 101, 94)",23:"rgb(204, 153, 0)",24:"rgb(153, 204, 0)",25:"rgb(51, 204, 0)",26:"rgb(0, 204, 51)",27:"rgb(0, 204, 153)",28:"rgb(0, 153, 204)",29:"rgb(10, 71, 255)",30:"rgb(71, 117, 255)",31:"rgb(255, 194, 10)",32:"rgb(255, 209, 71)",33:"rgb(153, 0, 51)",34:"rgb(153, 26, 0)",35:"rgb(153, 102, 0)",36:"rgb(128, 153, 0)",37:"rgb(51, 153, 0)",38:"rgb(0, 153, 26)",39:"rgb(0, 153, 102)",40:"rgb(0, 128, 153)",41:"rgb(0, 51, 153)",42:"rgb(26, 0, 153)",43:"rgb(102, 0, 153)",44:"rgb(153, 0, 128)",45:"rgb(214, 0, 71)",46:"rgb(255, 20, 99)",47:"rgb(0, 214, 143)",48:"rgb(20, 255, 177)"};for(let iy of Object.keys(CF)){CF["chr"+iy]=CF[iy]}for(let ny=1;ny<=48;ny++){if(10===ny)continue;const ry=_F(ny);CF[ry]=CF[ny.toString()]}function _F(e){if(!+e)return!1;for(var t=String(+e).split(""),i=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"],n="",r=3;r--;)n=(i[+t.pop()+10*r]||"")+n;return Array(+t.join("")+1).join("M")+n}class xF extends Pa{constructor(e,t){super(e,t)}init(e){super.init(e),this.useChrColors=void 0===e.useChrColors||e.useChrColors,this.trait=e.trait,this.posteriorProbability=e.posteriorProbability,this.valueProperty="bed"===e.format?"score":"value",this.height=e.height||100,this.autoscale=e.autoscale,this.autoscalePercentile=void 0===e.autoscalePercentile?98:e.autoscalePercentile,this.background=e.background,this.divider=e.divider||"rgb(225,225,225)",this.dotSize=e.dotSize||3,this.popoverWindow=void 0===e.popoverWindow?1e8:e.popoverWindow,this.useChrColors?this.colorScale=new Yn(e.colorTable||CF):e.color?this.colorScale=new wl(e.color):this.colorScale=new pl(e.colorScale||{thresholds:[5e-8,5e-4,.5],colors:["rgb(255,50,50)","rgb(251,100,100)","rgb(251,170,170)","rgb(227,238,249)"]}),this.featureSource=Hl(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),this.autoscale||(this.posteriorProbability?this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?1:this.config.max}:this.dataRange={min:void 0===this.config.min?0:this.config.min,max:void 0===this.config.max?25:this.config.max}),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor,this}get supportsWholeGenome(){return!0}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.features,i=e.context,n=e.pixelWidth,r=e.pixelHeight;if(this.background&&fr.fillRect(i,0,0,n,r,{fillStyle:this.background}),fr.strokeLine(i,0,r-1,n,r-1,{strokeStyle:this.divider}),t){const s=e.bpPerPixel,o=e.bpStart,a=o+n*s+1;for(let e of t){const t=e.start;if(t<o)continue;if(t>a)break;let n;if(this.posteriorProbability)n=e[this.valueProperty];else{const t=e[this.valueProperty];if(!t)continue;n=-Math.log10(t)}const c=this.useChrColors?e._f?e._f.chr:e.chr:n,l=this.colorScale.getColor(c),h=(this.dataRange.max-this.dataRange.min)/r,d=Math.round((t-o)/s),u=Math.max(this.dotSize,r-Math.round((n-this.dataRange.min)/h));l&&fr.setProperties(i,{fillStyle:l,strokeStyle:"black"}),fr.fillCircle(i,d,u,this.dotSize),e.px=d,e.py=u}}}paintAxis(e,t,i){fr.fillRect(e,0,0,t,i,{fillStyle:"rgb(255, 255, 255)"});var n={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};const r=(this.dataRange.max-this.dataRange.min)/i;if(this.posteriorProbability){const t=.1;for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);fr.strokeLine(e,45,t-2,50,t-2,n),fr.fillText(e,s.toFixed(1),44,t+2,n)}}else{const t=Math.ceil(10*(this.dataRange.max-this.dataRange.min)/i);for(let s=this.dataRange.min;s<this.dataRange.max;s+=t){const t=i-Math.round((s-this.dataRange.min)/r);fr.strokeLine(e,45,t,50,t,n),fr.fillText(e,Math.floor(s),44,t+4,n)}}n.textAlign="center",this.posteriorProbability?fr.fillText(e,"PPA",t/2,i/2,n,{rotate:{angle:-90}}):fr.fillText(e,"-log10(pvalue)",t/2,i/2,n,{rotate:{angle:-90}})}popupData(e,t){void 0===t&&(t=e.viewport.cachedFeatures);let i=[];const n=e.viewport.trackView.track;if(t){let r=0;for(let s of t){const t=Math.abs(e.canvasX-s.px),o=Math.abs(e.canvasY-s.py);if(t<this.dotSize&&o<this.dotSize){if(r>0&&i.push("<HR/>"),5==r){i.push("...");break}if(s=s._f||s,"function"==typeof s.popupData)i=i.concat(s.popupData());else{const e=s[this.valueProperty],t=s.chr,r=F(s.start+1);i.push({name:"chromosome",value:t}),i.push({name:"position",value:r}),i.push({name:"name",value:s.name}),n.posteriorProbability?i.push({name:"posterior probability",value:e}):i.push({name:"pValue",value:e})}r++}}}return i}menuItemList(){return this.numericDataMenuItems()}doAutoscale(e){if(e.length>0){const t=this.valueProperty,i=this.posteriorProbability,n=e.map((function(e){const n=e[t];return{value:i?n:-Math.log(n)/Math.LN10}}));this.dataRange=Gs(n)}else this.posteriorProbability?this.dataRange={min:this.config.min||0,max:this.config.max||1}:this.dataRange={min:this.config.max||25,max:this.config.min||0};return this.dataRange}}class kF extends Pa{constructor(e,t){super(e,t)}init(e){super.init(e),this.autoscale=e.autoscale||void 0===e.max,this.dataRange={min:e.min||0,max:e.max},this.windowFunction=e.windowFunction||"mean",this.paintAxis=hl,this.graphType=e.graphType||"bar",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=Hl(this.config,this.browser.genome),this.visibilityWindow=-1,this.featureSource.visibilityWindow=this.visibilityWindow}async postInit(){if("function"==typeof this.featureSource.getHeader){if(this.header=await this.featureSource.getHeader(),this.disposed)return;if(this.sampleKeys=this.header.columnNames.slice(3),this.setTrackProperties(this.header),this.header.hasOwnProperty("clickToHighlight")){let e=this.header.clickToHighlight;this.config.clickToHighlight=e,this.config.samplesClickedToHighlight={}}if(this.header.hasOwnProperty("onlyHandleClicksForHighlightedSamples")&&(this.config.onlyHandleClicksForHighlightedSamples=!0),this.header.hasOwnProperty("highlight")){this.config.highlightSamples={};let e=this.header.highlight;Array.isArray(e)||(e=[e]);for(let t of e){const e=t.split(";");2===e.length&&(this.config.highlightSamples[e[0]]=e[1])}}}this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor}menuItemList(){return this.numericDataMenuItems()}async getFeatures(e,t,i){const n=await this.featureSource.getFeatures({chr:e,start:0,end:Number.MAX_SAFE_INTEGER,visibilityWindow:this.visibilityWindow});let r,s;for(let e=1;e<n.length-1;e++)if(void 0===r&&n[e].end>t&&(r=e-1),void 0===s&&n[e].start>i){s=e+1;break}return void 0===r&&(r=0),void 0===s&&(s=n.length),n.slice(r,s)}draw(e){const{features:t,context:i,bpPerPixel:n,bpStart:r,pixelWidth:s,pixelHeight:o}=e,a=e=>(this.dataRange.max-e)/(this.dataRange.max-this.dataRange.min)*o,c=function(e){let t=Math.floor((e-r)/n);return isNaN(t)&&console.warn("isNaN(x). feature start "+F(e)+" bp start "+F(r)),t};if(t&&t.length>0&&(void 0===this.dataRange.min&&(this.dataRange.min=0),this.dataRange.max>this.dataRange.min)){const e=this.config.highlightSamples,n=this.config.onlyHandleClicksForHighlightedSamples,r=this.config.clickToHighlight;let s=-1,o={},l=[],h=[];this.clickDetectorCache={};for(let d of t){const t=c(d.start),u=c(d.end),f=s>=0?c(s):t;if(!isNaN(t)&&!isNaN(u)){this.clickDetectorCache[t]=[],this.clickDetectorCache[u]=[];for(let s=0;s<d.values.length;s++){const c=this.sampleKeys[s],p=d.values[s],g=a(p);if(t-f>=1){const s=o[c],h=a(s),d=e&&e[c];d?l.push([f,h,t,g,d]):r&&c in this.config.samplesClickedToHighlight?l.push([f,h,t,g,this.config.samplesClickedToHighlight[c]]):fr.strokeLine(i,f,h,t,g,{strokeStyle:"#D9D9D9"}),n&&!(c in e)||this.clickDetectorCache[t].push([f,h,t,g,c,d||"gray"])}if(u-t>=1){const s=e&&e[c];s?h.push([t,g,u,g,s]):r&&c in this.config.samplesClickedToHighlight?h.push([t,g,u,g,this.config.samplesClickedToHighlight[c]]):fr.strokeLine(i,t,g,u,g,{strokeStyle:"gray"}),n&&!(c in e)||this.clickDetectorCache[u].push([t,g,u,g,c,s||"gray"])}o[c]=p}s=d.end}}for(let e of l)fr.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:1.3});for(let e of h)fr.strokeLine(i,e[0],e[1],e[2],e[3],{strokeStyle:e[4],lineWidth:2})}(e=>{if(this.config.hasOwnProperty("guideLines"))for(let t of this.config.guideLines)if(t.hasOwnProperty("color")&&t.hasOwnProperty("y")&&t.hasOwnProperty("dotted")){let i=a(t.y),n={strokeStyle:t.color,strokeWidth:2};t.dotted?fr.dashedLine(e.context,0,i,e.pixelWidth,i,5,n):fr.strokeLine(e.context,0,i,e.pixelWidth,i,n)}})(e)}doAutoscale(e){let t,i;return e.length>0?(t=Number.MAX_VALUE,i=-Number.MAX_VALUE,e.forEach((function(e){t=Math.min(t,...e.values),i=Math.max(i,...e.values)})),t-=.01,i+=.01):(t=0,i=100),{min:t,max:i}}clickedFeatures(e){const t=e.canvasX,i=e.canvasY;let n=null;for(n of Object.keys(this.clickDetectorCache))if(n=parseInt(n),n>=t)break;if(n){let e=Number.MAX_VALUE,o=[];const a=this.clickDetectorCache[n];for(let n of a){const r=n[0],s=n[2];if(t<r||t>s)return[];const a=n[1],c=n[3];if(i<Math.min(a,c)-10||i>Math.max(a,c)+10)continue;const l=IF(t,i,r,a,s,c);l<e&&(o=[{name:n[4],color:n[5]}],e=l)}if(e<5){if(this.config.clickToHighlight){if(o[0].name in this.config.samplesClickedToHighlight)delete this.config.samplesClickedToHighlight[o[0].name];else if("any"===this.config.clickToHighlight){var r=["red","darkblue","green","teal","olivedrab","orange","maroon","purple","blue","gold"],s=r[Math.floor(Math.random()*(r.length+1))];this.config.samplesClickedToHighlight[o[0].name]=s}else this.config.samplesClickedToHighlight[o[0].name]=this.config.clickToHighlight;this.trackView.repaintViews()}return o}}return[]}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];return t.forEach((function(e){for(let t of Object.keys(e))Us(e[t])&&i.push({name:t,value:e[t]})})),i}get supportsWholeGenome(){return!1}}function IF(e,t,i,n,r,s){const o=r-i,a=s-n,c=Math.abs(o*(n-t)-(i-e)*a),l=Math.sqrt(o*o+a*a);return l>0?c/l:0}class SF extends Pa{static defaults={height:300,theta:Math.PI/2,arcOrientation:"UP"};constructor(e,t){super(e,t),!1===e.arcOrientation?this.arcOrientation="DOWN":!0===e.arcOrientation?this.arcOrientation="UP":e.arcOrientation?this.arcOrientation=e.arcOrientation.toUpperCase():this.arcOrientation="UP","bp"===e.format?this.featureSource=new NF(e,t.genome):this.featureSource=new Sl(e,t.genome)}async getFeatures(e,t,i){const n=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,visibilityWindow:n})}draw(e){const t=e.context,i=Math.PI/2,n=e.pixelWidth,r=e.pixelHeight;e.viewportWidth;const s=e.bpPerPixel,o=e.bpStart,a=s,c="UP"===this.arcOrientation;fr.fillRect(t,0,e.pixelTop,n,r,{fillStyle:"rgb(255, 255, 255)"});const l=e.features;if(l){EF(l,1);for(let e of l)if(e.startLeft){let n=Math.round((e.startLeft-o)/a),r=Math.round((e.startRight-o)/a),s=Math.round((e.endLeft-o)/a),l=Math.round((e.endRight-o)/a);t.fillStyle=e.color,t.strokeStyle=e.color,t.beginPath();let h=(n+l)/2,d=(l-n)/2,u=this.height,f=Math.PI+(Math.PI/2-i),p=2*Math.PI-(Math.PI/2-i);c?(t.arc(h,u,d,f,p),t.lineTo(s,u)):(u=0,t.arc(h,u,d,p,f),t.lineTo(l,u));const g=(r+s)/2,m=(s-r)/2,w=u;c?(t.arc(g,w,m,p,f,!0),t.lineTo(n,w)):(t.arc(g,w,m,f,p,!0),t.lineTo(s,w)),t.stroke(),t.fill(),e.drawState={x1:h,y1:u,r1:d,x2:g,y2:w,r2:m,sa:f,ea:p}}else{let n=Math.round((e.start-o)/a),r=Math.round((e.end-o)/a);t.strokeStyle=e.color,t.beginPath();let s=(n+r)/2,l=(r-n)/2,h=this.height,d=Math.PI+(Math.PI/2-i),u=2*Math.PI-(Math.PI/2-i);c?t.arc(s,h,l,d,u):(h=0,t.arc(s,h,l,u,d)),t.stroke(),e.drawState={x1:s,y1:h,r1:l,sa:d,ea:u}}}}clickedFeatures(e){const t=super.clickedFeatures(e),i=[];EF(t,-1);for(let n of t){const t=n.drawState,r=e.canvasX-t.x1,s=e.canvasY-t.y1,o=Math.sqrt(r*r+s*s),a=t.r1+3;let c,l;if(void 0===t.x2)c=o,l=t.r1-3;else{const i=e.canvasX-t.x2,n=e.canvasY-t.y2;c=Math.sqrt(i*i+n*n),l=t.r2-3}if(o<a&&c>l){i.push(n);break}}return i}popupData(e,t){if(void 0===t&&(t=this.clickedFeatures(e)),t&&t.length>0)return this.extractPopupData(t[0],this.getGenomeId())}menuItemList(){return[{name:"Toggle arc direction",click:function(){this.arcOrientation="UP"===this.arcOrientation?"DOWN":"UP",this.trackView.repaintViews()}}]}}function EF(e,t){e.sort((function(e,i){const n=void 0===e.score?-Number.MAX_VALUE:e.score,r=void 0===i.score?-Number.MAX_VALUE:i.score;return(void 0===t?1:t)*(n-r)}))}class NF{constructor(e,t){this.config=e,this.genome=t}async getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r}){const s=this.genome;if(this.featureCache)return this.featureCache.queryFeatures(e,t,i);{const n=js(this.config),r=await Mn.loadByteArray(this.config.url,n);return this.featureCache=new On(function(e){if(!e)return null;const t=wc(e);let i,n=!0;const r=[],s=[],o=[];for(;void 0!==(i=t.nextLine());){const e=i.split("\t");if(n&&i.startsWith("color:")){const t="rgb("+e[1]+","+e[2]+","+e[3]+")";r.push(t),e.length>4&&s.push(e[4])}else{n=!1;const t=e[0],i=Number.parseInt(e[1])-1,c=Number.parseInt(e[2])-1,l=Number.parseInt(e[3]),h=Number.parseInt(e[4]);var a=Number.parseInt(e[5]);const d=r[a];let u;u=i<=h?{chr:t,startLeft:Math.min(i,c),startRight:Math.max(i,c),endLeft:Math.min(l,h),endRight:Math.max(l,h),color:d,score:a}:{chr:t,startLeft:Math.min(l,h),startRight:Math.max(l,h),endLeft:Math.min(i,c),endRight:Math.max(i,c),color:d,score:a},u.start=u.startLeft,u.end=u.endRight,s.length>a&&(u.description=s[a]),o.push(u)}}return o}(r),s),this.featureCache.queryFeatures(e,t,i)}}}class MF{constructor(e){this.browser=e,this.type="ideogram",this.id="ideogram",this.height=e.config.showCytobandNames?20:16,this.order=Number.MIN_SAFE_INTEGER,this.disableButtons=!0,this.ignoreTrackMenu=!0,this.showCytobandNames=e.config.showCytobandNames}computePixelHeight(e){return this.height}draw({context:e,referenceFrame:t,pixelWidth:i,pixelHeight:n,features:r}){const s=t.chr,o=t.genome.getChromosome(s);if(void 0===o||i<=0||n<=0||"all"===s.toLowerCase())return;!function({ctx:e,chr:t,referenceFrame:i,genome:n,width:r,height:s,stainColors:o,features:a,showCytobandNames:c}){const l=1,h=.5*l,d=0;if(void 0===n)return;fr.fillRect(e,0,0,r,s,{fillStyle:un.greyScale(255)});const u=a;if(u){const t=d+s/2,i=[],n=[];if(0===u.length)return;const a=r/u[u.length-1].end;e.beginPath(),fr.roundRect(e,h,h+d,r-2*h,s-2*h,(s-2*h)/2,0,1),e.clip();for(let r=0;r<u.length;r++){const h=u[r],f=a*h.start,p=a*h.end;if("c"===h.type)"p"===h.name.charAt(0)?(i[0]=f,n[0]=s+d,i[1]=f,n[1]=d,i[2]=p,n[2]=t):(i[0]=p,n[0]=s+d,i[1]=p,n[1]=d,i[2]=f,n[2]=t),e.fillStyle="rgb(150, 0, 0)",e.strokeStyle="rgb(150, 0, 0)",fr.polygon(e,i,n,1,0);else{const t=BF(o,h);e.fillStyle=t.color,fr.fillRect(e,f,l+d,p-f,s-2*l),c&&RF(e,h.name,f,p,d,s,t.shade)}}}e.strokeStyle=un.greyScale(41),fr.roundRect(e,h,h+d,r-2*h,s-2*h,(s-2*h)/2,0,1)}({ctx:e,features:r,chr:s,referenceFrame:t,genome:t.genome,width:i,height:n,stainColors:[],showCytobandNames:this.showCytobandNames});const a=Math.round(t.bpPerPixel*i),c=t.start;let l=o.bpLength;const h=t.genome.getCytobands(s);if(h&&h.length>0&&h[h.length-1].end&&(l=Math.max(l,h[h.length-1].end),o.bpLength=l),a<l){const t=a/l,r=c/l;let s=Math.floor(r*i),o=Math.floor(t*i);s=Math.max(0,s),s=Math.min(i-o,s),e.save(),e.strokeStyle="red",e.lineWidth=o<2?1:2;const h=s+e.lineWidth/2;o=o<2?1:o-e.lineWidth;const d=e.lineWidth/2,u=n-e.lineWidth;e.strokeRect(h,d,o,u),e.restore()}}dispose(){this.trackView=void 0}}function RF(e,t,i,n,r,s,o){const a=s-4,c=n-i;let l=a-4;do{e.font=`${l}px sans-serif`;if(e.measureText(t).width<=c)break;l-=1}while(l>4);e.save(),e.beginPath(),e.rect(i,2+r,c,a),e.clip();const h=i+c/2,d=2+r+a/2+1;let u;u=null!==o?.2126*o+.7152*o+.0722*o:39.764;const f=u<128?"white":"black";fr.fillText(e,t,h,d,{fillStyle:f,textAlign:"center",textBaseline:"middle",font:`${l}px sans-serif`}),e.restore()}function BF(e,t){if("c"===t.type)return{color:"rgb(150, 10, 10)",shade:null};{let n=t.stain,r=230;"p"===t.type&&(r=Math.floor(230-n/100*230));var i=e[r];return i||(i="rgb("+r+","+r+","+r+")",e[r]=i),{color:i,shade:r}}}let DF=new Kn("Dark2");["GT/AG","CT/AC","GC/AG","CT/GC","AT/AC","GT/AT","non-canonical"].forEach((e=>{DF.getColor(e)}));class TF extends Pa{static defaults={margin:10,colorByNumReadsThreshold:5,height:100};constructor(e,t){super(e,t)}init(e){super.init(e),this.type=e.type||"junctions",e._featureSource?(this.featureSource=e._featureSource,delete e._featureSource):this.featureSource=e.featureSource?e.featureSource:Hl(e,this.browser.genome)}async postInit(){if("function"!=typeof this.featureSource.getHeader||(this.header=await this.featureSource.getHeader(),!this.disposed))return this.header&&this.setTrackProperties(this.header),void 0===this.visibilityWindow&&"function"==typeof this.featureSource.defaultVisibilityWindow&&(this.visibilityWindow=await this.featureSource.defaultVisibilityWindow()),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor,this}get supportsWholeGenome(){return!1}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}computePixelHeight(e){return this.height}draw(e){const t=e.features,i=e.context,n=e.bpPerPixel,r=e.bpStart,s=e.pixelWidth,o=e.pixelHeight,a=r+s*n+1;if(this.isMergedTrack||fr.fillRect(i,0,e.pixelTop,s,o,{fillStyle:"rgb(255, 255, 255)"}),t){const s={};s.referenceFrame=e.viewport.referenceFrame,s.referenceFrameStart=s.referenceFrame.start,s.referenceFrameEnd=s.referenceFrameStart+s.referenceFrame.toBP(e.viewport.getWidth()),s.featureZoomOutTracker={};for(let e of t)if(!(e.end<r)){if(e.start>a)break;this.renderJunction(e,r,n,o,i,s)}}else console.log("No feature list")}renderJunction(e,t,i,n,r,s){e.isVisible=!1;const o=Math.round((e.start-t)/i),a=Math.round((e.end-t)/i),c=(o+a)/2;if(a-o<=3){if(c in s.featureZoomOutTracker)return;s.featureZoomOutTracker[c]=!0}if(this.config.hideAnnotatedJunctions&&"true"===e.attributes.annotated_junction)return;if(this.config.hideUnannotatedJunctions&&"false"===e.attributes.annotated_junction)return;if(this.config.hideMotifs&&this.config.hideMotifs.includes(e.attributes.motif))return;if(this.config.hideStrand===e.strand)return;if(this.config.minJunctionEndsVisible){let t=0;if(e.start>=s.referenceFrameStart&&e.start<=s.referenceFrameEnd&&(t+=1),e.end>=s.referenceFrameStart&&e.end<=s.referenceFrameEnd&&(t+=1),t<this.config.minJunctionEndsVisible)return}let l,h,d,u;if(e.attributes.uniquely_mapped){if(l=parseInt(e.attributes.uniquely_mapped),l<this.config.minUniquelyMappedReads)return;if(h=parseInt(e.attributes.multi_mapped),d=l+h,d<this.config.minTotalReads)return;if(d>0&&h/d>this.config.maxFractionMultiMappedReads)return;if(e.attributes.maximum_spliced_alignment_overhang&&parseInt(e.attributes.maximum_spliced_alignment_overhang)<this.config.minSplicedAlignmentOverhang)return}if(e.attributes.num_samples_with_this_junction){if(u=parseInt(e.attributes.num_samples_with_this_junction),this.config.minSamplesWithThisJunction&&u<this.config.minSamplesWithThisJunction)return;if(this.config.maxSamplesWithThisJunction&&u>this.config.maxSamplesWithThisJunction)return;if(e.attributes.num_samples_total&&(e.attributes.percent_samples_with_this_junction=100*u/Number(e.attributes.num_samples_total),this.config.minPercentSamplesWithThisJunction&&(e.attributes.percent_samples_with_this_junction<this.config.minPercentSamplesWithThisJunction||e.attributes.percent_samples_with_this_junction>this.config.maxPercentSamplesWithThisJunction)))return}const f=this.margin,p=n,g=f+.5*p;let m=f;const w=f+p-10,b=(o+c)/2,F=(c+a)/2;let v,y,A=1;e.attributes.line_width?A=Number(e.attributes.line_width):(void 0===this.config.thicknessBasedOn||"numUniqueReads"===this.config.thicknessBasedOn?A=l:"numReads"===this.config.thicknessBasedOn?A=d:"numSamplesWithThisJunction"===this.config.thicknessBasedOn&&void 0!==u&&(A=u),A=1+Math.log(A+1)/Math.log(12)),void 0===this.config.bounceHeightBasedOn||"random"===this.config.bounceHeightBasedOn?v=(e.start+e.end)%7:"distance"===this.config.bounceHeightBasedOn?v=6*(e.end-e.start)/(s.referenceFrameEnd-s.referenceFrameStart):"thickness"===this.config.bounceHeightBasedOn&&(v=2*A),m+=p*Math.max(7-v,0)/10,y=e.attributes.color?e.attributes.color:void 0===this.config.colorBy||"numUniqueReads"===this.config.colorBy?l>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"numReads"===this.config.colorBy?d>this.config.colorByNumReadsThreshold?"blue":"#AAAAAA":"isAnnotatedJunction"===this.config.colorBy?"true"===e.attributes.annotated_junction?"#b0b0ec":"orange":"strand"===this.config.colorBy?"+"===e.strand?"#b0b0ec":"#ecb0b0":"motif"===this.config.colorBy?DF.getColor(e.attributes.motif):"#AAAAAA";let C="";e.attributes.label?C=e.attributes.label.replace(/_/g," "):void 0===this.config.labelWith||"uniqueReadCount"===this.config.labelWith?C=l:"totalReadCount"===this.config.labelWith?C=d:"numSamplesWithThisJunction"===this.config.labelWith?void 0!==u&&(C=u):"percentSamplesWithThisJunction"===this.config.labelWith?void 0!==e.attributes.percent_samples_with_this_junction&&(C=e.attributes.percent_samples_with_this_junction.toFixed(0)+"%"):"motif"===this.config.labelWith&&void 0!==e.attributes.motif&&(C+=e.attributes.motif),"uniqueReadCount"===this.config.labelWithInParen?C+=" ("+l+")":"totalReadCount"===this.config.labelWithInParen?C+=" ("+d+")":"multiMappedReadCount"===this.config.labelWithInParen?h>0&&(C+=" (+"+h+")"):"numSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==u&&(C+=" ("+u+")"):"percentSamplesWithThisJunction"===this.config.labelWithInParen?void 0!==e.attributes.percent_samples_with_this_junction&&(C+=" ("+e.attributes.percent_samples_with_this_junction.toFixed(0)+"%)"):"motif"===this.config.labelWithInParen&&void 0!==e.attributes.motif&&(C+=` ${e.attributes.motif}`),e.isVisible=!0,r.beginPath(),r.moveTo(o,w),r.bezierCurveTo(b,m,F,m,a,w),r.lineWidth=A,r.strokeStyle=y,r.stroke();const _=(e,t,i,n)=>{e.beginPath(),e.moveTo(t,i),e.lineTo(t-n/2,i-n),e.lineTo(t+n/2,i-n),e.lineTo(t,i),e.closePath(),e.fill()};if(e.attributes.left_shape||e.attributes.right_shape){r.fillStyle=y;const t=r.lineWidth>2?10:7;e.attributes.left_shape&&_(r,o,w,t),e.attributes.right_shape&&_(r,a,w,t)}r.fillText(C,c-r.measureText(C).width/2,(7*m+g)/8)}clickedFeatures(e){return super.clickedFeatures(e).filter((function(e){return e.isVisible&&e.attributes}))}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=e.genomicLocation,n=[];for(let e of t){const t="function"==typeof e.popupData?e.popupData(i):this.extractPopupData(e._f||e,this.getGenomeId());t&&(n.length>0&&n.push("<hr/><hr/>"),Array.prototype.push.apply(n,t))}return n}dispose(){this.trackView=void 0}}const zF={min:0,max:3e3,color:"rgb(0,0,255)"};class LF{constructor(e){e=e||zF,this.max=e.max,this.min=e.min||0,this.cache=[],this.nbins=1e3,this.binsize=(this.max-this.min)/this.nbins,this.updateColor(e.color||"rgb(0,0,255)"),this.br=255,this.bg=255,this.bb=255}updateColor(e){const t=e.substring(4).replace(")","").split(",");3===t.length&&(this.r=Number.parseInt(t[0].trim()),this.g=Number.parseInt(t[1].trim()),this.b=Number.parseInt(t[2].trim())),this.cache=[]}setMinMax(e,t){this.min=e,this.max=t,this.cache=[],this.binsize=(this.max-this.min)/this.nbins}getColor(e){if(e<=this.min)return"white";if(e>=this.max)return`rgb(${this.r},${this.g},${this.b})`;const t=Math.floor((Math.min(this.max,e)-this.min)/this.binsize);if(void 0===this.cache[t]){const i=(e-this.min)/(this.max-this.min),n=1-i;this.cache[t]=`rgb(${Math.floor(i*this.r+n*this.br)},${Math.floor(i*this.g+n*this.bg)},${Math.floor(i*this.b+n*this.bb)})`}return this.cache[t]}toJson(){return{min:this.min,max:this.max,color:`rgb(${this.r},${this.g},${this.b})`}}static parse(e){const t=e.split(","),i={min:Number.parseFloat(t[0]),max:Number.parseFloat(t[1]),color:`${t[2]},${t[3]},${t[4]}`};return new LF(i)}}class HF extends Pa{static defaults={height:300,rowHeight:3,min:.5,max:3,scale:1,visibilityWindow:1e4,supportHiDPI:!1,startSize:4,stepSize:2};constructor(e,t){super(e,t)}init(e){super.init(e),this.type="shoebox",e.max&&(this.dataRange={min:e.min||0,max:e.max});const t=Object.assign({},this.config);t.format="shoebox",this.featureSource=Hl(t,this.browser.genome)}async postInit(){if("function"==typeof this.featureSource.getHeader&&(this.header=await this.featureSource.getHeader(),this.disposed))return;this.header&&(this.header.scale&&(this.header.scale=Number.parseFloat(this.header.scale)),this.setTrackProperties(this.header),this.rowCount=this.header.firstFeature?this.header.firstFeature.values.length:100);const e=this.dataRange.min,t=this.dataRange.max;this.colorScale=new LF({min:e,max:t,color:this.color}),this.scale||(this.scale=1),this._initialColor=this.color||this.constructor.defaultColor,this._initialAltColor=this.altColor||this.constructor.defaultColor}get color(){return this._color||"rgb(0,0,255)"}set color(e){this._color=e,this.colorScale&&this.colorScale.updateColor(e)}menuItemList(){const e=[];e.push("<hr/>");let t=document.createElement("div");t.textContent="Set row height";const i=this.browser;return e.push({element:t,dialog:function(e){const t={label:"Row Height",value:this.rowHeight,callback:()=>{const e=parseInt(this.browser.inputDialog.value,10);if(void 0!==e){i.sampleNameViewportWidth=void 0;const t=[];this.trackView.track.selected?t.push(...this.trackView.browser.getSelectedTrackViews().map((({track:e})=>e))):t.push(this);for(const i of t)i.rowHeight=e,i.rowHeight*i.rowCount<i.height&&i.trackView.setTrackHeight(i.rowHeight*i.rowCount,!0),i.trackView.checkContentHeight(),i.trackView.repaintViews()}}};this.browser.inputDialog.present(t,e)}}),e.push("<hr/>"),t=document.createElement("div"),t.textContent="Set data range",e.push({element:t,dialog:function(){this.trackView.track.selected?this.browser.dataRangeDialog.configure(this.trackView.browser.getSelectedTrackViews()):this.browser.dataRangeDialog.configure(this.trackView),this.browser.dataRangeDialog.present(this.browser.columnContainer)}}),e}setDataRange({min:e,max:t}){this.dataRange.min=e,this.dataRange.max=t,this.colorScale.setMinMax(e,t),this.trackView.repaintViews()}async getFeatures(e,t,i,n){const r=this.visibilityWindow;return await this.featureSource.getFeatures({chr:e,start:t,end:i,bpPerPixel:n,visibilityWindow:r})}draw({context:e,pixelTop:t,pixelWidth:i,pixelHeight:n,features:r,bpPerPixel:s,bpStart:o}){if(fr.fillRect(e,0,t,i,n,{fillStyle:"rgb(255, 255, 255)"}),r&&r.length>0){const a=this.rowHeight,c=t+n,l=o+i*s+1,h=a;for(let i of r){if(i.end<o||i.start>l)continue;const n=Math.floor((i.start-o)/s),r=Math.floor((i.end-o)/s),d=Math.max(1,r-n);for(let r=i.values.length-1;r>=0;r--){const s=i.values[r];if(s>=this.dataRange.min){const o=(i.values.length-1-r)*a;if(o+a<t||o>c)continue;const l=this.colorScale.getColor(s);e.fillStyle=l,e.fillRect(n,o,d,h)}}}}}paintAxis(e,t,i){var n={font:"normal 10px Arial",textAlign:"right",strokeStyle:"black"};const r=this.startSize+this.rowCount*this.stepSize,s=this.startSize,o=(r-s)/i;for(let t=50;t<=r;t+=50){const r=Math.max(10,i-Math.round((t-s)/o));fr.strokeLine(e,35,r,40,r,n),t>s&&fr.fillText(e,PF(t),30,r+4,n)}n.textAlign="center",n.font="normal 10px Arial",fr.fillText(e,"Footprint size (bp)",10,i/2,n,{rotate:{angle:-90}})}computePixelHeight(e){return e&&0!==e.length?e[0].values.length*this.rowHeight:0}clickedFeatures(e){const t=super.clickedFeatures(e),i=e.y;return t.filter((function(e){const t=e.pixelRect;return t&&i>=t.y&&i<=t.y+t.h}))}hoverText(e){const t=this.clickedFeatures(e);if(t&&t.length>0)return`${t[0].sample}: ${t[0].value}`}popupData(e,t){void 0===t&&(t=this.clickedFeatures(e));const i=[];for(let e of t){i.length>0&&(i.push("<hr/>"),i.push("<hr/>"));const t=e._f||e,n="function"==typeof t.popupData?t.popupData(this.type,this.browser.genome.id):this.extractPopupData(t);Array.prototype.push.apply(i,n)}return i}get supportsWholeGenome(){return!1}getState(){const e=super.getState();return e.colorScale=this.colorScale.toJson(),e}}function PF(e){return Number.isInteger(e)||e%1==0?e:Math.abs(e)>=10?e.toFixed():Math.abs(e)>=1?e.toFixed(1):Math.abs(e)>=.1?e.toFixed(2):e.toExponential(1)}const OF=new Map([["ideogram",(e,t)=>new MF(e,t)],["sequence",(e,t)=>new fh(e,t)],["feature",(e,t)=>new eh(e,t)],["seg",(e,t)=>new Zd(e,t)],["mut",(e,t)=>new Zd(e,t)],["maf",(e,t)=>new Zd(e,t)],["shoebox",(e,t)=>new HF(e,t)],["wig",(e,t)=>new xl(e,t)],["merged",(e,t)=>new bd(e,t)],["alignment",(e,t)=>new dp(e,t)],["interaction",(e,t)=>new fp(e,t)],["interact",(e,t)=>new fp(e,t)],["variant",(e,t)=>new wF(e,t)],["qtl",(e,t)=>new AF(e,t)],["eqtl",(e,t)=>new AF(e,t)],["gwas",(e,t)=>new xF(e,t)],["arc",(e,t)=>new SF(e,t)],["gcnv",(e,t)=>new kF(e,t)],["junction",(e,t)=>new TF(e,t)],["blat",(e,t)=>new sh(e,t)],["cnvpytor",(e,t)=>new pF(e,t)]]);class VF{constructor(e,t){const i=(new DOMParser).parseFromString(e,"text/xml");this.processRootNode(i,t);const n=i.getElementsByTagName("Resource"),r=i.getElementsByTagName("Track"),s=r&&r.length>0,o=[];this.tracks=o;const a=new Map;Array.from(n).forEach((function(e,t){var i={url:e.getAttribute("path"),indexURL:e.getAttribute("index"),order:t};a.set(i.url,i),s||o.push(i)})),s&&Array.from(r).forEach((function(e){const t=e.getElementsByTagName("Track");if(t&&t.length>0){const i={type:"merged",tracks:[]};qF(e,i),o.push(i),Array.from(t).forEach((function(e){e.processed=!0;const t=e.getAttribute("id"),n=a.get(t);n&&(i.tracks.push(n),qF(e,n),n.autoscale=!1,i.height=n.height)}))}else if(!e.processed){const t=e.getAttribute("id"),i=a.get(t);i&&(o.push(i),qF(e,i))}}))}processRootNode(e,t){const i=e.getElementsByTagName("Session");!i||i.length;const n=i.item(0),r=n.getAttribute("genome"),s=n.getAttribute("locus"),o=n.getAttribute("ucscID");t&&t.hasOwnProperty(r)?this.genome=r:(this.reference={fastaURL:r},o&&(this.reference.id=o)),s&&(this.locus=s)}}function qF(e,t){t.name=e.getAttribute("name");const i=e.getAttribute("color");i&&(t.color="rgb("+i+")");const n=e.getAttribute("altColor");i&&(t.altColor="rgb("+n+")");const r=e.getAttribute("height");r&&(t.height=parseInt(r));const s=e.getAttribute("autoScale");s&&(t.autoscale="true"===s);const o=e.getAttribute("autoscaleGroup");o&&(t.autoscaleGroup=o);const a=e.getAttribute("windowFunction");a&&(t.windowFunction=a);const c=e.getAttribute("visibilityWindow")||e.getAttribute("featureVisibilityWindow");c&&(t.visibilityWindow=c);const l=e.getAttribute("indexed");l&&(t.indexed="true"===l);const h=e.getAttribute("normalize");h&&(t.normalize="true"===h);const d=e.getElementsByTagName("DataRange");if(d.length>0){const e=d.item(0);t.min=Number(e.getAttribute("minimum")),t.max=Number(e.getAttribute("maximum")),t.logScale="LOG"===e.getAttribute("type")}}class QF{constructor(e,t,i,n,r){this.genome=e,this.chr=t,this.start=i,this.end=n,this.bpPerPixel=r,this.id=o()}get center(){return(this.start+this.end)/2}get locusSearchString(){return`${this.chr}:${this.start+1}-${this.end}`}extend(e){const t=Math.min(e.start,this.start),i=Math.max(e.end,this.end),n=(i-t)/(this.end-this.start);this.start=t,this.end=i,this.bpPerPixel*=n}calculateEnd(e){return this.start+this.bpPerPixel*e}calculateCenter(e){return this.start+this.bpPerPixel*e/2}calculateBPP(e,t){return(e-this.start)/t}set(e){this.chr=e.chr,this.start=e.start,this.bpPerPixel=e.bpPerPixel}toPixels(e){return e/this.bpPerPixel}toBP(e){return this.bpPerPixel*e}shift(e){this.start+=e,this.end+=e}shiftPixels(e,t,i){const n=this.start,r=e*this.bpPerPixel;return this.start+=r,i&&this.clampStart(t),this.end=this.start+t*this.bpPerPixel,n!==this.start}clampStart(e){const t=this.genome.getChromosome(this.chr).bpStart||0;if(this.start=Math.max(t,this.start),e){const{bpLength:t}=this.genome.getChromosome(this.chr),i=t-e*this.bpPerPixel;this.start>i&&(this.start=i)}}async zoomWithScaleFactor(e,t,i,n){const r=void 0===n?this.start+this.toBP(i/2):n,s=this.start,o=this.bpPerPixel,a=this.getChromosome().bpLength,c=t<1?e.minimumBases()/i:a/i;this.bpPerPixel=t<1?Math.max(this.bpPerPixel*t,c):Math.min(this.bpPerPixel*t,c);const l=this.bpPerPixel*i;this.start=r-.5*l,this.clampStart(i),this.end=this.start+l;(s!==this.start||o!==this.bpPerPixel)&&await e.updateViews(!0)}getChromosome(){return this.genome.getChromosome(this.chr)}getMultiLocusLabelBPLengthOnly(e){const t=" ",i=Math.floor(this.start)+1,n=Math.round(this.start+this.bpPerPixel*e);return`${t}${this.chr}${t}${Ys(n-i)}${t}`}getMultiLocusLabelLocusOnly(e){const t=" ",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e);return`${t}${i}:${n}-${r}${t}`}getMultiLocusLabel(e){const t=" ",{chr:i,start:n,end:r}=this.getPresentationLocusComponents(e),s=Math.floor(this.start)+1;return`${t}${i}:${n}-${r}${t}${t}(${Ys(Math.round(this.start+this.bpPerPixel*e)-s)})${t}`}getPresentationLocusComponents(e){if("all"===this.chr)return{chr:this.chr};{const t=F(Math.floor(this.start)+1),i=F(Math.round(this.start+this.bpPerPixel*e));return{chr:this.chr,start:t,end:i}}}getLocusString(){if("all"===this.chr)return"all";return`${this.genome.getChromosomeDisplayName(this.chr)}:${F(Math.floor(this.start)+1)}-${F(Math.round(this.end))}`}description(e){console.log(` ${e||""} referenceFrame - ${this.chr} bpp ${this.bpPerPixel.toFixed(3)} start ${F(Math.round(this.start))} end ${F(Math.round(this.end))} `)}overlaps(e){return this.chr===e.chr&&this.end>=e.start&&e.end>=this.start}}function UF(){return"3.2.2"}const jF="Maximum sequence count exceeded";class GF{constructor(e,i){this.container=t({class:"igv-chromosome-select-widget-container"}),i.appendChild(this.container),this.select=document.createElement("select"),this.select.setAttribute("name","chromosome-select-widget"),this.container.appendChild(this.select),this.select.addEventListener("change",(()=>{this.select.blur(),""!==this.select.value&&jF!==this.select.value&&e.search(this.select.value)})),this.showAllChromosomes=!1!==e.config.showAllChromosomes,this.genome=e.genome}show(){this.container.style.display="flex"}hide(){this.container.style.display="none"}setValue(e){this.select.value=this.genome.getChromosomeDisplayName(e)}update(e){this.genome=e;const t=e.wgChromosomeNames.map((t=>e.getChromosomeDisplayName(t)))||[];if(this.showAllChromosomes&&e.chromosomeNames.length>1){const i=new Set(t);let n=0;for(let r of e.chromosomeNames){if(1e3==++n){t.push(jF);break}i.has(r)||(r=e.getChromosomeDisplayName(r),t.push(r))}}this.select.innerHTML="",e.showWholeGenomeView()&&t.unshift("all");for(let i of t){const t=document.createElement("option");t.setAttribute("value",i),t.innerText=e.getChromosomeDisplayName(i),this.select.appendChild(t)}}}class WF{constructor(e,i){this.container=t({class:"igv-windowsize-panel-container"}),e.appendChild(this.container),i.on("locuschange",(e=>{this.updatePanel(e)})),this.browser=i}show(){this.container.style.display="block"}hide(){this.container.style.display="none"}updatePanel(e){const t=this.browser.calculateViewportWidth(this.browser.referenceFrameList.length);this.container.innerText=1===e.length?Ys(Math.round(t*e[0].bpPerPixel)):""}}class $F extends md{constructor(e,t,i,n){super(e,t,"Select Tracks",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select">\n <rect id="backdrop-copy-3" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.32659528" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#737373">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#737373" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>multi select hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="multi-select-hover">\n <rect id="backdrop-copy-4" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-copy-3" transform="translate(81, 427)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy-2" transform="translate(82, 277)">\n <rect id="Rectangle" fill-opacity="0.33" fill="#CFCECE" x="133" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-16" stroke-opacity="0.33" stroke="#CFCECE" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n <g id="row-copy" transform="translate(81, 119)" fill="#FFFFFF">\n <rect id="Rectangle" x="134" y="0" width="329" height="70"></rect>\n <rect id="Rectangle-Copy-17" stroke="#FFFFFF" stroke-width="12" x="6" y="6" width="58" height="58"></rect>\n </g>\n </g>\n </g>\n</svg>',!1),this.navbar=i,this.enableMultiTrackSelection=!1,this.button.addEventListener("mouseenter",(e=>{!1===n&&this.setState(!0)})),this.button.addEventListener("mouseleave",(e=>{!1===n&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{this.setMultiTrackSelection(!this.enableMultiTrackSelection)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler)}setMultiTrackSelection(e){this.enableMultiTrackSelection=e,this.setState(this.enableMultiTrackSelection),!1===this.enableMultiTrackSelection&&this.navbar.overlayTrackButton.setVisibility(!1);for(const t of this.browser.trackViews)t.enableTrackSelection(e)}}class KF extends md{constructor(e,t){super(e,t,"Crosshairs",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor" stroke="#737373">\n <rect id="Rectangle-Copy-3" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group" transform="translate(5, 9)" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>cursor hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="cursor-hover">\n <rect id="Rectangle-Copy-5" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-Copy-2" transform="translate(5, 9)" stroke="#FFFFFF" stroke-width="24">\n <line x1="0.5" y1="212.5" x2="614.5" y2="212.5" id="Line"></line>\n <line x1="-115.5" y1="303.5" x2="490.5" y2="303.5" id="Line-Copy" transform="translate(187.5, 303.5) scale(-1, 1) rotate(90) translate(-187.5, -303.5)"></line>\n </g>\n <circle id="Oval" stroke="#FFFFFF" stroke-width="24" cx="191.5" cy="221.5" r="88.5"></circle>\n </g>\n </g>\n</svg>',t.doShowCursorGuide),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowCursorGuide&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowCursorGuide&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowCursorGuide=!t.doShowCursorGuide,t.setCursorGuideVisibility(t.doShowCursorGuide),this.setState(t.doShowCursorGuide)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showCursorTrackingGuideButton)}}class YF extends md{constructor(e,t){super(e,t,"Center Line",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline" stroke="#737373">\n <rect id="Rectangle-Copy-2" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>centerline hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="centerline-hover">\n <rect id="Rectangle-Copy-9" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="6.5" y1="312.5" x2="618.5" y2="312.5" id="Line-Copy" stroke="#FFFFFF" stroke-width="31" transform="translate(312.5, 312.5) scale(-1, 1) rotate(90) translate(-312.5, -312.5)"></line>\n </g>\n </g>\n</svg>',t.config.showCenterGuide),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowCenterLine&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowCenterLine&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowCenterLine=!t.doShowCenterLine,t.setCenterLineVisibility(t.doShowCenterLine),this.setState(t.doShowCenterLine)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showCenterGuideButton)}}class XF extends md{constructor(e,t){super(e,t,"Track Labels",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels" fill="#FFFFFF" stroke="#737373">\n <rect id="Rectangle-Copy-27" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" stroke-width="24">\n <path d="M448.444444,87.1189616 L448.444444,322.431462 L166.619398,322.431462 L19.2344421,204.775212 L166.619398,87.1189616 L448.444444,87.1189616 Z M244.028212,163.997434 C232.925565,163.997434 222.874656,168.493347 215.598982,175.760254 C208.318067,183.032394 203.815972,193.079106 203.815972,204.175675 C203.815972,215.272243 208.318067,225.318955 215.598982,232.591095 C222.874656,239.858002 232.925565,244.353915 244.028212,244.353915 C255.130858,244.353915 265.181767,239.858002 272.457442,232.591095 C279.738356,225.318955 284.240451,215.272243 284.240451,204.175675 C284.240451,193.079106 279.738356,183.032394 272.457442,175.760254 C265.181767,168.493347 255.130858,163.997434 244.028212,163.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>track labels hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="track-labels-hover" stroke="#737373">\n <rect id="Rectangle-Copy-29" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="group" transform="translate(52.2778, 149.7248)" fill="#FFFFFF" stroke-width="24">\n <path d="M448.444444,85.1189616 L448.444444,320.431462 L166.619398,320.431462 L19.2344421,202.775212 L166.619398,85.1189616 L448.444444,85.1189616 Z M244.028212,161.997434 C232.925565,161.997434 222.874656,166.493347 215.598982,173.760254 C208.318067,181.032394 203.815972,191.079106 203.815972,202.175675 C203.815972,213.272243 208.318067,223.318955 215.598982,230.591095 C222.874656,237.858002 232.925565,242.353915 244.028212,242.353915 C255.130858,242.353915 265.181767,237.858002 272.457442,230.591095 C279.738356,223.318955 284.240451,213.272243 284.240451,202.175675 C284.240451,191.079106 279.738356,181.032394 272.457442,173.760254 C265.181767,166.493347 255.130858,161.997434 244.028212,161.997434 Z" id="backdrop"></path>\n <path d="M495.232604,12 L495.232604,264.550423 L193.616935,264.550423 L35.4455183,138.275212 L193.616935,12 L495.232604,12 Z M168.133512,95.1660194 C156.441871,95.1660194 145.858581,99.8943121 138.197214,107.534302 C130.523695,115.18641 125.780417,125.758499 125.780417,137.434423 C125.780417,149.110347 130.523695,159.682435 138.197214,167.334543 C145.858581,174.974533 156.441871,179.702826 168.133512,179.702826 C179.825153,179.702826 190.408443,174.974533 198.06981,167.334543 C205.743329,159.682435 210.486607,149.110347 210.486607,137.434423 C210.486607,125.758499 205.743329,115.18641 198.06981,107.534302 C190.408443,99.8943121 179.825153,95.1660194 168.133512,95.1660194 Z" id="hero"></path>\n </g>\n </g>\n </g>\n</svg>',t.config.showTrackLabels),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowTrackLabels&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowTrackLabels&&this.setState(!1)}));this.boundMouseClickHandler=(()=>{t.doShowTrackLabels=!t.doShowTrackLabels,t.setTrackLabelVisibility(t.doShowTrackLabels),this.setState(t.doShowTrackLabels)}).bind(this),this.button.addEventListener("click",this.boundMouseClickHandler),this.setVisibility(t.config.showTrackLabelButton)}}class ZF extends md{constructor(e,t){super(e,t,["ROI","Regions of Interest Table"],wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi">\n <rect id="Rectangle-Copy-23" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#737373">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>roi hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="roi-hover">\n <rect id="Rectangle-Copy-24" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <text id="ROI" font-family="HelveticaNeue-Bold, Helvetica Neue" font-size="258" font-weight="bold" fill="#FFFFFF">\n <tspan x="81.445" y="389">ROI</tspan>\n </text>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>{!1===t.doShowROITable&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.doShowROITable&&this.setState(!1)})),this.button.addEventListener("click",(()=>this.buttonHandler(!t.doShowROITable))),this.setVisibility(!1)}buttonHandler(e){this.setState(e),this.browser.setROITableVisibility(e)}}class JF extends md{constructor(e,t){super(e,t,"Sample Info",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info">\n <rect id="Rectangle-Copy-6" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="Group-2" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="Group-2-Copy-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-10" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample info hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-info-hover">\n <rect id="Rectangle-Copy-14" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="row-2" transform="translate(314, 404) scale(-1, 1) translate(-314, -404)translate(8, 353)">\n <rect id="Rectangle" fill="#1B9E77" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BAD1E9" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#4DAF4A" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#CBF03E" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-1" transform="translate(8, 251)">\n <rect id="Rectangle" fill="#E41A1C" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#377EB8" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#FDB46B" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#BC80BD" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#FFFFB3" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="510" y="0" width="102" height="102"></rect>\n </g>\n <g id="row-0" transform="translate(8, 149)">\n <rect id="Rectangle" fill="#8DD3C7" x="0" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy" fill="#FBB4AE" x="102" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-8" fill="#7FC97F" x="204" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#ADE2CF" x="306" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#E41A1C" x="408" y="0" width="102" height="102"></rect>\n <rect id="Rectangle-Copy-7" fill="#3F70AE" x="510" y="0" width="102" height="102"></rect>\n </g>\n <rect id="Rectangle-Copy-15" stroke="#737373" stroke-width="12" x="6" y="6" width="613" height="613" rx="135"></rect>\n <rect id="scrim" fill="#000000" style="mix-blend-mode: hue;" x="8" y="149" width="612" height="306"></rect>\n </g>\n </g>\n</svg>',!1),this.showSampleInfo=!1,this.button.addEventListener("mouseenter",(()=>{!1===this.showSampleInfo&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===this.showSampleInfo&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)}))}performClickWithState(e,t){this.showSampleInfo=void 0===t?!this.showSampleInfo:t;e.columnContainer.querySelector(".igv-sample-info-column").style.display=!1===this.showSampleInfo?"none":"flex",this.setState(this.showSampleInfo),e.layoutChange()}setButtonVisibility(e){this.showSampleInfo=e,this.setState(this.showSampleInfo),!0===this.showSampleInfo?this.show():this.hide()}}class ev extends md{constructor(e,t){super(e,t,"Sample Names",'<svg width="90px" height="20px" viewBox="0 0 90 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="igv-navbar-button-group">\n <rect id="Rectangle" x="0.5" y="0.5" width="89" height="18" rx="6"></rect>\n <text id="igv-text-button-label" x="50%" y="50%" dy=".1em" font-family="Helvetica" font-size="12" font-weight="normal" letter-spacing="-0.372">\n <tspan id="igv-navbar-button-label"></tspan>\n </text>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names" stroke="#737373">\n <rect id="Rectangle-Copy-13" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke-width="32"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke-width="32"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke-width="32"></line>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>sample names hover</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="sample-names-hover">\n <rect id="Rectangle-Copy-18" stroke="#737373" stroke-width="12" fill="#737373" x="6" y="6" width="613" height="613" rx="135"></rect>\n <line x1="80" y1="465" x2="541" y2="464.5" id="Line-3-Copy-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="312.5" x2="542" y2="313" id="Line-3" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n <line x1="80" y1="158" x2="541" y2="158" id="Line-3-Copy" stroke="#FFFFFF" stroke-width="32" fill="#FFFFFF"></line>\n </g>\n </g>\n</svg>',t.config.showSampleNames),this.button.addEventListener("mouseenter",(()=>{!1===t.showSampleNames&&this.setState(!0)})),this.button.addEventListener("mouseleave",(()=>{!1===t.showSampleNames&&this.setState(!1)})),this.button.addEventListener("click",(()=>{this.performClickWithState(t,void 0)})),!0===t.config.showSampleNameButton?this.show():this.hide()}performClickWithState(e,t){e.showSampleNames=void 0===t?!e.showSampleNames:t;e.columnContainer.querySelector(".igv-sample-name-column").style.display=!1===e.showSampleNames?"none":"flex",this.setState(e.showSampleNames),e.layoutChange()}}class tv{constructor(e,i){this.parent=e,this.popover=t({class:"igv-ui-dropdown"}),e.appendChild(this.popover),this.popoverContent=t(),this.popover.appendChild(this.popoverContent),this.popover.style.display="none",this.shim=i}configure(e){if(0===e.length)return;const t=ro(e,this.popover);for(const{element:e}of t)this.popoverContent.appendChild(e)}present(e){this.popover.style.display="block";let{x:t,y:i}=a(e,this.parent);this.popover.style.left=`${t+this.shim.left}px`,this.popover.style.top=`${i+this.shim.top}px`}_present(e){this.popover.style.display="block";let{x:t,y:i,width:n}=a(e,this.parent);t+=this.shim.left,i+=this.shim.top,this.popover.style.top=`${i}px`;const{width:r}=this.popover.getBoundingClientRect(),s=t+r,o=s-n;this.popover.style.left=`${s>n?t-o:t}px`}dismiss(){this.popover.style.display="none"}}class iv extends md{constructor(e,t){super(e,t,"Save Image",wd,'<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>','<svg width="625px" height="625px" viewBox="0 0 625 625" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>save image</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="save-image">\n <rect id="border" stroke="#737373" stroke-width="12" fill="#FFFFFF" x="6" y="6" width="613" height="613" rx="135"></rect>\n <g id="frame" transform="translate(66, 66)" fill="#737373" fill-rule="nonzero">\n <path d="M54.75,493 C39.69375,493 26.8046875,487.639062 16.0828125,476.917187 C5.3609375,466.195312 0,453.30625 0,438.25 L0,274 L54.75,274 L54.75,438.25 L219,438.25 L219,493 L54.75,493 Z" id="Path"></path>\n <path d="M274,493 L274,438.25 L438.25,438.25 L438.25,274 L493,274 L493,438.25 C493,453.30625 487.639062,466.195312 476.917187,476.917187 C466.195312,487.639062 453.30625,493 438.25,493 L274,493 Z" id="Path"></path>\n <path d="M0,219 L0,54.75 C0,39.69375 5.3609375,26.8046875 16.0828125,16.0828125 C26.8046875,5.3609375 39.69375,0 54.75,0 L219,0 L219,54.75 L54.75,54.75 L54.75,219 L0,219 Z" id="Path"></path>\n <path d="M438.25,219 L438.25,54.75 L274,54.75 L274,0 L438.25,0 C453.30625,0 466.195312,5.3609375 476.917187,16.0828125 C487.639062,26.8046875 493,39.69375 493,54.75 L493,219 L438.25,219 Z" id="Path"></path>\n </g>\n <rect id="border-hold-out-matte" fill="#FFFFFF" x="91" y="90" width="444" height="444" rx="38"></rect>\n <g id="artwork" transform="translate(148, 176)" fill="#737373" fill-rule="nonzero">\n <polygon id="Path" points="0 273 82.25 163.4 143.9375 245.6 226.1875 136 329 273"></polygon>\n <path d="M260,82 C248.155556,82 238.361111,78.1277778 230.616667,70.3833333 C222.872222,62.6388889 219,52.8444444 219,41 C219,29.1555556 222.872222,19.3611111 230.616667,11.6166667 C238.361111,3.87222222 248.155556,0 260,0 C271.844444,0 281.638889,3.87222222 289.383333,11.6166667 C297.127778,19.3611111 301,29.1555556 301,41 C301,52.8444444 297.127778,62.6388889 289.383333,70.3833333 C281.638889,78.1277778 271.844444,82 260,82 Z" id="Path"></path>\n </g>\n </g>\n </g>\n</svg>',!1),this.button.addEventListener("mouseenter",(()=>this.setState(!0))),this.button.addEventListener("mouseleave",(()=>{for(const e of this.button.querySelectorAll("div"))if("block"===e.style.display)return;this.setState(!1)})),this.dropdown=new tv(this.button.parentNode,{top:24,left:-88});const i=[{label:"Save as SVG",click:e=>{this.browser.saveSVGtoFile("igvjs.svg"),this.dropdown.dismiss()}},{label:"Save as PNG",click:e=>{this.browser.savePNGtoFile("igvjs.png"),this.dropdown.dismiss()}}];this.dropdown.configure(i),this.button.addEventListener("click",(e=>{let t;if(e.target===this.button)t=!0;else if(e.target.closest("svg")){e.target.closest("div")===this.button&&(t=!0)}!0===t&&("none"===this.dropdown.popover.style.display?this.dropdown.present(e):this.dropdown.dismiss())})),this.setVisibility(t.config.showSVGButton)}navbarResizeHandler(e){this.dropdown.dismiss(),super.navbarResizeHandler(e)}}const nv=function(e,i,n){const r=t({class:"igv-navbar-button"});e.appendChild(r),r.textContent=n.label,r.addEventListener("click",(()=>n.callback(i)))};let rv=23,sv=0;class ov{constructor(e,i,n){this.browser=i,this.zoomContainer=t({class:"igv-zoom-widget"}),n.appendChild(this.zoomContainer),this.zoomOutButton=t(),this.zoomContainer.appendChild(this.zoomOutButton),this.zoomOutButton.appendChild(l("minus-circle")),this.zoomOutButton.addEventListener("click",(()=>{i.zoomOut()}));const r=t();this.zoomContainer.appendChild(r),this.slider=document.createElement("input"),this.slider.type="range",this.slider.min="0",this.slider.max=`${rv}`,r.appendChild(this.slider),this.slider.addEventListener("change",(e=>{e.preventDefault(),e.stopPropagation();const t=i.referenceFrameList[0],{bpLength:n}=t.genome.getChromosome(t.chr),{end:r,start:s}=t,o=r-s,a=n/Math.pow(2,e.target.valueAsNumber);i.zoomWithScaleFactor(a/o)})),this.zoomInButton=t(),this.zoomContainer.appendChild(this.zoomInButton),this.zoomInButton.appendChild(l("plus-circle")),this.zoomInButton.addEventListener("click",(()=>{i.zoomIn()})),i.on("locuschange",(e=>{this.browser.isMultiLocusMode()?this.disable():(this.enable(),this.update(e))}))}update(e){if(this.slider){const t=e[0],{bpLength:i}=t.genome.getChromosome(t.chr),{start:n,end:r}=t;rv=Math.ceil(Math.log2(i/this.browser.minimumBases())),this.slider.max=`${rv}`;const s=i/(r-n);sv=Math.log2(s),this.slider.value=`${Math.round(sv)}`}}enable(){this.slider&&(this.slider.disabled=!1)}disable(){this.slider&&(this.slider.disabled=!0)}hide(){this.zoomContainer.style.display="none"}show(){this.zoomContainer.style.display="block"}hideSlider(){this.slider&&(this.slider.style.display="none")}showSlider(){this.slider&&(this.slider.style.display="block")}}class av{constructor(e,t){this.browser=t,this.config=e,this.currentClass="igv-navbar-text-button";const i=document.createElement("div");i.className="igv-navbar",this.navigation=i;const n=document.createElement("div");n.className="igv-navbar-left-container",i.appendChild(n),this.navbarLeftContainer=n;const r=document.createElement("div");r.className="igv-logo",n.appendChild(r);const s=function(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("width","690px"),e.setAttribute("height","324px"),e.setAttribute("viewBox","0 0 690 324"),e.setAttribute("version","1.1"),e.setAttribute("xmlns","http://www.w3.org/2000/svg"),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink");const t=document.createElementNS("http://www.w3.org/2000/svg","title");t.textContent="IGV",e.appendChild(t);const i=document.createElementNS("http://www.w3.org/2000/svg","g");i.setAttribute("id","Page-1"),i.setAttribute("stroke","none"),i.setAttribute("stroke-width","1"),i.setAttribute("fill","none"),i.setAttribute("fill-rule","evenodd"),e.appendChild(i);const n=document.createElementNS("http://www.w3.org/2000/svg","g");n.setAttribute("id","IGV"),n.setAttribute("fill","#666666"),i.appendChild(n);const r=document.createElementNS("http://www.w3.org/2000/svg","polygon");r.setAttribute("id","Path"),r.setAttribute("points","379.54574 8.00169252 455.581247 8.00169252 515.564813 188.87244 532.884012 253.529506 537.108207 253.529506 554.849825 188.87244 614.833392 8.00169252 689.60164 8.00169252 582.729511 320.722144 486.840288 320.722144"),n.appendChild(r);const s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d","M261.482414,323.793286 C207.975678,323.793286 168.339046,310.552102 142.571329,284.069337 C116.803612,257.586572 103.919946,217.158702 103.919946,162.784513 C103.919946,108.410325 117.437235,67.8415913 144.472217,41.0770945 C171.507199,14.3125977 212.903894,0.930550071 268.663545,0.930550071 C283.025879,0.930550071 298.232828,1.84616386 314.284849,3.6774189 C330.33687,5.50867394 344.839793,7.97378798 357.794056,11.072835 L357.794056,68.968378 C339.48912,65.869331 323.578145,63.5450806 310.060654,61.9955571 C296.543163,60.4460336 284.574731,59.6712835 274.154998,59.6712835 C255.850062,59.6712835 240.502308,61.4320792 228.111274,64.9537236 C215.720241,68.4753679 205.793482,74.2507779 198.330701,82.2801269 C190.867919,90.309476 185.587729,100.87425 182.48997,113.974767 C179.392212,127.075284 177.843356,143.345037 177.843356,162.784513 C177.843356,181.942258 179.251407,198.000716 182.067551,210.960367 C184.883695,223.920018 189.671068,234.41436 196.429813,242.443709 C203.188559,250.473058 212.059279,256.178037 223.042241,259.558815 C234.025202,262.939594 247.683295,264.629958 264.01693,264.629958 C268.241146,264.629958 273.098922,264.489094 278.590403,264.207362 C284.081883,263.925631 289.643684,263.50304 295.275972,262.939577 L295.275972,159.826347 L361.595831,159.826347 L361.595831,308.579859 C344.698967,313.087564 327.239137,316.750019 309.215815,319.567334 C291.192494,322.38465 275.281519,323.793286 261.482414,323.793286 L261.482414,323.793286 L261.482414,323.793286 Z"),s.setAttribute("id","Path"),n.appendChild(s);const o=document.createElementNS("http://www.w3.org/2000/svg","polygon");return o.setAttribute("id","Path"),o.setAttribute("points","0.81355666 5.00169252 73.0472883 5.00169252 73.0472883 317.722144 0.81355666 317.722144"),n.appendChild(o),e}();s.style.width="34px",s.style.height="32px",r.appendChild(s),this.currentGenome=document.createElement("div"),this.currentGenome.className="igv-current-genome",n.appendChild(this.currentGenome),this.currentGenome.textContent="";const o=document.createElement("div");o.className="igv-navbar-genomic-location",n.appendChild(o),this.chromosomeSelectWidget=new GF(t,o),!1!==e.showChromosomeWidget?this.chromosomeSelectWidget.show():this.chromosomeSelectWidget.hide();const a=document.createElement("div");a.className="igv-locus-size-group",o.appendChild(a);const c=document.createElement("div");c.className="igv-search-container",a.appendChild(c),this.searchInput=document.createElement("input"),this.searchInput.className="igv-search-input",this.searchInput.type="text",this.searchInput.placeholder="Locus Search",c.appendChild(this.searchInput),this.searchInput.addEventListener("keyup",(e=>{e.stopImmediatePropagation()})),this.searchInput.addEventListener("change",(()=>{t.doSearch(this.searchInput.value)}));const h=document.createElement("div");h.className="igv-search-icon-container",c.appendChild(h);const d=l("search");h.appendChild(d),h.addEventListener("click",(()=>{t.doSearch(this.searchInput.value)})),this.windowSizePanel=new WF(a,t);const u=document.createElement("div");u.className="igv-navbar-right-container",i.appendChild(u),this.navbarRightContainer=u;const f=document.createElement("div");f.className="igv-navbar-toggle-button-container",u.appendChild(f),this.toggleButtonContainer=f,this.overlayTrackButton=new yd(f,t),this.overlayTrackButton.setVisibility(!1);const p=!1!==e.showMultiSelectButton;if(this.multiTrackSelectButton=new $F(f,t,this,p),this.cursorGuideButton=new KF(f,t),this.centerLineButton=new YF(f,t),this.trackLabelControl=new XF(f,t),this.roiTableControl=new ZF(f,t),this.sampleInfoControl=new JF(f,t),this.sampleNameControl=new ev(f,t),!0===e.showSVGButton&&(this.saveImageControl=new iv(f,t)),e.customButtons)for(let i of e.customButtons)new nv(f,t,i);this.zoomWidget=new ov(e,t,u),!1===e.showNavigation&&(this.navigation.style.display="none")}navbarDidResize(){const e=this.currentNavbarButtonClass();"igv-navbar-text-button"===e&&(this.textButtonContainerWidth=this.navbarRightContainer.getBoundingClientRect().width);const t=this.browser,i=t.isMultiLocusWholeGenomeView()||t.referenceFrameList&&Mh.isWholeGenomeView(t.referenceFrameList[0].chr);i?this.windowSizePanel.hide():this.windowSizePanel.show();const{x:n,width:r}=this.navbarLeftContainer.getBoundingClientRect(),s=n+r,{x:o}=this.navbarRightContainer.getBoundingClientRect();let a;if("igv-navbar-text-button"===e&&o-s<8)a="igv-navbar-icon-button";else if(this.textButtonContainerWidth&&"igv-navbar-icon-button"===e){this.navigation.offsetWidth-s-this.textButtonContainerWidth>8&&(a="igv-navbar-text-button")}let c;a&&e!==a&&(this.currentClass=a,this.browser.fireEvent("navbar-resize",[a])),c=i?"igv-zoom-widget-hidden":this.navigation.offsetWidth>860?"igv-zoom-widget":"igv-zoom-widget-900",this.zoomWidget.zoomContainer.className="",this.zoomWidget.zoomContainer.classList.add(c)}updateGenome(e){let t=e.id&&e.id.length<20?e.id:`${e.id.substring(0,8)}...${e.id.substring(e.id.length-8)}`;this.currentGenome.textContent=t,this.currentGenome.setAttribute("title",e.description);!1!==this.config.showChromosomeWidget&&!1!==e.showChromosomeWidget&&e.chromosomeNames&&e.chromosomeNames.length>1?(this.chromosomeSelectWidget.update(e),this.chromosomeSelectWidget.show()):this.chromosomeSelectWidget.hide()}updateLocus(e,t){this.searchInput&&(this.searchInput.value=e),this.chromosomeSelectWidget&&(this.chromosomeSelectWidget.select.value=t)}currentNavbarButtonClass(){return this.currentClass}setEnableTrackSelection(e){this.multiTrackSelectButton.setMultiTrackSelection(e)}getEnableTrackSelection(){return this.multiTrackSelectButton.enableMultiTrackSelection}hide(){this.navigation.style.display="none"}show(){this.navigation.style.display="flex"}}const cv=(e,t)=>{const i=0===e?t.nextElementSibling:t.previousElementSibling;t.remove(),i.remove()},lv=e=>{const i=t({class:"igv-column-shim"});eo(i,e);const n=t({class:"igv-column"});return eo(n,i),n},hv=(e,i)=>{for(let n=0;n<i;n++){const r=t({class:"igv-column"});if(Js(r,e),i>1&&n>0){Js(t({class:"igv-column-shim"}),r)}}};class dv{constructor(e,i,n){this.browser=e,this.referenceFrame=i,this.column=n,this.container=t({class:"igv-center-line"}),n.appendChild(this.container),e.doShowCenterLine?this.show():this.hide()}repaint(){if(this.referenceFrame){if(1/this.referenceFrame.bpPerPixel>1){const e=Math.floor(this.referenceFrame.toPixels(1));this.container.style.width=`${e}px`,this.container.classList.remove("igv-center-line-thin"),this.container.classList.add("igv-center-line-wide")}else this.container.style.width="1px",this.container.classList.remove("igv-center-line-wide"),this.container.classList.add("igv-center-line-thin")}}show(){this.isVisible=!0,this.container.style.display="block",this.repaint()}hide(){this.isVisible=!1,this.container.style.display="none"}resize(){this.repaint()}}const uv=function(e,i){this.button=t({class:"igv-navbar-button"}),e.appendChild(this.button),this.button.textContent="circular view",this.button.addEventListener("click",(()=>{i.circularViewVisible=!i.circularViewVisible})),this.browser=i,this.setVisibility(i.config.showCircularViewButton),this.setState(i.circularViewVisible)};uv.prototype.setVisibility=function(e){!0===e?this.show():this.hide()},uv.prototype.setState=function(e){!0===e?this.button.classList.add("igv-navbar-button-clicked"):this.button.classList.remove("igv-navbar-button-clicked")},uv.prototype.show=function(){this.button.style.display="block",this.setState(this.browser.circularViewVisible)},uv.prototype.hide=function(){this.button.style.display="none"};class fv{constructor(e,i){this.browser=e,this.container=t({class:"igv-roi-menu"}),i.appendChild(this.container);const n=t();this.container.appendChild(n),u(n,(()=>this.container.style.display="none")),this.body=t(),this.container.appendChild(this.body),this.container.style.display="none"}async present(e,t,i,n,r,s){const o=this.menuItems(e,t,i,n,r,s);this.browser.menuPopup.presentTrackContextMenu(i,o)}menuItems(e,t,i,n,r,s){const o=e.name?[`<b>${e.name}</b><br/>`]:[];return"name"in t&&o.push(`<b>ROI Set: ${t.name}</b>`),o.length>0&&o.push("<hr/>"),t.isUserDefined&&o.push({label:"Set description ...",click:()=>{const t={label:"Description",value:e.name||"",callback:()=>{const t=this.browser.inputDialog.value||"";e.name=t.trim(),this.browser.roiManager.repaintTable()}};this.browser.inputDialog.present(t,i)}}),to()&&e.end-e.start<1e6&&o.push({label:"Copy reference sequence",click:async()=>{this.container.style.display="none";let t=await this.browser.genome.getSequence(e.chr,e.start,e.end);t||(t="Unknown sequence");try{await navigator.clipboard.writeText(t)}catch(e){console.error(e),this.browser.alert.present(`error copying sequence to clipboard ${e}`)}}}),e.end-e.start<=25e3&&o.push({label:"BLAT reference sequence",click:async()=>{this.container.style.display="none";const{chr:t,start:i,end:n}=e;let r=await this.browser.genome.getSequence(t,i,n);if(r){const e=`blat: ${t}:${i+1}-${n}`,s=`blat: ${t}:${i+1}-${n}`;oh({sequence:r,browser:this.browser,name:e,title:s})}}}),t.isUserDefined&&o.push("<hr/>",{label:"Delete",click:async()=>{t.removeFeature(e);const i=await t.getAllFeatures();0===Object.keys(i).length&&n.deleteUserDefinedROISet(),n.deleteRegionWithKey(s.dataset.region,r),n.repaintTable()}}),o}dispose(){this.container.innerHTML=""}}class pv extends th{constructor(e){const t={browser:e,parent:e.columnContainer,headerTitle:"Regions of Interest",dismissHandler:()=>e.roiTableControl.buttonHandler(!1),gotoButtonHandler:pv.gotoButtonHandler};t.columnFormat=pv.getColumnFormatConfiguration(!0),super(Object.assign({width:"640px"},t))}tableRowDOM(e){const i=t({class:"igv-roi-table-row"}),{setName:n,feature:r}=e;i.dataset.region=bv(r.chr,r.start,r.end);let s=[r.chr,F(r.start),F(r.end),r.name||"",n];4===this.columnFormat.length&&(s=s.slice(0,4));for(let e=0;e<s.length;e++){const n=t();i.appendChild(n),n.style.width=this.columnFormat[e].width,n.innerText=s[e]}return this.tableRowDOMHelper(i),i}renderTable(e){if(Array.from(this.tableRowContainer.querySelectorAll(".igv-roi-table-row")).forEach((e=>e.remove())),e.length>0){const t=e.sort(((e,t)=>e.feature.chr.localeCompare(t.feature.chr)||e.feature.start-t.feature.start||e.feature.end-t.feature.end));for(let e of t){const t=this.tableRowDOM(e);this.tableRowContainer.appendChild(t)}}}set footerDOM(e){super.footerDOM=e,this.gotoButton.textContent="Go to selected region(s)";const i=t({class:"igv-roi-table-button"});this._footerDOM.appendChild(i),i.id="igv-roi-hide-show-button",i.textContent="Copy Sequence",i.title="One region only of max size 1 mb",this.copySequenceButton=i,gv(this.copySequenceButton,!1),this.boundCopySequenceButtonHandler=async function(e){e.preventDefault(),e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0){const e=[];for(let i of t){const{locus:t}=vv(i.dataset.region);e.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");if(this.setTableRowSelectionState(!1),e.length>0){const{chr:t,start:i,end:n}=yF(e[0],this.browser.isSoftclipped()),r=await this.browser.genome.getSequence(t,i,n);await navigator.clipboard.writeText(r)}}}.bind(this),this.copySequenceButton.addEventListener("click",this.boundCopySequenceButtonHandler);const n=t({class:"igv-roi-table-button"});this._footerDOM.appendChild(n),n.id="igv-roi-hide-show-button",n.textContent="Hide Overlays",this.toggleROIButton=n,this.boundToggleDisplayButtonHandler=function(e){e.preventDefault(),e.stopPropagation(),this.roiManager.toggleROIs()}.bind(this),this.toggleROIButton.addEventListener("click",this.boundToggleDisplayButtonHandler)}get roiManager(){return this.browser.roiManager}setTableRowSelectionState(e){super.setTableRowSelectionState(e);const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected");if(t.length>0&&t.length<2){const{locus:e}=vv(t[0].dataset.region),{chr:i,start:n,end:r}=yF(e,this.browser.isSoftclipped());gv(this.copySequenceButton,r-n<1e6)}else gv(this.copySequenceButton,!1)}dispose(){document.removeEventListener("click",this.boundGotoButtonHandler),document.removeEventListener("click",this.boundCopySequenceButtonHandler),document.removeEventListener("click",this.boundToggleDisplayButtonHandler),this.browser.roiTableControl.buttonHandler(!1),super.dispose()}static getColumnFormatConfiguration(e){return!0===e?[{label:"Chr",width:"20%"},{label:"Start",width:"15%"},{label:"End",width:"15%"},{label:"Description",width:"30%"},{label:"ROI Set",width:"20%"}]:[{label:"Chr",width:"25%"},{label:"Start",width:"20%"},{label:"End",width:"20%"},{label:"Description",width:"35%"}]}static gotoButtonHandler(e){e.stopPropagation();const t=this.tableDOM.querySelectorAll(".igv-roi-table-row-selected"),i=[];for(let e of t){const{locus:t}=vv(e.dataset.region);i.push(t)}for(let e of this.tableDOM.querySelectorAll(".igv-roi-table-row"))e.classList.remove("igv-roi-table-row-selected");this.setTableRowSelectionState(!1),i.length>0&&this.browser.search(i.join(" "))}}function gv(e,t){e.style.pointerEvents=t?"auto":"none",e.style.color=Wn(t?"licorice":"silver"),e.style.borderColor=Wn(t?"licorice":"silver")}class mv{constructor(e){this.browser=e,this.roiMenu=new fv(e,e.columnContainer),this.roiTable=new pv(e,e.columnContainer),this.top=0,this.roiSets=[],this.showOverlays=!0,this.boundLocusChangeHandler=wv.bind(this),e.on("locuschange",this.boundLocusChangeHandler)}async reset(){this.roiSets.length>0&&this.browser.roiTableControl.setVisibility(!0);const e=this.roiSets.map((e=>this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})));e.length>0&&await Promise.all(e);const t=await this.getTableRecords();this.roiTable.renderTable(t),this.roiSets.length>0&&this.setOverlayVisibility(this.showOverlays)}setOverlayVisibility(e){const t=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let i=0;i<t.length;i++){const n=t[i];n.style.backgroundColor=e?n.dataset.color:"rgba(0, 0, 0, 0)"}this.roiTable.toggleROIButton.textContent=!1===e?"Show Overlays":"Hide Overlays"}async loadROI(e,t){const i=Array.isArray(e)?e:[e];i.length>0&&!1===i[0].isVisible&&(this.showOverlays=!1);for(let e of i)!e.name&&e.url&&(e.name=await Ks(e.url)),e.url&&!e.format&&(e.format=await wf(e)),this.roiSets.push(new qh(e,t));await this.reset()}clearROIs(){this.roiTable.clearTable();const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();for(let e of this.roiSets)e.dispose();this.roiSets=[]}async getTableRecords(){const e=[];for(let t of this.roiSets){const i=t.name||"",n=await t.getAllFeatures();for(let t of Object.keys(n))for(let r of n[t])e.push({setName:i,feature:r})}return e}presentTable(){this.roiTable.present()}async repaintTable(){const e=await this.getTableRecords();this.roiTable.renderTable(e)}dismissTable(){this.roiTable.dismiss()}roiTableIsVisible(){return this.roiTable.isVisible()}async updateUserDefinedROISet(e){let t=await this.getUserDefinedROISet();void 0===t&&(t=this.initializeUserDefinedROISet()),t.addFeature(e),this.setROITableButtonVisibility(!0),await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:t});const i=await this.getTableRecords();this.roiTable.renderTable(i)}setROITableButtonVisibility(e){this.browser.roiTableControl.setVisibility(e)}toggleROIs(){this.showOverlays=!this.showOverlays,this.setOverlayVisibility(this.showOverlays)}async renderAllROISets(){for(let e of this.roiSets)await this.renderROISet({browser:this.browser,pixelTop:this.top,roiSet:e})}async renderROISet({browser:e,pixelTop:t,roiSet:i}){const n=e.columnContainer.querySelectorAll(".igv-column");for(let r=0;r<n.length;r++){let{chr:s,start:o,end:a,bpPerPixel:c}=e.referenceFrameList[r];const l=n[r].querySelectorAll(".igv-roi-region");for(let e of l){const t=e.dataset.region,{chr:i,start:n,end:r}=vv(t);(i!==s||r<o||n>a)&&e.remove()}const h=await i.getFeatures(s,o,a);if(h)for(let l of h){const h=bv(s,l.start,l.end),{x:d,width:u}=Qh(Math.max(o,l.start),Math.min(a,l.end),o,c),f=n[r].querySelector(Fv(h));if(f)f.style.left=`${d}px`,f.style.width=`${u}px`;else{const s=this.createRegionElement(e.columnContainer,t,d,u,i,h,l);n[r].appendChild(s)}}}}createRegionElement(e,i,n,r,s,o,c){const l=t({class:"igv-roi-region"});l.style.top=`${i}px`,l.style.left=`${n}px`,l.style.width=`${r}px`;const h=`${this.getROIRegionTopMargin()}px`;l.style.marginTop=h,l.dataset.color=s.color,l.dataset.region=o,this.showOverlays?l.style.backgroundColor=s.color:l.style.backgroundColor="rgba(0, 0, 0, 0)";const d=t();return l.appendChild(d),d.style.backgroundColor=s.headerColor,d.addEventListener("click",(t=>{t.preventDefault(),t.stopPropagation(),a(t,e),this.roiMenu.present(c,s,t,this,e,l)})),l}updateROIRegionPositions(){const e=`${this.getROIRegionTopMargin()}px`,t=this.browser.columnContainer.querySelectorAll(".igv-column");for(let i=0;i<t.length;i++){const n=t[i].querySelectorAll(".igv-roi-region");for(let t=0;t<n.length;t++)n[t].style.marginTop=e}}getROIRegionTopMargin(){const e=this.browser.findTracks((e=>new Set(["ideogram","ruler"]).has(e.type))),[t,i]=e.map((e=>e.trackView.viewports[0].viewportElement)).map((e=>function(e){const t=window.getComputedStyle(e),i=parseInt(t.marginTop),n=parseInt(t.marginBottom),{top:r,bottom:s,height:o}=e.getBoundingClientRect();return{top:Math.floor(r)-i,bottom:Math.floor(s)+n,height:Math.floor(o)+i+n}}(e)));return(t?t.height:0)+(i?i.height:0)+-.5}renderSVGContext(e,t,{deltaX:i,deltaY:n}){for(const r of e.querySelectorAll(".igv-roi-region")){const{x:e,y:s,width:o,height:a}=r.getBoundingClientRect();t.fillStyle=r.style.backgroundColor,t.fillRect(e-i,s+n,o,a);const c=r.querySelector("div"),{x:l,y:h,width:d,height:u}=c.getBoundingClientRect();t.fillStyle=c.style.backgroundColor,t.fillRect(l-i,h+n,d,u)}}getUserDefinedROISet(){return this.roiSets.find((e=>!0===e.isUserDefined))}deleteUserDefinedROISet(){this.roiSets=this.roiSets.filter((e=>!0!==e.isUserDefined))}initializeUserDefinedROISet(){const e=new qh({name:"user defined",isUserDefined:!0,features:[]},this.browser.genome);return this.roiSets.push(e),e}async deleteRegionWithKey(e,t){t.querySelectorAll(Fv(e)).forEach((e=>e.remove()));0===(await this.getTableRecords()).length&&(this.browser.roiTableControl.buttonHandler(!1),this.setROITableButtonVisibility(!1))}toJSON(){return this.roiSets.map((e=>e.toJSON()))}dispose(){this.browser.off("locuschange",this.boundLocusChangeHandler);const e=this.browser.columnContainer.querySelectorAll(".igv-roi-region");for(let t of e)t.remove();this.roiMenu&&this.roiMenu.dispose(),this.roiTable&&this.roiTable.dispose();for(let e of this.roiSets)e.dispose();for(let e of Object.keys(this))this[e]=void 0}}function wv(){this.renderAllROISets()}function bv(e,t,i){return`${e}-${t}-${i}`}function Fv(e){return`[data-region="${e}"]`}function vv(e){let t=e.split("-"),i=parseInt(t.pop()),n=parseInt(t.pop()),r=t.join("-");return{chr:r,start:n,end:i,locus:`${r}:${n}-${i}`,bedRecord:`${r}\t${n}\t${i}`}}class yv{constructor(e,t){this.name=e.name,this.featureSource=e.featureSource||Hl(e,t),this.color=e.color||Oh}async getFeatures(e,t,i){return this.featureSource.getFeatures({chr:e,start:t,end:i})}draw(e){const{context:t,bpPerPixel:i,bpStart:n,pixelTop:r,pixelHeight:s,pixelWidth:o,features:a}=e;if(!a)return;const c=n+o*i+1;for(let{start:e,end:o}of a){if(o<n)continue;if(e>c)break;const{x:a,width:l}=Qh(e,o,n,i);fr.fillRect(t,a,r,l,s,{fillStyle:this.color})}}}class Av{aliasRecordCache=new Map;constructor(e,t){this.genomeID=e,this.update(e,t)}async preload(){}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}update(e,t){if(t){const i=[];for(let n of t){if(this.aliasRecordCache.has(n))continue;const t={chr:n};if(i.push(t),n.startsWith("gi|")){const e=Av.getNCBIName(n);t["ncbi-gi-versioned"]=e;const i=e.lastIndexOf(".");if(i>0){const e=e.substring(0,i);t["ncbi-gi"]=e}}else if("chrM"===n?t.ncbi="MT":"MT"===n?t.ucsc="chrM":n.toLowerCase().startsWith("chr")&&Number.isInteger(Number(n.substring(3)))?t.ncbi=n.substring(3):Number.isInteger(Number(n))&&(t.ucsc="chr"+n),e.startsWith("hg")||e.startsWith("GRCh")||"1kg_ref"===e||"b37"===e)switch(n){case"23":t.ucsc="chrX",t.assembly="X";break;case"24":t.ucsc="chrY",t.assembly="Y";break;case"chrX":t.ncbi="23",t.assembly="X";break;case"chrY":t.ncbi="24",t.assembly="Y";break;case"X":t.ucsc="chrX",t.ncbi="23";break;case"Y":t.ucsc="chrY",t.ncbi="24"}else if(e.startsWith("mm")||e.startsWith("GRCm")||e.startsWith("rheMac"))switch(n){case"21":t.ucsc="chrX",t.assembly="X";break;case"22":t.ucsc="chrY",t.assembly="Y";break;case"chrX":t.ncbi="21",t.assembly="X";break;case"chrY":t.ncbi="22",t.assembly="Y";break;case"X":t.ucsc="chrX",t.ncbi="21";break;case"Y":t.ucsc="chrY",t.ncbi="22"}}for(let e of i){Av.addCaseAliases(e);for(let t of Object.values(e))this.aliasRecordCache.set(t,e)}}}search(e){return this.aliasRecordCache.get(e)}static getNCBIName(e){const t=e.split("\\|");return t[t.length-1]}static addCaseAliases(e){const t=e.chr.toUpperCase(),i=e.chr.toLowerCase(),n=e.chr.charAt(0).toUpperCase()+e.chr.slice(1);e.chr!==t&&(e._uppercase=t),e.chr!==i&&(e._lowercase=i),e.chr!==n&&(e._cap=n)}}class Cv{aliasRecordCache=new Map;constructor(e,t,i){(t=t||{}).url=e,this.reader=new el(t,i)}async preload(e){await this.reader.preload();for(let t of e)await this.search(t)}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async search(e){if(!this.aliasRecordCache.has(e)){const t=await this.reader.search(e);if(t){Av.addCaseAliases(t);for(let e of Object.keys(t))"start"!==e&&"end"!==e&&this.aliasRecordCache.set(t[e],t)}}return this.aliasRecordCache.get(e)}async getChromosomeNames(){return await this.reader.loadHeader(),Array.from(this.reader.chrNames)}}class _v{aliasRecordCache=new Map;constructor(e,t,i){this.aliasURL=e,this.config=t,this.genome=i}async preload(){return this.loadAliases()}getChromosomeName(e){return this.aliasRecordCache.has(e)?this.aliasRecordCache.get(e).chr:e}getChromosomeAlias(e,t){const i=this.aliasRecordCache.get(e);return i&&i[t]||e}async loadAliases(){const e=await Mn.loadString(this.aliasURL,js(this.config)),t=v(e),i=t[0];i.startsWith("#")&&(this.headings=i.substring(1).split("\t").map((e=>e.trim())),this.altNameSets=this.headings.slice(1));const n=this.genome.chromosomeNames?new Set(this.genome.chromosomeNames):new Set;for(let e of t)if(!e.startsWith("#")&&e.length>0){const t=e.split("\t");let i=t.find((e=>n.has(e)));i||(i=t[0]);const r={chr:i};Av.addCaseAliases(r);for(let e=0;e<t.length;e++){r[this.headings?this.headings[e]:e]=t[e]}for(let e of Object.values(r))this.aliasRecordCache.set(e,r)}}async search(e){return 0===this.aliasRecordCache.size&&await this.loadAliases(),this.aliasRecordCache.get(e)}}class xv{constructor(e,t,i,n){this.start=e,this.end=t,this.name=i,this.stain=0,"acen"===n?this.type="c":(this.type=n.charAt(1),"p"===this.type&&(this.stain=parseInt(n.substring(4))))}}class kv{cytobandMap=new Map;constructor(e,t,i){(t=t||{}).url=e,this.source=new cl(t,i)}async getCytobands(e){if(this.cytobandMap.has(e))return this.cytobandMap.get(e);{let t=await this.#S(e);return t||(t=[]),this.cytobandMap.set(e,t),t}}async#S(e){return(await this.source.getFeatures({chr:e})).map((e=>new xv(e.start,e.end,e.name,e.gieStain)))}}class Iv{cytobands=new Map;constructor(e,t){this.url=e,this.config=t}async getCytobands(e){return 0===this.cytobands.size&&await this.#E(),this.cytobands.get(e)}async#E(){let e,t;if(Xs(this.url)){const t=on(this.url);e="";const i=t.length;for(let n=0;n<i;n++)e+=String.fromCharCode(t[n])}else e=await Mn.loadString(this.url,js(this.config));let i=[];const n=v(e);for(let e of n){const n=e.split("\t"),r=n[0];if(t||(t=r),r!==t&&(this.cytobands.set(t,i),i=[],t=r),5===n.length){const e=parseInt(n[1]),t=parseInt(n[2]),r=n[3],s=n[4];i.push(new xv(e,t,r,s))}}}async getChromosomeNames(){return 0===this.cytobands.size&&await this.#E(),Array.from(this.cytobands.keys())}async getChromosomes(){0===this.cytobands.size&&await this.#E();const e=[];let t=0;for(let[i,n]of this.cytobands.entries())e.push(new ho(i,t++,n[n.length-1].end));return e}}class Sv{#N;#M=new Map;static async createGenome(e,t){const i=new Sv(e,t);return await i.init(),i}constructor(e,t){this.config=e,this.browser=t,this.id=e.id||function(e){return void 0!==e.id?e.id:e.fastaURL&&b(e.fastaURL)&&!e.fastaURL.startsWith("data:")?e.fastaURL:e.fastaURL&&e.fastaURL.name?e.fastaURL.name:""}(e),this.name=e.name,this.nameSet=e.nameSet}async init(){const e=this.config;if(this.sequence=await Ro(e,this.browser),e.chromSizesURL?this.chromosomes=await async function(e){const t=new Map;let i;if(Xs(e)){let t=on(e);i="";for(let e of t)i+=String.fromCharCode(e)}else i=await Mn.load(e,{});const n=yo(i);let r=0;for(let e of n){const i=e.split("\t");if(i.length>1){const e=Number.parseInt(i[1]);t.set(i[0],new ho(i[0],r++,e))}}return t}(e.chromSizesURL):this.chromosomes=this.sequence.chromosomes||new Map,this.chromosomes.size>0&&(this.chromosomeNames=Array.from(this.chromosomes.keys())),e.chromAliasBbURL?(this.chromAlias=new Cv(e.chromAliasBbURL,Object.assign({},e),this),this.chromosomeNames||(this.chromosomeNames=await this.chromAlias.getChromosomeNames())):e.aliasURL?this.chromAlias=new _v(e.aliasURL,Object.assign({},e),this):this.chromosomeNames&&(this.chromAlias=new Av(this.id,this.chromosomeNames)),e.cytobandBbURL?this.cytobandSource=new kv(e.cytobandBbURL,Object.assign({},e),this):e.cytobandURL&&(this.cytobandSource=new Iv(e.cytobandURL,Object.assign({},e))),this.chromosomeNames||"function"!=typeof this.cytobandSource.getChromosomeNames||(this.chromosomeNames=await this.cytobandSource.getChromosomeNames()),0===this.chromosomes.size&&"function"==typeof this.cytobandSource.getChromosomes){const e=await this.cytobandSource.getChromosomes();for(let t of e)this.chromosomes.set(e.name,e)}if(!1!==e.wholeGenomeView&&this.chromosomes.size>0&&(e.chromosomeOrder?Array.isArray(e.chromosomeOrder)?this.#N=e.chromosomeOrder:this.#N=e.chromosomeOrder.split(",").map((e=>e.trim())):this.#N=function(e){const t=[];let i,n=1;for(let r of e.values()){if(i){if(r.bpLength<i/100)continue;i=((n-1)*i+r.bpLength)/n,t.push(r.name)}else i=r.bpLength,t.push(r.name);n++}return t}(this.chromosomes),await this.chromAlias.preload(this.#N)),this.wholeGenomeView=!1!==e.wholeGenomeView&&this.#N&&this.chromosomes.size>1,this.wholeGenomeView){const e=this.#N.reduce(((e,t)=>e+this.chromosomes.get(t).bpLength),0);this.chromosomes.set("all",new ho("all",0,e))}}get description(){return this.config.description||`${this.id}\n${this.name}`}get infoURL(){return this.config.infoURL}showWholeGenomeView(){return this.wholeGenomeView}toJSON(){return Object.assign({},this.config,{tracks:void 0})}get initialLocus(){return this.config.locus?this.config.locus:this.getHomeChromosomeName()}getHomeChromosomeName(){return this.showWholeGenomeView()&&this.chromosomes.has("all")?"all":this.chromosomeNames[0]}getChromosomeName(e){return this.chromAlias?this.chromAlias.getChromosomeName(e,this.chromosomes.keys()):e}getChromosomeDisplayName(e){return this.nameSet&&this.chromAlias&&this.chromAlias.getChromosomeAlias(e,this.nameSet)||e}getChromosome(e){return this.chromAlias&&(e=this.chromAlias.getChromosomeName(e)),this.chromosomes.get(e)}async loadChromosome(e){const t=await this.getAliasRecord(e);if(t&&(e=t.chr),!this.chromosomes.has(e)){let t;const i=await this.sequence.getSequenceRecord(e);i&&(t=new ho(e,0,i.bpLength)),this.chromosomes.set(e,t)}return this.chromosomes.get(e)}async getAliasRecord(e){if(this.#M.has(e))return this.#M.get(e);if(this.chromAlias){let t=await this.chromAlias.search(e);if(t||e===e.toLowerCase()||(t=await this.chromAlias.search(e.toLowerCase())),t){const e=t.chr.toUpperCase(),i=t.chr.toLowerCase(),n=t.chr.charAt(0).toUpperCase()+t.chr.slice(1);t.chr!==e&&(t._uppercase=e),t.chr!==i&&(t._lowercase=i),t.chr!==n&&(t._cap=n)}return this.#M.set(e,t),t}}async getCytobands(e){if(this.cytobandSource){const t=this.getChromosomeName(e);return await this.cytobandSource.getCytobands(t)}}getChromosomes(){return this.chromosomes}get wgChromosomeNames(){return this.#N?this.#N.slice():void 0}get showChromosomeWidget(){return this.config.showChromosomeWidget}getGenomeCoordinate(e,t){var i=this.getCumulativeOffset(e);if(void 0!==i)return i+t}getChromosomeCoordinate(e){let t;void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=computeCumulativeOffsets.call(this));let i=0;for(let n of this.#N){const r=this.cumulativeOffsets[n];if(r>e){return{chr:t,position:e-i}}t=n,i=r}return{chr:this.#N[this.#N.length-1],position:0}}getCumulativeOffset(e){void 0===this.cumulativeOffsets&&(this.cumulativeOffsets=function(){let e={},t=0;for(let i of this.#N){e[i]=Math.floor(t);t+=this.getChromosome(i).bpLength}return e}.call(this));const t=this.getChromosomeName(e);return this.cumulativeOffsets[t]}getGenomeLength(){if(!this.bpLength){let e=0;for(let t of this.#N){e+=this.chromosomes.get(t).bpLength}this.bpLength=e}return this.bpLength}async getSequence(e,t,i){return e=this.getChromosomeName(e),this.sequence.getSequence(e,t,i)}getSequenceInterval(e,t,i){return"function"==typeof this.sequence.getSequenceInterval?this.sequence.getSequenceInterval(e,t,i):void 0}}class Ev{constructor(){this.clear()}clear(){this.phenotypeColors=new Map,this.snps=new Set,this.qtl=null}isEmpty(){return 0===this.phenotypeColors.size&&0===this.snps.size&&null===this.qtl}addSnp(e){e=e.toUpperCase(),this.snps.add(e)}addPhenotype(e){e=e.toUpperCase();const t=this.phenotypeColors.size;if(!this.phenotypeColors.has(e.toUpperCase())){const i=t<Nv.length?Nv[t]:un.randomRGB(0,255);this.phenotypeColors.set(e.toUpperCase(),i)}}hasSnp(e){return e&&this.snps.has(e.toUpperCase())}hasPhenotype(e){return e&&this.phenotypeColors.has(e.toUpperCase())}hasQTL(e){return this.qtls.has(e)}colorForGene(e){return e?this.phenotypeColors.get(e.toUpperCase()):"black"}toJSON(){const e={};return this.phenotypeColors.size>0&&(e.phenotypes=Array.from(this.phenotypeColors.keys())),this.snps.size>0&&(e.snps=Array.from(this.snps)),this.qtl&&(e.qtl=this.qtl),e}static fromJSON(e){const t=new Ev;if(e.phenotypes)for(let i of e.phenotypes)t.addPhenotype(i);if(e.snps)for(let i of e.snps)t.addSnp(i);return e.qtl&&(t.qtl=e.qtl),t}}const Nv=[];Nv.push("rgb(228,26,28)"),Nv.push("rgb(55,126,184)"),Nv.push("rgb(77,175,74)"),Nv.push("rgb(166,86,40)"),Nv.push("rgb(152,78,163)"),Nv.push("rgb(255,127,0)"),Nv.push("rgb(247,129,191)"),Nv.push("rgb(255,255,51)"),Nv.push("rgb(102,194,165)"),Nv.push("rgb(252,141,98)"),Nv.push("rgb(141, 160, 203)"),Nv.push("rgb(231, 138, 195)"),Nv.push("rgb(166, 216, 84)"),Nv.push("rgb(255, 217, 47)"),Nv.push("rgb(229, 196, 148)"),Nv.push("rgb( 141, 211, 199)"),Nv.push("rgb(255, 255, 179)"),Nv.push("rgb(190, 186, 218)"),Nv.push("rgb(251, 128, 114)"),Nv.push("rgb(128, 177, 211)"),Nv.push("rgb(253, 180, 98)"),Nv.push("rgb(179, 222, 105)"),Nv.push("rgb(252, 205, 229)"),Nv.push("rgb(188, 128, 189)"),Nv.push("rgb(204, 235, 197)"),Nv.push("rgb(255, 237, 111)");class Mv{constructor(e,i){this.browser=i,this.columnContainer=e,this.horizontalGuide=t({class:"igv-cursor-guide-horizontal"}),e.appendChild(this.horizontalGuide),this.verticalGuide=t({class:"igv-cursor-guide-vertical"}),e.appendChild(this.verticalGuide),this.addMouseHandler(i),this.setVisibility(i.config.showCursorGuide)}addMouseHandler(e){this.boundMouseMoveHandler=function(t){t.target.tagName;const{x:i,y:n}=a(t,this.columnContainer);if(this.horizontalGuide.style.top=`${n}px`,"CANVAS"===t.target.tagName){const n=function(e,t){for(;e.parentElement;){if(e.parentElement.classList.contains(t))return e.parentElement;e=e.parentElement}return}(t.target,"igv-viewport");if(n&&e.getRulerTrackView()){this.verticalGuide.style.left=`${i}px`;const r=e.root.querySelectorAll(".igv-column");let s;const o=n.parentElement;for(let e=0;e<r.length;e++)void 0===s&&o===r[e]&&(s=e);if(void 0!==s){const i=e.getRulerTrackView().viewports[s].mouseMove(t);if(i){const{start:e,bp:t,end:n}=i,r=(t-e)/(n-e);this.customMouseHandler&&this.customMouseHandler({start:e,bp:t,end:n,interpolant:r})}}}}}.bind(this),this.columnContainer.addEventListener("mousemove",this.boundMouseMoveHandler)}removeMouseHandler(){this.columnContainer.removeEventListener("mousemove",this.boundMouseMoveHandler)}setVisibility(e){!0===e?this.show():this.hide()}show(){this.verticalGuide.style.display="block",this.horizontalGuide.style.display="block"}hide(){if(this.verticalGuide.style.display="none",this.horizontalGuide.style.display="none",this.browser.getRulerTrackView())for(let e of this.browser.getRulerTrackView().viewports)e.tooltip.style.display="none"}}class Rv{constructor(e){this.parent=e,this.container=t({class:"igv-ui-generic-dialog-container"}),e.appendChild(this.container);const i=t({class:"igv-ui-generic-dialog-header"});this.container.appendChild(i),this.label=t({class:"igv-ui-generic-dialog-one-liner"}),this.container.appendChild(this.label),this.label.textContent="Unlabeled",this.input_container=t({class:"igv-ui-generic-dialog-input"}),this.container.appendChild(this.input_container);let r='<input type="range" id="igv-slider-dialog-input" name="igv-slider-dialog-input" />';this._input=document.createRange().createContextualFragment(r).firstChild,this.input_container.appendChild(this._input),r='<output id="igv-slider-dialog-output" name="igv-slider-dialog-output" for="igv-slider-dialog-input"></output>',this._output=document.createRange().createContextualFragment(r).firstChild,this.input_container.appendChild(this._output);const s=t({class:"igv-ui-generic-dialog-ok-cancel"});this.container.appendChild(s),this.ok=t(),s.appendChild(this.ok),this.ok.textContent="OK",this.cancel=t(),s.appendChild(this.cancel),this.cancel.textContent="Cancel",n(this.container),this._input.addEventListener("input",(()=>{const e=parseFloat(this._input.value)/this._scaleFactor;this.callback(e),this._output.value=`${e.toFixed(this._precision)}`}),!1),this.ok.addEventListener("click",(()=>{if("function"==typeof this.callback){const e=parseFloat(this._input.value)/this._scaleFactor;this.callback(e),this.callback=void 0}this._input.value=void 0,n(this.container)}));const o=()=>{this._input.value=void 0,n(this.container)};this.cancel.addEventListener("click",o),u(i,o),p(this.container,i)}get value(){return Fs.sanitize(this._input.value)}present(e,t){this.label.textContent=e.label,this._scaleFactor=e.scaleFactor,this._precision=e.precision||2;const[i,n,s]=[e.min,e.max,e.value].map((e=>Math.floor(this._scaleFactor*e).toString()));this._input.min=i,this._input.max=n,this._input.value=s;const o=parseFloat(s)/this._scaleFactor;this._output.value=`${o.toFixed(this._precision)}`,this.callback=e.callback||e.click,r(this.container),this.clampLocation(t.clientX,t.clientY)}clampLocation(e,t){const{width:i,height:n}=this.container.getBoundingClientRect(),r=window.innerHeight,s=window.innerWidth,o=Math.min(r-n,t),a=Math.min(s-i,e);this.container.style.left=`${a}px`,this.container.style.top=`${o}px`}}class Bv{qtlSelections=new Ev;constructor(e,i){this.config=e,this.guid=o(),this.namespace=".browser_"+this.guid,this.parent=i;let n=i.shadowRoot;if(!n){n=i.attachShadow({mode:"open"});const e=new CSSStyleSheet;e.replaceSync('.igv-ui-dropdown {\n cursor: default;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2048;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n background-color: white;\n}\n.igv-ui-dropdown > div {\n overflow-y: auto;\n overflow-x: hidden;\n background-color: white;\n}\n.igv-ui-dropdown > div > div {\n padding: 4px;\n width: 100%;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: 1px;\n background-color: white;\n}\n.igv-ui-dropdown > div > div:last-child {\n border-bottom-color: transparent;\n border-bottom-width: 0;\n}\n.igv-ui-dropdown > div > div:hover {\n cursor: pointer;\n background-color: rgba(0, 0, 0, 0.04);\n}\n\n.igv-ui-popover {\n cursor: default;\n position: absolute;\n z-index: 2048;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: 1px;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n background-color: white;\n}\n.igv-ui-popover > div:first-child {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-width: 0;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-popover > div:first-child > div:first-child {\n margin-left: 4px;\n}\n.igv-ui-popover > div:first-child > div:last-child {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-popover > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-popover > div:last-child {\n user-select: text;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 400px;\n max-width: 800px;\n background-color: white;\n border-bottom-width: 0;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-ui-popover > div:last-child > div {\n margin-left: 4px;\n margin-right: 4px;\n min-width: 220px;\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.igv-ui-popover > div:last-child > div > span {\n font-weight: bolder;\n}\n.igv-ui-popover > div:last-child hr {\n width: 100%;\n}\n\n.igv-ui-alert-dialog-container {\n position: fixed;\n top: 20%;\n left: 50%;\n transform: translateX(-50%);\n z-index: 2048;\n box-sizing: content-box;\n width: 400px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n outline: none;\n font-family: "Open Sans", sans-serif;\n font-size: 15px;\n font-weight: 400;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:first-child {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-alert-dialog-container > div:first-child div:first-child {\n padding-left: 8px;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body {\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n color: #373737;\n width: 100%;\n height: calc(100% - 24px - 64px);\n overflow-y: scroll;\n}\n.igv-ui-alert-dialog-container .igv-ui-alert-dialog-body .igv-ui-alert-dialog-body-copy {\n margin: 16px;\n width: auto;\n height: auto;\n overflow-wrap: break-word;\n word-break: break-word;\n background-color: white;\n border: unset;\n}\n.igv-ui-alert-dialog-container > div:last-child {\n width: 100%;\n margin-bottom: 10px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-ui-alert-dialog-container > div:last-child div {\n margin: unset;\n width: 40px;\n height: 30px;\n line-height: 30px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n border-color: #2B81AF;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-alert-dialog-container > div:last-child div:hover {\n cursor: pointer;\n border-color: #25597f;\n background-color: #25597f;\n}\n\n.igv-ui-generic-dialog-container {\n box-sizing: content-box;\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n width: 300px;\n height: fit-content;\n padding-bottom: 16px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input > div {\n width: fit-content;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input input[type=range] {\n width: 70%;\n -webkit-appearance: none;\n background: linear-gradient(90deg, white, black);\n outline: none;\n margin: 0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-input output {\n display: block;\n height: 100%;\n width: 20%;\n font-size: 16px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n padding-top: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div {\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-generic-dialog-container .igv-ui-generic-dialog-ok-cancel > div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n\n.igv-ui-generic-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n width: 300px;\n height: 200px;\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n box-sizing: content-box;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-container > div:first-child {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-ui-generic-container > div:first-child > div {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-ui-generic-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n background-color: #eee;\n}\n.igv-ui-generic-container > div:nth-child(2) {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ui-generic-container > div:nth-child(3) {\n box-sizing: border-box;\n position: relative;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n padding: 0.5rem;\n font-family: "Open Sans", sans-serif;\n font-size: 1rem;\n font-weight: 400;\n width: 100%;\n border-top-style: solid;\n border-top-width: thin;\n border-top-color: #373737;\n}\n.igv-ui-generic-container > div:nth-child(4) {\n width: 100%;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n\n.igv-ui-color-swatch {\n position: relative;\n box-sizing: content-box;\n display: flex;\n flex-flow: row;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n margin: 2px;\n width: 32px;\n height: 32px;\n border-style: solid;\n border-width: 0;\n border-color: white;\n border-radius: 3px;\n}\n\n.igv-ui-color-swatch-shim {\n cursor: pointer;\n position: relative;\n box-sizing: content-box;\n display: flex;\n flex-flow: row;\n flex-wrap: wrap;\n justify-content: center;\n align-items: center;\n width: 32px;\n height: 32px;\n background-color: white;\n border-style: solid;\n border-width: thin;\n border-color: white;\n border-radius: 4px;\n}\n\n.igv-ui-dialog {\n z-index: 2048;\n position: fixed;\n width: fit-content;\n height: fit-content;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n background-color: white;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n}\n.igv-ui-dialog .igv-ui-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-ui-dialog .igv-ui-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-ui-dialog .igv-ui-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-ui-dialog .igv-ui-dialog-one-liner {\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin: 8px;\n overflow-wrap: break-word;\n background-color: white;\n font-weight: bold;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel {\n width: 100%;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div {\n margin: 16px;\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child {\n background-color: #5ea4e0;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child {\n background-color: #c4c4c4;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-ui-dialog .igv-ui-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-ui-dialog .igv-ui-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-ui-panel, .igv-ui-panel-row, .igv-ui-panel-column {\n z-index: 2048;\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-panel-column {\n display: flex;\n flex-direction: column;\n}\n\n.igv-ui-panel-row {\n display: flex;\n flex-direction: row;\n}\n\n.igv-ui-textbox {\n background-color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n display: flex;\n justify-content: flex-start;\n align-items: flex-start;\n}\n\n.igv-ui-table {\n background-color: white;\n}\n\n.igv-ui-table thead {\n position: sticky;\n top: 0;\n}\n\n.igv-ui-table th {\n text-align: left;\n}\n\n.igv-ui-table td {\n padding-right: 20px;\n}\n\n.igv-ui-table tr:hover {\n background-color: lightblue;\n}\n\n.igv-ui-center-fixed {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.igv-navbar {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n box-sizing: border-box;\n width: 100%;\n color: #444;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n line-height: 32px;\n padding-left: 8px;\n padding-right: 8px;\n margin-top: 2px;\n margin-bottom: 6px;\n height: 32px;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: #f3f3f3;\n}\n.igv-navbar .igv-navbar-left-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 32px;\n line-height: 32px;\n}\n.igv-navbar .igv-navbar-left-container .igv-logo {\n width: 34px;\n height: 32px;\n margin-right: 8px;\n}\n.igv-navbar .igv-navbar-left-container .igv-current-genome {\n height: 32px;\n margin-left: 4px;\n margin-right: 4px;\n user-select: none;\n line-height: 32px;\n vertical-align: middle;\n text-align: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n height: 100%;\n width: 125px;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-chromosome-select-widget-container select {\n display: block;\n cursor: pointer;\n width: 100px;\n height: 75%;\n outline: none;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n margin-left: 8px;\n height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 240px;\n height: 22px;\n line-height: 22px;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container input.igv-search-input {\n cursor: text;\n width: 85%;\n height: 22px;\n line-height: 22px;\n font-size: 12px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n text-align: left;\n padding-left: 8px;\n margin-right: 8px;\n outline: none;\n border-style: solid;\n border-radius: 3px;\n border-width: thin;\n border-color: #bfbfbf;\n background-color: white;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-search-container .igv-search-icon-container {\n cursor: pointer;\n height: 16px;\n width: 16px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar .igv-navbar-left-container .igv-navbar-genomic-location .igv-locus-size-group .igv-windowsize-panel-container {\n margin-left: 4px;\n user-select: none;\n}\n.igv-navbar .igv-navbar-right-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container {\n position: relative;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-navbar-toggle-button-container-hidden {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n height: 100%;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget {\n color: #737373;\n font-size: 18px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget div:nth-child(even) {\n display: block;\n height: fit-content;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget input {\n display: block;\n width: 125px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 {\n color: #737373;\n font-size: 18px;\n height: 32px;\n line-height: 32px;\n margin-left: 8px;\n user-select: none;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div {\n cursor: pointer;\n margin-left: unset;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:first-child {\n height: 20px;\n width: 20px;\n margin-left: unset;\n margin-right: 4px;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:last-child {\n height: 20px;\n width: 20px;\n margin-left: 4px;\n margin-right: unset;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 div:nth-child(even) {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 input {\n width: 0;\n height: 0;\n display: none;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-900 svg {\n display: block;\n}\n.igv-navbar .igv-navbar-right-container .igv-zoom-widget-hidden {\n display: none;\n}\n\n.igv-navbar-button {\n display: block;\n box-sizing: unset;\n padding-left: 6px;\n padding-right: 6px;\n height: 18px;\n text-transform: capitalize;\n user-select: none;\n line-height: 18px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 11px;\n font-weight: 200;\n color: #737373;\n background-color: #f3f3f3;\n border-color: #737373;\n border-style: solid;\n border-width: thin;\n border-radius: 6px;\n}\n\n.igv-navbar-button:hover {\n cursor: pointer;\n}\n\n.igv-navbar-button-clicked {\n color: white;\n background-color: #737373;\n}\n\n.igv-navbar-icon-button {\n cursor: pointer;\n position: relative;\n width: 24px;\n height: 24px;\n margin-left: 4px;\n margin-right: 4px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:first-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: -18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-icon-button > div:last-child {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 18px;\n width: 24px;\n height: 24px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.igv-navbar-text-button {\n cursor: pointer;\n position: relative;\n margin-left: 2px;\n margin-right: 2px;\n border: none;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.igv-navbar-text-button > div:nth-child(2) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 0;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n.igv-navbar-text-button > div:nth-child(3) {\n z-index: 512;\n position: absolute;\n top: 36px;\n left: 42px;\n width: 38px;\n height: 18px;\n border: none;\n background-size: contain;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n#igv-text-button-label {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-inactive rect {\n stroke: #737373;\n fill: white;\n}\n.igv-navbar-text-button-svg-inactive text {\n fill: #737373;\n}\n.igv-navbar-text-button-svg-inactive tspan {\n dominant-baseline: middle;\n}\n\n.igv-navbar-text-button-svg-hover rect {\n stroke: #737373;\n fill: #737373;\n}\n.igv-navbar-text-button-svg-hover text {\n fill: white;\n}\n.igv-navbar-text-button-svg-hover tspan {\n dominant-baseline: middle;\n}\n\n#igv-save-svg-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-svg-group text {\n fill: #737373;\n}\n\n#igv-save-svg-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-svg-group:hover text {\n fill: white;\n}\n\n#igv-save-png-group rect {\n stroke: #737373;\n fill: white;\n}\n#igv-save-png-group text {\n fill: #737373;\n}\n\n#igv-save-png-group:hover rect {\n stroke: #737373;\n fill: #737373;\n}\n#igv-save-png-group:hover text {\n fill: white;\n}\n\n.igv-zoom-in-notice-container {\n z-index: 256;\n position: absolute;\n top: 8px;\n left: 50%;\n transform: translate(-50%, 0%);\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n background-color: white;\n}\n.igv-zoom-in-notice-container > div {\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 2px;\n padding-bottom: 2px;\n width: 100%;\n height: 100%;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: #3f3f3f;\n}\n\n.igv-zoom-in-notice {\n position: absolute;\n top: 10px;\n left: 50%;\n}\n.igv-zoom-in-notice div {\n position: relative;\n left: -50%;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #3f3f3f;\n background-color: rgba(255, 255, 255, 0.51);\n z-index: 64;\n}\n\n.igv-container-spinner {\n position: absolute;\n top: 90%;\n left: 50%;\n transform: translate(-50%, -50%);\n z-index: 1024;\n width: 24px;\n height: 24px;\n pointer-events: none;\n color: #737373;\n}\n\n.igv-multi-locus-close-button {\n position: absolute;\n top: 2px;\n right: 0;\n padding-left: 2px;\n padding-right: 2px;\n width: 12px;\n height: 12px;\n color: #666666;\n background-color: white;\n z-index: 1000;\n}\n.igv-multi-locus-close-button > svg {\n vertical-align: top;\n}\n\n.igv-multi-locus-close-button:hover {\n cursor: pointer;\n color: #434343;\n}\n\n.igv-multi-locus-ruler-label {\n z-index: 64;\n position: absolute;\n top: 2px;\n left: 0;\n width: 100%;\n height: 12px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-multi-locus-ruler-label > div {\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n color: rgb(16, 16, 16);\n background-color: white;\n}\n.igv-multi-locus-ruler-label > div {\n cursor: pointer;\n}\n\n.igv-multi-locus-ruler-label-square-dot {\n z-index: 64;\n position: absolute;\n left: 50%;\n top: 5%;\n transform: translate(-50%, 0%);\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-multi-locus-ruler-label-square-dot > div:first-child {\n width: 14px;\n height: 14px;\n}\n.igv-multi-locus-ruler-label-square-dot > div:last-child {\n margin-left: 16px;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n color: rgb(16, 16, 16);\n}\n\n.igv-ruler-sweeper {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 26px;\n bottom: 0;\n left: 0;\n width: 0;\n z-index: 99999;\n background-color: rgba(68, 134, 247, 0.25);\n}\n\n.igv-ruler-tooltip {\n pointer-events: none;\n z-index: 128;\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 32px;\n background-color: transparent;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-ruler-tooltip > div {\n pointer-events: none;\n width: 128px;\n height: auto;\n padding: 1px;\n color: #373737;\n font-size: 10px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n background-color: white;\n border-style: solid;\n border-width: thin;\n border-color: #373737;\n}\n\n.igv-track-label {\n position: absolute;\n left: 8px;\n top: 8px;\n width: auto;\n height: auto;\n max-width: 50%;\n padding-left: 4px;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n text-align: center;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-color: #444;\n border-radius: 2px;\n border-style: solid;\n border-width: thin;\n background-color: white;\n z-index: 128;\n cursor: pointer;\n}\n\n.igv-track-label:hover,\n.igv-track-label:focus,\n.igv-track-label:active {\n background-color: #e8e8e8;\n}\n\n.igv-track-label-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-top: 4px;\n}\n\n.igv-center-line {\n display: none;\n pointer-events: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n transform: translateX(-50%);\n z-index: 8;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n border-left-style: dashed;\n border-left-width: thin;\n border-right-style: dashed;\n border-right-width: thin;\n}\n\n.igv-center-line-wide {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(127, 127, 127, 0.51);\n}\n\n.igv-center-line-thin {\n background-color: rgba(0, 0, 0, 0);\n border-left-color: rgba(127, 127, 127, 0.51);\n border-right-color: rgba(0, 0, 0, 0);\n}\n\n.igv-cursor-guide-horizontal {\n display: none;\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 50%;\n height: 1px;\n z-index: 32;\n margin-left: 50px;\n margin-right: 54px;\n border-top-style: dotted;\n border-top-width: thin;\n border-top-color: rgba(127, 127, 127, 0.76);\n}\n\n.igv-cursor-guide-vertical {\n pointer-events: none;\n user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 50%;\n width: 1px;\n z-index: 32;\n border-left-style: dotted;\n border-left-width: thin;\n border-left-color: rgba(127, 127, 127, 0.76);\n display: none;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-generic-dialog-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n width: 300px;\n height: 200px;\n border-color: #7F7F7F;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n z-index: 2048;\n background-color: white;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-generic-dialog-container .igv-generic-dialog-header div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-generic-dialog-container .igv-generic-dialog-one-liner {\n color: #373737;\n width: 95%;\n height: 24px;\n line-height: 24px;\n text-align: left;\n margin-top: 8px;\n padding-left: 8px;\n overflow-wrap: break-word;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input {\n margin-top: 8px;\n width: 95%;\n height: 24px;\n color: #373737;\n line-height: 24px;\n padding-left: 8px;\n background-color: white;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input div {\n width: 30%;\n height: 100%;\n font-size: 16px;\n text-align: right;\n padding-right: 8px;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-label-input input {\n width: 50%;\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input {\n margin-top: 8px;\n width: calc(100% - 16px);\n height: 24px;\n color: #373737;\n line-height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n display: block;\n height: 100%;\n width: 100%;\n padding-left: 4px;\n font-family: "Open Sans", sans-serif;\n font-weight: 400;\n color: #373737;\n text-align: left;\n outline: none;\n border-style: solid;\n border-width: thin;\n border-color: #7F7F7F;\n background-color: white;\n}\n.igv-generic-dialog-container .igv-generic-dialog-input input {\n font-size: 16px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel {\n width: 100%;\n height: 28px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div {\n margin-top: 32px;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: 14px;\n font-weight: 400;\n width: 75px;\n height: 28px;\n line-height: 28px;\n text-align: center;\n border-color: transparent;\n border-style: solid;\n border-width: thin;\n border-radius: 2px;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child {\n margin-left: 32px;\n margin-right: 0;\n background-color: #5ea4e0;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child {\n margin-left: 0;\n margin-right: 32px;\n background-color: #c4c4c4;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:first-child:hover {\n cursor: pointer;\n background-color: #3b5c7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok-cancel div:last-child:hover {\n cursor: pointer;\n background-color: #7f7f7f;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok {\n width: 100%;\n height: 36px;\n margin-top: 32px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div {\n width: 98px;\n height: 36px;\n line-height: 36px;\n text-align: center;\n color: white;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n border-color: white;\n border-style: solid;\n border-width: thin;\n border-radius: 4px;\n background-color: #2B81AF;\n}\n.igv-generic-dialog-container .igv-generic-dialog-ok div:hover {\n cursor: pointer;\n background-color: #25597f;\n}\n\n.igv-generic-container {\n position: fixed;\n top: 20%;\n left: 75%;\n transform: translateX(-50%);\n z-index: 2048;\n background-color: white;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-generic-container > div:nth-child(1) {\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n height: 24px;\n width: 100%;\n background-color: #dddddd;\n}\n.igv-generic-container > div:nth-child(1) i {\n display: block;\n color: #5f5f5f;\n cursor: pointer;\n width: 14px;\n height: 14px;\n margin-right: 8px;\n margin-bottom: 4px;\n}\n\n.igv-menu-popup {\n position: absolute;\n top: 0;\n left: 0;\n width: max-content;\n max-width: 400px;\n z-index: 512;\n cursor: pointer;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background: white;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-end;\n text-align: left;\n}\n.igv-menu-popup > div:not(:first-child) {\n width: 100%;\n}\n.igv-menu-popup > div:not(:first-child) > div {\n background: white;\n}\n.igv-menu-popup > div:not(:first-child) > div.context-menu {\n padding-left: 4px;\n padding-right: 4px;\n}\n.igv-menu-popup > div:not(:first-child) > div:last-child {\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-menu-popup > div:not(:first-child) > div:hover {\n background: #efefef;\n}\n\n.igv-menu-popup-shim {\n padding-left: 8px;\n padding-right: 8px;\n padding-bottom: 1px;\n padding-top: 1px;\n}\n\n.igv-menu-popup-header {\n position: relative;\n width: 100%;\n height: 24px;\n cursor: move;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-menu-popup-header div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-menu-popup-header div:hover {\n cursor: pointer;\n color: #444;\n}\n\n.igv-menu-popup-check-container {\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n height: 20px;\n margin-right: 4px;\n background-color: transparent;\n}\n.igv-menu-popup-check-container div {\n padding-top: 2px;\n padding-left: 8px;\n}\n.igv-menu-popup-check-container div:first-child {\n position: relative;\n width: 12px;\n height: 12px;\n}\n.igv-menu-popup-check-container div:first-child svg {\n position: absolute;\n width: 12px;\n height: 12px;\n}\n\n.igv-user-feedback {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 512px;\n height: 360px;\n z-index: 2048;\n background-color: white;\n border-color: #a2a2a2;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: medium;\n font-weight: 400;\n color: #444;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n}\n.igv-user-feedback div:first-child {\n position: relative;\n height: 24px;\n width: 100%;\n background-color: white;\n border-bottom-color: #a2a2a2;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-user-feedback div:first-child div {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n background-color: transparent;\n}\n.igv-user-feedback div:first-child div:first-child {\n left: 8px;\n}\n.igv-user-feedback div:first-child div:last-child {\n cursor: pointer;\n right: 8px;\n}\n.igv-user-feedback div:last-child {\n width: 100%;\n height: calc(100% - 24px);\n border-width: 0;\n}\n.igv-user-feedback div:last-child div {\n width: auto;\n height: auto;\n margin: 8px;\n}\n\n.igv-loading-spinner-container {\n z-index: 1024;\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 32px;\n height: 32px;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: center;\n align-items: center;\n}\n.igv-loading-spinner-container > div {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n border: 4px solid rgba(128, 128, 128, 0.5);\n border-top-color: rgb(255, 255, 255);\n animation: spin 1s ease-in-out infinite;\n -webkit-animation: spin 1s ease-in-out infinite;\n}\n\n@keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@-webkit-keyframes spin {\n to {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.igv-roi-menu {\n position: absolute;\n z-index: 512;\n font-family: "Open Sans", sans-serif;\n font-size: small;\n font-weight: 400;\n color: #4b4b4b;\n background-color: white;\n width: 192px;\n border-radius: 4px;\n border-color: #7F7F7F;\n border-style: solid;\n border-width: thin;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-menu > div:first-child {\n height: 24px;\n border-top-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-color: #7F7F7F;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: flex-end;\n align-items: center;\n}\n.igv-roi-menu > div:first-child > div {\n margin-right: 4px;\n height: 12px;\n width: 12px;\n color: #7F7F7F;\n}\n.igv-roi-menu > div:first-child > div:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-menu > div:last-child {\n background-color: white;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-color: transparent;\n border-bottom-style: solid;\n border-bottom-width: 0;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n text-align: start;\n vertical-align: middle;\n}\n.igv-roi-menu > div:last-child > div {\n height: 24px;\n padding-left: 4px;\n border-bottom-style: solid;\n border-bottom-width: thin;\n border-bottom-color: #7f7f7f;\n}\n.igv-roi-menu > div:last-child > div:not(:first-child):hover {\n cursor: pointer;\n background-color: rgba(127, 127, 127, 0.1);\n}\n.igv-roi-menu > div:last-child div:first-child {\n font-style: italic;\n text-align: center;\n padding-right: 4px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.igv-roi-menu > div:last-child > div:last-child {\n border-bottom-width: 0;\n border-bottom-color: transparent;\n}\n\n.igv-roi-placeholder {\n font-style: normal;\n color: rgba(75, 75, 75, 0.6);\n}\n\n.igv-roi-table {\n position: absolute;\n z-index: 1024;\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n resize: both;\n overflow: hidden;\n width: min-content;\n max-width: 1600px;\n border-color: #7f7f7f;\n border-radius: 4px;\n border-style: solid;\n border-width: thin;\n font-family: "Open Sans", sans-serif;\n font-size: 12px;\n font-weight: 400;\n background-color: white;\n cursor: default;\n}\n.igv-roi-table > div {\n height: 24px;\n font-size: 14px;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n}\n.igv-roi-table > div:first-child {\n border-color: transparent;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-top-width: 0;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n background-color: #eee;\n cursor: move;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n}\n.igv-roi-table > div:first-child > div:first-child {\n text-align: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n margin-left: 4px;\n margin-right: 4px;\n width: calc(100% - 4px - 12px);\n}\n.igv-roi-table > div:first-child > div:last-child {\n margin-right: 4px;\n margin-bottom: 2px;\n height: 12px;\n width: 12px;\n color: #7f7f7f;\n}\n.igv-roi-table > div:first-child > div:last-child > svg {\n display: block;\n}\n.igv-roi-table > div:first-child > div:last-child:hover {\n cursor: pointer;\n color: #444;\n}\n.igv-roi-table > .igv-roi-table-description {\n padding: 4px;\n margin-left: 4px;\n word-break: break-all;\n overflow-y: auto;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-goto-explainer {\n margin-top: 5px;\n margin-left: 4px;\n color: #7F7F7F;\n font-style: italic;\n height: 24px;\n border-top: solid lightgray;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-column-titles {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n padding-right: 16px;\n background-color: white;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: #7f7f7f;\n border-bottom-style: solid;\n border-bottom-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: #7f7f7f;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-column-titles > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container {\n display: flex;\n flex-flow: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n overflow: auto;\n height: 360px;\n flex: 1 1 auto;\n background-color: transparent;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row {\n height: 24px;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div {\n font-size: 14px;\n vertical-align: middle;\n line-height: 24px;\n text-align: left;\n margin-left: 4px;\n height: 24px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n border-right-color: transparent;\n border-right-style: solid;\n border-right-width: thin;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row > div:last-child {\n border-right: unset;\n}\n.igv-roi-table > .igv-roi-table-row-container > .igv-roi-table-row-hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.igv-roi-table > div:last-child {\n min-height: 32px;\n height: 32px;\n line-height: 32px;\n border-top-color: #7f7f7f;\n border-top-style: solid;\n border-top-width: thin;\n border-bottom-color: transparent;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n border-bottom-width: 0;\n background-color: #eee;\n display: flex;\n flex-flow: row;\n flex-wrap: nowrap;\n justify-content: space-around;\n align-items: center;\n}\n\n.igv-roi-table-row-selected {\n background-color: rgba(0, 0, 0, 0.125);\n}\n\n.igv-roi-table-button {\n cursor: pointer;\n height: 20px;\n user-select: none;\n line-height: 20px;\n text-align: center;\n vertical-align: middle;\n font-family: "Open Sans", sans-serif;\n font-size: 13px;\n font-weight: 400;\n color: black;\n padding-left: 6px;\n padding-right: 6px;\n background-color: rgb(239, 239, 239);\n border-color: black;\n border-style: solid;\n border-width: thin;\n border-radius: 3px;\n}\n\n.igv-roi-table-button:hover {\n font-weight: 400;\n background-color: rgba(0, 0, 0, 0.13);\n}\n\n.igv-roi-region {\n z-index: 64;\n position: absolute;\n top: 0;\n bottom: 0;\n pointer-events: none;\n overflow: visible;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n}\n.igv-roi-region > div {\n position: relative;\n width: 100%;\n height: 8px;\n pointer-events: auto;\n}\n\n.igv-roi-menu-row {\n height: 24px;\n padding-left: 8px;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n line-height: 24px;\n background-color: white;\n}\n\n.igv-roi-menu-row-edit-description {\n width: -webkit-fill-available;\n font-size: small;\n text-align: start;\n vertical-align: middle;\n background-color: white;\n padding-left: 4px;\n padding-right: 4px;\n padding-bottom: 4px;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: stretch;\n align-items: stretch;\n}\n.igv-roi-menu-row-edit-description > label {\n margin-left: 2px;\n margin-bottom: 0;\n display: block;\n width: -webkit-fill-available;\n}\n.igv-roi-menu-row-edit-description > input {\n display: block;\n margin-left: 2px;\n margin-right: 2px;\n margin-bottom: 1px;\n width: -webkit-fill-available;\n}\n\n.picker_wrapper.no_alpha .picker_alpha {\n display: none;\n}\n\n.picker_wrapper.no_editor .picker_editor {\n position: absolute;\n z-index: -1;\n opacity: 0;\n}\n\n.picker_wrapper.no_cancel .picker_cancel {\n display: none;\n}\n\n.layout_default.picker_wrapper {\n display: flex;\n flex-flow: row wrap;\n justify-content: space-between;\n align-items: stretch;\n font-size: 10px;\n width: 25em;\n padding: 0.5em;\n}\n\n.layout_default.picker_wrapper input, .layout_default.picker_wrapper button {\n font-size: 1rem;\n}\n\n.layout_default.picker_wrapper > * {\n margin: 0.5em;\n}\n\n.layout_default.picker_wrapper::before {\n content: "";\n display: block;\n width: 100%;\n height: 0;\n order: 1;\n}\n\n.layout_default .picker_slider, .layout_default .picker_selector {\n padding: 1em;\n}\n\n.layout_default .picker_hue {\n width: 100%;\n}\n\n.layout_default .picker_sl {\n flex: 1 1 auto;\n}\n\n.layout_default .picker_sl::before {\n content: "";\n display: block;\n padding-bottom: 100%;\n}\n\n.layout_default .picker_editor {\n order: 1;\n width: 6.5rem;\n}\n\n.layout_default .picker_editor input {\n width: 100%;\n height: 100%;\n}\n\n.layout_default .picker_sample {\n order: 1;\n flex: 1 1 auto;\n}\n\n.layout_default .picker_done, .layout_default .picker_cancel {\n order: 1;\n}\n\n.picker_wrapper {\n box-sizing: border-box;\n background: #f2f2f2;\n box-shadow: 0 0 0 1px silver;\n cursor: default;\n font-family: sans-serif;\n color: #444;\n pointer-events: auto;\n}\n\n.picker_wrapper:focus {\n outline: none;\n}\n\n.picker_wrapper button, .picker_wrapper input {\n box-sizing: border-box;\n border: none;\n box-shadow: 0 0 0 1px silver;\n outline: none;\n}\n\n.picker_wrapper button:focus, .picker_wrapper button:active, .picker_wrapper input:focus, .picker_wrapper input:active {\n box-shadow: 0 0 2px 1px #1e90ff;\n}\n\n.picker_wrapper button {\n padding: 0.4em 0.6em;\n cursor: pointer;\n background-color: #f5f5f5;\n background-image: linear-gradient(0deg, gainsboro, transparent);\n}\n\n.picker_wrapper button:active {\n background-image: linear-gradient(0deg, transparent, gainsboro);\n}\n\n.picker_wrapper button:hover {\n background-color: #fff;\n}\n\n.picker_selector {\n position: absolute;\n z-index: 1;\n display: block;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n border: 2px solid #fff;\n border-radius: 100%;\n box-shadow: 0 0 3px 1px #67b9ff;\n background: currentColor;\n cursor: pointer;\n}\n\n.picker_slider .picker_selector {\n border-radius: 2px;\n}\n\n.picker_hue {\n position: relative;\n background-image: linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);\n box-shadow: 0 0 0 1px silver;\n}\n\n.picker_sl {\n position: relative;\n box-shadow: 0 0 0 1px silver;\n background-image: linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%), linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%), linear-gradient(90deg, #808080, rgba(128, 128, 128, 0));\n}\n\n.picker_alpha, .picker_sample {\n position: relative;\n background: linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em, linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;\n box-shadow: 0 0 0 1px silver;\n}\n\n.picker_alpha .picker_selector, .picker_sample .picker_selector {\n background: none;\n}\n\n.picker_editor input {\n font-family: monospace;\n padding: 0.2em 0.4em;\n}\n\n.picker_sample::before {\n content: "";\n position: absolute;\n display: block;\n width: 100%;\n height: 100%;\n background: currentColor;\n}\n\n.picker_arrow {\n position: absolute;\n z-index: -1;\n}\n\n.picker_wrapper.popup {\n position: absolute;\n z-index: 2;\n margin: 1.5em;\n}\n\n.picker_wrapper.popup, .picker_wrapper.popup .picker_arrow::before, .picker_wrapper.popup .picker_arrow::after {\n background: #f2f2f2;\n box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.4);\n}\n\n.picker_wrapper.popup .picker_arrow {\n width: 3em;\n height: 3em;\n margin: 0;\n}\n\n.picker_wrapper.popup .picker_arrow::before, .picker_wrapper.popup .picker_arrow::after {\n content: "";\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n z-index: -99;\n}\n\n.picker_wrapper.popup .picker_arrow::before {\n width: 100%;\n height: 100%;\n -webkit-transform: skew(45deg);\n transform: skew(45deg);\n -webkit-transform-origin: 0 100%;\n transform-origin: 0 100%;\n}\n\n.picker_wrapper.popup .picker_arrow::after {\n width: 150%;\n height: 150%;\n box-shadow: none;\n}\n\n.popup.popup_top {\n bottom: 100%;\n left: 0;\n}\n\n.popup.popup_top .picker_arrow {\n bottom: 0;\n left: 0;\n -webkit-transform: rotate(-90deg);\n transform: rotate(-90deg);\n}\n\n.popup.popup_bottom {\n top: 100%;\n left: 0;\n}\n\n.popup.popup_bottom .picker_arrow {\n top: 0;\n left: 0;\n -webkit-transform: rotate(90deg) scale(1, -1);\n transform: rotate(90deg) scale(1, -1);\n}\n\n.popup.popup_left {\n top: 0;\n right: 100%;\n}\n\n.popup.popup_left .picker_arrow {\n top: 0;\n right: 0;\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.popup.popup_right {\n top: 0;\n left: 100%;\n}\n\n.popup.popup_right .picker_arrow {\n top: 0;\n left: 0;\n}\n\n.igv-container {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n padding-top: 4px;\n user-select: none;\n -webkit-user-select: none;\n -ms-user-select: none;\n min-height: 160px;\n}\n\n.igv-viewport {\n position: relative;\n margin-top: 5px;\n line-height: 1;\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.igv-viewport-content {\n position: relative;\n width: 100%;\n}\n.igv-viewport-content > canvas {\n position: relative;\n display: block;\n}\n\n.igv-column-container {\n position: relative;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n width: 100%;\n}\n\n.igv-column-shim {\n width: 1px;\n margin-left: 2px;\n margin-right: 2px;\n background-color: #545453;\n}\n\n.igv-axis-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 50px;\n}\n.igv-axis-column > div {\n position: relative;\n margin-top: 5px;\n width: 100%;\n}\n.igv-axis-column > div > div {\n z-index: 512;\n position: absolute;\n top: 8px;\n left: 8px;\n width: fit-content;\n height: fit-content;\n background-color: transparent;\n display: grid;\n align-items: start;\n justify-items: center;\n}\n.igv-axis-column > div > div > input {\n display: block;\n margin: unset;\n cursor: pointer;\n}\n\n.igv-column {\n position: relative;\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-info-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-sample-name-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n}\n\n.igv-scrollbar-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 14px;\n}\n.igv-scrollbar-column > div {\n position: relative;\n margin-top: 5px;\n width: 14px;\n}\n.igv-scrollbar-column > div > div {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 2px;\n width: 8px;\n border-width: 1px;\n border-style: solid;\n border-color: #c4c4c4;\n border-top-left-radius: 4px;\n border-top-right-radius: 4px;\n border-bottom-left-radius: 4px;\n border-bottom-right-radius: 4px;\n}\n.igv-scrollbar-column > div > div:hover {\n background-color: #c4c4c4;\n}\n\n.igv-track-drag-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 12px;\n background-color: white;\n}\n.igv-track-drag-column > .igv-track-drag-handle {\n z-index: 512;\n position: relative;\n cursor: pointer;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n border-top-right-radius: 6px;\n border-bottom-right-radius: 6px;\n}\n.igv-track-drag-column .igv-track-drag-handle-color {\n background-color: #c4c4c4;\n}\n.igv-track-drag-column .igv-track-drag-handle-hover-color {\n background-color: #787878;\n}\n.igv-track-drag-column .igv-track-drag-handle-selected-color {\n background-color: #0963fa;\n}\n.igv-track-drag-column > .igv-track-drag-shim {\n position: relative;\n margin-top: 5px;\n width: 100%;\n border-style: solid;\n border-width: 0;\n}\n\n.igv-gear-menu-column {\n position: relative;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: flex-start;\n box-sizing: border-box;\n height: 100%;\n width: 28px;\n}\n.igv-gear-menu-column > div {\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: center;\n margin-top: 5px;\n width: 100%;\n background: white;\n}\n.igv-gear-menu-column > div > div {\n position: relative;\n margin-top: 4px;\n width: 16px;\n height: 16px;\n color: #7F7F7F;\n}\n.igv-gear-menu-column > div > div:hover {\n cursor: pointer;\n color: #444;\n}\n\n.igv-vertical-center {\n margin: 0 !important;\n top: 50% !important;\n -ms-transform: translateY(-50%) !important;\n transform: translateY(-50%) !important;\n}\n\n/*# sourceMappingURL=igv.css.map */\n'),n.adoptedStyleSheets=[e]}if(this.root=t({class:"igv-container"}),n.appendChild(this.root),this.alert=new Os(this.root),this.columnContainer=t({class:"igv-column-container"}),this.root.appendChild(this.columnContainer),this.menuPopup=new pd(this.columnContainer),this.menuUtils=new or(this),this.initialize(e),this.trackViews=[],this.constants={dragThreshold:3,scrollThreshold:5,defaultColor:"rgb(0,0,150)",doubleClickDelay:e.doubleClickDelay||500},this.eventHandlers={},e.listeners)for(let t of Object.keys(e.listeners))this.on(t,e.listeners[t]);this.on("trackremoved",(()=>{0===this.findTracks((e=>"function"==typeof e.getSamples)).length&&(this.sampleInfoControl.setButtonVisibility(!1),this.sampleNameViewportWidth=void 0,this.showSampleNames=!1,this.sampleNameControl.setState(this.showSampleNames),this.sampleNameControl.hide(),this.layoutChange())})),this.on("didchangecolumnlayout",(()=>{if(zh.length>0){const e=zh.length;for(let t=0;t<e;t++)zh[t].dispose();zh.length=0}})),this.addEventHandlers(),this.sampleInfo=new rd(this),this.createStandardControls(e),this.roiManager=new mv(this),this.previousTrackColors=[]}get doShowROITable(){return this.roiManager.roiTableIsVisible()}initialize(e){this.flanking=e.flanking,this.crossDomainProxy=e.crossDomainProxy,this.formats=e.formats,this.trackDefaults=e.trackDefaults,this.nucleotideColors=e.nucleotideColors||Bo;for(let e of Object.keys(this.nucleotideColors))this.nucleotideColors[e.toLowerCase()]=this.nucleotideColors[e];this.doShowTrackLabels=e.showTrackLabels,this.doShowCenterLine=e.showCenterGuide,this.doShowCursorGuide=e.showCursorGuide,this.showSampleNames=e.showSampleNames,this.sampleNameViewportWidth=void 0,e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),e.search&&(this.searchConfig={type:"json",url:e.search.url,coords:void 0===e.search.coords?1:e.search.coords,chromosomeField:e.search.chromosomeField||"chromosome",startField:e.search.startField||"start",endField:e.search.endField||"end",geneField:e.search.geneField||"gene",snpField:e.search.snpField||"snp",resultsField:e.search.resultsField})}createStandardControls(e){this.setTrackLabelVisibility(e.showTrackLabels),this.navbar=new av(e,this),this.columnContainer.parentNode.insertBefore(this.navbar.navigation,this.columnContainer),!1===e.showControls&&this.navbar.hide(),this.cursorGuide=new Mv(this.columnContainer,this),this.inputDialog=new vs(this.root),this.inputDialog.container.id=`igv-input-dialog-${o()}`,this.dataRangeDialog=new ur(this,this.root),this.dataRangeDialog.container.id=`igv-data-range-dialog-${o()}`,this.genericColorPicker=new Ls({parent:this.root,width:180}),this.genericColorPicker.container.id=`igv-track-color-picker-${o()}`,this.sliderDialog=new Rv(this.root),this.sliderDialog.container.id=`igv-slider-dialog-${o()}`}getSampleNameViewportWidth(){return void 0===this.sampleNameViewportWidth||!1===this.showSampleNames?0:this.sampleNameViewportWidth}getSampleInfoViewportWidth(){return this.getSampleInfoColumnWidth()}isMultiLocusMode(){return this.referenceFrameList&&this.referenceFrameList.length>1}isMultiLocusWholeGenomeView(){if(void 0===this.referenceFrameList||1===this.referenceFrameList.length)return!1;for(let e of this.referenceFrameList)if("all"===e.chr.toLowerCase())return!0;return!1}currentLoci(){const e=e=>`${e.chr}:${e.start+1}-${e.end}`;return void 0===this.referenceFrameList||0===this.referenceFrameList.length?"":1===this.referenceFrameList.length?e(this.referenceFrameList[0]):this.referenceFrameList.map((t=>e(t)))}toSVG(){const{x:e,y:t,width:i,height:n}=this.columnContainer.getBoundingClientRect(),r=new _h({width:i,height:n,backdropColor:"white",multiLocusGap:0,viewbox:{x:0,y:0,width:i,height:n}}),s={deltaX:0,deltaY:-t};for(let e of this.trackViews)e.renderSVGContext(r,s);return s.deltaX=e,this.roiManager.renderSVGContext(this.columnContainer,r,s),r.getSerializedSvg(!0)}saveSVGtoFile(e,t){let i=this.toSVG();if(t){const e=document.createElement("svg");e.innerHTML=i,t.appendChild(e)}const n=e||"igvjs.svg",r=URL.createObjectURL(new Blob([i],{type:"application/octet-stream"}));x(n,r),URL.revokeObjectURL(r)}savePNGtoFile(e){const t=this.toSVG(),i=new Blob([t],{type:"image/svg+xml"}),n=URL.createObjectURL(i),r=document.createElement("img");r.addEventListener("load",(()=>{const t=this.columnContainer.getBoundingClientRect(),i=window.devicePixelRatio,s=t.width*i,o=t.height*i,a=document.createElement("canvas");a.width=s,a.height=o;const c=a.getContext("2d");c.scale(i,i),c.drawImage(r,0,0);const l=a.toDataURL("image/png");x(e=e||"igvjs.png",l),URL.revokeObjectURL(n)})),r.src=n}async loadSession(e){let t;return this.sampleInfo.initialize(),this.roiSets=[],t=e.url||e.file?await Bv.loadSessionFile(e):e,this.loadSessionObject(t)}static async loadSessionFile(e){const t=e.url||e.file;let i;if(e.url&&b(e.url)&&(e.url.startsWith("blob:")||e.url.startsWith("data:"))){const t=Bv.uncompressSession(e.url);i=JSON.parse(t)}else{let n=e.filename;if(n||(n=e.url?await Ks(e.url):e.file.name),n.endsWith(".xml")){const e=Mh.KNOWN_GENOMES,n=await Mn.loadString(t);i=new VF(n,e)}else if(n.endsWith("hub.txt")){i={reference:(await kh.loadHub(t,e)).getGenomeConfig()}}else{if(!n.endsWith(".json"))throw Error("Unrecognized session file format:"+n);i=await Mn.loadJson(t)}}return Ov(i)}async loadSessionObject(e){this.cleanHouseForSession(),this.config=e,e.browsers&&(e=await async function(e){const t=e.browsers[0],i={},n=new jd({url:t.url});await n.readHeaderAndFooter(),i.sampleNameViewportWidth=20,i.genome="hg38";const r=t.state.split(","),s=n.bpResolutions[Number.parseInt(r[2])],o=Number.parseInt(r[0]),a=Math.floor(Number.parseFloat(r[3])*s),c=a+Math.floor(1700*s);return i.locus=`${n.chromosomes[o].name}:${a}-${c}`,i.tracks=(t.tracks||[]).filter((e=>!("refgene"===e.format||"cellType"===e.name))),i.tracks.push({type:"shoebox",url:t.url,name:t.name,colorScale:t.colorScale,_hicFile:n}),i}(e)),this.navbar.sampleInfoControl.setButtonVisibility(!1),this.showSampleNames=e.showSampleNames||!1,this.navbar.sampleNameControl.setState(!0===this.showSampleNames),e.sampleNameViewportWidth&&(this.sampleNameViewportWidth=e.sampleNameViewportWidth),Zs(this.columnContainer,"igv-axis-column"),Zs(this.columnContainer,"igv-sample-info-column"),Zs(this.columnContainer,"igv-sample-name-column"),Zs(this.columnContainer,"igv-scrollbar-column"),Zs(this.columnContainer,"igv-track-drag-column"),Zs(this.columnContainer,"igv-gear-menu-column");const t=e.reference||e.genome;if(!t)return void console.warn("No genome or reference object specified");const i=b(t)?await Mh.expandReference(this.alert,t):t;if(await this.loadReference(i,i.locus||e.locus),this.centerLineList=this.createCenterLineList(this.columnContainer),!1!==e.showIdeogram){const e=new MF(this),t=new kd(this,this.columnContainer,e);this.trackViews.push(t)}if(!1!==e.showRuler){const e=new ld(this),t=new kd(this,this.columnContainer,e);this.trackViews.push(t)}e.qtlSelections&&(this.qtlSelections=Ev.fromJSON(e.qtlSelections)),void 0!==e.showROIOverlays&&(this.roiManager.showOverlays=e.showROIOverlays),this.roiManager.clearROIs(),e.roi?this.roiManager.loadROI(e.roi):await this.roiManager.reset();const n=[];if(e.sampleinfo)for(const t of e.sampleinfo)t.file?n.push(t.file):this.loadSampleInfo(t);const r=i.tracks||[],s=e.tracks?r.concat(e.tracks):r;0===s.filter((e=>"sequence"===e.type&&!e.url&&!e.fastaURL)).length&&s.push({type:"sequence",order:ah,removable:!1});const o=s.filter((e=>void 0!==e.file)).map((({file:e})=>e)),a=s.filter((e=>void 0!==e.indexFile)).map((({indexFile:e})=>e));a.length>0&&o.push(...a),n.length>0&&o.push(...n),o.length>0&&alert(`Local files cannot be loaded automatically.\nThis session contains references to these local files:\n${o.map((e=>` ${e}`)).join("\n")}`);const c=s.filter((e=>void 0===e.file));let l=1;for(let e of c)void 0===e.order&&(e.order=l++);await this.loadTrackList(c);for(let e of this.trackViews.filter((e=>"ruler"===e.track.type||"ideogram"===e.track.type)))await e.updateViews();return this.trackViews.some((e=>e.track.selected))&&this.navbar.setEnableTrackSelection(!0),this.updateUIWithReferenceFrameList(),this.updateLocusSearchWidget(),s}cleanHouseForSession(){for(let e of this.trackViews)e.removeDOMFromColumnContainer();this.columnContainer.querySelectorAll(".igv-axis-column, .igv-column-shim, .igv-column, .igv-sample-info-column, .igv-sample-name-column, .igv-scrollbar-column, .igv-track-drag-column, .igv-gear-menu-column").forEach((e=>e.remove())),this.trackViews=[],this.circularView&&this.circularView.clearChords()}async loadReference(e,t){let i;this.removeAllTracks(),this.roiManager.clearROIs(),this.navbar.setEnableTrackSelection(!1),i=e.gbkURL?await Bl(e.gbkURL):await Sv.createGenome(e,this);const n=void 0===this.genome||this.genome.id!==i.id;this.genome=i,this.navbar.updateGenome(i);let r=t||i.initialLocus;Array.isArray(r)&&(r=r.join(" "));if(!await this.search(r,!0))throw new Error(`Cannot set initial locus ${r}`);if(n){let t;if(e.hubURL){t=(await kh.loadHub(e.hubURL)).getGroupedTrackConfigurations()}this.fireEvent("genomechange",[{genome:i,trackConfigurations:t}]),this.circularView&&this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:$f(this.genome)})}}async loadGenome(e){let t;e.genarkAccession&&(e.url=xh(e.genarkAccession)),e.url&&(b(e.url)&&e.url.endsWith("/hub.txt")?(e.hubURL=e.url,delete e.url):"gbk"===function(e){let t;if(e instanceof File)t=e.name;else{if("string"!=typeof e)throw new Error("Input must be a File object or a URL string");t=e}const i=t.split(".").pop();return i.split("?")[0]}(e.url)&&(e.gbkURL=e.url,delete e.url));if(e.hubURL||e.url&&b(e.url)&&e.url.endsWith("/hub.txt")){t=(await kh.loadHub(e.hubURL||e.url,e)).getGenomeConfig()}else t=b(e)||!(e.url||e.fastaURL||e.twoBitURL||e.gbkURL)?await Mh.expandReference(this.alert,e):e;let i;await this.loadReference(t),i=t.gbkURL||"gbk"===t.format?[{name:"Annotations",format:"gbk",url:t.gbkURL}]:t.tracks||[];return 0===i.filter((e=>"sequence"===e.type)).length&&i.push({type:"sequence",order:ah}),await this.loadTrackList(i),await this.updateViews(),this.genome}async loadTrackHub(e){const t=Ov((await kh.loadHub(e.url,e)).getGenomeConfig());return this.loadGenome(t)}updateUIWithReferenceFrameList(){const e=this.referenceFrameList;this.isMultiLocusWholeGenomeView()||Mh.isWholeGenomeView(e[0].chr),this.navbar.navbarDidResize(),Hv(this.trackViews,this.doShowTrackLabels),this.doShowCenterLine&&Mh.isWholeGenomeView(e[0].chr)&&this.navbar.centerLineButton.boundMouseClickHandler(),this.doShowCursorGuide&&Mh.isWholeGenomeView(e[0].chr)&&this.navbar.cursorGuideButton.boundMouseClickHandler(),this.setCenterLineAndCenterLineButtonVisibility(Mh.isWholeGenomeView(e[0].chr))}setCenterLineAndCenterLineButtonVisibility(e){e?this.navbar.centerLineButton.setVisibility(!1):this.navbar.centerLineButton.setVisibility(this.config.showCenterGuideButton);for(let t of this.centerLineList)e?this.setCenterLineVisibility(!e):this.setCenterLineVisibility(this.doShowCenterLine)}setTrackLabelVisibility(e){Hv(this.trackViews,e)}setROITableVisibility(e){!0===e?this.roiManager.presentTable():this.roiManager.dismissTable()}setCursorGuideVisibility(e){e?this.cursorGuide.show():this.cursorGuide.hide()}setCustomCursorGuideMouseHandler(e){this.cursorGuide.customMouseHandler=e}setCenterLineVisibility(e){for(let t of this.centerLineList)!0===e?(t.show(),t.repaint()):t.hide()}async loadTrackList(e){let t=0;for(let i of e)void 0===i.order&&(i.order=t++);const i=[];for(let t of e)i.push(this._loadTrack(t));const n=await Promise.all(i);return this.trackViews.filter((function(e){return e.track.autoscaleGroup})).length>0&&this.updateViews(),n}async loadTrack(e){e.sync=!1!==e.sync;const t=this._loadTrack(e);return t&&e.autoscaleGroup&&(await t,this.updateViews()),t}async _loadTrack(e){b(e)&&(e=JSON.parse(e));try{if(e.hidden){const t=Hl(e,this.genome);return void await t.getFeatures({chr:"1",start:0,end:Number.MAX_SAFE_INTEGER})}const t=await this.createTrack(e);if("sampleinfo"===e.type)return void this.layoutChange();if(void 0===t)return;return this.addTrack(e,t)}catch(t){let i=t.message||t.error||t.toString();const n={401:"Access unauthorized",403:"Access forbidden",404:"Not found"};n.hasOwnProperty(i)&&(i=n[i]),i=`${i} : ${_(e.url)?e.url.name:e.url}`;const r=new Error(i);throw console.error(r),r}}async addTrack(e,t){void 0===t.order&&(t.order=this.trackViews.length);const i=new kd(this,this.columnContainer,t);if(this.trackViews.push(i),Hv(this.trackViews,this.doShowTrackLabels),"function"==typeof t.postInit)try{i.startSpinner(),await t.postInit()}finally{i.stopSpinner()}return t.autoscaleGroup||(e.sync?await i.updateViews():i.updateViews()),"function"==typeof t.hasSamples&&t.hasSamples()&&(this.sampleInfo.hasAttributes()&&this.sampleInfoControl.setButtonVisibility(!0),!1!==this.config.showSampleNameButton&&this.sampleNameControl.show()),this.reorderTracks(),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),t.trackView.enableTrackSelection(this.navbar.getEnableTrackSelection()),t}async loadROI(e){return this.roiManager.loadROI(e,this.genome)}clearROIs(){this.roiManager.clearROIs()}async getUserDefinedROIs(){if(this.roiManager){const e=this.roiManager.getUserDefinedROISet();if(void 0===e)return[];const t=await e.getAllFeatures(),i=[];for(let e of Object.values(t))i.push(...e);return i}return[]}getRulerTrackView(){const e=this.trackViews.filter((({track:e})=>"ruler"===e.id));return e.length>0?e[0]:void 0}async createTrack(e){let t=await async function(e){return"function"==typeof e?e():e}
|
|
35
|
+
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */(e.url||e.fastaURL);if(b(t)&&(t=t.trim()),t)if(e.format)e.format=e.format.toLowerCase();else if(e.fastaURL)e.format="fasta";else if(e.sourceType)"htsget"===e.sourceType&&await Dc.inferFormat(e);else{const t=await wf(e);t&&(e.format=t)}e.type&&qs(e);let i=e.type?e.type.toLowerCase():void 0;if(!i){if(!e.format)throw Error(`Unrecognized track: ${JSON.stringify(e)}`);if("hic"===e.format){const t=new jd(e);if(await t.readHeaderAndFooter(),!t.chromosomeIndexMap.celltype)throw Error("'.hic' files not supported");i="shoebox",e._hicFile=t}else if(i=Vs(e.format),"bedtype"===i){const t=Hl(e,this.genome);e._featureSource=t;const n=await t.trackType();i=n||"annotation"}e.type=i}if(this.trackDefaults&&i){const t=this.trackDefaults[i];if(t)for(let i in t)t.hasOwnProperty(i)&&void 0===e[i]&&(e[i]=t[i])}const n=function(e,t,i){let n;switch(e){case"annotation":case"genes":case"fusionjuncspan":case"snp":n="feature";break;case"seg":case"maf":case"mut":n="seg";break;case"junctions":case"splicejunctions":n="junction";break;default:n=e}return OF.has(n)?OF.get(n)(t,i):void 0}(i,e,this);if(void 0!==n)return e.roi&&e.roi.length>0&&(n.roiSets=e.roi.map((e=>new yv(e,this.genome)))),n;this.alert.present(new Error(`Error creating track. Could not determine track type for file: ${e.url||e}`),void 0)}reorderTracks(){this.trackViews.sort((function(e,t){const i=e=>"ideogram"===e.track.id?1:"ruler"===e.track.id?2:3,n=i(e),r=i(t);if(n===r){return(e.track.order||0)-(t.track.order||0)}return n-r}));for(let{axis:e,viewports:t,sampleInfoViewport:i,sampleNameViewport:n,outerScroll:r,dragHandle:s,gearContainer:o}of this.trackViews){e.remove();for(let{viewportElement:e}of t)e.parentNode.removeChild(e);i.viewport.remove(),n.viewport.remove(),r.remove(),s.remove(),o.remove()}const e=this.columnContainer.querySelectorAll(".igv-column");for(let{axis:t,viewports:i,sampleInfoViewport:n,sampleNameViewport:r,outerScroll:s,dragHandle:o,gearContainer:a}of this.trackViews){this.columnContainer.querySelector(".igv-axis-column").appendChild(t);for(let t=0;t<e.length;t++){const{viewportElement:n}=i[t];e[t].appendChild(n)}this.columnContainer.querySelector(".igv-sample-info-column").appendChild(n.viewport),this.columnContainer.querySelector(".igv-sample-name-column").appendChild(r.viewport),this.columnContainer.querySelector(".igv-scrollbar-column").appendChild(s),this.columnContainer.querySelector(".igv-track-drag-column").appendChild(o),this.columnContainer.querySelector(".igv-gear-menu-column").appendChild(a)}}getTrackOrder(){return this.trackViews.filter((e=>e.track&&e.track.name)).map((e=>e.track.name))}getSelectedTrackViews(){return this.trackViews.filter((e=>!0===e.track.selected))}removeTrackByName(e){const t=this.trackViews.slice();for(let i of t)e===i.track.name&&this.removeTrack(i.track)}removeTrack(e){for(let t of this.trackViews)if(e===t.track){this._removeTrack(t.track);break}}_removeTrack(e){e.disposed||(this.trackViews.splice(this.trackViews.indexOf(e.trackView),1),this.fireEvent("trackremoved",[e]),this.fireEvent("trackorderchanged",[this.getTrackOrder()]),e.trackView&&e.trackView.dispose())}removeAllTracks(){const e=this.trackViews;this.trackViews=[];for(let t of e)"ruler"!==t.track.id&&"ideogram"!==t.track.id?(this.fireEvent("trackremoved",[t.track]),t.dispose()):this.trackViews.push(t)}get ideogramTrackView(){return this.trackViews[0]}get rulerTrackView(){return this.trackViews[1]}findTracks(e,t){let i="function"==typeof e?t=>e(t.track):i=>t===i.track[e];return this.trackViews.filter(i).map((e=>e.track))}get tracks(){return this.trackViews.map((e=>e.track)).filter((e=>void 0!==e))}setTrackHeight(e){this.trackHeight=e,this.trackViews.forEach((function(t){t.setTrackHeight(e)}))}async visibilityChange(){this.layoutChange()}async layoutChange(){if(this.referenceFrameList.find((e=>e.bpPerPixel<0))){const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel=(t.end-t.start)/e}this.referenceFrameList&&this.navbar.navbarDidResize(),Dv.call(this),this.roiManager.updateROIRegionPositions(),await this.updateViews()}async updateViews(){const e=this.trackViews;this.updateLocusSearchWidget();for(let e of this.referenceFrameList)e.bpPerPixel<=10&&await this.genome.getSequence(e.chr,e.start,e.start+1);for(let e of this.centerLineList)e.repaint();if(this.dragObject)for(let t of e)await t.updateViews();else{const t={},i=[];for(const n of e)if(n.track.autoscaleGroup){const e=n.track.autoscaleGroup;t[e]||(t[e]=[]),t[e].push(n)}else i.push(n);if(Object.entries(t).length>0)for(const[e,i]of Object.entries(t)){const e=await Promise.all(i.map((e=>e.getInViewFeatures()))),t=Gs(e.flat());for(const e of i)e.track.dataRange=Object.assign({},t),e.track.autoscale=!1;await Promise.all(i.map((e=>e.updateViews())))}await Promise.all(i.map((e=>e.updateViews())))}}repaintViews(){for(let e of this.trackViews)e.repaintViews()}updateLocusSearchWidget(){if(!this.referenceFrameList)return;const e=this.referenceFrameList,t=this.calculateViewportWidth(this.referenceFrameList.length);for(let i of e)i.end=i.start+i.bpPerPixel*t;const i=1===e.length?this.referenceFrameList[0].chr:"",n=this.referenceFrameList.map((e=>e.getLocusString())).join(" ");this.navbar.updateLocus(n,i),this.fireEvent("locuschange",[this.referenceFrameList])}calculateViewportWidth(e){let{width:t}=this.columnContainer.getBoundingClientRect();return t-=50+this.getSampleInfoViewportWidth()+this.getSampleNameViewportWidth()+14+12+28,t-=5*(e-1),Math.floor(t/e)}minimumBases(){return this.config.minimumBases}zoomIn(){this.zoomWithScaleFactor(.5)}zoomOut(){this.zoomWithScaleFactor(2)}async zoomWithScaleFactor(e,t,i){if(!this.referenceFrameList)return;const n=this.calculateViewportWidth(this.referenceFrameList.length);let r=i?[i]:this.referenceFrameList;for(let i of r)i.zoomWithScaleFactor(this,e,n,t)}async addMultiLocusPanel(e,t,i,n){if(!this.referenceFrameList)return;const r=this.calculateViewportWidth(1+this.referenceFrameList.length),s=this.calculateViewportWidth(this.referenceFrameList.length)/this.calculateViewportWidth(1+this.referenceFrameList.length);for(let e of this.referenceFrameList)e.bpPerPixel*=s;const o=(i-t)/r,a=new QF(this.genome,e,t,i,o),c=n?this.referenceFrameList.indexOf(n):this.referenceFrameList.length-1,l=1+c,{viewportElement:h}=this.trackViews[0].viewports[c],d=lv(h.parentElement);if(this.fireEvent("didchangecolumnlayout"),l===this.referenceFrameList.length){this.referenceFrameList.push(a);for(let e of this.trackViews){const t=ed(e,d,a);e.viewports.push(t)}}else{this.referenceFrameList.splice(l,0,a);for(let e of this.trackViews){const t=ed(e,d,a);e.viewports.splice(l,0,t)}}this.centerLineList=this.createCenterLineList(this.columnContainer),Dv.call(this),await this.updateViews(!0)}createCenterLineList(e){const t=e.querySelectorAll(".igv-center-line");for(let e=0;e<t.length;e++)t[e].remove();const i=[],n=e.querySelectorAll(".igv-column");for(let e=0;e<n.length;e++)i.push(new dv(this,this.referenceFrameList[e],n[e]));return i}async removeMultiLocusPanel(e){const t=this.referenceFrameList.indexOf(e),{viewportElement:i}=this.trackViews[0].viewports[t];cv(t,i.parentElement),this.fireEvent("didchangecolumnlayout");for(let{viewports:e}of this.trackViews)e[t].dispose(),e.splice(t,1);if(this.referenceFrameList.splice(t,1),1===this.referenceFrameList.length&&this.getRulerTrackView())for(let e of this.getRulerTrackView().viewports)e.dismissLocusLabel();const n=this.calculateViewportWidth(1+this.referenceFrameList.length)/this.calculateViewportWidth(this.referenceFrameList.length);await this.rescaleForMultiLocus(n)}async gotoMultilocusPanel(e){const t=this.referenceFrameList.indexOf(e);this.columnContainer.querySelectorAll(".igv-column").forEach(((e,i)=>{i===t||e.remove()})),this.columnContainer.querySelectorAll(".igv-column-shim").forEach((e=>e.remove()));for(let e of this.trackViews){const i=e.viewports[t];e.viewports.filter(((e,i)=>i!==t)).forEach((e=>e.dispose())),e.viewports=[i]}const i=this.calculateViewportWidth(1);e.bpPerPixel=(e.end-e.start)/i,this.referenceFrameList=[e],this.trackViews.forEach((({viewports:e})=>e.forEach((e=>e.setWidth(i))))),this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}async rescaleForMultiLocus(e){const t=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList)t.bpPerPixel*=e;for(let{viewports:e}of this.trackViews)for(let i of e)i.setWidth(t);this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),await this.updateViews()}async goto(e,t,i){await this.search(e+":"+t+"-"+i)}async doSearch(e,t){const i=await this.search(e,t);return i||this.alert.present(new Error(`Unrecognized locus: <b> ${e} </b>`)),i}async search(e,t){const i=await async function(e,t){if(void 0===t||""===t.trim())return;const i=t.split(" ");let n=[];const r=async t=>{if("all"===t.trim().toLowerCase()||"*"===t)return e.genome.wholeGenomeView?{chr:"all",start:0,end:e.genome.getChromosome("all").bpLength}:void 0;let i,n;if(t.includes(":")&&(i=yF(t,e.isSoftclipped()),i&&(n=await e.genome.loadChromosome(i.chr))),!n){i=void 0;const r=await vF(e,t);r&&(i={chr:r.chr,start:r.start,end:r.end,name:(r.name||t).toUpperCase()}),i||(n=await e.genome.loadChromosome(t),n&&(i={chr:n.name}))}return i&&(n=n||await e.genome.loadChromosome(i.chr),i.chr=n.name,void 0===i.start&&void 0===i.end&&(i.start=0,i.end=n.bpLength)),i};for(let e of i){const t=await r(e);t&&n.push(t)}if(0===n.length){const e=await r(t.replaceAll(" ","+"));e&&n.push(e)}return 0===n.length?void 0:n}(this,e);if(i&&i.length>0){this.referenceFrameList=function(e,t,i,n,r,s){return e.map((e=>{const o=Object.assign({},e);if(i&&o.name&&(o.start=Math.max(0,o.start-i),o.end+=i),!s){const e=t.getChromosome(o.chr);Ws(e.bpLength,o,n)}return new QF(t,o.chr,o.start,o.end,(o.end-o.start)/r)}))}(i,this.genome,this.flanking,this.minimumBases(),this.calculateViewportWidth(i.length),this.isSoftclipped());for(let e of this.trackViews)e.removeViewportsFromColumnContainer();this.columnContainer.querySelectorAll(".igv-column-shim, .igv-column").forEach((e=>e.remove())),hv(this.columnContainer.querySelector(".igv-sample-info-column"),this.referenceFrameList.length),this.fireEvent("didchangecolumnlayout");for(let e of this.trackViews)e.createViewports(this,this.columnContainer,this.referenceFrameList);return this.centerLineList=this.createCenterLineList(this.columnContainer),this.updateUIWithReferenceFrameList(),t||await this.updateViews(),!0}return!1}async loadSampleInfo(e){await this.sampleInfo.loadSampleInfoFile(e.url);for(const{sampleInfoViewport:e}of this.trackViews)e.setWidth(this.getSampleInfoColumnWidth());this.findTracks((e=>"function"==typeof e.getSamples)).length>0&&(this.sampleInfoControl.performClickWithState(this,!0),this.sampleInfoControl.setButtonVisibility(!0));for(const{sampleInfoViewport:e}of this.trackViews)e.repaint()}getSampleInfoColumnWidth(){if(this.sampleInfo.attributeCount){const e=this.findTracks((e=>"function"==typeof e.getSamples)).length>0,t=this.sampleInfo.hasAttributes(),i=this.sampleInfoControl.showSampleInfo;return e&&t&&i?this.sampleInfo.attributeCount*ad+8:0}return 0}on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)}un(e,t){this.off(e,t)}off(e,t){if(e)if(t){const i=this.eventHandlers[e];if(i&&0!==i.length){const n=i.indexOf(t);-1!==n&&this.eventHandlers[e].splice(n,1)}else console.warn("No handlers to remove for event: "+e)}else this.eventHandlers[e]=[];else this.eventHandlers={}}fireEvent(e,t,i){const n=this.eventHandlers[e];if(void 0===n||0===n.length)return;const r=i||window;return n.map((function(e){return e.apply(r,t)}))[0]}dispose(){this.removeEventHandlers();for(let e of this.trackViews)e.dispose();this.roiManager&&this.roiManager.dispose()}toJSON(){const e={version:"3.2.2"};if(void 0!==this.showSampleNames&&(e.showSampleNames=this.showSampleNames),this.sampleNameViewportWidth&&(e.sampleNameViewportWidth=this.sampleNameViewportWidth),e.reference=this.genome.toJSON(),e.reference.fastaURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.fastaURL.name}.`);if(e.reference.indexURL instanceof File)throw new Error(`Error. Sessions cannot include local file references ${e.reference.indexURL.name}.`);const t=[];let i=this.trackViews[0];for(let{referenceFrame:e}of i.viewports){const i=e.getLocusString();t.push(i)}e.locus=1===t.length?t[0]:t;const n=this.roiManager.toJSON();n&&(e.roi=n,this.roiManager.showOverlays||(e.showROIOverlays=!1)),this.qtlSelections.isEmpty()||(e.qtlSelections=this.qtlSelections.toJSON());const r=[],s=[];for(const{track:e}of this.trackViews)try{let t;"function"==typeof e.getState?t=Pa.localFileInspection(e.getState()):e.config&&(t=Pa.localFileInspection(e.config)),t&&(t.browser&&delete t.browser,t.order=e.order,r.push(t))}catch(t){const i=`Track: ${e.name}: ${t}`;console.error(i),s.push(i)}if(s.length>0){let e=1,t="Errors encountered saving session: </br>";for(let i of s)t+=` (${e++}) ${i.toString()} <br/>`;throw Error(t)}e.tracks=r;const o=[];for(const e of r)for(const t of Object.keys(e))"file"!==t&&"indexFile"!==t||o.push(e[t]);const a=[];if(this.sampleInfo.sampleInfoFiles.length>0){const t=this.sampleInfo.toJSON();t.length>0&&(e.sampleinfo=t);for(const e of this.sampleInfo.sampleInfoFiles){const t=Pa.localFileInspection({url:e});t.file&&a.push(t.file)}a.length>0&&o.push(...a)}return o.length>0&&alert(`This session includes reference(s) to local file(s):\n${o.map((e=>` ${e}`)).join("\n")}\nLocal files cannot be loaded automatically when a saved session is restored.`),e}compressedSession(){return function(e){const t=new Uint8Array(e.length);for(var i=0;i<e.length;i++)t[i]=e.charCodeAt(i);const n=new $i(t),r=String.fromCharCode.apply(null,n);return btoa(r).replace(/\+/g,".").replace(/\//g,"_").replace(/=/g,"-")}(JSON.stringify(this.toJSON()))}sessionURL(){const e=window.location.href.slice(),t=e.indexOf("?");return(t>0?e.substring(0,t):e)+"?sessionURL=blob:"+this.compressedSession()}mouseDownOnViewport(e,t){var i;i=s(e),this.vpMouseDown={viewport:t,lastMouseX:i.x,mouseDownX:i.x,lastMouseY:i.y,mouseDownY:i.y,referenceFrame:t.referenceFrame}}cancelTrackPan(){const e=this.dragObject;this.dragObject=void 0,this.isScrolling=!1,this.vpMouseDown=void 0,e&&e.viewport.referenceFrame.start!==e.start&&(this.updateViews(),this.fireEvent("trackdragend",[e.viewport]))}isTrackPanning(){return this.dragObject}isSoftclipped(){return void 0!==this.trackViews.find((e=>!0===e.track.showSoftClips))}startTrackDrag(e){this.dragTrack=e}updateTrackDrag(e){if(e&&this.dragTrack){const t=this.dragTrack,i=this.trackViews.indexOf(e),n=this.trackViews.indexOf(t),r=this.trackViews;r[i]=t,r[n]=e;const s=this.trackViews[i].track.order;this.trackViews[n].track.order=s;const o=r.length;let a=s;if(i<n)for(let e=i+1;e<o;e++){const t=r[e].track;if(!(t.order<=a))break;t.order=Math.min(Number.MAX_SAFE_INTEGER,a+1),a=t.order}else for(let e=i-1;e>0;e--){const t=r[e].track;if(!(t.order>=a))break;t.order=Math.max(-Number.MAX_SAFE_INTEGER,a-1),a=t.order}this.reorderTracks()}}endTrackDrag(){this.dragTrack?(this.dragTrack=void 0,this.fireEvent("trackorderchanged",[this.getTrackOrder()])):this.dragTrack=void 0}addEventHandlers(){this.addWindowResizeHandler(),this.addRootMouseUpHandler(),this.addRootMouseLeaveHandler(),this.addColumnContainerEventHandlers(),this.addKeyboardHandler()}removeEventHandlers(){this.removeWindowResizeHandler(),this.removeRootMouseUpHandler(),this.removeRootMouseLeaveHandler(),this.removeColumnContainerEventHandlers(),this.removeKeyboardHandler()}addWindowResizeHandler(){this.boundWindowResizeHandler=Dv.bind(this),window.addEventListener("resize",this.boundWindowResizeHandler)}removeWindowResizeHandler(){window.removeEventListener("resize",this.boundWindowResizeHandler)}addRootMouseUpHandler(){this.boundRootMouseUpHandler=zv.bind(this),this.root.addEventListener("mouseup",this.boundRootMouseUpHandler)}removeRootMouseUpHandler(){this.root.removeEventListener("mouseup",this.boundRootMouseUpHandler)}addRootMouseLeaveHandler(){this.boundRootMouseLeaveHandler=zv.bind(this),this.root.addEventListener("mouseleave",this.boundRootMouseLeaveHandler)}removeRootMouseLeaveHandler(){this.root.removeEventListener("mouseleave",this.boundRootMouseLeaveHandler)}addColumnContainerEventHandlers(){this.boundColumnContainerMouseMoveHandler=Tv.bind(this),this.boundColumnContainerTouchMoveHandler=Tv.bind(this),this.boundColumnContainerMouseLeaveHandler=zv.bind(this),this.boundColumnContainerMouseUpHandler=zv.bind(this),this.boundColumnContainerTouchEndHandler=zv.bind(this),this.columnContainer.addEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.addEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.addEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.addEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.addEventListener("touchend",this.boundColumnContainerTouchEndHandler)}removeColumnContainerEventHandlers(){this.columnContainer.removeEventListener("mousemove",this.boundColumnContainerMouseMoveHandler),this.columnContainer.removeEventListener("touchmove",this.boundColumnContainerTouchMoveHandler),this.columnContainer.removeEventListener("mouseleave",this.boundColumnContainerMouseLeaveHandler),this.columnContainer.removeEventListener("mouseup",this.boundColumnContainerMouseUpHandler),this.columnContainer.removeEventListener("touchend",this.boundColumnContainerTouchEndHandler)}addKeyboardHandler(){this.keyUpHandler=Lv.bind(this),document.addEventListener("keyup",this.keyUpHandler)}removeKeyboardHandler(){console.log("Remove handler"),document.addEventListener("keyup",this.keyUpHandler)}static uncompressSession(e){let t;if(e.indexOf("/gzip;base64")>0){t=on(e);let i="";for(let e of t)i+=String.fromCharCode(e);return i}return function(e){e=e.replace(/\./g,"+").replace(/_/g,"/").replace(/-/g,"=");const t=atob(e),i=[];for(let e=0;e<t.length;e++)i.push(t.charCodeAt(e));const n=Yi(i);let r="";for(let e of n)r+=String.fromCharCode(e);return r}(e.substring(5))}createCircularView(e,t){var i;return t=!0===t,this.circularView=(i=this,new Vf(e,{onChordClick:(e,t,n)=>{const r=e.data,s=r.mate;function o(e){e.chr=i.genome.getChromosomeName(e.refName);let t=!1;for(let n of i.referenceFrameList){const i=Ff.fromLocusString(n.getLocusString());if(i.contains(e)){t=!0;break}if(i.overlaps(e)){n.extend(e),t=!0;break}}if(!t){const t=2e3,n=(e.start+e.end)/2;i.addMultiLocusPanel(e.chr,n-t,n+t)}}o(r),o(s)}})),this.circularViewControl=new uv(this.navbar.toggleButtonContainer,this),this.circularView.setAssembly({name:this.genome.id,id:this.genome.id,chromosomes:$f(this.genome)}),this.circularViewVisible=t,this.circularView}get circularViewVisible(){return void 0!==this.circularView&&this.circularView.visible}set circularViewVisible(e){this.circularView&&(this.circularView.visible=e,this.circularViewControl.setState(e))}get sampleInfoControl(){return this.navbar.sampleInfoControl}get overlayTrackButton(){return this.navbar.overlayTrackButton}get roiTableControl(){return this.navbar.roiTableControl}get sampleInfoControl(){return this.navbar.sampleInfoControl}get sampleNameControl(){return this.navbar.sampleNameControl}}async function Dv(){if(!this.referenceFrameList)return;const e=this.calculateViewportWidth(this.referenceFrameList.length);for(let t of this.referenceFrameList){const i=this.referenceFrameList.indexOf(t),{chr:n,genome:r}=t,{bpLength:s}=r.getChromosome(t.chr),o=t.toBP(e);Mh.isWholeGenomeView(n)||o>s?t.bpPerPixel=s/e:t.end=t.start+t.toBP(e);for(let{viewports:t}of this.trackViews)t[i].setWidth(e)}this.updateUIWithReferenceFrameList(),await this.updateViews(!0)}function Tv(e){e.preventDefault();const{x:t,y:i}=s(e);if(this.vpMouseDown){const{viewport:e,referenceFrame:n}=this.vpMouseDown,r=Math.abs(t-this.vpMouseDown.mouseDownX)>Math.abs(i-this.vpMouseDown.mouseDownY);if(!this.dragObject&&!this.isScrolling)if(r)this.vpMouseDown.mouseDownX&&Math.abs(t-this.vpMouseDown.mouseDownX)>this.constants.dragThreshold&&(this.dragObject={viewport:e,start:n.start});else if(this.vpMouseDown.mouseDownY&&Math.abs(i-this.vpMouseDown.mouseDownY)>this.constants.scrollThreshold){this.isScrolling=!0;const t=e.viewportElement.clientHeight,i=e.trackView.maxViewportContentHeight();this.vpMouseDown.r=t/i}if(this.dragObject){const i=!this.isSoftclipped();let r=this.vpMouseDown.lastMouseX-t;n.shiftPixels(r,e.viewportElement.clientWidth,i)&&this.updateViews(),this.fireEvent("trackdrag")}if(this.isScrolling){const t=this.vpMouseDown.r*(this.vpMouseDown.lastMouseY-i);e.trackView.moveScroller(t)}this.vpMouseDown.lastMouseX=t,this.vpMouseDown.lastMouseY=i}}function zv(e){this.cancelTrackPan(),this.endTrackDrag()}async function Lv(e){if(this.referenceFrameList&&!(this.referenceFrameList.length>1)&&("KeyF"===e.code||"KeyB"===e.code)){const t=this.getSelectedTrackViews();if(t.length>0){const i=t[0].track;if("function"==typeof i.nextFeatureAfter){const t=this.referenceFrameList[0],n=t.viewport?t.viewport.getWidth():this.calculateViewportWidth(this.referenceFrameList.length),r="all"===t.chr.toLowerCase(),s=i.visibilityWindow;if(r||s&&s>0&&t.bpPerPixel*n>s)return;const o="KeyF"===e.code,a=t.chr,c=t.center,l=await i.nextFeatureAfter(a,c,o);if(l){const i=await this.genome.getChromosomeName(l.chr);if(a===i){const i=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,r=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,i-r/2),t.end=i+r/2,t.bpPerPixel=(t.end-t.start)/n}else t.shift(i-c);this.updateViews()}else{t.chr=i;const r=(l.start+l.end)/2;if(e.shiftKey){const e=this.config.minimumBases||40,i=Math.max(e,1.1*(l.end-l.start));t.start=Math.max(0,r-i/2),t.end=t.start+i,t.bpPerPixel=(t.end-t.start)/n}else t.start=r-n*t.bpPerPixel/2,t.end=t.start+n*t.bpPerPixel;this.updateViews()}}}}}}function Hv(e,t){for(let{viewports:i}of e)for(let e of i)e.trackLabelElement&&(0===i.indexOf(e)&&!0===t?e.trackLabelElement.style.display="block":e.trackLabelElement.style.display="none")}let Pv=[];function Ov(e){return void 0===e.minimumBases&&(e.minimumBases=40),void 0===e.showIdeogram&&(e.showIdeogram=!0),null==e.showCytobandNames&&(e.showCytobandNames=!1),void 0===e.showCircularView&&(e.showCircularView=!1),void 0===e.showCircularViewButton&&(e.showCircularViewButton=!1),void 0===e.showTrackLabelButton&&(e.showTrackLabelButton=!0),void 0===e.showTrackLabels&&(e.showTrackLabels=!0),void 0===e.showCursorTrackingGuideButton&&(e.showCursorTrackingGuideButton=!0),void 0===e.showCursorGuide&&(e.showCursorGuide=e.showCursorTrackingGuide||!1),void 0===e.showCenterGuideButton&&(e.showCenterGuideButton=!0),void 0===e.showCenterGuide&&(e.showCenterGuide=!1),void 0===e.showSampleNames&&(e.showSampleNames=!1),void 0===e.showSVGButton&&(e.showSVGButton=!0),void 0===e.showControls&&(e.showControls=!0),void 0===e.showNavigation&&(e.showNavigation=!0),void 0===e.showRuler&&(e.showRuler=!0),void 0===e.flanking&&(e.flanking=1e3),void 0===e.pairsSupported&&(e.pairsSupported=!0),e.tracks||(e.tracks=[]),e}const Vv=Mn.setApiKey;const qv=Mn.oauth;var Qv={AlertDialog:Ps,TrackUtils:Qs,IGVGraphics:fr,MenuUtils:or,DataRangeDialog:ur,createTrack:async function(e,t){return await Bv.prototype.createTrack.call(t,e)},createBrowser:async function(e,t){void 0===t&&(t={}),Mh.KNOWN_GENOMES||await Mh.initializeGenomes(t),Ov(t),t.queryParametersSupported&&function(e){var t,i,n,r,s,o,a,c,l;let h,d,u;if(a=window.location.href,s={},t=a.indexOf("?"),i=a.lastIndexOf("#"),t>=0)for(i<0&&(i=a.length),n=t+1;n<i;)(r=a.indexOf("&",n))<0&&(r=i),2===(o=a.substring(n,r).split("=",2)).length?(c=o[0],l=decodeURIComponent(o[1]),"file"===c?h=l.split(","):"index"===c?d=l.split(","):"name"===c?u=l.split(","):"genome"===c?!l.startsWith("https://")&&!l.startsWith("http://")||l.endsWith(".json")?(e[c]=l,e.reference=void 0):e.reference={fastaURL:l,indexURL:l+".fai"}:("reference"===c&&(e.genome=void 0),e[c]=l),n=r+1):n++;if(h){e.tracks||(e.tracks=[]);for(let t=0;t<h.length;t++){if(h[t].endsWith(".xml")||h[t].endsWith(".json")){e.sessionURL=h[t];break}const i={url:h[t]};d&&d.length>t&&(i.indexURL=d[t]),u&&u.length>t&&(i.name=u[t]),e.tracks.push(i)}}}(t),t.apiKey&&Mn.setApiKey(t.apiKey),t.oauthToken&&Mn.setOauthToken(t.oauthToken),t.clientId&&!Cn()&&await async function(e){if(!google.accounts.oauth2.initTokenClient)throw new Error("Google accounts token client not loaded (https://accounts.google.com/gsi/client)");if(Cn())throw new Error("Google client is already initialized");const t={client_id:e.client_id||e.clientId,scope:e.scope||"https://www.googleapis.com/auth/userinfo.profile",state:e.state||"igv",error:e=>{throw new Error(e.type)},hint:e.hint,hosted_domain:e.hosted_domain},i=google.accounts.oauth2.initTokenClient(t);google.igv={tokenClient:i,apiKey:e.apiKey}}({client_id:t.clientId,apiKey:t.apiKey,scope:"https://www.googleapis.com/auth/userinfo.profile"});const i=new Bv(t,e);Pv.push(i);const n=t.sessionURL||t.session||t.hubURL;return n?await i.loadSession({url:n}):await i.loadSessionObject(t),i.navbar.navbarDidResize(),i},removeBrowser:function(e){e.dispose(),e.root.remove(),Pv=Pv.filter((t=>t!==e))},removeAllBrowsers:function(){for(let e of Pv)e.dispose(),e.root.remove();Pv=[]},visibilityChange:async function(){for(let e of Pv)await e.visibilityChange()},setGoogleOauthToken:function(e){return Mn.setOauthToken(e)},setOauthToken:function(e,t){return Mn.setOauthToken(e,t)},oauth:qv,version:UF,setApiKey:Vv,TrackBase:Pa,registerTrackClass:function(e,t){OF.set(e,((e,i)=>new t(e,i)))},registerTrackCreatorFunction:function(e,t){OF.set(e,t)},registerFileFormats:function(e,t){Ea[e]={fields:t}},loadSessionFile:Bv.loadSessionFile};export{Qv as default};
|
|
36
36
|
//# sourceMappingURL=igv.esm.min.js.map
|