gramene-search 1.2.87 → 1.2.88

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.
Files changed (132) hide show
  1. package/.parcel-cache/2126881b633272fa.txt +2 -2
  2. package/.parcel-cache/425346ba6a54d932 +0 -0
  3. package/.parcel-cache/878e3ffbad677982 +0 -0
  4. package/.parcel-cache/cdecf11601322051 +0 -0
  5. package/.parcel-cache/data.mdb +0 -0
  6. package/.parcel-cache/lock.mdb +0 -0
  7. package/dist/index.css +12 -0
  8. package/dist/index.css.map +1 -1
  9. package/dist/index.js +57 -77
  10. package/dist/index.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/bundles/docs.js +4 -6
  13. package/src/components/results/details/Sequences.js +36 -26
  14. package/src/components/results/details/sequences.css +11 -0
  15. package/src/demo.js +1 -1
  16. package/.parcel-cache/026731a8e03b9698 +0 -0
  17. package/.parcel-cache/1a5f979ef6ee6606 +0 -0
  18. package/.parcel-cache/1fad770eff2dc533 +0 -0
  19. package/.parcel-cache/202f4fa61a6db014 +0 -0
  20. package/.parcel-cache/23858cdca340809d +0 -0
  21. package/.parcel-cache/2d4ba3bbd11ddbd9 +0 -0
  22. package/.parcel-cache/35a4992435507d84 +0 -0
  23. package/.parcel-cache/37c075a090d2565c +0 -0
  24. package/.parcel-cache/3883b9be5c7dfe69 +0 -0
  25. package/.parcel-cache/4061111f9795474b +0 -0
  26. package/.parcel-cache/43a294e536c20194 +0 -0
  27. package/.parcel-cache/46feddc9cb9e8605 +0 -0
  28. package/.parcel-cache/4e2ad0fe4c7c6766 +0 -0
  29. package/.parcel-cache/694cecb27f308869 +0 -0
  30. package/.parcel-cache/6e02cdcba92b377e +0 -0
  31. package/.parcel-cache/8478f4910112aff7 +0 -0
  32. package/.parcel-cache/9259851a8e334934 +0 -0
  33. package/.parcel-cache/96c34caf136de38c +0 -0
  34. package/.parcel-cache/9d92913d9a5fde85 +0 -0
  35. package/.parcel-cache/9ff1685cbd169282 +0 -0
  36. package/.parcel-cache/b4cc8a95482d8318 +0 -0
  37. package/.parcel-cache/b9a229ed67a459e2 +0 -0
  38. package/.parcel-cache/bbfc6fab41a92806.txt +0 -2
  39. package/.parcel-cache/bf653d2e76cac1c0 +0 -0
  40. package/.parcel-cache/ce709637d3d0d34d +0 -0
  41. package/.parcel-cache/d60c1bf58ed31376 +0 -0
  42. package/.parcel-cache/ec0b5946ebeb81a6 +0 -0
  43. package/.parcel-cache/f005e65af5a9c51c +0 -0
  44. package/dist/static/atlasWidget.html +0 -26
  45. package/dist/static/gramene-dalliance/css/bootstrap-scoped.css +0 -4511
  46. package/dist/static/gramene-dalliance/css/dalliance-scoped.css +0 -456
  47. package/dist/static/gramene-dalliance/css/font-awesome.min.css +0 -4
  48. package/dist/static/gramene-dalliance/dalliance-all.js +0 -15
  49. package/dist/static/gramene-dalliance/fonts/FontAwesome.otf +0 -0
  50. package/dist/static/gramene-dalliance/fonts/fontawesome-webfont.eot +0 -0
  51. package/dist/static/gramene-dalliance/fonts/fontawesome-webfont.svg +0 -414
  52. package/dist/static/gramene-dalliance/fonts/fontawesome-webfont.ttf +0 -0
  53. package/dist/static/gramene-dalliance/fonts/fontawesome-webfont.woff +0 -0
  54. package/dist/static/gramene-dalliance/img/README.md +0 -3
  55. package/dist/static/gramene-dalliance/img/glyphicons-halflings.png +0 -0
  56. package/dist/static/gramene-dalliance/img/loader.gif +0 -0
  57. package/dist/static/gramene-dalliance/img/spinner_16.gif +0 -0
  58. package/dist/static/gramene-dalliance/img/spinner_192.gif +0 -0
  59. package/dist/static/gramene-dalliance/img/spinner_24.gif +0 -0
  60. package/dist/static/gramene-dalliance/img/spinner_32.gif +0 -0
  61. package/dist/static/gramene-dalliance/img/spinner_48.gif +0 -0
  62. package/dist/static/gramene-dalliance/img/spinner_96.gif +0 -0
  63. package/dist/static/gramene-dalliance/worker-all.js +0 -4
  64. package/dist/static/icons/android-chrome-192x192.png +0 -0
  65. package/dist/static/icons/apple-touch-icon-114x114.png +0 -0
  66. package/dist/static/icons/apple-touch-icon-120x120.png +0 -0
  67. package/dist/static/icons/apple-touch-icon-144x144.png +0 -0
  68. package/dist/static/icons/apple-touch-icon-152x152.png +0 -0
  69. package/dist/static/icons/apple-touch-icon-180x180.png +0 -0
  70. package/dist/static/icons/apple-touch-icon-57x57.png +0 -0
  71. package/dist/static/icons/apple-touch-icon-60x60.png +0 -0
  72. package/dist/static/icons/apple-touch-icon-72x72.png +0 -0
  73. package/dist/static/icons/apple-touch-icon-76x76.png +0 -0
  74. package/dist/static/icons/apple-touch-icon-precomposed.png +0 -0
  75. package/dist/static/icons/apple-touch-icon.png +0 -0
  76. package/dist/static/icons/favicon-16x16.png +0 -0
  77. package/dist/static/icons/favicon-32x32.png +0 -0
  78. package/dist/static/icons/favicon-96x96.png +0 -0
  79. package/dist/static/icons/favicon.ico +0 -0
  80. package/dist/static/images/e_bang.png +0 -0
  81. package/dist/static/images/genetree.png +0 -0
  82. package/dist/static/images/gramene_logo.svg +0 -69
  83. package/dist/static/images/gramene_logo_white_letters.svg +0 -69
  84. package/dist/static/images/grapevine_logo.svg +0 -70
  85. package/dist/static/images/grapevine_logo_white_letters.svg +0 -70
  86. package/dist/static/images/logo.svg +0 -71
  87. package/dist/static/images/main_logo.svg +0 -70
  88. package/dist/static/images/main_logo_white_letters.svg +0 -70
  89. package/dist/static/images/maize_logo.svg +0 -70
  90. package/dist/static/images/maize_logo_white_letters.svg +0 -70
  91. package/dist/static/images/oryza_logo.svg +0 -70
  92. package/dist/static/images/oryza_logo_white_letters.svg +0 -70
  93. package/dist/static/images/results.png +0 -0
  94. package/dist/static/images/sorghum_logo.svg +0 -2667
  95. package/dist/static/images/suggestions.png +0 -0
  96. package/dist/static/images/welcome/BLAST.png +0 -0
  97. package/dist/static/images/welcome/Biomart250.png +0 -0
  98. package/dist/static/images/welcome/ExpressionAtlas.png +0 -0
  99. package/dist/static/images/welcome/TrackHub.png +0 -0
  100. package/dist/static/images/welcome/archive.jpg +0 -0
  101. package/dist/static/images/welcome/climtools.png +0 -0
  102. package/dist/static/images/welcome/curated.png +0 -0
  103. package/dist/static/images/welcome/download.png +0 -0
  104. package/dist/static/images/welcome/ensemblgramene.png +0 -0
  105. package/dist/static/images/welcome/gene_view.png +0 -0
  106. package/dist/static/images/welcome/genomes.png +0 -0
  107. package/dist/static/images/welcome/maize/NAM.png +0 -0
  108. package/dist/static/images/welcome/maize/lox-align-overview.png +0 -0
  109. package/dist/static/images/welcome/maize/lox-expression.png +0 -0
  110. package/dist/static/images/welcome/maize/lox-homologs.png +0 -0
  111. package/dist/static/images/welcome/maize/lox-malign.png +0 -0
  112. package/dist/static/images/welcome/maize/lox-neighborhood.png +0 -0
  113. package/dist/static/images/welcome/maize/lox-pathways.png +0 -0
  114. package/dist/static/images/welcome/maize/lox-suggestions.png +0 -0
  115. package/dist/static/images/welcome/maize/lox3-neighborhood.png +0 -0
  116. package/dist/static/images/welcome/noun_553934.png +0 -0
  117. package/dist/static/images/welcome/noun_553934.svg +0 -1
  118. package/dist/static/images/welcome/pangenomes.svg +0 -1
  119. package/dist/static/images/welcome/pathways.png +0 -0
  120. package/dist/static/images/welcome/plantReactome.svg +0 -4
  121. package/dist/static/images/welcome/suggestions.png +0 -0
  122. package/dist/static/images/welcome/tools.png +0 -0
  123. package/dist/static/images/welcome/vis.png +0 -0
  124. package/dist/static/images/yeast_logo.png +0 -0
  125. package/dist/static/images/yeast_logo.svg +0 -6469
  126. package/dist/static/socialMedia.html +0 -8
  127. package/dist/static/style.css +0 -69
  128. /package/.parcel-cache/{aaa834d13c760c5a → 6a03c5c4d917ff29} +0 -0
  129. /package/.parcel-cache/{328d87ee8e027da9 → 83140fbf67e1ff3e} +0 -0
  130. /package/.parcel-cache/{37a1f6034ac61c5a → deaa0d88d4cd68bc} +0 -0
  131. /package/.parcel-cache/{06faa2578dc5a59b → ecb15b348cd84f68} +0 -0
  132. /package/.parcel-cache/{08c5f61543303fa8 → ef442219bd702b1c} +0 -0
@@ -1,15 +0,0 @@
1
- !function e(t,r,i){function n(o,a){if(!r[o]){if(!t[o]){var l="function"==typeof require&&require;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[o]={exports:{}};t[o][0].call(h.exports,function(e){var r=t[o][1][e];return n(r?r:e)},h,h.exports,e,t,r,i)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;o<i.length;o++)n(i[o]);return n}({1:[function(e,t,r){"use strict";function i(){}function n(e,t){var r=t,i=h(e,r);r+=4;for(var n=0;i>n;++n){var s=(h(e,r),h(e,r+4));r+=8+16*s}var o=h(e,r);r+=4;for(var a=1e9,l=r,u=0;o>u;++u){var c=g(e,l);if(l+=8,c){var f=c.block;c.offset>0&&(f+=65536),a>f&&(a=f);break}}return r+=8*o,{minBlockIndex:a,nbin:i,length:r-t}}function s(e,t,r,i,n){e.slice(0,10).fetch(function(s){return s?o(e,t,r,i,n):i(null,"Couldn't access BAM.")},{timeout:5e3})}function o(e,t,r,s,a){function l(e){if(!e)return s(null,"Couldn't access BAM");var t=v(e,e.byteLength),r=new Uint8Array(t),i=h(r,0);if(i!=b)return s(null,"Not a BAM file, magic=0x"+i.toString(16));for(var n=h(r,4),o="",a=0;n>a;++a)o+=String.fromCharCode(r[a+8]);var l=h(r,n+8),u=n+12;c.chrToIndex={},c.indexToChr=[];for(var a=0;l>a;++a){for(var f=h(r,u),p="",d=0;f-1>d;++d)p+=String.fromCharCode(r[u+4+d]);h(r,u+f+4);c.chrToIndex[p]=a,0==p.indexOf("chr")?c.chrToIndex[p.substring(3)]=a:c.chrToIndex["chr"+p]=a,c.indexToChr.push(p),u=u+8+f}return c.indices?s(c):void 0}function u(e){if(!e)return"Couldn't access BAI";var t=new Uint8Array(e),r=h(t,0);if(r!=w)return s(null,"Not a BAI file, magic=0x"+r.toString(16));var i=h(t,4);c.indices=[];for(var o=8,a=0;i>a;++a){var l=o,u=n(t,l);o+=u.length,f=Math.min(u.minBlockIndex,f);var p=u.nbin;p>0&&(c.indices[a]=new Uint8Array(e,l,o-l))}return!0}var c=new i;c.data=e,c.bai=t,c.indexChunks=r;var f=c.indexChunks?c.indexChunks.minBlockIndex:1e9;if(c.indexChunks){var p=c.indexChunks.chunks;c.indices=[];for(var d=0;d<p.length;d++)c.indices[d]=null;c.data.slice(0,f).fetch(l)}else c.bai.fetch(function(t){var i=u(t);i!==!0?c.bai.url&&"undefined"==typeof a?(c.bai.url=c.data.url.replace(new RegExp(".bam$"),".bai"),o(e,c.bai,r,s,!0)):s(null,i):c.data.slice(0,f).fetch(l)})}function a(){}if("undefined"!=typeof e)var l=e("./spans"),u=(l.Range,l.union,l.intersection,e("./bin")),h=u.readInt,c=u.readShort,f=u.readByte,p=(u.readInt64,u.readFloat),d=e("./lh3utils"),g=d.readVob,v=d.unbgzf,y=d.reg2bins,m=d.Chunk;var b=21840194,w=21578050,x={MULTIPLE_SEGMENTS:1,ALL_SEGMENTS_ALIGN:2,SEGMENT_UNMAPPED:4,NEXT_SEGMENT_UNMAPPED:8,REVERSE_COMPLEMENT:16,NEXT_REVERSE_COMPLEMENT:32,FIRST_SEGMENT:64,LAST_SEGMENT:128,SECONDARY_ALIGNMENT:256,QC_FAIL:512,DUPLICATE:1024,SUPPLEMENTARY:2048};i.prototype.blocksForRange=function(e,t,r){var i=this.indices[e];if(!i)return[];for(var n=y(t,r),s=[],o=0;o<n.length;++o)s[n[o]]=!0;for(var a=[],l=[],u=h(i,0),c=4,f=0;u>f;++f){var p=h(i,c),d=h(i,c+4);if(c+=8,s[p])for(var v=0;d>v;++v){var b=g(i,c),w=g(i,c+8);(4681>p?l:a).push(new m(b,w)),c+=16}else c+=16*d}for(var x=h(i,c),S=null,_=Math.min(t>>14,x-1),T=Math.min(r>>14,x-1),o=_;T>=o;++o){var C=g(i,c+4+8*o);C&&(!S||C.block<S.block||C.block==S.block&&C.offset<S.offset)&&(S=C)}var k=[];if(null!=S)for(var o=0;o<l.length;++o){var L=l[o];(L.maxv.block>S.block||L.maxv.block==S.block&&L.maxv.offset>=S.offset)&&k.push(L)}l=k;for(var A=[],o=0;o<l.length;++o)A.push(l[o]);for(var o=0;o<a.length;++o)A.push(a[o]);A.sort(function(e,t){var r=e.minv.block-t.minv.block;return 0!=r?r:e.minv.offset-t.minv.offset});var E=[];if(A.length>0){for(var O=A[0],o=1;o<A.length;++o){var R=A[o];R.minv.block==O.maxv.block?O=new m(O.minv,R.maxv):(E.push(O),O=R)}E.push(O)}return E},i.prototype.fetch=function(e,t,r,i,n){function s(){if(f>=a.length)return i(c);if(h){var e=new Uint8Array(h),u=o.readBamRecords(e,a[f].minv.offset,c,t,r,l,n);return h=null,++f,u?i(c):s()}var p=a[f],d=p.minv.block,g=p.maxv.block+65536;o.data.slice(d,g-d).fetch(function(e){return h=v(e,p.maxv.block-p.minv.block+1),s()})}var o=this;n=n||{};var a,l=this.chrToIndex[e];if(void 0===l)a=[];else{if(null===this.indices[l]&&this.indexChunks.chunks[l]){var u=this.indexChunks.chunks[l];return this.bai.slice(u[0],u[1]).fetch(function(s){var o=new Uint8Array(s);return this.indices[l]=o,this.fetch(e,t,r,i,n)}.bind(this))}a=this.blocksForRange(l,t,r),a||i(null,"Error in index fetch")}var h,c=[],f=0;s()};var S=["=","A","C","x","G","x","x","x","T","x","x","x","x","x","x","N"],_=["M","I","D","N","S","H","P","=","X","?","?","?","?","?","?","?"];i.prototype.readBamRecords=function(e,t,r,i,n,s,o){for(;;){var l=h(e,t),u=t+l+4;if(u>e.length)return!1;var d=new a,g=h(e,t+4),v=h(e,t+8),y=h(e,t+12),m=(65280&y)>>8,b=255&y,w=h(e,t+16),x=(4294901760&w)>>16,T=65535&w,C=h(e,t+20),k=h(e,t+24),L=h(e,t+28);h(e,t+32);if(d.segment=this.indexToChr[g],d.flag=x,d.pos=v,d.mq=m,o.light&&(d.seqLength=C),!o.light||o.includeName){for(var A="",E=0;b-1>E;++E)A+=String.fromCharCode(e[t+36+E]);d.readName=A}if(!o.light){k>=0&&(d.nextSegment=this.indexToChr[k],d.nextPos=L);for(var O=t+36+b,R="",F=0;T>F;++F){var M=h(e,O);R=R+(M>>4)+_[15&M],O+=4}d.cigar=R;for(var I="",B=C+1>>1,E=0;B>E;++E){var P=e[O+E];I+=S[(240&P)>>4],I.length<C&&(I+=S[15&P])}O+=B,d.seq=I;for(var D="",E=0;C>E;++E)D+=String.fromCharCode(e[O+E]+33);for(O+=C,d.quals=D;u>O;){var H,N=String.fromCharCode(e[O],e[O+1]),G=String.fromCharCode(e[O+2]);if("A"==G)H=String.fromCharCode(e[O+3]),O+=4;else if("i"==G||"I"==G)H=h(e,O+3),O+=7;else if("c"==G||"C"==G)H=e[O+3],O+=4;else if("s"==G||"S"==G)H=c(e,O+3),O+=5;else if("f"==G)H=p(e,O+3),O+=7;else if("Z"==G||"H"==G)for(O+=3,H="";;){var q=e[O++];if(0==q)break;H+=String.fromCharCode(q)}else{if("B"!=G)throw"Unknown type "+G;var U,z,j=String.fromCharCode(e[O+3]),W=h(e,O+4);if("i"==j||"I"==j||"f"==j)U=4,z="f"==j?p:h;else if("s"==j||"S"==j)U=2,z=c;else{if("c"!=j&&"C"!=j)throw"Unknown array type "+j;U=1,z=f}O+=8,H=[];for(var V=0;W>V;++V)H.push(z(e,O)),O+=U}d[N]=H}}if((!i||d.pos<=n&&d.pos+C>=i)&&(void 0===s||g==s)&&r.push(d),d.pos>n)return!0;t=u}},"undefined"!=typeof t&&(t.exports={makeBam:s,BAM_MAGIC:b,BAI_MAGIC:w,BamFlags:x})},{"./bin":4,"./lh3utils":27,"./spans":41}],2:[function(e,t,r){"use strict";function i(e){this.type=e}function n(e,t){this.parser=e,this.sink=t}function s(e,t){this.parser=e,this.sink=t,this.wigState=null}if("undefined"!=typeof e)var o=e("./spans"),a=o.Range,l=o.union,u=o.intersection,h=e("./sourceadapters"),c=h.registerParserFactory,f=e("./das"),p=f.DASStylesheet,d=f.DASStyle,g=(f.DASFeature,f.DASGroup),v=e("./utils"),y=v.shallowCopy,m=e("revalidator");i.prototype.createSession=function(e){return"wig"==this.type?new s(this,e):new n(this,e)};var b=/([^=]+)=(.+)/,w=/\s/,x=new RegExp("^[0-9]+,[0-9]+,[0-9]+");n.prototype.parse=function(e){var t=e.split(w);if(!(t.length<3)){var r=parseInt(t[1])+1,i=parseInt(t[2]),n={segment:t[0],min:r,max:i};if(t.length>3&&"."!==t[3]&&(n.label=t[3]),t.length>4&&(n.score=parseFloat(t[4])),t.length>5&&(n.orientation=t[5]),t.length>8){var s=t[8];x.test(s)&&(n.itemRgb="rgb("+s+")")}if(t.length>=12){var o=parseInt(t[6]),h=parseInt(t[7]),c=parseInt(t[9]),f=t[10].split(",").map(function(e){return parseInt(e)}),p=t[11].split(",").map(function(e){return parseInt(e)});n.type="transcript";var d=new g;if(d.id=t[3],d.type="transcript",d.notes=[],n.groups=[d],t.length>12){var v=t[12],m=v;t.length>13&&(m=t[13]);var b=new g;b.id=v,b.label=m,b.type="gene",n.groups.push(b)}for(var S=null,_=0;c>_;++_){var T=p[_]+r,C=T+f[_],k=new a(T,C);S=S?l(S,k):k}for(var L=S.ranges(),A=0;A<L.length;++A){var E=L[A],O=y(n);O.min=E.min(),O.max=E.max(),this.sink(O)}if(h>o){var R="+"==n.orientation?new a(o,h+3):new a(o-3,h),F=u(S,R);if(F){n.type="translation";for(var M=F.ranges(),I=0,A=0;A<M.length;++A){var B=A;"-"==n.orientation&&(B=M.length-A-1);var E=M[B],O=y(n);O.min=E.min(),O.max=E.max(),n.readframe=I;var P=E.max()-E.min();I=(I+P)%3,this.sink(O)}}}}else this.sink(n)}},n.prototype.flush=function(){},n.prototype.schema={properties:{segment:{description:"the name of the region containing the feature",type:"string",required:!0},min:{description:"the start position of the feature (0-based)",type:"integer",minimum:1,required:!0},max:{description:"the end position of the feature (1-based)",type:"integer",required:!0},label:{description:"the label for a feature",type:"string"},score:{description:"score of a feature",type:"float"},orientation:{description:"strand of feature",type:"string","enum":["+","-","."]},itemRGB:{description:"rgb color to draw feature",type:"string",pattern:"^rgb([0-9]+,[0-9]+,[0-9]+)$"},type:{description:"type of feature",type:"string","enum":["transcript","translation"]},readingFrame:{description:"open reading frame at the start of the interval",type:"integer",minimum:0,maximum:2},groups:{description:"list of groups that a feature belongs to",type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},label:{type:"string",required:!0},type:{type:"string",required:!0}}}}}},n.prototype.validate=function(e){var t=m.validate(e,this.schema);t.valid?this.sink(e):console.log(t.errors)},s.prototype.parse=function(e){var t=e.split(w);if("fixedStep"==t[0]){this.wigState="fixedStep",this.chr=this.pos=this.step=null,this.span=1;for(var r=1;r<t.length;++r){var i=b.exec(t[r]);i&&("chrom"==i[1]?this.chr=i[2]:"start"==i[1]?this.pos=parseInt(i[2]):"step"==i[1]?this.step=parseInt(i[2]):"span"==i[1]&&(this.span=parseInt(i[2])))}}else if("variableStep"==t[0]){this.wigState="variableStep",this.chr=null,this.span=1;for(var r=1;r<t.length;++r){var i=b.exec(t[r]);"chrom"==i[1]?this.chr=i[2]:"span"==i[1]&&(this.span=parseInt(i[2]))}}else if(this.wigState){if("fixedStep"==this.wigState){if(1!=t.length)return;var n=parseFloat(t[0]),s={segment:this.chr,min:this.pos,max:this.pos+this.span-1,score:n};this.pos+=this.step,this.sink(s)}else if("variableStep"==this.wigState){if(2!=t.length)return;var o=parseInt(t[0]),n=parseFloat(t[1]),s={segment:this.chr,min:o,max:o+this.span-1,score:n};this.sink(s)}}else{if(t.length<4)return;var s={segment:t[0],min:parseInt(t[1])+1,max:parseInt(t[2]),score:parseFloat(t[3])};this.sink(s)}},s.prototype.flush=function(){},s.prototype.schema={properties:{segment:{description:"the name of the region containing the feature",type:"string",required:!0},min:{description:"the start position of the feature",type:"integer",minimum:1,required:!0},max:{description:"the end position of the feature",type:"integer",required:!0},score:{description:"score of a feature",type:"float",required:!0}}},s.prototype.validate=function(e){var t=m.validate(e,this.schema);t.valid?this.sink(e):console.log(t.errors)},i.prototype.getStyleSheet=function(e){var t=new p;if("wig"==this.type){var r=new d;r.glyph="HISTOGRAM",r.BGCOLOR="blue",r.HEIGHT=30,t.pushStyle({type:"default"},null,r)}else{var r=new d;r.glyph="BOX",r.FGCOLOR="black",r.BGCOLOR="blue",r.HEIGHT=8,r.BUMP=!0,r.LABEL=!0,r.ZINDEX=20,t.pushStyle({type:"default"},null,r);var r=new d;r.glyph="BOX",r.FGCOLOR="black",r.BGCOLOR="red",r.HEIGHT=10,r.BUMP=!0,r.ZINDEX=20,t.pushStyle({type:"translation"},null,r);var i=new d;i.glyph="BOX",i.FGCOLOR="black",i.BGCOLOR="white",i.HEIGHT=10,i.ZINDEX=10,i.BUMP=!0,i.LABEL=!0,t.pushStyle({type:"transcript"},null,i);var n=new d;n.glyph="HISTOGRAM",n.COLOR1="white",n.COLOR2="black",n.HEIGHT=30,t.pushStyle({type:"density"},null,n)}return e(t)},c("bed",function(e){return new i(e)}),c("wig",function(e){return new i(e)})},{"./das":11,"./sourceadapters":39,"./spans":41,"./utils":56,revalidator:74}],3:[function(e,t,r){"use strict";function i(e,t){var r=e[t]+e[t+1]*E+e[t+2]*O+e[t+3]*R+e[t+4]*F;return r}function n(){}function s(e,t,r,i){this.bwg=e,this.cirTreeOffset=t,this.cirTreeLength=r,this.isSummary=i}function o(e,t,r){var s=new n;s.data=e,s.name=r,s.data.slice(0,512).salted().fetch(function(e){if(!e)return t(null,"Couldn't fetch file");var r=e,n=new Uint8Array(r),o=new Int16Array(r),a=new Int32Array(r),l=n[0]+E*n[1]+O*n[2]+R*n[3];if(l==S)s.type="bigwig";else{if(l!=T)return l==_||l==C?t(null,"Currently don't support big-endian BBI files"):t(null,"Not a supported format, magic=0x"+l.toString(16));s.type="bigbed"}s.version=o[2],s.numZoomLevels=o[3],s.chromTreeOffset=i(n,8),s.unzoomedDataOffset=i(n,16),s.unzoomedIndexOffset=i(n,24),s.fieldCount=o[16],s.definedFieldCount=o[17],s.asOffset=i(n,36),s.totalSummaryOffset=i(n,44),s.uncompressBufSize=a[13],s.extHeaderOffset=i(n,56),s.zoomLevels=[];for(var u=0;u<s.numZoomLevels;++u){var h=a[6*u+16],c=i(n,24*u+72),f=i(n,24*u+80);s.zoomLevels.push({reduction:h,dataOffset:c,indexOffset:f})}s.readChromTree(function(){s.getAutoSQL(function(e){return s.schema=e,t(s)})})},{timeout:5e3})}function a(e,t,r,i,n){this.bbi=e,this.type=t,this.fieldCount=r,this.offset=i,this.field=n}if("undefined"!=typeof e)var l=e("./spans"),u=l.Range,h=l.union,c=l.intersection,f=e("./das"),p=f.DASFeature,d=f.DASGroup,g=e("./utils"),v=g.shallowCopy,y=e("./bin"),m=y.readInt,b=e("jszlib"),w=b.inflateBuffer,x=b.arrayCopy;var S=2291137574,_=654086024,T=2273964779,C=3958540679,k=1,L=2,A=3,E=256,O=65536,R=16777216,F=4294967296,M=new RegExp("^[0-9]+,[0-9]+,[0-9]+");n.prototype.readChromTree=function(e){var t=this;this.chromsToIDs={},this.idsToChroms={},this.maxID=0;var r=this.unzoomedDataOffset,n=r-this.chromTreeOffset&3;r=r+4-n,this.data.slice(this.chromTreeOffset,r-this.chromTreeOffset).fetch(function(r){var n=new Uint8Array(r),s=new Int16Array(r),o=new Int32Array(r),a=(o[0],o[1],o[2]),l=(o[3],i(n,16),32),u=function h(e){var r=n[e],o=s[e/2+1];e+=4;for(var l=0;o>l;++l)if(0==r){e+=a;var u=i(n,e);e+=8,u-=t.chromTreeOffset,h(u)}else{for(var c="",f=0;a>f;++f){var p=n[e++];0!=p&&(c+=String.fromCharCode(p))}var d=n[e+3]<<24|n[e+2]<<16|n[e+1]<<8|n[e+0];n[e+7]<<24|n[e+6]<<16|n[e+5]<<8|n[e+4];e+=8,t.chromsToIDs[c]=d,0==c.indexOf("chr")&&(t.chromsToIDs[c.substr(3)]=d),t.idsToChroms[d]=c,t.maxID=Math.max(t.maxID,d)}};u(l),e(t)})},s.prototype.readWigData=function(e,t,r,i){var n=this.bwg.chromsToIDs[e];return void 0===n?i([]):void this.readWigDataById(n,t,r,i)},s.prototype.readWigDataById=function(e,t,r,n){var s=this;if(!this.cirHeader)return void this.bwg.data.slice(this.cirTreeOffset,48).fetch(function(i){s.cirHeader=i;var o=new Int32Array(s.cirHeader);s.cirBlockSize=o[1],s.readWigDataById(e,t,r,n)});var o=[],a=0,l=(Date.now(),function(i,n,s,o){return(0>e||i==e)&&r>=n&&s>=t}),c=function(e,t){if(s.bwg.instrument&&console.log("level="+t+"; offset="+e+"; time="+(0|Date.now())),a+=e.length,1==e.length&&e[0]-s.cirTreeOffset==48&&s.cachedCirRoot)return p(s.cachedCirRoot,0,t),--a,void(0==a&&s.fetchFeatures(l,o,n));for(var r,i=4+32*s.cirBlockSize,c=0;c<e.length;++c){var d=new u(e[c],e[c]+i);r=r?h(r,d):d}for(var g=r.ranges(),v=0;v<g.length;++v){var y=g[v];f(e,y,t)}},f=function(e,t,r,i){t.max()-t.min();s.bwg.data.slice(t.min(),t.max()-t.min()).fetch(function(i){for(var u=0;u<e.length;++u)t.contains(e[u])&&(p(i,e[u]-t.min(),r),e[u]-s.cirTreeOffset==48&&e[u]-t.min()==0&&(s.cachedCirRoot=i),--a,0==a&&s.fetchFeatures(l,o,n))})},p=function(n,s,a){var l=new Uint8Array(n),u=new Int16Array(n),h=new Int32Array(n),f=l[s],p=u[s/2+1];if(s+=4,0!=f)for(var d=0;p>d;++d){var g=s/4,v=h[g],y=h[g+1],m=h[g+2],b=h[g+3],w=i(l,s+16),x=i(l,s+24);(0>e||e>v||v==e&&r>=y)&&(0>e||m>e||m==e&&b>=t)&&o.push({offset:w,size:x}),s+=32}else{for(var S=[],d=0;p>d;++d){var g=s/4,v=h[g],y=h[g+1],m=h[g+2],b=h[g+3],w=i(l,s+16);(0>e||e>v||v==e&&r>=y)&&(0>e||m>e||m==e&&b>=t)&&S.push(w),s+=24}S.length>0&&c(S,a+1)}};c([s.cirTreeOffset+48],1)},s.prototype.fetchFeatures=function(e,t,r){var i=this;if(t.sort(function(e,t){return(0|e.offset)-(0|t.offset)}),0==t.length)r([]);else{var n=[],s=function(e,t,r,s){s||(s={});var o=new p;o._chromId=e,o.segment=i.bwg.idsToChroms[e],o.min=t,o.max=r,o.type=i.bwg.type;for(var a in s)o[a]=s[a];n.push(o)},o=function a(){if(0==t.length){Date.now();return void r(n)}var o=t[0];if(o.data)i.parseFeatures(o.data,s,e),t.splice(0,1),a();else{for(var l=o.offset,u=o.size,h=1;h<t.length&&t[h].offset==l+u;)u+=t[h].size,++h;i.bwg.data.slice(l,u).fetch(function(e){for(var r=0,n=0;u>r;){var s,o=t[n];if(i.bwg.uncompressBufSize>0)s=w(e,r+2,o.size-2);else{var l=new Uint8Array(o.size);x(new Uint8Array(e,r,o.size),0,l,0,o.size),s=l.buffer}o.data=s,r+=o.size,++n}a()})}};o()}},s.prototype.parseFeatures=function(e,t,r){var i=new Uint8Array(e);if(this.isSummary)for(var n=new Int16Array(e),s=new Int32Array(e),o=new Float32Array(e),a=e.byteLength/32,l=0;a>l;++l){var f=s[8*l],p=s[8*l+1],g=s[8*l+2],y=s[8*l+3],m=(o[8*l+4],o[8*l+5]),b=o[8*l+6];o[8*l+7];if(r(f,p+1,g)){var w={type:"bigwig",score:b/y,maxScore:m};"bigbed"==this.bwg.type&&(w.type="density"),t(f,p+1,g,w)}}else if("bigwig"==this.bwg.type){var n=new Int16Array(e),s=new Int32Array(e),o=new Float32Array(e),f=s[0],x=s[1],S=(s[2],s[3]),_=s[4],T=i[20],a=n[11];if(T==A)for(var l=0;a>l;++l){var C=o[l+6],E=x+l*S+1,O=x+l*S+_;r(f,E,O)&&t(f,E,O,{score:C})}else if(T==L)for(var l=0;a>l;++l){var p=s[2*l+6]+1,g=p+_-1,C=o[2*l+7];r(f,p,g)&&t(f,p,g,{score:C})}else if(T==k)for(var l=0;a>l;++l){var p=s[3*l+6]+1,g=s[3*l+7],C=o[3*l+8];p>g&&(p=g),r(f,p,g)&&t(f,p,g,{score:C})}else console.log("Currently not handling bwgType="+T)}else{if("bigbed"!=this.bwg.type)throw Error("Don't know what to do with "+this.bwg.type);for(var R=0,F=this.bwg.definedFieldCount,I=this.bwg.schema;R<i.length;){var f=i[R+3]<<24|i[R+2]<<16|i[R+1]<<8|i[R+0],p=i[R+7]<<24|i[R+6]<<16|i[R+5]<<8|i[R+4],g=i[R+11]<<24|i[R+10]<<16|i[R+9]<<8|i[R+8];R+=12;for(var B="";;){var P=i[R++];if(0==P)break;B+=String.fromCharCode(P)}var D,H={};if(D=B.length>0?B.split(" "):[],D.length>0&&F>3&&(H.label=D[0]),D.length>1&&F>4){var C=parseInt(D[1]);isNaN(C)||(H.score=C)}if(D.length>2&&F>5&&(H.orientation=D[2]),D.length>5&&F>8){var N=D[5];M.test(N)&&(H.itemRgb="rgb("+N+")")}if(D.length>F-3&&I)for(var G=F-3;G<D.length;++G)H[I.fields[G+3].name]=D[G];if(r(f,p+1,g,D))if(12>F)t(f,p+1,g,H);else{var q=0|D[3],U=0|D[4],z=0|D[6],j=D[7].split(","),W=D[8].split(",");if(H.exonFrames){var V=H.exonFrames.split(",");H.exonFrames=void 0}H.type="transcript";var X=new d;for(var K in H)X[K]=H[K];if(X.id=D[0],X.segment=this.bwg.idsToChroms[f],X.min=p+1,X.max=g,X.notes=[],H.groups=[X],D.length>9){var Z=H.geneName||D[9],Q=Z;D.length>10&&(Q=D[10]),H.geneName2&&(Q=H.geneName2);var Y=v(X);Y.id=Z,Y.label=Q,Y.type="gene",H.groups.push(Y)}for(var $=[],J=0;z>J;++J){var ee=(0|W[J])+p,te=ee+(0|j[J]),re=new u(ee,te);$.push(re)}for(var ie=h($),ne=ie.ranges(),se=0;se<ne.length;++se){var oe=ne[se];t(f,oe.min()+1,oe.max(),H)}if(U>q){var ae="+"==H.orientation?new u(q,U+3):new u(q-3,U),le=c(ie,ae);if(le){H.type="translation";for(var ue=le.ranges(),he=0,ce=0;ue[0].min()>ne[ce].max();)ce++;for(var se=0;se<ue.length;++se){var fe=se;"-"==H.orientation&&(fe=ue.length-se-1);var oe=ue[fe];if(H.readframe=he,V){var pe=parseInt(V[fe+ce]);"number"==typeof pe&&pe>=0&&2>=pe&&(H.readframe=pe,H.readframeExplicit=!0)}var de=oe.max()-oe.min();he=(he+de)%3,t(f,oe.min()+1,oe.max(),H)}}}}}}},s.prototype.getFirstAdjacent=function(e,t,r,i){var n=this.bwg.chromsToIDs[e];return void 0===n?i([]):void this.getFirstAdjacentById(n,t,r,i)},s.prototype.getFirstAdjacentById=function(e,t,r,n){var s=this;if(!this.cirHeader)return void this.bwg.data.slice(this.cirTreeOffset,48).fetch(function(i){s.cirHeader=i;var o=new Int32Array(s.cirHeader);s.cirBlockSize=o[1],s.getFirstAdjacentById(e,t,r,n)});var o=null,a=-1,l=-1,c=0,f=(Date.now(),function(e,t){c+=e.length;for(var r,i=4+32*s.cirBlockSize,n=0;n<e.length;++n){var o=new u(e[n],e[n]+i);r=r?h(r,o):o}for(var a=r.ranges(),l=0;l<a.length;++l){var f=a[l];p(e,f,t)}}),p=function(i,a,l,u){a.max()-a.min();s.bwg.data.slice(a.min(),a.max()-a.min()).fetch(function(u){for(var h=0;h<i.length;++h)if(a.contains(i[h])&&(d(u,i[h]-a.min(),l),--c,0==c)){if(!o)return r>0&&(0!=e||t>0)?s.getFirstAdjacentById(0,0,r,n):0>r&&(e!=s.bwg.maxID||1e9>t)?s.getFirstAdjacentById(s.bwg.maxID,1e9,r,n):n([]);s.fetchFeatures(function(i,n,s,o){return 0>r&&(e>i||t>s)||r>0&&(i>e||n>t)},[o],function(e){for(var t=null,i=-1,s=-1,o=0;o<e.length;++o){var a=e[o],l=a._chromId,u=a.min,h=a.max;(null==t||0>r&&(l>i||h>s)||r>0&&(i>l||s>u))&&(t=a,s=0>r?h:u,i=l)}return n(null!=t?[t]:[])})}})},d=function(n,u,h){var c=new Uint8Array(n),p=new Int16Array(n),d=new Int32Array(n),g=c[u],v=p[u/2+1];if(u+=4,0!=g)for(var y=0;v>y;++y){var m=u/4,b=d[m],w=d[m+1],x=d[m+2],S=d[m+3],_=i(c,u+16),T=i(c,u+24);(0>r&&(e>b||b==e&&t>=w)||r>0&&(x>e||x==e&&S>=t))&&(/_random/.exec(s.bwg.idsToChroms[b])||(null==o||0>r&&(x>a||x==a&&S>l)||r>0&&(a>b||b==a&&l>w))&&(o={offset:_,size:T},l=0>r?S:w,a=0>r?x:b)),u+=32}else{for(var C=-1,k=-1,L=-1,y=0;v>y;++y){var m=u/4,b=d[m],w=d[m+1],x=d[m+2],S=d[m+3],_=d[m+4]<<32|d[m+5];(0>r&&(e>b||b==e&&t>=w)&&x>=e||r>0&&(x>e||x==e&&S>=t)&&e>=b)&&(0>C||S>k)&&(C=_,k=0>r?S:w,L=0>r?x:b),u+=24}C>=0&&f([C],h+1)}};f([s.cirTreeOffset+48],1)},n.prototype.readWigData=function(e,t,r,i){this.getUnzoomedView().readWigData(e,t,r,i)},n.prototype.getUnzoomedView=function(){if(!this.unzoomedView){var e=4e3,t=this.zoomLevels[0];t&&(e=this.zoomLevels[0].dataOffset-this.unzoomedIndexOffset),this.unzoomedView=new s(this,this.unzoomedIndexOffset,e,!1)}return this.unzoomedView},n.prototype.getZoomedView=function(e){var t=this.zoomLevels[e];return t.view||(t.view=new s(this,t.indexOffset,4e3,!0)),t.view},n.prototype._tsFetch=function(e,t,r,i,n){var s=this;if(!(e>=this.zoomLevels.length-1)){var o;return o=0>e?this.getUnzoomedView():this.getZoomedView(e),o.readWigDataById(t,r,i,n)}if(this.topLevelReductionCache){for(var a=[],l=this.topLevelReductionCache,u=0;u<l.length;++u)l[u]._chromId==t&&a.push(l[u]);return n(a)}this.getZoomedView(this.zoomLevels.length-1).readWigDataById(-1,0,3e8,function(o){return s.topLevelReductionCache=o,s._tsFetch(e,t,r,i,n)})},n.prototype.thresholdSearch=function(e,t,r,i,n){function s(){if(0==l.length)return n(null);l.sort(function(e,t){var i=e.zoom-t.zoom;return 0!=i?i:(i=e.chrOrd-t.chrOrd,0!=i?i:e.min-t.min*r)});var e=l.splice(0,1)[0];o._tsFetch(e.zoom,e.chr,e.min,e.max,function(o){var a=r>0?0:3e8;e.fromRef&&(a=t);for(var u=0;u<o.length;++u){var h,c=o[u];if(h=void 0!=c.maxScore?c.maxScore:c.score,r>0){if(h>i)if(e.zoom<0){if(c.min>a)return n(c)}else c.max>a&&l.push({chr:e.chr,chrOrd:e.chrOrd,zoom:e.zoom-2,min:c.min,max:c.max,fromRef:e.fromRef})}else if(h>i)if(e.zoom<0){if(c.max<a)return n(c)}else c.min<a&&l.push({chr:e.chr,chrOrd:e.chrOrd,zoom:e.zoom-2,min:c.min,max:c.max,fromRef:e.fromRef})}s()})}r=0>r?-1:1;for(var o=this,a=this.chromsToIDs[e],l=[{chrOrd:0,chr:a,zoom:o.zoomLevels.length-4,min:0,max:3e8,fromRef:!0}],u=1;u<=this.maxID+1;++u){var h=(a+r*u)%(this.maxID+1);0>h&&(h+=this.maxID+1),l.push({chrOrd:u,chr:h,zoom:o.zoomLevels.length-1,min:0,max:3e8})}s()},n.prototype.getAutoSQL=function(e){return this.asOffset?void this.data.slice(this.asOffset,2048).fetch(function(t){for(var r=new Uint8Array(t),i="",n=0;n<r.length&&0!=r[n];++n)i+=String.fromCharCode(r[n]);var s=/(\w+)\s+(\w+)\s+("([^"]+)")?\s+\(\s*/,o=/([\w\[\]]+)\s+(\w+)\s*;\s*("([^"]+)")?\s*/g,a=s.exec(i);if(a){var l={declType:a[1],name:a[2],comment:a[4],fields:[]};i=i.substring(a[0]);for(var u=o.exec(i);null!=u;u=o.exec(i))l.fields.push({type:u[1],name:u[2],comment:u[4]});return e(l)}}):e(null)},n.prototype.getExtraIndices=function(e){var t=this;return this.version<4||0==this.extHeaderOffset||"bigbed"!=this.type?e(null):void this.data.slice(this.extHeaderOffset,64).fetch(function(r){if(!r)return e(null,"Couldn't fetch extension header");var n=new Uint8Array(r),s=new Int16Array(r),o=(new Int32Array(r),s[0],s[1]),l=i(n,4);return 0==o?e(null):void t.data.slice(l,20*o).fetch(function(r){if(!r)return e(null,"Couldn't fetch index info");for(var n=new Uint8Array(r),s=new Int16Array(r),l=(new Int32Array(r),[]),u=0;o>u;++u){var h=s[10*u],c=s[10*u+1],f=i(n,20*u+4),p=s[10*u+8],d=new a(t,h,c,f,p);l.push(d)}e(l)})})},a.prototype.lookup=function(e,t){var r=this;this.bbi.data.slice(this.offset,32).fetch(function(n){function s(n){r.bbi.data.slice(n,4+l*(u+h)).fetch(function(n){var o=new Uint8Array(n),a=new Uint16Array(n),l=(new Uint32Array(n),o[0]),c=a[1],f=4;if(0!=l){for(var p=0;c>p;++p){for(var d="",g=0;u>g;++g){var v=o[f++];0!=v&&(d+=String.fromCharCode(v))}if(d==e){var y=i(o,f),b=m(o,f+8);return r.bbi.getUnzoomedView().fetchFeatures(function(t,i,n,s){return s&&s.length>r.field-3?s[r.field-3]==e:void 0},[{offset:y,size:b}],t)}f+=h}return t([])}for(var w=null,p=0;c>p;++p){for(var d="",g=0;u>g;++g){var v=o[f++];0!=v&&(d+=String.fromCharCode(v))}var x=i(o,f);if(f+=8,e.localeCompare(d)<0&&w)return void s(w);w=x}s(w)})}var o=new Uint8Array(n),a=(new Int16Array(n),new Int32Array(n)),l=(a[0],a[1]),u=a[2],h=a[3],c=(i(o,16),32);s(r.offset+c)})},"undefined"!=typeof t&&(t.exports={makeBwg:o,BIG_BED_MAGIC:T,BIG_WIG_MAGIC:S})},{"./bin":4,"./das":11,"./spans":41,"./utils":56,jszlib:71}],4:[function(e,t,r){"use strict";function i(e){this.blob=e}function n(e,t,r,i){i||("object"===("undefined"==typeof t?"undefined":f(t))?(i=t,t=void 0):i={}),this.url=e,this.start=t||0,r&&(this.end=r),this.opts=i}function s(e){if(!e)return null;for(var t=new Uint8Array(e.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r);return t.buffer}function o(e,t){return x[0]=e[t],x[1]=e[t+1],x[2]=e[t+2],x[3]=e[t+3],S[0]}function a(e,t){return e[t+7]<<24|e[t+6]<<16|e[t+5]<<8|e[t+4]}function l(e,t){return e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return e[t+1]<<8|e[t]}function h(e,t){return e[t]}function c(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}var f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};if("undefined"!=typeof e)var p=e("./utils"),d=p.shallowCopy,g=e("./sha1"),v=g.b64_sha1,y=e("es6-promise").Promise;i.prototype.slice=function(e,t){var r;return r=this.blob.slice?t?this.blob.slice(e,e+t):this.blob.slice(e):t?this.blob.webkitSlice(e,e+t):this.blob.webkitSlice(e),new i(r)},i.prototype.salted=function(){return this},"undefined"!=typeof FileReader?i.prototype.fetch=function(e){var t=new FileReader;t.onloadend=function(r){e(s(t.result))},t.readAsBinaryString(this.blob)}:i.prototype.fetch=function(e){var t=new FileReaderSync;try{var r=t.readAsArrayBuffer(this.blob);e(r)}catch(i){e(null,i)}},n.prototype.slice=function(e,t){if(0>e)throw"Bad slice "+e;var r=this.start,i=this.end;return r&&e?r+=e:r=e||r,i=t&&r?r+t-1:i||t-1,new n(this.url,r,i,this.opts)};var m=0,b="undefined"!=typeof navigator&&navigator.userAgent.indexOf("Safari")>=0&&navigator.userAgent.indexOf("Chrome")<0;n.prototype.fetchAsText=function(e){var t=this;this.getURL().then(function(r){try{var i,n=new XMLHttpRequest;if((b||t.opts.salt)&&r.indexOf("?")<0&&(r=r+"?salt="+v(""+Date.now()+","+ ++m)),n.open("GET",r,!0),t.end){if(t.end-t.start>1e8)throw"Monster fetch!";n.setRequestHeader("Range","bytes="+t.start+"-"+t.end),i=t.end-t.start+1}n.onreadystatechange=function(){return 4==n.readyState?e(200==n.status||206==n.status?n.responseText:null):void 0},t.opts.credentials&&(n.withCredentials=!0),n.send()}catch(s){return e(null)}})["catch"](function(t){return console.log(t),e(null,t)})},n.prototype.salted=function(){var e=d(this.opts);return e.salt=!0,new n(this.url,this.start,this.end,e)},n.prototype.getURL=function(){return this.opts.resolver?this.opts.resolver(this.url).then(function(e){return"string"==typeof e?e:e.url}):y.resolve(this.url)},n.prototype.fetch=function(e,t){var r=this;t=t||{};var i=t.attempt||1,n=t.truncatedLength;return i>3?e(null):void this.getURL().then(function(o){try{var a;t.timeout&&!r.opts.credentials&&(a=setTimeout(function(){return console.log("timing out "+o),u.abort(),e(null,"Timeout")},t.timeout));var l,u=new XMLHttpRequest;if((b||r.opts.salt)&&o.indexOf("?")<0&&(o=o+"?salt="+v(""+Date.now()+","+ ++m)),u.open("GET",o,!0),u.overrideMimeType("text/plain; charset=x-user-defined"),r.end){if(r.end-r.start>1e8)throw"Monster fetch!";u.setRequestHeader("Range","bytes="+r.start+"-"+r.end),l=r.end-r.start+1}u.responseType="arraybuffer",u.onreadystatechange=function(){if(4==u.readyState){if(a&&clearTimeout(a),200==u.status||206==u.status){if(u.response){var t=u.response.byteLength;return!l||l==t||n&&t==n?e(u.response):r.fetch(e,{attempt:i+1,truncatedLength:t})}if(u.mozResponseArrayBuffer)return e(u.mozResponseArrayBuffer);var o=u.responseText;return!l||l==o.length||n&&o.length==n?e(s(u.responseText)):r.fetch(e,{attempt:i+1,truncatedLength:o.length})}return r.fetch(e,{attempt:i+1})}},r.opts.credentials&&(u.withCredentials=!0),u.send()}catch(h){return e(null)}})["catch"](function(t){return console.log(t),e(null,t)})};var w=new ArrayBuffer(8),x=new Uint8Array(w),S=new Float32Array(w);"undefined"!=typeof t&&(t.exports={BlobFetchable:i,URLFetchable:n,readInt:l,readIntBE:c,readInt64:a,readShort:u,readByte:h,readFloat:o})},{"./sha1":38,"./utils":56,"es6-promise":60}],5:[function(e,t,r){"use strict";function i(e){var t="bp";return e>1e9?(e/=1e9,t="Gb"):e>1e6?(e/=1e6,t="Mb"):e>1e3&&(e/=1e3,t="kb"),""+Math.round(e)+t}if("undefined"!=typeof e){var n=e("./cbrowser"),s=n.Browser,o=e("./utils"),a=o.makeElement,l=(o.removeChildren,e("./numformats")),u=l.formatLongInt,h=e("./zoomslider");e("./tier-edit"),e("./export-config"),e("./export-ui"),e("./export-image"),e("./svg-export"),e("./session")}s.prototype.initUI=function(e,t){this.noSourceCSS||["bootstrap-scoped.css","dalliance-scoped.css","font-awesome.min.css"].forEach(function(e){document.head.appendChild(a("link","",{rel:"stylesheet",href:this.resolveURL("$$css/"+e)}))}.bind(this));var r=this;r.disableDefaultFeaturePopup||this.addFeatureListener(function(e,t,i,n){r.featurePopup(e,t,i,n)}),e.classList.add("dalliance");var n=r.toolbar=a("div",null,{className:"btn-toolbar toolbar"}),s=r.coordSystem.speciesName+" "+r.nameForCoordSystem(r.coordSystem);this.setDocumentTitle&&(document.title=s+" :: dalliance");var o=a("input","",{className:"loc-field"});r.makeTooltip(o,"Enter a genomic location or gene name");var l=a("p","",{className:"loc-status"}),c=a("a",[a("i",null,{className:"fa fa-search-plus"})],{className:"btn"}),f=new h({width:r.zoomSliderWidth});r.makeTooltip(f,"Highlighted button shows current zoom level, gray button shows inactive zoom level (click or tap SPACE to toggle).");var p=a("a",[a("i",null,{className:"fa fa-search-minus"})],{className:"btn"}),d=a("a",[a("i",null,{className:"fa fa-eraser"})],{className:"btn"}),g=a("a",[a("i",null,{className:"fa fa-plus"})],{className:"btn"}),v=a("a",[a("i",null,{className:"fa fa-bookmark"})],{className:"btn"}),y=a("a",[a("i",null,{className:"fa fa-print"})],{className:"btn"}),m=(a("a",[a("i",null,{className:"fa fa-refresh"})],{className:"btn"}),a("a",[a("i",null,{className:"fa fa-cogs"})],{className:"btn"})),b=a("a",[a("i",null,{className:"fa fa-question"})],{className:"btn"}),w=a("a",[a("i",null,{className:"fa fa-road"})],{className:"btn"});r.makeTooltip(w,"Configure currently selected track(s) (E)");var x=a("a",[a("i",null,{className:"fa fa-angle-left"})],{className:"btn"},{width:"5px"}),S=a("a",[a("i",null,{className:"fa fa-angle-right"})],{className:"btn pull-right"},{width:"5px"}),_=a("div",null,{className:"btn-group pull-right"});this.noTrackAdder||_.appendChild(g),this.noTrackEditor||_.appendChild(w),this.noExport||_.appendChild(y),this.noOptions||_.appendChild(m),this.noHelp||_.appendChild(b),this.setUiMode=function(e){this.uiMode=e;var t={help:b,add:g,opts:m,"export":y,tier:w};for(var r in t)r==e?t[r].classList.add("active"):t[r].classList.remove("active")},this.noLeapButtons||n.appendChild(S),_.firstChild&&n.appendChild(_),this.noLeapButtons||n.appendChild(x),this.noTitle||n.appendChild(a("div",a("h4",s,{},{margin:"0px"}),{className:"btn-group title"})),this.noLocationField||n.appendChild(a("div",[o,l],{className:"btn-group loc-group"})),this.noClearHighlightsButton||n.appendChild(d),this.noZoomSlider||n.appendChild(a("div",[c,a("span",f,{className:"btn"}),p],{className:"btn-group"})),this.toolbarBelow?(e.appendChild(t),e.appendChild(n)):(e.appendChild(n),e.appendChild(t));var T=Math.log(2)/Math.log(10),C=Math.log(5)/Math.log(10),k=function(e){var t,i=(e/r.zoomExpt+Math.log(r.zoomBase))/Math.log(10),n=0|i,s=i-n;
2
- return t=.01>s?n:T+.01>=s?n+T:C+.01>=s?n+C:n+1,(t*Math.log(10)-Math.log(r.zoomBase))*r.zoomExpt},L=function(e){f.addLabel(e,i(Math.exp(e/r.zoomExpt)*r.zoomBase))};this.addViewListener(function(e,t,i,n,s){o.value=e+":"+u(t)+".."+u(i),f.min=0|s.min,f.max=0|s.max,s.isSnapZooming?(f.value=s.alternate,f.value2=s.current,f.active=2):(f.value=s.current,f.value2=s.alternate,f.active=1),s.current==s.min?c.classList.add("disabled"):c.classList.remove("disabled"),s.current==s.max?p.classList.add("disabled"):p.classList.remove("disabled"),f.removeLabels();var a=s.min,l=s.max,h=l-a,g=4;r.zoomSliderWidth&&r.zoomSliderWidth<150&&(g=3),L(k(a));for(var v=1;g-1>v;++v)L(k(a+1*v*h/(g-1)));L(k(l)),r.storeStatus&&r.storeViewStatus(),r.highlights.length>0?d.style.display="inline-block":d.style.display="none"}),this.addTierListener(function(){r.storeStatus&&r.storeTierStatus()}),o.addEventListener("keydown",function(e){if(40==e.keyCode&&(e.preventDefault(),e.stopPropagation(),r.setSelectedTier(0)),10==e.keyCode||13==e.keyCode){e.preventDefault();var t=o.value;r.search(t,function(e){e?l.textContent=""+e:l.textContent=""})}},!1);var A;g.addEventListener("click",function(e){A&&A.displayed?r.removeAllPopups():A=r.showTrackAdder(e)},!1),r.makeTooltip(g,"Add a new track from the registry or an indexed file. (A)"),c.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),r.zoomStep(-10)},!1),r.makeTooltip(c,"Zoom in (+)"),p.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),r.zoomStep(10)},!1),r.makeTooltip(p,"Zoom out (-)"),f.addEventListener("change",function(e){var t=2==f.active;t!=r.isSnapZooming&&(r.savedZoom=r.zoomSliderValue-r.zoomMin,r.isSnapZooming=t);var i=1==f.active?f.value:f.value2;r.zoomSliderValue=1*i,r.zoom(Math.exp(1*i/r.zoomExpt))},!1),v.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault()},!1),r.makeTooltip(v,"Favourite regions"),y.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),r.openExportPanel()},!1),r.makeTooltip(y,"Export publication-quality SVG. (X)");m.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),r.toggleOptsPopup(e)},!1),r.makeTooltip(m,"Configure options."),b.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),r.toggleHelpPopup(e)}),r.makeTooltip(b,"Help; Keyboard shortcuts. (H)"),w.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),1==r.selectedTiers.length&&r.openTierPanel(r.tiers[r.selectedTiers[0]])},!1),x.addEventListener("click",function(e){r.leap(r.reverseKeyScrolling?-1:1,!1)},!1),r.makeTooltip(x,function(e){var t,i=r.getSelectedTier();return i>=0&&(t=r.tiers[i]),t&&t.featureSource&&r.sourceAdapterIsCapable(t.featureSource,"quantLeap")&&"number"==typeof t.quantLeapThreshold?'Jump to the next region with a score above the threshold in the selected track "'+(t.config.name||t.dasSource.name)+'"" (ctrl+LEFT)':t&&t.featureSource&&r.sourceAdapterIsCapable(t.featureSource,"leap")?'Jump to the next feature in the selected track "'+(t.config.name||t.dasSource.name)+'" (ctrl+LEFT)':"Jump left (shift+LEFT)"}),S.addEventListener("click",function(e){r.leap(r.reverseKeyScrolling?1:-1,!1)},!1),r.makeTooltip(S,function(e){var t,i=r.getSelectedTier();return i>=0&&(t=r.tiers[i]),t&&t.featureSource&&r.sourceAdapterIsCapable(t.featureSource,"quantLeap")&&"number"==typeof t.quantLeapThreshold?'Jump to the next region with a score above the threshold in the selected track "'+(t.config.name||t.dasSource.name)+'"" (ctrl+RIGHT)':t&&t.featureSource&&r.sourceAdapterIsCapable(t.featureSource,"leap")?'Jump to the next feature in the selected track "'+(t.config.name||t.dasSource.name)+'" (ctrl+RIGHT)':"Jump right (shift+RIGHT)"}),r.addTierSelectionListener(function(){var e,t=r.getSelectedTier();t>=0&&(e=r.tiers[t]);var i=!1;e&&e.featureSource&&(r.sourceAdapterIsCapable(e.featureSource,"quantLeap")&&"number"==typeof e.quantLeapThreshold?i=!0:r.sourceAdapterIsCapable(e.featureSource,"leap")&&(i=!0)),x.firstChild.className=i?"fa fa-angle-double-left":"fa fa-angle-left",S.firstChild.className=i?"fa fa-angle-double-right":"fa fa-angle-right"}),d.addEventListener("click",function(e){r.clearHighlights()},!1),r.makeTooltip(d,"Clear highlights (C)"),r.addTierSelectionWrapListener(function(e){0>e&&(r.setSelectedTier(null),o.focus())}),r.addTierSelectionListener(function(e){if("tier"===r.uiMode)if(0==e.length)r.hideToolPanel(),r.manipulatingTier=null,r.uiMode="none";else{var t=r.tiers[e[0]];t!=r.manipulatingTier&&r.openTierPanel(t)}});var E=function(e){65==e.keyCode||97==e.keyCode?(e.preventDefault(),e.stopPropagation(),r.showTrackAdder()):72==e.keyCode||104==e.keyCode?(e.stopPropagation(),e.preventDefault(),r.toggleHelpPopup(e)):69==e.keyCode||101==e.keyCode?(e.stopPropagation(),e.preventDefault(),1==r.selectedTiers.length&&r.openTierPanel(r.tiers[r.selectedTiers[0]])):88==e.keyCode||120==e.keyCode?(e.stopPropagation(),e.preventDefault(),r.openExportPanel()):(67==e.keyCode||99==e.keyCode)&&(e.stopPropagation(),e.preventDefault(),r.clearHighlights())};e.addEventListener("focus",function(t){e.addEventListener("keydown",E,!1)},!1),e.addEventListener("blur",function(t){e.removeEventListener("keydown",E,!1)},!1),e.addEventListener("keydown",function(e){27===e.keyCode&&"none"!==r.uiMode&&(e.preventDefault(),e.stopPropagation(),r.setUiMode("none"),r.hideToolPanel(),r.selectedTiers&&r.selectedTiers.length>0&&r.browserHolder.focus())},!1)},s.prototype.showToolPanel=function(e,t){var r=this;this.activeToolPanel&&this.activeToolPanel.parentElement.removeChild(this.activeToolPanel);var i;i=t?e:a("div",e,{},{overflowY:"auto",width:"100%"});var n=a("div",a("i",null,{className:"fa fa-caret-right"}),{className:"tool-divider"});n.addEventListener("click",function(e){r.hideToolPanel(),r.setUiMode("none")},!1),this.makeTooltip(n,"Close tool panel (ESC)"),this.activeToolPanel=a("div",[n,i],{className:"tool-holder"}),this.svgHolder.appendChild(this.activeToolPanel),this.resizeViewer();var r=this},s.prototype.hideToolPanel=function(){this.activeToolPanel&&this.activeToolPanel.parentElement.removeChild(this.activeToolPanel),this.svgHolder.style.width="100%",this.activeToolPanel=null,this.resizeViewer()},s.prototype.toggleHelpPopup=function(e){if("help"===this.uiMode)this.hideToolPanel(),this.setUiMode("none");else{var t=a("iframe",null,{scrolling:"yes",seamless:"seamless",src:this.resolveURL("$$help/main.html"),className:"help-panel"});this.showToolPanel(t,!1),this.setUiMode("help")}},s.prototype.toggleOptsPopup=function(e){var t=this;if("opts"===this.uiMode)this.hideToolPanel(),this.setUiMode("none");else{var r=a("div",null,{className:"form-horizontal"},{boxSizing:"border-box",MozBoxSizing:"border-box",display:"inline-block",verticalAlign:"top"}),i=a("table");i.cellPadding=5;var n=a("input","",{type:"checkbox",checked:t.reverseScrolling});n.addEventListener("change",function(e){t.reverseScrolling=n.checked,t.storeStatus()},!1),i.appendChild(a("tr",[a("td","Reverse trackpad scrolling",{align:"right"}),a("td",n)]));var s=a("input","",{type:"checkbox",checked:t.reverseKeyScrolling});s.addEventListener("change",function(e){t.reverseKeyScrolling=s.checked,t.storeStatus()},!1),i.appendChild(a("tr",[a("td","Reverse scrolling buttons and keys",{align:"right"}),a("td",s)]));var o=a("select");o.appendChild(a("option","Left",{value:"left"})),o.appendChild(a("option","Center",{value:"center"})),o.appendChild(a("option","Right",{value:"right"})),o.appendChild(a("option","None",{value:"none"})),o.value=t.rulerLocation,o.addEventListener("change",function(e){t.rulerLocation=o.value,t.positionRuler();for(var r=0;r<t.tiers.length;++r)t.tiers[r].paintQuant();t.storeStatus()},!1),i.appendChild(a("tr",[a("td","Vertical guideline",{align:"right"}),a("td",o)]));var l=a("input","",{type:"checkbox",checked:t.singleBaseHighlight});l.addEventListener("change",function(e){t.singleBaseHighlight=l.checked,t.positionRuler(),t.storeStatus()},!1),l.setAttribute("id","singleBaseHightlightButton"),i.appendChild(a("tr",[a("td","Display and highlight current genome location",{align:"right"}),a("td",l)])),r.appendChild(i);var u=a("button","Reset browser",{className:"btn"},{marginLeft:"auto",marginRight:"auto",display:"block"});u.addEventListener("click",function(e){t.reset()},!1),r.appendChild(u),this.showToolPanel(r),this.setUiMode("opts")}}},{"./cbrowser":6,"./export-config":17,"./export-image":18,"./export-ui":19,"./numformats":30,"./session":37,"./svg-export":44,"./tier-edit":51,"./utils":56,"./zoomslider":59}],6:[function(e,t,r){"use strict";function i(e,t,r){this.min=t,this.max=r,this.chr=e}function n(e){if(e||(e={}),this.renderers={"default":M,dummy:P,multi:I,sub:B},this.defaultRenderer=e.renderer||M,this.prefix="//www.biodalliance.org/release-0.14/",this.sources=[],this.tiers=[],this.tierGroups={},this.searchOnlySources=[],this.searchOnlySourceHolders=[],this.featureListeners=[],this.featureHoverListeners=[],this.viewListeners=[],this.regionSelectListeners=[],this.tierListeners=[],this.tierSelectionListeners=[],this.tierSelectionWrapListeners=[],this.cookieKey="browser",this.chains={},this.pageName="svgHolder",this.zoomFactor=1,this.maxPixelsPerBase=10,this.origin=0,this.targetQuantRes=1,this.featurePanelWidth=750,this.zoomBase=100,this.zoomExpt=30,this.zoomSliderValue=100,this.entryPoints=null,this.currentSeqMax=-1,this.highlights=[],this.selectedTiers=[1],this.maxViewWidth=5e5,this.defaultSubtierMax=100,this.highZoomThreshold=.2,this.mediumZoomThreshold=.01,this.minExtraWidth=100,this.maxExtraWidth=1e3,this.reverseScrolling=!1,this.rulerLocation="center",this.defaultHighlightFill="red",this.defaultHighlightAlpha=.3,this.exportHighlights=!0,this.exportRuler=!0,this.exportBanner=!0,this.exportRegion=!0,this.singleBaseHighlight=!0,this.tierBackgroundColors=["rgb(245,245,245)","white"],this.minTierHeight=20,this.noDefaultLabels=!1,this.availableSources=new c,this.defaultSources=[],this.mappableSources={},this.registry=null,this.noRegistryTabs=!0,this.defaultTrackAdderTab=null,this.hubs=[],this.hubObjects=[],this.sourceCache=new u,this.retina=!0,this.useFetchWorkers=!0,this.maxWorkers=2,this.workerPath="$$worker-all.js",this.resolvers={},this.resolverSeed=1,this.assemblyNamePrimary=!0,this.assemblyNameUcsc=!0,this.defaultSearchRegionPadding=1e4,this.httpCanaryURL="http://www.biodalliance.org/http-canary.txt",this.httpWarningURL="//www.biodalliance.org/https.html",this.initListeners=[],e.baseColors?this.baseColors=e.baseColors:e.aminoAcids?this.baseColors={F:"rgb(182, 201, 237)",L:"rgb(213, 236, 213)",I:"rgb(239, 213, 211)",M:"rgb(255, 23, 0)",V:"rgb(255, 172, 0)",S:"rgb(255, 244, 19)",P:"rgb(138, 189, 67)",T:"rgb(36, 153, 57)",A:"rgb(0, 166, 236)",Y:"rgb(0, 101, 178)",H:"rgb(215, 206, 182)",Q:"rgb(252, 176, 124)",N:"rgb(159, 148, 186)",K:"rgb(133, 117, 67)",D:"rgb(108, 242, 51)",E:"rgb(0, 253, 255)",C:"rgb(248, 129, 51)",W:"rgb(243, 68, 252)",R:"rgb(207, 207, 207)",G:"rgb(166, 213, 227)"}:this.baseColors={A:"green",C:"blue",G:"orange",T:"red","-":"hotpink",I:"red"},void 0!==e.viewStart&&"number"!=typeof e.viewStart)throw Error("viewStart must be an integer");if(void 0!==e.viewEnd&&"number"!=typeof e.viewEnd)throw Error("viewEnd must be an integer");if(void 0!==e.offscreenInitWidth&&"number"!=typeof e.offscreenInitWidth)throw Error("offscreenInitWidth must be an integer");for(var t in e)this[t]=e[t];if("string"==typeof e.uiPrefix&&"string"!=typeof e.prefix&&(this.prefix=e.uiPrefix),this.prefix.indexOf("//")<0&&0===this.prefix.indexOf("/")){var r=window.location.hostname;window.location.port&&(r+=":"+window.location.port),this.prefix="//"+r+this.prefix}if(0===this.prefix.indexOf("//")){var i=window.location.protocol;"http:"==i||"https:"==i||(console.log(window.location.protocol),console.log("WARNING: prefix is set to a protocol-relative URL ("+this.prefix+" when loading from a non-HTTP source"),this.prefix="http:"+this.prefix)}if(!this.coordSystem)throw Error("Coordinate system must be configured");if(void 0===this.chr||void 0===this.viewStart||void 0===this.viewEnd)throw Error("Viewed region (chr:start..end) must be defined");var n=this;if("complete"===document.readyState)n.realInit();else{var s=function o(e){window.removeEventListener("load",o,!1),n.realInit()};window.addEventListener("load",s,!1)}}function s(e,t,r){if(r)for(var i=0;i<t.length;++i)t[i].mapping=r;e.set(t)}function o(e,t,r,i){i=i||[];for(var n=e.length-1;n>=0;--n){var s=e[n];if(!s.notSelectable&&s.min()<=t&&s.max()>=t){if(s.minY&&(r<s.minY()||r>s.maxY()))continue;return s.feature?i.push(s.feature):s.group&&i.push(s.group),s.glyphs?o(s.glyphs,t,r,i):s.glyph?o([s.glyph],t,r,i):i}}return i}function a(e,t){var r=this;this.tagSeed=0,this.callbacks={},this.browser=e,this.worker=t,this.worker.onmessage=function(e){var t=e.data;if(t.cmd)if("resolve"==t.cmd){var i=r.browser.resolvers[t.resolver];i?i(t.url).then(function(e){r.worker.postMessage({tag:t.tag,url:e})})["catch"](function(e){console.log(e),r.worker.postMessage({tag:t.tag,err:e.toString()})}):console.log("No resolver "+t.resolver)}else console.log("Bad worker callback "+t.cmd);else{var n=r.callbacks[t.tag];n&&(n(t.result,t.error),delete r.callbacks[t.tag])}}}function l(e){var t=e.resolveURL(e.workerPath);if(0==t.indexOf("//")){var r=window.location.protocol;t="https:"==r?"https:"+t:"http:"+t}var i='importScripts("'+t+"?version="+_+'");',n=new Blob([i],{type:"application/javascript"});return new A(function(t,r){var i=new Worker(URL.createObjectURL(n));i.onmessage=function(r){"init"===r.data.tag&&(console.log("Worker initialized"),t(new a(e,i)))},i.onerror=function(e){r(e.message)}})}function u(){this.sourcesByURI={}}if("undefined"!=typeof e)var h=e("./utils"),c=h.Observed,f=(h.Awaited,h.makeElement),p=h.removeChildren,d=h.miniJSONify,g=h.shallowCopy,v=h.textXHR,y=e("./tier"),m=y.DasTier,b=e("./sha1"),w=b.hex_sha1,x=e("./thub"),S=x.connectTrackHub,_=e("./version"),T=e("./numformats"),C=T.formatQuantLabel,k=T.formatLongInt,L=e("./chainset").Chainset,A=e("es6-promise").Promise,E=e("./sourcecompare"),O=E.sourcesAreEqual,R=E.sourcesAreEqualModuloStyle,F=E.sourceDataURI,M=(E.sourceStyleURI,e("./default-renderer")),I=e("./multi-renderer"),B=e("./sub-renderer"),P=e("./dummy-renderer");n.prototype.resolveURL=function(e){return e.replace("$$",this.prefix)},n.prototype.destroy=function(){if(window.removeEventListener("resize",this.resizeListener,!1),this.fetchWorkers){var e=!0,t=!1,r=void 0;try{for(var i,n=this.fetchWorkers[Symbol.iterator]();!(e=(i=n.next()).done);e=!0){var s=i.value;s.terminate()}}catch(o){t=!0,r=o}finally{try{!e&&n["return"]&&n["return"]()}finally{if(t)throw r}}}},n.prototype.realInit=function(){var e=this,t=this;if(this.wasInitialized)return void console.log("Attemping to call realInit on an already-initialized Dalliance instance");if(this.wasInitialized=!0,"undefined"!=typeof navigator){var r=navigator.userAgent||"dummy";r.indexOf("Trident")>=0&&r.indexOf("rv:11")>=0&&(this.disablePinning=!0)}this.defaultChr=this.chr,this.defaultStart=this.viewStart,this.defaultEnd=this.viewEnd,this.defaultSources=[];for(var i=0;i<this.sources.length;++i){var n=this.sources[i];n&&this.defaultSources.push(n)}if(this.restoreStatus&&(this.statusRestored=this.restoreStatus()),this.injectionPoint&&this.injectionPoint instanceof Element)this.browserHolderHolder=this.injectionPoint;else if(this.injectionPoint){if(this.browserHolderHolder=document.getElementById(this.injectionPoint),!this.browserHolderHolder)throw Error("injectionPoint must point to a valid DOM element of element ID")}else if(this.browserHolderHolder=document.getElementById(this.pageName),!this.browserHolderHolder)throw Error("pageName must be a valid element ID (or use the injectionPoint option instead)");this.browserHolderHolder.classList.add("dalliance-injection-point"),this.browserHolder=f("div",null,{className:"dalliance dalliance-root",tabIndex:-1}),this.maxHeight?this.browserHolder.style.maxHeight=this.maxHeight+"px":void 0!=this.maxHeight&&(this.browserHolder.style.maxHeight=null),p(this.browserHolderHolder),this.browserHolderHolder.appendChild(this.browserHolder),this.svgHolder=f("div",null,{className:"main-holder"}),this.initUI(this.browserHolder,this.svgHolder),this.pinnedTierHolder=f("div",null,{className:"tier-holder tier-holder-pinned"}),this.tierHolder=f("div",this.makeLoader(24),{className:"tier-holder tier-holder-rest"}),this.locSingleBase=f("span","",{className:"loc-single-base"});var s=f("div",this.locSingleBase,{className:"loc-single-base-holder"});this.addViewListener(function(t,r,i,n,s,o,a){var l=Math.round((a+o)/2);e.locSingleBase.appendChild(document.createTextNode(t+":"+k(l))),e.locSingleBase.removeChild(e.locSingleBase.firstChild)}),this.disablePinning?this.tierHolderHolder=this.tierHolder:(this.tierHolderHolder=f("div",[s,this.pinnedTierHolder,this.tierHolder],{className:"tier-holder-holder"}),this.svgHolder.appendChild(this.tierHolderHolder)),this.svgHolder.appendChild(this.tierHolderHolder),this.bhtmlRoot=f("div"),this.disablePoweredBy||this.bhtmlRoot.appendChild(f("span",["Powered by ",f("a","Biodalliance",{href:"http://www.biodalliance.org/"})," "+_],{className:"powered-by"})),this.browserHolder.appendChild(this.bhtmlRoot),this.resizeListener=function(e){t.resizeViewer()},this.ruler=f("div",null,{className:"guideline"}),this.ruler2=f("div",null,{className:"single-base-guideline"}),this.tierHolderHolder.appendChild(this.ruler),this.tierHolderHolder.appendChild(this.ruler2),this.chainConfigs=this.chains||{},this.chains={};for(var o in this.chainConfigs){var a=this.chainConfigs[o];a instanceof L&&console.log('WARNING: Should no longer use "new Chainset" in Biodalliance configurations.'),this.chains[o]=new L(a)}var u;if(this.maxWorkers>0){for(var h=[],c=0;c<this.maxWorkers;++c)h.push(l(this));u=A.all(h)}else u=A.resolve([]);this.fetchWorkers=null,this.nextWorker=0,u.then(function(e){console.log("Booted "+e.length+" workers"),t.fetchWorkers=e},function(e){console.log("Failed to boot workers",e)}).then(function(){if(e.offscreenInitWidth||"none"!=window.getComputedStyle(t.browserHolderHolder).display&&t.tierHolder.getBoundingClientRect().width>0)setTimeout(function(){t.realInit2()},1);else var r=setInterval(function(){"none"!=window.getComputedStyle(t.browserHolderHolder).display&&t.tierHolder.getBoundingClientRect().width>0&&(clearInterval(r),t.realInit2())},300)})},n.prototype.realInit2=function(){var e=this,t=this;p(this.tierHolder),p(this.pinnedTierHolder),this.featurePanelWidth=this.tierHolder.getBoundingClientRect().width|t.offscreenInitWidth|0,window.addEventListener("resize",this.resizeListener,!1),this.scale=this.featurePanelWidth/(this.viewEnd-this.viewStart),this.zoomMax||(this.zoomMax=this.zoomExpt*Math.log(this.maxViewWidth/this.zoomBase),this.zoomMin=this.zoomExpt*Math.log(this.featurePanelWidth/this.maxPixelsPerBase/this.zoomBase)),this.zoomSliderValue=this.zoomExpt*Math.log((this.viewEnd-this.viewStart+1)/this.zoomBase),this.tierHolderHolder.addEventListener("mousewheel",function(e){if(e.stopPropagation(),e.preventDefault(),e.wheelDeltaX){var r=e.wheelDeltaX/5;t.reverseScrolling||(r=-r),t.move(r)}if(e.wheelDeltaY){var r=e.wheelDeltaY;t.reverseScrolling&&(r=-r),t.tierHolder.scrollTop+=r}},!1),this.tierHolderHolder.addEventListener("MozMousePixelScroll",function(e){if(e.stopPropagation(),e.preventDefault(),1==e.axis){if(0!=e.detail){var r=e.detail/4;t.reverseScrolling&&(r=-r),t.move(r)}}else{var r=e.detail;t.reverseScrolling||(r=-r),t.tierHolder.scrollTop+=r}},!1),this.tierHolderHolder.addEventListener("touchstart",function(e){return t.touchStartHandler(e)},!1),this.tierHolderHolder.addEventListener("touchmove",function(e){return t.touchMoveHandler(e)},!1),this.tierHolderHolder.addEventListener("touchend",function(e){return t.touchEndHandler(e)},!1),this.tierHolderHolder.addEventListener("touchcancel",function(e){return t.touchCancelHandler(e)},!1);var r=function(e){if(13==e.keyCode){for(var r=!1,i=0;i<t.tiers.length;++i){var n=t.tiers[i];n.wantedLayoutHeight&&n.wantedLayoutHeight!=n.layoutHeight&&(n.layoutHeight=n.wantedLayoutHeight,n.clipTier(),r=!0)}r&&t.arrangeTiers()}else if(32==e.keyCode||32==e.charCode){if(t.isSnapZooming){t.isSnapZooming=!1;var s=(t.savedZoom||20)+t.zoomMin;t.savedZoom=t.zoomSliderValue-t.zoomMin,t.zoomSliderValue=s,t.zoom(Math.exp(1*s/t.zoomExpt))}else{t.isSnapZooming=!0;var s=(t.savedZoom||0)+t.zoomMin;t.savedZoom=t.zoomSliderValue-t.zoomMin,t.zoomSliderValue=s,t.zoom(Math.exp(1*s/t.zoomExpt))}e.stopPropagation(),e.preventDefault()}else if(85==e.keyCode){if("opts"===t.uiMode){var o=document.getElementById("singleBaseHightlightButton").checked;document.getElementById("singleBaseHightlightButton").checked=!o}t.singleBaseHighlight=!t.singleBaseHighlight,t.positionRuler(),e.stopPropagation(),e.preventDefault()}else if(39==e.keyCode)e.stopPropagation(),e.preventDefault(),t.scrollArrowKey(e,-1);else if(37==e.keyCode)e.stopPropagation(),e.preventDefault(),t.scrollArrowKey(e,1);else if(38==e.keyCode||87==e.keyCode)if(e.stopPropagation(),e.preventDefault(),e.shiftKey){var a=t.getSelectedTier();if(0>a)return;var l=t.tiers[a],u=l.forceHeight||l.subtiers[0].height;u>=40&&l.mergeConfig({height:u-10})}else if(e.ctrlKey||e.metaKey){var a=t.getSelectedTier();if(0>a)return;var l=t.tiers[a];if(l.quantLeapThreshold){var h=l.subtiers[0].height,c=l.subtiers[0].quant;if(!c)return;var f=1*c.min,p=1*c.max,d=(p-f)/h;l.mergeConfig({quantLeapThreshold:f+((0|Math.round((l.quantLeapThreshold-f)/d))+1)*d}),l.notify("Threshold: "+C(l.quantLeapThreshold))}}else if(e.altKey){var g=t.selectedTiers.length;if(0==g)return;for(var a=t.selectedTiers[0],v=!0,y=[],m=0;m<t.selectedTiers.length;++m)y.push(t.tiers[t.selectedTiers[m]]),m>0&&t.selectedTiers[m]-t.selectedTiers[m-1]!=1&&(v=!1);if(v&&0>=a)return;for(var m=t.selectedTiers.length-1;m>=0;--m)t.tiers.splice(t.selectedTiers[m],1);t.selectedTiers.splice(0,g);for(var b=v?a-1:a,m=0;m<y.length;++m)t.tiers.splice(b+m,0,y[m]),t.selectedTiers.push(b+m);t.withPreservedSelection(t._ensureTiersGrouped),t.markSelectedTiers(),t.notifyTierSelection(),t.reorderTiers(),t.notifyTier("selected",a)}else{var a=t.getSelectedTier();if(a>0){t.setSelectedTier(a-1);var w=t.tiers[t.getSelectedTier()],x=w.row.offsetTop,S=x+w.row.offsetHeight;(x<t.tierHolder.scrollTop||S>t.tierHolder.scrollTop+t.tierHolder.offsetHeight)&&(t.tierHolder.scrollTop=x)}else t.notifyTierSelectionWrap(-1)}else if(40==e.keyCode||83==e.keyCode)if(e.stopPropagation(),e.preventDefault(),e.shiftKey){var a=t.getSelectedTier();if(0>a)return;var l=t.tiers[a],u=l.forceHeight||l.subtiers[0].height;l.mergeConfig({height:u+10})}else if(e.ctrlKey||e.metaKey){var a=t.getSelectedTier();if(0>a)return;var l=t.tiers[a];if(l.quantLeapThreshold){var h=l.subtiers[0].height,c=l.subtiers[0].quant;if(!c)return;var f=1*c.min,p=1*c.max,d=(p-f)/h,_=0|Math.round((l.quantLeapThreshold-f)/d);_>1&&(l.mergeConfig({quantLeapThreshold:f+(_-1)*d}),l.notify("Threshold: "+C(l.quantLeapThreshold)))}}else if(e.altKey){var g=t.selectedTiers.length;if(0==g)return;for(var a=t.selectedTiers[0],T=0,y=[],m=0;m<t.selectedTiers.length;++m)y.push(t.tiers[t.selectedTiers[m]]),m>0&&(T+=t.selectedTiers[m]-t.selectedTiers[m-1]-1);var v=0==T;if(v&&a+g>=t.tiers.length)return;for(var m=t.selectedTiers.length-1;m>=0;--m)t.tiers.splice(t.selectedTiers[m],1);t.selectedTiers.splice(0,g);for(var b=v?a+1:a+T,m=0;m<y.length;++m)t.tiers.splice(b+m,0,y[m]),t.selectedTiers.push(b+m);t.withPreservedSelection(function(){t._ensureTiersGrouped(!0)}),t.markSelectedTiers(),t.notifyTierSelection(),t.reorderTiers(),t.notifyTier("selected",a)}else{var a=t.getSelectedTier();if(a<t.tiers.length-1){t.setSelectedTier(a+1);var w=t.tiers[t.getSelectedTier()],x=w.row.offsetTop,S=x+w.row.offsetHeight;(x<t.tierHolder.scrollTop||S>t.tierHolder.scrollTop+t.tierHolder.offsetHeight)&&(t.tierHolder.scrollTop=Math.min(x,S-t.tierHolder.offsetHeight))}}else if(187==e.keyCode||61==e.keyCode)e.stopPropagation(),e.preventDefault(),t.zoomStep(-10);else if(189==e.keyCode||173==e.keyCode)e.stopPropagation(),e.preventDefault(),t.zoomStep(10);else if(73==e.keyCode||105==e.keyCode){e.stopPropagation(),e.preventDefault();var a=t.getSelectedTier();if(0>a)return;var n=t.tiers[a];n.infoVisible?(n.infoElement.style.display="none",n.updateHeight(),n.infoVisible=!1):(n.infoElement.style.display="block",n.updateHeight(),n.infoVisible=!0)}else if(84==e.keyCode||116==e.keyCode){var k;if(e.shiftKey){e.stopPropagation(),e.preventDefault();for(var i=0;i<t.tiers.length;++i){var n=t.tiers[i];n.dasSource.collapseSuperGroups&&(void 0===k&&(k=!n.bumped),n.mergeConfig({bumped:k}))}}else if(!e.ctrlKey&&!e.metaKey){e.stopPropagation(),e.preventDefault();var a=t.getSelectedTier();if(0>a)return;var n=t.tiers[a];n.dasSource.collapseSuperGroups&&(void 0===k&&(k=!n.bumped),n.mergeConfig({bumped:k}))}}else if(77==e.keyCode||109==e.keyCode)e.stopPropagation(),e.preventDefault(),(e.ctrlKey||e.metaKey)&&t.selectedTiers.length>1&&t.mergeSelectedTiers();else if(68==e.keyCode||100==e.keyCode){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey||e.metaKey){var a=t.getSelectedTier();if(0>a)return;t.addTier(t.tiers[a].dasSource)}}else if((80==e.keyCode||112==e.keyCode)&&(e.ctrlKey||e.metaKey)){for(var l=[],a=0;a<t.selectedTiers.length;++a)l.push(t.tiers[t.selectedTiers[a]]);for(var i=0;i<l.length;++i)l[i].mergeConfig({pinned:!l[i].pinned})}};this.browserHolder.addEventListener("focus",function(e){t.browserHolder.addEventListener("keydown",r,!1)},!1),this.browserHolder.addEventListener("blur",function(e){t.browserHolder.removeEventListener("keydown",r,!1)},!1),this.hPopupHolder=f("div"),this.hPopupHolder.style["font-family"]="helvetica",this.hPopupHolder.style["font-size"]="12pt",this.hPopupHolder.classList.add("dalliance"),document.body.appendChild(this.hPopupHolder);for(var i=0;i<this.sources.length;++i){var n=this.sources[i];if(n){var s={};this.restoredConfigs&&(s=this.restoredConfigs[i]),n.disabled||this.makeTier(n,s).then(function(e){t.refreshTier(e)})}}var o=!0,a=!1,l=void 0;try{for(var u,h=this.searchOnlySources[Symbol.iterator]();!(o=(u=h.next()).done);o=!0){var c=u.value;if(!c.disabled){var d=this.createSources(c),g=d.features;g&&this.searchOnlySourceHolders.push({dasSource:c,featureSource:g})}}}catch(v){a=!0,l=v}finally{try{!o&&h["return"]&&h["return"]()}finally{if(a)throw l}}this.onFirstRender&&A.all(this.tiers.map(function(e){return e.firstRenderPromise})).then(function(){return e.onFirstRender()})["catch"](function(e){return console.log(e)}),t._ensureTiersGrouped(),t.arrangeTiers(),t.reorderTiers();var y=this.getSequenceSource();y&&y.getSeqInfo(this.chr,function(e){e?t.currentSeqMax=e.length:t.currentSeqMax=-1}),this.queryRegistry();for(var m in this.chains)this.queryRegistry(m,!0);if(this.hubs)for(var b=0;b<this.hubs.length;++b){var w=this.hubs[b];"string"==typeof w&&(w={url:w}),function(e){S(e.url,function(r,i){if(i)console.log(i);else{var n;n=e.genome?r.genomes[e.genome]:r.genomes[t.coordSystem.ucscName],n&&(e.mapping&&(n.mapping=e.mapping),e.label&&(n.hub.altLabel=e.label),t.hubObjects.push(n))}},e)}(w)}this.fullScreen&&this.setFullScreenHeight(),!this.statusRestored&&this.storeStatus&&this.storeStatus(),t.setLocation(this.chr,this.viewStart,this.viewEnd,function(){t.setSelectedTier(1);for(var e=0;e<t.initListeners.length;++e)try{t.initListeners[e].call(t)}catch(r){console.log(r)}})},n.prototype.touchStartHandler=function(e){if(this.touchOriginX=e.touches[0].pageX,this.touchOriginY=e.touches[0].pageY,2==e.touches.length){var t=Math.abs(e.touches[0].pageX-e.touches[1].pageX);this.zooming=!0,this.zoomLastSep=this.zoomInitialSep=t,this.zoomInitialScale=this.scale}},n.prototype.touchMoveHandler=function(e){if(e.stopPropagation(),e.preventDefault(),1==e.touches.length){var t=e.touches[0].pageX,r=e.touches[0].pageY;this.touchOriginX&&t!=this.touchOriginX&&this.move(t-this.touchOriginX),this.touchOriginY&&r!=this.touchOriginY&&(this.tierHolder.scrollTop-=r-this.touchOriginY),this.touchOriginX=t,this.touchOriginY=r}else if(this.zooming&&2==e.touches.length){var i=Math.abs(e.touches[0].pageX-e.touches[1].pageX);if(i!=this.zoomLastSep){var n=(e.touches[0].pageX+e.touches[1].pageX)/2,s=this.viewStart+n/this.scale|0;this.scale=this.zoomInitialScale*(i/this.zoomInitialSep),this.viewStart=s-n/this.scale|0;for(var o=0;o<this.tiers.length;++o)tiers[o].getRenderer().drawTier(tiers[o])}this.zoomLastSep=i}},n.prototype.touchEndHandler=function(e){},n.prototype.touchCancelHandler=function(e){},n.prototype.makeTier=function(e,t){try{return this.realMakeTier(e,t)}catch(r){console.log("Error initializing",e),console.log(r.stack||r)}},n.prototype.realMakeTier=function(e,t){var r=this,i=null;this.tierBackgroundColors&&(i=this.tierBackgroundColors[this.tiers.length%this.tierBackgroundColors.length]);var n=new m(this,e,t,i);n.oorigin=this.viewStart;var s,a,l,u=!1,h=function(e,t){var i=n.subtiers;if(i){var s=0;for(t-=n.padding;s<i.length&&t>i[s].height&&s<i.length-1;)t=t-i[s].height-n.padding,++s;if(!(s>=i.length)){var a=i[s].glyphs,l=((r.viewStart+r.viewEnd)/2,(n.glyphCacheOrigin-r.viewStart)*r.scale);return e-=l,o(a,e,t)}}},c=function(e){e.preventDefault(),e.stopPropagation();var t=e.clientX;t!=a&&(r.move(t-a,!0),a=t),r.isDragging=!0},f=function _(e){window.removeEventListener("mousemove",c,!0),window.removeEventListener("mouseup",_,!0),r.move(e.clientX-a)};n.viewport.addEventListener("mousedown",function(e){r.browserHolder.focus(),e.preventDefault();var t=(n.row.getBoundingClientRect(),e.clientX);e.clientY;window.addEventListener("mousemove",c,!0),window.addEventListener("mouseup",f,!0),s=a=t,r.isDragging=!1},!1),n.viewport.addEventListener("mousemove",function(e){var t=n.row.getBoundingClientRect(),i=e.clientX-t.left,s=e.clientY-t.top,o=h(i,s);o&&o.length>0?n.row.style.cursor="pointer":n.row.style.cursor="default",l&&clearTimeout(l),u||(l=setTimeout(function(){var t=h(i,s);t&&t.length>0&&r.notifyFeatureHover(e,t[t.length-1],t,n)},1e3))});var p=null;n.viewport.addEventListener("mouseup",function(e){var t=n.row.getBoundingClientRect(),i=e.clientX-t.left,o=e.clientY-t.top,a=h(i,o);if(a&&a.length>0&&!r.isDragging&&(p?(clearTimeout(p),p=null,r.featureDoubleClick(a,i,o)):p=setTimeout(function(){p=null,r.notifyFeature(e,a[a.length-1],a,n)},500)),r.isDragging&&i!=s&&n.sequenceSource){var l,u,c=r.viewStart+i/r.scale,f=r.viewStart+s/r.scale;f>c?(l=0|c,u=0|f):(l=0|f,u=0|c),r.notifyRegionSelect(r.chr,l,u)}r.isDragging=!1},!1),n.viewport.addEventListener("mouseout",function(e){u=!1}),n.removeButton.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault();for(var t=0;t<r.tiers.length;++t)if(r.tiers[t]===n){r.removeTier({index:t});break}},!1),n.nameButton.addEventListener("click",function(e){if(e.stopPropagation(),e.preventDefault(),e.shiftKey){for(var t=-1,i=0;i<r.tiers.length;++i)if(r.tiers[i]===n){t=i;break}if(t>=0){var s=r.selectedTiers.indexOf(t);s>=0?r.selectedTiers.splice(s,1):(r.selectedTiers.push(t),r.selectedTiers.sort()),r.markSelectedTiers(),r.notifyTierSelection(),r.selectedTiers.length>0?r.browserHolder.focus():r.notifyTierSelectionWrap(-1)}}else{for(var i=0;i<r.tiers.length;++i)if(r.tiers[i]===n&&(r.browserHolder.focus(),1!=r.selectedTiers.length||r.selectedTiers[0]!=i))return void r.setSelectedTier(i);n.infoVisible?(n.infoElement.style.display="none",n.updateHeight(),n.infoVisible=!1):(n.infoElement.style.display="block",n.updateHeight(),n.infoVisible=!0)}},!1),n.bumpButton.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault();var t,r=n;r.dasSource.collapseSuperGroups&&(void 0===t&&(t=!r.bumped),r.mergeConfig({bumped:t}))},!1);var d,g,v,y,b,w=!1,x=function(e){var t=n.label;if(e.stopPropagation(),e.preventDefault(),!d){g=n.pinned?r.pinnedTierHolder:r.tierHolder,v=g.scrollHeight-g.offsetHeight,d=t.cloneNode(!0),d.style.cursor="pointer",g.appendChild(d),t.style.visibility="hidden";for(var i=0;i<r.tiers.length;++i)if(r.tiers[i]===n){y=i;break}b=e.clientY}var s=g.getBoundingClientRect();d.style.left=t.getBoundingClientRect().left-s.left+"px",
3
- d.style.top=e.clientY-s.top+g.scrollTop-10+"px";for(var o=e.clientY-s.top+g.scrollTop,i=0;i<r.tiers.length;++i){var a=r.tiers[i];if(!(a.pinned^n.pinned)){var l=a.row.getBoundingClientRect();if(o-=l.bottom-l.top,0>o){if(y>i&&e.clientY<b||i>y&&e.clientY>b){r.withPreservedSelection(function(){r.tiers.splice(y,1),r.tiers.splice(i,0,n),r._ensureTiersGrouped(i>y)});for(var u=0;u<r.tiers.length;++u)r.tiers[u]==n&&(y=u);b=e.clientY,r.reorderTiers(),g.appendChild(d),w=!0}break}}}d.offsetTop<g.scrollTop?g.scrollTop-=g.scrollTop-d.offsetTop:d.offsetTop+d.offsetHeight>g.scrollTop+g.offsetHeight&&(g.scrollTop=Math.min(g.scrollTop+(d.offsetTop+d.offsetHeight)-(g.scrollTop+g.offsetHeight),v))},S=function T(e){var t=n.label;if(e.stopPropagation(),e.preventDefault(),d&&(d.style.cursor="auto",g.removeChild(d),d=null,t.style.visibility="visible"),document.removeEventListener("mousemove",x,!1),document.removeEventListener("mouseup",T,!1),w){for(var i=0;i<r.tiers.length;++i)if(r.tiers[i]==n){r.setSelectedTier(i);break}r.notifyTier("reordered",n)}};return n.label.addEventListener("mousedown",function(e){e.stopPropagation(),e.preventDefault(),w=!1,document.addEventListener("mousemove",x,!1),document.addEventListener("mouseup",S,!1)},!1),this.tiers.push(n),n.init().then(function(e){return e.currentlyHeight=50,r.updateHeight(),e.updateLabel(),r.withPreservedSelection(r._ensureTiersGrouped),e._updateFromConfig(),r.reorderTiers(),e})},n.prototype.reorderTiers=function(){p(this.tierHolder),p(this.pinnedTierHolder),this.disablePinning&&(this.tierHolder.appendChild(this.ruler),this.tierHolder.appendChild(this.ruler2));for(var e=!1,t=[],r=[],i=0;i<this.tiers.length;++i){var n=this.tiers[i],s=-1===["sub","dummy"].indexOf(this.tiers[i].dasSource.renderer);n.pinned&&!this.disablePinning?(t.push(n),s&&this.pinnedTierHolder.appendChild(this.tiers[i].row),e=!0):(r.push(n),s&&this.tierHolder.appendChild(this.tiers[i].row))}this.withPreservedSelection(function(){this.tiers.splice(0,this.tiers.length);for(var e=0;e<t.length;++e)this.tiers.push(t[e]);for(var e=0;e<r.length;++e)this.tiers.push(r[e])}),e?this.pinnedTierHolder.classList.add("tier-holder-pinned-full"):this.pinnedTierHolder.classList.remove("tier-holder-pinned-full"),this.arrangeTiers()},n.prototype.withPreservedSelection=function(e){for(var t=[],r=0;r<this.selectedTiers.length;++r)t.push(this.tiers[this.selectedTiers[r]]);e.call(this),this.selectedTiers=[];for(var i=0;i<this.tiers.length;++i)t.indexOf(this.tiers[i])>=0&&this.selectedTiers.push(i)},n.prototype.refreshTier=function(e,t){var r=this.getTierRenderer(e);if("multi"===e.dasSource.renderer)r.drawTier(e);else{var i=t||r.renderTier;this.knownSpace&&this.knownSpace.invalidate(e,i)}},n.prototype.getTierRenderer=function(e){var t=e.dasSource.renderer||this.defaultRenderer;return"string"==typeof t?this.renderers[t]:"function"==typeof t.renderTier&&"function"==typeof t.drawTier?t:void console.log("Tier doesn't have a renderer")},n.prototype._ensureTiersGrouped=function(e){for(var t={},r=0;r<this.tiers.length;++r){var i=this.tiers[r];i.dasSource.tierGroup&&pusho(t,i.dasSource.tierGroup,i)}var n=[];e&&this.tiers.reverse();for(var r=0;r<this.tiers.length;++r){var i=this.tiers[r];if(i.dasSource.tierGroup){var s=t[i.dasSource.tierGroup];if(s){e&&s.reverse();for(var o=0;o<s.length;++o)n.push(s[o]);t[i.dasSource.tierGroup]=null}}else n.push(i)}e&&n.reverse(),this.tiers.splice(0,this.tiers.length);for(var o=0;o<n.length;++o)this.tiers.push(n[o])},n.prototype.arrangeTiers=function(){for(var e=[],t={},r=0;r<this.tiers.length;++r){var i=this.tiers[r];i.pinned&&(e.push(i),i.dasSource.tierGroup&&pusho(t,i.dasSource.tierGroup,i))}for(var r=0;r<this.tiers.length;++r){var i=this.tiers[r];i.pinned||(e.push(i),i.dasSource.tierGroup&&pusho(t,i.dasSource.tierGroup,i))}for(var n in t){var s=t[n],o=this.tierGroups[n];o||(o={element:f("div",f("span",n,{className:"tier-group-label"}),{className:"tier-group"})},this.tierGroups[n]=o),o.element.parentNode&&o.element.parentNode.removeChild(o.element);for(var a=s[0].pinned?this.pinnedTierHolder:this.tierHolder,l=1e7,u=0,r=0;r<s.length;++r){var h=s[r].row;l=Math.min(l,h.offsetTop),u=Math.max(u,h.offsetTop+h.offsetHeight)}o.element.style.top=l+"px",o.element.style.left="0px",o.element.style.height=u-l+"px",a.appendChild(o.element)}if(this.tierBackgroundColors)for(var r=0;r<e.length;++r){var i=e[r];i.setBackground(this.tierBackgroundColors[r%this.tierBackgroundColors.length]),i.dasSource.tierGroup?i.label.style.left="18px":i.label.style.left="2px",i.background=this.tierBackgroundColors[r%this.tierBackgroundColors.length]}},n.prototype.refresh=function(){this.retrieveTierData(this.tiers),this.drawOverlays(),this.positionRuler()};if(n.prototype.retrieveTierData=function(e){this.notifyLocation();var t=(this.viewEnd-this.viewStart+1,this.minExtraWidth/this.scale|0),r=this.maxExtraWidth/this.scale|0,i=(this.viewStart+this.viewEnd)/2,n=i-this.origin;this.origin=i,this.scaleAtLastRedraw=this.scale;for(var s=0;s<e.length;++s){var o=n;e[s].originHaxx&&(o+=e[s].originHaxx),e[s].originHaxx=o}var a=this.targetQuantRes/this.scale,l=Math.max(1,(0|this.viewStart)-t),u=Math.min((0|this.viewEnd)+t,(0|this.currentSeqMax)>0?0|this.currentSeqMax:1e9),h=Math.max(1,(0|this.viewStart)-r),c=Math.min((0|this.viewEnd)+r,(0|this.currentSeqMax)>0?0|this.currentSeqMax:1e9);if(!this.knownSpace||this.knownSpace.chr!==this.chr){var f=this.getSequenceSource();this.knownSpace&&this.knownSpace.cancel(),this.knownSpace=new q(this.tiers,this.chr,h,c,a,f)}var p=this.knownSpace.bestCacheOverlapping(this.chr,l,u);p&&p.min<=l&&p.max>=u?(this.drawnStart=Math.max(p.min,h),this.drawnEnd=Math.min(p.max,c)):(this.drawnStart=h,this.drawnEnd=c),this.knownSpace.retrieveFeatures(e,this.chr,this.drawnStart,this.drawnEnd,a)},n.prototype.queryRegistry=function(e,t){if(this.registry){var r,i,n=this;e?(r=this.chains[e].coords,n.mappableSources[e]||(n.mappableSources[e]=new c),i=n.mappableSources[e]):(r=this.coordSystem,i=this.availableSources);var o=w(d(r));if(t){var a=localStorage["dalliance.registry."+o+".last_queried"];if(a)try{s(i,JSON.parse(localStorage["dalliance.registry."+o+".sources"]),e);var l=(0|Date.now())-(0|a);if(432e5>l)return}catch(u){console.log("Bad registry cache: "+u)}}var h=this.registry;if(0==h.indexOf("//")){var f=window.location.protocol;"https:"!=f&&"http:"!=f&&(h="http:"+h)}new U(h).sources(function(t){for(var n=[],a=0;a<t.length;++a){var l=t[a];if(l.coords&&0!=l.coords.length){var u=l.coords[0];u.taxon==r.taxon&&u.auth==r.auth&&u.version==r.version&&n.push(l)}}localStorage["dalliance.registry."+o+".sources"]=JSON.stringify(n),localStorage["dalliance.registry."+o+".last_queried"]=""+Date.now(),s(i,n,e)},function(e){},r)}},n.prototype.move=function(e,t){var r=this.viewEnd-this.viewStart,i=this.viewStart-1*e/this.scale,n=i+r;t||(this.currentSeqMax>0&&n>this.currentSeqMax&&(n=this.currentSeqMax,i=this.viewEnd-r),1>i&&(i=1,n=i+r)),this.setLocation(null,i,n,null,t)},n.prototype.zoomStep=function(e){var t=1*this.zoomSliderValue,r=t+e;r<this.zoomMin&&(r=this.zoomMin),r>this.zoomMax&&(r=this.zoomMax),r!=t&&(this.zoomSliderValue=r,this.zoom(Math.exp(1*r/this.zoomExpt)))},n.prototype.zoom=function(e){this.zoomFactor=e;var t=0|Math.round((this.viewStart+this.viewEnd)/2);if(this.viewStart=t-this.zoomBase*this.zoomFactor/2,this.viewEnd=t+this.zoomBase*this.zoomFactor/2,this.currentSeqMax>0&&this.viewEnd>this.currentSeqMax+5){var r=this.viewEnd-this.viewStart+1;this.viewEnd=this.currentSeqMax,this.viewStart=this.viewEnd-r+1}if(this.viewStart<1){var r=this.viewEnd-this.viewStart+1;this.viewStart=1,this.viewEnd=this.viewStart+r-1}this.scale=this.featurePanelWidth/(this.viewEnd-this.viewStart);this.viewEnd-this.viewStart+1,this.scale/this.scaleAtLastRedraw;this.notifyLocation(),this.refresh()},n.prototype.spaceCheck=function(e){if(!this.knownSpace||this.knownSpace.chr!==this.chr)return void this.refresh();var t=((this.viewEnd-this.viewStart|0)+1,this.minExtraWidth/this.scale|0);this.maxExtraWidth/this.scale|0;((0|this.drawnStart)>Math.max(1,(0|this.viewStart)-t|0)||(0|this.drawnEnd)<Math.min((0|this.viewEnd)+t,(0|this.currentSeqMax)>0?0|this.currentSeqMax:1e9))&&this.refresh()},n.prototype.resizeViewer=function(e){var t=0|this.tierHolder.getBoundingClientRect().width;if(0!=t){var r=Math.max(this.featurePanelWidth,300);if(this.featurePanelWidth=0|t,r!=this.featurePanelWidth){this.zoomMax=this.zoomExpt*Math.log(this.maxViewWidth/this.zoomBase),this.zoomMin=this.zoomExpt*Math.log(this.featurePanelWidth/this.maxPixelsPerBase/this.zoomBase),this.zoomSliderValue=this.zoomExpt*Math.log((this.viewEnd-this.viewStart+1)/this.zoomBase);var i=this.viewEnd-this.viewStart,n=this.viewStart+i*this.featurePanelWidth/r;this.viewEnd=n;var s=this.viewEnd-this.viewStart+1;this.currentSeqMax>0&&this.viewEnd>this.currentSeqMax&&(this.viewEnd=this.currentSeqMax,this.viewStart=this.viewEnd-s+1),this.viewStart<1&&(this.viewStart=1,this.viewEnd=this.viewStart+s-1),this.positionRuler(),e||this.spaceCheck(),this.notifyLocation()}this.fullScreen&&this.setFullScreenHeight()}},n.prototype.setFullScreenHeight=function(){var e=document.body.offsetHeight-this.browserHolder.offsetHeight;this.browserHolder.style.maxHeight=Math.max(300,window.innerHeight-e-20)+"px"},n.prototype.addTier=function(e){var t=this;return e=g(e),e.disabled=!1,this.makeTier(e).then(function(e){return t.refreshTier(e),t.markSelectedTiers(),t.positionRuler(),t.notifyTier("added",e),e})},n.prototype.removeTier=function(e,t){var r=-1;if("undefined"!=typeof e.index&&e.index>=0&&e.index<this.tiers.length)r=e.index;else for(var i=0;i<this.tiers.length;++i){var n=this.tiers[i].dasSource;if(O(e,n)){r=i;break}}if(0>r)throw"Couldn't find requested tier";var s=this.tiers[r];this.tiers.splice(r,1);for(var o=[],a=0;a<this.selectedTiers.length;++a){var l=this.selectedTiers[a];r>l?o.push(l):l>r&&o.push(l-1)}this.selectedTiers=o,this.markSelectedTiers(),s.destroy(),this.knownSpace&&(this.knownSpace.featureCache[s]=null),this.reorderTiers(),this.notifyTier("removed",s)},n.prototype.removeAllTiers=function(){var e=this;this.selectedTiers=[],this.markSelectedTiers(),this.tiers.forEach(function(t){t.destroy(),e.knownSpace&&(e.knownSpace.featureCache[t]=null)}),this.tiers.length=0,this.reorderTiers(),this.notifyTier("removedAll",null)},n.prototype.getSequenceSource=function(){return void 0===this._sequenceSource&&(this._sequenceSource=this._getSequenceSource()),this._sequenceSource},n.prototype._getSequenceSource=function(){for(var e=0;e<this.tiers.length;++e)if(this.tiers[e].sequenceSource)return this.tiers[e].sequenceSource;for(var t=0;t<this.defaultSources.length;++t){var r=this.defaultSources[t];if(r.provides_entrypoints||"sequence"==r.tier_type||r.twoBitURI||r.twoBitBlob)return r.twoBitURI||r.twoBitBlob?new H(r):r.ensemblURI?new N(r):new G(r)}},n.prototype.setLocation=function(e,t,r,i,n){if("number"!=typeof t)throw Error("minimum must be a number (got "+JSON.stringify(t)+")");if("number"!=typeof r)throw Error("maximum must be a number (got "+JSON.stringify(r)+")");if(t>r){var s=t;t=r,r=s}else t===r&&(r+=1);i||(i=function(e){if(e)throw e});var o=this;if((!e||e==this.chr)&&this.currentSeqMax>0)return this._setLocation(null,t,r,null,i,n);var a=this.getSequenceSource();if(!a)return i("Need a sequence source");var l=e||this.chr;a.getSeqInfo(l,function(s){if(s)return o._setLocation(e,t,r,s,i,n);var u;u=0==l.indexOf("chr")?l.substr(3):"chr"+l,a.getSeqInfo(u,function(s){return!s&&e?i("Couldn't find sequence '"+e+"'"):s?o._setLocation(u,t,r,s,i,n):o._setLocation(null,t,r,null,i,n)})})},n.prototype._setLocation=function(e,t,r,i,n,s){var o=!1;e&&(0==e.indexOf("chr")&&(e=e.substring(3)),this.chr!=e&&(o=!0),this.chr=e,this.currentSeqMax=i.length),t=parseFloat(t),r=parseFloat(r);var a=Math.max(10,r-t+1);if(!s){var l=this.currentSeqMax;0>=l&&(l=1e12),1>t&&(t=1,r=t+a-1),r>l&&(r=l,t=Math.max(1,r-a+1))}this.viewStart=t,this.viewEnd=r;var u=Math.max(this.featurePanelWidth||this.offscreenInitWidth,50)/(this.viewEnd-this.viewStart),h=this.scale,c=Math.abs(u-h)>1e-6;this.scale=u;var f,p;if(p=this.zoomSliderValue,this.zoomSliderValue=f=this.zoomExpt*Math.log((this.viewEnd-this.viewStart+1)/this.zoomBase),c||o){for(var d=0;d<this.tiers.length;++d)this.tiers[d].viewportHolder.style.left="5000px",this.tiers[d].overlay.style.left="5000px";if(this.refresh(),this.savedZoom){f-=this.zoomMin,p-=this.zoomMin;var g=f-p,v=f-this.savedZoom;Math.abs(g)>Math.abs(v)&&(this.isSnapZooming=!this.isSnapZooming,this.savedZoom=p)}else this.isSnapZooming=!1,this.savedZoom=null}else for(var d=((this.viewStart+this.viewEnd)/2,0);d<this.tiers.length;++d){var y=(this.viewStart-this.tiers[d].norigin)*this.scale;this.tiers[d].viewportHolder.style.left=""+((0|-y)-1e3)+"px",this.tiers[d].drawOverlay()}return this.notifyLocation(),this.spaceCheck(),this.instrumentActivity&&(this.activityStartTime=0|Date.now()),n()},n.prototype.setCenterLocation=function(e,t){var r=(this.viewEnd-this.viewStart)/2,i=t-r,n=t+r;this.setLocation(e,i,n)},n.prototype.pingActivity=function(){if(this.instrumentActivity&&this.activityStartTime){for(var e=0,t=0;t<this.tiers.length;++t)"none"!==this.tiers[t].loaderButton.style.display&&++e;if(0==e){var r=0|Date.now();console.log("Loading took "+(r-this.activityStartTime)+"ms"),this.activityStartTime=null}}},n.prototype.addInitListener=function(e){this.initListeners.push(e)},n.prototype.addFeatureListener=function(e,t){t=t||{},this.featureListeners.push(e)},n.prototype.removeFeatureListener=function(e,t){var r=arrayIndexOf(this.featureListeners,e);r>=0&&this.featureListeners.splice(r,1)},n.prototype.notifyFeature=function(e,t,r,i){for(var n=0;n<this.featureListeners.length;++n)try{if(this.featureListeners[n](e,t,r,i))return}catch(s){console.log(s.stack)}},n.prototype.addFeatureHoverListener=function(e,t){t=t||{},this.featureHoverListeners.push(e)},n.prototype.removeFeatureHoverListener=function(e,t){var r=arrayIndexOf(this.featureHoverListeners,e);r>=0&&this.featureHoverListeners.splice(r,1)},n.prototype.notifyFeatureHover=function(e,t,r,i){for(var n=0;n<this.featureHoverListeners.length;++n)try{this.featureHoverListeners[n](e,t,r,i)}catch(s){console.log(s.stack)}},n.prototype.addViewListener=function(e,t){t=t||{},this.viewListeners.push(e)},n.prototype.removeViewListener=function(e,t){var r=arrayIndexOf(this.viewListeners,e);r>=0&&this.viewListeners.splice(r,1)},n.prototype.notifyLocation=function(){var e=Math.max(1,0|this.viewStart),t=0|this.viewEnd;this.currentSeqMax>0&&t>this.currentSeqMax&&(t=this.currentSeqMax);for(var r=0;r<this.viewListeners.length;++r)try{this.viewListeners[r](this.chr,e,t,this.zoomSliderValue,{current:this.zoomSliderValue,alternate:this.savedZoom+this.zoomMin||this.zoomMin,isSnapZooming:this.isSnapZooming,min:this.zoomMin,max:this.zoomMax},this.viewStart,this.viewEnd)}catch(i){console.log(i.stack)}},n.prototype.addTierListener=function(e){this.tierListeners.push(e)},n.prototype.removeTierListener=function(e){var t=arrayIndexOf(this.tierListeners,e);t>=0&&this.tierListeners.splice(t,1)},n.prototype.notifyTier=function(e,t){for(var r=0;r<this.tierListeners.length;++r)try{this.tierListeners[r](e,t)}catch(i){console.log(i.stack)}},n.prototype.addRegionSelectListener=function(e){this.regionSelectListeners.push(e)},n.prototype.removeRegionSelectListener=function(e){var t=arrayIndexOf(this.regionSelectListeners,e);t>=0&&this.regionSelectListeners.splice(t,1)},n.prototype.notifyRegionSelect=function(e,t,r){for(var i=0;i<this.regionSelectListeners.length;++i)try{this.regionSelectListeners[i](e,t,r)}catch(n){console.log(n.stack)}},n.prototype.highlightRegion=function(e,t,r){var i=this;if(e==this.chr)return this._highlightRegion(e,t,r);var n=this.getSequenceSource();if(!n)throw"Need a sequence source";n.getSeqInfo(e,function(s){if(s)return i._highlightRegion(e,t,r);var o;o=0==e.indexOf("chr")?e.substr(3):"chr"+e,n.getSeqInfo(o,function(e){return e?i._highlightRegion(o,t,r):void 0})})},n.prototype._highlightRegion=function(e,t,r){for(var n=0;n<this.highlights.length;++n){var s=this.highlights[n];if(s.chr==e&&s.min==t&&s.max==r)return}this.highlights.push(new i(e,t,r));var o=this.viewStart-1e3/this.scale,a=this.viewEnd+1e3/this.scale;(e==this.chr||e=="chr"+this.chr)&&a>t&&r>o&&this.drawOverlays(),this.notifyLocation()},n.prototype.clearHighlights=function(){this.highlights=[],this.drawOverlays(),this.notifyLocation()},n.prototype.drawOverlays=function(){for(var e=0;e<this.tiers.length;++e)this.tiers[e].drawOverlay()},n.prototype.featuresInRegion=function(e,t,r){var i=[];if(e!==this.chr)return[];for(var n=0;n<this.tiers.length;++n)for(var s=this.tiers[n].currentFeatures||[],o=0;o<s.length;++o){var a=s[o];a.min<=r&&a.max>=t&&i.push(a)}return i},n.prototype.getSelectedTier=function(){return this.selectedTiers.length>0?this.selectedTiers[0]:-1},n.prototype.setSelectedTier=function(e){null==e?this.selectedTiers=[]:this.selectedTiers=[e],this.markSelectedTiers(),this.notifyTierSelection()},n.prototype.markSelectedTiers=function(){for(var e=0;e<this.tiers.length;++e){var t=this.tiers[e].nameButton;this.selectedTiers.indexOf(e)>=0?t.classList.add("active"):t.classList.remove("active")}if(this.selectedTiers.length>0){var r=this.browserHolder.offsetTop+this.browserHolder.offsetHeight/2;r>document.body.scrollTop&&r+100<document.body.scrollTop+window.innerHeight&&this.browserHolder.focus()}},n.prototype.addTierSelectionListener=function(e){this.tierSelectionListeners.push(e)},n.prototype.removeTierSelectionListener=function(e){var t=arrayIndexOf(this.tierSelectionListeners,e);t>=0&&this.tierSelectionListeners.splice(t,1)},n.prototype.notifyTierSelection=function(){for(var e=0;e<this.tierSelectionListeners.length;++e)try{this.tierSelectionListeners[e](this.selectedTiers)}catch(t){console.log(t.stack)}},n.prototype.addTierSelectionWrapListener=function(e){this.tierSelectionWrapListeners.push(e)},n.prototype.removeTierSelectionWrapListener=function(e){var t=arrayIndexOf(this.tierSelectionWrapListeners,e);t>=0&&this.tierSelectionWrapListeners.splice(t,1)},n.prototype.notifyTierSelectionWrap=function(e){for(var t=0;t<this.tierSelectionWrapListeners.length;++t)try{this.tierSelectionWrapListeners[t](e)}catch(r){console.log(r.stack)}},n.prototype.positionRuler=function(){var e="none",t="",r="";if("center"==this.rulerLocation?(e="block",t=""+(this.featurePanelWidth/2|0)+"px"):"left"==this.rulerLocation?(e="block",t="0px"):"right"==this.rulerLocation?(e="block",r="0px"):e="none",this.ruler.style.display=e,this.ruler.style.left=t,this.ruler.style.right=r,this.singleBaseHighlight){this.ruler2.style.display="block",this.ruler2.style.borderWidth="1px",this.scale<1?(this.ruler2.style.width="0px",this.ruler2.style.borderRightWidth="0px"):(this.ruler2.style.width=this.scale+"px",this.ruler2.style.borderRightWidth="1px"),this.locSingleBase.style.visibility="visible";var i=this.featurePanelWidth/2-this.locSingleBase.offsetWidth/2+this.ruler2.offsetWidth/2;this.locSingleBase.style.left=""+(0|i)+"px"}else this.locSingleBase.style.visibility="hidden",this.ruler2.style.width="1px",this.ruler2.style.borderWidth="0px",this.ruler2.style.display="center"==this.rulerLocation?"none":"block";this.ruler2.style.left=""+(this.featurePanelWidth/2|0)+"px";for(var n=0;n<this.tiers.length;++n){var s,o=this.tiers[n],a=o.quantOverlay;o.subtiers&&o.subtiers.length>0&&(s=o.subtiers[0].quant),a&&(a.style.display=s?e:"none",a.style.left=t,a.style.right=r)}},n.prototype.featureDoubleClick=function(e,t,r){if(e&&0!=e.length){var i=e[e.length-1];if(i.min&&i.max){var n=((0|i.min)-(0|this.viewStart))*this.scale,s=(i.max-i.min+1)*this.scale,o=((0|i.min)+(0|i.max))/2;if(s>10){var a=1*(t-n)/s;.3>a?o=0|i.min:a>.7&&(o=(0|i.max)+1)}var l=this.viewEnd-this.viewStart;this.setLocation(null,o-l/2,o+l/2)}}},n.prototype.zoomForScale=function(e){var t;return t=e>this.highZoomThreshold?"high":e>this.mediumZoomThreshold?"medium":"low"},n.prototype.zoomForCurrentScale=function(){return this.zoomForScale(this.scale)},n.prototype.updateHeight=function(){for(var e=0,t=0;t<this.tiers.length;++t)e+=this.tiers[t].currentHeight||30;this.ruler.style.height=""+e+"px",this.ruler2.style.height=""+e+"px",this.browserHolder.style.display="block",this.browserHolder.style.display="-webkit-flex",this.browserHolder.style.display="flex"},n.prototype.scrollArrowKey=function(e,t){if(this.reverseKeyScrolling&&(t=-t),e.ctrlKey||e.metaKey){var r=!1;e.shiftKey&&(r=!0),this.leap(t,r)}else if(this.scale>1){var i=(this.viewStart+this.viewEnd)/2,n=i-Math.round(i),s=1;e.shiftKey&&(s*=10),t>0?(s=-s,s-=n,n>0&&(s+=1)):(s-=n,0>n&&(s-=1)),this.setLocation(null,this.viewStart+s,this.viewEnd+s)}else this.move(e.shiftKey?100*t:25*t)},n.prototype.leap=function(e,t){var r=this,i=(r.viewStart+r.viewEnd+1)/2|0;e>0&&r.viewStart<=1?i-=1e8:0>e&&r.viewEnd>=r.currentSeqMax&&(i+=1e8);var n=r.getSelectedTier();if(!(0>n)){var s=r.tiers[n];s&&(s.featureSource&&this.sourceAdapterIsCapable(s.featureSource,"quantLeap")&&"number"==typeof s.quantLeapThreshold||s.featureSource&&this.sourceAdapterIsCapable(s.featureSource,"leap"))?s.findNextFeature(r.chr,i,-e,t,function(n){if(n){var s=n.min,o=n.max;t&&(e>0?s>i+1?o=s:(o++,s=o):i-1>o?(o++,s=o):o=s);var a=r.viewEnd-r.viewStart+1;parseFloat(a/2)==parseInt(a/2)&&a--;var l=(s+o-a)/2+1,u=l+a-1;r.setLocation(n.segment,l,u)}else alert("no next feature")}):this.move(100*e)}},n.prototype.nameForCoordSystem=function(e){var t=null,r=null;return this.assemblyNamePrimary&&(t=""+e.auth,"undefined"!=typeof e.version&&(t+=e.version)),this.assemblyNameUcsc&&(r=e.ucscName),null!=t&&null!=r?t+"/"+r:t||r||"unknown"},n.prototype.makeLoader=function(e){e=e||16;var t=window.devicePixelRatio>1;return 20>e?f("img",null,{src:this.resolveURL("$$img/spinner_"+(t?16:32)+".gif"),width:"16",height:"16"}):f("img",null,{src:this.resolveURL("$$img/spinner_"+(t?24:48)+".gif"),width:"24",height:"24"})},n.prototype.canFetchPlainHTTP=function(){var e=this;if(!this._plainHTTPPromise){var t=this.getWorker();t?this._plainHTTPPromise=new A(function(r,i){t.postCommand({command:"textxhr",uri:e.httpCanaryURL},function(e,t){r(e?!0:!1)})}):this._plainHTTPPromise=new A(function(t,r){v(e.httpCanaryURL,function(e,r){t(e?!0:!1)},{timeout:2e3})})}return this._plainHTTPPromise},n.prototype.getWorker=function(){return this.useFetchWorkers&&this.fetchWorkers&&0!=this.fetchWorkers.length?(this.nextWorker>=this.fetchWorkers.length&&(this.nextWorker=0),this.fetchWorkers[this.nextWorker++]):null},n.prototype.registerResolver=function(e){var t="res"+ ++this.resolverSeed;return this.resolvers[t]=e,t},a.prototype.postCommand=function(e,t,r){var i="x"+ ++this.tagSeed;e.tag=i,this.callbacks[i]=t,this.worker.postMessage(e,r)},a.prototype.terminate=function(){this.worker.terminate()},"undefined"!=typeof t){t.exports={Browser:n},e("./browser-ui"),e("./track-adder"),e("./feature-popup"),e("./tier-actions"),e("./domui"),e("./search");var D=e("./sourceadapters"),H=D.TwoBitSequenceSource,N=D.EnsemblSequenceSource,G=(D.EnsemblProteinSequenceSource,D.DASSequenceSource),q=e("./kspace").KnownSpace,U=e("./das").DASRegistry}u.prototype.get=function(e){var t=this.sourcesByURI[F(e)];if(t)for(var r=0;r<t.configs.length;++r)if(R(t.configs[r],e))return t.sources[r]},u.prototype.put=function(e,t){var r=F(e),i=this.sourcesByURI[r];i||(i={configs:[],sources:[]},this.sourcesByURI[r]=i),i.configs.push(e),i.sources.push(t)}},{"./browser-ui":5,"./chainset":7,"./das":11,"./default-renderer":12,"./domui":13,"./dummy-renderer":14,"./feature-popup":22,"./kspace":26,"./multi-renderer":29,"./numformats":30,"./search":35,"./sha1":38,"./sourceadapters":39,"./sourcecompare":40,"./sub-renderer":43,"./thub":49,"./tier":52,"./tier-actions":50,"./track-adder":53,"./utils":56,"./version":58,"es6-promise":60}],7:[function(e,t,r){"use strict";function i(e,t,r,i){"string"==typeof e?(this.uri=e,this.srcTag=t,this.destTag=r,this.coords=i):(this.uri=e.uri,this.srcTag=e.srcTag,this.destTag=e.destTag,this.coords=g(e.coords),this.type=e.type,this.credentials=e.credentials),this.chainsBySrc={},this.chainsByDest={},this.postFetchQueues={},this.fetchedTiles={},this.granularity=1e6,"bigbed"==this.type?this.chainFetcher=new s(this.uri,this.credentials):"alias"==this.type?this.chainFetcher=new u(e):this.chainFetcher=new n(this.uri,this.srcTag,this.destTag)}function n(e,t,r){this.source=new c(e),this.srcTag=t,this.destTag=r}function s(e,t){var r=this;this.uri=e,this.credentials=t,this.bwg=new x(function(e,t){w(new m(r.uri,{credentials:r.credentials,resolver:r.resolver}),function(r,i){r?e(r):t(i)})}),this.bwg.then(function(e,t){t&&console.log(t)})}function o(e){return parseInt(e)}function a(e){return 0==e.indexOf("chr")?e.substr(3):e}function l(e){for(var t={srcChr:a(e.srcChrom),srcMin:parseInt(e.srcStart),srcMax:parseInt(e.srcEnd),srcOri:e.srcOri,destChr:a(e.segment),destMin:e.min-1,destMax:e.max,destOri:e.ori,blocks:[]},r=e.srcStarts.split(",").map(o),i=e.destStarts.split(",").map(o),n=e.blockLens.split(",").map(o),s=0;s<r.length;++s)t.blocks.push([r[s],i[s],n[s]]);return t}function u(e){this.conf=e,this.forwardAliases={};for(var t=e.sequenceAliases||[],r=0;r<t.length;++r){var i=t[r];if(!(i.length<2)){for(var n=[],s=0;s<i.length-1;++s)n.push(i[s]);this.forwardAliases[i[i.length-1]]=n}}}if("undefined"!=typeof e)var h=e("./das"),c=h.DASSource,f=h.DASSegment,p=e("./utils"),d=p.pusho,g=p.shallowCopy,v=e("./cigar").parseCigar,y=e("./bin"),m=y.URLFetchable,b=e("./bigwig"),w=b.makeBwg,x=e("es6-promise").Promise;i.prototype.exportConfig=function(){return{uri:this.uri,srcTag:this.srcTag,destTag:this.destTag,coords:this.coords,type:this.type,credentials:this.credentials}},i.prototype.mapPoint=function(e,t){for(var r=this.chainsBySrc[e]||[],i=0;i<r.length;++i){var n=r[i];if(t>=n.srcMin&&t<=n.srcMax){var s;s="-"==n.srcOri?n.srcMax-t:t-n.srcMin;for(var o=n.blocks,a=0;a<o.length;++a){var l=o[a],u=l[0],h=l[1],c=l[2];if(s>=u&&u+c>=s){var f,p=s-u;return f="-"==n.destOri?n.destMax-h-p:p+h+n.destMin,{seq:n.destChr,pos:f,flipped:n.srcOri!=n.destOri}}}}}return null},i.prototype.mapSegment=function(e,t,r){for(var i=this.chainsBySrc[e]||[],n=[],s=0;s<i.length;++s){var o=i[s];if(r>=o.srcMin&&t<=o.srcMax){var a,l;"-"==o.srcOri?(a=o.srcMax-r,l=o.srcMax-t):(a=t-o.srcMin,l=r-o.srcMin);for(var u=o.blocks,h=0;h<u.length;++h){var c=u[h],f=c[0],p=c[1],d=c[2];if(l>=f&&f+d>=a){var g={segment:o.destChr,flipped:"-"==o.srcOri^"-"==o.destOri};"-"==o.destOri?(a>=f?g.max=o.destMax-p-a+f:(g.max=o.destMax-p,g.partialMax=f-a),f+d>=l?g.min=o.destMax-p-l+f:(g.min=o.destMax-p-d,g.partialMin=l-f-d)):(a>=f?g.min=o.destMin+p+a-f:(g.min=o.destMin+p,g.partialMin=f-a),f+d>=l?g.max=o.destMin+p+l-f:(g.max=o.destMin+p+d,g.partialMax=l-f-d)),n.push(g)}}}}return n},i.prototype.unmapPoint=function(e,t){for(var r=this.chainsByDest[e]||[],i=0;i<r.length;++i){var n=r[i];if(t>=n.destMin&&t<=n.destMax){var s;s="-"==n.srcOri?n.destMax-t:t-n.destMin;for(var o=n.blocks,a=0;a<o.length;++a){var l=o[a],u=l[0],h=l[1],c=l[2];if(s>=h&&h+c>=s){var f,p=s-h,f=p+u+n.srcMin;return f="-"==n.destOri?n.srcMax-u-p:p+u+n.srcMin,{seq:n.srcChr,pos:f,flipped:n.srcOri!=n.destOri}}}}}return null},i.prototype.sourceBlocksForRange=function(e,t,r,i){for(var n=1,s=2,o=this,a=t/this.granularity|0,l=r/this.granularity|0,u=!1,h=!1,c=a;l>=c;++c){var p=e+"_"+c;this.fetchedTiles[p]!=s&&(u=!0,this.fetchedTiles[p]!=n&&(this.fetchedTiles[p]=n,h=!0))}if(u)this.postFetchQueues[e]||this.chainFetcher.fetchChains(e,a*this.granularity,(l+1)*this.granularity-1).then(function(t){o.chainsByDest||(o.chainsByDest[e]=[]);for(var r=0;r<t.length;++r){var i=t[r],n=o.chainsBySrc[i.srcChr];if(n){for(var u=!1,h=0;h<n.length;++h){var c=n[h];if(c.srcMin==i.srcMin&&c.srcMax==i.srcMax){u=!0;break}}u||n.push(i)}else o.chainsBySrc[i.srcChr]=[i];var f=o.chainsByDest[i.destChr];if(f){for(var u=!1,h=0;h<f.length;++h){var c=f[h];if(c.destMin==i.destMin&&c.destMax==i.destMax){u=!0;break}}u||f.push(i)}else o.chainsByDest[i.destChr]=[i]}for(var p=a;l>=p;++p){var d=e+"_"+p;o.fetchedTiles[d]=s}if(o.postFetchQueues[e]){for(var g=o.postFetchQueues[e],v=0;v<g.length;++v)g[v]();o.postFetchQueues[e]=null}})["catch"](function(e){console.log(e)}),d(this.postFetchQueues,e,function(){o.sourceBlocksForRange(e,t,r,i)});else{for(var g=[],v=this.chainsByDest[e]||[],y=0;y<v.length;++y){var m=v[y];if(t<=m.destMax&&r>=m.destMin){var b,w;"-"==m.srcOri?(b=m.destMax-r,w=m.destMax-t):(b=t-m.destMin,w=r-m.destMin);for(var x=m.blocks,S=0;S<x.length;++S){var _=x[S],T=_[0],C=_[1],k=_[2];if(w>=C&&C+k>=b){var L=Math.max(b,C)-C,A=Math.min(w,C+k)-C;"-"==m.destOri?g.push(new f(m.srcChr,m.srcMax-T-A,m.srcMax-T-L)):g.push(new f(m.srcChr,m.srcMin+L+T,m.srcMin+A+T))}}}}i(g)}},n.prototype.fetchChains=function(e,t,r){var i=this;return new x(function(t,r){i.source.alignments(e,{},function(e){for(var r=[],n=0;n<e.length;++n)for(var s=e[n],o=0;o<s.blocks.length;++o){for(var a,l,u=s.blocks[o],h=0;h<u.segments.length;++h){var c=u.segments[h],f=s.objects[c.object];f.dbSource===i.srcTag?a=c:f.dbSource===i.destTag&&(l=c)}if(a&&l){for(var p={srcChr:s.objects[a.object].accession,srcMin:0|a.min,srcMax:0|a.max,srcOri:a.strand,destChr:s.objects[l.object].accession,destMin:0|l.min,destMax:0|l.max,destOri:l.strand,blocks:[]},d=v(a.cigar),g=v(l.cigar),y=0,m=0,b=0,w=0;b<d.length&&w<g.length;)if("M"==d[b].op&&"M"==g[w].op){var x=Math.min(d[b].cnt,g[w].cnt);p.blocks.push([y,m,x]),d[b].cnt==x?++b:d[b].cnt-=x,g[w].cnt==x?++w:g[w]-=x,y+=x,m+=x}else"I"==d[b].op?m+=d[b++].cnt:"I"==g[w].op&&(y+=g[w++].cnt);r.push(p)}}t(r)})})},s.prototype.fetchChains=function(e,t,r){return this.bwg.then(function(i,n){if(!i)throw Error("No BWG");return new x(function(n,s){i.getUnzoomedView().readWigData(e,t,r,function(e){n(e.map(l))})})})},u.prototype.fetchChains=function(e,t,r){for(var i=[],n=this.forwardAliases[e]||[],s=0;s<n.length;++s)i.push({srcChr:n[s],srcMin:1,srcMax:1e9,srcOri:"+",destChr:e,destMin:1,destMax:1e9,destOri:"+",blocks:[[1,1,1e9]]});return x.resolve(i)},"undefined"!=typeof t&&(t.exports={Chainset:i})},{"./bigwig":3,"./bin":4,"./cigar":8,"./das":11,"./utils":56,"es6-promise":60}],8:[function(e,t,r){"use strict";function i(e){for(var t,r=[];null!=(t=n.exec(e));){var i=t[1];0==i.length&&(i=1),r.push({cnt:0|i,op:t[2]})}return r}var n=new RegExp("([0-9]*)([MIDS])","g");"undefined"!=typeof t&&(t.exports={parseCigar:i})},{}],9:[function(e,t,r){"use strict";function i(e,t,r,i){this.red=0|e,this.green=0|t,this.blue=0|r,i&&(this.name=i)}function n(e){var t="00"+e.toString(16);return t.substring(t.length-2)}function s(e){var t=l[e];if(!t){var r=u.exec(e);r?(t=new i("0x"+r[1]|0,"0x"+r[2]|0,"0x"+r[3]|0,e),l[e]=t):(r=h.exec(e),r?(t=new i(0|r[1],0|r[2],0|r[3],e),l[e]=t):(console.log("couldn't handle color: "+e),t=l.black,l[e]=t))}return t}function o(e,t,r){for(var n=[],o=0;o<r.length;++o)n.push(s(r[o]));var a=[];e:for(var l=0;e>l;++l){for(var u=1*l/(e-1),h=t[0]+(t[t.length-1]-t[0])*u,c=0;c<t.length-1;++c)if(h>=t[c]&&h<=t[c+1]){var f=(h-t[c])/(t[c+1]-t[c]),p=n[c],d=n[c+1],g=new i(p.red*(1-f)+d.red*f|0,p.green*(1-f)+d.green*f|0,p.blue*(1-f)+d.blue*f|0).toSvgString();a.push(g);continue e}throw"Bad step"}return a}function a(e,t,r,i){return i?o(e,[0,.5,1],[t,r,i]):o(e,[0,1],[t,r])}i.prototype.toSvgString=function(){return this.name||(this.name="rgb("+this.red+","+this.green+","+this.blue+")"),this.name},i.prototype.toHexString=function(){return"#"+n(this.red)+n(this.green)+n(this.blue)};var l={red:new i(255,0,0,"red"),green:new i(0,255,0,"green"),blue:new i(0,0,255,"blue"),yellow:new i(255,255,0,"yellow"),white:new i(255,255,255,"white"),black:new i(0,0,0,"black"),gray:new i(180,180,180,"gray"),grey:new i(180,180,180,"grey"),lightskyblue:new i(135,206,250,"lightskyblue"),lightsalmon:new i(255,160,122,"lightsalmon"),hotpink:new i(255,105,180,"hotpink")},u=new RegExp("^#([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})([0-9A-Fa-f]{2})$"),h=/rgb\(([0-9]+),([0-9]+),([0-9]+)\)/;"undefined"!=typeof t&&(t.exports={makeColourSteps:o,makeGradient:a,dasColourForName:s})},{}],10:[function(e,t,r){"use strict";function i(){}function n(e,t){var r=t,i=h(e,r);r+=4;for(var n=0;i>n;++n){
4
- var s=(h(e,r),h(e,r+4));r+=8+16*s}var o=h(e,r);r+=4;for(var a=1e9,l=r,u=0;o>u;++u){var c=g(e,l);if(l+=8,c){var f=c.block;c.offset>0&&(f+=65536),a>f&&(a=f);break}}return r+=8*o,{minBlockIndex:a,nbin:i,length:r-t}}function s(e,t,r,i,n){e.slice(0,10).fetch(function(s){return s?o(e,t,r,i,n):i(null,"Couldn't access CRAM.")},{timeout:5e3})}function o(e,t,r,s,a){function l(e){if(!e)return s(null,"Couldn't access CRAM");var t=v(e,e.byteLength),r=new Uint8Array(t),i=h(r,0);if(i!=w)return s(null,"Not a CRAM file, magic=0x"+i.toString(16));for(var n=h(r,4),o="",a=0;n>a;++a)o+=String.fromCharCode(r[a+8]);var l=h(r,n+8),u=n+12;c.chrToIndex={},c.indexToChr=[];for(var a=0;l>a;++a){for(var f=h(r,u),p="",d=0;f-1>d;++d)p+=String.fromCharCode(r[u+4+d]);h(r,u+f+4);c.chrToIndex[p]=a,0==p.indexOf("chr")?c.chrToIndex[p.substring(3)]=a:c.chrToIndex["chr"+p]=a,c.indexToChr.push(p),u=u+8+f}return c.indices?s(c):void 0}function u(e){if(!e)return"Couldn't access CRAI";var t=new Uint8Array(e),r=h(t,0);if(r!=x)return s(null,"Not a CRAI file, magic=0x"+r.toString(16));for(var i=10,o=b.inflateBuffer(e,i,e.byteLength-i),a="",l=new Uint8Array(o),u=0;u<l.length;++u)a+=String.fromCharCode(l[u]);console.log(a),c.indices=[];for(var p=8,d=0;d<nref;++d){var g=p,v=n(t,g);p+=v.length,f=Math.min(v.minBlockIndex,f);var y=v.nbin;y>0&&(c.indices[d]=new Uint8Array(e,g,p-g))}return!0}var c=new i;c.data=e,c.crai=t,c.indexChunks=r;var f=c.indexChunks?c.indexChunks.minBlockIndex:1e9;if(c.indexChunks){var p=c.indexChunks.chunks;c.indices=[];for(var d=0;d<p.length;d++)c.indices[d]=null;c.data.slice(0,f).fetch(l)}else c.crai.fetch(function(t){var i=u(t);i!==!0?c.crai.url&&"undefined"==typeof a?(c.crai.url=c.data.url.replace(new RegExp(".cram$"),".crai"),o(e,c.crai,r,s,!0)):s(null,i):c.data.slice(0,f).fetch(l)})}function a(){}if("undefined"!=typeof e)var l=e("./spans"),u=(l.Range,l.union,l.intersection,e("./bin")),h=u.readInt,c=u.readShort,f=u.readByte,p=(u.readInt64,u.readFloat),d=e("./lh3utils"),g=d.readVob,v=d.unbgzf,y=d.reg2bins,m=d.Chunk,b=e("jszlib");var w=21840194,x=559903,S={MULTIPLE_SEGMENTS:1,ALL_SEGMENTS_ALIGN:2,SEGMENT_UNMAPPED:4,NEXT_SEGMENT_UNMAPPED:8,REVERSE_COMPLEMENT:16,NEXT_REVERSE_COMPLEMENT:32,FIRST_SEGMENT:64,LAST_SEGMENT:128,SECONDARY_ALIGNMENT:256,QC_FAIL:512,DUPLICATE:1024,SUPPLEMENTARY:2048};i.prototype.blocksForRange=function(e,t,r){var i=this.indices[e];if(!i)return[];for(var n=y(t,r),s=[],o=0;o<n.length;++o)s[n[o]]=!0;for(var a=[],l=[],u=h(i,0),c=4,f=0;u>f;++f){var p=h(i,c),d=h(i,c+4);if(c+=8,s[p])for(var v=0;d>v;++v){var b=g(i,c),w=g(i,c+8);(4681>p?l:a).push(new m(b,w)),c+=16}else c+=16*d}for(var x=h(i,c),S=null,_=Math.min(t>>14,x-1),T=Math.min(r>>14,x-1),o=_;T>=o;++o){var C=g(i,c+4+8*o);C&&(!S||C.block<S.block||C.block==S.block&&C.offset<S.offset)&&(S=C)}var k=[];if(null!=S)for(var o=0;o<l.length;++o){var L=l[o];(L.maxv.block>S.block||L.maxv.block==S.block&&L.maxv.offset>=S.offset)&&k.push(L)}l=k;for(var A=[],o=0;o<l.length;++o)A.push(l[o]);for(var o=0;o<a.length;++o)A.push(a[o]);A.sort(function(e,t){var r=e.minv.block-t.minv.block;return 0!=r?r:e.minv.offset-t.minv.offset});var E=[];if(A.length>0){for(var O=A[0],o=1;o<A.length;++o){var R=A[o];R.minv.block==O.maxv.block?O=new m(O.minv,R.maxv):(E.push(O),O=R)}E.push(O)}return E},i.prototype.fetch=function(e,t,r,i,n){function s(){if(f>=a.length)return i(c);if(h){var e=new Uint8Array(h),u=o.readCramRecords(e,a[f].minv.offset,c,t,r,l,n);return h=null,++f,u?i(c):s()}var p=a[f],d=p.minv.block,g=p.maxv.block+65536;o.data.slice(d,g-d).fetch(function(e){return h=v(e,p.maxv.block-p.minv.block+1),s()})}var o=this;n=n||{};var a,l=this.chrToIndex[e];if(void 0===l)a=[];else{if(null===this.indices[l]&&this.indexChunks.chunks[l]){var u=this.indexChunks.chunks[l];return this.crai.slice(u[0],u[1]).fetch(function(s){var o=new Uint8Array(s);return this.indices[l]=o,this.fetch(e,t,r,i,n)}.bind(this))}a=this.blocksForRange(l,t,r),a||i(null,"Error in index fetch")}var h,c=[],f=0;s()};var _=["=","A","C","x","G","x","x","x","T","x","x","x","x","x","x","N"],T=["M","I","D","N","S","H","P","=","X","?","?","?","?","?","?","?"];i.prototype.readCramRecords=function(e,t,r,i,n,s,o){for(;;){var l=h(e,t),u=t+l+4;if(u>e.length)return!1;var d=new a,g=h(e,t+4),v=h(e,t+8),y=h(e,t+12),m=(65280&y)>>8,b=255&y,w=h(e,t+16),x=(4294901760&w)>>16,S=65535&w,C=h(e,t+20),k=h(e,t+24),L=h(e,t+28);h(e,t+32);if(d.segment=this.indexToChr[g],d.flag=x,d.pos=v,d.mq=m,o.light&&(d.seqLength=C),!o.light||o.includeName){for(var A="",E=0;b-1>E;++E)A+=String.fromCharCode(e[t+36+E]);d.readName=A}if(!o.light){k>=0&&(d.nextSegment=this.indexToChr[k],d.nextPos=L);for(var O=t+36+b,R="",F=0;S>F;++F){var M=h(e,O);R=R+(M>>4)+T[15&M],O+=4}d.cigar=R;for(var I="",B=C+1>>1,E=0;B>E;++E){var P=e[O+E];I+=_[(240&P)>>4],I.length<C&&(I+=_[15&P])}O+=B,d.seq=I;for(var D="",E=0;C>E;++E)D+=String.fromCharCode(e[O+E]+33);for(O+=C,d.quals=D;u>O;){var H,N=String.fromCharCode(e[O],e[O+1]),G=String.fromCharCode(e[O+2]);if("A"==G)H=String.fromCharCode(e[O+3]),O+=4;else if("i"==G||"I"==G)H=h(e,O+3),O+=7;else if("c"==G||"C"==G)H=e[O+3],O+=4;else if("s"==G||"S"==G)H=c(e,O+3),O+=5;else if("f"==G)H=p(e,O+3),O+=7;else if("Z"==G||"H"==G)for(O+=3,H="";;){var q=e[O++];if(0==q)break;H+=String.fromCharCode(q)}else{if("B"!=G)throw"Unknown type "+G;var U,z,j=String.fromCharCode(e[O+3]),W=h(e,O+4);if("i"==j||"I"==j||"f"==j)U=4,z="f"==j?p:h;else if("s"==j||"S"==j)U=2,z=c;else{if("c"!=j&&"C"!=j)throw"Unknown array type "+j;U=1,z=f}O+=8,H=[];for(var V=0;W>V;++V)H.push(z(e,O)),O+=U}d[N]=H}}if((!i||d.pos<=n&&d.pos+C>=i)&&(void 0===s||g==s)&&r.push(d),d.pos>n)return!0;t=u}},"undefined"!=typeof t&&(t.exports={makeCram:s,CRAM_MAGIC:w,CRAI_MAGIC:x,CramFlags:S})},{"./bin":4,"./lh3utils":27,"./spans":41,jszlib:71}],11:[function(e,t,r){"use strict";function i(e,t,r,i){this.name=e,this.start=t,this.end=r,this.description=i}function n(e,t){var r;"string"==typeof e?(this.uri=e,r=t||{}):r=e||{};for(var i in r)this[i]=r[i];this.coords||(this.coords=[]),this.props||(this.props={}),this.dasBaseURI=this.uri,this.dasBaseURI&&"/"!=this.dasBaseURI.substr(this.uri.length-1)&&(this.dasBaseURI=this.dasBaseURI+"/")}function s(){}function o(e,t){return e.taxon==t.taxon&&e.auth==t.auth&&e.version==t.version}function a(e,t,r,i,n){this.name=e,this.start=t,this.end=r,this.alphabet=i,this.seq=n}function l(){}function u(e){e&&(this.id=e)}function h(e,t){this.desc=e,this.uri=t}function c(e){this.type=e,this.objects={},this.blocks=[]}function f(){this.styles=[]}function p(){}function d(e){var t=e.getAttribute("steps");t=t?0|t:50;for(var r=[],i=[],n=e.getElementsByTagName("STOP"),s=0;s<n.length;++s){var o=n[s];r.push(1*o.getAttribute("score")),i.push(o.firstChild.nodeValue)}return A(t,r,i)}function g(e,t){t=t||{},this.uri=e,this.opts=t}function v(e,t){var r=e.getElementsByTagName(t);if(r.length>0&&r[0].firstChild){var i=r[0];if(1==i.childNodes.length)return i.firstChild.nodeValue;for(var n="",s=0;s<i.childNodes.length;++s)n+=i.childNodes[s].nodeValue;return n}return null}function y(e){if(e.hasChildNodes()){var t=e.firstChild;do{if(t.nodeType==Node.ELEMENT_NODE)return t;t=t.nextSibling}while(null!=t)}return null}function m(e){for(var t=new Array,r=e.getElementsByTagName("LINK"),i=0;i<r.length;++i){var n=r[i];n.parentNode==e&&t.push(new h(n.firstChild?n.firstChild.nodeValue:"Unknown",n.getAttribute("href")))}return t}function b(e){for(var t=[],r=e.getElementsByTagName("NOTE"),i=0;i<r.length;++i)r[i].firstChild&&t.push(r[i].firstChild.nodeValue);return t}function w(e,t,r,i){if(window.XDomainRequest){var n=new XDomainRequest;n.onload=function(){var e=new ActiveXObject("Microsoft.XMLDOM");e.async=!1,e.loadXML(n.responseText),t(e)},n.open("get",e),n.send()}else try{var n=new XMLHttpRequest,s=setTimeout(function(){console.log("timing out "+e),n.abort(),t(null,n)},5e3);n.ontimeout=function(){console.log("timeout on "+e)},n.onreadystatechange=function(){4==n.readyState&&(clearTimeout(s),(n.status>=200||0==n.status)&&t(n.responseXML,n))},n.open("get",e,!0),n.timeout=5e3,r&&(n.withCredentials=!0),i&&n.setRequestHeader("X-DAS-Authorisation",i),n.overrideMimeType("text/xml"),n.setRequestHeader("Accept","application/xml,*/*"),n.send()}catch(o){t(null,n,o)}}function x(e){return e=(""+e).toLowerCase(),"yes"===e||"true"===e}function S(e){return e?(e=(""+e).toLowerCase(),"no"!==e||"false"!==e):!1}function _(e){var t=C(e);t.styles=[];for(var r=0;r<e.styles.length;++r){var i=t.styles[r]=C(e.styles[r]);i._methodRE=i._labelRE=i._typeRE=void 0,i.style=C(i.style),i.style.id=void 0,i.style._gradient=void 0}return t}if("undefined"!=typeof e)var T=e("./utils"),C=T.shallowCopy,k=T.pusho,L=e("./color"),A=L.makeColourSteps;new Array;i.prototype.toString=function(){return this.name+":"+this.start+".."+this.end},i.prototype.isBounded=function(){return this.start&&this.end},i.prototype.toDASQuery=function(){var e="segment="+this.name;return this.start&&this.end&&(e+=":"+this.start+","+this.end),e},n.prototype.getURI=function(e){return this.resolver?this.resolver(e).then(function(e){return"string"==typeof e?e:e.url}):Promise.resolve(e)},n.prototype.entryPoints=function(e){var t=this.dasBaseURI+"entry_points";this.doCrossDomainRequest(t,function(t){if(!t)return e([]);for(var r=new Array,n=t.getElementsByTagName("SEGMENT"),s=0;s<n.length;++s){var o,a,l=n[s],u=l.getAttribute("id"),h=l.getAttribute("size");h?(o=1,a=0|h):(o=l.getAttribute("start"),o&&(o|=0),a=l.getAttribute("stop"),a&&(a|=0));var c=null;l.firstChild&&(c=l.firstChild.nodeValue),r.push(new i(u,o,a,c))}e(r)})},n.prototype.sequence=function(e,t){var r=this.dasBaseURI+"sequence?"+e.toDASQuery();this.doCrossDomainRequest(r,function(e){if(!e)return void t([]);for(var r=new Array,i=e.getElementsByTagName("SEQUENCE"),n=0;n<i.length;++n){var s=i[n],o=s.getAttribute("id"),l=s.getAttribute("start"),u=s.getAttribute("stop"),h="DNA",c=null;if(s.firstChild){var f=s.firstChild.nodeValue;c="";for(var p=0;;){var d=f.indexOf("\n",p);if(!(d>=0)){c+=f.substring(p).toUpperCase();break}c+=f.substring(p,d).toUpperCase(),p=d+1}}r.push(new a(o,l,u,h,c))}t(r)})},n.prototype.features=function(e,t,r){t=t||{};var i;if(this.features_uri)i=this.features_uri;else{var n=[];if(e)n.push(e.toDASQuery());else if(t.group){var s=t.group;if("string"==typeof s)n.push("group_id="+s);else for(var o=0;o<s.length;++o)n.push("group_id="+s[o])}if(t.adjacent){var a=t.adjacent;"string"==typeof a&&(a=[a]);for(var h=0;h<a.length;++h)n.push("adjacent="+a[h])}if(t.type)if("string"==typeof t.type)n.push("type="+t.type);else for(var c=0;c<t.type.length;++c)n.push("type="+t.type[c]);t.maxbins&&n.push("maxbins="+t.maxbins),n.length>0?i=this.dasBaseURI+"features?"+n.join(";"):r([],"No filters specified")}this.doCrossDomainRequest(i,function(e,t){if(!e){var i;return i=0==t.status?"server may not support CORS":"status="+t.status,void r([],"Failed request: "+i)}for(var n=new Array,s={},o=e.getElementsByTagName("SEGMENT"),a=0;a<o.length;++a){var h=o[a],c=h.getAttribute("id");s[c]={min:h.getAttribute("start"),max:h.getAttribute("stop")};for(var f=h.getElementsByTagName("FEATURE"),p=0;p<f.length;++p){var d=f[p],g=new l;g.segment=c,g.id=d.getAttribute("id"),g.label=d.getAttribute("label");var y=v(d,"START"),w=v(d,"END");(0|y)>(0|w)?(g.min=0|w,g.max=0|y):(g.min=0|y,g.max=0|w);var x=d.getElementsByTagName("TYPE");if(x.length>0){var S=x[0];S.firstChild&&(g.type=S.firstChild.nodeValue),g.typeId=S.getAttribute("id"),g.typeCv=S.getAttribute("cvId")}g.type=v(d,"TYPE"),!g.type&&g.typeId&&(g.type=g.typeId),g.method=v(d,"METHOD");var _=v(d,"ORIENTATION");_||(_="0"),g.orientation=_,g.score=v(d,"SCORE"),g.links=m(d),g.notes=b(d);for(var T=d.getElementsByTagName("GROUP"),C=0;C<T.length;++C){var k=T[C],L=new u;L.type=k.getAttribute("type"),L.id=k.getAttribute("id"),L.links=m(k),L.notes=b(k),g.groups?g.groups.push(L):g.groups=new Array(L)}if(g.notes)for(var A=0;A<g.notes.length;++A){var E=g.notes[A];if(0==E.indexOf("Genename=")){var O=new u;O.type="gene",O.id=E.substring(9),g.groups?g.groups.push(O):g.groups=new Array(O)}}var R=d.getElementsByTagName("PART");if(R.length>0){for(var F=[],M=0;M<R.length;++M)F.push(R[M].getAttribute("id"));g.parts=F}var R=d.getElementsByTagName("PARENT");if(R.length>0){for(var I=[],M=0;M<R.length;++M)I.push(R[M].getAttribute("id"));g.parents=I}n.push(g)}}r(n,void 0,s)},function(e){r([],e)})},n.prototype.alignments=function(e,t,r){var i=this.dasBaseURI+"alignment?query="+e;this.doCrossDomainRequest(i,function(e){if(!e)return void r([],"Failed request "+i);for(var t=[],n=e.getElementsByTagName("alignment"),s=0;s<n.length;++s){for(var o=n[s],a=new c(o.getAttribute("alignType")),l=o.getElementsByTagName("alignObject"),u=0;u<l.length;++u){var h=l[u],f={id:h.getAttribute("intObjectId"),accession:h.getAttribute("dbAccessionId"),version:h.getAttribute("objectVersion"),dbSource:h.getAttribute("dbSource"),dbVersion:h.getAttribute("dbVersion")};a.objects[f.id]=f}for(var p=o.getElementsByTagName("block"),d=0;d<p.length;++d){for(var g=p[d],y={order:g.getAttribute("blockOrder"),segments:[]},m=g.getElementsByTagName("segment"),b=0;b<m.length;++b){var w=m[b],x={object:w.getAttribute("intObjectId"),min:w.getAttribute("start"),max:w.getAttribute("end"),strand:w.getAttribute("strand"),cigar:v(w,"cigar")};y.segments.push(x)}a.blocks.push(y)}t.push(a)}r(t)})},f.prototype.pushStyle=function(e,t,r){e||(e={type:"default"});var i=C(e);t&&(i.zoom=t),i.style=r,this.styles.push(i)},n.prototype.stylesheet=function(e,t){var r,i=this.credentials;this.stylesheet_uri?(r=this.stylesheet_uri,i=!1):r=this.dasBaseURI+"stylesheet",this.getURI(r).then(function(r){w(r,function(r){if(!r)return void(t&&t());for(var i=new f,n=r.getElementsByTagName("TYPE"),s=0;s<n.length;++s){var o=n[s],a={};a.type=o.getAttribute("id"),a.label=o.getAttribute("label"),a.method=o.getAttribute("method");for(var l=o.getElementsByTagName("GLYPH"),u=0;u<l.length;++u){var h=l[u],c=h.getAttribute("zoom"),g=y(h),v=new p;v.glyph=g.localName;for(var m=g.firstChild;m;)m.nodeType==Node.ELEMENT_NODE&&("BGGRAD"==m.localName?v[m.localName]=d(m):v[m.localName]=m.firstChild.nodeValue),m=m.nextSibling;i.pushStyle(a,c,v)}}e(i)},i)})["catch"](function(e){console.log(e),t()})},g.prototype.sources=function(e,t,r){r||(r={});var i=[];r.taxon&&i.push("organism="+r.taxon),r.auth&&i.push("authority="+r.auth),r.version&&i.push("version="+r.version);var o=this.uri;i.length>0&&(o=o+"?"+i.join("&")),w(o,function(r){if(!r&&t)return void t();for(var i=[],o=r.getElementsByTagName("SOURCE"),a=0;a<o.length;++a){var l=o[a],u=l.getElementsByTagName("VERSION");if(!(u.length<1)){for(var h=u[0],c=h.getElementsByTagName("COORDINATES"),f=[],p=0;p<c.length;++p){var d=c[p],g=new s;g.auth=d.getAttribute("authority"),g.taxon=d.getAttribute("taxid"),g.version=d.getAttribute("version"),f.push(g)}for(var v,y=[],m=h.getElementsByTagName("CAPABILITY"),p=0;p<m.length;++p){var b=m[p];if(y.push(b.getAttribute("type")),"das1:features"==b.getAttribute("type")){var w=b.getAttribute("query_uri");v=w.substring(0,w.length-"features".length)}}for(var x={},S=h.getElementsByTagName("PROP"),_=0;_<S.length;++_)k(x,S[_].getAttribute("name"),S[_].getAttribute("value"));if(v){var T=new n(v,{source_uri:l.getAttribute("uri"),name:l.getAttribute("title"),desc:l.getAttribute("description"),coords:f,props:x,capabilities:y});i.push(T)}}}e(i)})},n.prototype.doCrossDomainRequest=function(e,t,r){var i;this.xUser&&(i="Basic "+btoa(this.xUser+":"+this.xPass));try{return w(e,t,this.credentials,i)}catch(n){if(!r)throw n;r(n)}},"undefined"!=typeof t&&(t.exports={DASGroup:u,DASFeature:l,DASStylesheet:f,DASStyle:p,DASSource:n,DASSegment:i,DASRegistry:g,DASSequence:a,DASLink:h,isDasBooleanTrue:x,isDasBooleanNotFalse:S,copyStylesheet:_,coordsMatch:o})},{"./color":9,"./utils":56}],12:[function(e,t,r){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function n(e,t){s(t),t.updateStatus(e)}function s(e){var t=e.viewport.getContext("2d"),r=e.browser.retina&&window.devicePixelRatio>1;if(e.sequenceSource){var i=e.currentSequence;(0,E.drawSeqTier)(e,i)}else e.currentFeatures?c(e,t):console.log("No sequence or features in tier!");if(e.subtiers){var n=N.defaultTo(0,e.dasSource.vOffset);d(e,t,r,!0,n),g(e,t,n),t.restore()}e.drawOverlay(),e.paintQuant(),"function"==typeof e.dasSource.drawCallback&&e.dasSource.drawCallback(t,e),e.originHaxx=0,e.browser.arrangeTiers()}function o(e,t,r,i,n){var s=n.styleForFeature(i),o=void 0,l=!1,u=[],h=null;if(t.forEach(function(t){t.orientation&&null===h&&(h=t.orientation),!o&&t.label&&(o=t.label);var i=n.styleForFeature(t);if(i&&!t.parts){(0,I.isDasBooleanTrue)(i.LABEL)&&(l=!0);var s=a(e,t,r,i,n,null,!0);s&&u.push(s)}}),0===u.length)return null;var c="flat";s&&"LINE"===s.glyph||(n.dasSource.collapseSuperGroups&&!n.bumped?("+"===h||"-"===h)&&(c="collapsed"+h):("+"===h||"-"===h)&&(c="hat"+h));var f=null;(o&&l||s&&((0,I.isDasBooleanTrue)(s.LABEL)||(0,I.isDasBooleanTrue)(s.LABELS)))&&(f=i.label||o),u.sort(function(e,t){return(e.zindex||0)-(t.zindex||0)});var p=new M.GroupGlyph(u,c);return f&&("+"===h?f=">"+f:"-"===h&&(f="<"+f),p=new M.LabelledGlyph(e,p,f,!1)),p.bump=!0,p}function a(e,t,r,i,n,s,o){var a=n.browser.scale,l=n.browser.viewStart,u=i.glyph||"BOX",h=t.min,c=t.max,f=t.orientation,p=t.score,d=t.label||t.id;if(n.dasSource.hideSubpixelGlyphs&&1>(c-h)*a)return null;var g=(h-l)*a,v=(c-l+1)*a,y=Math.max(v,g+1);s=1*s;var _=1*(n.forceHeight||i.HEIGHT||s||12);_=1*_;var T=i.BUMP&&(0,I.isDasBooleanTrue)(i.BUMP),C=void 0,k=void 0;if("CROSS"===u||"EX"===u||"TRIANGLE"===u||"DOT"===u||"SQUARE"===u||"STAR"===u||"PLIMSOLL"===u){var A=b(e,n,t,r,u,i,s,o);if(A){var E=L(A,2);C=E[0],k=E[1]}}else if("HISTOGRAM"===u||"GRADIENT"===u&&"undefined"!==p){var O=w(e,n,t,r,u,i,s),R=L(O,2);C=R[0],k=R[1]}else if("HIDDEN"===u)C=new M.PaddedGlyph(null,g,y),o=!0;else if("ARROW"===u){var F=i.FGCOLOR||"purple",B=(0,I.isDasBooleanTrue)(i.PARALLEL),P=(0,I.isDasBooleanTrue)(i.SOUTHWEST),D=(0,I.isDasBooleanTrue)(i.NORTHEAST);C=new M.ArrowGlyph(g,y,_,F,B,P,D)}else if("ANCHORED_ARROW"===u){var H=i.FGCOLOR||"none",N=i.BGCOLOR||"green";C=new M.AArrowGlyph(g,y,_,N,H,f),C.bump=!0}else if("SPAN"===u){var G=i.FGCOLOR||"black";C=new M.SpanGlyph(g,y,_,G)}else if("LINE"===u){var q=i.FGCOLOR||"black",U=i.STYLE||"solid";C=new M.LineGlyph(g,y,_,U,f,q)}else if("PRIMERS"===u){var z=i.FGCOLOR||"black",j=i.BGCOLOR||"red";C=new M.PrimersGlyph(g,y,_,j,z)}else if("TEXT"===u){var W=i.STRING||"text",V=i.FGCOLOR||"black";C=new M.TextGlyph(e,g,y,_,V,W)}else if("TOOMANY"===u){var X=i.FGCOLOR||"gray",K=i.BGCOLOR||"orange";C=new M.TooManyGlyph(g,y,_,K,X)}else if("POINT"===u){var Z=x(n,t,i),Q=L(Z,2);C=Q[0],k=Q[1]}else if("__SEQUENCE"===u)C=S(e,n,t,i,s);else if("__INSERTION"===u){var Y=!0;if(void 0!==i.__INSERTIONS&&(Y=(0,I.isDasBooleanNotFalse)(i.__INSERTIONS)),C=new M.TriangleGlyph(g,5,"S",5,n.browser.baseColors.I),Y&&(C=new M.LabelledGlyph(e,C,t.insertion||t.altAlleles[0],!1,"center","above","7px sans-serif")),y-g>1){var $=i.FGCOLOR||"red",J=i.BGCOLOR||i.COLOR1||"green",ee=new M.BoxGlyph(g,5,y-g,_,J,$);C=new M.GroupGlyph([ee,C])}}else{if("__NONE"===u)return null;if("BOX"===u){var te=i.FGCOLOR||null,re=i.BGCOLOR||i.COLOR1||"green";i.BGITEM&&t.itemRgb&&(re=t.itemRgb);var ie=(y-g)/(c-h);if("translation"==t.type&&("protein_coding"==t.method||t.readframeExplicit)&&(!t.tags||t.tags.indexOf("cds_start_NF")<0||t.readframeExplicit)&&(!n.dasSource.collapseSuperGroups||n.bumped)&&ie>=.5){var ne=m(n,h,c);C=new M.AminoAcidGlyph(g,y,_,re,ne,t.orientation,t.readframe)}else C=new M.BoxGlyph(g,0,y-g,_,re,te)}}return C?(((0,I.isDasBooleanTrue)(i.LABEL)||t.forceLabel)&&d&&!o&&(C=new M.LabelledGlyph(e,C,d,!1)),T&&(C.bump=!0),C.feature=t,(0,I.isDasBooleanTrue)(i.HIDEAXISLABEL)&&(k=null),k&&(C.quant=k),i.ZINDEX&&(C.zindex=0|i.ZINDEX),C):void 0}function l(e,t,r){var i=[],n={},s={},o=[];N.map(function(l){l.forEach(function(l){var u=e.styleForFeature(l);if(!l.parts&&u)if("LINEPLOT"===u.glyph)(0,R.pusho)(n,u.id,l),s[u.id]=u;else if("STACKED"===u.glyph)o.push(l);else{var h=a(t,l,r,u,e);h&&i.push(h)}})},e.ungroupedFeatures),o.length>0&&(i=i.concat(T(o,e)));for(var l in n){var u=n[l],h=s[l];if("LINEPLOT"===h.glyph){var c=_(u,h,e,r);c.forEach(function(e){return i.push(e)})}}return i}function u(e,t,r,i){var n=Object.keys(e.groupedFeatures),s={};return n.sort(function(t,r){return e.groupedFeatures[r][0].score-e.groupedFeatures[t][0].score}),n.forEach(function(r){var n=o(t,e.groupedFeatures[r],i,e.groups[r],e,e.dasSource.collapseSuperGroups&&!e.bumped?"collapsed_gene":"tent");n&&(n.group=e.groups[r],s[r]=n)}),s}function h(e,t,r,i,n){var s=e.subtierMax||e.dasSource.subtierMax||e.browser.defaultSubtierMax,o=!1,a=new A.SubTier,l=[];return t.forEach(function(t){if(t.bump&&(e.bumped||e.dasSource.collapseSuperGroups)){var r=l.find(function(e){return e.hasSpaceFor(t)});if(r)r.add(t);else if(l.length>=s)o=!0;else{var i=new A.SubTier;i.add(t),l.push(i)}}else a.add(t)}),a.glyphs.length>0&&(l=[a].concat(l)),r&&l.forEach(function(e){e.quant&&e.glyphs.unshift(new M.GridGlyph(e.height,i,n))}),l.forEach(function(e){e.glyphs.sort(function(e,t){return(e.zindex||0)-(t.zindex||0)})}),[l,o]}function c(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:!0,n=3;e.padding="number"==typeof e.dasSource.padding?e.dasSource.padding:n,e.scaleVertical="boolean"==typeof e.dasSource.scaleVertical?e.dasSource.scaleVertical:!1;var s=l(e,t,r);if(e.dasSource.collapseSuperGroups&&!e.bumped){var o=function(t){var r=e.superGroups[t];e.groups[t]=(0,R.shallowCopy)(e.groups[t]);var i=e.groups[t];i.isSuperGroup=!0;var n={},s=1e10,o=-1e10,a=null;r.forEach(function(t,l){var u=e.groupedFeatures[r[l]];u&&(u.forEach(function(e){(0,R.pusho)(n,e.type,e),s=Math.min(e.min,s),o=Math.max(e.max,o),e.segment&&!a&&(a=e.segment)}),(i&&!i.links||0===i.links.length)&&(i.links=e.groups[r[0]].links),delete e.groupedFeatures[r[l]])}),e.groups[t].max=o,e.groups[t].min=s,e.groups[t].segment=a,N.map(function(i){var n=i[0],s=null;i.forEach(function(e){var t=new O.Range(e.min,e.max);s=s?(0,O.union)(s,t):t});var o=s.ranges();o.forEach(function(s){var o=((0|s.max())-(0|s.min())+1)*r.length,a=0;i.forEach(function(e){var t=e.min||0,r=e.max||0;t<=s.max()&&r>=s.min()&&(a+=Math.min(r,s.max())-Math.max(t,s.min())+1)});var l=new I.DASFeature;for(var u in n)l[u]=n[u];l.min=s.min(),l.max=s.max(),l.label&&r.length>1&&(l.label+=" ("+r.length+" vars)"),l.visualWeight=1*a/o,(0,R.pusho)(e.groupedFeatures,t,l)})},n),delete e.superGroups[t]};for(var a in e.superGroups)o(a)}var c=u(e,t,s,r);N.map(function(e){var t=[],r=1e10,i=-1e10;e.forEach(function(e){var n=c[e];n&&(t.push(n),r=Math.min(r,n.min()),i=Math.max(i,n.max()))}),t.forEach(function(e){s.push(new M.PaddedGlyph(e,r,i))})},e.superGroups),N.map(function(e){return s.push(e)},c);var f=h(e,s,i,r),p=L(f,2),d=p[0],g=p[1];e.glyphCacheOrigin=e.browser.viewStart,g?e.updateStatus("Bumping limit exceeded, use the track editor to see more features"):e.updateStatus(),e.subtiers=d}function f(e,t,r){var i=e.browser.viewStart-1e3/e.browser.scale,n=e.browser.viewEnd+1e3/e.browser.scale,s=[];if(e.knownCoverage){var o=e.knownCoverage.ranges();o.forEach(function(e,t){0===t?e.min()>i&&s.push({min:i,max:e.min()-1}):s.push({min:o[t-1].max()+1,max:e.min()-1}),t==o.length-1&&e.max()<n&&s.push({min:e.max()+1,max:n})})}s.length>0&&(t.fillStyle="gray",s.forEach(function(i){var n=(i.min-e.browser.viewStart)*e.browser.scale+1e3,s=(i.max-e.browser.viewStart)*e.browser.scale+1e3;t.fillRect(n,0,s-n,r)}))}function p(e,t,r){e.clearRect(0,0,t,r)}function d(e,t,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:!0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=e.browser.featurePanelWidth+2e3;r&&(s*=2);var o=0|e.viewport.width;s-50>o&&(e.viewport.width=o=s);var a=e.padding+n;e.subtiers.forEach(function(t){return a+=t.height+e.padding}),a+=6,a=Math.max(a,e.browser.minTierHeight);var l=a;r&&(l*=2),l!=e.viewport.height&&(e.viewport.height=l),e.viewportHolder.style.left="-1000px",e.viewport.style.width=r?""+o/2+"px":""+o+"px",e.viewport.style.height=""+a+"px",e.layoutHeight=Math.max(a,e.browser.minTierHeight),e.updateHeight(),e.norigin=e.browser.viewStart,t.save(),r&&t.scale(2,2),i&&p(t,o,l),f(e,t,a)}function g(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=new M.OverlayLabelCanvas,n=(e.glyphCacheOrigin-e.browser.viewStart)*e.browser.scale+1e3;t.translate(n,r+e.padding),i.translate(0,e.padding),e.paintToContext(t,i,n),i.glyphs.length>0?e.overlayLabelCanvas=i:e.overlayLabelCanvas=null,t.restore()}function v(e,t){var r=e.quantMin(t),i=e.quantMax(t);return i||(i=0>r?0:10),r||(r=0),[r,i]}function y(e,t,r){var i=(1*e-t)/(r-t),n=-1*t/(r-t);return[i,n]}function m(e,t,r){var i=null;if(e.currentSequence){var n=0|e.currentSequence.start,s=0|e.currentSequence.end;if(r>=n&&s>=t){var o=Math.max(t,n),a=Math.min(r,s);for(i=e.currentSequence.seq.substr(o-n,a-o+1);o>t;)i="N"+i,o--;for(;r>a;)i+="N",a++}}return i}function b(e,t,r,i,n,s,o,a){var l=t.browser.scale,u=t.browser.viewStart,h=r.score,c=r.label||r.id,f=(r.min-u)*l,p=Math.max((r.max-u+1)*l,f+1),d=1*(t.forceHeight||s.HEIGHT||o||12),g=d,m=null,b=null,w=s.FGCOLOR||"black",x=s.BGCOLOR||"none",S=s.STROKECOLOR;if(s.BGITEM&&r.itemRgb)w=r.itemRgb;else if((0,I.isDasBooleanTrue)(s.COLOR_BY_SCORE2)){var _=s.BGGRAD||s._gradient;_||(_=(0,B.makeGradient)(50,s.COLOR1,s.COLOR2,s.COLOR3),s._gradient=_);var T=r.score2;if(void 0!==T||!w){T=T||0;var C=s.MIN2?1*s.MIN2:0,k=s.MAX2?1*s.MAX2:1,A=(1*T-C)/(k-C),E=A*_.length|0;N.clamp(0,E,_.length-1),w=_[E]}}var O=s.SIZE||d;s.RSIZE&&(O=1*s.RSIZE*d),s.STROKETHRESHOLD&&O<1*s.STROKETHRESHOLD&&(S=null);var R=(f+p)/2;if("EX"===n)m=new M.ExGlyph(R,O,w);else if("TRIANGLE"===n){var F=s.DIRECTION||"N",P=s.LINEWIDTH||O;m=new M.TriangleGlyph(R,O,F,P,w,S)}else if("DOT"===n)m=new M.DotGlyph(R,O,w,S);else if("PLIMSOLL"===n)m=new M.PlimsollGlyph(R,O,.2*O,w,S);else if("SQUARE"===n)m=new M.BoxGlyph(R-O/2,0,O,O,w,S);else if("STAR"===n){var D=s.POINTS||5;m=new M.StarGlyph(R,O/2,D,w,S)}else m=new M.CrossGlyph(R,O,w);if(x&&"none"!==x&&p-f>5){var H=new M.BoxGlyph(f,0,p-f,O,x);m=new M.GroupGlyph([H,m])}if((0,I.isDasBooleanTrue)(s.SCATTER)){var G=v(t,s),q=L(G,2),U=q[0],z=q[1],j=y(h,U,z),W=L(j,2),V=W[0],X=W[1];if(0>V||V>1)return null;var K=function(e){return(e-X)*g};d=Math.max(1,K(V)),i+=K(1),V>=X&&(i-=d),b={min:U,max:z};var Z=0,Q=N.defaultTo(s.LABEL,r.forceLabel);(0,I.isDasBooleanNotFalse)(Q)&&c&&!a&&(m=new M.LabelledGlyph(e,m,c,!0,null,"above"==Q?"above":"below"),"above"===Q&&(Z=m.textHeight+2),a=!0),m=new M.TranslatedGlyph(m,0,i-O/2-Z,g)}return[m,b]}function w(e,t,r,i,n,s,o){var a=t.browser.scale,l=t.browser.viewStart,u=r.score,h=(r.min-l)*a,c=Math.max((r.max-l+1)*a,h+1),f=1*(t.forceHeight||s.HEIGHT||o||12),p=1*f,d=null,g=null,m=(0,I.isDasBooleanTrue)(s.AXISCENTER),b=v(t,s),w=L(b,2),x=w[0],S=w[1];if((0,I.isDasBooleanTrue)(s.AUTOMIN)&&(x=.95*t.currentFeaturesMinScore,console.log("smin: "+x)),(0,I.isDasBooleanTrue)(s.AUTOMAX)&&(S=1.05*t.currentFeaturesMaxScore,console.log("smax: "+S)),1*x>1*u&&(u=x),1*u>1*S&&(u=S),m){var _=t.quantMin(s),T=t.quantMax(s);(0,I.isDasBooleanTrue)(s.AUTOMIN)&&(_=.95*t.currentFeaturesMinScore),(0,I.isDasBooleanTrue)(s.AUTOMAX)&&(T=1.05*t.currentFeaturesMaxScore),x=_-(T-_)/2,S=T-(T-_)/2}var C=y(u,x,S),k=L(C,2),A=k[0],E=k[1];if("HISTOGRAM"===n){var O=function(e){return e-Math.max(0,E)};f=Math.abs(O(A))*p,i+=O(1)*p,A>=E&&(i-=f),m&&(i+=f/2),g=(0,I.isDasBooleanTrue)(s.HIDEAXISLABEL)?null:{min:x,max:S}}var R=s.FGCOLOR||null,F=s.BGCOLOR||s.COLOR1||"green";s.BGITEM&&r.itemRgb&&(F=r.itemRgb);var P=s.ALPHA?1*s.ALPHA:null;if(s.BGGRAD){var D=s.BGGRAD,H=A*D.length|0;H=N.clamp(0,H,D.length-1),F=D[H]}if(s.COLOR2){var G=s._gradient;G||(G=(0,B.makeGradient)(50,s.COLOR1,s.COLOR2,s.COLOR3),s._gradient=G);var q=A*G.length|0;q=N.clamp(0,q,G.length-1),F=G[q]}var U=new M.BoxGlyph(h,i,c-h,f,F,R,P);return d=new M.TranslatedGlyph(U,0,0,p),[d,g]}function x(e,t,r){var i=e.browser.scale,n=e.browser.viewStart,s=t.score,o=(t.min-n)*i,a=Math.max((t.max-n+1)*i,o+1),l=e.forceHeight||r.HEIGHT||30,u=null,h=null,c=v(e,r),f=L(c,2),p=f[0],d=f[1],g=1*l/(d-p),y=(1*s-p)/(d-p),m=(s-1*p)*g|0;h={min:p,max:d};var b=r.FGCOLOR||r.COLOR1||"black";if(r.COLOR2){var w=r._gradient;w||(w=(0,B.makeGradient)(50,r.COLOR1,r.COLOR2,r.COLOR3),r._gradient=w);var x=y*w.length|0;x=N.clamp(0,x,w.length-1),b=w[x]}return u=new M.PointGlyph((o+a)/2,l-m,l,b),[u,h]}function S(e,t,r,i,n){var s=t.browser.scale,o=t.browser.viewStart,a=r.min,l=r.max,u=(r.min-o)*s,h=Math.max((r.max-o+1)*s,u+1),c=1*(t.forceHeight||i.HEIGHT||n||12),f=null,p=r.seq,d=p,g=r.quals,v=g,y=(0,I.isDasBooleanTrue)(i.__INSERTIONS),b=[];if(r.cigar){var w=(0,P.parseCigar)(r.cigar);d="",v="";var x=0;w.forEach(function(r){if("M"===r.op)d+=p.substr(x,r.cnt),v+=g.substr(x,r.cnt),x+=r.cnt;else if("D"===r.op)d+="-".repeat(r.cnt),v+="Z".repeat(r.cnt);else if("I"===r.op){var i=p.substr(x,r.cnt),n=new M.TranslatedGlyph(new M.TriangleGlyph(u+d.length*s,6,"S",5,t.browser.baseColors.I),0,-2,0);y&&(n=new M.LabelledGlyph(e,n,i,!1,"center","above","7px sans-serif")),n.feature={label:"Insertion: "+i,type:"insertion",method:"insertion"},b.push(n),x+=r.cnt}else"S"===r.op?x+=r.cnt:console.log("unknown cigop"+r.op)})}var S=m(t,a,l);if(d&&S&&("mismatch"===i.__SEQCOLOR||"mismatch-all"===i.__SEQCOLOR)){for(var _=[],T="-"===r.orientation?",":".",C=0;C<d.length;++C)_.push(d[C]==S[C]?T:d[C]);d=_.join("")}var k="-"===r.orientation?i._minusColor||"lightskyblue":i._plusColor||"lightsalmon";return i.__disableQuals&&(v=!1),f=new M.SequenceGlyph(t.browser.baseColors,k,u,h,c,d,S,i.__SEQCOLOR,v,!(0,I.isDasBooleanTrue)(i.__CLEARBG),t.scaleVertical),y&&(f=new M.TranslatedGlyph(f,0,7)),b.length>0&&(b.splice(0,0,f),f=new M.GroupGlyph(b)),f}function _(e,t,r,i){i=i||0;var n=r.browser.viewStart,s=r.browser.scale,o=r.forceHeight||t.HEIGHT||30,a=r.quantMin(t),l=r.quantMax(t);(0,I.isDasBooleanTrue)(t.AUTOMIN)&&(a=.95*r.currentFeaturesMinScore),(0,I.isDasBooleanTrue)(t.AUTOMAX)&&(l=1.05*r.currentFeaturesMaxScore);var u=1*o/(l-a),h=t.FGCOLOR||t.COLOR1||"black",c=1,f=null,p=[],d=[],g=null;e.forEach(function(e){var r=(((0|e.min)+(0|e.max))/2-n)*s,l=(e.score-1*a)*u|0;(0,I.isDasBooleanTrue)(t.ADDITIVE)?(f=e.score<0?-1:1,f!==c&&(d.push({points:p,color:1===c?t.POSCOLOR:t.NEGCOLOR}),p=[],p.push(g)),c=f):f=1;var h=o-l*f+i;g={x:r,y:h},p.push(g)}),(0,I.isDasBooleanTrue)(t.ADDITIVE)&&(h=1===f?t.POSCOLOR:t.NEGCOLOR),d.push({points:p,color:h});var v=d.map(function(e){var r=new M.LineGraphGlyph(e.points,e.color,o);return r.quant={min:a,max:l},t.ZINDEX&&(r.zindex=0|t.ZINDEX),r});return v}function T(e,t){for(var r=[],i=[],n=[],s=t.browser.scale,o=t.browser.viewStart,a=0;a<e.length;++a){var l=e[a],u=t.styleForFeature(l),h=1*l.score,c=t.forceHeight||u.HEIGHT||12,f=c=1*c,p=l.min,d=l.max,g=(p-o)*s,v=(d-o+1)*s,y=Math.max(v,g+1),m=t.quantMin(u),b=t.quantMax(u);b=b?1*b:0>m?0:10,m=m?1*m:0;var w;if(h>=0?(w=i[p]||0,i[p]=w+h):(w=n[p]||0,n[p]=w+h),!(w>b||m>w)){m>w+h&&(h=m-w),w+h>b&&(h=b-w);var x=(h+w-m)/(b-m),S=(w-m)/(b-m),_=Math.max(S,x),T=Math.min(S,x);c=(_-T)*f;var C=(1-_)*f,k=u.FGCOLOR||null,L=u.BGCOLOR||u.COLOR1||"green";u.BGITEM&&l.itemRgb&&(L=l.itemRgb);var A=u.ALPHA?1*u.ALPHA:null,E=new M.BoxGlyph(g,C,y-g,c,L,k,A);E=new M.TranslatedGlyph(E,0,0,f),E.feature=l,E.quant={min:m,max:b},u.ZINDEX&&(E.zindex=0|u.ZINDEX),r.push(E)}}return r}function C(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!1,i=50;e.quantOverlay.height=t,e.quantOverlay.width=r?2*i:i,e.quantOverlay.style.height=""+(r?t/2:t)+"px",e.quantOverlay.style.width=""+i+"px",e.quantOverlay.style.display="block";var n=e.quantOverlay.getContext("2d");return r&&n.scale(2,2),n}function k(e,t,r,i){e.save();var n=t.quantOverlay.height,s=100,o=(n+2*t.padding)/i,a=(r.max-r.min)/i;if(e.fillStyle="white",e.globalAlpha=.6,"right"==t.browser.rulerLocation?e.fillRect(s-30,0,30,n+2*t.padding):e.fillRect(0,0,30,n+2*t.padding),e.globalAlpha=1,e.strokeStyle="black",e.lineWidth=1,e.beginPath(),"right"==t.browser.rulerLocation){
5
- e.moveTo(s-8,t.padding),e.lineTo(s,t.padding),e.lineTo(s,n+t.padding),e.lineTo(s-8,n+t.padding);for(var l=1;i-1>l;l++){var u=l*o;e.moveTo(s,u),e.lineTo(s-5,u)}}else{e.moveTo(8,t.padding),e.lineTo(0,t.padding),e.lineTo(0,n+t.padding),e.lineTo(8,n+t.padding);for(var h=1;i-1>h;h++){var c=h*o;e.moveTo(0,c),e.lineTo(5,c)}}if(e.stroke(),e.fillStyle="black","right"==t.browser.rulerLocation){e.textAlign="right",e.fillText((0,D.formatQuantLabel)(r.max),s-9,8),e.fillText((0,D.formatQuantLabel)(r.min),s-9,n+t.padding);for(var f=1;i-1>f;f++){var p=f*o;e.fillText((0,D.formatQuantLabel)(1*r.max-f*a),s-9,p+3)}}else{e.textAlign="left",e.fillText((0,D.formatQuantLabel)(r.max),9,8),e.fillText((0,D.formatQuantLabel)(r.min),9,n+t.padding);for(var d=1;i-1>d;d++){var g=d*o;e.fillText((0,D.formatQuantLabel)(1*r.max-d*a),9,g+3)}}e.restore()}Object.defineProperty(r,"__esModule",{value:!0}),r.paintQuant=r.createQuantOverlay=r.clearViewport=r.drawUnmapped=r.paint=r.prepareViewport=r.prepareSubtiers=r.drawTier=r.renderTier=void 0;var L=function(){function e(e,t){var r=[],i=!0,n=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(i=(o=a.next()).done)&&(r.push(o.value),!t||r.length!==t);i=!0);}catch(l){n=!0,s=l}finally{try{!i&&a["return"]&&a["return"]()}finally{if(n)throw s}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),A=e("./feature-draw.js"),E=e("./sequence-draw.js"),O=e("./spans.js"),R=e("./utils.js"),F=e("./glyphs.js"),M=i(F),I=e("./das.js"),B=e("./color.js"),P=e("./cigar.js"),D=e("./numformats"),H=e("ramda"),N=i(H);r.renderTier=n,r.drawTier=s,r.prepareSubtiers=c,r.prepareViewport=d,r.paint=g,r.drawUnmapped=f,r.clearViewport=p,r.createQuantOverlay=C,r.paintQuant=k},{"./cigar.js":8,"./color.js":9,"./das.js":11,"./feature-draw.js":21,"./glyphs.js":24,"./numformats":30,"./sequence-draw.js":36,"./spans.js":41,"./utils.js":56,ramda:73}],13:[function(e,t,r){"use strict";function i(e,t,r){function i(){r?(n.className="fa fa-caret-down",t.style.display="table"):(n.className="fa fa-caret-right",t.style.display="none")}var n=a("i");i(),n.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),r=!r,i()},!1);var s=a("h6",[n," ",e],{},{display:"block",background:"gray",color:"white",width:"100%",padding:"5px 2px",margin:"0px"});return a("div",[s,t],{})}if("undefined"!=typeof e)var n=e("./cbrowser"),s=n.Browser,o=e("./utils"),a=o.makeElement,l=o.removeChildren;s.prototype.removeAllPopups=function(){l(this.hPopupHolder),l(this.popupHolder)},s.prototype.makeTooltip=function(e,t){var r,i=!1,n=this,s=null;r=function(t){i=!1,s&&(clearTimeout(s),s=null),e.removeEventListener("mouseout",r,!1)};var o=function l(r){var o=r.clientX+window.scrollX,u=r.clientY+window.scrollY;s||(s=setTimeout(function(){var r;r="function"==typeof t?t():t;var h=a("div",[a("div",null,{className:"tooltip-arrow"}),a("div",r,{className:"tooltip-inner"})],{className:"tooltip bottom in"},{display:"block",top:""+(u+20)+"px",left:""+Math.max(o-30,20)+"px"});n.hPopupHolder.appendChild(h);var c;c=function(t){try{n.hPopupHolder.removeChild(h)}catch(r){}window.removeEventListener("mousemove",c,!1),i&&(null==e.offsetParent||l(t))},window.addEventListener("mousemove",c,!1),s=null},1e3))};e.addEventListener("mouseover",function(t){i=!0,e.addEventListener("mouseout",r,!1),o(t)},!1),e.addEventListener("DOMNodeRemovedFromDocument",function(e){i=!1,s&&(clearTimeout(s),s=null)},!1)},s.prototype.popit=function(e,t,r,i){var n=this;i||(i={}),e||(e={});var s,o,l=i.width||200;if(e.clientX)var s=e.clientX,o=e.clientY;else s=500,o=50;s+=document.documentElement.scrollLeft||document.body.scrollLeft,o+=document.documentElement.scrollTop||document.body.scrollTop;var u=window.innerWidth,h=o,c=Math.min(s-l/2-4,u-l-30),f=a("div");if(f.className="popover fade "+(e.clientX?"bottom ":"")+"in",f.style.display="block",f.style.position="absolute",f.style.top=""+h+"px",f.style.left=""+c+"px",f.style.width=l+"px",l>276&&(f.style.maxWidth=l+"px"),f.appendChild(a("div",null,{className:"arrow"})),t){var p=a("button","",{className:"close"});p.innerHTML="&times;",p.addEventListener("mouseover",function(e){p.style.color="red"},!1),p.addEventListener("mouseout",function(e){p.style.color="black"},!1),p.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n.removeAllPopups()},!1);var d,g,v,y,m=a("h4",[a("span",t,null,{maxWidth:"200px"}),p],{},{paddingLeft:"10px",paddingRight:"10px"});v=function(e){e.stopPropagation(),e.preventDefault(),c+=e.clientX-d,8>c&&(c=8),c>u-l-32&&(c=u-l-26),h+=e.clientY-g,h=Math.max(10,h),f.style.top=""+h+"px",f.style.left=""+Math.min(c,u-l-10)+"px",d=e.clientX,g=e.clientY},y=function(e){e.stopPropagation(),e.preventDefault(),window.removeEventListener("mousemove",v,!1),window.removeEventListener("mouseup",y,!1)},m.addEventListener("mousedown",function(e){e.preventDefault(),e.stopPropagation(),d=e.clientX,g=e.clientY,window.addEventListener("mousemove",v,!1),window.addEventListener("mouseup",y,!1)},!1),f.appendChild(m)}f.appendChild(a("div",r,{className:"popover-content"},{padding:"0px"})),this.hPopupHolder.appendChild(f);var b={node:f,displayed:!0};return f.addEventListener("DOMNodeRemoved",function(e){e.target==f&&(b.displayed=!1)},!1),b},"undefined"!=typeof t&&(t.exports={makeTreeTableSection:i})},{"./cbrowser":6,"./utils":56}],14:[function(e,t,r){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function n(e,t){s(t),t.updateStatus(e)}function s(e){var t=e.viewport.getContext("2d"),r=e.browser.retina&&window.devicePixelRatio>1;r&&t.scale(2,2);var i=e.currentFeatures,n=e.currentSequence;e.sequenceSource?a.drawSeqTier(e,n):i?a.prepareSubtiers(e,t):console.log("No sequence or features in tier!"),e.subtiers&&a.prepareViewport(e,t,r,!0),e.drawOverlay(),e.paintQuant(),"function"==typeof e.dasSource.drawCallback&&e.dasSource.drawCallback(t,e),e.originHaxx=0,e.browser.arrangeTiers()}Object.defineProperty(r,"__esModule",{value:!0}),r.drawTier=r.renderTier=void 0;var o=e("./default-renderer"),a=i(o);r.renderTier=n,r.drawTier=s},{"./default-renderer":12}],15:[function(e,t,r){"use strict";function i(e,t){return e.indexOf("?")<0&&(e+="?soft=true"),new l(function(r,i){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4==n.readyState)if(n.status>=300)i("Error code "+n.status);else{var e=JSON.parse(n.response);r(t?e:e.location)}},n.open("GET",e,!0),n.setRequestHeader("Accept","application/json"),n.responseType="text",n.send()})}function n(e){this.rawurl=e}function s(e,t,r,i){i||("object"===("undefined"==typeof t?"undefined":a(t))?(i=t,t=void 0):i={}),this.url="string"==typeof e?new n(e):e,this.start=t||0,r&&(this.end=r),this.opts=i}function o(e){if(!e)return null;for(var t=new Uint8Array(e.length),r=0;r<t.length;++r)t[r]=e.charCodeAt(r);return t.buffer}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};if("undefined"!=typeof e)var l=e("es6-promise").Promise;n.prototype.getURLPromise=function(){return this.urlPromise&&this.urlPromiseValidity>Date.now()?this.urlPromise:(this.urlPromise=i(this.rawurl,!0).then(function(e){return e.location}),this.urlPromiseValidity=Date.now()+432e5,this.urlPromise)},s.prototype.slice=function(e,t){if(0>e)throw"Bad slice "+e;var r=this.start,i=this.end;return r&&e?r+=e:r=e||r,i=t&&r?r+t-1:i||t-1,new s(this.url,r,i,this.opts)},s.prototype.fetchAsText=function(e){var t,r=this,i=new XMLHttpRequest;r.url.getURLPromise().then(function(n){if(i.open("GET",n,!0),r.end){if(r.end-r.start>1e8)throw"Monster fetch!";i.setRequestHeader("Range","bytes="+r.start+"-"+r.end),t=r.end-r.start+1}i.onreadystatechange=function(){return 4==i.readyState?e(200==i.status||206==i.status?i.responseText:null):void 0},r.opts.credentials&&(i.withCredentials=!0),i.send()})["catch"](function(t){return console.log(t),e(null)})},s.prototype.salted=function(){return this},s.prototype.fetch=function(e,t,r){var i=this;return t=t||1,t>3?e(null):void i.url.getURLPromise().then(function(n){var s,a=new XMLHttpRequest;if(a.open("GET",n,!0),a.overrideMimeType("text/plain; charset=x-user-defined"),i.end){if(i.end-i.start>1e8)throw"Monster fetch!";a.setRequestHeader("Range","bytes="+i.start+"-"+i.end),s=i.end-i.start+1}a.responseType="arraybuffer",a.onreadystatechange=function(){if(4==a.readyState){if(200==a.status||206==a.status){if(a.response){var n=a.response.byteLength;return!s||s==n||r&&n==r?e(a.response):i.fetch(e,t+1,n)}if(a.mozResponseArrayBuffer)return e(a.mozResponseArrayBuffer);var l=a.responseText;return!s||s==l.length||r&&l.length==r?e(o(a.responseText)):i.fetch(e,t+1,l.length)}return i.fetch(e,t+1)}},i.opts.credentials&&(a.withCredentials=!0),a.send()})["catch"](function(e){console.log(e)})},"undefined"!=typeof t&&(t.exports={lookupEncodeURI:i,EncodeFetchable:s})},{"es6-promise":60}],16:[function(e,t,r){"use strict";function i(e){if(o.call(this),this.source=e,this.base=e.uri||"//rest.ensembl.org",0===this.base.indexOf("//")){var t=window.location.protocol;"http:"==t||"https:"==t||(this.base="http:"+this.base)}this.species=e.species||"human","string"==typeof e.type?this.type=[e.type]:this.type=e.type||["regulatory"]}if("undefined"!=typeof e)var n=e("./sourceadapters"),s=n.registerSourceAdapterFactory,o=n.FeatureSourceBase,a=e("./das"),l=a.DASStylesheet,u=a.DASStyle,h=a.DASFeature,c=a.DASGroup;i.prototype=Object.create(o.prototype),i.prototype.constructor=i,i.prototype.getStyleSheet=function(e){var t=new l,r=new u;r.glyph="__NONE",this.type.indexOf("exon")>=0&&t.pushStyle({type:"transcript"},null,r),(this.type.indexOf("exon")>=0||this.type.indexOf("transcript")>=0)&&t.pushStyle({type:"gene"},null,r);var i=new u;i.glyph="BOX",i.FGCOLOR="black",i.BGCOLOR="red",i.HEIGHT=8,i.BUMP=!0,i.LABEL=!0,i.ZINDEX=30,t.pushStyle({type:"cds"},null,i);var n=new u;n.glyph="SQUARE",n.BUMP="yes",n.LABEL="no",n.FGCOLOR="blue",t.pushStyle({type:"variation",method:".+_UTR_variant"},null,n);var n=new u;n.glyph="TRIANGLE",n.DIRECTION="S",n.BUMP="yes",n.LABEL="no",n.FGCOLOR="blue",t.pushStyle({type:"variation",method:"missense_variant"},null,n);var n=new u;n.glyph="TRIANGLE",n.DIRECTION="N",n.BUMP="yes",n.LABEL="no",n.FGCOLOR="blue",t.pushStyle({type:"variation",method:"splice_.+_variant"},null,n);var n=new u;n.glyph="STAR",n.POINTS=6,n.BUMP="yes",n.LABEL="no",n.FGCOLOR="blue",t.pushStyle({type:"variation",method:"regulatory_region_variant"},null,n);var n=new u;n.glyph="PLIMSOLL",n.BUMP="yes",n.LABEL="no",n.FGCOLOR="rgb(50,80,255)",n.STROKECOLOR="black",t.pushStyle({type:"variation"},null,n);var n=new u;n.glyph="SQUARE",n.BUMP="yes",n.LABEL="no",n.BGCOLOR="#888888",n.FGCOLOR="red",t.pushStyle({type:"indel",method:".+_UTR_variant"},null,n);var n=new u;n.glyph="TRIANGLE",n.DIRECTION="S",n.BUMP="yes",n.LABEL="no",n.BGCOLOR="#888888",n.FGCOLOR="red",t.pushStyle({type:"indel",method:"missense_variant"},null,n);var n=new u;n.glyph="TRIANGLE",n.DIRECTION="N",n.BUMP="yes",n.LABEL="no",n.BGCOLOR="#888888",n.FGCOLOR="red",t.pushStyle({type:"indel",method:"splice_.+_variant"},null,n);var n=new u;n.glyph="STAR",n.POINTS=6,n.BUMP="yes",n.LABEL="no",n.BGCOLOR="#888888",n.FGCOLOR="red",t.pushStyle({type:"indel",method:"regulatory_region_variant"},null,n);var n=new u;n.glyph="PLIMSOLL",n.BUMP="yes",n.LABEL="no",n.BGCOLOR="#888888",n.FGCOLOR="red",n.STROKECOLOR="black",t.pushStyle({type:"indel"},null,n);var s=new u;return s.glyph="BOX",s.FGCOLOR="black",s.BGCOLOR="orange",s.HEIGHT=8,s.BUMP=!0,s.LABEL=!0,s.ZINDEX=20,t.pushStyle({type:"default"},null,s),e(t)},i.prototype.getScales=function(){return[]},i.prototype.fetch=function(e,t,r,i,n,s,o){for(var a=this,l=this.base+"/overlap/region/"+this.species+"/"+e+":"+t+".."+r,u=[],f=0;f<this.type.length;++f)u.push("feature="+this.type[f]);u.push("content-type=application/json"),l=l+"?"+u.join(";");var p=new XMLHttpRequest;p.onreadystatechange=function(){if(4==p.readyState)if(a.busy--,a.notifyActivity(),p.status>=300){var t="Error code "+p.status;try{var r=JSON.parse(p.response);r.error&&(t=r.error)}catch(i){}o(t,null)}else{for(var n=JSON.parse(p.response),s=[],l=0;l<n.length;++l){var u=n[l],f=[],d=new h;if(d.segment=e,d.min=0|u.start,d.max=0|u.end,d.type=u.feature_type||"unknown",d.id=u.ID,u.Parent){var g=new c;g.id=u.Parent,d.groups=[g]}u.strand&&(u.strand<0?d.orientation="-":u.strand>0&&(d.orientation="+")),u.consequence_type&&(d.method=u.consequence_type),u.alt_alleles&&(f.push("Alleles="+u.alt_alleles.join("/")),u.alt_alleles.length>1&&(u.alt_alleles[1].length!=u.alt_alleles[0].length||"-"==u.alt_alleles[1])&&(d.type="indel")),f.length>0&&(d.notes=f),s.push(d)}o(null,s)}},a.busy++,a.notifyActivity(),p.open("GET",l,!0),p.responseType="text",p.send()},i.prototype.capabilities=function(){var e={};return this.type&&this.type.indexOf("transcript")>=0&&(e.search=["gene"]),e},i.prototype.search=function(e,t){var r=this.base+"/lookup/symbol/"+this.species+"/"+e+"?content-type=application/json",i=new XMLHttpRequest;i.onreadystatechange=function(){if(4==i.readyState){if(i.status>=300||i.status<200){var e="Error code "+i.status;try{var r=JSON.parse(i.response);r.error&&(e=r.error)}catch(n){}return 400==i.status?t([]):t(null,e)}var s=JSON.parse(i.response),o=[];return s&&s.seq_region_name&&o.push({segment:s.seq_region_name,min:s.start,max:s.end}),t(o)}},i.open("GET",r,!0),i.responseType="text",i.send()},s("ensembl",function(e){return{features:new i(e)}})},{"./das":11,"./sourceadapters":39}],17:[function(e,t,r){"use strict";if("undefined"!=typeof e)var i=e("./cbrowser"),n=i.Browser,s=e("./utils"),o=s.shallowCopy,a=e("./sha1"),l=a.hex_sha1,u=e("./das"),h=u.copyStylesheet;n.prototype.exportFullConfig=function(e){e=e||{};var t={chr:this.chr,viewStart:0|this.viewStart,viewEnd:0|this.viewEnd,cookieKey:"dalliance_"+l(Date.now()),coordSystem:this.coordSystem,sources:this.exportSourceConfig(),chains:this.exportChains()};return this.prefix&&(t.prefix=this.prefix),t},n.prototype.exportChains=function(){var e={},t=this.chains||{};for(var r in t)e[r]=t[r].exportConfig();return e},n.prototype.exportSourceConfig=function(e){e=e||{};for(var t=[],r=0;r<this.tiers.length;++r){var i=this.tiers[r],n=o(i.dasSource);n.noPersist||(n.coords=void 0,n.props=void 0,n.disabled||(n.disabled=void 0),i.config.stylesheet?(n.style=h(i.config.stylesheet).styles,n.stylesheet_uri=void 0):n.style&&(n.style=h({styles:n.style}).styles),"string"==typeof i.config.name&&(n.name=i.config.name),void 0!==i.config.height&&(n.forceHeight=i.config.height),void 0!==i.config.forceMin&&(n.forceMin=i.config.forceMin),i.config.forceMinDynamic&&(n.forceMinDynamic=i.config.forceMinDynamic),void 0!==i.config.forceMax&&(n.forceMax=i.config.forceMax),void 0!==i.config.bumped&&(n.bumped=i.config.bumped),i.config.forceMaxDynamic&&(n.forceMaxDynamic=i.config.forceMaxDynamic),t.push(n))}return t},n.prototype.exportPageTemplate=function(e){e=e||{};var t='<html>\n <head>\n <script language="javascript" src="'+this.resolveURL("$$dalliance-compiled.js")+'"></script>\n <script language="javascript">\n var dalliance_browser = new Browser('+JSON.stringify(this.exportFullConfig(e),null,2)+');\n </script>\n </head>\n <body>\n <div id="svgHolder">Dalliance goes here</div>\n </body>\n<html>\n';return t}},{"./cbrowser":6,"./das":11,"./sha1":38,"./utils":56}],18:[function(e,t,r){"use strict";function i(e,t,r,i){e.fillText(t,r-e.measureText(t).width,i)}if("undefined"!=typeof e)var n=e("./cbrowser"),s=n.Browser,o=e("./glyphs"),a=o.OverlayLabelCanvas,l=e("./numformats"),u=l.formatQuantLabel,h=l.formatLongInt,c=e("./version"),f=e("./sequence-draw").drawSeqTierGC;s.prototype.exportImage=function(e){e=e||{};var t=e.width||this.featurePanelWidth,r=3,n=0;(e.banner||e.region)&&(n=40);var s=this.featurePanelWidth,o=this.scale;this.featurePanelWidth=t,this.scale=this.featurePanelWidth/(this.viewEnd-this.viewStart);for(var l=n,p=0;p<this.tiers.length;++p){p>0&&(l+=r);var d=this.tiers[p];if(d.backupSubtiers=d.subtiers,d.backupOriginHaxx=d.originHaxx,d.backupLayoutHeight=d.layoutHeight,d.subtiers){var g=this.getTierRenderer(d);if(g&&g.prepareSubtiers&&g.prepareSubtiers(d,d.viewport.getContext("2d")),d.subtiers){for(var v=d.padding,y=0;y<d.subtiers.length;++y)v=v+d.subtiers[y].height+d.padding;v+=6,d.layoutHeight=Math.max(v,this.minTierHeight)}}void 0!==d.layoutHeight&&(l+=d.layoutHeight)}var m=e.resolutionMultiplier||1,b=200,w=(t+b)*m|0,x=l*m|0,S=makeElement("canvas",null,{width:w,height:x}),_=S.getContext("2d");_.fillStyle="white",_.fillRect(0,0,w,x),_.scale(m,m),e.region&&(_.save(),_.fillStyle="black",_.font="12pt sans-serif",_.fillText(this.chr+":"+h(this.viewStart)+".."+h(this.viewEnd),b+100,28),_.restore()),e.banner&&(_.save(),_.fillStyle="black",_.font="12pt sans-serif",i(_,"Graphics from Biodalliance "+c,b+t-100,28),_.restore()),_.font="10px sans-serif";for(var p=0;p<this.tiers.length;++p){var d=this.tiers[p],T=(d.glyphCacheOrigin-this.viewStart)*this.scale,C=new a;_.save(),_.translate(0,n),_.save(),_.beginPath(),_.moveTo(b,0),_.lineTo(b+t,0),_.lineTo(b+t,d.layoutHeight),_.lineTo(b,d.layoutHeight),_.closePath(),_.clip(),_.translate(b,0),_.save(),_.translate(T,0),d.subtiers?d.paintToContext(_,C,T+1e3):f(d,d.currentSequence,_),_.restore(),_.save(),_.translate(T,0),C.draw(_,-T,t-T),_.restore(),_.restore();for(var k=!1,L=0,A=d.subtiers||[],E=0;E<A.length;++E){var O=A[E];if(O.quant){k=!0;var R=O.quant,F=O.height,M=2;F>40&&(M=1+(F/20|0));var I=F/(M-1),B=(R.max-R.min)/(M-1);_.beginPath(),_.moveTo(b+5,L),_.lineTo(b,L),_.lineTo(b,L+O.height),_.lineTo(b+5,L+O.height);for(var P=1;M-1>P;++P){var D=P*I;_.moveTo(b,L+D),_.lineTo(b+3,L+D)}_.strokeStyle="black",_.strokeWidth=2,_.stroke(),_.fillStyle="black",i(_,u(R.max),b-3,L+7),i(_,u(R.min),b-3,L+O.height);for(var P=1;M-1>P;++P){var D=P*I;i(_,u(1*R.max-P*B),b-3,L+D+3)}}L+=O.height+r}var H;H="string"==typeof d.config.name?d.config.name:d.dasSource.name;var N=_.measureText(H).width;_.fillStyle="black",_.fillText(H,b-(k?28:12)-N,(d.layoutHeight+3)/2),_.restore(),n+=d.layoutHeight+r,d.subtiers=d.backupSubtiers,d.originHaxx=d.backupOriginHaxx,d.layoutHeight=d.backupLayoutHeight}if(e.highlights){_.save(),_.beginPath(),_.moveTo(b,0),_.lineTo(b+t,0),_.lineTo(b+t,n),_.lineTo(b,n),_.closePath(),_.clip(),_.translate(b+T,0);for(var G=this.viewStart,q=this.viewStart,U=this.viewEnd,z=0;z<this.highlights.length;++z){var F=this.highlights[z];(F.chr===this.chr||F.chr==="chr"+this.chr)&&F.min<U&&F.max>q&&(_.globalAlpha=this.defaultHighlightAlpha,_.fillStyle=this.defaultHighlightFill,_.fillRect((F.min-G)*this.scale,0,(F.max-F.min)*this.scale,n))}_.restore()}var j=-1;return"center"==e.ruler?j=b+(this.viewEnd-this.viewStart+1)*this.scale/2:"left"==e.ruler?j=b:"right"==e.ruler&&(j=b+(this.viewEnd-this.viewStart+1)*this.scale),j>=0&&(_.strokeStyle="blue",_.beginPath(),_.moveTo(j,0),_.lineTo(j,n),_.stroke()),this.featurePanelWidth=s,this.scale=o,S.toDataURL("image/png")}},{"./cbrowser":6,"./glyphs":24,"./numformats":30,"./sequence-draw":36,"./version":58}],19:[function(e,t,r){"use strict";if("undefined"!=typeof e)var i=e("./cbrowser"),n=i.Browser,s=e("./utils"),o=s.makeElement,a=s.removeChildren;n.prototype.openExportPanel=function(){var e=this;if("export"===this.uiMode)this.hideToolPanel(),this.setUiMode("none");else{var t=o("div",null,{className:"export-form"}),r=o("select");r.appendChild(o("option","SVG",{value:"svg"})),r.appendChild(o("option","Image",{value:"png"})),r.appendChild(o("option","Dalliance config",{value:"config"})),r.appendChild(o("option","Dalliance sources",{value:"sources"})),r.appendChild(o("option","Dalliance page",{value:"page"})),r.value="svg",r.addEventListener("change",function(e){a(f),w()},!1),t.appendChild(o("p",["Export as: ",r]));var i=o("input",null,{type:"checkbox",checked:this.exportHighlights});i.addEventListener("change",function(t){e.exportHighlights=i.checked,e.storeStatus()},!1);var n=o("input",null,{type:"checkbox",checked:this.exportRuler});n.addEventListener("change",function(t){e.exportRuler=n.checked,e.storeStatus()},!1);var s=o("input",null,{type:"checkbox",checked:this.exportRegion});s.addEventListener("change",function(t){e.exportRegion=s.checked,e.storeStatus()},!1);var l=o("input",null,{type:"checkbox",checked:this.exportBanner});l.addEventListener("change",function(t){e.exportBanner=l.checked,e.storeStatus()},!1);var u=o("input",null,{type:"text",value:"1.0"}),h=o("input",null,{type:"text",value:"800"}),c=o("button","Export",{className:"btn btn-primary"});c.addEventListener("click",function(t){a(f);var s,l,c,p;if("svg"===r.value)s=URL.createObjectURL(e.makeSVG({highlights:i.checked,banner:e.exportBanner,region:e.exportRegion,ruler:n.checked?e.rulerLocation:"none",width:parseInt(h.value)||800})),l="SVG",c="image/svg",p="dalliance-view.svg";else if("png"===r.value){var d=parseFloat(u.value);if(.1>d||d>10)return void alert("bad scale "+d);s=e.exportImage({highlights:i.checked,banner:e.exportBanner,region:e.exportRegion,ruler:n.checked?e.rulerLocation:"none",resolutionMultiplier:d,width:parseInt(h.value)||800}),l="Image",c="image/png",p="dalliance-view.png"}else if("config"===r.value){var g=JSON.stringify(e.exportFullConfig(),null,2),v=new Blob([g],{type:"text/plain"});s=URL.createObjectURL(v),l="Configuration",c="text/plain",p="dalliance-config.json"}else if("sources"===r.value){var g=JSON.stringify(e.exportSourceConfig(),null,2),v=new Blob([g],{type:"text/plain"});s=URL.createObjectURL(v),l="Source array",c="text/plain",p="dalliance-sources.json"}else if("page"===r.value){var y=e.exportPageTemplate(),c="text/html",v=new Blob([y],{type:c});s=URL.createObjectURL(v),l="Page template",p="dalliance-view.html"}if(s){var m=o("a","[Download]",{href:s,download:p,type:c}),b=o("a","[Preview in browser]",{href:s,type:c,target:"_new"});f.appendChild(o("p",[""+l+" created: ",m,b]))}},!1),e.addViewListener(function(){a(f)}),e.addTierListener(function(){a(f)});var f=o("p",""),p=o("tr",[o("th","Include highlights",{},{width:"400px",textAlign:"right"}),o("td",i)]),d=o("tr",[o("th","Include vertical guideline",{},{textAlign:"right"}),o("td",n)]),g=o("tr",[o("th","Scale multiplier",{},{textAlign:"right"}),o("td",u)]),v=o("tr",[o("th","Width (logical px)",{},{textAlign:"right"}),o("td",h)]),y=o("tr",[o("th","Label with genomic coordinates",{},{textAlign:"right"}),o("td",s)]),m=o("tr",[o("th","Include banner",{},{textAlign:"right"}),o("td",l)]),b=o("table",[p,d,v,g,y],null,{width:"500px"}),w=function(){var e=r.value;p.style.display="svg"==e||"png"==e?"table-row":"none",d.style.display="svg"==e||"png"==e?"table-row":"none",g.style.display="png"==e?"table-row":"none",v.style.display="svg"==e||"png"==e?"table-row":"none",y.style.display="svg"==e||"png"==e?"table-row":"none",m.style.display="svg"==e||"png"==e?"table-row":"none"};w(),t.appendChild(b),t.appendChild(c),t.appendChild(f),"none"!==this.uiMode&&this.hideToolPanel(),this.browserHolder.insertBefore(t,this.svgHolder),this.activeToolPanel=t,this.setUiMode("export")}}},{"./cbrowser":6,"./utils":56}],20:[function(e,t,r){"use strict";var i=e("./cbrowser"),n=e("./chainset"),s=e("./sourceadapters"),o=e("./utils"),a=e("./das"),l=e("./sourcecompare");window.Browser=i.Browser,window.sourcesAreEqual=l.sourcesAreEqual,window.Chainset=n.Chainset,window.makeElement=o.makeElement,window.dalliance_registerSourceAdapterFactory=s.registerSourceAdapterFactory,window.dalliance_registerParserFactory=s.registerParserFactory,window.dalliance_makeParser=s.makeParser,window.DASSequence=a.DASSequence,window.DASFeature=a.DASFeature,window.DASGroup=a.DASGroup,window.DASStylesheet=a.DASStylesheet,window.DASStyle=a.DASStyle,window.DASSource=a.DASSource;var u=e("./rulers");window.Ruler=u.Ruler,window.rulerDrawCallback=u.rulerDrawCallback},{"./cbrowser":6,"./chainset":7,"./das":11,"./rulers":33,"./sourceadapters":39,"./sourcecompare":40,"./utils":56}],21:[function(e,t,r){"use strict";function i(){this.glyphs=[],this.height=0,this.quant=null}if("undefined"!=typeof e)var n=e("./tier"),s=n.DasTier,o=e("./numformats"),a=o.formatQuantLabel;i.prototype.indexFor=function(e){for(var t=e.min(),r=0,i=this.glyphs.length;i>r;){var n=(r+i)/2|0;if(n>=this.glyphs.length)return this.glyphs.length;var s=this.glyphs[n];t<s.min()?i=n:r=n+1}return i},i.prototype.add=function(e){var t=this.indexFor(e);this.glyphs.splice(t,0,e),this.height=Math.max(this.height,e.height()),e.quant&&null==this.quant&&(this.quant=e.quant)},i.prototype.hasSpaceFor=function(e){var t=this.indexFor(e);return t>0&&this.glyphs[t-1].max()>=e.min()?!1:t<this.glyphs.length&&this.glyphs[t].min()<=e.max()?!1:!0},s.prototype.paintToContext=function(e,t,r){var i=this.subtiers,n=0|this.viewport.width;e.save();for(var s=0;s<i.length;++s){for(var o=null,a=i[s].glyphs,l=0;l<a.length;++l){var u=a[l];if(u.min()<n-r&&u.max()>-r){var u=a[l];u.draw(e,t),u.quant&&(o=u.quant)}}if(o&&o.min<0&&o.max>0&&this.dasSource.zeroLine){var h=i[0].height*(o.max/(o.max-o.min));e.save(),e.strokeStyle=this.dasSource.zeroLine,e.lineWidth=.5,e.beginPath(),e.moveTo(-1e3,h),e.lineTo(n+1e3,h),e.stroke(),e.restore()}if(this.scaleVertical){var c=this.browser.scale;e.translate(0,c+this.padding),t.translate(0,c+this.padding)}else e.translate(0,i[s].height+this.padding),t.translate(0,i[s].height+this.padding)}if(e.restore(),o&&this.quantLeapThreshold&&this.featureSource&&this.browser.sourceAdapterIsCapable(this.featureSource,"quantLeap")){var h=i[0].height*(1-(this.quantLeapThreshold-o.min)/(o.max-o.min));e.save(),e.strokeStyle="red",e.lineWidth=.3,e.beginPath(),e.moveTo(-1e3,h),e.lineTo(n+1e3,h),e.stroke(),e.restore()}},s.prototype.paintQuant=function(){if(this.quantOverlay){var e,t=this.browser.retina&&window.devicePixelRatio>1;if(this.subtiers&&this.subtiers.length>0&&(e=this.subtiers[0].quant),e){var r=this.subtiers[0].height,i=50;this.quantOverlay.height=this.viewport.height,this.quantOverlay.width=t?2*i:i,this.quantOverlay.style.height=""+(t?this.quantOverlay.height/2:this.quantOverlay.height)+"px",this.quantOverlay.style.width=""+i+"px",this.quantOverlay.style.display="block";var n=this.quantOverlay.getContext("2d");t&&n.scale(2,2);var s=2;r>40&&(s=1+(r/20|0));var o=(r+2*this.padding)/(s-1),l=(e.max-e.min)/(s-1);if(n.fillStyle="white",n.globalAlpha=.6,"right"==this.browser.rulerLocation?n.fillRect(i-30,0,30,r+2*this.padding):n.fillRect(0,0,30,r+2*this.padding),n.globalAlpha=1,n.strokeStyle="black",n.lineWidth=1,n.beginPath(),"right"==this.browser.rulerLocation){n.moveTo(i-8,this.padding),n.lineTo(i,this.padding),n.lineTo(i,r+this.padding),n.lineTo(i-8,r+this.padding);for(var u=1;s-1>u;++u){var h=u*o;n.moveTo(i,h),n.lineTo(i-5,h)}}else{n.moveTo(8,this.padding),n.lineTo(0,this.padding),n.lineTo(0,r+this.padding),n.lineTo(8,r+this.padding);for(var u=1;s-1>u;++u){var h=u*o;n.moveTo(0,h),n.lineTo(5,h)}}if(n.stroke(),n.fillStyle="black","right"==this.browser.rulerLocation){n.textAlign="right",n.fillText(a(e.max),i-9,8),n.fillText(a(e.min),i-9,r+this.padding);for(var u=1;s-1>u;++u){var h=u*o;n.fillText(a(1*e.max-u*l),i-9,h+3)}}else{n.textAlign="left",n.fillText(a(e.max),9,8),n.fillText(a(e.min),9,r+this.padding);for(var u=1;s-1>u;++u){var h=u*o;n.fillText(a(1*e.max-u*l),9,h+3)}}}else this.quantOverlay.style.display="none"}},s.prototype.styleForFeature=function(e){var t=this.browser.zoomForCurrentScale();if(!this.stylesheet)return null;for(var r=null,i=this.stylesheet.styles,n=0;n<i.length;++n){var s=i[n];if(!(s.zoom&&s.zoom!=t||s.orientation&&s.orientation!=e.orientation)){var o=s._labelRE;if(o&&o.test||(o=new RegExp("^"+s.label+"$"),s._labelRE=o),!s.label||o.test(e.label)){var a=s._methodRE;if(a&&a.test||(a=new RegExp("^"+s.method+"$"),s._methodRE=a),!s.method||a.test(e.method)){if(s.type){if("default"==s.type){r||(r=s.style);continue}var l=s._typeRE;if(l&&l.test||(l=new RegExp("^"+s.type+"$"),s._typeRE=l),!l.test(e.type))continue}return s.style}}}}return r},s.prototype.quantMin=function(e){if(this.forceMinDynamic)return this.currentFeaturesMinScore||0;if("number"==typeof this.forceMin)return this.forceMin;var t="undefined"!=typeof e.SOFTMIN?e.SOFTMIN:Number.MAX_VALUE;return e.MIN||Math.min(t,this.currentFeaturesMinScore||0)},s.prototype.quantMax=function(e){if(this.forceMaxDynamic)return this.currentFeaturesMaxScore||0;if("number"==typeof this.forceMax)return this.forceMax;var t="undefined"!=typeof e.SOFTMAX?e.SOFTMAX:Number.MIN_VALUE;return e.MAX||Math.max(t,this.currentFeaturesMaxScore||0)},"undefined"!=typeof t&&(t.exports={SubTier:i})},{"./numformats":30,"./tier":52}],22:[function(e,t,r){"use strict";function i(e,t,r){var i=l(r.type,t.type),n=l(r.label,t.label,r.id,t.id);n&&0!=n.indexOf("__dazzle")&&(i=i+": "+n),this.hit=e,this.feature=t,this.group=r,this.title=i,this.sections=[]}function n(e,t){var r=[];if(e)for(var i=0;i<e.length;++i)u(r,e[i]);if(t)for(var i=0;i<t.length;++i)u(r,t[i]);return r}if("undefined"!=typeof e)var s=e("./cbrowser"),o=s.Browser,a=e("./utils"),l=a.pick,u=a.pushnew,h=a.makeElement;var c=new RegExp("^([A-Za-z_-]+)=(.+)");o.prototype.addFeatureInfoPlugin=function(e){this.featureInfoPlugins||(this.featureInfoPlugins=[]),this.featureInfoPlugins.push(e)},i.prototype.setTitle=function(e){this.title=e},i.prototype.add=function(e,t){"string"==typeof t&&(t=h("span",t)),this.sections.push({label:e,info:t})},o.prototype.featurePopup=function(e,t,r,s){var o=r.length,a=--o>=0?r[o]:{},l=--o>=0?r[o]:{},u=new i(r,a,l);u.tier=s;for(var f=this.featureInfoPlugins||[],p=0;p<f.length;++p)try{f[p](a,u)}catch(d){console.log(d.stack||d)}for(f=s.featureInfoPlugins||[],p=0;p<f.length;++p)try{f[p](a,u)}catch(d){console.log(d.stack||d)}this.removeAllPopups();var g=h("table",null,{className:"table table-striped table-condensed"});g.style.width="100%",g.style.margin="0px";var v=0;if(a.method&&!s.dasSource.suppressMethod){var y=h("tr",[h("th","Method"),h("td",a.method)]);g.appendChild(y),++v}var m;m=l.segment?l:a;var y=h("tr",[h("th","Location"),h("td",m.segment+":"+m.min+"-"+m.max,{},{minWidth:"200px"})]);if(g.appendChild(y),++v,void 0!==a.score&&null!==a.score&&"-"!=a.score&&!a.suppressScore&&!s.dasSource.suppressScore){var y=h("tr",[h("th","Score"),h("td",""+a.score)]);g.appendChild(y),++v}var b=n(l.links,a.links);if(b&&b.length>0){var y=h("tr",[h("th","Links"),h("td",b.map(function(e){return h("div",h("a",e.desc,{href:e.uri,target:"_new"}))}))]);g.appendChild(y),++v}for(var w=n(l.notes,a.notes),x=0;x<w.length;++x){var S="Note",_=w[x],T=_.match(c);T&&(S=T[1],_=T[2]);var y=h("tr",[h("th",S),h("td",_)]);g.appendChild(y),++v}for(var C=0;C<u.sections.length;++C){var k=u.sections[C];g.appendChild(h("tr",[h("th",k.label),h("td",k.info)]))}this.popit(e,u.title||"Feature",g,{width:450})}},{"./cbrowser":6,"./utils":56}],23:[function(e,t,r){"use strict";function i(e){for(var t,r,i,n=e.browser.drawnStart,a=e.browser.drawnEnd,l={},u={},h={},c={},f={},p={},d={},g={},v=[],y=function(){i={};for(var t=0;t<e.currentFeatures.length;++t){var r=e.currentFeatures[t];r.id&&(i[r.id]=r)}},m=function(e){var t=[];if(e.parents)for(var r=0;r<e.parents.length;++r){var n=e.parents[r],s=i[n];s&&"SO:0000704"==s.typeCv&&pushnew(t,n)}return t},b=0;b<e.currentFeatures.length;++b){var w=e.currentFeatures[b];if(!w.parts){var x=w.min<=a&&w.max>=n;if(w.min&&w.max){if(w.score&&"."!=w.score&&"-"!=w.score){var S=1*w.score;(!t||t>S)&&(t=S),(!r||S>r)&&(r=S)}var _=[],T=null;if(w.groups)for(var C=0;C<w.groups.length;++C){var k=w.groups[C],L=k.id;if("gene"==k.type)T=L,p[L]=k;else if("translation"==k.type);else{s(u,L,w),p[L]=k,_.push(L);var A=c[L];(!A||w.min<A)&&(c[L]=w.min),A=f[L],(!A||w.max>A)&&(f[L]=w.max)}}if(w.parents){i||y();for(var E=0;E<w.parents.length;++E){var O=w.parents[E],R=i[O];if(R){R.parts||(R.parts=[w]),o(u,O,R),s(u,O,w),p[O]||(p[O]={type:R.type,id:R.id,label:R.label||R.id}),_.push(O);var A=c[O];(!A||w.min<A)&&(c[O]=w.min),A=f[O],(!A||w.max>A)&&(f[O]=w.max);var F=m(R);
6
- if(F.length>0){T=F[0];var M=i[F[0]];p[F[0]]={type:M.type,id:M.id,label:M.label||M.id},e.dasSource.collapseSuperGroups||(e.dasSource.collapseSuperGroups=!0)}}}}if(0==_.length)x&&s(l,w.type,w);else if(T)for(var k=0;k<_.length;++k){var L=_[k];o(d,T,L),g[L]=T}}else v.push(w)}}for(var L in u){var I=p[L];"number"!=typeof I.min&&(I.min=c[L]),"number"!=typeof I.max&&(I.max=f[L]),f[L]>=n&&c[L]<=a&&(h[L]=u[L])}e.ungroupedFeatures=l,e.groupedFeatures=h,e.groups=p,e.superGroups=d,e.groupsToSupers=g,t&&(t>0?t=0:0>r&&(r=0),e.currentFeaturesMinScore=t,e.currentFeaturesMaxScore=r)}if("undefined"!=typeof e)var n=e("./utils"),s=n.pusho,o=n.pushnewo;"undefined"!=typeof t&&(t.exports={sortFeatures:i})},{"./utils":56}],24:[function(e,t,r){"use strict";function i(e,t){this._stroke=e,this._fill=t}function n(e,t,r,i,n,s,o,a){this.x=e,this.y=t,this._width=r,this._height=i,this.fill=n,this.stroke=s,this._alpha=o,this._radius=a||0}function s(e,t){this.glyphs=e,this.connector=t,this.h=e[0].height();for(var r=[],i=0;i<e.length;++i){var n=e[i];r.push(new F(n.min(),n.max())),this.h=Math.max(this.h,n.height())}this.coverage=R(r)}function o(e,t,r){this.points=e,this.color=t,this._height=r||50}function a(e,t,r,i,n,s,o){this.glyph=t,this.text=r,this.anchor=n||"left",this.align=s||"below",o&&(this.font=o),this.font&&(e.save(),e.font=this.font);var a=e.measureText(r);this.font&&e.restore(),this.textLen=a.width,this.textHeight=5,this.bump=t.bump,this.measured=!i}function l(e,t,r){this._x=e,this._height=t,this._stroke=r}function u(e,t,r){this._x=e,this._height=t,this._stroke=r}function h(e,t,r,n,s,o){i.call(this,o,s),this._x=e,this._height=t,this._dir=r,this._width=n}function c(e,t,r,i){this._x=e,this._height=t,this._fill=r,this._stroke=i}function f(e,t,r){this.glyph=e,this._min=t,this._max=r,e&&(this.bump=e.bump)}function p(e,t,r,n,s,o){i.call(this,s,n),this._min=e,this._max=t,this._height=r,this._ori=o}function d(e,t,r,n){i.call(this,n,null),this._min=e,this._max=t,this._height=r}function g(e,t,r,i,n,s){this._min=e,this._max=t,this._height=r,this._style=i,this._strand=n,this._stroke=s}function v(e,t,r,i,n){this._min=e,this._max=t,this._height=r,this._fill=i,this._stroke=n}function y(e,t,r,n,s,o,a){i.call(this,null,n),this._min=e,this._max=t,this._height=r,this._color=n,this._parallel=s,this._sw=o,this._ne=a}function m(e,t,r,i,n){this._min=e,this._max=t,this._height=r,this._fill=i,this._stroke=n}function b(e,t,r,i,n,s){this._min=t,this._max=r,this._height=i,this._fill=n,this._string=s,this._textLen=e.measureText(s).width}function w(e,t,r){var i,n={red:"darkred",purple:"mediumpurple",blue:"darkblue",green:"darkgreen"},s=n[r.toLowerCase()];return i=s?[r,s]:["rgb(73, 68, 149)","rgb(9, 0, 103)"],"?"==e?"black":"M"==e?"greenyellow":"*"==e?"crimson":i[t%2]}function x(e){for(var t={A:"T",T:"A",G:"C",C:"G"},r=e.split("").reverse().join(""),i=[],n=0;n<r.length;++n){var s=r.substr(n,1).toUpperCase();i.push(s in t?t[s]:"N")}return i.join("")}function S(e,t,r,i,n,s,o){this._min=e,this._max=t,this._height=r,this._fill=i,this._seq=n,this._orientation=s,this._readframe=o}function _(e,t,r,i,n,s,o,a,l,u,h){this.baseColors=e,this._strandColor=t,this._min=r,this._max=i,this._height=n,this._seq=s,this._ref=o,this._scheme=a,this._quals=l,this._fillbg=u,this._scaleVertical=h}function T(e,t,r,i){this.glyph=e,this._height=i,this._x=t,this._y=r}function C(e,t,r,i){this._x=e,this._y=t,this._height=r,this._fill=i}function k(e,t,r){this._height=e||50,this.yOffset=t||0,this.spacing=r||10}function L(e,t,r,n,s){i.call(this,s,n),this._x=e,this._r=t,this._points=r}function A(e,t,r,i,n){this._x=e,this._height=t,this._overhang=r,this._fill=i,this._stroke=n,this._hh=t/2}function E(){this.ox=0,this.oy=0,this.glyphs=[]}if("undefined"!=typeof e)var O=e("./spans"),R=O.union,F=O.Range,M=e("./utils"),I=M.makeElementNS,B=M.AMINO_ACID_TRANSLATION,P=e("./svg-utils"),D=P.NS_SVG,H=(P.NS_XLINK,P.SVGPath);i.prototype.draw=function(e){e.beginPath(),this.drawPath(e),this._fill&&(e.fillStyle=this._fill,e.fill()),this._stroke&&(e.strokeStyle=this._stroke,e.stroke())},i.prototype.toSVG=function(){var e=new H;return this.drawPath(e),I(D,"path",null,{d:e.toPathData(),fill:this._fill||"none",stroke:this._stroke||"none"})},i.prototype.drawPath=function(e){throw"drawPath method on PathGlyphBase must be overridden"},n.prototype.draw=function(e){var t=this._radius;t>0?(e.beginPath(),e.moveTo(this.x+t,this.y),e.lineTo(this.x+this._width-t,this.y),e.arcTo(this.x+this._width,this.y,this.x+this._width,this.y+t,t),e.lineTo(this.x+this._width,this.y+this._height-t),e.arcTo(this.x+this._width,this.y+this._height,this.x+this._width-t,this.y+this._height,t),e.lineTo(this.x+t,this.y+this._height),e.arcTo(this.x,this.y+this._height,this.x,this.y+this._height-t,t),e.lineTo(this.x,this.y+t),e.arcTo(this.x,this.y,this.x+t,this.y,t),e.closePath(),null!=this._alpha&&(e.save(),e.globalAlpha=this._alpha),this.fill&&(e.fillStyle=this.fill,e.fill()),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=.5,e.stroke()),null!=this._alpha&&e.restore()):(null!=this._alpha&&(e.save(),e.globalAlpha=this._alpha),this.fill&&(e.fillStyle=this.fill,e.fillRect(this.x,this.y,this._width,this._height)),this.stroke&&(e.strokeStyle=this.stroke,e.lineWidth=.5,e.strokeRect(this.x,this.y,this._width,this._height)),null!=this._alpha&&e.restore())},n.prototype.toSVG=function(){var e=I(D,"rect",null,{x:this.x,y:this.y,width:this._width,height:this._height,stroke:this.stroke||"none",strokeWidth:.5,fill:this.fill||"none"});return null!=this._alpha&&e.setAttribute("opacity",this._alpha),e},n.prototype.min=function(){return this.x},n.prototype.max=function(){return this.x+this._width},n.prototype.height=function(){return this.y+this._height},s.prototype.drawConnectors=function(e){for(var t=this.coverage.ranges(),r=1;r<t.length;++r){var i=t[r],n=t[r-1];if(n&&i.min()>n.max()){var s=n.max(),o=i.min(),a=(s+o)/2;"hat+"===this.connector?(e.moveTo(s,this.h/2),e.lineTo(a,0),e.lineTo(o,this.h/2)):"hat-"===this.connector?(e.moveTo(s,this.h/2),e.lineTo(a,this.h),e.lineTo(o,this.h/2)):"collapsed+"===this.connector?(e.moveTo(s,this.h/2),e.lineTo(o,this.h/2),o-s>4&&(e.moveTo(a-2,this.h/2-3),e.lineTo(a+2,this.h/2),e.lineTo(a-2,this.h/2+3))):"collapsed-"===this.connector?(e.moveTo(s,this.h/2),e.lineTo(o,this.h/2),o-s>4&&(e.moveTo(a+2,this.h/2-3),e.lineTo(a-2,this.h/2),e.lineTo(a+2,this.h/2+3))):(e.moveTo(s,this.h/2),e.lineTo(o,this.h/2))}n=i}},s.prototype.draw=function(e,t){for(var r=0;r<this.glyphs.length;++r){var i=this.glyphs[r];i.draw(e,t)}e.strokeStyle="black",e.beginPath(),this.drawConnectors(e),e.stroke()},s.prototype.toSVG=function(){for(var e=I(D,"g"),t=0;t<this.glyphs.length;++t)e.appendChild(this.glyphs[t].toSVG());var r=new H;this.drawConnectors(r);var i=r.toPathData();if(i.length>0){var n=I(D,"path",null,{d:r.toPathData(),fill:"none",stroke:"black",strokeWidth:.5});e.appendChild(n)}return e},s.prototype.min=function(){return this.coverage.min()},s.prototype.max=function(){return this.coverage.max()},s.prototype.height=function(){return this.h},o.prototype.min=function(){return this.points[0].x},o.prototype.max=function(){return this.points[this.points.length-1].x},o.prototype.height=function(){return this._height},o.prototype.draw=function(e){e.save(),e.strokeStyle=this.color,e.lineWidth=2,e.beginPath(),this.points.forEach(function(t,r){0===r?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)}),e.stroke(),e.restore()},o.prototype.toSVG=function(){for(var e=new H,t=0;t<this.points.length;++t){var r=this.points[t].x,i=this.points[t].y;0==t?e.moveTo(r,i):e.lineTo(r,i)}return I(D,"path",null,{d:e.toPathData(),fill:"none",stroke:this.color,strokeWidth:"2px"})},a.prototype.toSVG=function(){var e=this.glyph.toSVG(),t={};return"above"==this.align?(e=I(D,"g",e,{transform:"translate(0, "+(2|this.textHeight)+")"}),t.y=this.textHeight):t.y=this.glyph.height()+15,this.font&&(t.fontSize=7),"center"==this.anchor?t.x=(this.glyph.min()+this.glyph.max()-this.textLen)/2:t.x=this.glyph.min(),I(D,"g",[e,I(D,"text",this.text,t)])},a.prototype.min=function(){return this.glyph.min()},a.prototype.max=function(){return this.measured?Math.max(this.glyph.max(),1*this.glyph.min()+this.textLen+10):this.glyph.max()},a.prototype.height=function(){var e=this.glyph.height();return this.measured&&(e+="above"==this.align?this.textHeight+2:20),e},a.prototype.draw=function(e,t){"above"==this.align&&(e.save(),e.translate(0,this.textHeight+2)),this.glyph.draw(e),"above"==this.align&&e.restore(),t.registerGlyph(this)},a.prototype.drawOverlay=function(e,t,r){e.fillStyle="black",this.font&&(e.save(),e.font=this.font);var i;"center"==this.anchor?i=(this.glyph.min()+this.glyph.max()-this.textLen)/2:(i=this.glyph.min(),t>i&&(i=Math.min(t,this.glyph.max()-this.textLen))),e.fillText(this.text,i,"above"==this.align?this.textHeight:this.glyph.height()+15),this.font&&e.restore()},l.prototype.draw=function(e){var t=this._height/2;e.beginPath(),e.moveTo(this._x,0),e.lineTo(this._x,this._height),e.moveTo(this._x-t,t),e.lineTo(this._x+t,t),e.strokeStyle=this._stroke,e.lineWidth=1,e.stroke()},l.prototype.toSVG=function(){var e=this._height/2,t=new H;return t.moveTo(this._x,0),t.lineTo(this._x,this._height),t.moveTo(this._x-e,e),t.lineTo(this._x+e,e),I(D,"path",null,{d:t.toPathData(),fill:"none",stroke:this._stroke,strokeWidth:"1px"})},l.prototype.min=function(){return this._x-this._height/2},l.prototype.max=function(){return this._x+this._height/2},l.prototype.height=function(){return this._height},u.prototype.draw=function(e){var t=this._height/2;e.beginPath(),e.moveTo(this._x-t,0),e.lineTo(this._x+t,this._height),e.moveTo(this._x-t,this._height),e.lineTo(this._x+t,0),e.strokeStyle=this._stroke,e.lineWidth=1,e.stroke()},u.prototype.toSVG=function(){var e=this._height/2,t=new H;return t.moveTo(this._x-e,0),t.lineTo(this._x+e,this._height),t.moveTo(this._x-e,this._height),t.lineTo(this._x+e,0),I(D,"path",null,{d:t.toPathData(),fill:"none",stroke:this._stroke,strokeWidth:"1px"})},u.prototype.min=function(){return this._x-this._height/2},u.prototype.max=function(){return this._x+this._height/2},u.prototype.height=function(){return this._height},h.prototype=Object.create(i.prototype),h.prototype.drawPath=function(e){var t=this._height/2,r=this._width/2;"S"===this._dir?(e.moveTo(this._x,this._height),e.lineTo(this._x-r,0),e.lineTo(this._x+r,0)):"W"===this._dir?(e.moveTo(this._x+r,t),e.lineTo(this._x-r,0),e.lineTo(this._x-r,this._height)):"E"===this._dir?(e.moveTo(this._x-r,t),e.lineTo(this._x+r,0),e.lineTo(this._x+r,this._height)):(e.moveTo(this._x,0),e.lineTo(this._x+r,this._height),e.lineTo(this._x-r,this._height)),e.closePath()},h.prototype.min=function(){return this._x-this._height/2},h.prototype.max=function(){return this._x+this._height/2},h.prototype.height=function(){return this._height},c.prototype.draw=function(e){var t=this._height/2;e.fillStyle=this._stroke,e.beginPath(),e.arc(this._x,t,t,0,6.29),this._fill&&(e.fillStyle=this._fill,e.fill()),this._stroke&&(e.strokeStyle=this._stroke,e.stroke())},c.prototype.toSVG=function(){var e=this._height/2;return I(D,"circle",null,{cx:this._x,cy:e,r:e,fill:this._fill||"none",stroke:this._stroke||"none",strokeWidth:"1px"})},c.prototype.min=function(){return this._x-this._height/2},c.prototype.max=function(){return this._x+this._height/2},c.prototype.height=function(){return this._height},f.prototype.draw=function(e,t){this.glyph&&this.glyph.draw(e,t)},f.prototype.toSVG=function(){return this.glyph?this.glyph.toSVG():I(D,"g")},f.prototype.min=function(){return this._min},f.prototype.max=function(){return this._max},f.prototype.height=function(){return this.glyph?this.glyph.height():1},p.prototype=Object.create(i.prototype),p.prototype.min=function(){return this._min},p.prototype.max=function(){return this._max},p.prototype.height=function(){return this._height},p.prototype.drawPath=function(e){var t=this._max,r=this._min,i=this._height,n=0,s=0,o=this._height+2,a=.333333*this._height,l=0;this._ori&&("+"===this._ori?s=.5*this._height:"-"===this._ori&&(n=.5*this._height)),o>t-r&&(r=(t+r-o)/2,t=r+o),e.moveTo(r+n,l+a),e.lineTo(t-s,l+a),e.lineTo(t-s,l),e.lineTo(t,l+this._height/2),e.lineTo(t-s,l+i),e.lineTo(t-s,l+a+a),e.lineTo(r+n,l+a+a),e.lineTo(r+n,l+i),e.lineTo(r,l+i/2),e.lineTo(r+n,l),e.lineTo(r+n,l+a)},d.prototype=Object.create(i.prototype),d.prototype.min=function(){return this._min},d.prototype.max=function(){return this._max},d.prototype.height=function(){return this._height},d.prototype.drawPath=function(e){var t=this._min,r=this._max,i=this._height,n=i/2;e.moveTo(t,n),e.lineTo(r,n),e.moveTo(t,0),e.lineTo(t,i),e.moveTo(r,0),e.lineTo(r,i)},g.prototype.min=function(){return this._min},g.prototype.max=function(){return this._max},g.prototype.height=function(){return this._height},g.prototype.drawPath=function(e){var t=this._min,r=this._max,i=this._height,n=i/2;"hat"===this._style?(e.moveTo(t,n),e.lineTo((t+r)/2,"-"===this._strand?i:0),e.lineTo(r,n)):(e.moveTo(t,n),e.lineTo(r,n))},g.prototype.draw=function(e){e.beginPath(),this.drawPath(e),e.strokeStyle=this._stroke,"dashed"===this._style&&e.setLineDash?(e.save(),e.setLineDash([3]),e.stroke(),e.restore()):e.stroke()},g.prototype.toSVG=function(){var e=new H;this.drawPath(e);var t={d:e.toPathData(),stroke:this._stroke||"none"};return"dashed"===this._style&&(t.strokeDasharray="3"),I(D,"path",null,t)},v.prototype.min=function(){return this._min},v.prototype.max=function(){return this._max},v.prototype.height=function(){return this._height},v.prototype.drawStemPath=function(e){var t=this._min,r=this._max,i=this._height,n=i/2;e.moveTo(t,n),e.lineTo(r,n)},v.prototype.drawTrigsPath=function(e){var t=this._min,r=this._max,i=this._height,n=i/2;e.moveTo(t,0),e.lineTo(t+i,n),e.lineTo(t,i),e.lineTo(t,0),e.moveTo(r,0),e.lineTo(r-i,n),e.lineTo(r,i),e.lineTo(r,0)},v.prototype.draw=function(e){e.beginPath(),this.drawStemPath(e),e.strokeStyle=this._stroke,e.stroke(),e.beginPath(),this.drawTrigsPath(e),e.fillStyle=this._fill,e.fill()},v.prototype.toSVG=function(){var e=new H;this.drawStemPath(e);var t=new H;return this.drawTrigsPath(t),I(D,"g",[I(D,"path",null,{d:e.toPathData(),stroke:this._stroke||"none"}),I(D,"path",null,{d:t.toPathData(),fill:this._fill||"none"})])},y.prototype=Object.create(i.prototype),y.prototype.min=function(){return this._min},y.prototype.max=function(){return this._max},y.prototype.height=function(){return this._height},y.prototype.drawPath=function(e){var t=this._min,r=this._max,i=this._height;if(this._parallel){var n=i/2,s=.4*i;this._sw?(e.moveTo(t+n,i-s),e.lineTo(t+n,i),e.lineTo(t,n),e.lineTo(t+n,0),e.lineTo(t+n,s)):(e.moveTo(t,i-s),e.lineTo(t,s)),this._ne?(e.lineTo(r-n,s),e.lineTo(r-n,0),e.lineTo(r,n),e.lineTo(r-n,i),e.lineTo(r-n,i-s)):(e.lineTo(r,s),e.lineTo(r,i-s)),e.closePath()}else{var o=(t+r)/2,s=.4*(r-t),a=i/3;this._ne?(e.moveTo(t+s,a),e.lineTo(t,a),e.lineTo(o,0),e.lineTo(r,a),e.lineTo(r-s,a)):(e.moveTo(t+s,0),e.lineTo(r-s,0)),this._sw?(e.lineTo(r-s,i-a),e.lineTo(r,i-a),e.lineTo(o,i),e.lineTo(t,i-a),e.lineTo(t+s,i-a)):(e.lineTo(r-s,i),e.lineTo(t+s,i)),e.closePath()}},m.prototype.min=function(){return this._min},m.prototype.max=function(){return this._max},m.prototype.height=function(){return this._height},m.prototype.toSVG=function(){return I(D,"rect",null,{x:this._min,y:0,width:this._max-this._min,height:this._height,stroke:this._stroke||"none",fill:this._fill||"none"})},m.prototype.draw=function(e){if(this._fill&&(e.fillStyle=this._fill,e.fillRect(this._min,0,this._max-this._min,this._height)),this._stroke){e.strokeStyle=this._stroke,e.strokeRect(this._min,0,this._max-this._min,this._height),e.beginPath();for(var t=2;t<this._height;t+=3)e.moveTo(this._min,t),e.lineTo(this._max,t);e.stroke()}},b.prototype.min=function(){return this._min},b.prototype.max=function(){return Math.max(this._max,this._min+this._textLen)},b.prototype.height=function(){return this._height},b.prototype.draw=function(e){e.fillStyle=this._fill,e.fillText(this._string,this._min,this._height-4)},b.prototype.toSVG=function(){return I(D,"text",this._string,{x:this._min,y:this._height-4})},S.prototype.min=function(){return this._min},S.prototype.max=function(){return this._max},S.prototype.height=function(){return this._height},S.prototype.draw=function(e){var t=this._seq,r=this._fill;if(t){var i=(this._max-this._min+1)/t.length,n=(3-this._readframe)%3,s=(t.length-n)%3,o="+"==this._orientation?n:s;o>0&&(e.fillStyle=r,e.fillRect(this._min,0,i*o,this._height));for(var a=o;a<t.length;a+=3){var l=t.substr(a,3).toUpperCase();"-"==this._orientation&&(l=x(l));var u=l in B?B[l]:"?";r=3==l.length?w(u,a,this._fill):this._fill,e.fillStyle=r,e.fillRect(this._min+a*i,0,i*l.length,this._height),i>=8&&3==l.length&&(e.fillStyle="white",e.fillText(u,this._min+(a+1)*i,this._height))}}},S.prototype.toSVG=function(){var e=I(D,"g"),t=this._seq,r=this._fill;if(!t)return e;var i=(this._max-this._min+1)/t.length,n=(3-this._readframe)%3,s=(t.length-n)%3,o="+"==this._orientation?n:s;o>0&&e.appendChild(I(D,"rect",null,{x:this._min,y:0,width:i*o,height:this._height,fill:r}));for(var a=o;a<t.length;a+=3){var l=t.substr(a,3).toUpperCase();"-"==this._orientation&&(l=x(l));var u=l in B?B[l]:"?";r=3==l.length?w(u,a,this._fill):this._fill,e.appendChild(I(D,"rect",null,{x:this._min+a*i,y:0,width:i*l.length,height:this._height,fill:r})),i>=8&&3==l.length&&e.appendChild(I(D,"text",u,{x:this._min+(a+1)*i,y:this._height,fill:"white"}))}return e};var N="undefined"!=typeof window&&window.devicePixelRatio>1,G={},q=new RegExp("^[ACGT-]$"),U=function(e){return e>=8};_.prototype.min=function(){return this._min},_.prototype.max=function(){return this._max},_.prototype.height=function(){return this._height},_.prototype.alphaForQual=function(e){return.1+.9*Math.max(0,Math.min(1*e/30,1))},_.prototype.draw=function(e){var t=this._seq,r=this._ref,i="mismatch"===this._scheme||"mismatch-all"===this._scheme,n="mismatch-all"===this._scheme,s=t?t.length:this._max-this._min+1,o=(this._max-this._min+1)/s;i&&!U(o)&&(e.fillStyle=this._strandColor,this._scaleVertical?e.fillRect(this._min,o,this._max-this._min,o):e.fillRect(this._min,this._height/4,this._max-this._min,this._height/2));for(var a=0;s>a;++a){var l=t?t.substr(a,1).toUpperCase():"N";if(q.test(l)||U(o)){var u=this.baseColors[l];if(this._quals){var h=this._quals.charCodeAt(a)-33,c=e.globalAlpha;e.globalAlpha=this.alphaForQual(h)}if(!u){var f=r?r.substr(a,1).toUpperCase():"N";u="N"==l||"N"==f?"gray":this._strandColor,n&&(l=f)}e.fillStyle=u;var p=q.test(l);if(!this._fillbg&&U(o)&&p||(this._scaleVertical?e.fillRect(this._min+a*o,o,o,o):e.fillRect(this._min+a*o,0,o,this._height)),U(o)&&p){var d=u+"_"+l,g=G[d];if(!g){g=document.createElement("canvas"),N?(g.width=16,g.height=20):(g.width=8,g.height=10);var v=g.getContext("2d");N&&v.scale(2,2),v.fillStyle=this._fillbg?"black":u;var y=v.measureText(l).width;v.fillText(l,.5*(8-y),8),G[d]=g}var m=this._scaleVertical?o:0;N?e.drawImage(g,this._min+a*o+.5*(o-8),m,8,10):e.drawImage(g,this._min+a*o+.5*(o-8),m)}this._quals&&(e.globalAlpha=c)}}},_.prototype.toSVG=function(){for(var e=this._seq,t=this._ref,r=("mismatch"===this._scheme||"mismatch-all"===this._scheme,"mismatch-all"===this._scheme),i=(this._max-this._min+1)/this._seq.length,n=I(D,"g"),s=0;s<e.length;++s){var o=e?e.substr(s,1).toUpperCase():"N",a=this.baseColors[o];if(!a){var l=t?t.substr(s,1).toUpperCase():"N";a="N"==o||"N"==l?"gray":this._strandColor,r&&(o=l)}var u=1;if(this._quals){var h=this._quals.charCodeAt(s)-33;u=this.alphaForQual(h)}var c=q.test(o);!this._fillbg&&U(i)&&c||n.appendChild(I(D,"rect",null,{x:this._min+s*i,y:0,width:i,height:this._height,fill:a,fillOpacity:u})),U(i)&&c&&n.appendChild(I(D,"text",o,{x:this._min+(.5+s)*i,y:8,textAnchor:"middle",fill:this._fillbg?"black":a,fillOpacity:u}))}return n},T.prototype.height=function(){return this._height?this._height:this.glyph.height()+this._y},T.prototype.min=function(){return this.glyph.min()+this._x},T.prototype.max=function(){return this.glyph.max()+this._x},T.prototype.minY=function(){return this._y},T.prototype.maxY=function(){return this._y+this.glyph.height()},T.prototype.draw=function(e,t){e.save(),e.translate(this._x,this._y),this.glyph.draw(e,t),e.restore()},T.prototype.toSVG=function(){var e=this.glyph.toSVG();return e.setAttribute("transform","translate("+this._x+","+this._y+")"),e},C.prototype.min=function(){return this._x-2},C.prototype.max=function(){return this._x+2},C.prototype.height=function(){return this._height},C.prototype.draw=function(e){e.save(),e.globalAlpha=.3,e.fillStyle=this._fill,e.beginPath(),e.arc(this._x,this._y,1.5,0,6.29),e.fill(),e.restore()},C.prototype.toSVG=function(){return I(D,"circle",null,{cx:this._x,cy:this._y,r:2,fill:this._fill,stroke:"none"})},k.prototype.notSelectable=!0,k.prototype.min=function(){return-1e5},k.prototype.max=function(){return 1e5},k.prototype.height=function(){return this._height},k.prototype.draw=function(e){e.save(),e.strokeStyle="black",e.lineWidth=.1,e.beginPath();for(var t=this.yOffset;t<=this._height+this.yOffset;t+=this.spacing)e.moveTo(-5e3,t),e.lineTo(5e3,t);e.stroke(),e.restore()},k.prototype.toSVG=function(){for(var e=new H,t=0;t<=this._height;t+=10)e.moveTo(-5e3,t),e.lineTo(5e3,t);return I(D,"path",null,{d:e.toPathData(),fill:"none",stroke:"black",strokeWidth:"0.1px"})},L.prototype=Object.create(i.prototype),L.prototype.min=function(){return this._x-this._r},L.prototype.max=function(){return this._x+this._r},L.prototype.height=function(){return 2*this._r},L.prototype.drawPath=function(e){for(var t=this._x,r=this._r,i=this._r,n=0;n<this._points;++n){var s=6.28*n/this._points,o=t+i*Math.sin(s),a=r-i*Math.cos(s);0==n?e.moveTo(o,a):e.lineTo(o,a),s=6.28*(n+.5)/this._points,o=t+.4*i*Math.sin(s),a=r-.4*i*Math.cos(s),e.lineTo(o,a)}e.closePath()},A.prototype.draw=function(e){var t=this._height/2;e.fillStyle=this._stroke,e.beginPath(),e.arc(this._x,t,t-this._overhang,0,6.29),e.moveTo(this._x,0),e.lineTo(this._x,this._height),this._fill&&(e.fillStyle=this._fill,e.fill()),this._stroke&&(e.strokeStyle=this._stroke,e.stroke())},A.prototype.toSVG=function(){var e=this._hh;return I(D,"g",[I(D,"circle",null,{cx:this._x,cy:e,r:e-this._overhang}),I(D,"line",null,{x1:this._x,y1:0,x2:this._x,y2:this._height})],{fill:this._fill||"none",stroke:this._stroke||"none",strokeWidth:"1px"})},A.prototype.min=function(){return this._x-this._hh},A.prototype.max=function(){return this._x+this._hh},A.prototype.height=function(){return this._height},E.prototype.translate=function(e,t){this.ox+=e,this.oy+=t},E.prototype.registerGlyph=function(e){this.glyphs.push({x:this.ox,y:this.oy,glyph:e})},E.prototype.draw=function(e,t,r){for(var i=0;i<this.glyphs.length;++i){var n=this.glyphs[i];e.save(),e.translate(n.x,n.y),n.glyph.drawOverlay(e,t,r),e.restore()}},"undefined"!=typeof t&&(t.exports={BoxGlyph:n,GroupGlyph:s,LineGraphGlyph:o,LabelledGlyph:a,CrossGlyph:l,ExGlyph:u,TriangleGlyph:h,DotGlyph:c,PaddedGlyph:f,AArrowGlyph:p,SpanGlyph:d,LineGlyph:g,PrimersGlyph:v,ArrowGlyph:y,TooManyGlyph:m,TextGlyph:b,SequenceGlyph:_,AminoAcidGlyph:S,TranslatedGlyph:T,GridGlyph:k,StarGlyph:L,PointGlyph:C,PlimsollGlyph:A,OverlayLabelCanvas:E})},{"./spans":41,"./svg-utils":45,"./utils":56}],25:[function(e,t,r){"use strict";function i(e,t){this.base=e,this.query=t}function n(e){return e>0?"+":0>e?"-":void 0}if("undefined"!=typeof e){var s=e("./das"),o=(s.DASStylesheet,s.DASStyle,s.DASFeature),a=(s.DASGroup,e("./utils")),l=a.shallowCopy,u=e("./spans"),h=u.Range,c=u.union;u.intersection}i.prototype.features=function(e,t,r){t=t||{},url=this.base+"/features/"+e.name;var i=[];this.query&&i.push(this.query),e.isBounded&&(i.push("start="+e.start),i.push("end="+e.end)),i.length>0&&(url=url+"?"+i.join("&"));var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4==s.readyState)if(s.status>=300)r(null,"Error code "+s.status);else{var t=JSON.parse(s.response).features,i=[];for(fi=0;fi<t.length;++fi){var a=t[fi],f=new o;if(f.segment=e.name,f.min=(0|a.start)+1,f.max=0|a.end,a.name&&(f.label=a.name),a.strand&&(f.orientation=n(a.strand)),f.type=a.type||"unknown",a.subfeatures&&a.subfeatures.length>0){f.id=a.uniqueID;for(var p=[],d=[],g=[],v=0;v<a.subfeatures.length;++v){var y=a.subfeatures[v],m=l(f);m.min=y.start+1,m.max=y.end,m.groups=[f],g.push(m),p.push(new h(m.min,m.max)),"CDS"===y.type&&d.push(m)}if(d.length>0){u=c(p);var b=l(f);b.type="transcript",u.ranges().forEach(function(t){i.push({segment:e.name,min:t.min(),max:t.max(),orientation:f.orientation,groups:[b],type:"transcript"})});var w=l(f);d.forEach(function(e){e.type="translation",e.groups=[w],i.push(e)})}else g.forEach(function(e){i.push(e)})}else i.push(f)}r(i)}},s.open("GET",url,!0),s.responseType="text",s.send()},"undefined"!=typeof t&&(t.exports={JBrowseStore:i})},{"./das":11,"./spans":41,"./utils":56}],26:[function(e,t,r){"use strict";function i(){var e=this;this.reqs=[],this.awaitedFeatures={},this.requestsIssued=new A(function(t,r){e.notifyRequestsIssued=t})}function n(e,t,r,i,n,s,o){this.chr=e,this.min=t,this.max=r,this.coverage=o,this.scale=i,this.features=n||[],this.status=s}function s(e,t,r,i,n,s){this.tierMap=e,this.chr=t,this.min=r,this.max=i,this.scale=n,this.seqSource=s||new y,this.viewCount=0,this.featureCache={},this.latestViews={}}function o(e,t,r){for(var i=[],n={},s=0;s<e.length;++s){var o=e[s];o.min&&o.max?o.groups&&o.groups.length>0?u(n,o.groups[0].id,o):o.min<=r&&o.max>=t&&i.push(o):i.push(o)}for(var a in n){for(var l=n[a],h=1e11,c=-1e11,s=0;s<l.length;++s){var o=l[s];h=Math.min(h,o.min),c=Math.max(c,o.max)}if(r>=h||c>=t)for(var s=0;s<l.length;++s)i.push(l[s])}return i}if("undefined"!=typeof e)var a=e("./utils"),l=a.Awaited,u=a.pusho,h=e("./sourceadapters"),c=h.MappedFeatureSource,f=h.CachingFeatureSource,p=h.BWGFeatureSource,d=h.RemoteBWGFeatureSource,g=h.BAMFeatureSource,v=h.RemoteBAMFeatureSource,y=h.DummySequenceSource,m=h.DummyFeatureSource,b=e("./overlay").OverlayFeatureSource,w=e("./spans"),x=w.Range,S=(w.union,w.intersection),_=e("./sample"),T=_.downsample,C=_.getBaseCoverage,k=e("./das"),L=k.DASSequence,A=e("es6-promise").Promise;i.prototype.addRequest=function(e){this.reqs.push(e)},i.prototype.abortAll=function(){for(var e=0;e<this.reqs.length;++e)this.reqs[e].abort()},n.prototype.toString=function(){return this.chr+":"+this.min+".."+this.max+";scale="+this.scale},s.prototype.cancel=function(){this.cancelled=!0},s.prototype.bestCacheOverlapping=function(e,t,r){var i=this.featureCache[this.tierMap[0]];return i?i:null},s.prototype.retrieveFeatures=function(e,t,r,n,s){if(s!=s)throw"retrieveFeatures called with silly scale";if(t!=this.chr)throw"Can't extend Known Space to a new chromosome";1>r&&(r=1),this.min=r,this.max=n,this.scale=s,this.pool&&this.pool.abortAll(),this.pool=new i,this.awaitedSeq=new l,this.seqWasFetched=!1,this.viewCount++,this.startFetchesForTiers(e),this.pool.notifyRequestsIssued()},s.prototype.invalidate=function(e){this.pool&&(this.featureCache[e]=null,this.startFetchesForTiers([e]))},s.prototype.startFetchesForTiers=function(e){for(var t,r=this,i=this.awaitedSeq,n=!1,s=0;s<e.length;++s){var o=e[s].browser.getTierRenderer(e[s]);try{this.startFetchesFor(e[s],i)&&(n=!0)}catch(a){var l=e[s];l.currentFeatures=[],l.currentSequence=null,console.log("Error fetching tier source"),console.log(a),t=a,console.log(a.stack),o.renderTier(a,l),l.wasRendered()}}if(n&&!this.seqWasFetched){this.seqWasFetched=!0;var u=this.min,h=this.max;if(this.cs&&this.cs.start<=u&&this.cs.end>=h){var c;return c=this.cs.start==u&&this.cs.end==h?this.cs:new L(this.cs.name,u,h,this.cs.alphabet,this.cs.seq.substring(u-this.cs.start,h+1-this.cs.start)),i.provide(c)}this.seqSource.fetch(this.chr,u,h,this.pool,function(e,t){t?((!r.cs||u<=r.cs.start&&h>=r.cs.end||u>=r.cs.end||h<=r.cs.start||h-u>r.cs.end-r.cs.start)&&(r.cs=t),i.provide(t)):(console.log("Sequence loading failed",e),i.provide(null))})}if(t)throw t},s.prototype.startFetchesFor=function(e,t){var r,i=this,s=this.viewCount,a=e.getSource()||new m,l=e.needsSequence(this.scale),u=i.featureCache[e],h=e.getActiveStyleFilters(this.scale);h&&(r=h.typeList());var c=this.chr,f=this.min,p=this.max;if(void 0===r)return!1;if(u&&u.chr===this.chr&&u.min<=f&&u.max>=p){var d=u.features;(u.min<f||u.max>p)&&(d=o(d,f,p)),i.provision(e,u.chr,S(u.coverage,new x(f,p)),u.scale,r,d,u.status,l?t:null);var g=a.getScales();if(u.scale<=this.scale||!g)return l}return a.instrument&&console.log("Starting fetch "+s+" ("+f+", "+p+")"),a.fetch(c,f,p,this.scale,r,this.pool,function(o,h,d,g){a.instrument&&console.log("Finishing fetch "+s);var v=i.latestViews[e]||-1;i.cancelled||v>s||(g||(g=new x(f,p)),(!u||f<u.min||p>u.max)&&(i.featureCache[e]=new n(c,f,p,d,h,o,g)),i.latestViews[e]=s,i.provision(e,c,g,d,r,h,o,l?t:null))},h),l},s.prototype.provision=function(e,t,r,i,n,s,o,a){var l=e.browser.getTierRenderer(e);if(o){if(e.setFeatures(t,r,i,[],null),!s){var u=new Error(o);o="Error fetching data: "+o+"; see browser console",console.log("Error fetching data for tier "+e.dasSource.name+":"),console.log(e.dasSource),console.log("Stack trace:"),console.log(u.stack)}l.renderTier(o,e),e.wasRendered()}else{for(var h=!1,y=!1,m=e.getSource();c.prototype.isPrototypeOf(m)||f.prototype.isPrototypeOf(m)||b.prototype.isPrototypeOf(m);)m=b.prototype.isPrototypeOf(m)?m.sources[0]:m.source;(p.prototype.isPrototypeOf(m)||d.prototype.isPrototypeOf(m)||g.prototype.isPrototypeOf(m)||v.prototype.isPrototypeOf(m))&&(h=!0),m.opts&&(m.opts.forceReduction||m.opts.noDownsample)||h&&n&&1==n.length&&n.indexOf("density")>=0&&(s=T(s,this.scale)),n&&1==n.length&&n.indexOf("base-coverage")>=0&&(y=!0),a?a.await(function(n){y&&(s=C(s,n,e.browser.baseColors)),e.setFeatures(t,r,i,s,n),l.renderTier(o,e),e.wasRendered()}):(e.setFeatures(t,r,i,s),l.renderTier(o,e),e.wasRendered())}},"undefined"!=typeof t&&(t.exports={KnownSpace:s})},{"./das":11,"./overlay":31,"./sample":34,"./sourceadapters":39,"./spans":41,"./utils":56,"es6-promise":60}],27:[function(e,t,r){"use strict";function i(e,t){this.block=e,this.offset=t}function n(e,t,r){var n=4294967296*(255&e[t+6])+16777216*(255&e[t+5])+65536*(255&e[t+4])+256*(255&e[t+3])+(255&e[t+2]),s=e[t+1]<<8|e[t];return 0!=n||0!=s||r?new i(n,s):null}function s(e,t){t=Math.min(t||1,e.byteLength-50);for(var r=[],i=[0],n=0;i[0]<t;){var s=new Uint8Array(e,i[0],12),o=s[11]<<8|s[10],a=h(e,12+o+i[0],Math.min(65536,e.byteLength-12-o-i[0]),i);i[0]+=8,n+=a.byteLength,r.push(a)}if(1==r.length)return r[0];for(var l=new Uint8Array(n),u=0,f=0;f<r.length;++f){var p=new Uint8Array(r[f]);c(p,0,l,u,p.length),u+=p.length}return l.buffer}function o(e,t){this.minv=e,this.maxv=t}function a(e,t){return--t,e>>14==t>>14?4681+(e>>14):e>>17==t>>17?585+(e>>17):e>>20==t>>20?73+(e>>20):e>>23==t>>23?9+(e>>23):e>>26==t>>26?1+(e>>26):0}function l(e,t){var r,i=[];for(--t,i.push(0),r=1+(e>>26);1+(t>>26)>=r;++r)i.push(r);for(r=9+(e>>23);9+(t>>23)>=r;++r)i.push(r);for(r=73+(e>>20);73+(t>>20)>=r;++r)i.push(r);for(r=585+(e>>17);585+(t>>17)>=r;++r)i.push(r);for(r=4681+(e>>14);4681+(t>>14)>=r;++r)i.push(r);return i}if("undefined"!=typeof e)var u=e("jszlib"),h=u.inflateBuffer,c=u.arrayCopy;i.prototype.toString=function(){return""+this.block+":"+this.offset};"undefined"!=typeof t&&(t.exports={unbgzf:s,readVob:n,reg2bin:a,reg2bins:l,Chunk:o})},{jszlib:71}],28:[function(e,t,r){"use strict";function i(){this.featuresByChr={},this.maxLength=1,this.chrRing=null}function n(e){if(this.source=e,l.call(this),this.storeHolder=new c,this.parser=a(e.payload),!this.parser)throw"Unsupported memstore payload: "+e.payload;var t=this;this._load(function(e,r){if(r)t.error=r,t.storeHolder.provide(null);else{var n=new i,s=[],o=t.parser.createSession(function(e){s.push(e)});if("already parsed"===r)e.forEach(function(e){o.validate(e)});else{for(var a=e.split("\n"),l=0;l<a.length;++l){var u=a[l];u.length>0&&o.parse(u)}o.flush()}n.addFeatures(s),t.storeHolder.provide(n)}})}if("undefined"!=typeof e)var s=e("./sourceadapters"),o=s.registerSourceAdapterFactory,a=s.makeParser,l=s.FeatureSourceBase,u=e("./das"),h=(u.DASStylesheet,u.DASStyle,
7
- u.DASFeature,u.DASGroup,e("./utils")),c=h.Awaited,f=h.textXHR;i.prototype.addFeatures=function(e){for(var t={},r=0;r<e.length;++r){var i=e[r],n=i.segment||i.chr,s=this.featuresByChr[n];s||(s=[],this.featuresByChr[n]=s),s.push(i),t[n]=!0;var o=i.max-i.min+1;o>this.maxLength&&(this.maxLength=o)}for(n in t){var s=this.featuresByChr[n];s.sort(function(e,t){var r=e.min-t.min;return 0!=r?r:e.max-t.max})}this.chrRing=null},i.prototype._indexFor=function(e,t){for(var r=0,i=e.length;i>r;){var n=(r+i)/2|0;if(n>=e.length)return e.length;var s=e[n];t<s.min?i=n:r=n+1}return i},i.prototype.fetch=function(e,t,r){var i=this.featuresByChr[e];if(i||(i=0==e.indexOf("chr")?this.featuresByChr[e.substring(3)]:this.featuresByChr["chr"+e]),!i)return[];for(var n=Math.max(0,this._indexFor(i,t-this.maxLength-1)),s=Math.min(i.length-1,this._indexFor(i,r)),o=[],a=n;s>=a;++a){var l=i[a];l.min<=r&&l.max>=t&&o.push(l)}return o},i.prototype.findNextFeature=function(e,t,r){if(null==this.chrRing){this.chrRing=[];for(var e in this.featuresByChr)this.chrRing.push(e);this.chrRing.sort()}var i=this.featuresByChr[e];if(i||(0==e.indexOf("chr")?(e=e.substring(3),i=this.featuresByChr[e]):(e="chr"+e,i=this.featuresByChr[e])),!i)return null;var n=Math.max(0,Math.min(this._indexFor(i,t),i.length-1));if(r>0){for(;n<i.length;){var s=i[n++];if(s.min>t)return s}var o=this.chrRing.indexOf(e)+1;return o>=this.chrRing.length&&(o=0),this.findNextFeature(this.chrRing[o],0,r)}for(;n>=0;){var s=i[n--];if(s.max<t)return s}var o=this.chrRing.indexOf(e)-1;return 0>o&&(o=this.chrRing.length-1),this.findNextFeature(this.chrRing[o],1e10,r)},n.prototype=Object.create(l.prototype),n.prototype._load=function(e){if(this.source.blob){var t=new FileReader;t.onloadend=function(){return e(t.result,t.error)},t.readAsText(this.source.blob)}else{if(this.source.features)return e(this.source.features,"already parsed");if(this.source.credentials)var r={credentials:this.source.credentials};f(this.source.uri,e,r)}},n.prototype.fetch=function(e,t,r,i,n,s,o){var a=this;this.storeHolder.await(function(i){if(i){var n=i.fetch(e,t,r);return o(null,n,1e8)}return o(a.error)})},n.prototype.getStyleSheet=function(e){this.parser&&this.parser.getStyleSheet&&this.parser.getStyleSheet(e)},n.prototype.getDefaultFIPs=function(e){this.parser&&this.parser.getDefaultFIPs&&this.parser.getDefaultFIPs(e)},n.prototype.getScales=function(){return 1e8},n.prototype.findNextFeature=function(e,t,r,i){var n=this;this.storeHolder.await(function(s){return s?i(s.findNextFeature(e,t,r)):i(null,n.error)})},n.prototype.capabilities=function(){var e={leap:!0};return e},o("memstore",function(e){return{features:new n(e)}})},{"./das":11,"./sourceadapters":39,"./utils":56}],29:[function(e,t,r){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function n(e,t){s(t),t.updateStatus(e)}function s(e){var t=e.dasSource.multi,r=function(e){return e.dasSource.sub};e.padding||(e.padding=3);var i=e.viewport.getContext("2d"),n=e.browser.retina&&window.devicePixelRatio>1;n&&i.scale(2,2);var s=e.browser.tiers.filter(function(e){return"object"===a(r(e))&&r(e).multi_id===t.multi_id&&(e.currentFeatures||e.currentSequence)}),h=p.pipe(p.map(function(e){return e.dasSource.sub.offset}),p.reduce(function(e,t){return e>t?t:e},0))(s);s.forEach(function(t){t.sequenceSource?(0,l.drawSeqTier)(t,t.currentSequence):c.prepareSubtiers(t,i,r(t).offset-h,!1),e.glyphCacheOrigin||(e.glyphCacheOrigin=t.glyphCacheOrigin)});var f=p.pipe(p.map(function(e){return p.map(function(t){return t.height+r(e).offset},e.subtiers)}),p.flatten,p.reduce(function(e,t){return t>e?t:e},-(1/0)),p.add(-h))(s);if(o(e,i,n,f,!0),s.sort(function(e,t){return r(e).z>r(t).z}),t.grid&&s&&s[s.length-1]&&s[s.length-1].subtiers[0]){var d=new u.GridGlyph(f,t.grid_offset,t.grid_spacing);s[s.length-1].subtiers[0].glyphs.unshift(d)}if(s.forEach(function(e){i.save(),c.paint(e,i,n,!0),i.restore()}),e.drawOverlay(),t.quant){var g=c.createQuantOverlay(e,f+2*e.padding,n);c.paintQuant(g,e,t.quant,10)}"function"==typeof e.dasSource.drawCallback&&e.dasSource.drawCallback(i,e),e.originHaxx=0,e.browser.arrangeTiers()}function o(e,t,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:!0,s=e.browser.featurePanelWidth+2e3;r&&(s*=2);var o=0|e.viewport.width;s-50>o&&(e.viewport.width=o=s),i+=2*e.padding,i=Math.max(i,e.browser.minTierHeight),i!=e.viewport.height&&(e.viewport.height=i,r&&(e.viewport.height*=2)),e.viewportHolder.style.left="-1000px",e.viewport.style.width=r?""+o/2+"px":""+o+"px",e.viewport.style.height=""+i+"px",e.layoutHeight=Math.max(i,e.browser.minTierHeight),e.updateHeight(),e.norigin=e.browser.viewStart,n&&c.clearViewport(t,o,i),c.drawUnmapped(e,t,i)}Object.defineProperty(r,"__esModule",{value:!0}),r.drawTier=r.renderTier=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=e("./sequence-draw.js"),u=e("./glyphs.js"),h=e("./default-renderer"),c=i(h),f=e("ramda"),p=i(f);r.renderTier=n,r.drawTier=s},{"./default-renderer":12,"./glyphs.js":24,"./sequence-draw.js":36,ramda:73}],30:[function(e,t,r){"use strict";function i(e){return(0|e).toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}function n(e){var t=""+e,r=t.indexOf(".");if(0>r)return t;var i=2;return"-"==t.substring(0,1)&&++i,r>=i?t.substring(0,r):t.substring(0,r+2)}"undefined"!=typeof t&&(t.exports={formatLongInt:i,formatQuantLabel:n})},{}],31:[function(e,t,r){"use strict";function i(e,t){this.sources=e,this.opts=t||{},this.activityListeners=[],this.readinessListeners=[],this.changeListeners=[],this.business=[],this.readiness=[];for(var r=0;r<this.sources.length;++r)this.initN(r);"function"==typeof t.merge?this.merge=t.merge:"concat"==t.merge?this.merge=o:"alternates"==t.merge?(this.merge=o,this.filterDispatchOnMethod=!0):this.merge=s}function n(e,t,r){this.source=e,this.callback=t,this.sources=r,this.count=r.length,this.returnCount=0,this.statusCount=0,this.returns=[],this.features=[],this.statuses=[],this.scale=null}function s(e){for(var t=[],r=1;r<e.length;++r){for(var i={},n=e[r],s=0;s<n.length;++s)i[this.keyForFeature(n[s])]=n[s];t.push(i)}for(var o=[],a=e[0],s=0;s<a.length;++s){for(var l=a[s],u=0;u<t.length;++u){var i=t[u];if(n=i[this.keyForFeature(l)])for(var h in n)"score"===h?l.score2=n.score:"min"===h||"max"===h||"segment"===h||"_cachedStyle"===h||(l[h]=n[h])}o.push(l)}return o}function o(e,t){for(var r=[],i=0;i<e.length;++i)for(var n=e[i],s=t[i].name,o=0;o<n.length;++o){var a=n[o];a.method=s,r.push(a)}return r}function a(e,t){return e.capabilities?e.capabilities()[t]:!1}if("undefined"!=typeof e)var l=e("./utils"),u=l.shallowCopy,h=l.arrayIndexOf;i.prototype.initN=function(e){var t=this.sources[e],r=this;this.business[e]=0,t.addActivityListener&&t.addActivityListener(function(t){r.business[e]=t,r.notifyActivity()}),t.addChangeListener&&t.addChangeListener(function(){r.notifyChange()}),t.addReadinessListener&&t.addReadinessListener(function(t){r.readiness[e]=t,r.notifyReadiness()})},i.prototype.addReadinessListener=function(e){this.readinessListeners.push(e),this.notifyReadinessListener(e)},i.prototype.removeReadinessListener=function(e){var t=h(this.readinessListeners,e);t>=0&&this.readinessListeners.splice(t,1)},i.prototype.notifyReadiness=function(){for(var e=0;e<this.readinessListeners.length;++e)this.notifyReadinessListener(this.readinessListeners[e])},i.prototype.notifyReadinessListener=function(e){for(var t=null,r=0;r<this.readiness.length;++r)if(null!=this.readiness[r]){t=this.readiness[r];break}try{e(t)}catch(i){console.log(i)}},i.prototype.addActivityListener=function(e){this.activityListeners.push(e)},i.prototype.removeActivityListener=function(e){var t=h(this.activityListeners,e);t>=0&&this.activityListeners.splice(t,1)},i.prototype.notifyActivity=function(){for(var e=0,t=0;t<this.business.length;++t)e+=this.business[t];for(var r=0;r<this.activityListeners.length;++r)try{this.activityListeners[r](e)}catch(i){console.log(i)}},i.prototype.addChangeListener=function(e){this.changeListeners.push(e)},i.prototype.removeChangeListener=function(e){var t=h(this.changeListeners,e);t>=0&&this.changeListeners.splice(t,1)},i.prototype.notifyChange=function(){for(var e=0;e<this.changeListeners.length;++e)try{this.changeListeners[e](this.busy)}catch(t){console.log(t)}},i.prototype.getScales=function(){return this.sources[0].getScales()},i.prototype.getStyleSheet=function(e){return this.sources[0].getStyleSheet(e)},i.prototype.capabilities=function(){var e={},t=this.sources[0];t.capabilities&&(e=u(t.capabilities()));for(var r=1;r<this.sources.length;++r){var i=this.sources[r];if(i.capabilities){var n=i.capabilities();n.search&&(e.search=n.search)}}return e},i.prototype.search=function(e,t){for(var r=0;r<this.sources.length;++r)if(a(this.sources[r],"search"))return this.sources[r].search(e,t)},i.prototype.fetch=function(e,t,r,i,s,o,a,l){var u;if(this.filterDispatchOnMethod){u=[];for(var h=l.list(),c=0;c<this.sources.length;++c)for(var f=this.sources[c],p=0;p<h.length;++p){var d=h[p];if(!d.method||d.method==f.name){u.push(f);break}}}else u=this.sources;for(var g=new n(this,a,u),c=0;c<u.length;++c)this.fetchN(g,c,u[c],e,t,r,i,s,o,l)},i.prototype.fetchN=function(e,t,r,i,n,s,o,a,l,u){r.fetch(i,n,s,o,a,l,function(r,i,n){return e.completed(t,r,i,n)},u)},i.prototype.quantFindNextFeature=function(e,t,r,i,n){return this.sources[0].quantFindNextFeature(e,t,r,i,n)},i.prototype.findNextFeature=function(e,t,r,i){return this.sources[0].findNextFeature(e,t,r,i)},n.prototype.completed=function(e,t,r,i){if((null==this.scale||0==e)&&(this.scale=i),this.returns[e])throw"Multiple returns for source "+e;if(this.returns[e]=!0,this.returnCount++,this.features[e]=r,t&&(this.statuses[e]=t,this.statusCount++),this.returnCount==this.count){if(this.statusCount>0){for(var n="",s=0;s<this.count;++s){var o=this.statuses[s];o&&(n.length>0&&(n+=", "),n+=o)}return this.callback(n,null,this.scale)}this.callback(null,this.source.merge(this.features,this.sources),this.scale)}},i.prototype.getDefaultFIPs=function(e){for(var t=0;t<this.sources.length;++t){var r=this.sources[t];r.getDefaultFIPs&&r.getDefaultFIPs(e)}},i.prototype.keyForFeature=function(e){return""+e.min+".."+e.max},"undefined"!=typeof t&&(t.exports={OverlayFeatureSource:i})},{"./utils":56}],32:[function(e,t,r){"use strict";function i(e,t,r){var s,u=new RegExp("^\\w+\\s[0-9]+\\s[0-9]+.*$"),f=/([^=]+)=\"?([^\"]+)\"?/,d=/^##\s*fileformat=VCFv4\..+/;s=e.blob?new a(e.blob):"encode"==e.transport?new b(e.uri):new o(e.uri,{credentials:e.credentials}),s.slice(0,65536).salted().fetch(function(s,o){if(!s)return r||(e.credentials=!0,i(e,t,!0)),t(e,"Couldn't fetch data");var a=new Uint8Array(s),y=new Uint32Array(s,0,1),b=y[0];if(b==h||b==c){e.tier_type="bwg";var w=new RegExp("/?([^/]+?)(.bw|.bb|.bigWig|.bigBed)?$"),x=w.exec(e.uri||e.blob.name);return x&&(e.name=x[1]),t(e,null)}if(b==v)return e.tier_type="bai",t(e,null);if(31==a[0]||139==a[1]){var S=p(s),_=new Uint8Array(S);if(b=l(_,0),b==g){e.tier_type="bam";var w=new RegExp("/?([^/]+?)(.bam)?$"),x=w.exec(e.uri||e.blob.name);return x&&(e.name=x[1]),t(e,null)}if(b==m)return e.tier_type="tabix-index",t(e,null);if(1768301347==b){e.tier_type="tabix",e.payload="vcf";var w=new RegExp("/?([^/]+?)(.vcf)?(.gz)?$"),x=w.exec(e.uri||e.blob.name);return x&&(e.name=x[1]),t(e,null)}return console.log("magic = "+b.toString(16)),t(e,"Unsupported format")}var T=String.fromCharCode.apply(null,a),C=T.split("\n");if(C.length>0&&d.test(C[0])){e.tier_type="memstore",e.payload="vcf";var w=new RegExp("/?([^/]+?)(.vcf)?$"),x=w.exec(e.uri||e.blob.name);return x&&!e.name&&(e.name=x[1]),t(e,null)}for(var k=0;k<C.length;++k){var L=C[k].replace("\r","");if(0!=L.length&&0!=L.indexOf("browser")){if(0==L.indexOf("track")){for(var A="bed",E=L.split(/\s/),O=1;O<E.length;++O){var R=f.exec(E[O]);R&&("type"==R[1]&&"wiggle_0"==R[2]?A="wig":"name"==R[0]&&(e.name=R[2]))}return n(e,A),t(e,null)}if(0==L.indexOf("fixedStep"))return n(e,"wig"),t(e,null);if(0==L.indexOf("variableStep"))return n(e,"wig"),t(e,null);if(u.test(L))return n(e,null),t(e,null);break}}return t(e,"Unsupported format")},{timeout:1500})}function n(e,t){e.tier_type="memstore";var r=new RegExp("/?([^/]+?)(.(bed|wig))?$"),i=r.exec(e.uri||e.blob.name);i&&(e.name||(e.name=i[1]),!t&&i[3]&&(t=i[3])),e.payload=t||"bed"}if("undefined"!=typeof e)var s=e("./bin"),o=s.URLFetchable,a=s.BlobFetchable,l=s.readInt,u=e("./bigwig"),h=u.BIG_WIG_MAGIC,c=u.BIG_BED_MAGIC,f=e("./lh3utils"),p=f.unbgzf,d=e("./bam"),g=d.BAM_MAGIC,v=d.BAI_MAGIC,y=e("./tabix"),m=y.TABIX_MAGIC,b=e("./encode").EncodeFetchable;"undefined"!=typeof t&&(t.exports={probeResource:i})},{"./bam":1,"./bigwig":3,"./bin":4,"./encode":15,"./lh3utils":27,"./tabix":47}],33:[function(e,t,r){"use strict";function i(e){var t=this;t.value=e.value,t.min=e.min,t.max=e.max,t.width=e.width,t.color=e.color,Object.keys(t).map(function(e){void 0===t[e]&&console.log("WARNING: Ruler option "+e+" not set")})}function n(e,t){var r=t.dasSource.rulers;r?r instanceof Array||console.log("rulers.js: 'rulers' should be an Array"):console.log("Tier uses ruler callback but has no rulers!"),r.map(function(r){var i=(r.max-r.value)*r.height,n=t.viewport.width,s=e.lineWidth;e.strokeStyle=r.color,e.beginPath(),e.moveTo(-n,i+r.offset),e.lineWidth=r.width,e.lineTo(2*n,i+r.offset),e.stroke(),e.lineWidth=s})}Object.defineProperty(r,"__esModule",{value:!0}),r.Ruler=i,r.rulerDrawCallback=n,i.prototype.constructor=i},{}],34:[function(e,t,r){"use strict";function i(e){return g[e%g.length]*Math.pow(10,e/g.length|0)}function n(e,t,r){this.scale=e,this.tot=0,this.cnt=0,this.hasScore=!1,this.min=t,this.max=r,this.features=[]}function s(e,t){return e.min<t.min?-1:e.min>t.min?1:e.max<t.max?-1:t.max>e.max?1:0}function o(e,t){for(var r=0;i(r+1)<t;)++r;for(var s=i(r),o=[],a=-1e10,l=1e10,u=0;u<e.length;++u){var h=e[u];if(h.groups&&h.groups.length>0)return e;var c=h.min/s|0,p=h.max/s|0;a=Math.max(a,p),l=Math.min(l,c);for(var d=c;p>=d;++d){var g=o[d];g||(g=new n(s,d*s,(d+1)*s-1),o[d]=g),g.feature(h)}}for(var v=[],d=l;a>=d;++d){var g=o[d];if(g){var h=new f;h.segment=e[0].segment,h.min=d*s+1,h.max=(d+1)*s,h.score=g.score(),h.type="density",v.push(h)}}Date.now();return v}function a(e){this._pos=e,this._bases={},this._totalCount=0}function l(e,t,r){for(var i=p(r),n=[],s=[],o=0,a=0;a<i.length;++a){var l=i[a];if("M"==l.op)n.push(e.substr(o,l.cnt)),s.push(t.substr(o,l.cnt)),o+=l.cnt;else if("D"==l.op)for(var u=0;u<l.cnt;++u)n.push("-"),s.push("Z");else"I"==l.op?o+=l.cnt:"S"==l.op?o+=l.cnt:console.log("unknown cigop"+l.op)}var h={seq:n.join(""),quals:s.join("")};return h}function u(e,t,r){var i=[];if(e){var n=0|e.start,s=0|e.end;if(r>=n&&s>=t){for(var o=Math.max(t,n),a=Math.min(r,s),l=0;o-t>l;l++)i.push("N");i.push(e.seq.substr(o-n,a-o+1));for(var l=0;r-a>l;l++)i.push("N")}}return i.join("")}function h(e,t,r){for(var i=null,n=null,s=[],o=0;o<e.length;++o){var h=e[o];if(h.groups&&h.groups.length>0)return e;for(var c=l(h.seq,h.quals,h.cigar),p=c.seq,g=c.quals,v=h.orientation,y=h.min||0,m=h.max||0,b=0,w=y;m>=w;++w){var x=s[w];x||(x=new a(w),s[w]=x);var S=p.charAt(b),_=g.charCodeAt(b)-33;x.recordBase(S,_,v),b++}i=i?Math.min(i,y):y,n=n?Math.max(n,m):m}for(var T=u(t,i,n),C=[],b=0,w=i;n>=w;++w){var x=s[w];if(x){var h=new f;if(h.segment=e[0].segment,h.min=x.pos(),h.max=h.min,h.notes=[],h.notes=h.notes.concat(x.infoList()),h.type="base-coverage",h.suppressScore=!0,T){var k=T.charAt(b),L="Ref="+k;h.notes.unshift(L);for(var A=x.baseScoreList(k,.2),E=0;E<A.length;E++){var S=A[E].base,O=A[E].score,R=d(h);R.score=O,(A.length>1||S!=k)&&(R.itemRgb=r[S]),C.push(R)}}else C.push(h)}b++}return C}if("undefined"!=typeof e)var c=e("./das"),f=c.DASFeature,p=e("./cigar").parseCigar,d=e("./utils").shallowCopy;var g=[1,2,5];n.prototype.score=function(){if(0==this.cnt)return 0;if(this.hasScore)return this.tot/this.cnt;var e=this.features;e.sort(s);for(var t=-1e10,r=0,i=0,n=1;n<e.length;++n){var o=e[n],a=Math.max(o.min,this.min),l=Math.min(o.max,this.max);i+=l-a+1,a>t?(r+=l-a+1,t=l):l>t&&(r+=l-t,t=l)}return r>0?1*i/r:0},n.prototype.feature=function(e){void 0!==e.score&&(this.tot+=e.score,this.hasScore=!0),++this.cnt,this.features.push(e)},a.prototype.recordBase=function(e,t,r){if(this._bases[e]){var i=this._bases[e];i.cnt++,i.totalQual+=t,i.strandCnt[r]++}else{var n={"+":0,"-":0};n[r]++,this._bases[e]={cnt:1,totalQual:t,strandCnt:n}}this._totalCount++},a.prototype.totalCount=function(){return this._totalCount},a.prototype.pos=function(){return this._pos},a.prototype.infoList=function(){var e=[],t=this._totalCount,r="Depth="+t.toString();e.push(r);for(var i in this._bases){var n=this._bases[i],s=n.cnt,o=100*s/t,a=n.strandCnt["+"],l=n.strandCnt["-"],u=n.totalQual/s,h=[i,"=",s," (",o.toFixed(0),"%, ",a," +, ",l," -, Qual: ",u.toFixed(0),")"];e.push(h.join(""))}return e},a.prototype.baseScoreList=function(e,t){var r=[],i=this._totalCount,n=t*i;for(var s in this._bases){var o=this._bases[s].cnt;if(!(n>o||s==e)){var a={base:s,score:i};r.push(a),i-=o}}return r.push({base:e,score:i}),r},"undefined"!=typeof t&&(t.exports={downsample:o,getBaseCoverage:h})},{"./cigar":8,"./das":11,"./utils":56}],35:[function(e,t,r){"use strict";function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function n(e,t){var r=parseFloat(e.replace(/,/g,""));return"k"===t||"K"===t?1e3*r|0:"m"==t||"M"===t?1e6*r|0:0|r}if("undefined"!=typeof e)var s=e("./cbrowser"),o=s.Browser,a=e("./bin"),l=a.URLFetchable,u=e("./trix").connectTrix;var h=/^([\d+,\w,\.,\_,\-]+)[\s:]+([0-9,\.]+?)([KkMmGg])?((-|\.\.|\s)+([0-9,\.]+)([KkMmGg])?)?$/;o.prototype.search=function(e,t,r){var s=this;r=r||{};var o=r.padding||this.defaultSearchRegionPadding,a=h.exec(e);if(a){var c,f,p=a[1];if(a[6])c=n(a[2],a[3]),f=n(a[6],a[7]);else{var d=this.viewEnd-this.viewStart+1;c=n(a[2],a[3])-d/2|0,f=c+d-1}this.setLocation(p,c,f,t)}else{if(!e||0==e.length)return!1;var g=0,v=!1,y=function(r,i){if(--g,i)return t(i);r||(r=[]);for(var n=5e8,a=-1e8,l=null,u=0;u<r.length;++u){var h=r[u];null==l&&(l=h.segment),n=Math.min(n,h.min),a=Math.max(a,h.max)}if(l){v=!0,s.highlightRegion(l,n,a);var c=Math.max(o,.3*(a-n+1)|0);s.setLocation(l,n-c,a+c,t)}else if(0==g&&!v)return t("no match for '"+e+"'")},m=function(t,r){r.lookup(e,function(r,i){if(null==r||r.length<2)return t.featureSource.search(e,y);var n=r[1].split(",")[0];return t.featureSource.search(n,y)})};if(this.searchEndpoint)return g=1,this.doDasSearch(s.searchEndpoint,e,y);for(var b=[].concat(i(this.searchOnlySourceHolders||[]),i(this.tiers)),w=0;w<b.length;++w)!function(t){if(s.sourceAdapterIsCapable(t.featureSource,"search"))if(t.dasSource.trixURI)if(++g,t.trix)m(t,t.trix);else{var r=new l(t.dasSource.trixURI,{credentials:t.dasSource.credentials,resolver:t.dasSource.resolver}),i=new l(t.dasSource.trixxURI||t.dasSource.trixURI+"x",{credentials:t.dasSource.credentials,resolver:t.dasSource.resolver});u(r,i,function(e){t.trix=e,m(t,e)})}else++g,t.featureSource.search(e,y);else t.dasSource.provides_search&&(++g,s.doDasSearch(t.dasSource,e,y))}(b[w])}},o.prototype.doDasSearch=function(e,t,r){e.features(null,{group:t,type:"transcript"},function(e){e||(e=[]);for(var i=[],n=0;n<e.length;++n){var s=e[n];s.label.toLowerCase()==t.toLowerCase()&&i.push(s)}return r(i)},!1)}},{"./bin":4,"./cbrowser":6,"./trix":54}],36:[function(e,t,r){"use strict";function i(e,t){function r(e){return d[e%d.length]*Math.pow(10,e/d.length|0)}t||(t=p);for(var i=d.length;e*r(i)<t;)++i;return r(i)}function n(e,t){var r=e.viewport.getContext("2d"),i=e.browser.retina&&window.devicePixelRatio>1,n=e.browser.featurePanelWidth+2e3;i&&(n*=2);var o=0|e.viewport.width;n-50>o&&(e.viewport.width=o=n);var a=50;t&&t.seq&&(a+=25);var l=a;i&&(l*=2),e.viewport.height=l,e.viewport.style.height=""+a+"px",e.viewport.style.width=i?""+o/2+"px":""+o+"px",e.layoutHeight=a,e.updateHeight(),e.background&&(r.fillStyle=e.background,r.fillRect(0,0,o,e.viewport.height)),i&&r.scale(2,2),r.translate(1e3,0),s(e,t,r),e.norigin=e.browser.viewStart,e.viewportHolder.style.left="-1000px"}function s(e,t,r){var n=e.browser.scale,s=e.browser.viewStart-1e3/n|0,o=e.browser.viewEnd+2e3/n,a=e.browser.currentSeqMax,u=o;a>0&&o>a&&(u=a);for(var h=i(n),c=Math.max(0,(s/h|0)*h),f=e.browser.viewStart;u>=c;)r.fillStyle=c/h%2==0?"white":"black",r.strokeStyle="black",r.fillRect((c-f)*n,8,h*n,3),r.strokeRect((c-f)*n,8,h*n,3),r.fillStyle="black",r.fillText(l(c),(c-f)*n,22),c+=h;if(t&&t.seq)for(var p=s;o>=p;++p)if(p>=t.start&&p<=t.end){var d=t.seq.substr(p-t.start,1).toUpperCase(),g=e.browser.baseColors[d];if(g||(g="gray"),r.fillStyle=g,n>=8){var v=r.measureText(d).width;r.fillText(d,(p-f)*n+.5*(n-v),52)}else r.fillRect((p-f)*n,42,n,12)}}function o(e,t){var r=e.browser.scale,n=e.browser.viewStart-1e3/r|0,s=e.browser.viewEnd+2e3/r,o=e.browser.currentSeqMax,a=(0|e.viewport.width,s);o>0&&s>o&&(a=o);for(var h=i(r),f=Math.max(0,(n/h|0)*h),p=e.browser.viewStart,d=u(c,"g",[],{fontSize:"8pt"});a>=f;)d.appendChild(u(c,"rect",null,{x:(f-p)*r,y:8,width:h*r,height:3,fill:f/h%2==0?"white":"black",stroke:"black"})),d.appendChild(u(c,"text",l(f),{x:(f-p)*r,y:28,fill:"black",stroke:"none"})),f+=h;if(t&&t.seq)for(var g=n;s>=g;++g)if(g>=t.start&&g<=t.end){var v=t.seq.substr(g-t.start,1).toUpperCase(),y=e.browser.baseColors[v];y||(y="gray"),r>=8?d.appendChild(u(c,"text",v,{x:(.5+g-p)*r,y:52,textAnchor:"middle",fill:y})):d.appendChild(u(c,"rect",null,{x:(g-p)*r,y:42,width:r,height:12,fill:y}))}return d}if("undefined"!=typeof e)var a=e("./utils"),l=a.formatLongInt,u=a.makeElementNS,h=e("./svg-utils"),c=h.NS_SVG,f=(h.NS_XLINK,h.SVGPath,e("./numformats")),l=f.formatLongInt;var p=100,d=[1,2,5],c="http://www.w3.org/2000/svg";"undefined"!=typeof t&&(t.exports={drawSeqTier:n,drawSeqTierGC:s,svgSeqTier:o})},{"./numformats":30,"./svg-utils":45,"./utils":56}],37:[function(e,t,r){"use strict";if("undefined"!=typeof e)var i=e("./cbrowser"),n=i.Browser,s=e("./sourcecompare"),o=s.sourceDataURI,a=s.sourcesAreEqual,l=e("./version"),u=e("./utils"),h=u.miniJSONify,c=e("./sha1"),f=c.hex_sha1;n.prototype.nukeStatus=function(){delete localStorage["dalliance."+this.cookieKey+".view-chr"],delete localStorage["dalliance."+this.cookieKey+".view-start"],delete localStorage["dalliance."+this.cookieKey+".view-end"],delete localStorage["dalliance."+this.cookieKey+".current-seq-length"],delete localStorage["dalliance."+this.cookieKey+".showing-alt-zoom"],delete localStorage["dalliance."+this.cookieKey+".saved-zoom"],delete localStorage["dalliance."+this.cookieKey+".sources"],delete localStorage["dalliance."+this.cookieKey+".hubs"],delete localStorage["dalliance."+this.cookieKey+".version"],delete localStorage["dalliance."+this.cookieKey+".reverse-scrolling"],delete localStorage["dalliance."+this.cookieKey+".reverse-key-scrolling"],delete localStorage["dalliance."+this.cookieKey+".ruler-location"]},n.prototype.storeStatus=function(){this.storeViewStatus(),this.storeTierStatus()},n.prototype.storeViewStatus=function(){!this.cookieKey||this.noPersist||this.noPersistView||(localStorage["dalliance."+this.cookieKey+".view-chr"]=this.chr,localStorage["dalliance."+this.cookieKey+".view-start"]=0|this.viewStart,localStorage["dalliance."+this.cookieKey+".view-end"]=0|this.viewEnd,localStorage["dalliance."+this.cookieKey+".showing-alt-zoom"]=""+this.isSnapZooming,localStorage["dalliance."+this.cookieKey+".saved-zoom"]=this.savedZoom,this.currentSeqMax&&(localStorage["dalliance."+this.cookieKey+".current-seq-length"]=this.currentSeqMax))},n.prototype.storeTierStatus=function(){if(this.cookieKey&&!this.noPersist){for(var e=[],t=0;t<this.tiers.length;++t){var r=this.tiers[t],i=r.dasSource;i.noPersist||e.push({source:r.dasSource,config:r.config||{}})}localStorage["dalliance."+this.cookieKey+".sources"]=JSON.stringify(e);for(var n={},s=[],o=0;o<this.hubObjects.length;++o){var a=this.hubObjects[o],u={url:a.hub.url,genome:a.genome};a.credentials&&(u.credentials=a.credentials),a.mapping&&(u.mapping=a.mapping),n[u.url]=!0,s.push(u)}for(var o=0;o<this.hubs.length;++o){var u=this.hubs[o];"string"==typeof u&&(u={url:u}),n[u.url]||s.push(u)}localStorage["dalliance."+this.cookieKey+".hubs"]=JSON.stringify(s),localStorage["dalliance."+this.cookieKey+".reverse-scrolling"]=this.reverseScrolling,localStorage["dalliance."+this.cookieKey+".reverse-key-scrolling"]=this.reverseKeyScrolling,localStorage["dalliance."+this.cookieKey+".single-base-highlight"]=this.singleBaseHighlight,localStorage["dalliance."+this.cookieKey+".ruler-location"]=this.rulerLocation,localStorage["dalliance."+this.cookieKey+".export-ruler"]=this.exportRuler,localStorage["dalliance."+this.cookieKey+".export-highlights"]=this.exportHighlights,localStorage["dalliance."+this.cookieKey+".version"]=l.CONFIG}},n.prototype.restoreStatus=function(){if(!this.noPersist){var e=localStorage["dalliance."+this.cookieKey+".version"];if(e=e?0|e:-100,l.CONFIG==e){var t=localStorage["dalliance."+this.cookieKey+".configHash"]||"",r=f(h({sources:this.sources,hubs:this.hubs,rulerLocation:this.rulerLocation}));if(r!=t)return void(localStorage["dalliance."+this.cookieKey+".configHash"]=r);for(var i={},n=0;n<this.sources.length;++n){var s=this.sources[n];if(s){var u=o(s),c=i[u];c||(i[u]=c=[]),c.push(s)}}if(!this.noPersistView){var p=localStorage["dalliance."+this.cookieKey+".view-chr"],d=0|localStorage["dalliance."+this.cookieKey+".view-start"],g=0|localStorage["dalliance."+this.cookieKey+".view-end"];if(p&&d&&g){this.chr=p,this.viewStart=d,this.viewEnd=g;var v=localStorage["dalliance."+this.cookieKey+".current-seq-length"];v&&(this.currentSeqMax=0|v),this.isSnapZooming="true"==localStorage["dalliance."+this.cookieKey+".showing-alt-zoom"];var y=parseFloat(localStorage["dalliance."+this.cookieKey+".saved-zoom"]);"number"!=typeof y||isNaN(y)||(this.savedZoom=y)}}var m=localStorage["dalliance."+this.cookieKey+".reverse-scrolling"];this.reverseScrolling=m&&"true"==m;var b=localStorage["dalliance."+this.cookieKey+".reverse-key-scrolling"];this.reverseKeyScrolling=b&&"true"==b;var w=localStorage["dalliance."+this.cookieKey+".single-base-highlight"];this.singleBaseHighlight=w&&"true"==w;var x=localStorage["dalliance."+this.cookieKey+".ruler-location"];x&&(this.rulerLocation=x);var S=localStorage["dalliance."+this.cookieKey+".export-ruler"];S&&(this.exportRuler="true"===S);var S=localStorage["dalliance."+this.cookieKey+".export-highlights"];S&&(this.exportHighlights="true"===S);var _=localStorage["dalliance."+this.cookieKey+".sources"];if(_){var T=JSON.parse(_);this.sources=[],this.restoredConfigs=[];for(var n=0;n<T.length;++n){var s=this.sources[n]=T[n].source;this.restoredConfigs[n]=T[n].config;for(var u=o(s),c=i[u]||[],C=0;C<c.length;++C){var k=c[C];if(a(s,k))for(var L in k)k.hasOwnProperty(L)&&("function"==typeof k[L]||k[L]instanceof Blob)&&(s[L]=k[L])}}}var A=localStorage["dalliance."+this.cookieKey+".hubs"];return A&&(this.hubs=JSON.parse(A)),!0}}},n.prototype.reset=function(){for(var e=this.tiers.length-1;e>=0;--e)this.removeTier({index:e},!0);for(var e=0;e<this.defaultSources.length;++e){var t=this.defaultSources[e];t.disabled||this.addTier(this.defaultSources[e])}this.highlights.splice(0,this.highlights.length),this.setLocation(this.defaultChr,this.defaultStart,this.defaultEnd)}},{"./cbrowser":6,"./sha1":38,"./sourcecompare":40,"./utils":56,"./version":58}],38:[function(e,t,r){"use strict";function i(e){return o(s(l(e)))}function n(e){return a(s(l(e)))}function s(e){return h(c(u(e),8*e.length))}function o(e){for(var t,r=v?"0123456789ABCDEF":"0123456789abcdef",i="",n=0;n<e.length;n++)t=e.charCodeAt(n),i+=r.charAt(t>>>4&15)+r.charAt(15&t);return i}function a(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",i=e.length,n=0;i>n;n+=3)for(var s=e.charCodeAt(n)<<16|(i>n+1?e.charCodeAt(n+1)<<8:0)|(i>n+2?e.charCodeAt(n+2):0),o=0;4>o;o++)r+=8*n+6*o>8*e.length?y:t.charAt(s>>>6*(3-o)&63);return r}function l(e){for(var t,r,i="",n=-1;++n<e.length;)t=e.charCodeAt(n),r=n+1<e.length?e.charCodeAt(n+1):0,t>=55296&&56319>=t&&r>=56320&&57343>=r&&(t=65536+((1023&t)<<10)+(1023&r),n++),127>=t?i+=String.fromCharCode(t):2047>=t?i+=String.fromCharCode(192|t>>>6&31,128|63&t):65535>=t?i+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):2097151>=t&&(i+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return i}function u(e){for(var t=Array(e.length>>2),r=0;r<t.length;r++)t[r]=0;for(var r=0;r<8*e.length;r+=8)t[r>>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}function h(e){for(var t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function c(e,t){e[t>>5]|=128<<24-t%32,e[(t+64>>9<<4)+15]=t;for(var r=Array(80),i=1732584193,n=-271733879,s=-1732584194,o=271733878,a=-1009589776,l=0;l<e.length;l+=16){for(var u=i,h=n,c=s,v=o,y=a,m=0;80>m;m++){16>m?r[m]=e[l+m]:r[m]=g(r[m-3]^r[m-8]^r[m-14]^r[m-16],1);var b=d(d(g(i,5),f(m,n,s,o)),d(d(a,r[m]),p(m)));a=o,o=s,s=g(n,30),n=i,i=b}i=d(i,u),n=d(n,h),s=d(s,c),o=d(o,v),a=d(a,y)}return Array(i,n,s,o,a)}function f(e,t,r,i){return 20>e?t&r|~t&i:40>e?t^r^i:60>e?t&r|t&i|r&i:t^r^i}function p(e){return 20>e?1518500249:40>e?1859775393:60>e?-1894007588:-899497514}function d(e,t){var r=(65535&e)+(65535&t),i=(e>>16)+(t>>16)+(r>>16);return i<<16|65535&r}function g(e,t){return e<<t|e>>>32-t}var v=0,y="";"undefined"!=typeof t&&(t.exports={b64_sha1:n,hex_sha1:i})},{}],39:[function(e,t,r){"use strict";function i(e,t){le[e]=t}function n(e,t){ue[e]=t}function s(e){return ue[e]?ue[e](e):void 0}function o(e){var t=this;this.source=e,this.cfsid="cfs"+ ++he,e.name&&(this.name=e.name),e.addChangeListener&&e.addChangeListener(function(){t.cfsid="cfs"+ ++he})}function a(){this.busy=0,this.activityListeners=[],this.readinessListeners=[],this.readiness=null}function l(e){this.dasSource=new P(e),this.busy=0,this.activityListeners=[]}function u(e){this.dasSource=new P(e),this.awaitedEntryPoints=new E;var t=this;this.dasSource.entryPoints(function(e){t.awaitedEntryPoints.provide(e)})}function h(e){var t=this;this.source=e,this.twoBit=new E;var r;if(e.twoBitURI)r=new U(e.twoBitURI,{credentials:e.credentials,resolver:e.resolver});else{if(!e.twoBitBlob)throw Error("No twoBitURI or twoBitBlob parameter");r=new z(e.twoBitBlob)}W(r,function(e,r){r?console.log(r):t.twoBit.provide(e)})}function c(e){this.source=e}function f(e){this.source=e}function p(e){a.call(this);var t=this;if(this.readiness="Connecting",this.bwgSource=this.opts=e,t.bwgHolder=new E,this.opts.preflight){var r=ce[this.opts.preflight];if(!r){r=new E,ce[this.opts.preflight]=r;var i=new XMLHttpRequest;i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r.provide("success"):r.provide("failure"))},i.open("get",this.opts.preflight+"?"+hex_sha1("salt"+Date.now()),!0),this.opts.credentials&&(i.withCredentials=!0),i.send()}r.await(function(e){"success"===e&&t.init()})}else t.init()}function d(e,t,r){a.call(this);this.worker=t,this.readiness="Connecting",this.bwgSource=this.opts=e,this.keyHolder=new E,e.resolver&&(this.resolverKey=r.registerResolver(e.resolver)),this.init()}function g(e,t){if(!(e.flag&Q.SEGMENT_UNMAPPED)){var r;if(r=e.seq?e.seq.length:e.seqLength,e.cigar){r=0;for(var i=re(e.cigar),n=0;n<i.length;++n){var s=i[n];("M"==s.op||"D"==s.op)&&(r+=s.cnt)}}var o=new H;return o.min=e.pos+1,o.max=e.pos+r,o.segment=e.segment,o.type="bam",o.id=e.readName,o.notes=["MQ="+e.mq],o.cigar=e.cigar,o.seq=e.seq,o.quals=e.quals,o.orientation=e.flag&Q.REVERSE_COMPLEMENT?"-":"+",o.bamRecord=e,t&&e.flag&Q.MULTIPLE_SEGMENTS&&(o.groups=[{id:e.readName,type:"readpair"}]),o}}function v(e){a.call(this);var t=this;if(this.bamSource=e,this.opts={credentials:e.credentials,preflight:e.preflight,bamGroup:e.bamGroup},this.bamHolder=new E,this.opts.preflight){var r=ce[this.opts.preflight];if(!r){r=new E,ce[this.opts.preflight]=r;var i=new XMLHttpRequest;i.onreadystatechange=function(){
8
- 4==i.readyState&&(200==i.status?r.provide("success"):r.provide("failure"))},i.open("get",this.opts.preflight+"?"+hex_sha1("salt"+Date.now()),!0),this.opts.credentials&&(i.withCredentials="true"),i.send()}r.await(function(e){"success"===e&&t.init()})}else t.init()}function y(e,t){a.call(this);this.bamSource=e,this.worker=t,this.opts={credentials:e.credentials,preflight:e.preflight,bamGroup:e.bamGroup},this.keyHolder=new E,e.resolver&&(this.resolverKey=T.registerResolver(e.resolver)),this.init()}function m(e){a.call(this);var t=this;if(this.cramSource=e,this.opts={credentials:e.credentials,preflight:e.preflight,cramGroup:e.cramGroup},this.cramHolder=new E,this.opts.preflight){var r=ce[this.opts.preflight];if(!r){r=new E,ce[this.opts.preflight]=r;var i=new XMLHttpRequest;i.onreadystatechange=function(){4==i.readyState&&(200==i.status?r.provide("success"):r.provide("failure"))},i.open("get",this.opts.preflight+"?"+hex_sha1("salt"+Date.now()),!0),this.opts.credentials&&(i.withCredentials="true"),i.send()}r.await(function(e){"success"===e&&t.init()})}else t.init()}function b(e,t){a.call(this);this.cramSource=e,this.worker=t,this.opts={credentials:e.credentials,preflight:e.preflight,cramGroup:e.cramGroup},this.keyHolder=new E,e.resolver&&(this.resolverKey=T.registerResolver(e.resolver)),this.init()}function w(e,t){this.source=e,this.mapping=t,this.activityListeners=[],this.busy=0}function x(){}function S(){}function _(e){this.store=new ne(e.jbURI,e.jbQuery)}if("undefined"!=typeof e)var T=e("./cbrowser"),C=T.Browser,k=e("./tier"),L=k.DasTier,A=e("./utils"),E=A.Awaited,O=A.arrayIndexOf,R=A.shallowCopy,F=A.resolveUrlToPage,M=e("./das"),I=M.DASStylesheet,B=M.DASStyle,P=M.DASSource,D=M.DASSegment,H=M.DASFeature,N=M.DASSequence,G=M.DASLink,q=e("./bin"),U=q.URLFetchable,z=q.BlobFetchable,j=e("./twoBit"),W=j.makeTwoBit,V=e("./bigwig"),X=V.makeBwg,K=e("./bam"),Z=K.makeBam,Q=K.BamFlags,Y=e("./cram"),$=Y.makeCram,J=(Y.CramFlags,e("./spans")),ee=J.Range,te=J.union,re=e("./cigar").parseCigar,ie=e("./overlay").OverlayFeatureSource,ne=e("./jbjson").JBrowseStore,se=e("./chainset").Chainset,oe=e("./style"),ae=(oe.StyleFilterSet,e("./encode").EncodeFetchable);var le={},ue={};L.prototype.initSources=function(){var e=this,t=this.browser.createSources(this.dasSource);this.featureSource=t.features||new x,this.sequenceSource=t.sequence,this.featureSource&&this.featureSource.addChangeListener&&this.featureSource.addChangeListener(function(){e.browser.refreshTier(e)})},C.prototype.createSources=function(e){var t=this.sourceCache.get(e);if(t)return t;var r,i;if("sequence"==e.tier_type||e.twoBitURI||e.twoBitBlob)i=e.twoBitURI||e.twoBitBlob?new h(e):e.ensemblURI?e.aminoAcids?new f(e):new c(e):new u(e);else if(e.tier_type&&le[e.tier_type]){var n=le[e.tier_type],s=n(e);r=s.features,i=s.sequence}else if(e.bwgURI||e.bwgBlob){var a=this.getWorker();r=a?new d(e,a,this):new p(e)}else if(e.bamURI||e.bamBlob){var a=this.getWorker();r=a?new y(e,a,this):new v(e)}else if(e.cramURI||e.cramBlob){var a=this.getWorker();r=a?new b(e,a,this):new m(e)}else e.jbURI?r=new _(e):(e.uri||e.features_uri)&&(r=new l(e));if(e.overlay){var t=[];r&&t.push(new o(r));for(var g=0;g<e.overlay.length;++g){var x=this.createSources(e.overlay[g]);x&&x.features&&t.push(x.features)}r=new ie(t,e)}return e.sequenceAliases&&(r=new w(r,new se({type:"alias",sequenceAliases:e.sequenceAliases}))),e.mapping&&(r=new w(r,this.chains[e.mapping])),e.name&&r&&!r.name&&(r.name=e.name),"undefined"!=typeof r&&null!==r&&(r=new o(r)),("undefined"!=typeof r&&null!==r||"undefined"!=typeof i&&null!=i)&&(t={features:r,sequence:i},this.sourceCache.put(e,t)),t},L.prototype.fetchStylesheet=function(e){var t;t=!this.dasSource.stylesheet_uri&&(this.dasSource.tier_type||this.dasSource.bwgURI||this.dasSource.bwgBlob||this.dasSource.bamURI||this.dasSource.bamBlob||this.dasSource.twoBitURI||this.dasSource.twoBitBlob||this.dasSource.jbURI||this.dasSource.overlay)?this.getSource():new l(this.dasSource),t.getStyleSheet(e)};var he=0;o.prototype.addReadinessListener=function(e){return this.source.addReadinessListener?this.source.addReadinessListener(e):void e(null)},o.prototype.removeReadinessListener=function(e){return this.source.removeReadinessListener?this.source.removeReadinessListener(e):void 0},o.prototype.search=function(e,t){return this.source.search?this.source.search(e,t):void 0},o.prototype.getDefaultFIPs=function(e){return this.source.getDefaultFIPs?this.source.getDefaultFIPs(e):void 0},o.prototype.getStyleSheet=function(e){this.source.getStyleSheet(e)},o.prototype.getScales=function(){return this.source.getScales()},o.prototype.addActivityListener=function(e){this.source.addActivityListener&&this.source.addActivityListener(e)},o.prototype.removeActivityListener=function(e){this.source.removeActivityListener&&this.source.removeActivityListener(e)},o.prototype.addChangeListener=function(e){this.source.addChangeListener&&this.source.addChangeListener(e)},o.prototype.removeChangeListener=function(e){this.source.removeChangeListener&&this.source.removeChangeListener(e)},o.prototype.findNextFeature=function(e,t,r,i){this.source.findNextFeature(e,t,r,i)},o.prototype.quantFindNextFeature=function(e,t,r,i,n){this.source.quantFindNextFeature(e,t,r,i,n)},o.prototype.capabilities=function(){return this.source.capabilities?this.source.capabilities():{}},o.prototype.fetch=function(e,t,r,i,n,s,o,a){if(!s)throw Error("Fetch pool is null");var l=this,u=this.cfsid,h=s.awaitedFeatures[u];if(h&&h.started){if(h.styleFilters.doesNotContain(a))return void l.source.fetch(e,t,r,i,n,s,o,a)}else h?h.styleFilters.addAll(a):(h=new E,h.styleFilters=a,s.awaitedFeatures[u]=h,s.requestsIssued.then(function(){h.started=!0,l.source.fetch(e,t,r,i,h.styleFilters.typeList(),s,function(e,t,r,i){h.res||h.provide({status:e,features:t,scale:r,coverage:i})},h.styleFilters)})["catch"](function(e){console.log(e)}));h.await(function(e){o(e.status,e.features,e.scale,e.coverage)})},a.prototype.addReadinessListener=function(e){this.readinessListeners.push(e),e(this.readiness)},a.prototype.removeReadinessListener=function(e){var t=O(this.readinessListeners,e);t>=0&&this.readinessListeners.splice(t,1)},a.prototype.notifyReadiness=function(){for(var e=0;e<this.readinessListeners.length;++e)try{this.readinessListeners[e](this.readiness)}catch(t){console.log(t)}},a.prototype.addActivityListener=function(e){this.activityListeners.push(e)},a.prototype.removeActivityListener=function(e){var t=O(this.activityListeners,e);t>=0&&this.activityListeners.splice(t,1)},a.prototype.notifyActivity=function(){for(var e=0;e<this.activityListeners.length;++e)try{this.activityListeners[e](this.busy)}catch(t){console.log(t)}},a.prototype.getScales=function(){return null},a.prototype.fetch=function(e,t,r,i,n,s,o){return o(null,[],1e9)},a.prototype.getStyleSheet=function(e){var t=new I,r=new B;return r.glyph="BOX",r.BGCOLOR="blue",r.FGCOLOR="black",t.pushStyle({type:"default"},null,r),e(t)},l.prototype.addActivityListener=function(e){this.activityListeners.push(e)},l.prototype.removeActivityListener=function(e){var t=O(this.activityListeners,e);t>=0&&this.activityListeners.splice(t,1)},l.prototype.notifyActivity=function(){for(var e=0;e<this.activityListeners.length;++e)try{this.activityListeners[e](this.busy)}catch(t){console.log(t)}},l.prototype.getStyleSheet=function(e){this.dasSource.stylesheet(function(t){e(t)},function(){e(null,"Couldn't fetch DAS stylesheet")})},l.prototype.fetch=function(e,t,r,i,n,s,o){if(n&&0===n.length)return void o(null,[],i);if(this.dasSource.uri||this.dasSource.features_uri){if(this.dasSource.dasStaticFeatures&&this.cachedStaticFeatures)return o(null,this.cachedStaticFeatures,this.cachedStaticScale);var a=this.dasSource.maxbins!==!1,l={type:n};a&&(l.maxbins=1+((r-t)/i|0));var u=this;u.busy++,u.notifyActivity(),this.dasSource.features(new D(e,t,r),l,function(e,t){u.busy--,u.notifyActivity();var r=i;a||(r=.1),!t&&u.dasSource.dasStaticFeatures&&(u.cachedStaticFeatures=e,u.cachedStaticScale=r),o(t,e,r)})}},l.prototype.findNextFeature=function(e,t,r,i){if(this.dasSource.capabilities&&O(this.dasSource.capabilities,"das1:adjacent-feature")>=0){var n=this;if(this.dasAdjLock)return console.log("Already looking for a next feature, be patient!");this.dasAdjLock=!0;var s={adjacent:e+":"+(0|t)+":"+(r>0?"F":"B")},o=thisTier.getDesiredTypes(thisTier.browser.scale);o&&(s.types=o),thisTier.dasSource.features(null,s,function(e){n.dasAdjLock=!1,e.length>0&&null!==e[0]&&i(e[0])})}},u.prototype.fetch=function(e,t,r,i,n){this.dasSource.sequence(new D(e,t,r),function(e){return 1==e.length?n(null,e[0]):n("Didn't get sequence")})},u.prototype.getSeqInfo=function(e,t){this.awaitedEntryPoints.await(function(r){for(var i=0;i<r.length;++i)if(r[i].name==e)return t({length:r[i].end});return t()})},h.prototype.fetch=function(e,t,r,i,n){this.twoBit.await(function(i){i.fetch(e,t,r,function(i,s){if(s)return n(s,null);var o=new N(e,t,r,"DNA",i);return n(null,o)})})},h.prototype.getSeqInfo=function(e,t){this.twoBit.await(function(r){var i=r.getSeq(e);i?r.getSeq(e).length(function(e){t({length:e})}):t()})},c.prototype.fetch=function(e,t,r,i,n){var s=this.source.ensemblURI+"/sequence/region/"+this.source.species+"/"+e+":"+t+".."+r+":1?content-type=application/json",o=new XMLHttpRequest;o.onreadystatechange=function(){if(4==o.readyState){var i;if(!(o.status>=300)){i=JSON.parse(o.response);var s=new N(e,t,r,"DNA",i.seq);return n(null,s)}var a="Error code "+o.status;try{i=JSON.parse(o.response),i.error&&(a=i.error)}finally{n(a,null)}}},o.open("GET",s,!0),o.responseType="text",o.send()},c.prototype.getSeqInfo=function(e,t){var r=this.source.ensemblURI+"/info/assembly/"+this.source.species+"/"+e+"?content-type=application/json",i=new XMLHttpRequest;i.onreadystatechange=function(){if(4==i.readyState)if(i.status>=300)t();else{var e=JSON.parse(i.response);t(e)}},i.open("GET",r,!0),i.responseType="text",i.send()},f.prototype.fetch=function(e,t,r,i,n){var s=this.source.ensemblURI+"/sequence/id/"+e+"?type=protein&content-type=application/json",o=new XMLHttpRequest;o.onreadystatechange=function(){if(4==o.readyState){if(!(o.status>=300)){var t=JSON.parse(o.response),r=new N(e,1,t.seq.length+1,"PEP",t.seq);return n(null,r)}var i="Error code "+o.status;try{var t=JSON.parse(o.response);t.error&&(i=t.error)}catch(s){}n(i,null)}},o.open("GET",s,!0),o.responseType="text",o.send("")},f.prototype.getSeqInfo=function(e,t){var r=this.source.ensemblURI+"/sequence/id/"+e+"?type=protein&content-type=application/json",i=new XMLHttpRequest;i.onreadystatechange=function(){if(4==i.readyState)if(i.status>=300)t();else{var e=JSON.parse(i.response);t({length:e.seq.length})}},i.open("GET",r,!0),i.responseType="text",i.send("")},l.prototype.getScales=function(){return[]};var ce={};p.prototype=Object.create(a.prototype),p.prototype.init=function(){var e,t=this,r=this.bwgSource.uri||this.bwgSource.bwgURI;e=r?"encode"===this.bwgSource.transport?new ae(r,{credentials:this.opts.credentials}):new U(r,{credentials:this.opts.credentials,resolver:this.opts.resolver}):new z(this.bwgSource.bwgBlob),X(e,function(e,r){r?(t.error=r,t.readiness=null,t.notifyReadiness(),t.bwgHolder.provide(null)):(t.bwgHolder.provide(e),t.readiness=null,t.notifyReadiness(),"bigbed"==e.type&&e.getExtraIndices(function(e){t.extraIndices=e}))})},p.prototype.capabilities=function(){var e={leap:!0};if(this.bwgHolder.res&&"bigwig"==this.bwgHolder.res.type&&(e.quantLeap=!0),this.extraIndices&&this.extraIndices.length>0){e.search=[];for(var t=0;t<this.extraIndices.length;++t)e.search.push(this.extraIndices[t].field)}return e},p.prototype.fetch=function(e,t,r,i,n,s,o){var a=this;this.bwgHolder.await(function(s){if("undefined"==typeof s||null===s)return o(a.error||"Can't access binary file",null,null);var l,u=!n||0===n.length||O(n,"density")>=0;a.opts.clientBin&&(u=!1);var h=a.opts.scaleFactor||1;if("bigwig"==s.type||u||"undefined"!=typeof a.opts.forceReduction){for(var c=-1,f=0;f<s.zoomLevels.length&&s.zoomLevels[f].reduction<=i*h;++f)c=f;"undefined"!=typeof a.opts.forceReduction&&(c=a.opts.forceReduction),l=0>c?s.getUnzoomedView():s.getZoomedView(c)}else l=s.getUnzoomedView();a.busy++,a.notifyActivity(),l.readWigData(e,t,r,function(e){a.busy--,a.notifyActivity();var i=1e9;if("bigwig"===s.type){var n=(r-t)/e.length/2;i>n&&(i=n)}if(a.opts.link)for(var l=0;l<e.length;++l){var u=e[l];u.label&&(u.links=[new G("Link",a.opts.link.replace(/\$\$/,u.label))])}o(null,e,i)})})},p.prototype.quantFindNextFeature=function(e,t,r,i,n){var s=this;s.busy++,s.notifyActivity(),this.bwgHolder.res.thresholdSearch(e,t,r,i,function(e,t){return s.busy--,s.notifyActivity(),n(e,t)})},p.prototype.findNextFeature=function(e,t,r,i){var n=this;n.busy++,n.notifyActivity(),this.bwgHolder.res.getUnzoomedView().getFirstAdjacent(e,t,r,function(e){n.busy--,n.notifyActivity(),e.length>0&&null!==e[0]&&i(e[0])})},p.prototype.getScales=function(){var e=this.bwgHolder.res;if(e){for(var t=[1],r=0;r<e.zoomLevels.length;++r)t.push(e.zoomLevels[r].reduction);return t}return null},p.prototype.search=function(e,t){if(!this.extraIndices||0===this.extraIndices.length)return t(null,"No indices available");var r=this.extraIndices[0];return r.lookup(e,t)},p.prototype.getDefaultFIPs=function(e){return this.opts.noExtraFeatureInfo?!0:void this.bwgHolder.await(function(t){if(t&&t.schema&&t.definedFieldCount<t.schema.fields.length){var r=function(e,r){for(var i=0;i<r.hit.length;++i)if(r.hit[i].isSuperGroup)return;for(var n=t.definedFieldCount;n<t.schema.fields.length;++n){var s=t.schema.fields[n];r.add(s.comment,e[s.name])}};e(r)}})},p.prototype.getStyleSheet=function(e){this.bwgHolder.await(function(t){if(!t)return e(null,"bbi error");var r=new I;if("bigbed"==t.type){var i=new B;i.glyph="BOX",i.FGCOLOR="black",i.BGCOLOR="blue",i.HEIGHT=8,i.BUMP=!0,i.LABEL=!0,i.ZINDEX=20,r.pushStyle({type:"bigbed"},null,i),i.glyph="BOX",i.FGCOLOR="black",i.BGCOLOR="red",i.HEIGHT=10,i.BUMP=!0,i.ZINDEX=20,r.pushStyle({type:"translation"},null,i);var n=new B;n.glyph="BOX",n.FGCOLOR="black",n.BGCOLOR="white",n.HEIGHT=10,n.ZINDEX=10,n.BUMP=!0,n.LABEL=!0,r.pushStyle({type:"transcript"},null,n);var s=new B;s.glyph="HISTOGRAM",s.COLOR1="white",s.COLOR2="black",s.HEIGHT=30,r.pushStyle({type:"density"},null,s)}else{var i=new B;i.glyph="HISTOGRAM",i.COLOR1="white",i.COLOR2="black",i.HEIGHT=30,r.pushStyle({type:"default"},null,i)}return 12==t.definedFieldCount&&t.fieldCount>=14&&(r.geneHint=!0),e(r)})},d.prototype=Object.create(a.prototype),d.prototype.init=function(){var e=this,t=this.uri||this.bwgSource.uri||this.bwgSource.bwgURI,r=this.bwgSource.blob||this.bwgSource.bwgBlob,i=function(t,r){e.readiness=null,e.notifyReadiness(),t?e.worker.postCommand({command:"meta",connection:t},function(r,i){i?(e.error=i,e.keyHolder.provide(null)):(e.meta=r,e.keyHolder.provide(t))}):(e.error=r,e.keyHolder.provide(null))};r?this.worker.postCommand({command:"connectBBI",blob:r},i):this.worker.postCommand({command:"connectBBI",uri:F(t),resolver:this.resolverKey,transport:this.bwgSource.transport,credentials:this.bwgSource.credentials},i)},d.prototype.capabilities=function(){var e={leap:!0};if(this.meta&&"bigwig"==this.meta.type&&(e.quantLeap=!0),this.meta&&this.meta.extraIndices&&this.meta.extraIndices.length>0){e.search=[];for(var t=0;t<this.meta.extraIndices.length;++t)e.search.push(this.meta.extraIndices[t].field)}return e},d.prototype.fetch=function(e,t,r,i,n,s,o){var a=this;a.busy++,a.notifyActivity(),this.keyHolder.await(function(s){if(!s)return a.busy--,a.notifyActivity(),o(a.error||"Can't access binary file",null,null);var l=-1,u=!n||0===n.length||O(n,"density")>=0;if(a.opts.clientBin&&(u=!1),"bigwig"==a.meta.type||u||"undefined"!=typeof a.opts.forceReduction){for(var h=1;h<a.meta.zoomLevels.length&&a.meta.zoomLevels[h]<=i;++h)l=h-1;"undefined"!=typeof a.opts.forceReduction&&(l=a.opts.forceReduction)}a.worker.postCommand({command:"fetch",connection:s,chr:e,min:t,max:r,zoom:l},function(e,i){a.busy--,a.notifyActivity();var n=1e9;if("bigwig"===a.meta.type){var s=(r-t)/e.length/2;n>s&&(n=s)}if(a.opts.link)for(var l=0;l<e.length;++l){var u=e[l];u.label&&(u.links=[new G("Link",a.opts.link.replace(/\$\$/,u.label))])}o(i,e,n)})})},d.prototype.quantFindNextFeature=function(e,t,r,i,n){var s=this;this.busy++,this.notifyActivity(),this.worker.postCommand({command:"quantLeap",connection:this.keyHolder.res,chr:e,pos:t,dir:r,threshold:i,under:!1},function(e,t){return console.log(e,t),s.busy--,s.notifyActivity(),n(e,t)})},d.prototype.findNextFeature=function(e,t,r,i){var n=this;this.busy++,this.notifyActivity(),this.worker.postCommand({command:"leap",connection:this.keyHolder.res,chr:e,pos:t,dir:r},function(e,t){n.busy--,n.notifyActivity(),e.length>0&&null!==e[0]&&i(e[0])})},d.prototype.getScales=function(){var e=this.meta;return e?e.zoomLevels:null},d.prototype.search=function(e,t){if(!this.meta.extraIndices||0===this.meta.extraIndices.length)return t(null,"No indices available");var r=this;this.busy++,this.notifyActivity();var i=this.meta.extraIndices[0];this.worker.postCommand({command:"search",connection:this.keyHolder.res,query:e,index:i},function(e,i){r.busy--,r.notifyActivity(),t(e,i)})},d.prototype.getDefaultFIPs=function(e){if(this.opts.noExtraFeatureInfo)return!0;var t=this;this.keyHolder.await(function(r){var i=t.meta;if(i&&i.schema&&i.definedFieldCount<i.schema.fields.length){var n=function(e,t){for(var r=0;r<t.hit.length;++r)if(t.hit[r].isSuperGroup)return;for(var n=i.definedFieldCount;n<i.schema.fields.length;++n){var s=i.schema.fields[n];t.add(s.comment,e[s.name])}};e(n)}})},d.prototype.getStyleSheet=function(e){var t=this;this.keyHolder.await(function(r){var i=t.meta;if(!i)return e(null,"bbi error");var n=new I;if("bigbed"==i.type){var s=new B;s.glyph="BOX",s.FGCOLOR="black",s.BGCOLOR="blue",s.HEIGHT=8,s.BUMP=!0,s.LABEL=!0,s.ZINDEX=20,n.pushStyle({type:"bigbed"},null,s),s.glyph="BOX",s.FGCOLOR="black",s.BGCOLOR="red",s.HEIGHT=10,s.BUMP=!0,s.ZINDEX=20,n.pushStyle({type:"translation"},null,s);var o=new B;o.glyph="BOX",o.FGCOLOR="black",o.BGCOLOR="white",o.HEIGHT=10,o.ZINDEX=10,o.BUMP=!0,o.LABEL=!0,n.pushStyle({type:"transcript"},null,o);var a=new B;a.glyph="HISTOGRAM",a.COLOR1="white",a.COLOR2="black",a.HEIGHT=30,n.pushStyle({type:"density"},null,a)}else{var s=new B;s.glyph="HISTOGRAM",s.COLOR1="white",s.COLOR2="black",s.HEIGHT=30,n.pushStyle({type:"default"},null,s)}return 12==i.definedFieldCount&&i.fieldCount>=14&&(n.geneHint=!0),e(n)})},v.prototype=Object.create(a.prototype),v.prototype.init=function(){var e,t,r=this;this.bamSource.bamBlob?(e=new z(this.bamSource.bamBlob),t=new z(this.bamSource.baiBlob)):(e=new U(this.bamSource.bamURI,{credentials:this.opts.credentials,resolver:this.opts.resolver}),t=new U(this.bamSource.baiURI||this.bamSource.bamURI+".bai",{credentials:this.opts.credentials,resolver:this.opts.resolver})),Z(e,t,null,function(e,t){r.readiness=null,r.notifyReadiness(),e?r.bamHolder.provide(e):(r.error=t,r.bamHolder.provide(null))})},v.prototype.fetch=function(e,t,r,i,n,s,o){var a=n&&1==n.length&&"density"==n[0],l=this;l.busy++,l.notifyActivity(),this.bamHolder.await(function(i){return i?void i.fetch(e,t,r,function(e,t){if(l.busy--,l.notifyActivity(),t)o(t,null,null);else{for(var r=[],i=0;i<e.length;++i){var n=e[i],s=g(n,l.opts.bamGroup);s&&r.push(s)}o(null,r,1e9)}},{light:a}):(l.busy--,l.notifyActivity(),o(l.error||"Couldn't fetch BAM"))})},v.prototype.getScales=function(){return 1e9},v.prototype.getStyleSheet=function(e){this.bamHolder.await(function(t){var r=new I,i=new B;i.glyph="HISTOGRAM",i.COLOR1="black",i.COLOR2="red",i.HEIGHT=30,r.pushStyle({type:"density"},"low",i),r.pushStyle({type:"density"},"medium",i);var n=new B;return n.glyph="__SEQUENCE",n.FGCOLOR="black",n.BGCOLOR="blue",n.HEIGHT=8,n.BUMP=!0,n.LABEL=!1,n.ZINDEX=20,r.pushStyle({type:"bam"},"high",n),e(r)})},y.prototype=Object.create(a.prototype),y.prototype.init=function(){var e=this,t=this.bamSource.uri||this.bamSource.bamURI,r=this.bamSource.indexUri||this.bamSource.baiURI||t+".bai",i=this.bamSource.bamBlob||this.bamSource.blob,n=this.bamSource.baiBlob||this.bamSource.indexBlob,s=function(t,r){e.readiness=null,e.notifyReadiness(),t?e.keyHolder.provide(t):(e.error=r,e.keyHolder.provide(null))};i?this.worker.postCommand({command:"connectBAM",blob:i,indexBlob:n},s):this.worker.postCommand({command:"connectBAM",uri:F(t),resolver:this.resolverKey,indexUri:F(r),credentials:this.bamSource.credentials,indexChunks:this.bamSource.indexChunks},s)},y.prototype.fetch=function(e,t,r,i,n,s,o){var a=n&&1==n.length&&"density"==n[0],l=this;l.busy++,l.notifyActivity(),this.keyHolder.await(function(i){return i?void l.worker.postCommand({command:"fetch",connection:i,chr:e,min:t,max:r,opts:{light:a}},function(e,t){if(l.busy--,l.notifyActivity(),t)o(t,null,null);else{for(var r=[],i=0;i<e.length;++i){var n=e[i],s=g(n,l.opts.bamGroup);s&&r.push(s)}o(null,r,1e9)}}):(l.busy--,l.notifyActivity(),o(l.error||"Couldn't fetch BAM"))})},y.prototype.getScales=function(){return 1e9},y.prototype.getStyleSheet=function(e){this.keyHolder.await(function(t){var r=new I,i=new B;i.glyph="HISTOGRAM",i.COLOR1="black",i.COLOR2="red",i.HEIGHT=30,r.pushStyle({type:"density"},"low",i),r.pushStyle({type:"density"},"medium",i);var n=new B;return n.glyph="__SEQUENCE",n.FGCOLOR="black",n.BGCOLOR="blue",n.HEIGHT=8,n.BUMP=!0,n.LABEL=!1,n.ZINDEX=20,r.pushStyle({type:"bam"},"high",n),e(r)})},m.prototype=Object.create(a.prototype),m.prototype.init=function(){var e,t,r=this;this.cramSource.cramBlob?(e=new z(this.cramSource.cramBlob),t=new z(this.cramSource.craiBlob)):(e=new U(this.cramSource.cramURI,{credentials:this.opts.credentials,resolver:this.opts.resolver}),t=new U(this.cramSource.craiURI||this.cramSource.cramURI+".crai",{credentials:this.opts.credentials,resolver:this.opts.resolver})),$(e,t,null,function(e,t){r.readiness=null,r.notifyReadiness(),e?r.cramHolder.provide(e):(r.error=t,r.cramHolder.provide(null))})},m.prototype.fetch=function(e,t,r,i,n,s,o){var a=n&&1==n.length&&"density"==n[0],l=this;l.busy++,l.notifyActivity(),this.cramHolder.await(function(i){return i?void i.fetch(e,t,r,function(e,t){if(l.busy--,l.notifyActivity(),t)o(t,null,null);else{for(var r=[],i=0;i<e.length;++i){var n=e[i],s=cramRecordToFeature(n,l.opts.cramGroup);s&&r.push(s)}o(null,r,1e9)}},{light:a}):(l.busy--,l.notifyActivity(),o(l.error||"Couldn't fetch CRAM"))})},m.prototype.getScales=function(){return 1e9},m.prototype.getStyleSheet=function(e){this.cramHolder.await(function(t){var r=new I,i=new B;i.glyph="HISTOGRAM",i.COLOR1="black",i.COLOR2="red",i.HEIGHT=30,r.pushStyle({type:"density"},"low",i),r.pushStyle({type:"density"},"medium",i);var n=new B;return n.glyph="__SEQUENCE",n.FGCOLOR="black",n.BGCOLOR="blue",n.HEIGHT=8,n.BUMP=!0,n.LABEL=!1,n.ZINDEX=20,r.pushStyle({type:"cram"},"high",n),e(r)})},b.prototype=Object.create(a.prototype),b.prototype.init=function(){var e=this,t=this.cramSource.uri||this.cramSource.cramURI,r=this.cramSource.indexUri||this.cramSource.craiURI||t+".crai",i=this.cramSource.cramBlob||this.cramSource.blob,n=this.cramSource.craiBlob||this.cramSource.indexBlob,s=function(t,r){e.readiness=null,e.notifyReadiness(),t?e.keyHolder.provide(t):(e.error=r,e.keyHolder.provide(null))};i?this.worker.postCommand({command:"connectCRAM",blob:i,indexBlob:n},s):this.worker.postCommand({command:"connectCRAM",uri:F(t),resolver:this.resolverKey,indexUri:F(r),credentials:this.cramSource.credentials,indexChunks:this.cramSource.indexChunks},s)},b.prototype.fetch=function(e,t,r,i,n,s,o){var a=n&&1==n.length&&"density"==n[0],l=this;l.busy++,l.notifyActivity(),this.keyHolder.await(function(i){return i?void l.worker.postCommand({command:"fetch",connection:i,chr:e,min:t,max:r,opts:{light:a}},function(e,t){if(l.busy--,l.notifyActivity(),t)o(t,null,null);else{for(var r=[],i=0;i<e.length;++i){var n=e[i],s=cramRecordToFeature(n,l.opts.cramGroup);s&&r.push(s)}o(null,r,1e9)}}):(l.busy--,l.notifyActivity(),o(l.error||"Couldn't fetch CRAM"))})},b.prototype.getScales=function(){return 1e9},b.prototype.getStyleSheet=function(e){this.keyHolder.await(function(t){var r=new I,i=new B;i.glyph="HISTOGRAM",i.COLOR1="black",i.COLOR2="red",i.HEIGHT=30,r.pushStyle({type:"density"},"low",i),r.pushStyle({type:"density"},"medium",i);var n=new B;return n.glyph="__SEQUENCE",n.FGCOLOR="black",n.BGCOLOR="blue",n.HEIGHT=8,n.BUMP=!0,n.LABEL=!1,n.ZINDEX=20,r.pushStyle({type:"cram"},"high",n),e(r)})},w.prototype.addActivityListener=function(e){this.activityListeners.push(e)},w.prototype.removeActivityListener=function(e){var t=O(this.activityListeners,e);t>=0&&this.activityListeners.splice(t,0)},w.prototype.notifyActivity=function(){for(var e=0;e<this.activityListeners.length;++e)try{this.activityListeners[e](this.busy)}catch(t){console.log(t)}},w.prototype.getStyleSheet=function(e){return this.source.getStyleSheet(e)},w.prototype.getScales=function(){return this.source.getScales()},w.prototype.getDefaultFIPs=function(e){return this.source.getDefaultFIPs?this.source.getDefaultFIPs(e):void 0},w.prototype.simplifySegments=function(e,t){if(0===e.length)return e;e.sort(function(e,t){var r=e.name-t.name;return r?r:(r=e.start-t.start,r?r:e.end-t.end)});for(var r=[],i=e[0],n=0;n<e.length;++n){var s=e[n];s.name!=i.name||s.start>i.end+t?(r.push(i),i=s):i=new D(i.name,Math.min(i.start,s.start),Math.max(i.end,s.end))}return r.push(i),r},w.prototype.fetch=function(e,t,r,i,n,s,o,a){var l=this,u=r-t+1;l.busy++,l.notifyActivity(),this.mapping.sourceBlocksForRange(e,t,r,function(e){if(0===e.length)l.busy--,l.notifyActivity(),o("No mapping available for this regions",[],i);else{e=l.simplifySegments(e,Math.max(100,.05*u));var t,r=[],h=null,c=e.length;e.map(function(e){l.source.fetch(e.name,e.start,e.end,i,n,s,function(i,n,s){if(i&&!t&&(t=i),n)for(var a=0;a<n.length;++a){var u=n[a],f=u.segment;0===f.indexOf("chr")&&(f=f.substr(3));var p=l.mapping.mapSegment(f,u.min,u.max);if(0===p.length)u.parts&&u.parts.length>0&&r.push(u);else for(var d=0;d<p.length;++d){var g=p[d],v=R(u);v.segment=g.segment,v.min=g.min,v.max=g.max,g.partialMin&&(v.partialMin=g.partialMin),g.partialMax&&(v.partialMax=g.partialMax),g.flipped&&("-"==u.orientation?v.orientation="+":"+"==u.orientation&&(v.orientation="-")),r.push(v)}}var y=l.mapping.mapPoint(e.name,e.start),m=l.mapping.mapPoint(e.name,e.end);if(y&&m){var b=new ee(y.pos,m.pos);h=h?te(h,b):b}--c,0===c&&(l.busy--,l.notifyActivity(),o(t,r,s,h))},a)})}})},x.prototype.getScales=function(){return null},x.prototype.fetch=function(e,t,r,i,n,s,o){return o(null,[],1e9)},x.prototype.getStyleSheet=function(e){var t=new I,r=new B;return r.glyph="BOX",r.BGCOLOR="blue",r.FGCOLOR="black",t.pushStyle({type:"default"},null,r),e(t)},S.prototype.fetch=function(e,t,r,i,n){return n(null,null)},_.prototype.getScales=function(){return null},_.prototype.getStyleSheet=function(e){var t=new I,r=new B;r.glyph="BOX",r.FGCOLOR="black",r.BGCOLOR="red",r.HEIGHT=10,r.BUMP=!0,r.ZINDEX=20,t.pushStyle({type:"translation"},null,r);var i=new B;i.glyph="BOX",i.FGCOLOR="black",i.BGCOLOR="white",i.HEIGHT=10,i.ZINDEX=10,i.BUMP=!0,i.LABEL=!0,t.pushStyle({type:"transcript"},null,i);var n=new B;return n.glyph="BOX",n.FGCOLOR="black",n.BGCOLOR="green",n.HEIGHT=8,n.BUMP=!0,n.LABEL=!0,n.ZINDEX=20,t.pushStyle({type:"default"},null,n),e(t)},_.prototype.fetch=function(e,t,r,i,n,s,o){if(n&&0===n.length)return void o(null,[],i);var a={};this.store.features(new D(e,t,r),a,function(e,t){o(t,e,1e5)})},C.prototype.sourceAdapterIsCapable=function(e,t){return e.capabilities?e.capabilities()[t]:!1},"undefined"!=typeof t&&(t.exports={FeatureSourceBase:a,TwoBitSequenceSource:h,EnsemblSequenceSource:c,EnsemblProteinSequenceSource:f,DASSequenceSource:u,MappedFeatureSource:w,CachingFeatureSource:o,BWGFeatureSource:p,RemoteBWGFeatureSource:d,BAMFeatureSource:v,RemoteBAMFeatureSource:y,CRAMFeatureSource:m,RemoteCRAMFeatureSource:b,DummyFeatureSource:x,DummySequenceSource:S,registerSourceAdapterFactory:i,registerParserFactory:n,makeParser:s},e("./ensembljson"),e("./tabix-source"),e("./memstore"),e("./bedwig"),e("./vcf"),e("./test-source"))},{"./bam":1,"./bedwig":2,"./bigwig":3,"./bin":4,"./cbrowser":6,"./chainset":7,"./cigar":8,"./cram":10,"./das":11,"./encode":15,"./ensembljson":16,"./jbjson":25,"./memstore":28,"./overlay":31,"./spans":41,"./style":42,"./tabix-source":46,"./test-source":48,"./tier":52,"./twoBit":55,"./utils":56,"./vcf":57}],40:[function(e,t,r){"use strict";function i(e){return e.uri?e.uri:e.blob?"file:"+e.blob.name:e.bwgBlob?"file:"+e.bwgBlob.name:e.bamBlob?"file:"+e.bamBlob.name:e.twoBitBlob?"file:"+e.twoBitBlob.name:e.bwgURI||e.bamURI||e.jbURI||e.twoBitURI||"https://www.biodalliance.org/magic/no_uri"}function n(e){return e.stylesheet_uri?e.stylesheet_uri:"sequence"==e.tier_type||e.twoBitURI||e.twoBitBlob?"https://www.biodalliance.org/magic/sequence":i(e)}function s(e,t){if(i(e)!=i(t))return!1;if(e.mapping!=t.mapping)return!1;if(e.tier_type!=t.tier_type)return!1;if(e.overlay){if(!t.overlay||t.overlay.length!=e.overlay.length)return!1;for(var r=0;r<e.overlay.length;++r)if(!s(e.overlay[r],t.overlay[r]))return!1}else if(t.overlay)return!1;return!0}function o(e,t){if(i(e)!=i(t)||n(e)!=n(t))return!1;if(e.mapping!=t.mapping)return!1;if(e.tier_type!=t.tier_type)return!1;if(e.overlay){if(!t.overlay||t.overlay.length!=e.overlay.length)return!1;for(var r=0;r<e.overlay.length;++r)if(!o(e.overlay[r],t.overlay[r]))return!1}else if(t.overlay)return!1;return!0}"undefined"!=typeof t&&(t.exports={sourcesAreEqual:o,sourcesAreEqualModuloStyle:s,sourceDataURI:i,sourceStyleURI:n})},{}],41:[function(e,t,r){"use strict";function i(e,t){if("number"!=typeof e||"number"!=typeof t)throw"Bad range "+e+","+t;this._min=e,this._max=t}function n(e){var t=e.sort(u),r=[],i=t.shift();t.forEach(function(e){e._min<=i._max?e._max>i._max&&(i._max=e._max):(r.push(i),i=e)}),r.push(i),this._ranges=r}function s(e,t){return e instanceof n||(e instanceof Array||(e=[e]),e=new n(e)),t&&e.insertRange(t),e}function o(e,t){for(var r=e.ranges(),s=t.ranges(),o=r.length,a=s.length,l=0,u=0,h=[];o>l&&a>u;){var e=r[l],t=s[u],c=Math.max(e.min(),t.min()),f=Math.min(e.max(),t.max());f>=c&&h.push(new i(c,f)),e.max()>t.max()?++u:++l}return 0==h.length?null:1==h.length?h[0]:new n(h)}function a(e){for(var t=0,r=e.ranges(),i=0;i<r.length;++i){var n=r[i];t+=n.max()-n.min()+1}return t}function l(e,t){return e.min()<t.min()?-1:e.min()>t.min()?1:e.max()<t.max()?-1:t.max()>e.max()?1:0}function u(e,t){return e._min<t._min?-1:e._min>t._min?1:e._max<t._max?-1:t._max>e._max?1:0}i.prototype.min=function(){return this._min},i.prototype.max=function(){return this._max},i.prototype.contains=function(e){return e>=this._min&&e<=this._max},i.prototype.isContiguous=function(){return!0},i.prototype.ranges=function(){return[this]},i.prototype._pushRanges=function(e){e.push(this)},i.prototype.toString=function(){return"["+this._min+"-"+this._max+"]"},n.prototype.min=function(){return this._ranges[0].min()},n.prototype.max=function(){return this._ranges[this._ranges.length-1].max()},n.prototype.lower_bound=function(e){var t=this.ranges();if(e>this.max())return t.length;if(e<this.min())return 0;for(var r=0,i=t.length-1;i>=r;){var n=Math.floor((r+i)/2);if(e>t[n]._max)r=n+1;else{if(!(e<t[n]._min))return n;i=n-1}}return r},n.prototype.contains=function(e){var t=this.lower_bound(e);return t<this._ranges.length&&this._ranges[t].contains(e)?!0:!1},n.prototype.insertRange=function(e){var t=this.lower_bound(e._min);if(t===this._ranges.length)return void this._ranges.push(e);var r=this.ranges();if(e._max<r[t]._min)return void this._ranges.splice(t,0,e);r[t]._min<e._min&&(e._min=r[t]._min);for(var i=t+1;i<r.length&&r[i]._min<=e._max;)i++;i--,r[i]._max>e._max&&(e._max=r[i]._max),this._ranges.splice(t,i-t+1,e)},n.prototype.isContiguous=function(){return this._ranges.length>1},n.prototype.ranges=function(){return this._ranges},n.prototype._pushRanges=function(e){for(var t=0;t<this._ranges.length;++t)e.push(this._ranges[t])},n.prototype.toString=function(){for(var e="",t=0;t<this._ranges.length;++t)t>0&&(e+=","),
9
- e+=this._ranges[t].toString();return e},"undefined"!=typeof t&&(t.exports={Range:i,union:s,intersection:o,coverage:a,rangeOver:l,_rangeOrder:u})},{}],42:[function(e,t,r){"use strict";function i(e,t,r){this.type=e,this.method=t,this.label=r}function n(e){if(this._filters={},e)for(var t=0;t<e.length;++t)this.add(e[t])}i.prototype.equals=function(e){return this.type==e.type&&this.method==e.method&&this.label==e.label},i.prototype.toString=function(){var e=[];return this.type&&e.push("type="+this.type),this.method&&e.push("method="+this.method),this.label&&e.push("label="+this.label),"StyleFilter<"+e.join(";")+">"},n.prototype.add=function(e){var t=e.toString();this._filters[t]||(this._filters[t]=e,this._list=null)},n.prototype.addAll=function(e){for(var t=e.list(),r=0;r<t.length;++r)this.add(t[r])},n.prototype.doesNotContain=function(e){for(var t=e.list(),r=0;r<t.length;++r)if(!this._filters[r.toString()])return!0;return!1},n.prototype.list=function(){if(!this._list){this._list=[];for(var e in this._filters)this._filters.hasOwnProperty(e)&&this._list.push(this._filters[e])}return this._list},n.prototype.typeList=function(){for(var e=[],t=this.list(),r=0;r<t.length;++r){var i=t[r],n=i.type;if(!n||"default"==n)return null;e.indexOf(n)<0&&e.push(n)}return e},"undefined"!=typeof t&&(t.exports={StyleFilter:i,StyleFilterSet:n})},{}],43:[function(e,t,r){"use strict";function i(e,t){n(t),t.updateStatus(e)}function n(e){var t=e.browser,r=t.tiers.filter(function(t){return"multi"===t.dasSource.renderer&&t.dasSource.multi.multi_id===e.dasSource.sub.multi_id});r.forEach(function(e){return t.refreshTier(e)})}Object.defineProperty(r,"__esModule",{value:!0}),r.renderTier=i,r.drawTier=n},{}],44:[function(e,t,r){"use strict";if("undefined"!=typeof e)var i=e("./cbrowser"),n=i.Browser,s=e("./utils"),o=(s.makeElement,s.makeElementNS),a=e("./version"),l=e("./sequence-draw").svgSeqTier,u=e("./svg-utils"),h=u.NS_SVG,c=u.NS_XLINK,f=u.SVGPath,p=e("./numformats"),d=p.formatQuantLabel,g=p.formatLongInt;n.prototype.makeSVG=function(e){e=e||{};var t=e.minTierHeight||20,r=3,i=e.width||this.featurePanelWidth,n=this.featurePanelWidth,s=this.scale;this.featurePanelWidth=i,this.scale=this.featurePanelWidth/(this.viewEnd-this.viewStart);var u=this,p=document.implementation.createDocument(h,"svg",null),v=o(h,"g",null,{fontFamily:"helvetica",fontSize:"8pt"});p.documentElement.appendChild(v);var y=200;if(e.banner){var m=o(h,"a",o(h,"text","Graphics from Biodalliance "+a,{x:u.featurePanelWidth+y-100,y:35,strokeWidth:0,fontSize:"12pt",textAnchor:"end",fill:"blue"}));m.setAttribute("xmlns:xlink",c),m.setAttribute("xlink:href","http://www.biodalliance.org/"),v.appendChild(m)}e.region&&v.appendChild(o(h,"text",this.chr+":"+g(this.viewStart)+".."+g(this.viewEnd),{x:y+100,y:35,strokeWidth:0,fontSize:"12pt",textAnchor:"start"}));var b=o(h,"rect",null,{x:y,y:50,width:u.featurePanelWidth,height:1e5}),w=o(h,"clipPath",b,{id:"featureClip"});v.appendChild(w);for(var x=70,S=o(h,"g",null,{}),_=0;_<u.tiers.length;++_){var T=u.tiers[_];T.backupSubtiers=T.subtiers,T.backupOriginHaxx=T.originHaxx,T.backupLayoutHeight=T.layoutHeight;var C=u.getTierRenderer(T);C&&C.prepareSubtiers&&C.prepareSubtiers(T,T.viewport.getContext("2d"));var k=o(h,"g",null,{clipPath:"url(#featureClip)",clipRule:"nonzero"}),L=o(h,"g"),A=x,E=o(h,"rect",null,{x:0,y:A,width:"10000",height:50,fill:T.background});if(k.appendChild(E),T.sequenceSource){var O=l(T,T.currentSequence);k.appendChild(o(h,"g",O,{transform:"translate("+y+", "+x+")"})),x+=80}else{if(!T.subtiers)continue;for(var R=(T.glyphCacheOrigin-u.viewStart)*u.scale,F=!1,M=0;M<T.subtiers.length;++M){x+=r;for(var I=T.subtiers[M],B=[],P=0;P<I.glyphs.length;++P){var D=I.glyphs[P];B.push(D.toSVG())}if(k.appendChild(o(h,"g",B,{transform:"translate("+(y+R)+", "+x+")"})),I.quant){F=!0;var H=I.quant,N=I.height,G=2;N>40&&(G=1+(N/20|0));var q=N/(G-1),U=(H.max-H.min)/(G-1),z=new f;z.moveTo(y+5,x),z.lineTo(y,x),z.lineTo(y,x+I.height),z.lineTo(y+5,x+I.height);for(var j=1;G-1>j;++j){var W=j*q;z.moveTo(y,x+W),z.lineTo(y+3,x+W)}L.appendChild(o(h,"path",null,{d:z.toPathData(),fill:"none",stroke:"black",strokeWidth:"2px"})),L.appendChild(o(h,"text",d(H.max),{x:y-3,y:x+7,textAnchor:"end"})),L.appendChild(o(h,"text",d(H.min),{x:y-3,y:x+I.height,textAnchor:"end"}));for(var j=1;G-1>j;++j){var W=j*q;L.appendChild(o(h,"text",d(1*H.max-j*U),{x:y-3,y:x+W+3,textAnchor:"end"}))}}x+=I.height+r}t>x-A&&(x=A+t)}var V;V="string"==typeof T.config.name?T.config.name:T.dasSource.name,L.appendChild(o(h,"text",V,{x:y-(F?20:12),y:(x+A+8)/2,fontSize:"10pt",textAnchor:"end"})),E.setAttribute("height",x-A),S.appendChild(o(h,"g",[k,L])),T.subtiers=T.backupSubtiers,T.originHaxx=T.backupOriginHaxx,T.layoutHeight=T.backupLayoutHeight}if(e.highlights)for(var X=this.highlights||[],K=0;K<X.length;++K){var N=X[K];if((N.chr==this.chr||N.chr=="chr"+this.chr)&&N.min<this.viewEnd&&N.max>this.viewStart){var Z=(Math.max(N.min,this.viewStart)-this.viewStart)*this.scale,Q=(Math.min(N.max,this.viewEnd)-this.viewStart)*this.scale;S.appendChild(o(h,"rect",null,{x:y+Z,y:70,width:Q-Z,height:x-70,stroke:"none",fill:this.defaultHighlightFill,fillOpacity:this.defaultHighlightAlpha}))}}var Y=-1;"center"==e.ruler?Y=y+(this.viewEnd-this.viewStart)*this.scale/2:"left"==e.ruler?Y=y:"right"==e.ruler&&(Y=y+(this.viewEnd-this.viewStart)*this.scale),Y>=0&&S.appendChild(o(h,"line",null,{x1:Y,y1:70,x2:Y,y2:x,stroke:"blue"})),v.appendChild(S),p.documentElement.setAttribute("width",u.featurePanelWidth+20+y),p.documentElement.setAttribute("height",x+50),this.featurePanelWidth=n,this.scale=s;var $=void 0;if("undefined"!=typeof XMLSerializer)$=(new XMLSerializer).serializeToString(p);else{var J=p.documentElement;J.setAttribute("xmlns","http://www.w3.org/2000/svg"),$=J.outerHTML}return e.output&&"string"===e.output?$:new Blob([$],{type:"image/svg+xml"})}},{"./cbrowser":6,"./numformats":30,"./sequence-draw":36,"./svg-utils":45,"./utils":56,"./version":58}],45:[function(e,t,r){"use strict";function i(){this.ops=[]}var n="http://www.w3.org/2000/svg",s="http://www.w3.org/1999/xlink";i.prototype.moveTo=function(e,t){this.ops.push("M "+e+" "+t)},i.prototype.lineTo=function(e,t){this.ops.push("L "+e+" "+t)},i.prototype.closePath=function(){this.ops.push("Z")},i.prototype.toPathData=function(){return this.ops.join(" ")},"undefined"!=typeof t&&(t.exports={NS_SVG:n,NS_XLINK:s,SVGPath:i})},{}],46:[function(e,t,r){"use strict";function i(e){a.call(this),this.readiness="Connecting",this.source=e,this.tabixHolder=new f;var t=this,r=o(e.payload);if(!r)throw"Unsuported tabix payload "+e.payload;this.parser=r;var i,n;this.source.blob?(i=new h(this.source.blob),n=new h(this.source.indexBlob)):(i=new u(this.source.uri,{credentials:this.source.credentials,resolver:this.source.resolver}),n=new u(this.source.indexURI||this.source.uri+".tbi",{credentials:this.source.credentials,resolver:this.source.resolver})),p(i,n,function(e,i){t.tabixHolder.provide(e),e.fetchHeader(function(e,t){if(e){for(var i=r.createSession(function(){}),n=0;n<e.length;++n)i.parse(e[n]);i.flush()}}),t.readiness=null,t.notifyReadiness()})}if("undefined"!=typeof e)var n=e("./sourceadapters"),s=n.registerSourceAdapterFactory,o=n.makeParser,a=n.FeatureSourceBase,l=e("./bin"),u=l.URLFetchable,h=l.BlobFetchable,c=e("./utils"),f=c.Awaited,p=e("./tabix").connectTabix;i.prototype=Object.create(a.prototype),i.prototype.fetch=function(e,t,r,i,n,s,o){var a=this;a.busy++,a.notifyActivity(),this.tabixHolder.await(function(i){i.fetch(e,t,r,function(e,t){a.busy--,a.notifyActivity();for(var r=[],i=a.parser.createSession(function(e){r.push(e)}),n=0;n<e.length;++n){i.parse(e[n])}i.flush(),o(null,r,1e9)})})},i.prototype.getStyleSheet=function(e){this.parser&&this.parser.getStyleSheet&&this.parser.getStyleSheet(e)},i.prototype.getDefaultFIPs=function(e){this.parser&&this.parser.getDefaultFIPs&&this.parser.getDefaultFIPs(e)},s("tabix",function(e){return{features:new i(e)}})},{"./bin":4,"./sourceadapters":39,"./tabix":47,"./utils":56}],47:[function(e,t,r){"use strict";function i(){}function n(e,t,r){var n=new i;n.data=e,n.tbi=t,n.tbi.fetch(function(e){if(!e)return r(null,"Couldn't access Tabix");var t=c(e,e.byteLength),i=new Uint8Array(t),o=l(i,0);if(o!=s)return r(null,"Not a tabix index");var a=l(i,4);n.format=l(i,8),n.colSeq=l(i,12),n.colStart=l(i,16),n.colEnd=l(i,20),n.meta=l(i,24),n.skip=l(i,28);l(i,32);n.indices=[];var u=36;n.chrToIndex={},n.indexToChr=[];for(var f=0;a>f;++f){for(var p="";;){var d=i[u++];if(0==d)break;p+=String.fromCharCode(d)}n.chrToIndex[p]=f,0==p.indexOf("chr")?n.chrToIndex[p.substring(3)]=f:n.chrToIndex["chr"+p]=f,n.indexToChr.push(p)}for(var g=1e9,v=0;a>v;++v){var y=u,m=l(i,u);u+=4;for(var b=0;m>b;++b){var w=(l(i,u),l(i,u+4));u+=8+16*w}var x=l(i,u);u+=4;for(var S=u,f=0;x>f;++f){var _=h(i,S);if(S+=8,_){var T=_.block;_.offset>0&&(T+=65536),g>T&&(g=T);break}}u+=8*x;m>0&&(n.indices[v]=new Uint8Array(t,y,u-y))}n.headerMax=g,r(n)},{timeout:5e4})}var s=21578324;if("undefined"!=typeof e)var o=e("./spans"),a=(o.Range,o.union,o.intersection,e("./bin")),l=a.readInt,u=(a.readShort,a.readByte,a.readInt64,a.readFloat,e("./lh3utils")),h=u.readVob,c=u.unbgzf,f=u.reg2bins,p=u.Chunk;i.prototype.blocksForRange=function(e,t,r){var i=this.indices[e];if(!i)return[];for(var n=f(t,r),s=[],o=0;o<n.length;++o)s[n[o]]=!0;for(var a=[],u=[],c=l(i,0),d=4,g=0;c>g;++g){var v=l(i,d),y=l(i,d+4);if(d+=8,s[v])for(var m=0;y>m;++m){var b=h(i,d,!0),w=h(i,d+8,!0);(4681>v?u:a).push(new p(b,w)),d+=16}else d+=16*y}for(var x=l(i,d),S=null,_=Math.min(t>>14,x-1),T=Math.min(r>>14,x-1),o=_;T>=o;++o){var C=h(i,d+4+8*o);C&&(!S||C.block<S.block||C.offset<S.offset)&&(S=C)}var k=[];if(null!=S)for(var o=0;o<u.length;++o){var L=u[o];L.maxv.block>=S.block&&L.maxv.offset>=S.offset&&k.push(L)}u=k;for(var A=[],o=0;o<u.length;++o)A.push(u[o]);for(var o=0;o<a.length;++o)A.push(a[o]);A.sort(function(e,t){var r=e.minv.block-t.minv.block;return 0!=r?r:e.minv.offset-t.minv.offset});var E=[];if(A.length>0){for(var O=A[0],o=1;o<A.length;++o){var R=A[o];R.minv.block==O.maxv.block?O=new p(O.minv,R.maxv):(E.push(O),O=R)}E.push(O)}return E},i.prototype.fetch=function(e,t,r,i){function n(){if(f>=a.length)return i(h);if(u){var e=new Uint8Array(u);return s.readRecords(e,a[f].minv.offset,h,t,r,l),u=null,++f,n()}var o=a[f],p=o.minv.block,d=o.maxv.block+65536;s.data.slice(p,d-p).fetch(function(e){return u=c(e,o.maxv.block-o.minv.block+1),n()})}var s=this,o=this.chrToIndex[e];if(void 0==o)return i([]);var a,l=this.indexToChr[o];void 0===o?a=[]:(a=this.blocksForRange(o,t,r),a||i(null,"Error in index fetch"));var u,h=[],f=0;n()},i.prototype.readRecords=function(e,t,r,i,n,s){e:for(;;){for(var o="";t<e.length;){var a=e[t++];if(10==a){var l=o.split(" ");if(l[this.colSeq-1]==s){var u=parseInt(l[this.colStart-1]),h=u;this.colEnd>0&&(h=parseInt(l[this.colEnd-1])),65536&this.format&&++u,n>=u&&h>=i&&r.push(o)}continue e}o+=String.fromCharCode(a)}return}},i.prototype.fetchHeader=function(e){var t=this;t.data.slice(0,t.headerMax).fetch(function(r){if(!r)return e(null,"Fetch failed");for(var i=new Uint8Array(c(r,r.byteLength)),n=0,s="",o=[];n<i.length;){var a=i[n++];if(10==a){if(s.charCodeAt(0)!=t.meta)return e(o);o.push(s),s=""}else s+=String.fromCharCode(a)}e(o)})},"undefined"!=typeof t&&(t.exports={connectTabix:n,TABIX_MAGIC:s})},{"./bin":4,"./lh3utils":27,"./spans":41}],48:[function(e,t,r){"use strict";function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t["default"]=e,t}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),l=e("./sourceadapters.js"),u=e("./das.js"),h=e("ramda"),c=i(h),f=function(e){function t(e){n(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.features=c.defaultTo([],e.features),r}return o(t,e),a(t,[{key:"genFeature",value:function(e){var t=new u.DASFeature;for(var r in e)t[r]=e[r]}},{key:"fetch",value:function(e,t,r,i,n,s,o){var a=c.forEach(this.genFeature,this.features);return o(null,a,1)}}]),t}(l.FeatureSourceBase);(0,l.registerSourceAdapterFactory)("test-source",function(e){return{features:new f(e)}})},{"./das.js":11,"./sourceadapters.js":39,ramda:73}],49:[function(e,t,r){"use strict";function i(e){this.genomes={},this.url=e}function n(){}function s(e){this.hub=e}function o(e,t,r){r=r||{},r.salt=!0,u(e,function(n,o){if(o)return t(null,o);var a=n.split(v),l=new i(e);r.credentials&&(l.credentials=r.credentials);for(var c=0;c<a.length-2;c+=3)l[a[c+1]]=a[c+2];if(l.genomesFile){var f=h(e,l.genomesFile);u(f,function(e,i){if(i)return t(null,i);for(var n=e.split(g),o=0;o<n.length;++o){var a=n[o].split(v),u=new s(l);r.credentials&&(u.credentials=r.credentials);for(var c=0;c<a.length-2;c+=3)u[a[c+1]]=a[c+2];u.twoBitPath&&(u.twoBitPath=h(f,u.twoBitPath)),u.genome&&u.trackDb&&(u.absURL=h(f,u.trackDb),l.genomes[u.genome]=u)}t(l)},r)}else t(null,"No genomesFile")},r)}function a(e,t){return e.priority&&t.priority?1*e.priority-1*t.priority:e.priority?1:t.priority?-1:e.shortLabel.localeCompare(t.shortLabel)}if("undefined"!=typeof e)var l=e("./utils"),u=l.textXHR,h=l.relativeURL,c=l.shallowCopy,f=e("./das"),p=f.DASStylesheet,d=f.DASStyle;var g=/\n\s*\n/,v=/(\w+) +(.+)\n?/,y=/subGroup[1-9]/,m="http://genome.ucsc.edu/images/";n.prototype.get=function(e){return this[e]?this[e]:this._parent?this._parent.get(e):void 0},s.prototype.getTracks=function(e){var t=this;return this._tracks?e(this._tracks):void u(this.absURL,function(r,i){if(i)return e(null,i);r=r.replace("\\\n"," ");for(var s=[],o={},a=r.split(g),l=0;l<a.length;++l){var u=a[l].replace(/\#.*/g,"").split(v),h=new n;h._db=t;for(var c=0;c<u.length-2;c+=3){var f=u[c+1],p=u[c+2];if(f.match(y)){h.subgroups||(h.subgroups={});for(var d=p.split(/\s/),m=d[0],b={name:d[1],tags:[],titles:[]},w=2;w<d.length;++w){var x=d[w].split(/=/);b.tags.push(x[0]),b.titles.push(x[1])}h.subgroups[m]=b}else if("subGroups"===f){var d=p.split(/(\w+)=(\w+)/);h.sgm={};for(var w=0;w<d.length-2;w+=3)h.sgm[d[w+1]]=d[w+2]}else h[u[c+1]]=u[c+2]}h.track&&(h.type||h.container||h.view||h.bigDataUrl)&&(s.push(h),o[h.track]=h)}for(var S=[],_=[],T=0;T<s.length;++T){var h=s[T],C=!0;if(h.parent){var k=h.parent.split(/\s+/),L=o[k[0]];L?(h._parent=L,L.children||(L.children=[]),L.children.push(h),L&&(C=!1)):console.log("Couldn't find parent "+k[0]+"("+h.parent+")")}h.compositeTrack?_.push(h):C&&S.push(h)}for(var A=0;A<_.length;++A){var E=_[A];if(E.children){for(var O=!1,R=0;R<E.children.length;++R){var f=E.children[R];f.view&&(f.shortLabel=E.shortLabel+": "+f.shortLabel,S.push(f),O=!0)}O||S.push(E)}}return t._tracks=S,e(t._tracks,null)},{credentials:this.credentials,salt:!0})},n.prototype.toDallianceSource=function(){var e={name:this.shortLabel,desc:this.longLabel};this._db.mapping&&(e.mapping=this._db.mapping);var t=this.get("pennantIcon");if(t){var r=t.split(/\s+/);e.pennant=m+r[0]}var i=this.get("searchTrix");if(i&&(e.trixURI=h(this._db.absURL,i)),"multiWig"==this.container){e.merge="concat",e.overlay=[];var n=this.children||[];e.style=[],e.noDownsample=!0;for(var s=0;s<n.length;++s){var o=n[s],a=o.toDallianceSource();if(e.overlay.push(a),a.style)for(var l=0;l<a.style.length;++l){var u=a.style[l];u.method=o.shortLabel,"transparentOverlay"==this.aggregate&&(u.style.ALPHA=.5),e.style.push(u)}}return e}var c=this.type;if(!c){for(var f=this;f._parent&&!f.type;)f=f._parent;c=f.type}if(c){var p=c.split(/\s+/);if("bigBed"==p[0]&&this.bigDataUrl){var d=0|p[1],g="+"==p[2];return e.bwgURI=h(this._db.absURL,this.bigDataUrl),e.style=this.bigbedStyles(),this._db.credentials&&(e.credentials=!0),d>=12&&g&&(e.collapseSuperGroups=!0),e}return"bigWig"==p[0]&&this.bigDataUrl?(e.bwgURI=h(this._db.absURL,this.bigDataUrl),e.style=this.bigwigStyles(),e.noDownsample=!0,this.yLineOnOff&&"on"==this.yLineOnOff&&(e.quantLeapThreshold=void 0!==this.yLineMark?1*this.yLineMark:0),this._db.credentials&&(e.credentials=!0),e):"bam"==p[0]&&this.bigDataUrl?(e.bamURI=h(this._db.absURL,this.bigDataUrl),this._db.credentials&&(e.credentials=!0),e):"cram"==p[0]&&this.bigDataUrl?(e.cramURI=h(this._db.absURL,this.bigDataUrl),this._db.credentials&&(e.credentials=!0),e):"vcfTabix"==p[0]&&this.bigDataUrl?(e.uri=h(this._db.absURL,this.bigDataUrl),e.tier_type="tabix",e.payload="vcf",this._db.credentials&&(e.credentials=!0),e):void console.log("Unsupported "+this.type)}},n.prototype.bigwigStyles=function(){var e=this.type;if(!e){for(var t=this;t._parent&&!t.type;)t=t._parent;e=t.type}if(e){var r,i,n=e.split(/\s+/);n.length>=3&&(r=1*n[1],i=1*n[2]);var s;if(this.maxHeightPixels){var o=this.maxHeightPixels.split(/:/);3==o.length?s=0|o[1]:console.log("maxHeightPixels should be of the form max:default:min")}var a="bars";this.graphTypeDefault&&(a=this.graphTypeDefault);var l="black",u=null;this.color&&(l="rgb("+this.color+")"),this.altColor&&(u="rgb("+this.altColor+")");var h=new p,c=new d;return"points"==a?c.glyph="POINT":c.glyph="HISTOGRAM",u?(c.COLOR1=l,c.COLOR2=u):c.BGCOLOR=l,c.HEIGHT=s||30,(r||i)&&(c.MIN=r,c.MAX=i),h.pushStyle({type:"default"},null,c),h.styles}},n.prototype.bigbedStyles=function(){var e="on"==(""+this.get("itemRgb")).toLowerCase(),t=this.get("visibility")||"full",r=this.get("color");r=r?"rgb("+r+")":"blue";var i=new p,n=new d;n.glyph="BOX",n.FGCOLOR="black",n.BGCOLOR=r,n.HEIGHT="full"==t||"pack"==t?12:8,n.BUMP="full"==t||"pack"==t,n.LABEL="full"==t||"pack"==t,n.ZINDEX=20,e&&(n.BGITEM=!0);var s=this.get("colorByStrand");if(s){var o=s.split(/\s+/),a=c(n);a.BGCOLOR="rgb("+o[0]+")",i.pushStyle({type:"bigbed",orientation:"+"},null,a);var l=c(n);l.BGCOLOR="rgb("+o[1]+")",i.pushStyle({type:"bigbed",orientation:"-"},null,l)}else i.pushStyle({type:"bigbed"},null,n);var u=new d;u.glyph="BOX",u.FGCOLOR="black",e&&(u.BGITEM=!0),u.BGCOLOR="red",u.HEIGHT=10,u.BUMP=!0,u.ZINDEX=20,i.pushStyle({type:"translation"},null,u);var h=new d;return h.glyph="BOX",h.FGCOLOR="black",h.BGCOLOR="white",h.HEIGHT=10,h.ZINDEX=10,h.BUMP=!0,h.LABEL=!0,i.pushStyle({type:"transcript"},null,h),i.styles},"undefined"!=typeof t&&(t.exports={connectTrackHub:o,THUB_COMPARE:a})},{"./das":11,"./utils":56}],50:[function(e,t,r){"use strict";if("undefined"!=typeof e)var i=e("./cbrowser"),n=i.Browser,s=e("./utils"),o=s.shallowCopy;n.prototype.mergeSelectedTiers=function(){for(var e=[],t=[],r=0;r<this.selectedTiers.length;++r){var i=this.tiers[this.selectedTiers[r]];e.push(o(i.dasSource));for(var n=i.stylesheet.styles,s=0;s<n.length;++s){var a=n[s],l=o(a);l.method=i.dasSource.name.replace(/[()+*?]/g,"\\$&"),l._methodRE=null,l.style=o(a.style),void 0===l.style.ZINDEX&&(l.style.ZINDEX=r),i.forceMin&&(l.style.MIN=i.forceMin),i.forceMax&&(l.style.MAX=i.forceMax),t.push(l)}}this.addTier({name:"Merged",merge:"concat",overlay:e,noDownsample:!0,style:t}),this.setSelectedTier(this.tiers.length-1)}},{"./cbrowser":6,"./utils":56}],51:[function(e,t,r){"use strict";function i(e){for(var t=0;t<e.styles.length;++t){var r=e.styles[t].style;if("__SEQUENCE"===r.glyph)return r}}if("undefined"!=typeof e)var n=e("./cbrowser"),s=n.Browser,o=e("./utils"),a=o.makeElement,l=e("./das"),u=l.isDasBooleanTrue,h=(l.isDasBooleanNotFalse,l.copyStylesheet),c=e("./color"),f=c.dasColourForName,p=e("./sourcecompare").sourceDataURI;var d={DOT:!0,EX:!0,STAR:!0,SQUARE:!0,CROSS:!0,TRIANGLE:!0,PLIMSOLL:!0};s.prototype.openTierPanel=function(e){if("tier"===this.uiMode&&this.manipulatingTier===e)this.hideToolPanel(),this.setUiMode("none");else{if(!e)return;var t=function(e){e.BGGRAD||(1==R?("LINEPLOT"==e.glyph||d[e.glyph]?e.FGCOLOR=S.value:e.BGCOLOR=S.value,e.COLOR1=e.COLOR2=e.COLOR3=null):(e.COLOR1=S.value,e.COLOR2=_.value,R>2?e.COLOR3=T.value:e.COLOR3=null),e._gradient=null,e._plusColor=C.value,e._minusColor=k.value)},r=function(t){for(var r=h(e.stylesheet),i=e.browser.zoomForCurrentScale(),n=0;n<r.styles.length;++n){var s=r.styles[n];s.zoom&&s.zoom!=i||t(s.style)}return r},n=function(i){e.mergeStylesheet(r(t))};this.manipulatingTier=e;var s=a("div",null,{className:"tier-edit"}),o=a("div","About '"+(e.config.Name||e.dasSource.name)+"'",null,{background:"gray",paddingBottom:"5px",marginBottom:"5px",textAlign:"center"});s.appendChild(o);var l=a("div",[a("p",e.dasSource.desc)]),c=[],g=p(e.dasSource);if(!g||0!=g.indexOf("http://")&&0!=g.indexOf("https://")&&0!=g.indexOf("//")||"https://www.biodalliance.org/magic/no_uri"===g||c.push(a("li",a("a","(Download data)",{href:g}))),e.dasSource.mapping){var v=this.chains[e.dasSource.mapping].coords;c.push(a("li","Mapped from "+v.auth+v.version))}c.length>0&&l.appendChild(a("ul",c)),s.appendChild(l);var y=a("span"," (styles for current zoom level)",null,{display:"none"}),m=a("div",["Edit",y],null,{background:"gray",paddingBottom:"5px",marginBottom:"5px",textAlign:"center"});s.appendChild(m);var b=a("input",null,{type:"text"}),w=a("input",null,{type:"checkbox",disabled:this.disablePinning}),x=a("select");x.appendChild(a("option","Histogram",{value:"HISTOGRAM"})),x.appendChild(a("option","Line Plot",{value:"LINEPLOT"})),x.appendChild(a("option","Ribbon",{value:"GRADIENT"})),x.appendChild(a("option","Scatter",{value:"SCATTER"}));var S=a("input",null,{type:"text",value:"#dd00dd"}),_=a("input",null,{type:"text",value:"#dd00dd"}),T=a("input",null,{type:"text",value:"#dd00dd"}),C=a("input",null,{type:"text",value:"#ffa07a"}),k=a("input",null,{type:"text",value:"#87cefa"});try{S.type=_.type=T.type="color",C.type=k.type="color"}catch(L){}var A=[S,_,T],E=a("i",null,{className:"fa fa-plus-circle"}),O=a("i",null,{className:"fa fa-minus-circle"}),R=1,F=a("td",A),M=function(e){R=e;for(var t=0;e>t;++t)A[t].style.display="block";for(var t=e;t<A.length;++t)A[t].style.display="none"};E.addEventListener("click",function(e){3>R&&(M(R+1),n(null))},!1),O.addEventListener("click",function(e){R>1&&(M(R-1),n(null))},!1);var I=a("input",null,{type:"text",value:"0.0"}),B=a("input",null,{type:"text",value:"10.0"}),P=a("input",null,{type:"checkbox"}),D=a("input",null,{type:"checkbox"}),H=a("input",null,{type:"checkbox",checked:void 0!==e.quantLeapThreshold}),N=a("input",null,{type:"text",value:e.quantLeapThreshold,disabled:!H.checked}),G=a("input",null,{type:"text",value:"50"}),q=a("input",null,{type:"checkbox"}),U=a("input",null,{type:"text"}),z=a("input",null,{type:"checkbox"}),j=null;if(e.stylesheet.styles.length>0){j=e.stylesheet.styles[0].style}var W=function(){if("string"==typeof e.config.name?b.value=e.config.name:b.value=e.dasSource.name,w.checked=e.pinned,e.forceHeight?G.value=""+e.forceHeight:j&&j.HEIGHT&&(G.value=""+j.HEIGHT),"number"==typeof e.quantLeapThreshold?(H.checked=!0,N.disabled=!1,parseFloat(N.value)!=e.quantLeapThreshold&&(N.value=e.quantLeapThreshold)):(H.checked=!1,N.disabled=!0),"number"==typeof e.subtierMax?U.value=""+e.subtierMax:U.value=""+(e.dasSource.subtierMax||e.browser.defaultSubtierMax),e.stylesheet.styles.length>0){for(var t=null,r=!1,n=!1,s=e.browser.zoomForCurrentScale(),o=0,a=0;a<e.stylesheet.styles.length;++a){var l=e.stylesheet.styles[a];if(!l.zoom||l.zoom==s){++o;var h=e.stylesheet.styles[a].style;t||(t=j=h),("LINEPLOT"==h.glyph||"HISTOGRAM"==h.glyph||"GRADIENT"==h.glyph||u(h.SCATTER))&&(r||(t=j=h),r=!0)}}if(!t)return;y.style.display=o==e.stylesheet.styles.length?"none":"inline",n=r&&1==o;t.COLOR2||t.BGGRAD;r?(re.style.display="table-row",ie.style.display="table-row",se.style.display="none",oe.style.display="none"):(re.style.display="none",ie.style.display="none",se.style.display="table-row",q.checked=u(j.BUMP),U.disabled=!u(j.BUMP),oe.style.display="table-row",z.checked=u(j.LABEL)),n?($.style.display="table-row",J.style.display="table-row"):($.style.display="none",J.style.display="none");var c=1;t.COLOR1?(S.value=f(t.COLOR1).toHexString(),t.COLOR2&&(_.value=f(t.COLOR2).toHexString(),t.COLOR3?(T.value=f(t.COLOR3).toHexString(),c=3):c=2)):"LINEPLOT"==t.glyph||"DOT"==t.glyph&&t.FGCOLOR?S.value=f(t.FGCOLOR).toHexString():t.BGCOLOR&&(S.value=f(t.BGCOLOR).toHexString()),M(c),t._plusColor&&(C.value=f(t._plusColor).toHexString()||t._plusColor),t._minusColor&&(k.value=f(t._minusColor).toHexString()||t._minusColor),u(t.SCATTER)?x.value="SCATTER":x.value=t.glyph;var p,d;if(void 0!==t.MIN){var g=parseFloat(t.MIN);isNaN(g)||(p=g)}if(e.forceMinDynamic||void 0===t.MIN&&void 0===e.forceMin?(P.checked=!1,I.disabled=!0):(P.checked=!0,I.disabled=!1),void 0!==t.MAX){var g=parseFloat(t.MAX);isNaN(g)||(d=g)}e.forceMaxDynamic||void 0===t.MAX&&void 0===e.forceMax?(D.checked=!1,B.disabled=!0):(D.checked=!0,B.disabled=!1),void 0!=e.forceMin&&(p=e.forceMin),void 0!=e.forceMax&&(d=e.forceMax),"number"==typeof p&&p!=parseFloat(I.value)&&(I.value=p),"number"==typeof d&&d!=parseFloat(B.value)&&(B.value=d);var v=i(e.stylesheet);v?(X.style.display="table-row",V.checked="mismatch"===v.__SEQCOLOR,Z.style.display="table-row",K.checked=u(v.__INSERTIONS),Y.style.display="table-row",Q.checked=void 0===v.__disableQuals||v.__disableQuals===!1,console.log(v.__disableQuals)):(X.style.display="none",Z.style.display="none",Y.style.display="none"),v&&V.checked&&!n?(ee.style.display="table-row",te.style.display="table-row"):(ee.style.display="none",te.style.display="none")}r&&e.browser.sourceAdapterIsCapable(e.featureSource,"quantLeap")?ne.style.display="table-row":ne.style.display="none"},V=a("input",null,{type:"checkbox"}),X=a("tr",[a("th","Highlight mismatches & strands"),a("td",V)]);V.addEventListener("change",function(t){var r=h(e.stylesheet),n=i(r);n.__SEQCOLOR=V.checked?"mismatch":"base",e.mergeStylesheet(r)});var K=a("input",null,{type:"checkbox"}),Z=a("tr",[a("th","Show insertions"),a("td",K)]);K.addEventListener("change",function(t){var r=h(e.stylesheet),n=i(r);n.__INSERTIONS=K.checked?"yes":"no",e.mergeStylesheet(r)});var Q=a("input",null,{type:"checkbox"}),Y=a("tr",[a("th","Reflect base quality as base color transparency"),a("td",Q)]);Q.addEventListener("change",function(t){var r=h(e.stylesheet),n=i(r);n.__disableQuals=!Q.checked,console.log(n.__disableQuals),e.mergeStylesheet(r)});var $=a("tr",[a("th","Style"),a("td",x)]),J=a("tr",[a("th",["Colour(s)",E,O]),F]),ee=a("tr",[a("th","Plus Strand Color"),a("td",C)]),te=a("tr",[a("th","Minus Strand Color"),a("td",k)]),re=a("tr",[a("th","Min value"),a("td",[P," ",I])]),ie=a("tr",[a("th","Max value"),a("td",[D," ",B])]),ne=a("tr",[a("th","Threshold leap:"),a("td",[H," ",N])]),se=a("tr",[a("th","Bump overlaps"),a("td",[q," limit: ",U])]),oe=a("tr",[a("th","Label features"),a("td",z)]),ae=a("table",[a("tr",[a("th","Name",{},{width:"150px",textAlign:"right"}),b]),a("tr",[a("th","Pin to top"),w]),a("tr",[a("th","Height"),a("td",G)]),$,J,ee,te,re,ie,ne,se,oe,X,Z,Y]);W(),s.appendChild(ae);var le=a("button","Reset track",{className:"btn"},{marginLeft:"auto",marginRight:"auto",display:"block"});le.addEventListener("click",function(t){e.setConfig({})},!1),s.appendChild(le),b.addEventListener("input",function(t){e.mergeConfig({name:b.value})},!1),w.addEventListener("change",function(t){e.mergeConfig({pinned:w.checked})},!1);for(var ue=0;ue<A.length;++ue)A[ue].addEventListener("change",n,!1);C.addEventListener("change",n,!1),k.addEventListener("change",n,!1),x.addEventListener("change",function(i){var n=r(function(e){"SCATTER"===x.value?(e.SCATTER=!0,e.glyph="DOT",e.SIZE="3"):(e.glyph=x.value,e.SCATTER=void 0),t(e)});e.mergeStylesheet(n)},!1),P.addEventListener("change",function(t){var r={forceMinDynamic:!P.checked};I.disabled=!P.checked;var i=parseFloat(I.value);P.checked&&"number"==typeof i&&!isNaN(i)&&(r.forceMin=parseFloat(i)),e.mergeConfig(r)}),I.addEventListener("input",function(t){var r=parseFloat(I.value);"number"!=typeof r||isNaN(r)||e.mergeConfig({forceMin:r})},!1),D.addEventListener("change",function(t){var r={forceMaxDynamic:!D.checked};B.disabled=!D.checked;var i=parseFloat(B.value);D.checked&&"number"==typeof i&&!isNaN(i)&&(r.forceMax=parseFloat(i)),e.mergeConfig(r)}),B.addEventListener("input",function(t){var r=parseFloat(B.value);"number"!=typeof r||isNaN(r)||e.mergeConfig({forceMax:r})},!1),G.addEventListener("input",function(t){var r=parseFloat(G.value);"number"!=typeof r||isNaN(r)||e.mergeConfig({height:Math.min(500,0|r)})},!1);var he=function(){if(N.disabled=!H.checked,H.checked){var t=parseFloat(N.value);"number"!=typeof t||isNaN(t)||e.mergeConfig({quantLeapThreshold:parseFloat(N.value)})}else e.mergeConfig({quantLeapThreshold:null})};H.addEventListener("change",function(e){he()},!1),N.addEventListener("input",function(e){he()},!1),z.addEventListener("change",function(t){var i=r(function(e){e.LABEL=z.checked?"yes":"no"});e.mergeStylesheet(i)},!1),q.addEventListener("change",function(t){var i=r(function(e){e.BUMP=q.checked?"yes":"no"});e.mergeStylesheet(i)},!1),U.addEventListener("input",function(t){var r=parseInt(U.value);"number"==typeof r&&r>0&&e.mergeConfig({subtierMax:r})},!1),this.showToolPanel(s),this.setUiMode("tier"),e.addTierListener(W);var ce=e.browser.scale;e.browser.addViewListener(function(){e.browser.scale!=ce&&(ce=e.browser.scale,W())})}}},{"./cbrowser":6,"./color":9,"./das":11,"./sourcecompare":40,"./utils":56}],52:[function(e,t,r){"use strict";function i(e,t,r,i){var n=this;if(this.config=r||{},this.id="tier"+ ++_,this.browser=e,this.dasSource=l(t),this.background=i,this.viewport=o("canvas",null,{width:""+((0|this.browser.featurePanelWidth)+2e3),height:"30",className:"viewport_12_5"},{position:"inline-block",margin:"0px",border:"0px"}),this.viewportHolder=o("div",this.viewport,{className:"viewport-holder_12_5"},{background:i,position:"absolute",padding:"0px",margin:"0px",border:"0px",left:"-1000px",minHeight:"200px"}),this.overlay=o("canvas",null,{width:+(0|this.browser.featurePanelWidth),height:"30",className:"viewport-overlay"}),this.notifier=o("div","",{className:"notifier"}),this.notifierHolder=o("div",this.notifier,{className:"notifier-holder"}),this.quantOverlay=o("canvas",null,{width:"50",height:"56",className:"quant-overlay"}),this.removeButton=o("i",null,{className:"fa fa-times"}),this.bumpButton=o("i",null,{className:"fa fa-plus-circle"}),this.loaderButton=e.makeLoader(16),this.loaderButton.style.display="none",this.infoElement=o("div",this.dasSource.desc,{className:"track-label-info"}),this.nameButton=o("div",[],{className:"tier-tab"}),this.nameButton.appendChild(this.removeButton),t.pennant)this.nameButton.appendChild(o("img",null,{src:t.pennant,width:"16",height:"16"}));else if(t.mapping){var s=null;this.browser.chains[t.mapping]&&(s=this.browser.chains[t.mapping].coords.version),s&&this.nameButton.appendChild(o("span",""+s,null,{fontSize:"8pt",background:"black",color:"white",paddingLeft:"3px",paddingRight:"3px",paddingTop:"1px",paddingBottom:"1px",marginLeft:"2px",borderRadius:"10px"}))}this.nameElement=o("span",t.name),this.nameButton.appendChild(o("span",[this.nameElement,this.infoElement],{className:"track-name-holder"})),this.nameButton.appendChild(this.bumpButton),this.nameButton.appendChild(this.loaderButton),this.label=o("span",[this.nameButton],{className:"btn-group track-label"});var a="tier"+(t.className?" "+t.className:"");this.row=o("div",[this.viewportHolder,this.overlay,this.quantOverlay],{className:a}),i||(this.row.style.background="none"),e.noDefaultLabels||this.row.appendChild(this.label),this.row.appendChild(this.notifierHolder),this.layoutHeight=25,this.bumped=!0,this.styleIdSeed=0,t.quantLeapThreshold&&(this.quantLeapThreshold=t.quantLeapThreshold),
10
- this.dasSource.collapseSuperGroups&&(this.bumped=!1),this.layoutWasDone=!1,t.featureInfoPlugin&&this.addFeatureInfoPlugin(t.featureInfoPlugin),this.initSources();var u=this;this.featureSource&&this.featureSource.getDefaultFIPs&&!t.noSourceFeatureInfo&&this.featureSource.getDefaultFIPs(function(e){e&&u.addFeatureInfoPlugin(e)}),this.featureSource&&this.featureSource.addReadinessListener&&(this.readinessListener=function(e){u.notify(e,-1)},this.featureSource.addReadinessListener(this.readinessListener)),this.featureSource&&this.featureSource.addActivityListener&&(this.activityListener=function(e){e>0?u.loaderButton.style.display="inline-block":u.loaderButton.style.display="none",u.browser.pingActivity()},this.featureSource.addActivityListener(this.activityListener)),this.listeners=[],this.featuresLoadedListeners=[],this.firstRenderPromise=new x(function(e,t){return n._resolveFirstRenderPromise=e})}var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};if("undefined"!=typeof e)var s=e("./utils"),o=s.makeElement,a=s.removeChildren,l=s.shallowCopy,u=(s.pushnew,s.miniJSONify),h=s.arrayIndexOf,c=e("./das"),f=c.DASStylesheet,p=c.DASStyle,d=e("./sha1"),g=d.b64_sha1,v=e("./style"),y=v.StyleFilter,m=v.StyleFilterSet,b=e("./sourcecompare"),w=b.sourceDataURI,x=e("es6-promise").Promise,S=e("./features").sortFeatures;var _=0;if(i.prototype.destroy=function(){this.featureSource.removeReadinessListener&&this.featureSource.removeReadinessListener(this.readinessListener),this.featureSource.removeActivityListener&&this.featureSource.removeActivityListener(this.activityListener)},i.prototype.setBackground=function(e){this.background=e,this.viewportHolder.style.background=e},i.prototype.toString=function(){return this.id},i.prototype.addFeatureInfoPlugin=function(e){this.featureInfoPlugins||(this.featureInfoPlugins=[]),this.featureInfoPlugins.push(e)},i.prototype.init=function(){var e=this;return new x(function(t,r){e.dasSource.style?(e.setStylesheet({styles:e.dasSource.style}),t(e)):(e.status="Fetching stylesheet",e.fetchStylesheet(function(r,i){if(i||!r){e.error="No stylesheet";var r=new f,n=new p;n.glyph="BOX",n.BGCOLOR="blue",n.FGCOLOR="black",r.pushStyle({type:"default"},null,n),e.setStylesheet(r)}else e.setStylesheet(r),r.geneHint&&(e.dasSource.collapseSuperGroups=!0,e.bumped=!1,e.updateLabel()),e._updateFromConfig();t(e)}))})},i.prototype.setStylesheet=function(e){this.baseStylesheet=l(e);for(var t=0;t<this.baseStylesheet.styles.length;++t){var r=this.baseStylesheet.styles[t]=l(this.baseStylesheet.styles[t]);r._methodRE=r._labelRE=r._typeRE=null,r.style=l(r.style),r.style.id="style"+ ++this.styleIdSeed}this.baseStylesheetValidity=g(u(this.baseStylesheet)),this._updateFromConfig()},i.prototype.getSource=function(){return this.featureSource},i.prototype.getDesiredTypes=function(e){var t=this.getActiveStyleFilters(e);return t?t.typeList():void 0},i.prototype.getActiveStyleFilters=function(e){var t=this.browser.zoomForCurrentScale();if(this.stylesheet){for(var r=new m,i=this.stylesheet.styles,n=0;n<i.length;++n){var s=i[n];s.zoom&&s.zoom!=t||r.add(new y(s.type,s.method,s.label))}return r}},i.prototype.needsSequence=function(e){var t=function r(e){return e.bamURI||e.bamBlob||e.bwgURI||e.bwgBlob?!0:e.overlay?e.overlay.some(r):!1};return this.sequenceSource&&5>e?!0:t(this.dasSource)&&20>e?!0:!1},i.prototype.setFeatures=function(e,t,r,i,n){this.currentFeatures=i,this.currentSequence=n,this.knownChr=e,this.knownCoverage=t,i&&(S(this),this.notifyFeaturesLoaded())},i.prototype.draw=function(){console.log("Use browser.getTierRenderer(tier).drawTier(tier)")},i.prototype.findNextFeature=function(e,t,r,i,n){if(this.quantLeapThreshold){var s=this.browser.viewEnd-this.browser.viewStart+1;t=t+s*r/2|0,this.featureSource.quantFindNextFeature(e,t,r,this.quantLeapThreshold,n)}else{if(this.knownCoverage&&t>=this.knownCoverage.min()&&t<=this.knownCoverage.max()&&this.currentFeatures){for(var o=null,a=0;a<this.currentFeatures.length;++a){var l=this.currentFeatures[a];l.min&&l.max&&(l.parents&&l.parents.length>0||(0>r?1==i&&l.max>=t&&l.min<t?(!o||l.min>o.min||l.min==o.min&&l.max<o.max)&&(o=l):l.max<t&&(!o||l.max>o.max||l.max==o.max&&l.min<o.min||l.min==o.mmin&&o.max>=t)&&(o=l):1==i&&l.min<=t&&l.max>t?(!o||l.max<o.max||l.max==o.max&&l.min>o.min)&&(o=l):l.min>t&&(!o||l.min<o.min||l.min==o.min&&l.max>o.max||l.max==o.max&&o.min<=t)&&(o=l)))}if(o)return n(o);t=0>r?this.browser.knownSpace.min:this.browser.knownSpace.max}this.trySourceFNF(e,t,r,n)}},i.prototype.trySourceFNF=function(e,t,r,i){var n=this;this.featureSource.findNextFeature(e,t,r,function(e){e||i(e);var t=n.browser.getSequenceSource();t||i(e),t.getSeqInfo(e.segment,function(t){t?i(e):n.trySourceFNF(e.segment,r>0?1e10:0,r,i)})})},i.prototype.updateLabel=function(){this.bumpButton.className=this.bumped?"fa fa-minus-circle":"fa fa-plus-circle",this.dasSource.collapseSuperGroups?this.bumpButton.style.display="inline-block":this.bumpButton.style.display="none"},i.prototype.updateHeight=function(){this.currentHeight=Math.max(Math.max(this.layoutHeight,this.label.clientHeight+2),this.browser.minTierHeight),this.row.style.height=""+this.currentHeight+"px",this.browser.updateHeight()},i.prototype.drawOverlay=function(){var e=this,t=this.browser,r=t.retina&&window.devicePixelRatio>1;e.overlay.height=e.viewport.height,e.overlay.width=r?2*t.featurePanelWidth:t.featurePanelWidth;var i=e.overlay.getContext("2d");r&&i.scale(2,2);var n=t.viewStart,s=t.viewStart,o=t.viewEnd;if(this.overlayLabelCanvas){var a=(this.glyphCacheOrigin-this.browser.viewStart)*this.browser.scale;i.save(),i.translate(a,0);var l=-a+2;this.dasSource.tierGroup&&(l+=15),this.overlayLabelCanvas.draw(i,l,t.featurePanelWidth-a),i.restore()}for(var u=0;u<t.highlights.length;++u){var h=t.highlights[u];(h.chr===t.chr||h.chr==="chr"+t.chr)&&h.min<o&&h.max>s&&(i.globalAlpha=t.defaultHighlightAlpha,i.fillStyle=t.defaultHighlightFill,i.fillRect((h.min-n)*t.scale,0,(h.max-h.min)*t.scale,e.overlay.height))}e.overlay.style.width=t.featurePanelWidth,e.overlay.style.height=e.viewport.style.height,e.overlay.style.left="0px"},i.prototype.updateStatus=function(e){var t=this;if(e){this.status=e,this._notifierToStatus();w(this.dasSource);"https:"!==window.location.protocol||0!=w(this.dasSource).indexOf("http:")||this.checkedHTTP||(this.checkedHTTP=!0,this.browser.canFetchPlainHTTP().then(function(e){e||(t.warnHTTP=!0,t._notifierToStatus())}))}else this.status&&(this.status=null,this._notifierToStatus())},i.prototype.notify=function(e,t){if("number"!=typeof t&&(t=2e3),this.notifierFadeTimeout&&(clearTimeout(this.notifierFadeTimeout),this.notifierFadeTimeout=null),e){if(this._notifierOn(e),t>0){var r=this;this.notifierFadeTimeout=setTimeout(function(){r._notifierToStatus()},t)}}else this._notifierToStatus()},i.prototype._notifierOn=function(e,t){a(this.notifier),t?this.notifier.appendChild(o("span",[o("a","[HTTP Warning] ",{href:this.browser.httpWarningURL,target:"_blank"}),e])):this.notifier.textContent=e,this.notifier.style.opacity=.8},i.prototype._notifierOff=function(){this.notifier.style.opacity=0},i.prototype._notifierToStatus=function(){this.status?this._notifierOn(this.status,this.warnHTTP):this._notifierOff()},i.prototype.setConfig=function(e){this.config=e||{},this._updateFromConfig(),this.notifyTierListeners()},i.prototype.mergeStylesheet=function(e){this.mergeConfig({stylesheet:e,stylesheetValidity:this.baseStylesheetValidity})},i.prototype.mergeConfig=function(e){for(var t in e)this.config[t]=e[t];this._updateFromConfig(),this.notifyTierListeners()},i.prototype._updateFromConfig=function(){var e=!1,t=!1;"string"==typeof this.config.name?this.nameElement.textContent=this.config.name:this.nameElement.textContent=this.dasSource.name;var r=this.config.height||this.dasSource.forceHeight;r!=this.forceHeight&&(this.forceHeight=r,e=!0),this.forceMinDynamic!=this.config.forceMinDynamic&&(this.forceMinDynamic=this.config.forceMinDynamic,e=!0);var i=void 0!=this.config.forceMin?this.config.forceMin:this.dasSource.forceMin;this.forceMin!=i&&(this.forceMin=i,e=!0),this.forceMaxDynamic!=this.config.forceMaxDynamic&&(this.forceMaxDynamic=this.config.forceMaxDynamic,e=!0);var s=void 0!=this.config.forceMax?this.config.forceMax:this.dasSource.forceMax;this.forceMax!=s&&(this.forceMax=s,e=!0);var o=null;void 0!==this.config.quantLeapThreshold?o=this.config.quantLeapThreshold:void 0!==this.dasSource.quantLeapThreshold&&(o=this.dasSource.quantLeapThreshold),o!=this.quantLeapThreshold&&(this.quantLeapThreshold=o,e=!0);var a=null;this.config.stylesheetValidity==this.baseStylesheetValidity&&(a=this.config.stylesheet),a=a||this.baseStylesheet,this.stylesheet!==a&&(this.stylesheet=a,e=!0);var l=void 0!==this.config.pinned?this.config.pinned:this.dasSource.pinned;l!==this.pinned&&(this.pinned=l,t=!0);var u=n("number"===this.config.subtierMax)?this.config.subtierMax:this.dasSource.subtierMax||this.browser.defaultSubtierMax;u!=this.subtierMax&&(this.subtierMax=u,e=!0);var h;h=void 0!==this.config.bumped?this.config.bumped:void 0!==this.dasSource.bumped?this.dasSource.bumped:this.dasSource.collapseSuperGroups?!1:!0,h!==this.bumped&&(this.bumped=h,e=!0,this.updateLabel()),e&&this.scheduleRedraw(),t&&this.browser.reorderTiers()},i.prototype.scheduleRedraw=function(){if(this.currentFeatures){var e=this;this.redrawTimeout||(this.redrawTimeout=setTimeout(function(){S(e);var t=e.browser.getTierRenderer(e);t.drawTier(e),e.redrawTimeout=null},10))}},i.prototype.clearTierListeners=function(){this.listeners=[]},i.prototype.addTierListener=function(e){this.listeners.push(e)},i.prototype.removeTierListener=function(e){var t=h(this.listeners,e);t>=0&&this.listeners.splice(t,1)},i.prototype.notifyTierListeners=function(e){for(var t=0;t<this.listeners.length;++t)try{this.listeners[t](e)}catch(r){console.log(r)}this.browser.notifyTier()},i.prototype.clearFeaturesLoadedListeners=function(){this.featuresLoadedListeners=[]},i.prototype.addFeaturesLoadedListener=function(e){this.featuresLoadedListeners.push(e)},i.prototype.removeFeaturesLoadedListener=function(e){var t=h(this.featuresLoadedListeners,e);t>=0&&this.featuresLoadedListeners.splice(t,1)},i.prototype.notifyFeaturesLoaded=function(){for(var e=0;e<this.featuresLoadedListeners.length;++e)try{this.featuresLoadedListeners[e].call(this)}catch(t){console.log(t)}},i.prototype.wasRendered=function(){this._resolveFirstRenderPromise()},"undefined"!=typeof t){t.exports={DasTier:i};e("./feature-draw")}},{"./das":11,"./feature-draw":21,"./features":23,"./sha1":38,"./sourcecompare":40,"./style":42,"./utils":56,"es6-promise":60}],53:[function(e,t,r){"use strict";function i(e,t){for(var r=0;r<e.length;++r){var i=e[r];i===t?i.classList.add("active"):i.classList.remove("active")}}if("undefined"!=typeof e)var n=e("./cbrowser"),s=n.Browser,o=e("./sourcecompare"),a=o.sourcesAreEqual,l=e("./utils"),u=l.makeElement,h=l.removeChildren,c=l.Observed,f=e("./thub"),p=f.THUB_COMPARE,d=f.connectTrackHub,g=e("./domui"),v=g.makeTreeTableSection,y=e("./probe").probeResource,m=e("./bin"),b=m.URLFetchable,w=m.BlobFetchable,x=m.readInt,S=e("./lh3utils"),_=S.unbgzf,T=e("./bam"),C=(T.BAM_MAGIC,T.BAI_MAGIC),k=e("./tabix"),L=k.TABIX_MAGIC,A=e("./das"),E=A.DASSource,O=A.DASSegment,R=A.DASRegistry,F=A.coordsMatch,M=e("./encode").EncodeFetchable;s.prototype.currentlyActive=function(e){for(var t=0;t<this.tiers.length;++t)if(a(this.tiers[t].dasSource,e))return this.tiers[t];return!1},s.prototype.makeButton=function(e,t){var r=u("a",e,{href:"#"});return t&&this.makeTooltip(r,t),u("li",r)},s.prototype.showTrackAdder=function(e){function t(e){Se.style.display="none",fe.style.display="none",xe.style.display="none",oe=!1,h(ue);for(var t=0,r=u("div",null,{},{width:"100%"}),i=[],n=0;n<e.length;++n)i.push(e[n]);i.sort(function(e,t){return e.shortLabel.toLowerCase().trim().localeCompare(t.shortLabel.toLowerCase().trim())});for(var s=[],o=[],a=0;a<i.length;++a){var l=i[a];l.children&&l.children.length>0&&"multiWig"!=l.container?s.push(l):o.push(l)}o.length>0&&s.push({shortLabel:"Others",priority:-1e8,children:o}),s.sort(p);for(var c=[],f=0;f<s.length;++f){var d=s[f],g=d;!g.dimensions&&g._parent&&g._parent.dimensions&&(g=g._parent);var y={};if(g.dimensions)for(var m=g.dimensions.split(/(\w+)=(\w+)/),b=0;b<m.length-2;b+=3)y[m[b+1]]=m[b+2];if(y.dimX&&y.dimY){for(var w=y.dimX,x=y.dimY,S=g.subgroups[w],_=g.subgroups[x],T={},C=0;C<d.children.length;++C){var k=d.children[C],L=k.sgm[w],A=k.sgm[x];T[L]||(T[L]={}),T[L][A]=k}var E=u("table",null,{className:"table table-striped table-condensed"},{tableLayout:"fixed"}),O=u("tr");O.appendChild(u("th",null,{},{width:"150px",height:"100px"}));for(var R=0;R<S.titles.length;++R){var F=u("th",u("div",S.titles[R],{},{transform:"rotate(-60deg)",transformOrigin:"0% 100%",webkitTransform:"rotate(-60deg) translate(20px,10px)",webkitTransformOrigin:"0% 100%",textAlign:"left"}),{},{width:"35px",height:"100px",verticalAlign:"bottom"});O.appendChild(F)}E.appendChild(O);for(var M=u("tbody",null,{className:"table table-striped table-condensed"}),B=0;B<_.titles.length;++B){var A=_.tags[B],P=u("tr");P.appendChild(u("th",_.titles[B]),{});for(var D=0;D<S.titles.length;++D){var L=S.tags[D],H=u("td");if(T[L]&&T[L][A]){var l=T[L][A],N=l.toDallianceSource();if(!N)continue;var G=u("tr"),q=u("td");q.style.textAlign="center";var U=u("input");U.type="checkbox",U.dalliance_source=N,he&&(U.dalliance_mapping=he),c.push(U),H.appendChild(U),U.addEventListener("change",function(e){e.target.checked?I.addTier(e.target.dalliance_source):I.removeTier(e.target.dalliance_source)})}P.appendChild(H)}M.appendChild(P)}E.appendChild(M),r.appendChild(v(d.shortLabel,E,0==f))}else{var z=u("tbody",null,{className:"table table-striped table-condensed"}),j=u("table",z,{className:"table table-striped table-condensed"},{width:"100%",tableLayout:"fixed"}),W=0;d.children.sort(p);for(var n=0;n<d.children.length;++n){var V="hb"+ ++t,l=d.children[n],N=l.toDallianceSource();if(N){var G=u("tr"),q=u("td",null,{},{width:"30px"});q.style.textAlign="center";var U=u("input");U.type="checkbox",U.dalliance_source=N,U.id=V,he&&(U.dalliance_mapping=he),c.push(U),q.appendChild(U),U.addEventListener("change",function(e){e.target.checked?I.addTier(e.target.dalliance_source):I.removeTier(e.target.dalliance_source)}),G.appendChild(q);var X=u("label",null,{htmlFor:V});X.appendChild(document.createTextNode(l.shortLabel)),l.longLabel&&l.longLabel.length>0&&I.makeTooltip(X,l.longLabel),G.appendChild(u("td",X)),z.appendChild(G),++W}}s.length>1||"Others"!==d.shortLabel?r.appendChild(v(d.shortLabel,j,0==f)):r.appendChild(j)}}var K=function(){for(var e=0;e<c.length;++e){var t=c[e],r=I.currentlyActive(t.dalliance_source);r?(t.checked=!0,t.disabled=null!=r.sequenceSource):t.checked=!1}};K(),I.addTierListener(function(e){K()}),ue.appendChild(r)}function r(){i(P,K),oe="bin",Se.style.display="none",fe.style.display="inline",xe.style.display="none",h(ue);var e=u("div",null,{},{paddingLeft:"10px",paddingRight:"10px"});e.appendChild(u("h3","Add custom URL-based data")),e.appendChild(u("p",["You can add indexed binary data hosted on an web server that supports CORS (",u("a","full details",{href:"http://www.biodalliance.org/bin.html"}),"). Currently supported formats are bigwig, bigbed, and indexed BAM."])),e.appendChild(u("br")),e.appendChild(document.createTextNode("URL: ")),J=u("input","",{size:80,value:"http://www.biodalliance.org/datasets/ensGene.bb"},{width:"100%"}),e.appendChild(J),e.appendChild(u("br")),e.appendChild(u("b","- or -")),e.appendChild(u("br")),e.appendChild(document.createTextNode("File: ")),ie=u("input",null,{type:"file",multiple:"multiple"}),e.appendChild(ie),e.appendChild(u("p",'Clicking the "Add" button below will initiate a series of test queries.')),ue.appendChild(e),J.focus()}function n(){i(P,Y),Se.style.display="none",fe.style.display="inline",xe.style.display="none",oe="hub-connect",Se.style.visibility="hidden",h(ue);var e=u("div",null,{},{paddingLeft:"10px",paddingRight:"10px"});e.appendChild(u("h3","Connect to a track hub.")),e.appendChild(u("p",['Enter the top-level URL (usually points to a file called "hub.txt") of a UCSC-style track hub'])),J=u("input","",{size:120,value:"http://www.biodalliance.org/datasets/testhub/hub.txt"},{width:"100%"}),e.appendChild(J),ue.appendChild(e),J.focus()}function s(){i(P,X),Se.style.display="none",fe.style.display="inline",xe.style.display="none",oe="das",h(ue);var e=u("div",null,{},{paddingLeft:"10px",paddingRight:"10px"});e.appendChild(u("h3","Add custom DAS data")),e.appendChild(u("p","This interface is intended for adding custom or lab-specific data. Public data can be added more easily via the registry interface.")),e.appendChild(document.createTextNode("URL: ")),e.appendChild(u("br")),J=u("input","",{size:80,value:"http://www.derkholm.net:8080/das/medipseq_reads/"},{width:"100%"}),e.appendChild(J),e.appendChild(u("p",'Clicking the "Add" button below will initiate a series of test queries. If the source is password-protected, you may be prompted to enter credentials.')),ue.appendChild(e),J.focus()}function o(){if(oe){if("das"===oe){var e=J.value.trim();/^.+:\/\//.exec(e)||(e="http://"+e);var t=new E({name:"temporary",uri:e});pe(t)}else if("bin"===oe){var i=ie.files;if(i&&i.length>0)me(i);else{var e=J.value.trim();/^.+:\/\//.exec(e)||(e="http://"+e);var o={uri:e},l=e.toLowerCase();0==l.indexOf("https://www.encodeproject.org/")&&l.indexOf("@@download")>=0&&(o.transport="encode"),ge(o)}}else if("reset"===oe)s();else if("reset-bin"===oe)r();else if("reset-hub"===oe)n();else if("prompt-bai"===oe){var i=ie.files;i&&i.length>0&&i[0]?(ae.baiBlob=i[0],m(ae)):f(ae)}else if("prompt-tbi"===oe){var i=ie.files;i&&i.length>0&&i[0]?(ae.indexBlob=i[0],S(ae)):g(ae)}else if("finalize"===oe||"finalize-bin"===oe){ae.name=ee.value;var u=te.value;"__default__"!=u?ae.mapping=u:ae.mapping=void 0,re&&(ae.maxbins=re.checked),ne.value.length>1&&se.value.length>1&&(ae.xUser=ne.value,ae.xPass=se.value),I.addTier(ae),"finalize-bin"==oe?r():s()}else if("hub-connect"===oe){var e=J.value.trim();/^.+:\/\//.exec(e)||(e="http://"+e),a(e)}else if("multiple"===oe){for(var h=0;h<ye.length;++h){var c=ye[h];if(!c.hidden&&("bam"!=c.tier_type||c.indexBlob||c.indexUri)&&("tabix"!=c.tier_type||c.indexBlob||c.indexUri)){var t=de(c);t&&(t.noPersist=!0,I.addTier(t))}}r()}}else I.removeAllPopups()}function a(e,r,n){r=r||{};for(var s=0;s<I.hubObjects.length;++s){var o=I.hubObjects[s];if(o.hub.url==e){for(var l=0;l<P.length;++l)P[l].hub==o&&i(P,P[l]);return void o.getTracks(function(e,r){r&&console.log(r),t(e)})}}d(e,function(s,o){if(o)return n?(h(ue),ue.appendChild(u("h2","Error connecting to track hub")),ue.appendChild(u("p",o)),void(oe="reset-hub")):a(e,{credentials:!0},!0);var l=null,c=null;for(var f in s.genomes){var p=null,d=!1;if(f==I.coordSystem.ucscName)d=!0;else for(var g in I.chains){var v=I.chains[g];f==v.coords.ucscName&&(p=g,d=!0)}if(d){var y={url:e,genome:f};r.credentials&&(y.credentials=!0),p&&(y.mapping=p,s.genomes[f].mapping=p),I.hubs.push(y),I.hubObjects.push(s.genomes[f]);var m=j(s.genomes[f]);$.appendChild(m),p&&l||(l=s.genomes[f],c=m)}}return l?(I.notifyTier(),i(P,c),l.getTracks(function(e,r){t(e)}),void 0):(h(ue),ue.appendChild(u("h2","No data for this genome")),ue.appendChild(u("p","This URL appears to be a valid track-hub, but it doesn't contain any data for the coordinate system of this browser")),ue.appendChild(u("p","coordSystem.ucscName = "+I.coordSystem.ucscName)),void(oe="reset-hub"))},r)}function l(e,t){function r(){return t?ve(e):l(e,!0)}var i=e.uri;if(t){var n=/(.+)\/[^\/]+\/?/.exec(i);n&&(i=n[1]+"/sources")}new R(i,{credentials:e.credentials}).sources(function(t){if(!t||0==t.length)return r();var i=null;if(1==t.length)i=t[0];else for(var n=0;n<t.length;++n)if(t[n].uri===e.uri){i=t[n];break}var s=!1,o=!1;if(i&&(e.name=i.name,e.desc=i.desc,i.maxbins?e.maxbins=!0:e.maxbins=!1,i.capabilities&&(e.capabilities=i.capabilities),o=!0,i.coords&&1==i.coords.length)){var a=i.coords[0];if(F(a,I.coordSystem))s=!0;else if(I.chains)for(var l in I.chains)F(a,I.chains[l].coords)&&(e.mapping=l,s=!0)}return ve(e,s,o)},function(){return r()})}function f(e){Se.style.display="none",fe.style.display="inline",xe.style.display="inline",h(ue),oe="prompt-bai",ue.appendChild(u("h2","Select an index file")),ue.appendChild(u("p","Dalliance requires a BAM index (.bai) file when displaying BAM data. These normally accompany BAM files. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate BAI file")),ue.appendChild(document.createTextNode("Index file: ")),ie=u("input",null,{type:"file"}),ue.appendChild(ie),ae=e}function g(e){Se.style.display="none",fe.style.display="inline",xe.style.display="inline",h(ue),oe="prompt-tbi",ue.appendChild(u("h2","Select an index file")),ue.appendChild(u("p","Dalliance requires a Tabix index (.tbi) file when displaying VCF data. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate BAI file")),ue.appendChild(document.createTextNode("Index file: ")),ie=u("input",null,{type:"file"}),ue.appendChild(ie),ae=e}function m(e){var t;t=e.baiBlob?new w(e.baiBlob):"encode"==e.transport?new M(e.bamURI+".bai"):new b(e.bamURI+".bai",{credentials:e.credentials}),t.slice(0,256).fetch(function(t){var r=!1;if(t){var i=new Uint8Array(t),n=x(i,0);r=n==C}return r?ve(e,!1,!1,!0):T("You have selected a valid BAM file, but a corresponding index (.bai) file was not found. Please index your BAM (samtools index) and place the BAI file in the same directory")})}function S(e){var t;t=e.indexBlob?new w(e.indexBlob):new b(e.uri+".tbi"),t.slice(0,65536).fetch(function(t){var r=!1;if(t){var i=new Uint8Array(t);if(31==i[0]||139==i[1]){var n=_(t);i=new Uint8Array(n);var s=x(i,0);r=s==L}}return r?ve(e,!1,!1,!0):T('You have selected a valid VCF file, but a corresponding index (.tbi) file was not found. Please index your VCF ("tabix -p vcf -f myfile.vcf.gz") and place the .tbi file in the same directory')})}function T(e){Se.style.display="none",fe.style.display="inline",xe.style.display="inline",h(ue),e=e||"Custom data format not recognized",ue.appendChild(u("h2","Error adding custom data")),ue.appendChild(u("p",e)),ue.appendChild(u("p","Currently supported formats are bigBed, bigWig, and BAM.")),oe="reset-bin"}if("add"===this.uiMode)return this.hideToolPanel(),void this.setUiMode("none");var k,A,I=this,B=u("div",null,{className:"dalliance"},{width:"100%",display:"inline-block",boxSizing:"border-box",MozBoxSizing:"border-box",verticalAlign:"top",paddingRight:"15px"}),P=[];if(!this.noRegistryTabs){var D=this.makeButton("Registry","Browse compatible datasources from the DAS registry");P.push(D);for(var H in this.mappableSources){var N=function(e){var t=I.makeButton(I.chains[e].srcTag,"Browse datasources mapped from "+I.chains[e].srcTag);P.push(t),t.addEventListener("click",function(r){r.preventDefault(),r.stopPropagation(),i(P,t),k(I.mappableSources[e],e)},!1)};N(H)}}for(var G={},q=0;q<this.defaultSources.length;++q){var U=this.defaultSources[q],z=U.group||"Defaults";G[z]?G[z].push(U):G[z]=[U]}var j=function(e){var r=e.hub,s=u("i",null,{className:"fa fa-list-alt"},{cursor:"context-menu"}),o=r.altLabel||r.shortLabel||"Unknown";e.mapping&&(o=o+" ("+e.genome+")");var a=u("span",[o," ",s]),l=I.makeButton(a,r.longLabel);return l.hub=e,P.push(l),l.addEventListener("click",function(r){r.preventDefault(),r.stopPropagation(),i(P,l),h(ue);var n=I.makeLoader(24);n.style.marginLeft="auto",n.style.marginRight="auto",n.style.marginTop="100px",ue.appendChild(u("div",n,null,{textAlign:"center"})),Se.style.display="none",fe.style.display="none",xe.style.display="none",e.getTracks(function(e,r){r&&console.log(r),t(e)})},!1),s.addEventListener("click",function(t){t.preventDefault(),t.stopPropagation();var r=u("li",u("a","Remove hub")),s=u("li",u("a","Enable all")),o=u("li",u("a","Disable all")),a=u("ul",[r,s,o],{className:"dropdown-menu"},{display:"block"}),h=t.clientX,c=t.clientY;h+=document.documentElement.scrollLeft||document.body.scrollLeft,c+=document.documentElement.scrollTop||document.body.scrollTop,a.style.position="absolute",a.style.top=""+(c+10)+"px",a.style.left=""+(h-30)+"px",I.hPopupHolder.appendChild(a);var f=function p(e){console.log("cc"),document.body.removeEventListener("click",p,!0),I.hPopupHolder.removeChild(a)};document.body.addEventListener("click",f,!0),r.addEventListener("click",function(t){for(var r=0;r<I.hubObjects.length;++r)if(I.hubObjects[r].absURL==e.absURL){I.hubObjects.splice(r,1);break}for(var r=0;r<I.hubs.length;++r){var s=I.hubs[r];if("string"==typeof s&&(s={url:s}),s.url==e.hub.url&&!s.genome||s.genome==e.genome){I.hubs.splice(r,1);break}}I.notifyTier(),$.removeChild(l),i(P,Y),n()},!1),s.addEventListener("click",function(t){e.getTracks(function(e,t){t&&console.log(t);for(var r=0;r<e.length;++r){var i=e[r].toDallianceSource();I.currentlyActive(i)||I.addTier(i)}})},!1),o.addEventListener("click",function(t){e.getTracks(function(e,t){t&&console.log(t);for(var r=0;r<e.length;++r){var i=e[r].toDallianceSource();I.currentlyActive(i)&&I.removeTier(i)}})},!1)},!1),l},W=null,V=null;for(var z in G)!function(e,t){var r=I.makeButton(e,"Browse the default set of data for this browser");r.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),i(P,r),k(new c(t))},!1),P.push(r),(!W||I.defaultTrackAdderTab&&I.defaultTrackAdderTab==e)&&(W=r,V=t)}(z,G[z]);var X=this.makeButton("DAS","Add data using the DAS protocol");P.push(X);var K=this.makeButton("Files","Add data from files on disk or the web");P.push(K);for(var Z=0;Z<this.hubObjects.length;++Z){var Q=this.hubObjects[Z];j(Q)}var Y=this.makeButton("+","Connect to a new track-hub");P.push(Y);var $=u("ul",P,{className:"nav nav-tabs"},{marginBottom:"0px"});B.appendChild($);var J,ee,te,re,ie,ne,se,oe=!1,ae=null,le=u("form",null,{},{display:"inline-block",width:"100%"});le.addEventListener("submit",function(e){return e.stopPropagation(),e.preventDefault(),o(),!1},!0);var ue=u("div");ue.style.position="relative",ue.style.overflow="scroll",le.appendChild(ue);var he,ce;k=function(e,t){Se.style.display="none",fe.style.display="none",xe.style.display="none",ce&&ce.removeListener(A),he=t,ce=e,ce.addListenerAndFire(A)},A=function(e){oe=!1;var t=[];if(h(ue),!e)return void ue.appendChild(u("p","Dalliance was unable to retrieve data source information from the DAS registry, please try again later"));for(var r=u("tbody",null,{className:"table table-striped table-condensed"},{width:"100%"}),i=u("table",r,{className:"table table-striped table-condensed"},{width:"100%",tableLayout:"fixed"}),n=0,s=[],o=0;o<e.length;++o)s.push(e[o]);s.sort(function(e,t){return e.name.toLowerCase().trim().localeCompare(t.name.toLowerCase().trim())});for(var o=0;o<s.length;++o){var a=s[o],l=u("tr"),c=u("td",null,{},{width:"30px"});if(c.style.textAlign="center",!a.props||a.props.cors){var f=u("input");f.type="checkbox",f.dalliance_source=a,f.id="sourcecb"+o,he&&(f.dalliance_mapping=he),c.appendChild(f),t.push(f),f.addEventListener("change",function(e){e.target.checked?I.addTier(e.target.dalliance_source):I.removeTier(e.target.dalliance_source)})}else c.appendChild(document.createTextNode("!")),I.makeTooltip(c,u("span",["This data source isn't accessible because it doesn't support ",u("a","CORS",{href:"http://www.w3.org/TR/cors/"}),"."]));l.appendChild(c);var p=u("label",null,{htmlFor:"sourcecb"+o});p.appendChild(document.createTextNode(a.name)),a.desc&&a.desc.length>0&&I.makeTooltip(p,a.desc),l.appendChild(u("td",p)),r.appendChild(l),++n}var d=function(){for(var e=0;e<t.length;++e){var r=t[e],i=I.currentlyActive(r.dalliance_source);i?r.checked=!0:r.checked=!1}};d(),I.addTierListener(function(e){d()}),ue.appendChild(i)},D&&D.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),i(P,D),k(I.availableSources)},!1),K.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),r()},!1),Y.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n()},!1),X.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),s()},!1);var fe=u("button","Add",{className:"btn btn-primary"});fe.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),o()},!1);var pe=function Te(e,t){var r=I.knownSpace;if(!r)return void alert("Can't confirm track-addition to an uninit browser.");var i=0|Math.max(r.min,(r.min+r.max-100)/2),n=new O(r.chr,i,Math.min(i+99,r.max));e.features(n,{},function(r,i){if(!i){var n=new RegExp("/([^/]+)/?$"),s=n.exec(e.uri);return s&&(e.name=s[1]),void l(e)}return t?(h(ue),ue.appendChild(u("h2","Custom data not found")),ue.appendChild(u("p","DAS uri: "+e.uri+" is not answering features requests")),void(oe="reset")):(e.credentials=!0,void Te(e,!0))})},de=function(e){var t={name:e.name};return e.credentials&&(t.credentials=e.credentials),e.mapping&&"__default__"!=e.mapping&&(t.mapping=e.mapping),e.transport&&(t.transport=e.transport),"bwg"==e.tier_type?(e.blob?t.bwgBlob=e.blob:e.uri&&(t.bwgURI=e.uri),t):"bam"==e.tier_type?(e.blob?(t.bamBlob=e.blob,t.baiBlob=e.indexBlob):(t.bamURI=e.uri,t.baiURI=e.indexUri),t):"tabix"==e.tier_type?(t.tier_type="tabix",t.payload=e.payload,e.blob?(t.blob=e.blob,t.indexBlob=e.indexBlob):(t.uri=e.uri,t.indexUri=e.indexUri),t):"memstore"==e.tier_type?(t.tier_type="memstore",t.payload=e.payload,e.blob?t.blob=e.blob:t.uri=e.uri,t):void 0},ge=function(e){y(e,function(e,t){if(!t){var r=de(e);return"bam"==e.tier_type?m(r):"tabix"==e.tier_type?S(r):ve(r,!1,!1,!0)}h(ue);var i=u("div");i.appendChild(u("h2","Couldn't access custom data")),i.appendChild(u("p",""+t)),ue.appendChild(i),console.log(e),"https:"===window.location.protocol&&0==e.uri.indexOf("http:")&&I.canFetchPlainHTTP().then(function(e){e||i.appendChild(u("p",[u("strong","HTTP warning: "),"you may not be able to access HTTP resources from an instance of Biodalliance which you are accessing via HTTPS.",u("a","[More info]",{href:I.httpWarningURL,target:"_blank"})]))}),oe="reset-bin"})},ve=function(e,t,r,i){if(Se.style.display="none",fe.style.display="inline",xe.style.display="inline",h(ue),ue.appendChild(u("h2","Add custom data: step 2")),ue.appendChild(document.createTextNode("Label: ")),ee=u("input","",{value:e.name}),ue.appendChild(ee),ne=u("input",""),se=u("input",""),ue.appendChild(u("br")),ue.appendChild(u("br")),ue.appendChild(u("h4","Coordinate system: ")),te=u("select",null),te.appendChild(u("option",I.nameForCoordSystem(I.coordSystem),{value:"__default__"})),I.chains)for(var n in I.chains){var s=I.chains[n].coords;te.appendChild(u("option",I.nameForCoordSystem(s),{value:n}))}te.value=e.mapping||"__default__",ue.appendChild(te),t?ue.appendChild(u("p","(Based on server response, probably doesn't need changing.)")):(ue.appendChild(u("p",[u("b","Warning: "),"unable to determine the correct value from server responses. Please check carefully."])),ue.appendChild(u("p","If you don't see the mapping you're looking for, please contact thomas@biodalliance.org"))),i||(ue.appendChild(document.createTextNode("Quantitative: ")),re=u("input",null,{type:"checkbox",checked:!0}),"undefined"!=typeof e.maxbins&&(re.checked=e.maxbins),ue.appendChild(re),r?ue.appendChild(u("p","(Based on server response, probably doesn't need changing.)")):ue.appendChild(u("p",[u("b","Warning: "),"unable to determine correct value. If in doubt, leave checked."]))),e.bwgBlob&&ue.appendChild(u("p",[u("b","Warning: "),"data added from local file. Due to the browser security model, the track will disappear if you reload Dalliance."])),ee.focus(),oe="bin"===oe||"prompt-bai"===oe||"prompt-tbi"===oe?"finalize-bin":"finalize",ae=e},ye=null,me=function(e){
11
- var t=ye=[];oe="multiple";for(var r=0;r<e.length;++r){var i=e[r];i&&t.push({blob:i})}for(var r=0;r<t.length;++r)be(t[r]);we()},be=function(e){y(e,function(e,t){t&&(e.error=t);for(var r=[],i={},n={},s=0;s<ye.length;++s){var o=ye[s];"bam"!=o.tier_type||o.indexBlob||(i[o.blob.name]=o),"tabix"!=o.tier_type||o.indexBlob||(n[o.blob.name]=o)}for(var s=0;s<ye.length;++s){var o=ye[s];if("bai"===o.tier_type){var a=new RegExp("(.+)\\.bai$"),l=a.exec(o.blob.name);l&&i[l[1]]&&(i[l[1]].indexBlob=o.blob,r.push(s))}else if("tabix-index"===o.tier_type){var u=new RegExp("(.+)\\.tbi$"),l=u.exec(o.blob.name);l&&n[l[1]]&&(n[l[1]].indexBlob=o.blob,r.push(s))}}for(var h=r.length-1;h>=0;--h)ye.splice(r[h],1);we()})},we=function(){h(ue);var e=!1,t=u("table",ye.filter(function(e){return!e.hidden}).map(function(t){var r=u("tr");r.appendChild(u("td",t.name||t.blob.name));var i;i=t.error?u("span","Error",null,{color:"red"}):t.tier_type?t.payload||t.tier_type:I.makeLoader(16);var n,s="unknown";if("bwg"==t.tier_type||"memstore"==t.tier_type?s="okay":"bam"==t.tier_type?s=t.indexBlob?"okay":"needs-index":"tabix"==t.tier_type&&(s=t.indexBlob?"okay":"needs-index"),"okay"==s){if(n=u("select",null,null,{width:"150px"}),n.appendChild(u("option",I.nameForCoordSystem(I.coordSystem),{value:"__default__"})),I.chains)for(var o in I.chains){var a=I.chains[o].coords;n.appendChild(u("option",I.nameForCoordSystem(a),{value:o}))}n.value=t.mapping||"__default__",n.addEventListener("change",function(e){t.mapping=n.value,console.log(t)},!1)}else"needs-index"==s&&(n=u("span","Needs index",{},{color:"red"}),e=!0);return u("tr",[u("td",t.name||t.blob.name),u("td",i),u("td",n)])}),{className:"table table-striped table-condensed"});if(ue.appendChild(t),e){ue.appendChild(u("p","Some of these files are missing required index (.bai or .tbi) files. For security reasons, web applications like Dalliance can only access local files which you have explicity selected. Please use the file chooser below to select the appropriate index file")),ue.appendChild(document.createTextNode("Index file(s): "));var r=u("input",null,{type:"file",multiple:"multiple"});ue.appendChild(r),r.addEventListener("change",function(e){console.log("fileset changed");for(var t=r.files||[],i=0;i<t.length;++i){var n=t[i];if(n){var s={blob:n,hidden:!0};ye.push(s),be(s)}}},!1)}},xe=u("button","Cancel",{className:"btn"});xe.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),"finalize-bin"===oe?r():s()},!1);var Se=u("button","Refresh",{className:"btn"});Se.addEventListener("click",function(e){e.stopPropagation(),e.preventDefault(),I.queryRegistry(he)},!1),this.makeTooltip(Se,"Click to re-fetch data from the DAS registry");var _e=u("div",[fe," ",xe," ",Se]);_e.style.margin="10px",le.appendChild(_e),B.appendChild(le),k(I.availableSources),this.showToolPanel(B),this.setUiMode("add"),W&&(i(P,W),k(new c(V)))}},{"./bam":1,"./bin":4,"./cbrowser":6,"./das":11,"./domui":13,"./encode":15,"./lh3utils":27,"./probe":32,"./sourcecompare":40,"./tabix":47,"./thub":49,"./utils":56}],54:[function(e,t,r){"use strict";function i(e,t,r){t.fetchAsText(function(t){if(!t)return r(null,"Couldn't fetch index-index");for(var i=t.split(/(.+)([0-9A-F]{10})\n/),s=[],o=[],a=1;a<i.length;a+=3)s.push(i[a]),o.push(parseInt(i[a+1],16));return r(new n(s,o,e))})}function n(e,t,r){this.keys=e,this.offsets=t,this.ix=r}n.prototype.lookup=function(e,t){for(var r,i=(e+" ").substring(0,5).toLowerCase(),n=0;n<this.keys.length;++n)if(i.localeCompare(this.keys[n])<0){r=this.ix.slice(this.offsets[n-1],this.offsets[n]-this.offsets[n-1]);break}r||(r=this.ix.slice(this.offsets[this.offsets.length-1])),r.fetchAsText(function(r){for(var i=r.split("\n"),n=0;n<i.length;++n)if(0==i[n].indexOf(e.toLowerCase()+" "))return t(i[n].split(" "));return t(null)})},"undefined"!=typeof t&&(t.exports={connectTrix:i})},{}],55:[function(e,t,r){"use strict";function i(){}function n(e,t){var r=new i;r.data=e;var n=g,o=0;r.data.slice(0,n).fetch(function(e){if(!e)return t(null,"Couldn't access data");var i=new Uint8Array(e),u=a(i,0);if(u==p)r.readInt=a;else{if(u!=d)return t(null,"Not a .2bit file, magic=0x"+u.toString(16));r.readInt=l}var h=r.readInt(i,4);if(0!=h)return t(null,"Unsupported version "+h);r.seqCount=r.readInt(i,8),r.seqDict={};var c=16,f=0,v=0,y=function m(){for(;f<r.seqCount;){var e=i[c];if(c+e+6>=i.length)return o+=n,n=Math.max(g,Math.floor(o*r.seqCount/f)),r.data.slice(v+c,n).fetch(function(e){v+=c,c=0,i=new Uint8Array(e),m()});++c;for(var a="",l=1;e>=l;++l)a+=String.fromCharCode(i[c++]);var u=r.readInt(i,c);c+=4,r.seqDict[a]=new s(r,u),++f}return t(r)};y()})}function s(e,t){this.tbf=e,this.offset=t}if("undefined"!=typeof e)var o=e("./bin"),a=o.readInt,l=o.readIntBE,u=e("./spans"),h=u.Range,c=u.union,f=u.intersection;var p=440477507,d=1126646042,g=12500;i.prototype.getSeq=function(e){var t=this.seqDict[e];return t||(t=this.seqDict["chr"+e]),t},i.prototype.fetch=function(e,t,r,i){var n=this.getSeq(e);return n?t>=r?i(""):void n.fetch(t,r,i):i(null,"Couldn't find "+e)},s.prototype.init=function(e){if(this.seqOffset)return e();var t=this;t.tbf.data.slice(t.offset,8).fetch(function(r){if(!r)return e("Fetch failed");var i=new Uint8Array(r);t._length=t.tbf.readInt(i,0),t.nBlockCnt=t.tbf.readInt(i,4),t.tbf.data.slice(t.offset+8,8*t.nBlockCnt+4).fetch(function(r){if(!r)return e("Fetch failed");for(var i=new Uint8Array(r),n=null,s=0;s<t.nBlockCnt;++s){var o=t.tbf.readInt(i,4*s),a=t.tbf.readInt(i,4*(s+t.nBlockCnt)),l=new h(o,o+a-1);n=n?c(n,l):l}return t.nBlocks=n,t.mBlockCnt=t.tbf.readInt(i,8*t.nBlockCnt),t.seqLength=(t._length+3)/4|0,t.seqOffset=t.offset+16+8*(t.nBlockCnt+t.mBlockCnt),e()})})};var v=["T","C","A","G"];s.prototype.fetch=function(e,t,r){--e,--t;var i=this;this.init(function(n){if(n)return r(null,n);var s=e>>2,o=t+3>>2;return 0>s||o>i.seqLength?r("Coordinates out of bounds: "+e+":"+t):void i.tbf.data.slice(i.seqOffset+s,o-s).salted().fetch(function(n){function o(e){for(;e>=p;){var t,r=(p>>2)-s,i=3&p,n=a[r];t=0==i?n>>6&3:1==i?n>>4&3:2==i?n>>2&3:3&n,c+=v[t],++p}}if(null==n)return r("SeqFetch failed");var a=new Uint8Array(n),l=[];if(i.nBlocks){var u=f(new h(e,t),i.nBlocks);u&&(l=u.ranges())}for(var c="",p=e,d=0;d<l.length;++d){var g=l[d];if(p>g.min())throw"N mismatch...";for(p<g.min()&&o(g.min()-1);p<=g.max();)c+="N",++p}return t>=p&&o(t),r(c)})})},s.prototype.length=function(e){var t=this;this.init(function(r){return r?e(null,r):e(t._length)})},"undefined"!=typeof t&&(t.exports={makeTwoBit:n})},{"./bin":4,"./spans":41}],56:[function(e,t,r){"use strict";function i(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return;e.push(t)}function n(e,t,r){e[t]?e[t].push(r):e[t]=[r]}function s(e,t,r){var i=e[t];if(i){for(var n=0;n<i.length;++n)if(i[n]==r)return;i.push(r)}else e[t]=[r]}function o(e,t,r,i){return e?e:t?t:r?r:i?i:void 0}function i(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return;e.push(t)}function a(e,t){if(!e)return-1;for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}function l(e,t){var r=a(e,t);return r>=0?(e.splice(r,1),!0):!1}function u(e,t,r,i){var n=document.createElement(e);if(t){t instanceof Array||(t=[t]);for(var s=0;s<t.length;++s){var o=t[s];o&&("string"==typeof o?o=document.createTextNode(o):"number"==typeof o&&(o=document.createTextNode(""+o)),n.appendChild(o))}}if(r)for(var a in r)try{n[a]=r[a]}catch(l){throw console.log("error setting "+a),l}if(i)for(var a in i)n.style[a]=i[a];return n}function h(e,t,r,i){var n=document.createElementNS(e,t);if(r){r instanceof Array||(r=[r]);for(var s=0;s<r.length;++s){var o=r[s];"string"==typeof o&&(o=document.createTextNode(o)),n.appendChild(o)}}return f(n,i),n}function c(e,t,r){var i=C[t];if(!i){for(var n="",s=0;s<t.length;++s){var o=t.substring(s,s+1),a=o.toLowerCase();a!=o?n=n+"-"+a:n+=o}C[t]=n,i=n}e.setAttribute(i,r)}function f(e,t){if(t)for(var r in t)c(e,r,t[r])}function p(e){if(e&&e.childNodes)for(;e.childNodes.length>0;)e.removeChild(e.firstChild)}function d(e,t){if("undefined"==typeof e)return"undefined";if(null==e)return"null";if("string"==typeof e)return"'"+e+"'";if("number"==typeof e)return""+e;if("boolean"==typeof e)return""+e;if("object"==("undefined"==typeof e?"undefined":S(e))){if(e instanceof Array){for(var r=null,i=0;i<e.length;++i)r=(null==r?"":r+", ")+d(e[i],t);return"["+(r?r:"")+"]"}t=t||{};var r=null;for(var n in e)t[n]||void 0!=n&&"function"!=typeof e[n]&&(r=(null==r?"":r+", ")+n+": "+d(e[n],t));return"{"+(r?r:"")+"}"}return"undefined"==typeof e?"undefined":S(e)}function g(e){var t={};for(var r in e)t[r]=e[r];return t}function v(e){this.value=e,this.listeners=[]}function y(){this.queue=[]}function m(e){return e+"?salt="+T(""+Date.now()+","+ ++k)}function b(e,t,r){r&&r.salt&&(e=m(e));try{var i;r&&r.timeout&&(i=setTimeout(function(){return console.log("timing out "+e),n.abort(),t(null,"Timeout")},r.timeout));var n=new XMLHttpRequest;n.onreadystatechange=function(){4==n.readyState&&(i&&clearTimeout(i),n.status<200||n.status>=300?t(null,"Error code "+n.status):t(n.responseText))},n.open("GET",e,!0),n.responseType="text",r&&r.credentials&&(n.withCredentials=!0),n.send()}catch(s){t(null,"Exception "+s)}}function w(e,t){if(0==t.indexOf("http:")||0==t.indexOf("https:"))return t;var r=e.lastIndexOf("/");return r>=0?e.substr(0,r+1)+t:t}function x(e){return u("a",null,{href:e}).href}var S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};if("undefined"!=typeof e)var _=e("./sha1"),T=_.b64_sha1;var C=(new RegExp("[0-9]+"),new RegExp("^[0-9]+$"),{});v.prototype.addListener=function(e){this.listeners.push(e)},v.prototype.addListenerAndFire=function(e){this.listeners.push(e),e(this.value)},v.prototype.removeListener=function(e){l(this.listeners,e)},v.prototype.get=function(){return this.value},v.prototype.set=function(e){this.value=e;for(var t=0;t<this.listeners.length;++t)this.listeners[t](e)},y.prototype.provide=function(e){if(void 0!==this.res)throw"Resource has already been provided.";this.res=e;for(var t=0;t<this.queue.length;++t)this.queue[t](e);this.queue=null},y.prototype.await=function(e){return void 0!==this.res?(e(this.res),this.res):void this.queue.push(e)};var k=0,L={TTT:"F",TTC:"F",TTA:"L",TTG:"L",CTT:"L",CTC:"L",CTA:"L",CTG:"L",ATT:"I",ATC:"I",ATA:"I",ATG:"M",GTT:"V",GTC:"V",GTA:"V",GTG:"V",TCT:"S",TCC:"S",TCA:"S",TCG:"S",CCT:"P",CCC:"P",CCA:"P",CCG:"P",ACT:"T",ACC:"T",ACA:"T",ACG:"T",GCT:"A",GCC:"A",GCA:"A",GCG:"A",TAT:"Y",TAC:"Y",TAA:"*",TAG:"*",CAT:"H",CAC:"H",CAA:"Q",CAG:"Q",AAT:"N",AAC:"N",AAA:"K",AAG:"K",GAT:"D",GAC:"D",GAA:"E",GAG:"E",TGT:"C",TGC:"C",TGA:"*",TGG:"W",CGT:"R",CGC:"R",CGA:"R",CGG:"R",AGT:"S",AGC:"S",AGA:"R",AGG:"R",GGT:"G",GGC:"G",GGA:"G",GGG:"G"};"trim"in String.prototype||(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),"undefined"!=typeof t&&(t.exports={textXHR:b,relativeURL:w,resolveUrlToPage:x,shallowCopy:g,pusho:n,pushnew:i,pushnewo:s,arrayIndexOf:a,pick:o,makeElement:u,makeElementNS:h,removeChildren:p,miniJSONify:d,Observed:v,Awaited:y,AMINO_ACID_TRANSLATION:L})},{"./sha1":38}],57:[function(e,t,r){"use strict";function i(){this.info=[]}function n(e,t){this.parser=e,this.sink=t}if("undefined"!=typeof e)var s=e("./sourceadapters"),o=s.registerParserFactory,a=e("./das"),l=a.DASStylesheet,u=a.DASStyle,h=a.DASFeature,c=(a.DASGroup,e("revalidator"));var f=/([^;=]+)(=([^;]+))?;?/,p=/##INFO=<([^>]+)>/,d=/([^,=]+)=([^,]+|"[^"]+"),?/;i.prototype.createSession=function(e){return new n(this,e)},n.prototype.parse=function(e){if(0!=e.length)if("#"!=e[0]){var t=e.split(" "),r=new h;r.segment=t[0],r.id=t[2],r.refAllele=t[3],r.altAlleles=t[4].split(","),r.min=parseInt(t[1]),r.max=r.min+r.refAllele.length-1;var i=t[7].split(f);r.info={};for(var n=0;n<i.length;n+=4)r.info[i[n+1]]=i[n+3];var s=r.altAlleles[0],o=r.refAllele;s.length>o.length?(r.type="insertion",0==s.indexOf(o)?(r.insertion=s.substr(o.length),r.min+=o.length,r.max=r.min-1):r.insertion=s):s.length<o.length?r.type="deletion":r.type="substitution",this.sink(r)}else if(e.length>1&&"#"==e[1]){var a=p.exec(e);if(a){for(var t=a[1].split(d),l=null,u=null,n=0;n<t.length-1;n+=3){var c=t[n+1],g=t[n+2].replace(/"/g,"");"ID"==c?l=g:"Description"==c&&(u=g)}l&&u&&this.parser.info.push({id:l,desc:u})}return}},n.prototype.flush=function(){},n.prototype.schema={properties:{segment:{description:"the name of the region containing the variation",type:"string",required:!0},min:{description:"the start position",type:"integer",minimum:1,required:!0},max:{description:"the end position",type:"integer",required:!0},id:{description:"identifier of variant",type:"string",required:!0},refAllele:{description:"reference allele",type:"string",required:!0},altAlleles:{description:"list of alternate alleles",type:"array",items:{type:"string"},required:!0},info:{description:"info",type:"object",required:!0},type:{description:"type of variation",type:"string","enum":["insertion","deletion","substitution"],required:!0},insertion:{description:"the actual insertion",type:"string"}}},n.prototype.validate=function(e){var t=c.validate(e,this.schema);t.valid?this.sink(e):console.log(t.errors)},i.prototype.getStyleSheet=function(e){var t=new l,r=new u;r.glyph="__INSERTION",r.BUMP="yes",r.LABEL="no",r.FGCOLOR="rgb(50,80,255)",r.BGCOLOR="#888888",r.STROKECOLOR="black",t.pushStyle({type:"insertion"},null,r);var r=new u;r.glyph="PLIMSOLL",r.BUMP="yes",r.LABEL="no",r.FGCOLOR="rgb(255, 60, 60)",r.BGCOLOR="#888888",r.STROKECOLOR="black",t.pushStyle({type:"deletion"},null,r);var r=new u;return r.glyph="PLIMSOLL",r.BUMP="yes",r.LABEL="no",r.FGCOLOR="rgb(50,80,255)",r.BGCOLOR="#888888",r.STROKECOLOR="black",t.pushStyle({type:"default"},null,r),e(t)},i.prototype.getDefaultFIPs=function(e){var t=this,r=function(e,r){if(r.add("Ref. allele",e.refAllele),r.add("Alt. alleles",e.altAlleles.join(",")),e.info)for(var i=0;i<t.info.length;++i){var n=t.info[i],s=e.info[n.id];void 0!==s&&r.add(n.desc,s)}};e(r)},o("vcf",function(){return new i})},{"./das":11,"./sourceadapters":39,revalidator:74}],58:[function(e,t,r){"use strict";var i={CONFIG:5,MAJOR:0,MINOR:13,MICRO:7,BRANCH:"dev"};i.toString=function(){var e=""+this.MAJOR+"."+this.MINOR+"."+this.MICRO;return this.PATCH&&(e+=this.PATCH),this.BRANCH&&""!=this.BRANCH&&(e=e+"-"+this.BRANCH),e},"undefined"!=typeof t&&(t.exports=i)},{}],59:[function(e,t,r){"use strict";function i(e){function t(e){e=Math.min(e,n),e=Math.max(e,i),l=e,f.style.left=""+l+"px"}function r(e){e=Math.min(e,n),e=Math.max(e,i),u=e,p.style.left=""+u+"px"}e=e||{};var i=0,n=e.width||200,o=0,a=200,l=50,u=100,h=[],c=s("hr",null,{className:"slider-track"},{width:""+(0|n)+"px"}),f=s("hr",null,{className:"slider-thumb active"}),p=s("hr",null,{className:"slider-thumb"}),d=s("div",[c,f,p],{className:"slider"},{width:""+((0|n)+10)+"px"});d.removeLabels=function(){for(var e=0;e<h.length;++e)d.removeChild(h[e]);h=[]},d.addLabel=function(e,t){var r=s("div",t,{className:"slider-label"},{left:""+(i+(e-o)*(n-i)/(a-o)|0)+"px"});d.appendChild(r),h.push(r)};var g=document.createEvent("HTMLEvents");g.initEvent("change",!0,!1),Object.defineProperty(d,"value",{get:function(){return o+(l-i)*(a-o)/(n-i)},set:function(e){var r=i+(e-o)*(n-i)/(a-o);t(r)}}),Object.defineProperty(d,"value2",{get:function(){return o+(u-i)*(a-o)/(n-i)},set:function(e){var t=i+(e-o)*(n-i)/(a-o);r(t)}}),Object.defineProperty(d,"active",{get:function(){return f.classList.contains("active")?1:2},set:function(e){1==e?(f.classList.add("active"),p.classList.remove("active")):(p.classList.add("active"),f.classList.remove("active"))}}),Object.defineProperty(d,"min",{get:function(){return o},set:function(e){o=e}}),Object.defineProperty(d,"max",{get:function(){return a},set:function(e){a=e}});var v,y,m=function(e){y=this==f?1:2,y!=d.active&&(d.active=y,d.dispatchEvent(g)),e.stopPropagation(),e.preventDefault(),window.addEventListener("mousemove",b,!1),window.addEventListener("mouseup",w,!1),v=e.clientX-(1==y?l:u)};f.addEventListener("mousedown",m,!1),p.addEventListener("mousedown",m,!1);var b=function(e){1==y?t(e.clientX-v):r(e.clientX-v),d.dispatchEvent(g)},w=function x(e){window.removeEventListener("mousemove",b,!1),window.removeEventListener("mouseup",x,!1)};return d}if("undefined"!=typeof e)var n=e("./utils"),s=n.makeElement;"undefined"!=typeof t&&(t.exports=i)},{"./utils":56}],60:[function(e,t,r){"use strict";var i=e("./promise/promise").Promise,n=e("./promise/polyfill").polyfill;r.Promise=i,r.polyfill=n},{"./promise/polyfill":65,"./promise/promise":66}],61:[function(e,t,r){"use strict";function i(e){var t=this;if(!n(e))throw new TypeError("You must pass an array to all.");return new t(function(t,r){function i(e){return function(t){n(e,t)}}function n(e,r){a[e]=r,0===--l&&t(a)}var o,a=[],l=e.length;0===l&&t([]);for(var u=0;u<e.length;u++)o=e[u],o&&s(o.then)?o.then(i(u),r):n(u,o)})}var n=e("./utils").isArray,s=e("./utils").isFunction;r.all=i},{"./utils":70}],62:[function(e,t,r){(function(e,t){"use strict";function i(){return function(){e.nextTick(o)}}function n(){var e=0,t=new h(o),r=document.createTextNode("");return t.observe(r,{characterData:!0}),function(){r.data=e=++e%2}}function s(){return function(){c.setTimeout(o,1)}}function o(){for(var e=0;e<f.length;e++){var t=f[e],r=t[0],i=t[1];r(i)}f=[]}function a(e,t){var r=f.push([e,t]);1===r&&l()}var l,u="undefined"!=typeof window?window:{},h=u.MutationObserver||u.WebKitMutationObserver,c="undefined"!=typeof t?t:void 0===this?window:this,f=[];l="undefined"!=typeof e&&"[object process]"==={}.toString.call(e)?i():h?n():s(),r.asap=a}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:72}],63:[function(e,t,r){"use strict";function i(e){if(e&&"object"==typeof e&&e.constructor===this)return e;var t=this;return new t(function(t){t(e)})}r.cast=i},{}],64:[function(e,t,r){"use strict";function i(e,t){return 2!==arguments.length?n[e]:void(n[e]=t)}var n={instrument:!1};r.config=n,r.configure=i},{}],65:[function(e,t,r){(function(t){"use strict";function i(){var e;e="undefined"!=typeof t?t:"undefined"!=typeof window&&window.document?window:self;var r="Promise"in e&&"cast"in e.Promise&&"resolve"in e.Promise&&"reject"in e.Promise&&"all"in e.Promise&&"race"in e.Promise&&function(){var t;return new e.Promise(function(e){t=e}),s(t)}();r||(e.Promise=n)}var n=e("./promise").Promise,s=e("./utils").isFunction;r.polyfill=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./promise":66,"./utils":70}],66:[function(e,t,r){"use strict";function i(e){if(!v(e))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof i))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");this._subscribers=[],n(e,this)}function n(e,t){function r(e){u(t,e)}function i(e){c(t,e)}try{e(r,i)}catch(n){i(n)}}function s(e,t,r,i){var n,s,o,a,h=v(r);if(h)try{n=r(i),o=!0}catch(f){a=!0,s=f}else n=i,o=!0;l(t,n)||(h&&o?u(t,n):a?c(t,s):e===C?u(t,n):e===k&&c(t,n))}function o(e,t,r,i){var n=e._subscribers,s=n.length;n[s]=t,n[s+C]=r,n[s+k]=i}function a(e,t){for(var r,i,n=e._subscribers,o=e._detail,a=0;a<n.length;a+=3)r=n[a],i=n[a+t],s(t,r,i,o);e._subscribers=null}function l(e,t){var r,i=null;try{if(e===t)throw new TypeError("A promises callback cannot return that same promise.");if(g(t)&&(i=t.then,v(i)))return i.call(t,function(i){return r?!0:(r=!0,void(t!==i?u(e,i):h(e,i)))},function(t){return r?!0:(r=!0,void c(e,t))}),!0}catch(n){return r?!0:(c(e,n),!0)}return!1}function u(e,t){e===t?h(e,t):l(e,t)||h(e,t)}function h(e,t){e._state===_&&(e._state=T,e._detail=t,d.async(f,e))}function c(e,t){e._state===_&&(e._state=T,e._detail=t,d.async(p,e))}function f(e){a(e,e._state=C)}function p(e){a(e,e._state=k)}var d=e("./config").config,g=(e("./config").configure,e("./utils").objectOrFunction),v=e("./utils").isFunction,y=(e("./utils").now,e("./cast").cast),m=e("./all").all,b=e("./race").race,w=e("./resolve").resolve,x=e("./reject").reject,S=e("./asap").asap;d.async=S;var _=void 0,T=0,C=1,k=2;i.prototype={constructor:i,_state:void 0,_detail:void 0,_subscribers:void 0,then:function(e,t){var r=this,i=new this.constructor(function(){});if(this._state){var n=arguments;d.async(function(){s(r._state,i,n[r._state-1],r._detail)})}else o(this,i,e,t);return i},"catch":function(e){return this.then(null,e)}},i.all=m,i.cast=y,i.race=b,i.resolve=w,i.reject=x,r.Promise=i},{"./all":61,"./asap":62,"./cast":63,"./config":64,"./race":67,"./reject":68,"./resolve":69,"./utils":70}],67:[function(e,t,r){"use strict";function i(e){var t=this;if(!n(e))throw new TypeError("You must pass an array to race.");return new t(function(t,r){for(var i,n=0;n<e.length;n++)i=e[n],i&&"function"==typeof i.then?i.then(t,r):t(i)})}var n=e("./utils").isArray;r.race=i},{"./utils":70}],68:[function(e,t,r){"use strict";function i(e){var t=this;return new t(function(t,r){r(e)})}r.reject=i},{}],69:[function(e,t,r){"use strict";function i(e){var t=this;return new t(function(t,r){t(e)})}r.resolve=i},{}],70:[function(e,t,r){"use strict";function i(e){return n(e)||"object"==typeof e&&null!==e}function n(e){return"function"==typeof e}function s(e){return"[object Array]"===Object.prototype.toString.call(e)}var o=Date.now||function(){return(new Date).getTime()};r.objectOrFunction=i,r.isFunction=n,r.isArray=s,r.now=o},{}],71:[function(e,t,r){function i(){}function n(){this.was=[0]}function s(e,t,r){this.hufts=new Int32Array(3*g),this.window=new Uint8Array(r),this.end=r,this.checkfn=t,this.mode=z,this.reset(e,null),this.left=0,this.table=0,this.index=0,this.blens=null,this.bb=new Int32Array(1),this.tb=new Int32Array(1),this.codes=new o,this.last=0,this.bitk=0,this.bitb=0,this.read=0,this.write=0,this.check=0,this.inftree=new a}function o(){}function a(){}function l(e,t,r,i,n){return e[0]=J,t[0]=ee,r[0]=te,i[0]=re,x}function u(e,t,r,i,n){if(0!=n){if(!e)throw"Undef src";if(!r)throw"Undef dest";0==t&&n==e.length?c(e,r,i):we?c(e.subarray(t,t+n),r,i):1==e.BYTES_PER_ELEMENT&&n>100?c(new Uint8Array(e.buffer,e.byteOffset+t,n),r,i):h(e,t,r,i,n)}}function h(e,t,r,i,n){for(var s=0;n>s;++s)r[i+s]=e[t+s]}function c(e,t,r){t.set(e,r)}function f(e,t,r,n){e=t?r?new Uint8Array(e,t,r):new Uint8Array(e,t,e.byteLength-t):new Uint8Array(e);var s=new i;s.inflateInit(d,!0),s.next_in=e,s.next_in_index=0,s.avail_in=e.length;for(var o=[],a=0;;){var l=new Uint8Array(32e3);s.next_out=l,s.next_out_index=0,s.avail_out=l.length;var h=s.inflate(m);if(h!=x&&h!=S&&h!=L)throw s.msg;if(0!=s.avail_out){var c=new Uint8Array(l.length-s.avail_out);u(l,0,c,0,l.length-s.avail_out),l=c}if(o.push(l),a+=l.length,h==S||h==L)break}if(n&&(n[0]=(t||0)+s.next_in_index),1==o.length)return o[0].buffer;for(var f=new Uint8Array(a),p=0,g=0;g<o.length;++g){var v=o[g];u(v,0,f,p,v.length),p+=v.length}return f.buffer}var p=15,d=p,g=1440,v=15,y=32,m=0,b=4,w=8,x=0,S=1,_=2,T=-2,C=-3,k=-4,L=-5,A=0,E=1,O=2,R=3,F=4,M=5,I=6,B=7,P=8,D=9,H=10,N=11,G=12,q=13,U=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],z=0,j=1,W=2,V=3,X=4,K=5,Z=6,Q=7,Y=8,$=9,J=9,ee=5,te=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],re=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],ie=[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],ne=[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,112,112],se=[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],oe=[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];i.prototype.inflateInit=function(e,t){return e||(e=d),t&&(t=!1),this.istate=new n,this.istate.inflateInit(this,t?-e:e)},i.prototype.inflate=function(e){return null==this.istate?T:this.istate.inflate(this,e)},i.prototype.inflateEnd=function(){if(null==this.istate)return T;var e=istate.inflateEnd(this);return this.istate=null,e},i.prototype.inflateSync=function(){return istate.inflateSync(this)},i.prototype.inflateSetDictionary=function(e,t){return istate.inflateSetDictionary(this,e,t)},n.prototype.inflateReset=function(e){return null==e||null==e.istate?T:(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=0!=e.istate.nowrap?B:A,e.istate.blocks.reset(e,null),x)},n.prototype.inflateEnd=function(e){return null!=this.blocks&&this.blocks.free(e),this.blocks=null,x},n.prototype.inflateInit=function(e,t){return e.msg=null,this.blocks=null,nowrap=0,0>t&&(t=-t,nowrap=1),8>t||t>15?(this.inflateEnd(e),T):(this.wbits=t,e.istate.blocks=new s(e,0!=e.istate.nowrap?null:this,1<<t),this.inflateReset(e),x)},n.prototype.inflate=function(e,t){var r,i;if(null==e||null==e.istate||null==e.next_in)return T;for(t=t==b?L:x,r=L;;)switch(e.istate.mode){case A:if(0==e.avail_in)return r;if(r=t,e.avail_in--,e.total_in++,(15&(e.istate.method=e.next_in[e.next_in_index++]))!=w){e.istate.mode=q,e.msg="unknown compression method",e.istate.marker=5;break}if((e.istate.method>>4)+8>e.istate.wbits){e.istate.mode=q,e.msg="invalid window size",e.istate.marker=5;break}e.istate.mode=E;case E:if(0==e.avail_in)return r;if(r=t,e.avail_in--,e.total_in++,i=255&e.next_in[e.next_in_index++],((e.istate.method<<8)+i)%31!=0){e.istate.mode=q,e.msg="incorrect header check",e.istate.marker=5;break}if(0==(i&y)){e.istate.mode=B;break}e.istate.mode=O;case O:if(0==e.avail_in)return r;r=t,e.avail_in--,e.total_in++,e.istate.need=(255&e.next_in[e.next_in_index++])<<24&4278190080,e.istate.mode=R;case R:if(0==e.avail_in)return r;r=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.next_in[e.next_in_index++])<<16&16711680,e.istate.mode=F;case F:if(0==e.avail_in)return r;r=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.next_in[e.next_in_index++])<<8&65280,e.istate.mode=M;case M:return 0==e.avail_in?r:(r=t,e.avail_in--,e.total_in++,e.istate.need+=255&e.next_in[e.next_in_index++],e.adler=e.istate.need,e.istate.mode=I,_);case I:return e.istate.mode=q,e.msg="need dictionary",e.istate.marker=0,T;case B:if(r=e.istate.blocks.proc(e,r),r==C){e.istate.mode=q,e.istate.marker=0;break}if(r==x&&(r=t),r!=S)return r;if(r=t,e.istate.blocks.reset(e,e.istate.was),0!=e.istate.nowrap){e.istate.mode=G;break}e.istate.mode=P;case P:if(0==e.avail_in)return r;r=t,e.avail_in--,e.total_in++,e.istate.need=(255&e.next_in[e.next_in_index++])<<24&4278190080,e.istate.mode=D;case D:if(0==e.avail_in)return r;r=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.next_in[e.next_in_index++])<<16&16711680,e.istate.mode=H;case H:if(0==e.avail_in)return r;r=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.next_in[e.next_in_index++])<<8&65280,e.istate.mode=N;case N:if(0==e.avail_in)return r;if(r=t,e.avail_in--,e.total_in++,e.istate.need+=255&e.next_in[e.next_in_index++],e.istate.was[0]!=e.istate.need){e.istate.mode=q,e.msg="incorrect data check",e.istate.marker=5;break}e.istate.mode=G;case G:return S;case q:return C;default:return T}},n.prototype.inflateSetDictionary=function(e,t,r){var i=0,n=r;return null==e||null==e.istate||e.istate.mode!=I?T:e._adler.adler32(1,t,0,r)!=e.adler?C:(e.adler=e._adler.adler32(0,null,0,0),n>=1<<e.istate.wbits&&(n=(1<<e.istate.wbits)-1,i=r-n),e.istate.blocks.set_dictionary(t,i,n),e.istate.mode=B,x)};var ae=[0,0,255,255];n.prototype.inflateSync=function(e){var t,r,i,n,s;if(null==e||null==e.istate)return T;if(e.istate.mode!=q&&(e.istate.mode=q,e.istate.marker=0),0==(t=e.avail_in))return L;for(r=e.next_in_index,i=e.istate.marker;0!=t&&4>i;)e.next_in[r]==ae[i]?i++:i=0!=e.next_in[r]?0:4-i,r++,t--;return e.total_in+=r-e.next_in_index,e.next_in_index=r,e.avail_in=t,e.istate.marker=i,4!=i?C:(n=e.total_in,s=e.total_out,this.inflateReset(e),e.total_in=n,e.total_out=s,e.istate.mode=B,x)},n.prototype.inflateSyncPoint=function(e){return null==e||null==e.istate||null==e.istate.blocks?T:e.istate.blocks.sync_point();
12
- };var le=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];s.prototype.reset=function(e,t){t&&(t[0]=this.check),this.mode==Z&&this.codes.free(e),this.mode=z,this.bitk=0,this.bitb=0,this.read=this.write=0,this.checkfn&&(e.adler=this.check=e._adler.adler32(0,null,0,0))},s.prototype.proc=function(e,t){var r,i,n,s,o,a,h;for(s=e.next_in_index,o=e.avail_in,i=this.bitb,n=this.bitk,a=this.write,h=a<this.read?this.read-a-1:this.end-a;;)switch(this.mode){case z:for(;3>n;){if(0==o)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);t=x,o--,i|=(255&e.next_in[s++])<<n,n+=8}switch(r=7&i,this.last=1&r,r>>>1){case 0:i>>>=3,n-=3,r=7&n,i>>>=r,n-=r,this.mode=j;break;case 1:var c=new Int32Array(1),f=new Int32Array(1),p=[],d=[];l(c,f,p,d,e),this.codes.init(c[0],f[0],p[0],0,d[0],0,e),i>>>=3,n-=3,this.mode=Z;break;case 2:i>>>=3,n-=3,this.mode=V;break;case 3:return i>>>=3,n-=3,this.mode=q,e.msg="invalid block type",t=C,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t)}break;case j:for(;32>n;){if(0==o)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);t=x,o--,i|=(255&e.next_in[s++])<<n,n+=8}if((~i>>>16&65535)!=(65535&i))return this.mode=q,e.msg="invalid stored block lengths",t=C,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);this.left=65535&i,i=n=0,this.mode=0!=this.left?W:0!=this.last?Q:z;break;case W:if(0==o)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,write=a,this.inflate_flush(e,t);if(0==h&&(a==end&&0!=read&&(a=0,h=a<this.read?this.read-a-1:this.end-a),0==h&&(this.write=a,t=this.inflate_flush(e,t),a=this.write,h=a<this.read?this.read-a-1:this.end-a,a==this.end&&0!=this.read&&(a=0,h=a<this.read?this.read-a-1:this.end-a),0==h)))return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);if(t=x,r=this.left,r>o&&(r=o),r>h&&(r=h),u(e.next_in,s,this.window,a,r),s+=r,o-=r,a+=r,h-=r,0!=(this.left-=r))break;this.mode=0!=this.last?Q:z;break;case V:for(;14>n;){if(0==o)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);t=x,o--,i|=(255&e.next_in[s++])<<n,n+=8}if(this.table=r=16383&i,(31&r)>29||(r>>5&31)>29)return this.mode=$,e.msg="too many length or distance symbols",t=C,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);if(r=258+(31&r)+(r>>5&31),null==this.blens||this.blens.length<r)this.blens=new Int32Array(r);else for(var g=0;r>g;g++)this.blens[g]=0;i>>>=14,n-=14,this.index=0,mode=X;case X:for(;this.index<4+(this.table>>>10);){for(;3>n;){if(0==o)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);t=x,o--,i|=(255&e.next_in[s++])<<n,n+=8}this.blens[le[this.index++]]=7&i,i>>>=3,n-=3}for(;this.index<19;)this.blens[le[this.index++]]=0;if(this.bb[0]=7,r=this.inftree.inflate_trees_bits(this.blens,this.bb,this.tb,this.hufts,e),r!=x)return t=r,t==C&&(this.blens=null,this.mode=$),this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,write=a,this.inflate_flush(e,t);this.index=0,this.mode=K;case K:for(;;){if(r=this.table,!(this.index<258+(31&r)+(r>>5&31)))break;var g,v,y;for(r=this.bb[0];r>n;){if(0==o)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);t=x,o--,i|=(255&e.next_in[s++])<<n,n+=8}if(r=this.hufts[3*(this.tb[0]+(i&U[r]))+1],y=this.hufts[3*(this.tb[0]+(i&U[r]))+2],16>y)i>>>=r,n-=r,this.blens[this.index++]=y;else{for(g=18==y?7:y-14,v=18==y?11:3;r+g>n;){if(0==o)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);t=x,o--,i|=(255&e.next_in[s++])<<n,n+=8}if(i>>>=r,n-=r,v+=i&U[g],i>>>=g,n-=g,g=this.index,r=this.table,g+v>258+(31&r)+(r>>5&31)||16==y&&1>g)return this.blens=null,this.mode=$,e.msg="invalid bit length repeat",t=C,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);y=16==y?this.blens[g-1]:0;do this.blens[g++]=y;while(0!=--v);this.index=g}}this.tb[0]=-1;var c=new Int32Array(1),f=new Int32Array(1),p=new Int32Array(1),d=new Int32Array(1);if(c[0]=9,f[0]=6,r=this.table,r=this.inftree.inflate_trees_dynamic(257+(31&r),1+(r>>5&31),this.blens,c,f,p,d,this.hufts,e),r!=x)return r==C&&(this.blens=null,this.mode=q),t=r,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);this.codes.init(c[0],f[0],this.hufts,p[0],this.hufts,d[0],e),this.mode=Z;case Z:if(this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,(t=this.codes.proc(this,e,t))!=S)return this.inflate_flush(e,t);if(t=x,this.codes.free(e),s=e.next_in_index,o=e.avail_in,i=this.bitb,n=this.bitk,a=this.write,h=a<this.read?this.read-a-1:this.end-a,0==this.last){this.mode=z;break}this.mode=Q;case Q:if(this.write=a,t=this.inflate_flush(e,t),a=this.write,h=a<this.read?this.read-a-1:this.end-a,this.read!=this.write)return this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);mode=G;case Y:return t=S,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);case $:return t=C,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t);default:return t=T,this.bitb=i,this.bitk=n,e.avail_in=o,e.total_in+=s-e.next_in_index,e.next_in_index=s,this.write=a,this.inflate_flush(e,t)}},s.prototype.free=function(e){this.reset(e,null),this.window=null,this.hufts=null},s.prototype.set_dictionary=function(e,t,r){u(e,t,window,0,r),this.read=this.write=r},s.prototype.sync_point=function(){return this.mode==j},s.prototype.inflate_flush=function(e,t){var r,i,n;return i=e.next_out_index,n=this.read,r=(n<=this.write?this.write:this.end)-n,r>e.avail_out&&(r=e.avail_out),0!=r&&t==L&&(t=x),e.avail_out-=r,e.total_out+=r,null!=this.checkfn&&(e.adler=this.check=e._adler.adler32(this.check,this.window,n,r)),u(this.window,n,e.next_out,i,r),i+=r,n+=r,n==this.end&&(n=0,this.write==this.end&&(this.write=0),r=this.write-n,r>e.avail_out&&(r=e.avail_out),0!=r&&t==L&&(t=x),e.avail_out-=r,e.total_out+=r,null!=this.checkfn&&(e.adler=this.check=e._adler.adler32(this.check,this.window,n,r)),u(this.window,n,e.next_out,i,r),i+=r,n+=r),e.next_out_index=i,this.read=n,t};var ue=0,he=1,ce=2,fe=3,pe=4,de=5,ge=6,ve=7,ye=8,me=9;o.prototype.init=function(e,t,r,i,n,s,o){this.mode=ue,this.lbits=e,this.dbits=t,this.ltree=r,this.ltree_index=i,this.dtree=n,this.dtree_index=s,this.tree=null},o.prototype.proc=function(e,t,r){var i,n,s,o,a,l,u,h=0,c=0,f=0;for(f=t.next_in_index,o=t.avail_in,h=e.bitb,c=e.bitk,a=e.write,l=a<e.read?e.read-a-1:e.end-a;;)switch(this.mode){case ue:if(l>=258&&o>=10&&(e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,r=this.inflate_fast(this.lbits,this.dbits,this.ltree,this.ltree_index,this.dtree,this.dtree_index,e,t),f=t.next_in_index,o=t.avail_in,h=e.bitb,c=e.bitk,a=e.write,l=a<e.read?e.read-a-1:e.end-a,r!=x)){this.mode=r==S?ve:me;break}this.need=this.lbits,this.tree=this.ltree,this.tree_index=this.ltree_index,this.mode=he;case he:for(i=this.need;i>c;){if(0==o)return e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);r=x,o--,h|=(255&t.next_in[f++])<<c,c+=8}if(n=3*(this.tree_index+(h&U[i])),h>>>=this.tree[n+1],c-=this.tree[n+1],s=this.tree[n],0==s){this.lit=this.tree[n+2],this.mode=ge;break}if(0!=(16&s)){this.get=15&s,this.len=this.tree[n+2],this.mode=ce;break}if(0==(64&s)){this.need=s,this.tree_index=n/3+this.tree[n+2];break}if(0!=(32&s)){this.mode=ve;break}return this.mode=me,t.msg="invalid literal/length code",r=C,e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);case ce:for(i=this.get;i>c;){if(0==o)return e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);r=x,o--,h|=(255&t.next_in[f++])<<c,c+=8}this.len+=h&U[i],h>>=i,c-=i,this.need=this.dbits,this.tree=this.dtree,this.tree_index=this.dtree_index,this.mode=fe;case fe:for(i=this.need;i>c;){if(0==o)return e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);r=x,o--,h|=(255&t.next_in[f++])<<c,c+=8}if(n=3*(this.tree_index+(h&U[i])),h>>=this.tree[n+1],c-=this.tree[n+1],s=this.tree[n],0!=(16&s)){this.get=15&s,this.dist=this.tree[n+2],this.mode=pe;break}if(0==(64&s)){this.need=s,this.tree_index=n/3+this.tree[n+2];break}return this.mode=me,t.msg="invalid distance code",r=C,e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);case pe:for(i=this.get;i>c;){if(0==o)return e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);r=x,o--,h|=(255&t.next_in[f++])<<c,c+=8}this.dist+=h&U[i],h>>=i,c-=i,this.mode=de;case de:for(u=a-this.dist;0>u;)u+=e.end;for(;0!=this.len;){if(0==l&&(a==e.end&&0!=e.read&&(a=0,l=a<e.read?e.read-a-1:e.end-a),0==l&&(e.write=a,r=e.inflate_flush(t,r),a=e.write,l=a<e.read?e.read-a-1:e.end-a,a==e.end&&0!=e.read&&(a=0,l=a<e.read?e.read-a-1:e.end-a),0==l)))return e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);e.window[a++]=e.window[u++],l--,u==e.end&&(u=0),this.len--}this.mode=ue;break;case ge:if(0==l&&(a==e.end&&0!=e.read&&(a=0,l=a<e.read?e.read-a-1:e.end-a),0==l&&(e.write=a,r=e.inflate_flush(t,r),a=e.write,l=a<e.read?e.read-a-1:e.end-a,a==e.end&&0!=e.read&&(a=0,l=a<e.read?e.read-a-1:e.end-a),0==l)))return e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);r=x,e.window[a++]=this.lit,l--,this.mode=ue;break;case ve:if(c>7&&(c-=8,o++,f--),e.write=a,r=e.inflate_flush(t,r),a=e.write,l=a<e.read?e.read-a-1:e.end-a,e.read!=e.write)return e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);this.mode=ye;case ye:return r=S,e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);case me:return r=C,e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r);default:return r=T,e.bitb=h,e.bitk=c,t.avail_in=o,t.total_in+=f-t.next_in_index,t.next_in_index=f,e.write=a,e.inflate_flush(t,r)}},o.prototype.free=function(e){},o.prototype.inflate_fast=function(e,t,r,i,n,s,o,a){var l,h,c,f,p,d,g,v,y,m,b,w,_,T,k,L;g=a.next_in_index,v=a.avail_in,p=o.bitb,d=o.bitk,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=U[e],w=U[t];do{for(;20>d;)v--,p|=(255&a.next_in[g++])<<d,d+=8;if(l=p&b,h=r,c=i,L=3*(c+l),0!=(f=h[L]))for(;;){if(p>>=h[L+1],d-=h[L+1],0!=(16&f)){for(f&=15,_=h[L+2]+(p&U[f]),p>>=f,d-=f;15>d;)v--,p|=(255&a.next_in[g++])<<d,d+=8;for(l=p&w,h=n,c=s,L=3*(c+l),f=h[L];;){if(p>>=h[L+1],d-=h[L+1],0!=(16&f)){for(f&=15;f>d;)v--,p|=(255&a.next_in[g++])<<d,d+=8;if(T=h[L+2]+(p&U[f]),p>>=f,d-=f,m-=_,y>=T)k=y-T,y-k>0&&2>y-k?(o.window[y++]=o.window[k++],o.window[y++]=o.window[k++],_-=2):(o.window[y++]=o.window[k++],o.window[y++]=o.window[k++],_-=2);else{k=y-T;do k+=o.end;while(0>k);if(f=o.end-k,_>f){if(_-=f,y-k>0&&f>y-k){do o.window[y++]=o.window[k++];while(0!=--f)}else u(o.window,k,o.window,y,f),y+=f,k+=f,f=0;k=0}}do o.window[y++]=o.window[k++];while(0!=--_);break}if(0!=(64&f))return a.msg="invalid distance code",_=a.avail_in-v,_=_>d>>3?d>>3:_,v+=_,g-=_,d-=_<<3,o.bitb=p,o.bitk=d,a.avail_in=v,a.total_in+=g-a.next_in_index,a.next_in_index=g,o.write=y,C;l+=h[L+2],l+=p&U[f],L=3*(c+l),f=h[L]}break}if(0!=(64&f))return 0!=(32&f)?(_=a.avail_in-v,_=_>d>>3?d>>3:_,v+=_,g-=_,d-=_<<3,o.bitb=p,o.bitk=d,a.avail_in=v,a.total_in+=g-a.next_in_index,a.next_in_index=g,o.write=y,S):(a.msg="invalid literal/length code",_=a.avail_in-v,_=_>d>>3?d>>3:_,v+=_,g-=_,d-=_<<3,o.bitb=p,o.bitk=d,a.avail_in=v,a.total_in+=g-a.next_in_index,a.next_in_index=g,o.write=y,C);if(l+=h[L+2],l+=p&U[f],L=3*(c+l),0==(f=h[L])){p>>=h[L+1],d-=h[L+1],o.window[y++]=h[L+2],m--;break}}else p>>=h[L+1],d-=h[L+1],o.window[y++]=h[L+2],m--}while(m>=258&&v>=10);return _=a.avail_in-v,_=_>d>>3?d>>3:_,v+=_,g-=_,d-=_<<3,o.bitb=p,o.bitk=d,a.avail_in=v,a.total_in+=g-a.next_in_index,a.next_in_index=g,o.write=y,x},a.prototype.huft_build=function(e,t,r,i,n,s,o,a,l,h,c){var f,p,d,y,m,b,w,S,_,T,k,A,E,O,R;T=0,m=r;do this.c[e[t+T]]++,T++,m--;while(0!=m);if(this.c[0]==r)return o[0]=-1,a[0]=0,x;for(S=a[0],b=1;v>=b&&0==this.c[b];b++);for(w=b,b>S&&(S=b),m=v;0!=m&&0==this.c[m];m--);for(d=m,S>m&&(S=m),a[0]=S,O=1<<b;m>b;b++,O<<=1)if((O-=this.c[b])<0)return C;if((O-=this.c[m])<0)return C;for(this.c[m]+=O,this.x[1]=b=0,T=1,E=2;0!=--m;)this.x[E]=b+=this.c[T],E++,T++;m=0,T=0;do 0!=(b=e[t+T])&&(this.v[this.x[b]++]=m),T++;while(++m<r);for(r=this.x[d],this.x[0]=m=0,T=0,y=-1,A=-S,this.u[0]=0,k=0,R=0;d>=w;w++)for(f=this.c[w];0!=f--;){for(;w>A+S;){if(y++,A+=S,R=d-A,R=R>S?S:R,(p=1<<(b=w-A))>f+1&&(p-=f+1,E=w,R>b))for(;++b<R&&!((p<<=1)<=this.c[++E]);)p-=this.c[E];if(R=1<<b,this.hn[0]+R>g)return C;this.u[y]=k=this.hn[0],this.hn[0]+=R,0!=y?(this.x[y]=m,this.r[0]=b,this.r[1]=S,b=m>>>A-S,this.r[2]=k-this.u[y-1]-b,u(this.r,0,l,3*(this.u[y-1]+b),3)):o[0]=k}for(this.r[1]=w-A,T>=r?this.r[0]=192:c[T]<i?(this.r[0]=this.v[T]<256?0:96,this.r[2]=this.v[T++]):(this.r[0]=s[this.v[T]-i]+16+64,this.r[2]=n[this.v[T++]-i]),p=1<<w-A,b=m>>>A;R>b;b+=p)u(this.r,0,l,3*(k+b),3);for(b=1<<w-1;0!=(m&b);b>>>=1)m^=b;for(m^=b,_=(1<<A)-1;(m&_)!=this.x[y];)y--,A-=S,_=(1<<A)-1}return 0!=O&&1!=d?L:x},a.prototype.inflate_trees_bits=function(e,t,r,i,n){var s;return this.initWorkArea(19),this.hn[0]=0,s=this.huft_build(e,0,19,19,null,null,r,t,i,this.hn,this.v),s==C?n.msg="oversubscribed dynamic bit lengths tree":(s==L||0==t[0])&&(n.msg="incomplete dynamic bit lengths tree",s=C),s},a.prototype.inflate_trees_dynamic=function(e,t,r,i,n,s,o,a,l){var u;return this.initWorkArea(288),this.hn[0]=0,u=this.huft_build(r,0,e,257,ie,ne,s,i,a,this.hn,this.v),u!=x||0==i[0]?(u==C?l.msg="oversubscribed literal/length tree":u!=k&&(l.msg="incomplete literal/length tree",u=C),u):(this.initWorkArea(288),u=this.huft_build(r,e,t,0,se,oe,o,n,a,this.hn,this.v),u!=x||0==n[0]&&e>257?(u==C?l.msg="oversubscribed distance tree":u==L?(l.msg="incomplete distance tree",u=C):u!=k&&(l.msg="empty distance tree with lengths",u=C),u):x)},a.prototype.initWorkArea=function(e){null==this.hn&&(this.hn=new Int32Array(1),this.v=new Int32Array(e),this.c=new Int32Array(v+1),this.r=new Int32Array(3),this.u=new Int32Array(v),this.x=new Int32Array(v+1)),this.v.length<e&&(this.v=new Int32Array(e));for(var t=0;e>t;t++)this.v[t]=0;for(var t=0;v+1>t;t++)this.c[t]=0;for(var t=0;3>t;t++)this.r[t]=0;u(this.c,0,this.u,0,v),u(this.c,0,this.x,0,v+1)};var be=new Uint8Array(1),we="function"==typeof be.subarray;"undefined"!=typeof t&&(t.exports={inflateBuffer:f,arrayCopy:u})},{}],72:[function(e,t,r){function i(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function s(e){if(c===setTimeout)return setTimeout(e,0);if((c===i||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(f===clearTimeout)return clearTimeout(e);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){v&&d&&(v=!1,d.length?g=d.concat(g):y=-1,g.length&&l())}function l(){if(!v){var e=s(a);v=!0;for(var t=g.length;t;){for(d=g,g=[];++y<t;)d&&d[y].run();y=-1,t=g.length}d=null,v=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function h(){}var c,f,p=t.exports={};!function(){try{c="function"==typeof setTimeout?setTimeout:i}catch(e){c=i}try{f="function"==typeof clearTimeout?clearTimeout:n}catch(e){f=n}}();var d,g=[],v=!1,y=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];g.push(new u(e,t)),1!==g.length||v||s(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=h,p.addListener=h,p.once=h,p.off=h,p.removeListener=h,p.removeAllListeners=h,p.emit=h,p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},{}],73:[function(e,t,r){(function(){"use strict";var e={"@@functional/placeholder":!0},i=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,i){return t.apply(this,arguments)};case 4:return function(e,r,i,n){return t.apply(this,arguments)};case 5:return function(e,r,i,n,s){return t.apply(this,arguments)};case 6:return function(e,r,i,n,s,o){return t.apply(this,arguments)};case 7:return function(e,r,i,n,s,o,a){return t.apply(this,arguments)};case 8:return function(e,r,i,n,s,o,a,l){return t.apply(this,arguments)};case 9:return function(e,r,i,n,s,o,a,l,u){return t.apply(this,arguments)};case 10:return function(e,r,i,n,s,o,a,l,u,h){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}},n=function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r},s=function(){return Array.prototype.slice.call(arguments)},o=function(e){return new RegExp(e.source,(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":""))},a=function(e){return function(){return!e.apply(this,arguments)}},l=function(e,t){e=e||[],t=t||[];var r,i=e.length,n=t.length,s=[];for(r=0;i>r;)s[s.length]=e[r],r+=1;for(r=0;n>r;)s[s.length]=t[r],r+=1;return s},u=function(e,t,r){for(var i=0,n=r.length;n>i;){if(e(t,r[i]))return!0;i+=1}return!1},h=function(e,t){for(var r=0,i=t.length,n=[];i>r;)e(t[r])&&(n[n.length]=t[r]),r+=1;return n},c=function(e){return{"@@transducer/value":e,"@@transducer/reduced":!0}},f=function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]},p=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},d=function(e){return e},g=function(){var e=Object.prototype.toString;return"[object Arguments]"===e.call(arguments)?function(t){return"[object Arguments]"===e.call(t)}:function(e){return p("callee",e)}}(),v=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},y=function(e){return"[object Function]"===Object.prototype.toString.call(e)},m=Number.isInteger||function(e){return e<<0===e},b=function(e){return"[object Number]"===Object.prototype.toString.call(e)},w=function(e){return"[object Object]"===Object.prototype.toString.call(e)},x=function(e){return null!=e&&"object"==typeof e&&e["@@functional/placeholder"]===!0},S=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},_=function(e){return"[object String]"===Object.prototype.toString.call(e)},T=function(e){return"function"==typeof e["@@transducer/step"]},C=function(e,t){for(var r=0,i=t.length,n=Array(i);i>r;)n[r]=e(t[r]),r+=1;return n},k=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,i=arguments.length;i>r;){var n=arguments[r];if(null!=n)for(var s in n)p(s,n)&&(t[s]=n[s]);r+=1}return t},L=function(e){return[e]},A=function(e,t){return function(){return t.call(this,e.apply(this,arguments))}},E=function(e,t){return function(){var r=this;return e.apply(r,arguments).then(function(e){return t.call(r,e)})}},O=function(e){var t=e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+t.replace(/"/g,'\\"')+'"'},R=function(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}},F=function qn(e,t,r){switch(arguments.length){case 1:return qn(e,0,e.length);case 2:return qn(e,t,e.length);default:for(var i=[],n=0,s=Math.max(0,Math.min(e.length,r)-t);s>n;)i[n]=e[t+n],n+=1;return i}},M=function(){var e=function(e){return(10>e?"0":"")+e};return"function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(t){return t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}}(),I={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}},B=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},function(t){return new e(t)}}(),P=function(e,t){for(var r=0,i=t.length-(e-1),n=new Array(i>=0?i:0);i>r;)n[r]=F(t,r,r+e),r+=1;return n},D="function"==typeof Object.assign?Object.assign:k,H=function(e,t){return function(){var r=arguments.length;if(0===r)return t();var i=arguments[r-1];return v(i)||"function"!=typeof i[e]?t.apply(this,arguments):i[e].apply(i,F(arguments,0,r-1))}},N=function(e){return function t(r){return 0===arguments.length||x(r)?t:e.apply(this,arguments)}},G=function(e){return function t(r,i){switch(arguments.length){case 0:return t;case 1:return x(r)?t:N(function(t){return e(r,t)});default:return x(r)&&x(i)?t:x(r)?N(function(t){return e(t,i)}):x(i)?N(function(t){return e(r,t)}):e(r,i)}}},q=function(e){return function t(r,i,n){switch(arguments.length){case 0:return t;case 1:return x(r)?t:G(function(t,i){return e(r,t,i)});case 2:return x(r)&&x(i)?t:x(r)?G(function(t,r){return e(t,i,r)}):x(i)?G(function(t,i){return e(r,t,i)}):N(function(t){return e(r,i,t)});default:return x(r)&&x(i)&&x(n)?t:x(r)&&x(i)?G(function(t,r){return e(t,r,n)}):x(r)&&x(n)?G(function(t,r){return e(t,i,r)}):x(i)&&x(n)?G(function(t,i){return e(r,t,i)}):x(r)?N(function(t){return e(t,i,n)}):x(i)?N(function(t){return e(r,t,n)}):x(n)?N(function(t){return e(r,i,t)}):e(r,i,n)}}},U=function Un(e,t,r){return function(){for(var n=[],s=0,o=e,a=0;a<t.length||s<arguments.length;){var l;a<t.length&&(!x(t[a])||s>=arguments.length)?l=t[a]:(l=arguments[s],s+=1),n[a]=l,x(l)||(o-=1),a+=1}return 0>=o?r.apply(this,n):i(o,Un(e,n,r))}},z=function(e,t,r){return function(){var i=arguments.length;if(0===i)return r();var n=arguments[i-1];if(!v(n)){var s=F(arguments,0,i-1);if("function"==typeof n[e])return n[e].apply(n,s);if(T(n)){var o=t.apply(null,s);return o(n)}}return r.apply(this,arguments)}},j=function(e,t){for(var r=t.length-1;r>=0&&e(t[r]);)r-=1;return F(t,0,r+1)},W=function(){function e(e,t){this.xf=t,this.f=e,this.all=!0}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.all&&(e=this.xf["@@transducer/step"](e,!0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)||(this.all=!1,e=R(this.xf["@@transducer/step"](e,!1))),e},G(function(t,r){return new e(t,r)})}(),V=function(){function e(e,t){this.xf=t,this.f=e,this.any=!1}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.any||(e=this.xf["@@transducer/step"](e,!1)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.any=!0,e=R(this.xf["@@transducer/step"](e,!0))),e},G(function(t,r){return new e(t,r)})}(),X=function(){function e(e,t){this.xf=t,this.pos=0,this.full=!1,this.acc=new Array(e)}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.acc=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.store(t),this.full?this.xf["@@transducer/step"](e,this.getCopy()):e},e.prototype.store=function(e){this.acc[this.pos]=e,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},e.prototype.getCopy=function(){return l(F(this.acc,this.pos),F(this.acc,0,this.pos))},G(function(t,r){return new e(t,r)})}(),K=function(){function e(e,t){this.xf=t,this.n=e}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=I.result,e.prototype["@@transducer/step"]=function(e,t){return this.n>0?(this.n-=1,e):this.xf["@@transducer/step"](e,t)},G(function(t,r){return new e(t,r)})}(),Z=function(){function e(e,t){this.xf=t,this.pos=0,this.full=!1,this.acc=new Array(e)}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.acc=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.full&&(e=this.xf["@@transducer/step"](e,this.acc[this.pos])),this.store(t),e},e.prototype.store=function(e){this.acc[this.pos]=e,this.pos+=1,this.pos===this.acc.length&&(this.pos=0,this.full=!0)},G(function(t,r){return new e(t,r)})}(),Q=function(){function e(e,t){this.xf=t,this.pred=e,this.lastValue=void 0,this.seenFirstValue=!1}return e.prototype["@@transducer/init"]=function(){return this.xf["@@transducer/init"]()},e.prototype["@@transducer/result"]=function(e){return this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var r=!1;return this.seenFirstValue?this.pred(this.lastValue,t)&&(r=!0):this.seenFirstValue=!0,this.lastValue=t,r?e:this.xf["@@transducer/step"](e,t)},G(function(t,r){return new e(t,r)})}(),Y=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=I.result,e.prototype["@@transducer/step"]=function(e,t){if(this.f){if(this.f(t))return e;this.f=null}return this.xf["@@transducer/step"](e,t)},G(function(t,r){return new e(t,r)})}(),$=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=I.result,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},G(function(t,r){return new e(t,r)})}(),J=function(){function e(e,t){this.xf=t,this.f=e,this.found=!1}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.found=!0,e=R(this.xf["@@transducer/step"](e,t))),e},G(function(t,r){return new e(t,r)})}(),ee=function(){function e(e,t){this.xf=t,this.f=e,this.idx=-1,this.found=!1}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,-1)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.idx+=1,this.f(t)&&(this.found=!0,e=R(this.xf["@@transducer/step"](e,this.idx))),e},G(function(t,r){return new e(t,r)})}(),te=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](e,this.last))},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)&&(this.last=t),e},G(function(t,r){return new e(t,r)})}(),re=function(){function e(e,t){this.xf=t,this.f=e,this.idx=-1,this.lastIdx=-1}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.xf["@@transducer/result"](this.xf["@@transducer/step"](e,this.lastIdx))},e.prototype["@@transducer/step"]=function(e,t){return this.idx+=1,this.f(t)&&(this.lastIdx=this.idx),e},G(function(t,r){return new e(t,r)})}(),ie=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=I.result,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},G(function(t,r){return new e(t,r)})}(),ne=function(){function e(e,t){this.xf=t,this.n=e}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=I.result,e.prototype["@@transducer/step"]=function(e,t){return 0===this.n?R(e):(this.n-=1,this.xf["@@transducer/step"](e,t))},G(function(t,r){return new e(t,r)})}(),se=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=I.result,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):R(e)},G(function(t,r){return new e(t,r)})}(),oe=G(function(e,t){return Number(e)+Number(t)}),ae=q(function(e,t,r){if(t>=r.length||t<-r.length)return r;var i=0>t?r.length:0,n=i+t,s=l(r);return s[n]=e(r[n]),s}),le=G(z("all",W,function(e,t){for(var r=0;r<t.length;){if(!e(t[r]))return!1;r+=1}return!0})),ue=N(function(e){return function(){return e}}),he=G(function(e,t){return e&&t}),ce=G(z("any",V,function(e,t){for(var r=0;r<t.length;){if(e(t[r]))return!0;r+=1}return!1})),fe=G(z("aperture",X,P)),pe=G(function(e,t){return l(t,[e])}),de=G(function(e,t){return e.apply(this,t)}),ge=q(function(e,t,r){var i={};for(var n in r)i[n]=r[n];return i[e]=t,i}),ve=q(function zn(e,t,r){switch(e.length){case 0:return t;case 1:return ge(e[0],t,r);default:return ge(e[0],zn(F(e,1),t,Object(r[e[0]])),r)}}),ye=G(function(e,t){return i(e.length,function(){return e.apply(t,arguments)})}),me=q(function(e,t,r){if(e>t)throw new Error("min must not be greater than max in clamp(min, max, value)");return e>r?e:r>t?t:r}),be=N(function(e){return function(t,r){return e(t,r)?-1:e(r,t)?1:0}}),we=G(function(e,t){return 1===e?N(t):i(e,U(e,[],t))}),xe=oe(-1),Se=G(function(e,t){return null==t||t!==t?e:t}),_e=q(function(e,t,r){for(var i=[],n=0,s=t.length;s>n;)u(e,t[n],r)||u(e,t[n],i)||i.push(t[n]),n+=1;return i}),Te=G(function(e,t){var r={};for(var i in t)i!==e&&(r[i]=t[i]);return r}),Ce=G(function jn(e,t){switch(e.length){case 0:return t;case 1:return Te(e[0],t);default:var r=e[0],i=F(e,1);return null==t[r]?t:ge(r,jn(i,t[r]),t)}}),ke=G(function(e,t){return e/t}),Le=G(z("dropWhile",Y,function(e,t){for(var r=0,i=t.length;i>r&&e(t[r]);)r+=1;return F(t,r)})),Ae=N(function(e){return null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():v(e)?[]:_(e)?"":w(e)?{}:g(e)?function(){return arguments}():void 0}),Ee=G(function Wn(e,t){var r,i,n,s={};for(i in t)r=e[i],n=typeof r,s[i]="function"===n?r(t[i]):"object"===n?Wn(e[i],t[i]):t[i];return s}),Oe=G(z("find",J,function(e,t){for(var r=0,i=t.length;i>r;){if(e(t[r]))return t[r];r+=1}})),Re=G(z("findIndex",ee,function(e,t){for(var r=0,i=t.length;i>r;){if(e(t[r]))return r;r+=1}return-1})),Fe=G(z("findLast",te,function(e,t){for(var r=t.length-1;r>=0;){if(e(t[r]))return t[r];r-=1}})),Me=G(z("findLastIndex",re,function(e,t){for(var r=t.length-1;r>=0;){if(e(t[r]))return r;r-=1}return-1})),Ie=G(H("forEach",function(e,t){for(var r=t.length,i=0;r>i;)e(t[i]),i+=1;return t})),Be=N(function(e){for(var t=0,r=e.length,i={};r>t;)v(e[t])&&e[t].length&&(i[e[t][0]]=e[t][1]),t+=1;return i}),Pe=G(function(e,t){for(var r=[],i=0,n=t.length;n>i;){for(var s=i+1;n>s&&e(t[i],t[s]);)s+=1;r.push(t.slice(i,s)),i=s}return r}),De=G(function(e,t){return e>t}),He=G(function(e,t){return e>=t}),Ne=G(p),Ge=G(function(e,t){return e in t}),qe=G(function(e,t){
13
- return e===t?0!==e||1/e===1/t:e!==e&&t!==t}),Ue=N(d),ze=q(function(e,t,r){return we(Math.max(e.length,t.length,r.length),function(){return e.apply(this,arguments)?t.apply(this,arguments):r.apply(this,arguments)})}),je=oe(1),We=q(function(e,t,r){e=e<r.length&&e>=0?e:r.length;var i=F(r);return i.splice(e,0,t),i}),Ve=q(function(e,t,r){return e=e<r.length&&e>=0?e:r.length,l(l(F(r,0,e),t),F(r,e))}),Xe=G(H("intersperse",function(e,t){for(var r=[],i=0,n=t.length;n>i;)i===n-1?r.push(t[i]):r.push(t[i],e),i+=1;return r})),Ke=G(function(e,t){return null!=t&&t.constructor===e||t instanceof e}),Ze=N(function(e){return v(e)?!0:e?"object"!=typeof e?!1:e instanceof String?!1:1===e.nodeType?!!e.length:0===e.length?!0:e.length>0?e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1):!1:!1}),Qe=N(function(e){return null==e}),Ye=function(){var e=!{toString:null}.propertyIsEnumerable("toString"),t=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],r=function(){return arguments.propertyIsEnumerable("length")}(),i=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1};return N("function"!=typeof Object.keys||r?function(n){if(Object(n)!==n)return[];var s,o,a=[],l=r&&g(n);for(s in n)!p(s,n)||l&&"length"===s||(a[a.length]=s);if(e)for(o=t.length-1;o>=0;)s=t[o],p(s,n)&&!i(a,s)&&(a[a.length]=s),o-=1;return a}:function(e){return Object(e)!==e?[]:Object.keys(e)})}(),$e=N(function(e){var t,r=[];for(t in e)r[r.length]=t;return r}),Je=N(function(e){return null!=e&&Ke(Number,e.length)?e.length:NaN}),et=G(function(e,t){return t>e}),tt=G(function(e,t){return t>=e}),rt=q(function(e,t,r){for(var i=0,n=r.length,s=[],o=[t];n>i;)o=e(o[0],r[i]),s[i]=o[1],i+=1;return[o[0],s]}),it=q(function(e,t,r){for(var i=r.length-1,n=[],s=[t];i>=0;)s=e(s[0],r[i]),n[i]=s[1],i-=1;return[s[0],n]}),nt=G(function(e,t){return t.match(e)||[]}),st=G(function(e,t){return m(e)?!m(t)||1>t?NaN:(e%t+t)%t:NaN}),ot=G(function(e,t){return t>e?t:e}),at=q(function(e,t,r){return e(r)>e(t)?r:t}),lt=G(function(e,t){return D({},e,t)}),ut=N(function(e){return D.apply(null,[{}].concat(e))}),ht=q(function(e,t,r){var i,n={};for(i in t)p(i,t)&&(n[i]=p(i,r)?e(i,t[i],r[i]):t[i]);for(i in r)p(i,r)&&!p(i,n)&&(n[i]=r[i]);return n}),ct=G(function(e,t){return e>t?t:e}),ft=q(function(e,t,r){return e(r)<e(t)?r:t}),pt=G(function(e,t){return e%t}),dt=G(function(e,t){return e*t}),gt=G(function(e,t){switch(e){case 0:return function(){return t.call(this)};case 1:return function(e){return t.call(this,e)};case 2:return function(e,r){return t.call(this,e,r)};case 3:return function(e,r,i){return t.call(this,e,r,i)};case 4:return function(e,r,i,n){return t.call(this,e,r,i,n)};case 5:return function(e,r,i,n,s){return t.call(this,e,r,i,n,s)};case 6:return function(e,r,i,n,s,o){return t.call(this,e,r,i,n,s,o)};case 7:return function(e,r,i,n,s,o,a){return t.call(this,e,r,i,n,s,o,a)};case 8:return function(e,r,i,n,s,o,a,l){return t.call(this,e,r,i,n,s,o,a,l)};case 9:return function(e,r,i,n,s,o,a,l,u){return t.call(this,e,r,i,n,s,o,a,l,u)};case 10:return function(e,r,i,n,s,o,a,l,u,h){return t.call(this,e,r,i,n,s,o,a,l,u,h)};default:throw new Error("First argument to nAry must be a non-negative integer no greater than ten")}}),vt=N(function(e){return-e}),yt=G(a(z("any",V,ce))),mt=N(function(e){return!e}),bt=G(function(e,t){var r=0>e?t.length+e:e;return _(t)?t.charAt(r):t[r]}),wt=N(function(e){return function(){return bt(e,arguments)}}),xt=G(function(e,t){var r={};return r[e]=t,r}),St=N(L),_t=N(function(e){var t,r=!1;return i(e.length,function(){return r?t:(r=!0,t=e.apply(this,arguments))})}),Tt=G(function(e,t){return e||t}),Ct=function(){var e=function(t){return{value:t,map:function(r){return e(r(t))}}};return q(function(t,r,i){return t(function(t){return e(r(t))})(i).value})}(),kt=G(function(e,t){return[e,t]}),Lt=G(function(e,t){for(var r=t,i=0;i<e.length;){if(null==r)return;r=r[e[i]],i+=1}return r}),At=q(function(e,t,r){return Se(e,Lt(t,r))}),Et=q(function(e,t,r){return t.length>0&&e(Lt(t,r))}),Ot=G(function(e,t){for(var r={},i=0;i<e.length;)e[i]in t&&(r[e[i]]=t[e[i]]),i+=1;return r}),Rt=G(function(e,t){for(var r={},i=0,n=e.length;n>i;){var s=e[i];r[s]=t[s],i+=1}return r}),Ft=G(function(e,t){var r={};for(var i in t)e(t[i],i,t)&&(r[i]=t[i]);return r}),Mt=G(function(e,t){return l([e],t)}),It=G(function(e,t){return t[e]}),Bt=q(function(e,t,r){return null!=r&&p(t,r)?r[t]:e}),Pt=q(function(e,t,r){return e(r[t])}),Dt=G(function(e,t){for(var r=e.length,i=[],n=0;r>n;)i[n]=t[e[n]],n+=1;return i}),Ht=G(function(e,t){if(!b(e)||!b(t))throw new TypeError("Both arguments to range must be numbers");for(var r=[],i=e;t>i;)r.push(i),i+=1;return r}),Nt=q(function(e,t,r){for(var i=r.length-1;i>=0;)t=e(t,r[i]),i-=1;return t}),Gt=N(R),qt=q(function(e,t,r){return l(F(r,0,Math.min(e,r.length)),F(r,Math.min(r.length,e+t)))}),Ut=q(function(e,t,r){return r.replace(e,t)}),zt=N(function(e){return _(e)?e.split("").reverse().join(""):F(e).reverse()}),jt=q(function(e,t,r){for(var i=0,n=r.length,s=[t];n>i;)t=e(t,r[i]),s[i+1]=t,i+=1;return s}),Wt=q(function(e,t,r){return Ct(e,ue(t),r)}),Vt=q(H("slice",function(e,t,r){return Array.prototype.slice.call(r,e,t)})),Xt=G(function(e,t){return F(t).sort(e)}),Kt=G(function(e,t){return F(t).sort(function(t,r){var i=e(t),n=e(r);return n>i?-1:i>n?1:0})}),Zt=G(function(e,t){return[Vt(0,e,t),Vt(e,Je(t),t)]}),Qt=G(function(e,t){if(0>=e)throw new Error("First argument to splitEvery must be a positive integer");for(var r=[],i=0;i<t.length;)r.push(Vt(i,i+=e,t));return r}),Yt=G(function(e,t){for(var r=0,i=t.length,n=[];i>r&&!e(t[r]);)n.push(t[r]),r+=1;return[n,F(t,r)]}),$t=G(function(e,t){return Number(e)-Number(t)}),Jt=H("tail",Vt(1,1/0)),er=G(z("take",ne,function(e,t){return Vt(0,0>e?1/0:e,t)})),tr=G(function(e,t){for(var r=t.length-1;r>=0&&e(t[r]);)r-=1;return F(t,r+1,1/0)}),rr=G(z("takeWhile",se,function(e,t){for(var r=0,i=t.length;i>r&&e(t[r]);)r+=1;return F(t,0,r)})),ir=G(function(e,t){return e(t),t}),nr=G(function(e,t){var r,i=Number(t),n=0;if(0>i||isNaN(i))throw new RangeError("n must be a non-negative number");for(r=new Array(i);i>n;)r[n]=e(n),n+=1;return r}),sr=N(function(e){var t=[];for(var r in e)p(r,e)&&(t[t.length]=[r,e[r]]);return t}),or=N(function(e){var t=[];for(var r in e)t[t.length]=[r,e[r]];return t}),ar=N(function(e){for(var t=0,r=[];t<e.length;){for(var i=e[t],n=0;n<i.length;)"undefined"==typeof r[n]&&(r[n]=[]),r[n].push(i[n]),n+=1;t+=1}return r}),lr=function(){var e=" \n\x0B\f\r   ᠎              \u2028\u2029\ufeff",t="​",r="function"==typeof String.prototype.trim;return N(r&&!e.trim()&&t.trim()?function(e){return e.trim()}:function(t){var r=new RegExp("^["+e+"]["+e+"]*"),i=new RegExp("["+e+"]["+e+"]*$");return t.replace(r,"").replace(i,"")})}(),ur=G(function(e,t){return i(e.length,function(){try{return e.apply(this,arguments)}catch(r){return t.apply(this,l([r],arguments))}})}),hr=N(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}),cr=N(function(e){return function(){return e(F(arguments))}}),fr=N(function(e){return gt(1,e)}),pr=G(function(e,t){return we(e,function(){for(var r,i=1,n=t,s=0;e>=i&&"function"==typeof n;)r=i===e?arguments.length:s+n.length,n=n.apply(this,F(arguments,s,r)),i+=1,s=r;return n})}),dr=G(function(e,t){for(var r=e(t),i=[];r&&r.length;)i[i.length]=r[0],r=e(r[1]);return i}),gr=G(function(e,t){for(var r,i=0,n=t.length,s=[];n>i;)r=t[i],u(e,r,s)||(s[s.length]=r),i+=1;return s}),vr=q(function(e,t,r){return e(r)?r:t(r)}),yr=q(function(e,t,r){for(var i=r;!e(i);)i=t(i);return i}),mr=q(function(e,t,r){return ae(ue(t),e,r)}),br=G(function(e,t){return we(t.length,function(){for(var r=[],i=0;i<t.length;)r.push(t[i].call(this,arguments[i])),i+=1;return e.apply(this,r.concat(F(arguments,t.length)))})}),wr=N(function(e){for(var t=Ye(e),r=t.length,i=[],n=0;r>n;)i[n]=e[t[n]],n+=1;return i}),xr=N(function(e){var t,r=[];for(t in e)r[r.length]=e[t];return r}),Sr=function(){var e=function(e){return{value:e,map:function(){return this}}};return G(function(t,r){return t(e)(r).value})}(),_r=q(function(e,t,r){return e(r)?t(r):r}),Tr=G(function(e,t){for(var r in e)if(p(r,e)&&!e[r](t[r]))return!1;return!0}),Cr=G(function(e,t){return we(e.length,function(){return t.apply(this,l([e],arguments))})}),kr=G(function(e,t){for(var r,i=0,n=e.length,s=t.length,o=[];n>i;){for(r=0;s>r;)o[o.length]=[e[i],t[r]],r+=1;i+=1}return o}),Lr=G(function(e,t){for(var r=[],i=0,n=Math.min(e.length,t.length);n>i;)r[i]=[e[i],t[i]],i+=1;return r}),Ar=G(function(e,t){for(var r=0,i=Math.min(e.length,t.length),n={};i>r;)n[e[r]]=t[r],r+=1;return n}),Er=q(function(e,t,r){for(var i=[],n=0,s=Math.min(t.length,r.length);s>n;)i[n]=e(t[n],r[n]),n+=1;return i}),Or=ue(!1),Rr=ue(!0),Fr=function Vn(e,t,r,i){var n=function(n){for(var s=t.length,o=0;s>o;){if(e===t[o])return r[o];o+=1}t[o+1]=e,r[o+1]=n;for(var a in e)n[a]=i?Vn(e[a],t,r,!0):e[a];return n};switch(hr(e)){case"Object":return n({});case"Array":return n([]);case"Date":return new Date(e.valueOf());case"RegExp":return o(e);default:return e}},Mr=function(e){return G(function(t,r){return i(Math.max(0,t.length-r.length),function(){return t.apply(this,e(r,arguments))})})},Ir=function(e,t){return er(e<t.length?t.length-e:0,t)},Br=function Xn(e,t,r,i){if(qe(e,t))return!0;if(hr(e)!==hr(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(hr(e)){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===f(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!qe(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!qe(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1;break;case"Map":case"Set":if(!Xn(n(e.entries()),n(t.entries()),r,i))return!1;break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":break;case"ArrayBuffer":break;default:return!1}var s=Ye(e);if(s.length!==Ye(t).length)return!1;for(var o=r.length-1;o>=0;){if(r[o]===e)return i[o]===t;o-=1}for(r.push(e),i.push(t),o=s.length-1;o>=0;){var a=s[o];if(!p(a,t)||!Xn(t[a],e[a],r,i))return!1;o-=1}return r.pop(),i.pop(),!0},Pr=function(e){return function t(r){for(var i,n,s,o=[],a=0,l=r.length;l>a;){if(Ze(r[a]))for(i=e?t(r[a]):r[a],s=0,n=i.length;n>s;)o[o.length]=i[s],s+=1;else o[o.length]=r[a];a+=1}return o}},Dr=function(){function e(e,t,r){for(var i=0,n=r.length;n>i;){if(t=e["@@transducer/step"](t,r[i]),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}i+=1}return e["@@transducer/result"](t)}function t(e,t,r){for(var i=r.next();!i.done;){if(t=e["@@transducer/step"](t,i.value),t&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}i=r.next()}return e["@@transducer/result"](t)}function r(e,t,r){return e["@@transducer/result"](r.reduce(ye(e["@@transducer/step"],e),t))}var i="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";return function(n,s,o){if("function"==typeof n&&(n=B(n)),Ze(o))return e(n,s,o);if("function"==typeof o.reduce)return r(n,s,o);if(null!=o[i])return t(n,s,o[i]());if("function"==typeof o.next)return t(n,s,o);throw new TypeError("reduce: list must be array or iterable")}}(),Hr=function(){var e={"@@transducer/init":Array,"@@transducer/step":function(e,t){return e.push(t),e},"@@transducer/result":d},t={"@@transducer/init":String,"@@transducer/step":function(e,t){return e+t},"@@transducer/result":d},r={"@@transducer/init":Object,"@@transducer/step":function(e,t){return D(e,Ze(t)?xt(t[0],t[1]):t)},"@@transducer/result":d};return function(i){if(T(i))return i;if(Ze(i))return e;if("string"==typeof i)return t;if("object"==typeof i)return r;throw new Error("Cannot create transformer for "+i)}}(),Nr=function(){function e(e,t){this.f=e,this.retained=[],this.xf=t}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){return this.retained=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.retain(e,t):this.flush(e,t)},e.prototype.flush=function(e,t){return e=Dr(this.xf["@@transducer/step"],e,this.retained),this.retained=[],this.xf["@@transducer/step"](e,t)},e.prototype.retain=function(e,t){return this.retained.push(t),e},G(function(t,r){return new e(t,r)})}(),Gr=function(){function e(e,t){this.xf=t,this.f=e,this.inputs={}}return e.prototype["@@transducer/init"]=I.init,e.prototype["@@transducer/result"]=function(e){var t;for(t in this.inputs)if(p(t,this.inputs)&&(e=this.xf["@@transducer/step"](e,this.inputs[t]),e["@@transducer/reduced"])){e=e["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var r=this.f(t);return this.inputs[r]=this.inputs[r]||[r,[]],this.inputs[r][1]=pe(t,this.inputs[r][1]),e},G(function(t,r){return new e(t,r)})}(),qr=N(function(e){return we(e.length,function(){var t=0,r=arguments[0],i=arguments[arguments.length-1],n=F(arguments);return n[0]=function(){var e=r.apply(this,l(arguments,[t,i]));return t+=1,e},e.apply(this,n)})}),Ur=N(function(e){return gt(2,e)}),zr=N(function(e){return null!=e&&"function"==typeof e.clone?e.clone():Fr(e,[],[],!0)}),jr=N(function(e){return we(e.length,e)}),Wr=G(z("drop",K,function(e,t){return Vt(Math.max(0,e),1/0,t)})),Vr=G(z("dropLast",Z,Ir)),Xr=G(z("dropLastWhile",Nr,j)),Kr=G(function(e,t){return Br(e,t,[],[])}),Zr=G(z("filter",$,function(e,t){return w(t)?Dr(function(r,i){return e(t[i])&&(r[i]=t[i]),r},{},Ye(t)):h(e,t)})),Qr=N(Pr(!0)),Yr=N(function(e){return jr(function(t,r){var i=F(arguments);return i[0]=r,i[1]=t,e.apply(this,i)})}),$r=bt(0),Jr=Vt(0,-1),ei=q(function(e,t,r){var i,n;t.length>r.length?(i=t,n=r):(i=r,n=t);for(var s=[],o=0;o<n.length;)u(e,n[o],i)&&(s[s.length]=n[o]),o+=1;return gr(e,s)}),ti=q(function(e,t,r){return T(e)?Dr(t(e),e["@@transducer/init"](),r):Dr(t(Hr(e)),Fr(e,[],[],!1),r)}),ri=N(function(e){for(var t=Ye(e),r=t.length,i=0,n={};r>i;){var s=t[i],o=e[s],a=p(o,n)?n[o]:n[o]=[];a[a.length]=s,i+=1}return n}),ii=N(function(e){for(var t=Ye(e),r=t.length,i=0,n={};r>i;){var s=t[i];n[e[s]]=s,i+=1}return n}),ni=N(function(e){return null!=e&&Kr(e,Ae(e))}),si=bt(-1),oi=G(function(e,t){if("function"!=typeof t.lastIndexOf||v(t)){for(var r=t.length-1;r>=0;){if(Kr(t[r],e))return r;r-=1}return-1}return t.lastIndexOf(e)}),ai=G(z("map",ie,function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return we(t.length,function(){return e.call(this,t.apply(this,arguments))});case"[object Object]":return Dr(function(r,i){return r[i]=e(t[i]),r},{},Ye(t));default:return C(e,t)}})),li=G(function(e,t){return Dr(function(r,i){return r[i]=e(t[i],i,t),r},{},Ye(t))}),ui=q(function(e,t,r){return ht(function(t,r,i){return e(r,i)},t,r)}),hi=Mr(l),ci=Mr(Yr(l)),fi=q(function(e,t,r){return Kr(Lt(e,r),t)}),pi=G(function(e,t){return ai(It(e),t)}),di=br(C,[Rt,Ue]),gi=q(function(e,t,r){return Pt(Kr(t),e,r)}),vi=q(function(e,t,r){return Pt(Ke(e),t,r)}),yi=q(Dr),mi=U(4,[],function(e,t,r,i){return Dr(function(i,n){var s=r(n);return i[s]=e(p(s,i)?i[s]:t,n),i},{},i)}),bi=G(function(e,t){return Zr(a(e),t)}),wi=G(function(e,t){return nr(ue(e),t)}),xi=yi(oe,0),Si=G(function(e,t){return Wr(e>=0?t.length-e:0,t)}),_i=we(4,function(e,t,r,i){return Dr(e("function"==typeof t?B(t):t),r,i)}),Ti=q(function(e,t,r){return gr(e,l(t,r))}),Ci=G(function(e,t){return Tr(ai(Kr,e),t)}),ki=function(){var e=function(e){return{"@@transducer/init":I.init,"@@transducer/result":function(t){return e["@@transducer/result"](t)},"@@transducer/step":function(t,r){var i=e["@@transducer/step"](t,r);return i["@@transducer/reduced"]?c(i):i}}};return function(t){var r=e(t);return{"@@transducer/init":I.init,"@@transducer/result":function(e){return r["@@transducer/result"](e)},"@@transducer/step":function(e,t){return Ze(t)?Dr(r,e,t):Dr(r,e,[t])}}}}(),Li=function(e,t,r){var i,n;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(i=1/t;r<e.length;){if(n=e[r],0===n&&1/n===i)return r;r+=1}return-1}if(t!==t){for(;r<e.length;){if(n=e[r],"number"==typeof n&&n!==n)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(Kr(e[r],t))return r;r+=1}return-1},Ai=G(function(e,t){return ai(e,ki(t))}),Ei=N(function(e){return we(yi(ot,0,pi("length",e)),function(){for(var t=0,r=e.length;r>t;){if(!e[t].apply(this,arguments))return!1;t+=1}return!0})}),Oi=N(function(e){for(var t=e.length,r=0;t>r;){if(Li(e,e[r],r+1)>=0)return!1;r+=1}return!0}),Ri=N(function(e){return we(yi(ot,0,pi("length",e)),function(){for(var t=0,r=e.length;r>t;){if(e[t].apply(this,arguments))return!0;t+=1}return!1})}),Fi=G(function(e,t){return"function"==typeof e.ap?e.ap(t):"function"==typeof e?we(Math.max(e.length,t.length),function(){return e.apply(this,arguments)(t.apply(this,arguments))}):Dr(function(e,r){return l(e,ai(r,t))},[],e)}),Mi=N(function Kn(e){return e=ai(function(e){return"function"==typeof e?e:Kn(e)},e),we(yi(ot,0,pi("length",wr(e))),function(){var t=arguments;return ai(function(e){return de(e,t)},e)})}),Ii=jr(function(e){return e.apply(this,F(arguments,1))}),Bi=G(z("chain",Ai,function(e,t){return"function"==typeof t?function(){return t.call(this,e.apply(this,arguments)).apply(this,arguments)}:Pr(!1)(ai(e,t))})),Pi=N(function(e){var t=yi(ot,0,ai(function(e){return e[0].length},e));return i(t,function(){for(var t=0;t<e.length;){if(e[t][0].apply(this,arguments))return e[t][1].apply(this,arguments);t+=1}})}),Di=G(function(e,t){if(e>10)throw new Error("Constructor with greater than ten arguments");return 0===e?function(){return new t}:jr(gt(e,function(e,r,i,n,s,o,a,l,u,h){switch(arguments.length){case 1:return new t(e);case 2:return new t(e,r);case 3:return new t(e,r,i);case 4:return new t(e,r,i,n);case 5:return new t(e,r,i,n,s);case 6:return new t(e,r,i,n,s,o);case 7:return new t(e,r,i,n,s,o,a);case 8:return new t(e,r,i,n,s,o,a,l);case 9:return new t(e,r,i,n,s,o,a,l,u);case 10:return new t(e,r,i,n,s,o,a,l,u,h)}}))}),Hi=G(function(e,t){return we(yi(ot,0,pi("length",t)),function(){var r=arguments,i=this;return e.apply(i,C(function(e){return e.apply(i,r)},t))})}),Ni=mi(function(e,t){return e+1},0),Gi=G(z("dropRepeatsWith",Q,function(e,t){var r=[],i=1,n=t.length;if(0!==n)for(r[0]=t[0];n>i;)e(si(r),t[i])||(r[r.length]=t[i]),i+=1;return r})),qi=q(function(e,t,r){return Kr(e(t),e(r))}),Ui=q(function(e,t,r){return Kr(t[e],r[e])}),zi=G(z("groupBy",Gr,mi(function(e,t){return null==e&&(e=[]),e.push(t),e},null))),ji=mi(function(e,t){return t},null),Wi=G(function(e,t){return"function"!=typeof t.indexOf||v(t)?Li(t,e,0):t.indexOf(e)}),Vi=N(function(e){return Hi(s,e)}),Xi=G(function(e,t){return function(r){return function(i){return ai(function(e){return t(e,i)},r(e(i)))}}}),Ki=N(function(e){return Xi(bt(e),mr(e))}),Zi=N(function(e){return Xi(Lt(e),ve(e))}),Qi=N(function(e){return Xi(It(e),ge(e))}),Yi=G(function(e,t){var r=we(e,t);return we(e,function(){return Dr(Fi,ai(r,arguments[0]),F(arguments,1))})}),$i=N(function(e){return xi(e)/e.length}),Ji=N(function(e){var t=e.length;if(0===t)return NaN;var r=2-t%2,i=(t-r)/2;return $i(F(e).sort(function(e,t){return t>e?-1:e>t?1:0}).slice(i,i+r))}),en=Vi([Zr,bi]),tn=function(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return i(arguments[0].length,yi(A,arguments[0],Jt(arguments)))},rn=function(){if(0===arguments.length)throw new Error("pipeP requires at least one argument");return i(arguments[0].length,yi(E,arguments[0],Jt(arguments)))},nn=yi(dt,1),sn=G(function(e,t){return"function"==typeof t.sequence?t.sequence(e):Nt(function(e,t){return Fi(ai(Mt,t),e)},e([]),t)}),on=q(function(e,t,r){return sn(e,ai(t,r))}),an=Bi(d),ln=function(e,t){return Li(t,e,0)>=0},un=function Zn(e,t){var r=function(r){var i=t.concat([e]);return ln(r,i)?"<Circular>":Zn(r,i)},i=function(e,t){return C(function(t){return O(t)+": "+r(e[t])},t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+C(r,e).join(", ")+"))";case"[object Array]":return"["+C(r,e).concat(i(e,bi(function(e){return/^\d+$/.test(e)},Ye(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):O(M(e)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e===-(1/0)?"-0":e.toString(10);case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":O(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var n=e.toString();if("[object Object]"!==n)return n}return"{"+i(e,Ye(e)).join(", ")+"}"}},hn=function(){if(0===arguments.length)throw new Error("compose requires at least one argument");return tn.apply(this,zt(arguments))},cn=function(){return hn.apply(this,Mt(Ue,ai(Bi,arguments)))},fn=function(){if(0===arguments.length)throw new Error("composeP requires at least one argument");return rn.apply(this,zt(arguments))},pn=N(function(e){return Di(e.length,e)}),dn=G(ln),gn=G(function(e,t){for(var r=[],i=0,n=e.length;n>i;)ln(e[i],t)||ln(e[i],r)||(r[r.length]=e[i]),i+=1;return r}),vn=N(z("dropRepeats",Q(Kr),Gi(Kr))),yn=N(function(e){return Yi(e.length,e)}),mn=G(function(e,t){var r={};for(var i in t)ln(i,e)||(r[i]=t[i]);return r}),bn=function(){return cn.apply(this,zt(arguments))},wn=N(function(e){return un(e,[])}),xn=G(function(e,t){return bi(Yr(ln)(e),t)}),Sn=function(){function e(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}function t(e,t,r){var i,n,s=typeof e;switch(s){case"string":case"number":return 0!==e||r._items["-0"]||1/e!==-(1/0)?null!==r._nativeSet?t?(i=r._nativeSet.size,r._nativeSet.add(e),n=r._nativeSet.size,n>i):r._nativeSet.has(e):s in r._items?e in r._items[s]?!t:(t&&(r._items[s][e]=!0),t):(t&&(r._items[s]={},r._items[s][e]=!0),t):(t&&(r._items["-0"]=!0),t);case"boolean":if(s in r._items){var o=e?1:0;return r._items[s][o]?!t:(t&&(r._items[s][o]=!0),t)}return t&&(r._items[s]=e?[!1,!0]:[!0,!1]),t;case"function":return null!==r._nativeSet?t?(i=r._nativeSet.size,r._nativeSet.add(e),n=r._nativeSet.size,n>i):r._nativeSet.has(e):s in r._items?ln(e,r._items[s])?!t:(t&&r._items[s].push(e),t):(t&&(r._items[s]=[e]),t);case"undefined":return r._items[s]?!t:(t&&(r._items[s]=!0),t);case"object":if(null===e)return r._items["null"]?!t:(t&&(r._items["null"]=!0),t);default:return s=Object.prototype.toString.call(e),s in r._items?ln(e,r._items[s])?!t:(t&&r._items[s].push(e),t):(t&&(r._items[s]=[e]),t)}}return e.prototype.add=function(e){return t(e,!0,this)},e.prototype.has=function(e){return t(e,!1,this)},e}(),_n=G(function(e,t){return y(e)?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:yn(he)(e,t)}),Tn=yn(mt),Cn=G(function(e,t){return y(e)?function(){return e.apply(this,arguments)||t.apply(this,arguments)}:yn(Tt)(e,t)}),kn=G(function(e,t){return we(e+1,function(){var r=arguments[e];if(null!=r&&Ke(Function,r[t]))return r[t].apply(r,F(arguments,0,e));throw new TypeError(wn(r)+' does not have a method named "'+t+'"')})}),Ln=kn(1,"join"),An=N(function(e){var t={};return i(e.length,function(){var r=wn(arguments);return p(r,t)||(t[r]=e.apply(this,arguments)),t[r]})}),En=kn(1,"split"),On=G(function(e,t){if(!S(e))throw new TypeError("‘test’ requires a value of type RegExp as its first argument; received "+wn(e));return o(e).test(t)}),Rn=kn(0,"toLowerCase"),Fn=kn(0,"toUpperCase"),Mn=G(function(e,t){for(var r,i,n=new Sn,s=[],o=0;o<t.length;)i=t[o],r=e(i),n.add(r)&&s.push(i),o+=1;return s}),In=Yr(kn(1,"concat")),Bn=G(function(e,t){return In(gn(e,t),gn(t,e))}),Pn=q(function(e,t,r){return In(_e(e,t,r),_e(e,r,t))}),Dn=Mn(Ue),Hn=G(function(e,t){var r,i;return e.length>t.length?(r=e,i=t):(r=t,i=e),Dn(h(Yr(ln)(r),i))}),Nn=G(hn(Dn,l)),Gn={F:Or,T:Rr,__:e,add:oe,addIndex:qr,adjust:ae,all:le,allPass:Ei,allUniq:Oi,always:ue,and:he,any:ce,anyPass:Ri,ap:Fi,aperture:fe,append:pe,apply:de,applySpec:Mi,assoc:ge,assocPath:ve,binary:Ur,bind:ye,both:_n,call:Ii,chain:Bi,clamp:me,clone:zr,comparator:be,complement:Tn,compose:hn,composeK:cn,composeP:fn,concat:In,cond:Pi,construct:pn,constructN:Di,contains:dn,converge:Hi,countBy:Ni,curry:jr,curryN:we,dec:xe,defaultTo:Se,difference:gn,differenceWith:_e,dissoc:Te,dissocPath:Ce,divide:ke,drop:Wr,dropLast:Vr,dropLastWhile:Xr,dropRepeats:vn,dropRepeatsWith:Gi,dropWhile:Le,either:Cn,empty:Ae,eqBy:qi,eqProps:Ui,equals:Kr,evolve:Ee,filter:Zr,find:Oe,findIndex:Re,findLast:Fe,findLastIndex:Me,flatten:Qr,flip:Yr,forEach:Ie,fromPairs:Be,groupBy:zi,groupWith:Pe,gt:De,gte:He,has:Ne,hasIn:Ge,head:$r,identical:qe,identity:Ue,ifElse:ze,inc:je,indexBy:ji,indexOf:Wi,init:Jr,insert:We,insertAll:Ve,intersection:Hn,intersectionWith:ei,intersperse:Xe,into:ti,invert:ri,invertObj:ii,invoker:kn,is:Ke,isArrayLike:Ze,isEmpty:ni,isNil:Qe,join:Ln,juxt:Vi,keys:Ye,keysIn:$e,last:si,lastIndexOf:oi,length:Je,lens:Xi,lensIndex:Ki,lensPath:Zi,lensProp:Qi,lift:yn,liftN:Yi,lt:et,lte:tt,map:ai,mapAccum:rt,mapAccumRight:it,mapObjIndexed:li,match:nt,mathMod:st,max:ot,maxBy:at,mean:$i,median:Ji,memoize:An,merge:lt,mergeAll:ut,mergeWith:ui,mergeWithKey:ht,min:ct,minBy:ft,modulo:pt,multiply:dt,nAry:gt,negate:vt,none:yt,not:mt,nth:bt,nthArg:wt,objOf:xt,of:St,omit:mn,once:_t,or:Tt,over:Ct,pair:kt,partial:hi,partialRight:ci,partition:en,path:Lt,pathEq:fi,pathOr:At,pathSatisfies:Et,pick:Ot,pickAll:Rt,pickBy:Ft,pipe:tn,pipeK:bn,pipeP:rn,pluck:pi,prepend:Mt,product:nn,project:di,prop:It,propEq:gi,propIs:vi,propOr:Bt,propSatisfies:Pt,props:Dt,range:Ht,reduce:yi,reduceBy:mi,reduceRight:Nt,reduced:Gt,reject:bi,remove:qt,repeat:wi,replace:Ut,reverse:zt,scan:jt,sequence:sn,set:Wt,slice:Vt,sort:Xt,sortBy:Kt,split:En,splitAt:Zt,splitEvery:Qt,splitWhen:Yt,subtract:$t,sum:xi,symmetricDifference:Bn,symmetricDifferenceWith:Pn,tail:Jt,take:er,takeLast:Si,takeLastWhile:tr,takeWhile:rr,tap:ir,test:On,times:nr,toLower:Rn,toPairs:sr,toPairsIn:or,toString:wn,toUpper:Fn,transduce:_i,transpose:ar,traverse:on,trim:lr,tryCatch:ur,type:hr,unapply:cr,unary:fr,uncurryN:pr,unfold:dr,union:Nn,unionWith:Ti,uniq:Dn,uniqBy:Mn,uniqWith:gr,unless:vr,unnest:an,until:yr,update:mr,useWith:br,values:wr,valuesIn:xr,view:Sr,when:_r,where:Tr,whereEq:Ci,without:xn,wrap:Cr,xprod:kr,zip:Lr,zipObj:Ar,zipWith:Er};"object"==typeof r?t.exports=Gn:"function"==typeof define&&define.amd?define(function(){return Gn}):this.R=Gn}).call(this)},{}],74:[function(e,t,r){!function(e){function t(e,s,o){o=r({},t.defaults,o);var a=[];return"array"===s.type?n(e,e,"",s,o,a):i(e,s,o,a),{valid:!a.length,errors:a}}function r(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError("mixin non-object");for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}}return e}function i(e,t,r,i){var s,a=Object.keys(e),l=[];if(t.properties){s=t.properties;for(var u in s)s.hasOwnProperty(u)&&(l.push(u),n(e,e[u],u,s[u],r,i))}if(t.patternProperties){s=t.patternProperties;for(var u in s)if(s.hasOwnProperty(u)){var h=new RegExp(u);for(var c in e)e.hasOwnProperty(c)&&null!==h.exec(c)&&(n(e,e[c],c,s[u],r,i),l.push(c))}}if(void 0===t.additionalProperties&&(t.additionalProperties=r.additionalProperties),void 0!==t.additionalProperties){var f,p,d=a.filter(function(e){return-1===l.indexOf(e)});if(t.additionalProperties===!1&&d.length>0)for(f=0,p=d.length;p>f;f++)o("additionalProperties",d[f],e[d[f]],!1,i);else if("object"==typeof t.additionalProperties&&d.length>0)for(f=0,p=d.length;p>f;f++)n(e,e[d[f]],d[f],t.unvisitedProperties,r,i)}}function n(e,r,l,u,h,c){function f(e,t,r){void 0===u[e]||r(t,u[e])||o(e,l,t,u,c)}var p,d;if(void 0===r)return u.required&&"any"!==u.type?o("required",l,void 0,u,c):void 0;if(h.cast&&("integer"!==u.type&&"number"!==u.type||r!=+r||(r=+r,e[l]=r),"boolean"===u.type&&(("true"===r||"1"===r||1===r)&&(r=!0,e[l]=r),("false"===r||"0"===r||0===r)&&(r=!1,e[l]=r))),u.format&&h.validateFormats)if(p=u.format,h.validateFormatExtensions&&(d=t.formatExtensions[p]),d||(d=t.formats[p]),d){if(!d.test(r))return o("format",l,r,u,c)}else if(h.validateFormatsStrict)return o("format",l,r,u,c);if(u["enum"]&&-1===u["enum"].indexOf(r)&&o("enum",l,r,u,c),"string"==typeof u.dependencies&&void 0===e[u.dependencies]&&o("dependencies",l,null,u,c),a(u.dependencies))for(var g=0,v=u.dependencies.length;v>g;g++)void 0===e[u.dependencies[g]]&&o("dependencies",l,null,u,c);"object"==typeof u.dependencies&&i(e,u.dependencies,h,c),s(r,u.type,function(t,s){if(t)return o("type",l,typeof r,u,c);switch(f("conform",r,function(t,r){return r(t,e)}),s||(a(r)?"array":typeof r)){case"string":f("allowEmpty",r,function(e,t){return t?t:""!==e}),f("minLength",r.length,function(e,t){return e>=t}),f("maxLength",r.length,function(e,t){return t>=e}),f("pattern",r,function(e,t){return t="string"==typeof t?t=new RegExp(t):t,t.test(e)});break;case"integer":case"number":f("minimum",r,function(e,t){return e>=t}),f("maximum",r,function(e,t){return t>=e}),f("exclusiveMinimum",r,function(e,t){return e>t}),f("exclusiveMaximum",r,function(e,t){return t>e}),f("divisibleBy",r,function(e,t){var r=Math.max((e-Math.floor(e)).toString().length-2,(t-Math.floor(t)).toString().length-2);return r=r>0?Math.pow(10,r):1,e*r%(t*r)===0});break;case"array":f("items",r,function(t,r){for(var i,s=0,o=t.length;o>s;s++)i=[],n(e,t[s],l,r,h,i),i.forEach(function(e){e.property=(l?l+".":"")+s+(e.property?"."+e.property.replace(l+".",""):"")}),i.unshift(0,0),Array.prototype.splice.apply(c,i);return!0}),f("minItems",r,function(e,t){return e.length>=t}),f("maxItems",r,function(e,t){return e.length<=t}),f("uniqueItems",r,function(e,t){if(!t)return!0;for(var r={},i=0,n=e.length;n>i;i++){var s=JSON.stringify(e[i]);if(r[s])return!1;r[s]=!0}return!0});break;case"object":if(u.properties||u.patternProperties||u.additionalProperties){var p=[];i(r,u,h,p),p.forEach(function(e){e.property=l+"."+e.property}),p.unshift(0,0),Array.prototype.splice.apply(c,p)}}})}function s(e,t,r){var i=a(t)?t:[t];if(void 0===t)return r(null,t);for(var n=0,s=i.length;s>n;n++)if(t=i[n].toLowerCase().trim(),"string"===t?"string"==typeof e:"array"===t?a(e):"object"===t?e&&"object"==typeof e&&!a(e):"number"===t?"number"==typeof e:"integer"===t?"number"==typeof e&&Math.floor(e)===e:"null"===t?null===e:"boolean"===t?"boolean"==typeof e:"date"===t?l(e):"any"===t?"undefined"!=typeof e:!1)return r(null,t);r(!0)}function o(e,r,i,n,s){var o={expected:n[e],actual:i,attribute:e,property:r},a=n.messages&&n.messages[e]||n.message||t.messages[e]||"no default message";a=a.replace(/%\{([a-z]+)\}/gi,function(e,t){return o[t.toLowerCase()]||""}),s.push({attribute:e,property:r,expected:n[e],actual:i,message:a})}function a(e){var t=typeof e;return"object"===t&&e&&"number"==typeof e.length&&!e.propertyIsEnumerable("length")&&"function"==typeof e.splice?!0:!1}function l(e){var t=typeof e;return"object"===t&&e&&"function"==typeof e.getTime?!0:!1}e.validate=t,e.mixin=r,t.defaults={validateFormats:!0,validateFormatsStrict:!1,validateFormatExtensions:!0,additionalProperties:!0},t.messages={required:"is required",allowEmpty:"must not be empty",minLength:"is too short (minimum is %{expected} characters)",maxLength:"is too long (maximum is %{expected} characters)",pattern:"invalid input",minimum:"must be greater than or equal to %{expected}",maximum:"must be less than or equal to %{expected}",exclusiveMinimum:"must be greater than %{expected}",exclusiveMaximum:"must be less than %{expected}",divisibleBy:"must be divisible by %{expected}",minItems:"must contain more than %{expected} items",
14
- maxItems:"must contain less than %{expected} items",uniqueItems:"must hold a unique set of values",format:"is not a valid %{expected}",conform:"must conform to given constraint",type:"must be of %{expected} type",additionalProperties:"must not exist"},t.messages["enum"]="must be present in given enumerator",t.formats={email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,"ip-address":/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/i,ipv6:/^([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}$/,"date-time":/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:.\d{1,3})?Z$/,date:/^\d{4}-\d{2}-\d{2}$/,time:/^\d{2}:\d{2}:\d{2}$/,color:/^#[a-z0-9]{6}|#[a-z0-9]{3}|(?:rgb\(\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*,\s*(?:[+-]?\d+%?)\s*\))aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow$/i,"host-name":/^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])/,"utc-millisec":{test:function(e){return"number"==typeof e&&e>=0}},regex:{test:function(e){try{new RegExp(e)}catch(t){return!1}return!0}}},t.formatExtensions={url:/^(https?|ftp|git):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i}}("object"==typeof t&&t&&t.exports?t.exports:window)},{}]},{},[20]);
15
- //# sourceMappingURL=dalliance-all.js.map