jbrowse-plugin-graphgenomeviewer 8.7.0 → 8.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/dist/chunks/AddTrackWorkflow-FANMD3WB.js +2 -0
  2. package/dist/chunks/{AddTrackWorkflow-IOPTETLH.js.map → AddTrackWorkflow-FANMD3WB.js.map} +2 -2
  3. package/dist/chunks/{GbzBaseSyntenyAdapter-67NMRHWZ.js → GbzBaseSyntenyAdapter-SDYLJG5H.js} +2 -2
  4. package/dist/chunks/{GbzBaseSyntenyAdapter-67NMRHWZ.js.map → GbzBaseSyntenyAdapter-SDYLJG5H.js.map} +2 -2
  5. package/dist/chunks/{GraphGenomeView-RD2XGX6D.js → GraphGenomeView-HCN57HV4.js} +2 -2
  6. package/dist/chunks/{GraphTrackSettingsDialog-R3XOY32L.js → GraphTrackSettingsDialog-ZNZWUEN3.js} +2 -2
  7. package/dist/chunks/{HighlightColorDialog-AKPIC56I.js → HighlightColorDialog-3H2H2LPS.js} +2 -2
  8. package/dist/chunks/{LinearGraphDisplay-RRAXTQFC.js → LinearGraphDisplay-W5IT3HYI.js} +2 -2
  9. package/dist/chunks/{MinigraphBubbleAdapter-2YTXBZYS.js → MinigraphBubbleAdapter-TTGZ45BF.js} +2 -2
  10. package/dist/chunks/{RgfaTabixAdapter-RCGS6YVM.js → RgfaTabixAdapter-A274AVUU.js} +2 -2
  11. package/dist/chunks/{WalkFormsAdapter-3M5A4JL3.js → WalkFormsAdapter-7RD7ZAHG.js} +2 -2
  12. package/dist/chunks/WalkTabixSyntenyAdapter-CLC2CJJT.js +2 -0
  13. package/dist/chunks/{WalkTabixSyntenyAdapter-576RE5OE.js.map → WalkTabixSyntenyAdapter-CLC2CJJT.js.map} +2 -2
  14. package/dist/chunks/{chunk-CL4PYWKC.js → chunk-2FG67WIZ.js} +1 -1
  15. package/dist/chunks/{chunk-CL4PYWKC.js.map → chunk-2FG67WIZ.js.map} +1 -1
  16. package/dist/chunks/chunk-46O3IEW3.js +2 -0
  17. package/dist/chunks/{chunk-OPWSPSAE.js.map → chunk-46O3IEW3.js.map} +4 -4
  18. package/dist/chunks/{chunk-ULPW4VGT.js → chunk-5QJ2ANXK.js} +2 -2
  19. package/dist/chunks/chunk-5TT5TG4Q.js +2 -0
  20. package/dist/chunks/chunk-5TT5TG4Q.js.map +7 -0
  21. package/dist/chunks/{chunk-X2QGBINE.js → chunk-64OSFJLE.js} +1 -1
  22. package/dist/chunks/{chunk-X2QGBINE.js.map → chunk-64OSFJLE.js.map} +1 -1
  23. package/dist/chunks/chunk-7BKSSU2R.js +4 -0
  24. package/dist/chunks/chunk-7BKSSU2R.js.map +7 -0
  25. package/dist/chunks/{chunk-SVDQVLEU.js → chunk-7HJWQFKE.js} +2 -2
  26. package/dist/chunks/{chunk-DIGIM3XY.js → chunk-DQC5K7EW.js} +2 -2
  27. package/dist/chunks/{chunk-W5HHWDGZ.js → chunk-G6NFDDMN.js} +1 -1
  28. package/dist/chunks/{chunk-W5HHWDGZ.js.map → chunk-G6NFDDMN.js.map} +1 -1
  29. package/dist/chunks/{chunk-4XY7HUQR.js → chunk-HC2YPYTO.js} +2 -2
  30. package/dist/chunks/{chunk-4XY7HUQR.js.map → chunk-HC2YPYTO.js.map} +1 -1
  31. package/dist/chunks/{chunk-HRTRECXN.js → chunk-HTH7NAV4.js} +2 -2
  32. package/dist/chunks/chunk-KACKTX2U.js +2 -0
  33. package/dist/chunks/{chunk-Y7MQVQAS.js → chunk-OS52UJIX.js} +2 -2
  34. package/dist/chunks/{chunk-Y7MQVQAS.js.map → chunk-OS52UJIX.js.map} +1 -1
  35. package/dist/chunks/{chunk-UC2NHZ7E.js → chunk-S7DQGZX2.js} +1 -1
  36. package/dist/chunks/{chunk-UC2NHZ7E.js.map → chunk-S7DQGZX2.js.map} +1 -1
  37. package/dist/chunks/{chunk-4DQWDJG7.js → chunk-T3FHGWNW.js} +2 -2
  38. package/dist/chunks/{chunk-4DQWDJG7.js.map → chunk-T3FHGWNW.js.map} +2 -2
  39. package/dist/chunks/chunk-T7LVVBTT.js +2 -0
  40. package/dist/chunks/chunk-T7LVVBTT.js.map +7 -0
  41. package/dist/chunks/{chunk-E23AOQPE.js → chunk-VPZZ6XMM.js} +2 -2
  42. package/dist/chunks/{chunk-E23AOQPE.js.map → chunk-VPZZ6XMM.js.map} +2 -2
  43. package/dist/chunks/{chunk-XLVKVQJB.js → chunk-VQVQXMNM.js} +2 -2
  44. package/dist/chunks/{chunk-XLVKVQJB.js.map → chunk-VQVQXMNM.js.map} +2 -2
  45. package/dist/chunks/chunk-W4Y2JUP7.js +3 -0
  46. package/dist/chunks/chunk-W4Y2JUP7.js.map +7 -0
  47. package/dist/chunks/{chunk-ELC7POI6.js → chunk-WJHTNDTQ.js} +2 -2
  48. package/dist/chunks/{chunk-ELC7POI6.js.map → chunk-WJHTNDTQ.js.map} +4 -4
  49. package/dist/chunks/{chunk-VNWCN47G.js → chunk-YNMEZ4EZ.js} +2 -2
  50. package/dist/chunks/{renderSvg-GF64RZ6B.js → renderSvg-PEQY7XLR.js} +2 -2
  51. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js +4 -4
  52. package/dist/jbrowse-plugin-graphgenomeviewer.esm.js.map +4 -4
  53. package/package.json +2 -2
  54. package/src/GraphAddTrackWorkflow/AddTrackWorkflow.test.tsx +7 -5
  55. package/src/GraphAddTrackWorkflow/AddTrackWorkflow.tsx +2 -2
  56. package/src/GraphAddTrackWorkflow/buildTrackConfig.ts +13 -6
  57. package/src/GraphTrack/GraphTrack.test.ts +68 -0
  58. package/src/GraphTrack/index.ts +8 -5
  59. package/src/RgfaTabixAdapter/index.ts +3 -2
  60. package/src/WalkTabixSyntenyAdapter/walkLanes.ts +1 -1
  61. package/src/graphTrackDefaults/graphTrackDefaults.test.ts +80 -3
  62. package/src/graphTrackDefaults/guessAdapter.ts +62 -0
  63. package/src/graphTrackDefaults/index.ts +16 -51
  64. package/src/panSNAliases/panSNAliases.test.ts +40 -6
  65. package/src/panSNAliases/trackAdapterConfig.ts +49 -10
  66. package/src/version.ts +1 -1
  67. package/dist/chunks/AddTrackWorkflow-IOPTETLH.js +0 -2
  68. package/dist/chunks/WalkTabixSyntenyAdapter-576RE5OE.js +0 -2
  69. package/dist/chunks/chunk-CGPYVMGQ.js +0 -2
  70. package/dist/chunks/chunk-CGPYVMGQ.js.map +0 -7
  71. package/dist/chunks/chunk-OPWSPSAE.js +0 -2
  72. package/dist/chunks/chunk-U6SNNNFV.js +0 -2
  73. package/dist/chunks/chunk-U6SNNNFV.js.map +0 -7
  74. package/dist/chunks/chunk-WE7XHNAH.js +0 -4
  75. package/dist/chunks/chunk-WE7XHNAH.js.map +0 -7
  76. package/dist/chunks/chunk-WO644UAC.js +0 -3
  77. package/dist/chunks/chunk-WO644UAC.js.map +0 -7
  78. package/dist/chunks/chunk-ZA5GPTUM.js +0 -2
  79. /package/dist/chunks/{GraphGenomeView-RD2XGX6D.js.map → GraphGenomeView-HCN57HV4.js.map} +0 -0
  80. /package/dist/chunks/{GraphTrackSettingsDialog-R3XOY32L.js.map → GraphTrackSettingsDialog-ZNZWUEN3.js.map} +0 -0
  81. /package/dist/chunks/{HighlightColorDialog-AKPIC56I.js.map → HighlightColorDialog-3H2H2LPS.js.map} +0 -0
  82. /package/dist/chunks/{LinearGraphDisplay-RRAXTQFC.js.map → LinearGraphDisplay-W5IT3HYI.js.map} +0 -0
  83. /package/dist/chunks/{MinigraphBubbleAdapter-2YTXBZYS.js.map → MinigraphBubbleAdapter-TTGZ45BF.js.map} +0 -0
  84. /package/dist/chunks/{RgfaTabixAdapter-RCGS6YVM.js.map → RgfaTabixAdapter-A274AVUU.js.map} +0 -0
  85. /package/dist/chunks/{WalkFormsAdapter-3M5A4JL3.js.map → WalkFormsAdapter-7RD7ZAHG.js.map} +0 -0
  86. /package/dist/chunks/{chunk-ULPW4VGT.js.map → chunk-5QJ2ANXK.js.map} +0 -0
  87. /package/dist/chunks/{chunk-SVDQVLEU.js.map → chunk-7HJWQFKE.js.map} +0 -0
  88. /package/dist/chunks/{chunk-DIGIM3XY.js.map → chunk-DQC5K7EW.js.map} +0 -0
  89. /package/dist/chunks/{chunk-HRTRECXN.js.map → chunk-HTH7NAV4.js.map} +0 -0
  90. /package/dist/chunks/{chunk-ZA5GPTUM.js.map → chunk-KACKTX2U.js.map} +0 -0
  91. /package/dist/chunks/{chunk-VNWCN47G.js.map → chunk-YNMEZ4EZ.js.map} +0 -0
  92. /package/dist/chunks/{renderSvg-GF64RZ6B.js.map → renderSvg-PEQY7XLR.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{s as Ve}from"./chunk-M2D7NUOY.js";import{b as ze}from"./chunk-VNWCN47G.js";import{a as He}from"./chunk-CL4PYWKC.js";import{a as $e,c as Ye}from"./chunk-TC265JAP.js";function qe(e){let r=[],t=0,o;for(let n=0,i=e.length;n<i;n++){let a=e.charCodeAt(n);if(a>=48&&a<=57)t=t*10+a-48;else if(a===58)o=t,t=0;else{let f=e[n];f==="M"||f==="="||f==="X"?r.push({own:o===void 0?t:o,mate:t,op:"M"}):f==="I"?r.push({own:0,mate:t,op:f}):(f==="D"||f==="N")&&r.push({own:t,mate:0,op:f}),o=void 0,t=0}}return r}function Ae(e){let r="";for(let{own:t,mate:o,op:n}of qe(e))r+=n==="M"?t===0?`${o}I`:o===0?`${t}D`:`${t}M`:`${n==="I"?o:t}${n}`;return r}var Se=2**28-1;function ve(e,r,t){for(let o=r;o>0;o-=Se)e.push((Math.min(o,Se)<<4|t)>>>0)}function kr(e,r,t){if(r===t)ve(e,r,0);else{let o=Math.ceil(Math.max(r,t)/Se);for(let n=0;n<o;n++){let i=Math.floor(r*(n+1)/o)-Math.floor(r*n/o),a=Math.floor(t*(n+1)/o)-Math.floor(t*n/o);e.push((i<<4|9)>>>0,(a<<4|9)>>>0)}}}function _e(e){let r=[];for(let{own:t,mate:o,op:n}of qe(e))n==="M"?kr(r,t,o):n==="I"?ve(r,o,1):ve(r,t,n==="N"?3:2);return Uint32Array.from(r)}function Gr(e){return e>=48&&e<=57}function Dr(e){return e!==void 0&&/[A-Za-z]/.test(e)}function Ke(e,r){let t=r;for(;t<e.length&&Dr(e[t]);)t++;return t}function Qe(e,r){let t=r,o=0;for(;t<e.length&&Gr(e.charCodeAt(t));)o=o*10+(e.charCodeAt(t)-48),t++;return{value:o,next:t}}function rr(e,r){let t=0;for(;t<e.length;){let o=e[t];if(o===":"){let{value:n,next:i}=Qe(e,t+1);r(":",n,n,t+1,i),t=i}else if(o==="="){let n=Ke(e,t+1),i=n-t-1;r("=",i,i,t+1,n),t=n}else if(o==="*")r("*",1,1,t+1,Math.min(t+3,e.length)),t+=3;else if(o==="+"||o==="-"){let n=Ke(e,t+1),i=n-t-1;r(o,o==="-"?i:0,o==="+"?i:0,t+1,n),t=n}else if(o==="~"){let{value:n,next:i}=Qe(e,t+3),a=Math.min(i+2,e.length);r("~",n,0,t+1,a),t=a}else t++}}function Ce(e,r,t,o){let n=t??Number.NEGATIVE_INFINITY,i=o??Number.POSITIVE_INFINITY,a=0;rr(e,(f,p,s,c,u)=>{if(f==="*")a>=n&&a<i&&r(88,a,1,e[c+1]??"",-1,0,0);else if(f==="+"){if(a>=n&&a<=i){let m=e.slice(c,u);r(73,a,s,m,-1,0,s)}}else(f==="-"||f==="~")&&a<i&&a+p>n&&r(f==="-"?68:78,a,p,"",-1,0,0);a+=p})}function tr(e,r,t,o){let n=0,i=0,a=[],f=t&&r;for(let p=0,s=e.length;p<s;p++){let c=e[p],u=c>>>4,m=c&15;if(m===0||m===7){if(f)for(let l=0;l<u;l++)(r.charCodeAt(i+l)|32)!==(t.charCodeAt(n+l)|32)&&a.push({start:n+l,type:"mismatch",base:r[i+l],altbase:t[n+l],length:1});i+=u,n+=u}else if(m===1)a.push({start:n,type:"insertion",insertlen:u,insertedBases:r?.slice(i,i+u),length:0}),i+=u;else if(m===2)a.push({start:n,type:"deletion",length:u}),n+=u;else if(m===3)a.push({start:n,type:"skip",length:u}),n+=u;else if(m===8){for(let l=0;l<u;l++)a.push({start:n+l,type:"mismatch",base:r?.[i+l]||"X",qual:o?.[i+l],length:1});i+=u,n+=u}else m===5?a.push({start:n,type:"hardclip",cliplen:u,length:1}):m===4&&(a.push({start:n,type:"softclip",cliplen:u,length:1}),i+=u)}return a}function or(e,r,t,o,n){if(!r)return[];let i=[],a=r.length,f=o.length,p=n!==void 0,s=t.length,c=!1;for(let b=0;b<s;b++)if(t[b].type==="skip"){c=!0;break}let u=0,m=0,l=0,y=0,d=0,x=0,g=e.length;for(;x<g;){let b=e.charCodeAt(x);if(b>=48&&b<=57){let v=0;for(;x<g;){let S=e.charCodeAt(x);if(S>=48&&S<=57)v=v*10+(S-48),x++;else break}u+=v}else if(b===94)for(x++;x<g&&e.charCodeAt(x)>=65;)x++,u++;else if(b>=65){let v=e[x];if(x++,c&&s>0)for(let I=d;I<s;I++){let R=t[I];R.type==="skip"&&u>=R.start&&(u+=R.length,d=I+1)}let S=l,C=y;for(let I=m;I<a&&C<=u;I++,m=I){let R=r[I],L=R>>>4,A=R&15;A===4||A===1?S+=L:A===2||A===6||A===3?C+=L:A!==5&&(S+=L,C+=L)}l=S,y=C;let F=S-(C-u),q=F<f?o[F]:"X";i.push({start:u,base:q,qual:p?n[F]:void 0,altbase:v,length:1,type:"mismatch"}),u++}else x++}return i}var nr={77:0,73:1,68:2,78:3,83:4,72:5,80:6,61:7,88:8};function ir(e=""){let r=0,t=[];for(let o=0,n=e.length;o<n;o++){let i=e.charCodeAt(o);if(i>=48&&i<=57)r=r*10+(i-48);else{let a=nr[i];t.push(r<<4|a),r=0}}return t}function Te(e=""){let r=0;for(let i=0,a=e.length;i<a;i++){let f=e.charCodeAt(i);(f<48||f>57)&&r++}let t=new Uint32Array(r),o=0,n=0;for(let i=0,a=e.length;i<a;i++){let f=e.charCodeAt(i);f>=48&&f<=57?o=o*10+(f-48):(t[n++]=o<<4|nr[f],o=0)}return t}function J(e,r,t,o,n){let i=ir(e),a=e?tr(i,t,o,n):[];return r&&t?a.concat(or(r,i,a,t,n)):a}var N=class extends $e{get(r){return r==="mismatches"?J(this.walkableCigar):r==="clipLengthAtStartOfRead"?this.clipLengthAtStartOfRead:r==="name"?super.get("name")??this.mate?.refName:super.get(r)}get mate(){return super.get("mate")}get walkableCigar(){let r=super.get("CIGAR"),t=super.get("coarseCigar");return typeof r=="string"?r:typeof t=="string"?Ae(t):void 0}get clipLengthAtStartOfRead(){return this.mate?.start??0}forEachMismatch(r,t){let o=this.get("start"),n=t?.start===void 0?void 0:t.start-o,i=t?.end===void 0?void 0:t.end-o,a=this.get("cs");if(a)Ce(a,r,n,i);else{let f=n??Number.NEGATIVE_INFINITY,p=i??Number.POSITIVE_INFINITY;for(let s of J(this.walkableCigar))(s.type==="deletion"||s.type==="skip"?s.start<p&&s.start+s.length>f:s.start>=f&&s.start<=p)&&(s.type==="mismatch"?r(88,s.start,s.length,s.base,s.qual??-1,0,0):s.type==="insertion"?r(73,s.start,s.length,s.insertedBases??"",-1,0,s.insertlen):s.type==="deletion"?r(68,s.start,s.length,"",-1,0,0):s.type==="skip"&&r(78,s.start,s.length,"",-1,0,0))}}};var we=function(e,r){return we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])},we(e,r)};function H(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");we(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}function ar(e,r,t,o){function n(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function f(c){try{s(o.next(c))}catch(u){a(u)}}function p(c){try{s(o.throw(c))}catch(u){a(u)}}function s(c){c.done?i(c.value):n(c.value).then(f,p)}s((o=o.apply(e,r||[])).next())})}function ee(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=f(0),a.throw=f(1),a.return=f(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(s){return function(c){return p([s,c])}}function p(s){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(t=0)),t;)try{if(o=1,n&&(i=s[0]&2?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,n=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1],i=s;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(s);break}i[2]&&t.ops.pop(),t.trys.pop();continue}s=r.call(e,t)}catch(c){s=[6,c],n=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function P(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],o=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var o=t.call(e),n,i=[],a;try{for(;(r===void 0||r-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(f){a={error:f}}finally{try{n&&!n.done&&(t=o.return)&&t.call(o)}finally{if(a)throw a.error}}return i}function j(e,r,t){if(t||arguments.length===2)for(var o=0,n=r.length,i;o<n;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return e.concat(i||Array.prototype.slice.call(r))}function k(e){return this instanceof k?(this.v=e,this):new k(e)}function sr(e,r,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=t.apply(e,r||[]),n,i=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),f("next"),f("throw"),f("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(l){return function(y){return Promise.resolve(y).then(l,u)}}function f(l,y){o[l]&&(n[l]=function(d){return new Promise(function(x,g){i.push([l,d,x,g])>1||p(l,d)})},y&&(n[l]=y(n[l])))}function p(l,y){try{s(o[l](y))}catch(d){m(i[0][3],d)}}function s(l){l.value instanceof k?Promise.resolve(l.value.v).then(c,u):m(i[0][2],l)}function c(l){p("next",l)}function u(l){p("throw",l)}function m(l,y){l(y),i.shift(),i.length&&p(i[0][0],i[0][1])}}function fr(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],t;return r?r.call(e):(e=typeof P=="function"?P(e):e[Symbol.iterator](),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(i){t[i]=e[i]&&function(a){return new Promise(function(f,p){a=e[i](a),n(f,p,a.done,a.value)})}}function n(i,a,f,p){Promise.resolve(p).then(function(s){i({value:s,done:f})},a)}}function h(e){return typeof e=="function"}function pr(e){var r=function(o){Error.call(o),o.stack=new Error().stack},t=e(r);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var re=pr(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
1
+ import{s as Ve}from"./chunk-M2D7NUOY.js";import{b as ze}from"./chunk-YNMEZ4EZ.js";import{a as He}from"./chunk-2FG67WIZ.js";import{a as $e,c as Ye}from"./chunk-TC265JAP.js";function qe(e){let r=[],t=0,o;for(let n=0,i=e.length;n<i;n++){let a=e.charCodeAt(n);if(a>=48&&a<=57)t=t*10+a-48;else if(a===58)o=t,t=0;else{let f=e[n];f==="M"||f==="="||f==="X"?r.push({own:o===void 0?t:o,mate:t,op:"M"}):f==="I"?r.push({own:0,mate:t,op:f}):(f==="D"||f==="N")&&r.push({own:t,mate:0,op:f}),o=void 0,t=0}}return r}function Ae(e){let r="";for(let{own:t,mate:o,op:n}of qe(e))r+=n==="M"?t===0?`${o}I`:o===0?`${t}D`:`${t}M`:`${n==="I"?o:t}${n}`;return r}var Se=2**28-1;function ve(e,r,t){for(let o=r;o>0;o-=Se)e.push((Math.min(o,Se)<<4|t)>>>0)}function kr(e,r,t){if(r===t)ve(e,r,0);else{let o=Math.ceil(Math.max(r,t)/Se);for(let n=0;n<o;n++){let i=Math.floor(r*(n+1)/o)-Math.floor(r*n/o),a=Math.floor(t*(n+1)/o)-Math.floor(t*n/o);e.push((i<<4|9)>>>0,(a<<4|9)>>>0)}}}function _e(e){let r=[];for(let{own:t,mate:o,op:n}of qe(e))n==="M"?kr(r,t,o):n==="I"?ve(r,o,1):ve(r,t,n==="N"?3:2);return Uint32Array.from(r)}function Gr(e){return e>=48&&e<=57}function Dr(e){return e!==void 0&&/[A-Za-z]/.test(e)}function Ke(e,r){let t=r;for(;t<e.length&&Dr(e[t]);)t++;return t}function Qe(e,r){let t=r,o=0;for(;t<e.length&&Gr(e.charCodeAt(t));)o=o*10+(e.charCodeAt(t)-48),t++;return{value:o,next:t}}function rr(e,r){let t=0;for(;t<e.length;){let o=e[t];if(o===":"){let{value:n,next:i}=Qe(e,t+1);r(":",n,n,t+1,i),t=i}else if(o==="="){let n=Ke(e,t+1),i=n-t-1;r("=",i,i,t+1,n),t=n}else if(o==="*")r("*",1,1,t+1,Math.min(t+3,e.length)),t+=3;else if(o==="+"||o==="-"){let n=Ke(e,t+1),i=n-t-1;r(o,o==="-"?i:0,o==="+"?i:0,t+1,n),t=n}else if(o==="~"){let{value:n,next:i}=Qe(e,t+3),a=Math.min(i+2,e.length);r("~",n,0,t+1,a),t=a}else t++}}function Ce(e,r,t,o){let n=t??Number.NEGATIVE_INFINITY,i=o??Number.POSITIVE_INFINITY,a=0;rr(e,(f,p,s,c,u)=>{if(f==="*")a>=n&&a<i&&r(88,a,1,e[c+1]??"",-1,0,0);else if(f==="+"){if(a>=n&&a<=i){let m=e.slice(c,u);r(73,a,s,m,-1,0,s)}}else(f==="-"||f==="~")&&a<i&&a+p>n&&r(f==="-"?68:78,a,p,"",-1,0,0);a+=p})}function tr(e,r,t,o){let n=0,i=0,a=[],f=t&&r;for(let p=0,s=e.length;p<s;p++){let c=e[p],u=c>>>4,m=c&15;if(m===0||m===7){if(f)for(let l=0;l<u;l++)(r.charCodeAt(i+l)|32)!==(t.charCodeAt(n+l)|32)&&a.push({start:n+l,type:"mismatch",base:r[i+l],altbase:t[n+l],length:1});i+=u,n+=u}else if(m===1)a.push({start:n,type:"insertion",insertlen:u,insertedBases:r?.slice(i,i+u),length:0}),i+=u;else if(m===2)a.push({start:n,type:"deletion",length:u}),n+=u;else if(m===3)a.push({start:n,type:"skip",length:u}),n+=u;else if(m===8){for(let l=0;l<u;l++)a.push({start:n+l,type:"mismatch",base:r?.[i+l]||"X",qual:o?.[i+l],length:1});i+=u,n+=u}else m===5?a.push({start:n,type:"hardclip",cliplen:u,length:1}):m===4&&(a.push({start:n,type:"softclip",cliplen:u,length:1}),i+=u)}return a}function or(e,r,t,o,n){if(!r)return[];let i=[],a=r.length,f=o.length,p=n!==void 0,s=t.length,c=!1;for(let b=0;b<s;b++)if(t[b].type==="skip"){c=!0;break}let u=0,m=0,l=0,y=0,d=0,x=0,g=e.length;for(;x<g;){let b=e.charCodeAt(x);if(b>=48&&b<=57){let v=0;for(;x<g;){let S=e.charCodeAt(x);if(S>=48&&S<=57)v=v*10+(S-48),x++;else break}u+=v}else if(b===94)for(x++;x<g&&e.charCodeAt(x)>=65;)x++,u++;else if(b>=65){let v=e[x];if(x++,c&&s>0)for(let I=d;I<s;I++){let R=t[I];R.type==="skip"&&u>=R.start&&(u+=R.length,d=I+1)}let S=l,C=y;for(let I=m;I<a&&C<=u;I++,m=I){let R=r[I],L=R>>>4,A=R&15;A===4||A===1?S+=L:A===2||A===6||A===3?C+=L:A!==5&&(S+=L,C+=L)}l=S,y=C;let F=S-(C-u),q=F<f?o[F]:"X";i.push({start:u,base:q,qual:p?n[F]:void 0,altbase:v,length:1,type:"mismatch"}),u++}else x++}return i}var nr={77:0,73:1,68:2,78:3,83:4,72:5,80:6,61:7,88:8};function ir(e=""){let r=0,t=[];for(let o=0,n=e.length;o<n;o++){let i=e.charCodeAt(o);if(i>=48&&i<=57)r=r*10+(i-48);else{let a=nr[i];t.push(r<<4|a),r=0}}return t}function Te(e=""){let r=0;for(let i=0,a=e.length;i<a;i++){let f=e.charCodeAt(i);(f<48||f>57)&&r++}let t=new Uint32Array(r),o=0,n=0;for(let i=0,a=e.length;i<a;i++){let f=e.charCodeAt(i);f>=48&&f<=57?o=o*10+(f-48):(t[n++]=o<<4|nr[f],o=0)}return t}function J(e,r,t,o,n){let i=ir(e),a=e?tr(i,t,o,n):[];return r&&t?a.concat(or(r,i,a,t,n)):a}var N=class extends $e{get(r){return r==="mismatches"?J(this.walkableCigar):r==="clipLengthAtStartOfRead"?this.clipLengthAtStartOfRead:r==="name"?super.get("name")??this.mate?.refName:super.get(r)}get mate(){return super.get("mate")}get walkableCigar(){let r=super.get("CIGAR"),t=super.get("coarseCigar");return typeof r=="string"?r:typeof t=="string"?Ae(t):void 0}get clipLengthAtStartOfRead(){return this.mate?.start??0}forEachMismatch(r,t){let o=this.get("start"),n=t?.start===void 0?void 0:t.start-o,i=t?.end===void 0?void 0:t.end-o,a=this.get("cs");if(a)Ce(a,r,n,i);else{let f=n??Number.NEGATIVE_INFINITY,p=i??Number.POSITIVE_INFINITY;for(let s of J(this.walkableCigar))(s.type==="deletion"||s.type==="skip"?s.start<p&&s.start+s.length>f:s.start>=f&&s.start<=p)&&(s.type==="mismatch"?r(88,s.start,s.length,s.base,s.qual??-1,0,0):s.type==="insertion"?r(73,s.start,s.length,s.insertedBases??"",-1,0,s.insertlen):s.type==="deletion"?r(68,s.start,s.length,"",-1,0,0):s.type==="skip"&&r(78,s.start,s.length,"",-1,0,0))}}};var we=function(e,r){return we=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])},we(e,r)};function H(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");we(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}function ar(e,r,t,o){function n(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function f(c){try{s(o.next(c))}catch(u){a(u)}}function p(c){try{s(o.throw(c))}catch(u){a(u)}}function s(c){c.done?i(c.value):n(c.value).then(f,p)}s((o=o.apply(e,r||[])).next())})}function ee(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,n,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=f(0),a.throw=f(1),a.return=f(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function f(s){return function(c){return p([s,c])}}function p(s){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(t=0)),t;)try{if(o=1,n&&(i=s[0]&2?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,n=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1],i=s;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(s);break}i[2]&&t.ops.pop(),t.trys.pop();continue}s=r.call(e,t)}catch(c){s=[6,c],n=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function P(e){var r=typeof Symbol=="function"&&Symbol.iterator,t=r&&e[r],o=0;if(t)return t.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var o=t.call(e),n,i=[],a;try{for(;(r===void 0||r-- >0)&&!(n=o.next()).done;)i.push(n.value)}catch(f){a={error:f}}finally{try{n&&!n.done&&(t=o.return)&&t.call(o)}finally{if(a)throw a.error}}return i}function j(e,r,t){if(t||arguments.length===2)for(var o=0,n=r.length,i;o<n;o++)(i||!(o in r))&&(i||(i=Array.prototype.slice.call(r,0,o)),i[o]=r[o]);return e.concat(i||Array.prototype.slice.call(r))}function k(e){return this instanceof k?(this.v=e,this):new k(e)}function sr(e,r,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=t.apply(e,r||[]),n,i=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),f("next"),f("throw"),f("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(l){return function(y){return Promise.resolve(y).then(l,u)}}function f(l,y){o[l]&&(n[l]=function(d){return new Promise(function(x,g){i.push([l,d,x,g])>1||p(l,d)})},y&&(n[l]=y(n[l])))}function p(l,y){try{s(o[l](y))}catch(d){m(i[0][3],d)}}function s(l){l.value instanceof k?Promise.resolve(l.value.v).then(c,u):m(i[0][2],l)}function c(l){p("next",l)}function u(l){p("throw",l)}function m(l,y){l(y),i.shift(),i.length&&p(i[0][0],i[0][1])}}function fr(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=e[Symbol.asyncIterator],t;return r?r.call(e):(e=typeof P=="function"?P(e):e[Symbol.iterator](),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(i){t[i]=e[i]&&function(a){return new Promise(function(f,p){a=e[i](a),n(f,p,a.done,a.value)})}}function n(i,a,f,p){Promise.resolve(p).then(function(s){i({value:s,done:f})},a)}}function h(e){return typeof e=="function"}function pr(e){var r=function(o){Error.call(o),o.stack=new Error().stack},t=e(r);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var re=pr(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
2
2
  `+t.map(function(o,n){return n+1+") "+o.toString()}).join(`
3
3
  `):"",this.name="UnsubscriptionError",this.errors=t}});function Oe(e,r){if(e){var t=e.indexOf(r);0<=t&&e.splice(t,1)}}var te=(function(){function e(r){this.initialTeardown=r,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var r,t,o,n,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var f=P(a),p=f.next();!p.done;p=f.next()){var s=p.value;s.remove(this)}}catch(d){r={error:d}}finally{try{p&&!p.done&&(t=f.return)&&t.call(f)}finally{if(r)throw r.error}}else a.remove(this);var c=this.initialTeardown;if(h(c))try{c()}catch(d){i=d instanceof re?d.errors:[d]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var m=P(u),l=m.next();!l.done;l=m.next()){var y=l.value;try{cr(y)}catch(d){i=i??[],d instanceof re?i=j(j([],D(i)),D(d.errors)):i.push(d)}}}catch(d){o={error:d}}finally{try{l&&!l.done&&(n=m.return)&&n.call(m)}finally{if(o)throw o.error}}}if(i)throw new re(i)}},e.prototype.add=function(r){var t;if(r&&r!==this)if(this.closed)cr(r);else{if(r instanceof e){if(r.closed||r._hasParent(this))return;r._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(r)}},e.prototype._hasParent=function(r){var t=this._parentage;return t===r||Array.isArray(t)&&t.includes(r)},e.prototype._addParent=function(r){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(r),t):t?[t,r]:r},e.prototype._removeParent=function(r){var t=this._parentage;t===r?this._parentage=null:Array.isArray(t)&&Oe(t,r)},e.prototype.remove=function(r){var t=this._finalizers;t&&Oe(t,r),r instanceof e&&r._removeParent(this)},e.EMPTY=(function(){var r=new e;return r.closed=!0,r})(),e})();var Zt=te.EMPTY;function oe(e){return e instanceof te||e&&"closed"in e&&h(e.remove)&&h(e.add)&&h(e.unsubscribe)}function cr(e){h(e)?e():e.unsubscribe()}var w={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var U={setTimeout:function(e,r){for(var t=[],o=2;o<arguments.length;o++)t[o-2]=arguments[o];var n=U.delegate;return n?.setTimeout?n.setTimeout.apply(n,j([e,r],D(t))):setTimeout.apply(void 0,j([e,r],D(t)))},clearTimeout:function(e){var r=U.delegate;return(r?.clearTimeout||clearTimeout)(e)},delegate:void 0};function ne(e){U.setTimeout(function(){var r=w.onUnhandledError;if(r)r(e);else throw e})}function Re(){}var ur=(function(){return Me("C",void 0,void 0)})();function lr(e){return Me("E",void 0,e)}function mr(e){return Me("N",e,void 0)}function Me(e,r,t){return{kind:e,value:r,error:t}}var G=null;function dr(e){if(w.useDeprecatedSynchronousErrorHandling){var r=!G;if(r&&(G={errorThrown:!1,error:null}),e(),r){var t=G,o=t.errorThrown,n=t.error;if(G=null,o)throw n}}else e()}function xr(e){w.useDeprecatedSynchronousErrorHandling&&G&&(G.errorThrown=!0,G.error=e)}var z=(function(e){H(r,e);function r(t){var o=e.call(this)||this;return o.isStopped=!1,t?(o.destination=t,oe(t)&&t.add(o)):o.destination=Yr,o}return r.create=function(t,o,n){return new ae(t,o,n)},r.prototype.next=function(t){this.isStopped?Le(mr(t),this):this._next(t)},r.prototype.error=function(t){this.isStopped?Le(lr(t),this):(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped?Le(ur,this):(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},r.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},r})(te);var Br=Function.prototype.bind;function Fe(e,r){return Br.call(e,r)}var Wr=(function(){function e(r){this.partialObserver=r}return e.prototype.next=function(r){var t=this.partialObserver;if(t.next)try{t.next(r)}catch(o){ie(o)}},e.prototype.error=function(r){var t=this.partialObserver;if(t.error)try{t.error(r)}catch(o){ie(o)}else ie(r)},e.prototype.complete=function(){var r=this.partialObserver;if(r.complete)try{r.complete()}catch(t){ie(t)}},e})(),ae=(function(e){H(r,e);function r(t,o,n){var i=e.call(this)||this,a;if(h(t)||!t)a={next:t??void 0,error:o??void 0,complete:n??void 0};else{var f;i&&w.useDeprecatedNextContext?(f=Object.create(t),f.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Fe(t.next,f),error:t.error&&Fe(t.error,f),complete:t.complete&&Fe(t.complete,f)}):a=t}return i.destination=new Wr(a),i}return r})(z);function ie(e){w.useDeprecatedSynchronousErrorHandling?xr(e):ne(e)}function $r(e){throw e}function Le(e,r){var t=w.onStoppedNotification;t&&U.setTimeout(function(){return t(e,r)})}var Yr={closed:!0,next:Re,error:$r,complete:Re};var B=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function hr(e){return e}function yr(e){return e.length===0?hr:e.length===1?e[0]:function(t){return e.reduce(function(o,n){return n(o)},t)}}var _=(function(){function e(r){r&&(this._subscribe=r)}return e.prototype.lift=function(r){var t=new e;return t.source=this,t.operator=r,t},e.prototype.subscribe=function(r,t,o){var n=this,i=zr(r)?r:new ae(r,t,o);return dr(function(){var a=n,f=a.operator,p=a.source;i.add(f?f.call(i,p):p?n._subscribe(i):n._trySubscribe(i))}),i},e.prototype._trySubscribe=function(r){try{return this._subscribe(r)}catch(t){r.error(t)}},e.prototype.forEach=function(r,t){var o=this;return t=gr(t),new t(function(n,i){var a=new ae({next:function(f){try{r(f)}catch(p){i(p),a.unsubscribe()}},error:i,complete:n});o.subscribe(a)})},e.prototype._subscribe=function(r){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(r)},e.prototype[B]=function(){return this},e.prototype.pipe=function(){for(var r=[],t=0;t<arguments.length;t++)r[t]=arguments[t];return yr(r)(this)},e.prototype.toPromise=function(r){var t=this;return r=gr(r),new r(function(o,n){var i;t.subscribe(function(a){return i=a},function(a){return n(a)},function(){return o(i)})})},e.create=function(r){return new e(r)},e})();function gr(e){var r;return(r=e??w.Promise)!==null&&r!==void 0?r:Promise}function Hr(e){return e&&h(e.next)&&h(e.error)&&h(e.complete)}function zr(e){return e&&e instanceof z||Hr(e)&&oe(e)}function Vr(e){return h(e?.lift)}function E(e){return function(r){if(Vr(r))return r.lift(function(t){try{return e(t,this)}catch(o){this.error(o)}});throw new TypeError("Unable to lift unknown Observable type")}}function M(e,r,t,o,n){return new qr(e,r,t,o,n)}var qr=(function(e){H(r,e);function r(t,o,n,i,a,f){var p=e.call(this,t)||this;return p.onFinalize=a,p.shouldUnsubscribe=f,p._next=o?function(s){try{o(s)}catch(c){t.error(c)}}:e.prototype._next,p._error=i?function(s){try{i(s)}catch(c){t.error(c)}finally{this.unsubscribe()}}:e.prototype._error,p._complete=n?function(){try{n()}catch(s){t.error(s)}finally{this.unsubscribe()}}:e.prototype._complete,p}return r.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var o=this.closed;e.prototype.unsubscribe.call(this),!o&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},r})(z);var se=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"});function fe(e){return h(e?.then)}function pe(e){return h(e[B])}function ce(e){return Symbol.asyncIterator&&h(e?.[Symbol.asyncIterator])}function ue(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Kr(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var le=Kr();function me(e){return h(e?.[le])}function de(e){return sr(this,arguments,function(){var t,o,n,i;return ee(this,function(a){switch(a.label){case 0:t=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,k(t.read())];case 3:return o=a.sent(),n=o.value,i=o.done,i?[4,k(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,k(n)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function xe(e){return h(e?.getReader)}function O(e){if(e instanceof _)return e;if(e!=null){if(pe(e))return Qr(e);if(se(e))return Xr(e);if(fe(e))return Zr(e);if(ce(e))return br(e);if(me(e))return Jr(e);if(xe(e))return et(e)}throw ue(e)}function Qr(e){return new _(function(r){var t=e[B]();if(h(t.subscribe))return t.subscribe(r);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Xr(e){return new _(function(r){for(var t=0;t<e.length&&!r.closed;t++)r.next(e[t]);r.complete()})}function Zr(e){return new _(function(r){e.then(function(t){r.closed||(r.next(t),r.complete())},function(t){return r.error(t)}).then(null,ne)})}function Jr(e){return new _(function(r){var t,o;try{for(var n=P(e),i=n.next();!i.done;i=n.next()){var a=i.value;if(r.next(a),r.closed)return}}catch(f){t={error:f}}finally{try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(t)throw t.error}}r.complete()})}function br(e){return new _(function(r){rt(e,r).catch(function(t){return r.error(t)})})}function et(e){return br(de(e))}function rt(e,r){var t,o,n,i;return ar(this,void 0,void 0,function(){var a,f;return ee(this,function(p){switch(p.label){case 0:p.trys.push([0,5,6,11]),t=fr(e),p.label=1;case 1:return[4,t.next()];case 2:if(o=p.sent(),!!o.done)return[3,4];if(a=o.value,r.next(a),r.closed)return[2];p.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return f=p.sent(),n={error:f},[3,11];case 6:return p.trys.push([6,,9,10]),o&&!o.done&&(i=t.return)?[4,i.call(t)]:[3,8];case 7:p.sent(),p.label=8;case 8:return[3,10];case 9:if(n)throw n.error;return[7];case 10:return[7];case 11:return r.complete(),[2]}})})}function T(e,r,t,o,n){o===void 0&&(o=0),n===void 0&&(n=!1);var i=r.schedule(function(){t(),n?e.add(this.schedule(null,o)):this.unsubscribe()},o);if(e.add(i),!n)return i}function he(e,r){return r===void 0&&(r=0),E(function(t,o){t.subscribe(M(o,function(n){return T(o,e,function(){return o.next(n)},r)},function(){return T(o,e,function(){return o.complete()},r)},function(n){return T(o,e,function(){return o.error(n)},r)}))})}function ye(e,r){return r===void 0&&(r=0),E(function(t,o){o.add(e.schedule(function(){return t.subscribe(o)},r))})}function Sr(e,r){return O(e).pipe(ye(r),he(r))}function vr(e,r){return O(e).pipe(ye(r),he(r))}function Ar(e,r){return new _(function(t){var o=0;return r.schedule(function(){o===e.length?t.complete():(t.next(e[o++]),t.closed||this.schedule())})})}function _r(e,r){return new _(function(t){var o;return T(t,r,function(){o=e[le](),T(t,r,function(){var n,i,a;try{n=o.next(),i=n.value,a=n.done}catch(f){t.error(f);return}a?t.complete():t.next(i)},0,!0)}),function(){return h(o?.return)&&o.return()}})}function ge(e,r){if(!e)throw new Error("Iterable cannot be null");return new _(function(t){T(t,r,function(){var o=e[Symbol.asyncIterator]();T(t,r,function(){o.next().then(function(n){n.done?t.complete():t.next(n.value)})},0,!0)})})}function Cr(e,r){return ge(de(e),r)}function Ir(e,r){if(e!=null){if(pe(e))return Sr(e,r);if(se(e))return Ar(e,r);if(fe(e))return vr(e,r);if(ce(e))return ge(e,r);if(me(e))return _r(e,r);if(xe(e))return Cr(e,r)}throw ue(e)}function Ne(e,r){return r?Ir(e,r):O(e)}function V(e,r){return E(function(t,o){var n=0;t.subscribe(M(o,function(i){o.next(e.call(r,i,n++))}))})}function Er(e,r,t,o,n,i,a,f){var p=[],s=0,c=0,u=!1,m=function(){u&&!p.length&&!s&&r.complete()},l=function(d){return s<o?y(d):p.push(d)},y=function(d){i&&r.next(d),s++;var x=!1;O(t(d,c++)).subscribe(M(r,function(g){n?.(g),i?l(g):r.next(g)},function(){x=!0},void 0,function(){if(x)try{s--;for(var g=function(){var b=p.shift();a?T(r,a,function(){return y(b)}):y(b)};p.length&&s<o;)g();m()}catch(b){r.error(b)}}))};return e.subscribe(M(r,l,function(){u=!0,m()})),function(){f?.()}}function W(e,r,t){return t===void 0&&(t=1/0),h(r)?W(function(o,n){return V(function(i,a){return r(o,i,n,a)})(O(e(o,n)))},t):(typeof r=="number"&&(t=r),E(function(o,n){return Er(o,n,e,t)}))}function Tr(e,r,t,o,n){return function(i,a){var f=t,p=r,s=0;i.subscribe(M(a,function(c){var u=s++;p=f?e(p,c,u):(f=!0,c),o&&a.next(p)},n&&(function(){f&&a.next(p),a.complete()})))}}function wr(e,r){return E(Tr(e,r,arguments.length>=2,!1,!0))}var tt=function(e,r){return e.push(r),e};function be(){return E(function(e,r){wr(tt,[])(e).subscribe(r)})}var ot=397,nt=387,it=385;function Or(e){return(1<<e&ot)!==0}function Rr(e){return(1<<e&nt)!==0}function Mr(e){return(1<<e&it)!==0}function Pe(e,r,t,o,n,i,a){let f=n===-1?-1:1,p=r,s=n===-1?o:t,c=[],u=1/0,m=-1/0,l=1/0,y=-1/0,d=(x,g)=>{l=Math.min(l,x,g),y=Math.max(y,x,g)};for(let x=0;x<e.length;x++){let g=e[x],b=g>>>4,v=g&15,S=v===9,C=S||Or(v)?b:0,F=S?e[++x]>>>4:Rr(v)?b:0,q=p+C,I=s+F*f,R=p,L=q;if(L>=i&&R<=a)if(C>0){let A=Math.max(R,i),$=Math.min(L,a);if($>A)if(u=Math.min(u,A),m=Math.max(m,$),S){let je=F/b,Ue=$-A,Be=Math.round(Ue*je),We=Math.round(s+(A-p)*je*f);c.push(Ue<<4|9,Be<<4|9),d(We,We+Be*f)}else c.push($-A<<4|v),Mr(v)?d(s+(A-p)*f,s+($-p)*f):d(s,s)}else F>0&&(S?c.push(g,e[x]):c.push(g),u=Math.min(u,p),m=Math.max(m,p),d(s,I));if(p=q,s=I,p>a)break}if(c.length!==0)return{start:u,end:m,mateStart:l,mateEnd:y,cigar:Uint32Array.from(c)}}function at(e){return e===1||e===2||e===3}function ke(e,r,t,o,n,i){let a=n===-1?-1:1,f=[],p=r,s=n===-1?o:t,c,u=!1,m=()=>{c!==void 0&&u&&c.qHi>c.qLo&&f.push({start:c.qLo,end:c.qHi,mateStart:c.tLo,mateEnd:c.tHi,cigar:Uint32Array.from(c.ops)}),c=void 0,u=!1};for(let l=0;l<e.length;l++){let y=e[l],d=y>>>4,x=y&15,g=x===9,b=g?e[++l]:void 0,v=g||Or(x)?d:0,S=b!==void 0?b>>>4:Rr(x)?d:0,C=s+S*a;at(x)&&d>=i?m():(v>0||S>0)&&(c===void 0&&(c={qLo:p,qHi:p,tLo:s,tHi:s,ops:[]}),c.qHi=p+v,c.tLo=Math.min(c.tLo,s,C),c.tHi=Math.max(c.tHi,s,C),c.ops.push(y),b!==void 0&&c.ops.push(b),u=u||g||Mr(x)),p+=v,s=C}return m(),f}function Fr(e){let r=e.get("CIGAR");return typeof r=="string"?r:void 0}function Lr(e){let r=e.get("coarseCigar");return typeof r=="string"?r:void 0}function Ge(e){let r=Fr(e),t=r===void 0?Lr(e):void 0;return r!==void 0?Te(r):t!==void 0?_e(t):void 0}var st=["CIGAR","cs","coarseCigar","cg","cr"];function ft(e){return typeof e=="object"&&e!==null&&"refName"in e&&"start"in e&&"end"in e&&typeof e.refName=="string"&&typeof e.start=="number"&&typeof e.end=="number"}function pt(e){let r=e.get("mate");return ft(r)?r:void 0}function ct(e,r,t,o){let n=Math.max(e.start,o.start),i=Math.min(e.end,o.end),a=(r.end-r.start)/Math.max(e.end-e.start,1),f=c=>t===-1?r.end-(c-e.start)*a:r.start+(c-e.start)*a,p=Math.round(f(n)),s=Math.round(f(i));return i>n?{start:n,end:i,mateStart:Math.min(p,s),mateEnd:Math.max(p,s)}:void 0}function ut(e,r,t,o,n){let i={start:e.get("start"),end:e.get("end")},a=e.get("strand")===-1?-1:1,f=i.start>=t.start&&i.end<=t.end,p=f&&o===void 0&&!n?void 0:Ge(e);if(p===void 0){let s=f?{...i,mateStart:r.start,mateEnd:r.end}:ct(i,r,a,t);return s===void 0?[]:[s]}else return(o===void 0?[{...i,mateStart:r.start,mateEnd:r.end,cigar:p}]:ke(p,i.start,r.start,r.end,a,o)).flatMap(c=>{let u=Pe(c.cigar,c.start,c.mateStart,c.mateEnd,a,t.start,t.end);return u===void 0?[]:[u]})}function lt(e,r,t,o,n,i){let a=`:${o.start}-${o.end}${n}`,f=e.toJSON(),p={...f,uniqueId:`${e.id()}${a}`,recordId:f.recordId??e.id(),start:t.start,end:t.end,mate:{...r,start:t.mateStart,end:t.mateEnd}};f.syntenyId!==void 0&&(p.syntenyId=`${String(f.syntenyId)}${a}`);for(let s of st)delete p[s];return i&&t.cigar&&(p.alignmentOps=t.cigar),new N(p)}function Nr(e,r,t,o=!1){let n=pt(e);if(n===void 0||e.get("spansWindow"))return[e];{let i=ut(e,n,r,t,o);return i.map((a,f)=>lt(e,n,a,r,i.length>1?`/${f}`:"",o))}}var Pr=class extends ze{constructor(){super(...arguments);this.recordsAreAlignments=!0}static{this.capabilities=["getFeatures","getRefNames"]}async hasDataForRefName(){return!0}getFeaturesInMultipleRegions(t,o={}){let{clipToRegion:n,splitAtGapBp:i,keepAlignment:a,...f}=o,p=n&&this.recordsAreAlignments,s=Ye(f.statusCallback);return Ne(t).pipe(W((c,u)=>this.getFeatures(c,{...f,statusCallback:s()}).pipe(W(m=>p?Nr(m,m.get("assemblyName")===c.assemblyName?c:{start:m.get("start"),end:m.get("end")},i,a):[m]),be(),V(m=>({index:u,features:m})))),be(),W(c=>c.sort((u,m)=>u.index-m.index).flatMap(u=>u.features)))}};var De=class extends Error{constructor(t){super(`a pair query names both lanes: queryAssemblyName ${t} came without a targetAssemblyName`);this.name="PairTargetError"}};function Xi(e){let{lanePairs:r,queryAssemblyName:t,targetAssemblyName:o}=e;if(r?.length)return r;if(t===void 0)return[];if(o===void 0)throw new De(t);return[{queryAssemblyName:t,targetAssemblyName:o}]}function Zi(e){let[r]=e;return e.length===1&&r?`Reading ${r.queryAssemblyName} against ${r.targetAssemblyName}`:`Reading ${e.length} lane pairs`}function Ji(e,r){return e[r]??e[He(r)]??r}function mt(e,r){let t=Math.max(1,r);return e>=10*t?Math.ceil(e/t):Math.max(11,Math.ceil(10*e/t))/10}function ta(e,r){if(Ve(e)&&e instanceof Error){let{fitsBp:t}=e;e.message=e.message.replace("to see the graph","to see lanes"),typeof t=="number"&&(e.message=e.message.replace(/^Zoom in to about [\d.,]*\d[KM]?bp/,`Zoom in about ${mt(r,t)}\xD7`))}return e}function ia({target:e,query:r,strand:t,cigar:o,matches:n,columns:i}){let a=`${e.name}:${e.start}-${e.end}|${r.name}:${r.start}-${r.end}`;return new N({uniqueId:a,assemblyName:e.assemblyName,refName:e.refName,start:e.start,end:e.end,type:"match",strand:t==="-"?-1:1,CIGAR:o,syntenyId:a,identity:n/Math.max(i,1),numMatches:n,blockLen:i,mate:{refName:r.refName,start:r.start,end:r.end,assemblyName:r.assemblyName}})}export{N as a,Pr as b,De as c,Xi as d,Zi as e,Ji as f,ta as g,ia as h};
4
- //# sourceMappingURL=chunk-SVDQVLEU.js.map
4
+ //# sourceMappingURL=chunk-7HJWQFKE.js.map
@@ -1,4 +1,4 @@
1
- import{Aa as Ye,Cb as ue,D as $e,Db as de,E as Ke,F as Xe,G as Ue,Ia as P,Ib as Qe,J as Fe,Ja as se,Kb as W,Lb as be,Mb as fe,Oa as ze,Pa as ie,Qb as et,Sa as Ve,Sb as tt,Ub as nt,Va as qe,Wa as le,Wb as he,_a as ce,_b as rt,a as Se,b as X,dc as ot,eb as je,f as Q,g as ee,jc as at,lc as st,mb as Je,ob as pe,r as Ie,rb as Ze,s as Be,t as We,u as oe,w as Ge,x as De,y as He}from"./chunk-WO644UAC.js";import{D as ae,f as Oe,m as A,p as re,q as Ae,r as I}from"./chunk-4DQWDJG7.js";import{A as Ee,E as ne,T as ve,U as Ne,Z as Te,m as T,o as F,p as te,x as _e}from"./chunk-OPWSPSAE.js";import{b as _,c as B}from"./chunk-W5HHWDGZ.js";import{c as Z}from"./chunk-E23AOQPE.js";import{e as K}from"./chunk-FLKXKTS2.js";import{b as Pe,d as L,e as Le,f as Me,g as U,h as Ce}from"./chunk-J2PN6CG3.js";import{a as v,b as p,c as m,d as g}from"./chunk-DUU6T2I5.js";var Et="data-pans-with-drawing";function it(e,t){return{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:t,zIndex:e}}var M=g(function({model:t,zIndex:n,overflow:r="hidden",testId:o,pansWithDrawing:a,children:i}){return p("svg",{style:{...it(n,r),userSelect:a?"none":void 0},width:t.paneWidth,height:t.canvasHeight,"data-testid":o,...a?{[Et]:""}:{},children:i})}),lt=g(function({model:t,children:n}){let{scaleX:r,scaleY:o,translateX:a,translateY:i}=t;return p("g",{transform:`translate(${a} ${i}) scale(${r} ${o})`,children:n})}),C=g(function({model:t,zIndex:n,shown:r=!0,testId:o,paint:a}){let i=Ce(null);return Le(()=>{if(r)return Se(()=>{let s=i.current,u=s?.getContext("2d");if(s&&u){let c=t.paneWidth,d=t.canvasHeight;Ye(st());let b=Qe(s,c,d);u.setTransform(b,0,0,b,0,0),u.clearRect(0,0,c,d),a(u,b)}})},[t,r,a]),p("canvas",{ref:i,"data-testid":r?o:void 0,style:{...it(n),display:r?"block":"none"}})});var Ot=g(function({model:t}){let{bubbleHalos:n,hoveredBubble:r}=t;if(n.length===0)return null;let o=t.contigThickness*et;return p(M,{model:t,zIndex:2,testId:"graph-bubble-halos",children:p(lt,{model:t,children:n.filter(a=>!a.whole&&(!a.tick||r&&_(a.bubble,r))).map(a=>p("path",{d:a.path,fill:"none",stroke:P[a.kind],strokeOpacity:r&&_(a.bubble,r)?.45:t.bubbleFaded(a)?.06:.22,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},B(a.bubble)))})})}),Kn=Ot;var ct=["#d4735e","#d8a94a","#c98aa4"],vt="#e6e6e6",Nt="#555",Tt="bold 11px sans-serif";var ge=e=>ct[e]??vt;function Y(e){let t=String.fromCharCode(65+e%26);return e<26?t:Y(Math.floor(e/26)-1)+t}var z=ct.length;function pt(e,t,n){e.font=Tt,e.textAlign="center",e.textBaseline="middle";for(let{row:r,start:o,bp:a,block:i}of t){let s=n.x(o),u=n.x(o+a)-s,c=n.rowCentre(r)-n.barPx/2;e.fillStyle=ge(i),e.fillRect(s,c,u,n.barPx),e.strokeStyle=Nt,e.lineWidth=1,e.strokeRect(s+.5,c+.5,u-1,n.barPx-1),u>=12&&n.barPx>=9&&(e.fillStyle="#111",e.fillText(Y(i),s+u/2,n.rowCentre(r)))}}var R=18,ke=32,bt="rgba(160, 160, 160, 0.45)",It="#18181c",Bt=6,ft=7,Wt="#b8b8c0",V=Be-4,Gt="rgba(119, 119, 119, 0.85)",Dt=15,ut=10;function j(e){return e.kind==="fill"?e.width??R:R}var me=e=>e.length>1?3:4;function G(e){switch(e.kind){case"fill":return e.height??8;case"bands":return me(e.bands)*e.bands.length;case"line":return 3;case"halo":case"overhang":return 10;case"outline":case"tick":return e.height;case"glyph":return 15;case"bracket":return 7;case"blank":return 0}}function Gr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,j(n.swatch)):t,0)}function Dr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,Math.ceil(G(n.swatch))+3):t,Dt)}var y=e=>[{offset:0,color:e}];function q(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:y(t),width:ut,height:ut,edged:!0}}}function dt(e){return e.flatMap((t,n)=>[{offset:n/e.length,color:t},{offset:(n+1)/e.length,color:t}])}function Ht(e){let t=e.openBubble;if(!t)return[];let n=e.bubbleHalos.find(r=>_(r.bubble,t));return[{key:"open",label:`open: ${n?.label??"bubble"}`,swatch:n?{kind:"halo",color:P[n.kind]}:{kind:"blank"},closesBubble:!0}]}function $t(e){let t=e.walkLift?void 0:e.referenceRampDomain;if(!t)return[];let n=Math.round(t.start),r=Math.round(t.end);return[{key:"ramp",label:`position on ${e.graph?Z(e.graph):"reference"}`,swatch:{kind:"fill",stops:A,width:ke},under:`${n.toLocaleString("en-US")}-${r.toLocaleString("en-US")} (${ne(r-n)})`},...e.referenceRampDrawsOffReference?[q("off",I,"off the reference")]:[]]}function Kt(e){let t=e.walkLift;if(t)return t.walks.map(o=>ae(o.encoding));if(e.effectiveColorScheme==="reference-position")return[A];let n=e.referenceStripBlocks.map(o=>o.colors[0]).filter((o,a,i)=>o!==i[a-1]),r=Math.min(Bt,n.length);return[r===0?y(re):Array.from({length:r},(o,a)=>({offset:r>1?a/(r-1):0,color:n[r>1?Math.round(a*(n.length-1)/(r-1)):0]}))]}function Xt(e){if(!e.referenceStripShown)return[];let t=(e.walkLift?.walks.length??0)>1;return[{key:"strip",label:`reference${t?", a row per walk":""}`,swatch:{kind:"bands",bands:Kt(e)}},...e.referenceStripFaded?[q("strip-faded",re,e.walkLift?`reference not on ${t?"that row's walk":e.liftedWalksLabel}`:"reference outside the open bubble")]:[],...e.referenceStripOverhangs?[{key:"overhang",label:"graph runs past this edge",swatch:{kind:"overhang"}}]:[]]}function Ut(e){let t=new Map;for(let n of e.bubbleHalos)if(!n.whole){let r=P[n.kind],o=t.get(r)??new Set;o.add(se[n.kind]),t.set(r,o)}return[...t].map(([n,r])=>{let o=[...r].join(" or ");return{key:`halo-${n}`,label:o===se.superbubble?o:`${o} bubble`,swatch:{kind:"halo",color:n}}})}function ht(e){let{graph:t}=e;return t&&Ee(e.deletions,e.walkLift).length>0?[{key:"deletion",label:_e(Z(t)),swatch:{kind:"line",color:e.walkLift?bt:It,dashed:!0}}]:[]}function we(e,t,n,r){return{key:e,label:t,swatch:{kind:"fill",stops:y(r),width:ke,height:n}}}var Ft=e=>e>=10?Math.round(e):Math.round(e*10)/10;function Yt(e){let{graph:t,contigThickness:n,depthRange:r}=e;if(!t||!e.drawsNodes||e.walkRowBars)return[];if(e.nodeWidth==="frequency"){let c=t.nodes.some(d=>d.frequency!==void 0);return ve(n).map(({label:d,widthPx:b})=>we(`width-${d}`,c?`AF ${d}`:`${d} of haplotypes`,b,I))}if(e.nodeWidth!=="depth"||!r||r.min===r.max)return[];let o=t.paths?.length??0,a=o>0,i=[...new Set([r.max,r.mean,r.min].map(a?Math.round:Ft))],s=i[0]>o,u=c=>s?`${c.toLocaleString("en-US")} walk pass${c===1?"":"es"}`:`${c.toLocaleString("en-US")} walk${c===1?"":"s"}`;return i.map(c=>we(`width-${c}`,a?u(c):`depth ${c.toLocaleString("en-US")}`,Ne({depth:c},n,"depth",r.mean),I))}function zt(e){let t=e.busiestLink;return!e.drawsNodes||e.walkRowBars||e.linkWidth!=="walks"||t===0?[]:(t>1?[t,1]:[1]).map(r=>we(`link-width-${r}`,`${r.toLocaleString("en-US")} walk${r===1?"":"s"}`,e.connectorThickness*Te(r,t,"walks"),Gt))}function Vt(e){return e.genePins.some(t=>t.exonsByNode.length>0)?[{key:"exon",label:"exon",swatch:{kind:"outline",color:W,stroke:2,radius:5,height:8}}]:[]}function qt(e){let t=e.foldNote;return t?[{key:"fold",label:t}]:[]}function jt(e){return e.pathLegend.map(({name:t,label:n,color:r})=>({key:`path-${t}`,label:n,swatch:{kind:"line",color:r}}))}function E(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:t,height:ft,square:!0}}}function Jt(e){let{roles:t,haplotypeTube:n,bundled:r,values:o,logWidths:a,foldBp:i,forwardReads:s,reverseReads:u,substitution:c,insertion:d,deletion:b}=e.tubeMapKeys,h=e.readsShown,l=[];if(o){l.push(E("value-reference",y(pe),"reference"));for(let{value:f,color:w}of o)l.push(E(`value-${f}`,y(w),f))}return t&&l.push(E("ref",y(pe),"reference"),E("hap",y(n),r?"shared route, \xD7n haplotypes":"haplotype")),s&&l.push(E("fwd",dt(Q),"read on the forward strand")),u&&l.push(E("rev",dt(ee),"read on the reverse strand")),h&&h.shown<h.total&&l.push({key:"sampled",label:`${h.shown.toLocaleString("en-US")} of ${h.total.toLocaleString("en-US")} reads shown`,swatch:{kind:"blank"}}),c&&l.push({key:"sub",label:"read mismatch",swatch:{kind:"glyph",char:"A"}}),d&&l.push({key:"ins",label:"read insertion",swatch:{kind:"glyph",char:"*"}}),b&&l.push(E("del",y("grey"),"read deletion")),i!==void 0&&l.push({key:"tube-fold",label:`haplotype variant < ${ne(i)}`,swatch:{kind:"tick",color:qe(),height:ft,backing:Wt}}),a&&l.push({key:"log",label:"width grows with log of length",swatch:{kind:"bracket"}}),l}function Zt(e){return e.kind==="gene"?{kind:"outline",color:Ie,stroke:1.5,radius:0,height:V}:{kind:"fill",stops:e.kind==="bar"&&e.ramp?A:y(e.fill),height:e.kind==="gap"?e.px:V}}function Qt(e){let t=new Set(e.sharedBlocks?.map(r=>r.block)),n=r=>({kind:"fill",stops:y(ge(r)),height:V});return[...[...t].filter(r=>r<z).sort((r,o)=>r-o).map(r=>({key:`block-${r}`,label:`${Y(r)}: off the reference, walked by several rows`,swatch:n(r)})),...[...t].some(r=>r>=z)?[{key:"block-more",label:"more shared blocks",swatch:n(z)}]:[]]}function en(e){let t=e.walkRowBars;if(!t)return[];let n=[t.reference,...t.rows].flatMap(o=>o.call??[]),r=(o,a,i)=>({key:o,label:i,swatch:{kind:"tick",color:a,height:V}});return[...$e(t,{ramp:e.referenceRampDomain,genes:e.walkRowGeneKey,annotation:e.walkRowAnnotation}).map(o=>({key:`rows-${o.label}`,label:o.label,swatch:o.note?void 0:Zt(o.swatch)})),...Qt(e),...n.some(o=>o.spanningReads!==0)?[r("call",Ke,"allele length called for this walk")]:[],...n.some(o=>o.spanningReads===0)?[r("unbacked",Xe,"called with no read spanning it")]:[],...n.some(o=>o.agrees===!1)?[r("disagrees",Ue,`walk and call over ${Math.round(.1*100)}% apart`)]:[]]}function tn(e,t){let n=rt(t,e.walkReference);return{key:`walk-${t.name}`,strong:e.walkLabel(t.name),label:n.delta+n.gaps+n.reversed,swatch:{kind:"fill",stops:ae(t.encoding),width:n.shades?ke:R},under:n.scale,title:n.hover,walk:t}}function gt(e,t){return[...e.liftPaintsOffReference?[q("lift-off",I,"off the reference")]:[],q("faded",bt,t)]}function nn(e){let t=e.walkLift;if(!t||e.facetPanels)return[];let n=t.walks.map(o=>tn(e,o)),r=e.graph?he(e.graph,t,e.liftedWalksLabel):`not on ${e.liftedWalksLabel}`;return[...n,...gt(e,r)]}function Hr(e){let{graph:t,facetPanels:n}=e;if(!t||!n)return[];let r=new Set(n.map(o=>he(t,o,"the panel's walk")));return[...gt(e,r.size===1?[...r][0]:"not on the panel's walk"),...ht(e)]}function $r(e){let t=[{testid:"graph-open-bubble-legend",rows:Ht(e)},{testid:"graph-ramp-legend",rows:$t(e),group:"Color"},{testid:"graph-walk-readout",rows:nn(e),group:"Walks"},{testid:"graph-width-legend",rows:Yt(e),group:"Node thickness"},{testid:"graph-link-width-legend",rows:zt(e),group:"Link thickness"},{testid:"graph-halo-legend",rows:Ut(e),group:"Marks"},{testid:"graph-deletion-legend",rows:ht(e),group:"Marks"},{testid:"graph-gene-legend",rows:Vt(e),group:"Marks"},{testid:"graph-path-legend",rows:jt(e),group:"Paths"},{testid:"graph-tube-map-legend",rows:Jt(e),group:"Tube map"},{testid:"graph-walk-rows-legend",rows:en(e),group:"Walk rows"},{testid:"graph-reference-strip-legend",rows:Xt(e),group:"Top strip"},{testid:"graph-fold-legend",rows:qt(e)}].filter(o=>o.rows.length>0);if(new Set(t.flatMap(o=>o.group??[])).size<2)return t;let r=new Set;return t.map((o,a)=>{let{group:i}=o;return i?r.has(i)?o:(r.add(i),{...o,heading:i}):a===0?o:{...o,spaced:!0}})}function rn(e){return e==="class"?"className":/^(data|aria)-/.test(e)?e:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function wt(e,t){if(typeof e=="string")return e;let n={key:t};for(let[r,o]of Object.entries(e.attrs))o!==void 0&&(n[rn(r)]=o);return Pe(e.tag,n,e.children.map(wt))}function N(){return Me().replaceAll(/[^\w-]/g,"")}function D({el:e}){return wt(e,0)}var on="rgba(0, 0, 0, 0.28)";function kt({id:e,x:t,y:n,stops:r,width:o,height:a,square:i,edged:s}){let u=s?.5:0,c=d=>p("rect",{x:t+u,y:n+u,width:o-u*2,height:a-u*2,rx:i?0:2,fill:d,stroke:s?on:void 0});return r.length>1?m(v,{children:[p("defs",{children:p("linearGradient",{id:e,children:r.map((d,b)=>p("stop",{offset:d.offset,stopColor:d.color},b))})}),c(`url(#${e})`)]}):c(r[0].color)}function an({swatch:e,x:t,id:n}){switch(e.kind){case"fill":{let o=G(e);return p(kt,{id:n,x:t,y:-5-o/2,stops:e.stops,width:j(e),height:o,square:e.square,edged:e.edged})}case"bands":{let o=me(e.bands),a=-5-G(e)/2;return p(v,{children:e.bands.map((i,s)=>p(kt,{id:`${n}-${s}`,x:t,y:a+s*o,stops:i,width:R,height:o,square:!0},s))})}case"line":return e.dashed?p("line",{x1:t+1,x2:t+R,y1:-5,y2:-5,stroke:e.color,strokeWidth:3,strokeDasharray:"4 3"}):p("rect",{x:t,y:-5-1.5,width:R,height:3,rx:2,fill:e.color});case"halo":return p("line",{x1:t+5,x2:t+13,y1:-5,y2:-5,stroke:e.color,strokeOpacity:.35,strokeWidth:8,strokeLinecap:"round"});case"outline":{let o=e.stroke/2;return p("rect",{x:t+o,y:-5-e.height/2+o,width:R-e.stroke,height:e.height-e.stroke,rx:Math.max(0,e.radius-o),fill:"none",stroke:e.color,strokeWidth:e.stroke})}case"overhang":return p("path",{transform:`translate(${t} -10)`,d:"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z",fill:"#18181c"});case"glyph":return p("text",{x:t+R/2,y:-1,textAnchor:"middle",fontFamily:"monospace",fontSize:12,fill:"currentColor",children:e.char});case"tick":{let o=-5-e.height/2;return m(v,{children:[e.backing?p("rect",{x:t,y:o,width:R,height:e.height,fill:e.backing}):null,p("rect",{x:t+R/2-1,y:o,width:2,height:e.height,fill:e.color})]})}case"bracket":return p("path",{transform:`translate(${t} ${-5-3.5})`,d:`M0.5,6 V1.5 H5.5 V6 M8.5,6 V1.5 H${R-.5} V6`,fill:"none",stroke:ze()});case"blank":return null}}var qr=g(function({swatch:t}){let n=N(),r=G(t);return p("svg",{width:j(t),height:r,overflow:"visible",style:{flex:"none"},children:p("g",{transform:`translate(0 ${r/2+5})`,children:p(an,{swatch:t,x:0,id:n})})})});var Zr={background:"#fff",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},Qr={display:"flex",alignItems:"center",gap:5},eo={color:"#666"},sn="#6b7479",to=4,no={color:sn,fontSize:9.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase"};var ln=g(function({model:t}){let n=`exon-outline-${N()}`,r=U(()=>X(()=>{let{genePins:b,walkLift:h}=t,l=h?void 0:t.openBubbleFocus,f=l?b.map(w=>({...w,exonsByNode:w.exonsByNode.filter(k=>l.nodeIds.has(k.nodeId))})):b;return be(f,t.nodeInk.halfWidthPx,h)}),[t]),{scaleX:o,scaleY:a,translateX:i,translateY:s,paneWidth:u,canvasHeight:c}=t,d=fe(r.get(),{id:n,width:u,height:c,transform:`translate(${i} ${s}) scale(${o} ${a})`});return d?p(M,{model:t,zIndex:2,testId:"graph-gene-pins",children:p(D,{el:d})}):null}),po=ln;function mt(e,t,n){return{x:e-n/2,y:t-T-F+2,width:n,height:T+F*2-2}}function Rt(e,t,n){let r=mt(e.x,e.y,e.w);return t>=r.x&&t<=r.x+r.width&&n>=r.y&&n<=r.y+r.height}var J=g(function({x:t,y:n,w:r,text:o,note:a,color:i,edge:s=i,italic:u,dimmed:c,title:d,testId:b,onClick:h,onHover:l}){return m("g",{style:{pointerEvents:h||l?"auto":"none",cursor:h?"pointer":void 0,opacity:c?.35:1},"data-testid":b,onClick:h,onMouseEnter:()=>{l?.(!0)},onMouseLeave:()=>{l?.(!1)},...h&&{role:"button",tabIndex:0,"aria-label":(d??o).replaceAll(`
1
+ import{Aa as Ye,Cb as ue,D as $e,Db as de,E as Ke,F as Xe,G as Ue,Ia as P,Ib as Qe,J as Fe,Ja as se,Kb as W,Lb as be,Mb as fe,Oa as ze,Pa as ie,Qb as et,Sa as Ve,Sb as tt,Ub as nt,Va as qe,Wa as le,Wb as he,_a as ce,_b as rt,a as Se,b as X,dc as ot,eb as je,f as Q,g as ee,jc as at,lc as st,mb as Je,ob as pe,r as Ie,rb as Ze,s as Be,t as We,u as oe,w as Ge,x as De,y as He}from"./chunk-W4Y2JUP7.js";import{D as ae,f as Oe,m as A,p as re,q as Ae,r as I}from"./chunk-T3FHGWNW.js";import{A as Ee,E as ne,T as ve,U as Ne,Z as Te,m as T,o as F,p as te,x as _e}from"./chunk-46O3IEW3.js";import{b as _,c as B}from"./chunk-G6NFDDMN.js";import{c as Z}from"./chunk-VPZZ6XMM.js";import{e as K}from"./chunk-FLKXKTS2.js";import{b as Pe,d as L,e as Le,f as Me,g as U,h as Ce}from"./chunk-J2PN6CG3.js";import{a as v,b as p,c as m,d as g}from"./chunk-DUU6T2I5.js";var Et="data-pans-with-drawing";function it(e,t){return{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:t,zIndex:e}}var M=g(function({model:t,zIndex:n,overflow:r="hidden",testId:o,pansWithDrawing:a,children:i}){return p("svg",{style:{...it(n,r),userSelect:a?"none":void 0},width:t.paneWidth,height:t.canvasHeight,"data-testid":o,...a?{[Et]:""}:{},children:i})}),lt=g(function({model:t,children:n}){let{scaleX:r,scaleY:o,translateX:a,translateY:i}=t;return p("g",{transform:`translate(${a} ${i}) scale(${r} ${o})`,children:n})}),C=g(function({model:t,zIndex:n,shown:r=!0,testId:o,paint:a}){let i=Ce(null);return Le(()=>{if(r)return Se(()=>{let s=i.current,u=s?.getContext("2d");if(s&&u){let c=t.paneWidth,d=t.canvasHeight;Ye(st());let b=Qe(s,c,d);u.setTransform(b,0,0,b,0,0),u.clearRect(0,0,c,d),a(u,b)}})},[t,r,a]),p("canvas",{ref:i,"data-testid":r?o:void 0,style:{...it(n),display:r?"block":"none"}})});var Ot=g(function({model:t}){let{bubbleHalos:n,hoveredBubble:r}=t;if(n.length===0)return null;let o=t.contigThickness*et;return p(M,{model:t,zIndex:2,testId:"graph-bubble-halos",children:p(lt,{model:t,children:n.filter(a=>!a.whole&&(!a.tick||r&&_(a.bubble,r))).map(a=>p("path",{d:a.path,fill:"none",stroke:P[a.kind],strokeOpacity:r&&_(a.bubble,r)?.45:t.bubbleFaded(a)?.06:.22,strokeWidth:o,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"},B(a.bubble)))})})}),Kn=Ot;var ct=["#d4735e","#d8a94a","#c98aa4"],vt="#e6e6e6",Nt="#555",Tt="bold 11px sans-serif";var ge=e=>ct[e]??vt;function Y(e){let t=String.fromCharCode(65+e%26);return e<26?t:Y(Math.floor(e/26)-1)+t}var z=ct.length;function pt(e,t,n){e.font=Tt,e.textAlign="center",e.textBaseline="middle";for(let{row:r,start:o,bp:a,block:i}of t){let s=n.x(o),u=n.x(o+a)-s,c=n.rowCentre(r)-n.barPx/2;e.fillStyle=ge(i),e.fillRect(s,c,u,n.barPx),e.strokeStyle=Nt,e.lineWidth=1,e.strokeRect(s+.5,c+.5,u-1,n.barPx-1),u>=12&&n.barPx>=9&&(e.fillStyle="#111",e.fillText(Y(i),s+u/2,n.rowCentre(r)))}}var R=18,ke=32,bt="rgba(160, 160, 160, 0.45)",It="#18181c",Bt=6,ft=7,Wt="#b8b8c0",V=Be-4,Gt="rgba(119, 119, 119, 0.85)",Dt=15,ut=10;function j(e){return e.kind==="fill"?e.width??R:R}var me=e=>e.length>1?3:4;function G(e){switch(e.kind){case"fill":return e.height??8;case"bands":return me(e.bands)*e.bands.length;case"line":return 3;case"halo":case"overhang":return 10;case"outline":case"tick":return e.height;case"glyph":return 15;case"bracket":return 7;case"blank":return 0}}function Gr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,j(n.swatch)):t,0)}function Dr(e){return e.reduce((t,n)=>n.swatch?Math.max(t,Math.ceil(G(n.swatch))+3):t,Dt)}var y=e=>[{offset:0,color:e}];function q(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:y(t),width:ut,height:ut,edged:!0}}}function dt(e){return e.flatMap((t,n)=>[{offset:n/e.length,color:t},{offset:(n+1)/e.length,color:t}])}function Ht(e){let t=e.openBubble;if(!t)return[];let n=e.bubbleHalos.find(r=>_(r.bubble,t));return[{key:"open",label:`open: ${n?.label??"bubble"}`,swatch:n?{kind:"halo",color:P[n.kind]}:{kind:"blank"},closesBubble:!0}]}function $t(e){let t=e.walkLift?void 0:e.referenceRampDomain;if(!t)return[];let n=Math.round(t.start),r=Math.round(t.end);return[{key:"ramp",label:`position on ${e.graph?Z(e.graph):"reference"}`,swatch:{kind:"fill",stops:A,width:ke},under:`${n.toLocaleString("en-US")}-${r.toLocaleString("en-US")} (${ne(r-n)})`},...e.referenceRampDrawsOffReference?[q("off",I,"off the reference")]:[]]}function Kt(e){let t=e.walkLift;if(t)return t.walks.map(o=>ae(o.encoding));if(e.effectiveColorScheme==="reference-position")return[A];let n=e.referenceStripBlocks.map(o=>o.colors[0]).filter((o,a,i)=>o!==i[a-1]),r=Math.min(Bt,n.length);return[r===0?y(re):Array.from({length:r},(o,a)=>({offset:r>1?a/(r-1):0,color:n[r>1?Math.round(a*(n.length-1)/(r-1)):0]}))]}function Xt(e){if(!e.referenceStripShown)return[];let t=(e.walkLift?.walks.length??0)>1;return[{key:"strip",label:`reference${t?", a row per walk":""}`,swatch:{kind:"bands",bands:Kt(e)}},...e.referenceStripFaded?[q("strip-faded",re,e.walkLift?`reference not on ${t?"that row's walk":e.liftedWalksLabel}`:"reference outside the open bubble")]:[],...e.referenceStripOverhangs?[{key:"overhang",label:"graph runs past this edge",swatch:{kind:"overhang"}}]:[]]}function Ut(e){let t=new Map;for(let n of e.bubbleHalos)if(!n.whole){let r=P[n.kind],o=t.get(r)??new Set;o.add(se[n.kind]),t.set(r,o)}return[...t].map(([n,r])=>{let o=[...r].join(" or ");return{key:`halo-${n}`,label:o===se.superbubble?o:`${o} bubble`,swatch:{kind:"halo",color:n}}})}function ht(e){let{graph:t}=e;return t&&Ee(e.deletions,e.walkLift).length>0?[{key:"deletion",label:_e(Z(t)),swatch:{kind:"line",color:e.walkLift?bt:It,dashed:!0}}]:[]}function we(e,t,n,r){return{key:e,label:t,swatch:{kind:"fill",stops:y(r),width:ke,height:n}}}var Ft=e=>e>=10?Math.round(e):Math.round(e*10)/10;function Yt(e){let{graph:t,contigThickness:n,depthRange:r}=e;if(!t||!e.drawsNodes||e.walkRowBars)return[];if(e.nodeWidth==="frequency"){let c=t.nodes.some(d=>d.frequency!==void 0);return ve(n).map(({label:d,widthPx:b})=>we(`width-${d}`,c?`AF ${d}`:`${d} of haplotypes`,b,I))}if(e.nodeWidth!=="depth"||!r||r.min===r.max)return[];let o=t.paths?.length??0,a=o>0,i=[...new Set([r.max,r.mean,r.min].map(a?Math.round:Ft))],s=i[0]>o,u=c=>s?`${c.toLocaleString("en-US")} walk pass${c===1?"":"es"}`:`${c.toLocaleString("en-US")} walk${c===1?"":"s"}`;return i.map(c=>we(`width-${c}`,a?u(c):`depth ${c.toLocaleString("en-US")}`,Ne({depth:c},n,"depth",r.mean),I))}function zt(e){let t=e.busiestLink;return!e.drawsNodes||e.walkRowBars||e.linkWidth!=="walks"||t===0?[]:(t>1?[t,1]:[1]).map(r=>we(`link-width-${r}`,`${r.toLocaleString("en-US")} walk${r===1?"":"s"}`,e.connectorThickness*Te(r,t,"walks"),Gt))}function Vt(e){return e.genePins.some(t=>t.exonsByNode.length>0)?[{key:"exon",label:"exon",swatch:{kind:"outline",color:W,stroke:2,radius:5,height:8}}]:[]}function qt(e){let t=e.foldNote;return t?[{key:"fold",label:t}]:[]}function jt(e){return e.pathLegend.map(({name:t,label:n,color:r})=>({key:`path-${t}`,label:n,swatch:{kind:"line",color:r}}))}function E(e,t,n){return{key:e,label:n,swatch:{kind:"fill",stops:t,height:ft,square:!0}}}function Jt(e){let{roles:t,haplotypeTube:n,bundled:r,values:o,logWidths:a,foldBp:i,forwardReads:s,reverseReads:u,substitution:c,insertion:d,deletion:b}=e.tubeMapKeys,h=e.readsShown,l=[];if(o){l.push(E("value-reference",y(pe),"reference"));for(let{value:f,color:w}of o)l.push(E(`value-${f}`,y(w),f))}return t&&l.push(E("ref",y(pe),"reference"),E("hap",y(n),r?"shared route, \xD7n haplotypes":"haplotype")),s&&l.push(E("fwd",dt(Q),"read on the forward strand")),u&&l.push(E("rev",dt(ee),"read on the reverse strand")),h&&h.shown<h.total&&l.push({key:"sampled",label:`${h.shown.toLocaleString("en-US")} of ${h.total.toLocaleString("en-US")} reads shown`,swatch:{kind:"blank"}}),c&&l.push({key:"sub",label:"read mismatch",swatch:{kind:"glyph",char:"A"}}),d&&l.push({key:"ins",label:"read insertion",swatch:{kind:"glyph",char:"*"}}),b&&l.push(E("del",y("grey"),"read deletion")),i!==void 0&&l.push({key:"tube-fold",label:`haplotype variant < ${ne(i)}`,swatch:{kind:"tick",color:qe(),height:ft,backing:Wt}}),a&&l.push({key:"log",label:"width grows with log of length",swatch:{kind:"bracket"}}),l}function Zt(e){return e.kind==="gene"?{kind:"outline",color:Ie,stroke:1.5,radius:0,height:V}:{kind:"fill",stops:e.kind==="bar"&&e.ramp?A:y(e.fill),height:e.kind==="gap"?e.px:V}}function Qt(e){let t=new Set(e.sharedBlocks?.map(r=>r.block)),n=r=>({kind:"fill",stops:y(ge(r)),height:V});return[...[...t].filter(r=>r<z).sort((r,o)=>r-o).map(r=>({key:`block-${r}`,label:`${Y(r)}: off the reference, walked by several rows`,swatch:n(r)})),...[...t].some(r=>r>=z)?[{key:"block-more",label:"more shared blocks",swatch:n(z)}]:[]]}function en(e){let t=e.walkRowBars;if(!t)return[];let n=[t.reference,...t.rows].flatMap(o=>o.call??[]),r=(o,a,i)=>({key:o,label:i,swatch:{kind:"tick",color:a,height:V}});return[...$e(t,{ramp:e.referenceRampDomain,genes:e.walkRowGeneKey,annotation:e.walkRowAnnotation}).map(o=>({key:`rows-${o.label}`,label:o.label,swatch:o.note?void 0:Zt(o.swatch)})),...Qt(e),...n.some(o=>o.spanningReads!==0)?[r("call",Ke,"allele length called for this walk")]:[],...n.some(o=>o.spanningReads===0)?[r("unbacked",Xe,"called with no read spanning it")]:[],...n.some(o=>o.agrees===!1)?[r("disagrees",Ue,`walk and call over ${Math.round(.1*100)}% apart`)]:[]]}function tn(e,t){let n=rt(t,e.walkReference);return{key:`walk-${t.name}`,strong:e.walkLabel(t.name),label:n.delta+n.gaps+n.reversed,swatch:{kind:"fill",stops:ae(t.encoding),width:n.shades?ke:R},under:n.scale,title:n.hover,walk:t}}function gt(e,t){return[...e.liftPaintsOffReference?[q("lift-off",I,"off the reference")]:[],q("faded",bt,t)]}function nn(e){let t=e.walkLift;if(!t||e.facetPanels)return[];let n=t.walks.map(o=>tn(e,o)),r=e.graph?he(e.graph,t,e.liftedWalksLabel):`not on ${e.liftedWalksLabel}`;return[...n,...gt(e,r)]}function Hr(e){let{graph:t,facetPanels:n}=e;if(!t||!n)return[];let r=new Set(n.map(o=>he(t,o,"the panel's walk")));return[...gt(e,r.size===1?[...r][0]:"not on the panel's walk"),...ht(e)]}function $r(e){let t=[{testid:"graph-open-bubble-legend",rows:Ht(e)},{testid:"graph-ramp-legend",rows:$t(e),group:"Color"},{testid:"graph-walk-readout",rows:nn(e),group:"Walks"},{testid:"graph-width-legend",rows:Yt(e),group:"Node thickness"},{testid:"graph-link-width-legend",rows:zt(e),group:"Link thickness"},{testid:"graph-halo-legend",rows:Ut(e),group:"Marks"},{testid:"graph-deletion-legend",rows:ht(e),group:"Marks"},{testid:"graph-gene-legend",rows:Vt(e),group:"Marks"},{testid:"graph-path-legend",rows:jt(e),group:"Paths"},{testid:"graph-tube-map-legend",rows:Jt(e),group:"Tube map"},{testid:"graph-walk-rows-legend",rows:en(e),group:"Walk rows"},{testid:"graph-reference-strip-legend",rows:Xt(e),group:"Top strip"},{testid:"graph-fold-legend",rows:qt(e)}].filter(o=>o.rows.length>0);if(new Set(t.flatMap(o=>o.group??[])).size<2)return t;let r=new Set;return t.map((o,a)=>{let{group:i}=o;return i?r.has(i)?o:(r.add(i),{...o,heading:i}):a===0?o:{...o,spaced:!0}})}function rn(e){return e==="class"?"className":/^(data|aria)-/.test(e)?e:e.replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function wt(e,t){if(typeof e=="string")return e;let n={key:t};for(let[r,o]of Object.entries(e.attrs))o!==void 0&&(n[rn(r)]=o);return Pe(e.tag,n,e.children.map(wt))}function N(){return Me().replaceAll(/[^\w-]/g,"")}function D({el:e}){return wt(e,0)}var on="rgba(0, 0, 0, 0.28)";function kt({id:e,x:t,y:n,stops:r,width:o,height:a,square:i,edged:s}){let u=s?.5:0,c=d=>p("rect",{x:t+u,y:n+u,width:o-u*2,height:a-u*2,rx:i?0:2,fill:d,stroke:s?on:void 0});return r.length>1?m(v,{children:[p("defs",{children:p("linearGradient",{id:e,children:r.map((d,b)=>p("stop",{offset:d.offset,stopColor:d.color},b))})}),c(`url(#${e})`)]}):c(r[0].color)}function an({swatch:e,x:t,id:n}){switch(e.kind){case"fill":{let o=G(e);return p(kt,{id:n,x:t,y:-5-o/2,stops:e.stops,width:j(e),height:o,square:e.square,edged:e.edged})}case"bands":{let o=me(e.bands),a=-5-G(e)/2;return p(v,{children:e.bands.map((i,s)=>p(kt,{id:`${n}-${s}`,x:t,y:a+s*o,stops:i,width:R,height:o,square:!0},s))})}case"line":return e.dashed?p("line",{x1:t+1,x2:t+R,y1:-5,y2:-5,stroke:e.color,strokeWidth:3,strokeDasharray:"4 3"}):p("rect",{x:t,y:-5-1.5,width:R,height:3,rx:2,fill:e.color});case"halo":return p("line",{x1:t+5,x2:t+13,y1:-5,y2:-5,stroke:e.color,strokeOpacity:.35,strokeWidth:8,strokeLinecap:"round"});case"outline":{let o=e.stroke/2;return p("rect",{x:t+o,y:-5-e.height/2+o,width:R-e.stroke,height:e.height-e.stroke,rx:Math.max(0,e.radius-o),fill:"none",stroke:e.color,strokeWidth:e.stroke})}case"overhang":return p("path",{transform:`translate(${t} -10)`,d:"M0,5 L8,0 L8,10 Z M18,5 L10,0 L10,10 Z",fill:"#18181c"});case"glyph":return p("text",{x:t+R/2,y:-1,textAnchor:"middle",fontFamily:"monospace",fontSize:12,fill:"currentColor",children:e.char});case"tick":{let o=-5-e.height/2;return m(v,{children:[e.backing?p("rect",{x:t,y:o,width:R,height:e.height,fill:e.backing}):null,p("rect",{x:t+R/2-1,y:o,width:2,height:e.height,fill:e.color})]})}case"bracket":return p("path",{transform:`translate(${t} ${-5-3.5})`,d:`M0.5,6 V1.5 H5.5 V6 M8.5,6 V1.5 H${R-.5} V6`,fill:"none",stroke:ze()});case"blank":return null}}var qr=g(function({swatch:t}){let n=N(),r=G(t);return p("svg",{width:j(t),height:r,overflow:"visible",style:{flex:"none"},children:p("g",{transform:`translate(0 ${r/2+5})`,children:p(an,{swatch:t,x:0,id:n})})})});var Zr={background:"#fff",padding:"3px 6px",fontSize:11,lineHeight:"15px",whiteSpace:"nowrap"},Qr={display:"flex",alignItems:"center",gap:5},eo={color:"#666"},sn="#6b7479",to=4,no={color:sn,fontSize:9.5,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase"};var ln=g(function({model:t}){let n=`exon-outline-${N()}`,r=U(()=>X(()=>{let{genePins:b,walkLift:h}=t,l=h?void 0:t.openBubbleFocus,f=l?b.map(w=>({...w,exonsByNode:w.exonsByNode.filter(k=>l.nodeIds.has(k.nodeId))})):b;return be(f,t.nodeInk.halfWidthPx,h)}),[t]),{scaleX:o,scaleY:a,translateX:i,translateY:s,paneWidth:u,canvasHeight:c}=t,d=fe(r.get(),{id:n,width:u,height:c,transform:`translate(${i} ${s}) scale(${o} ${a})`});return d?p(M,{model:t,zIndex:2,testId:"graph-gene-pins",children:p(D,{el:d})}):null}),po=ln;function mt(e,t,n){return{x:e-n/2,y:t-T-F+2,width:n,height:T+F*2-2}}function Rt(e,t,n){let r=mt(e.x,e.y,e.w);return t>=r.x&&t<=r.x+r.width&&n>=r.y&&n<=r.y+r.height}var J=g(function({x:t,y:n,w:r,text:o,note:a,color:i,edge:s=i,italic:u,dimmed:c,title:d,testId:b,onClick:h,onHover:l}){return m("g",{style:{pointerEvents:h||l?"auto":"none",cursor:h?"pointer":void 0,opacity:c?.35:1},"data-testid":b,onClick:h,onMouseEnter:()=>{l?.(!0)},onMouseLeave:()=>{l?.(!1)},...h&&{role:"button",tabIndex:0,"aria-label":(d??o).replaceAll(`
2
2
  `,", "),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),h())},onFocus:()=>{l?.(!0)},onBlur:()=>{l?.(!1)}},children:[d?p("title",{children:d}):null,p("rect",{...mt(t,n,r),rx:3,fill:"rgba(255,255,255,0.85)",stroke:s,strokeWidth:1}),m("text",{x:t,y:n,fontSize:T,fontFamily:"sans-serif",fontStyle:u?"italic":void 0,fontWeight:u?600:void 0,fill:i,textAnchor:"middle",children:[o,a?p("tspan",{fontStyle:"normal",fontWeight:"normal",children:a}):null]})]})});var xt="#1c1c22",Re=9,xe=3;function To({genes:e},t,n){let r=e.find(i=>Rt(i,t,n))?.item;if(!r)return;let{gene:o}=r,a=tt(r);return{label:o.name,readout:`${o.refName}:${o.start.toLocaleString()}-${o.end.toLocaleString()}${a?`, ${a} in the cut`:""}`}}var cn=g(function({model:t}){let{bubbles:n,genes:r,ticks:o}=t.overlayLabels;if(n.length+r.length+o.length===0)return null;let{scaleY:a,translateY:i,contigThickness:s,hoveredBubble:u}=t,c=u?o.find(l=>_(l.item.bubble,u)):void 0,d=l=>o[Number(l.getAttribute("data-tick"))],b=l=>t.bubbleFaded(l),h=l=>t.bubbleIsOpen(l.bubble);return m(M,{model:t,zIndex:3,testId:"graph-label-layer",pansWithDrawing:!0,children:[p("g",{"data-testid":"graph-bubble-ticks",onClick:l=>{let f=d(l.target);f&&t.toggleBubble(f.item.bubble)},onMouseOver:l=>{let f=d(l.target);f&&t.setHoveredBubble(f.item.bubble)},onMouseOut:()=>{K(t)&&t.setHoveredBubble(null)},onFocus:l=>{let f=d(l.target);f&&t.setHoveredBubble(f.item.bubble)},onBlur:()=>{K(t)&&t.setHoveredBubble(null)},onKeyDown:l=>{let f=d(l.target);f&&(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.toggleBubble(f.item.bubble))},children:o.map(({item:l,x:f,y:w},k)=>p("rect",{"data-tick":k,role:"button",tabIndex:0,"aria-label":`${l.label}, ${h(l)?"close":"open"} bubble`,x:f-xe/2,y:w-Re,width:xe,height:Re,rx:xe/2,fill:P[l.kind],opacity:b(l)?.35:1,style:{pointerEvents:"all",cursor:"pointer"}},B(l.bubble)))}),r.map(({item:l,x:f,y:w,w:k,text:x})=>{let{gene:S}=l,{y1:H,y2:$}=nt({y:w},l.at.y*a+i,s);return m("g",{children:[p("line",{x1:f,x2:f,y1:H,y2:$,stroke:xt,strokeWidth:.8,strokeOpacity:.6}),p(J,{x:f,y:w,w:k,text:S.name,note:x.slice(S.name.length)||void 0,color:xt,edge:W,italic:!0,testId:"graph-gene-pin-label"})]},`${S.name}-${S.start}`)}),n.map(({item:l,x:f,y:w,w:k,text:x})=>p(J,{x:f,y:w,w:k,text:x,color:P[l.kind],dimmed:b(l),title:`${l.label}
3
3
  ${l.bubble.segmentCount} segments${l.bubble.covering?"":h(l)?" \xB7 click to close":" \xB7 click to open"}`,testId:"graph-bubble-halo-label",onClick:l.bubble.covering?void 0:()=>{t.toggleBubble(l.bubble)},onHover:S=>{K(t)&&t.setHoveredBubble(S?l.bubble:null)}},B(l.bubble))),c?p(J,{x:c.x,y:c.y-Re-4,w:te(c.item.label),text:c.item.label,color:P[c.item.kind],testId:"graph-bubble-tick-label"}):null]})}),Ao=cn;function pn(e,t,{lit:n,dpr:r}){let o=t.hostBpFrame;o&&at(e,t.referenceStripBlocks,o,{width:t.paneWidth,lit:n,dpr:r})}var un=g(function({model:t}){let n=L((r,o)=>{pn(r,t,{lit:t.referenceStripLit,dpr:o})},[t]);return p(C,{model:t,zIndex:5,shown:t.referenceStripShown,testId:"graph-reference-strip",paint:n})}),$o=un;var dn=.45;function bn(e,t,{highlightNode:n}){let r=t.tubeMapPicture,o=t.tubeMapFrame;if(!r||!o)return;let a=t.paneWidth,i=t.tubeMapPanelViews;if(i){fn(e,t,i,n);return}let s={...o,width:a,highlightNode:n,tubeColors:t.tubeMapTubeColors,nodeColors:t.tubeMapNodeColors};ce(e,r,s);let u=t.layoutResult?.tubeMap;u&&(ue(e,r,u.graph,s),de(e,u,s)),le(e,t.tubeMapDeviations,s),Ve(e,t.tubeMapConnectors,t.connectorZoneBottom,s);let{bounds:c}=r;ot(e,t.tubeMapGenes,s,o.y(c.minY)-2);let d=t.tubeMapRulerBoxes;d&&ie(e,d,s,o.y(c.maxY)+4,t.layoutResult?.referenceAxis)}function fn(e,t,n,r){let o=t.paneWidth;for(let s of n){if(s.bottom<0||s.titleTop>t.canvasHeight)continue;let u={...s.frame,width:o,highlightNode:r,tubeColors:s.tubeColors,nodeColors:s.nodeColors};ce(e,s.picture,u),ue(e,s.picture,s.panel.result.tubeMap.graph,u),de(e,s.panel.result.tubeMap,u),e.globalAlpha=dn,le(e,s.deviations,u),e.globalAlpha=1,e.strokeStyle="rgba(0,0,0,0.15)",e.lineWidth=1,e.beginPath(),e.moveTo(0,Math.round(s.titleTop)+.5),e.lineTo(o,Math.round(s.titleTop)+.5),e.stroke(),e.font=Ze,e.textAlign="left",e.textBaseline="top",e.fillStyle="rgba(0,0,0,0.85)",e.fillText(s.label,6,s.titleTop+4)}let a=n.at(-1),i=t.tubeMapPanelRulerBoxes;a&&i&&ie(e,i,{...a.frame,width:o},a.bottom+4,!0)}var hn=g(function({model:t}){let n=L(r=>{bn(r,t,{highlightNode:t.selectedNode})},[t]);return p(C,{model:t,zIndex:1,shown:!!t.tubeMapPicture,testId:"graph-tube-map",paint:n})}),Qo=hn;var O=JBrowseExports["@jbrowse/render-core/marks"],gn=e=>O!=null&&e in Object(O)?O[e]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+e+"' from '@jbrowse/render-core/marks' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:e});var yt=gn("spanMark");var na=O&&O.__esModule?O.default:O;var wn=["bars","gaps","hairlines"],St=e=>(e.match(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi)??[]).map(Number);function Pt(e){if(e.startsWith("#")){let o=Number.parseInt(e.slice(1),16);return[o>>16&255,o>>8&255,o&255]}let[t=0,n=0,r=0]=St(e);return e.startsWith("hsl")?Ae(t,n/100,r/100).map(o=>o*255):[t,n,r]}var Lt=([e,t,n])=>Oe(Math.round(e),Math.round(t),Math.round(n),255),Mt=e=>Lt(Pt(e));function kn(){let e=new Map;return t=>{let n=e.get(t);return n===void 0&&(n=Mt(t),e.set(t,n)),n}}function mn(e,t,n,r=Mt){let o=e.start+e.bp,a=He(e,t);if("fill"in a)return[[e.start,o,r(a.fill)]];let i=a.stops.map(Pt),s=a.stops.map(b=>St(b)[0]),u=Math.abs(s.at(-1)-s[0]),c=Math.max(1,Math.min(Math.ceil(e.bp*n),Math.ceil(u),e.bp)),d=[];for(let b=0;b<c;b++){let h=(b+.5)/c*(i.length-1),l=Math.min(Math.floor(h),i.length-2),f=i[l],w=i[l+1],k=h-l;d.push([Math.round(e.start+e.bp*b/c),Math.round(e.start+e.bp*(b+1)/c),Lt([0,1,2].map(x=>f[x]+(w[x]-f[x])*k))])}return d}function ye(e){return{x:new Uint32Array(e),x2:new Uint32Array(e),row:new Uint32Array(e),color:new Uint32Array(e),count:0}}function Rn(e,t,n){return{x:e.x.subarray(t,n),x2:e.x2.subarray(t,n),row:e.row.subarray(t,n),color:e.color.subarray(t,n),count:n-t}}var xn=e=>e.gap?De(e.cause).px===oe?"hairlines":"gaps":"bars";function Ct(e,t,n){let r=kn(),o=e.map(c=>Fe(c.runs,t).map(d=>({kind:xn(d),pieces:mn(d,n,t,r)}))),a={bars:0,gaps:0,hairlines:0};for(let c of o)for(let d of c)a[d.kind]+=d.pieces.length;let i={bars:ye(a.bars),gaps:ye(a.gaps),hairlines:ye(a.hairlines)},s={bars:new Uint32Array(e.length+1),gaps:new Uint32Array(e.length+1),hairlines:new Uint32Array(e.length+1)},u=1;return o.forEach((c,d)=>{for(let b of c){let h=i[b.kind];for(let[l,f,w]of b.pieces){let k=h.count++;h.x[k]=l,h.x2[k]=f,h.row[k]=d,h.color[k]=w,u=Math.max(u,f)}}for(let b of wn)s[b][d+1]=i[b].count}),{...i,barRows:s.bars,gapRows:s.gaps,hairlineRows:s.hairlines,longest:u}}function _t(e,t,n){let{longest:r}=t,o={start:0,end:r,screenStartPx:n.origin*n.scaleX+n.translateX,screenEndPx:(n.origin+r)*n.scaleX+n.translateX,reversed:!1,displayedRegionIndex:0},a={canvasWidth:n.width,canvasHeight:n.height},i=n.rowPx*n.scaleY;for(let{first:s,count:u,rowY:c}of n.blocks){let d=i/2-n.translateY-(c-s*n.rowPx)*n.scaleY,b=(c-n.rowPx/2)*n.scaleY+n.translateY;if(!(b>n.height||b+u*i<0))for(let[h,l,f]of[[t.bars,t.barRows,n.barPx],[t.gaps,t.gapRows,Math.min(We,n.barPx)],[t.hairlines,t.hairlineRows,Math.min(oe,n.barPx)]])yt.paintBlock(e,Rn(h,l[s],l[s+u]),o,a,{rowHeight:i,rowProportion:f/i,minWidthPx:1,seamPx:0,scrollTop:d})}}var yn=g(function({model:t}){let n=U(()=>X(()=>t.walkRowBars?Ct(t.walkRowList,t.scaleX,t.referenceRampDomain):void 0),[t]),r=L(o=>{let a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch,u=n.get();!a||!i||!s||!u||_t(o,u,{...t.screenTransform,width:t.paneWidth,height:t.canvasHeight,rowPx:s.rowPx,barPx:s.barPx,origin:a.origin,blocks:i.blocks(a.rows.length+1)})},[t,n]);return p(C,{model:t,zIndex:3,testId:"graph-walk-rows-spans",paint:r})}),Sn="rgba(160, 196, 232, 0.55)",Pn="rgba(160, 140, 220, 0.55)",Ln=g(function({model:t}){let n=L(r=>{let o=t.walkRowRibbons,a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch;if(!o||!a||!i||!s)return;let{scaleX:u,scaleY:c,translateX:d,translateY:b}=t.screenTransform,h=f=>(a.origin+f)*u+d,l=s.barPx/2;for(let{row:f,a0:w,a1:k,b0:x,b1:S}of o){let H=i.rowY(f)*c+b+l,$=i.rowY(f+1)*c+b-l;r.fillStyle=x>S?Pn:Sn,r.beginPath(),r.moveTo(h(w),H),r.lineTo(h(k),H),r.lineTo(h(S),$),r.lineTo(h(x),$),r.closePath(),r.fill()}},[t]);return p(C,{model:t,zIndex:2,testId:"graph-walk-rows-ribbons",paint:n})}),Mn=g(function({model:t}){let n=L(r=>{let o=t.sharedBlocks,a=t.walkRowBars,i=t.walkRowPlacement,s=t.walkRowPitch;if(!o||!a||!i||!s)return;let{scaleX:u,scaleY:c,translateX:d,translateY:b}=t.screenTransform;pt(r,o,{x:h=>(a.origin+h)*u+d,rowCentre:h=>i.rowY(h)*c+b,barPx:s.barPx})},[t]);return p(C,{model:t,zIndex:3,testId:"graph-walk-rows-blocks",paint:n})}),Cn=g(function({model:t}){let n=t.walkRowBars,r=t.walkRowPlacement,o=t.walkRowPitch;if(!n||!r||!o||!t.hoveredWalkRowText)return null;let a=t.walkRowList,i=a.findIndex(c=>c.name===t.hoveredWalkRow),s=a[i];if(!s)return null;let u=t.toScreen({x:n.origin,y:r.rowY(i)});return p("rect",{"data-testid":"graph-walk-row-hovered",x:u.x-2,y:u.y-o.rowPx/2-1,width:Ge(s)*t.scaleX+4,height:o.rowPx+2,fill:"none",stroke:"#111",strokeWidth:1})}),_n=g(function({model:t,vector:n=!1}){let r=N(),o=t.walkRowBars,a=t.walkRowPlacement,i=t.walkRowPitch;if(!o||!a||!i)return null;let{paneWidth:s,canvasHeight:u}=t,c={...t.screenTransform,width:s,height:u,...i,bars:n};return m(v,{children:[n||!t.walkRowRibbons?null:p(Ln,{model:t}),n?null:p(yn,{model:t}),n||!t.sharedBlocks?null:p(Mn,{model:t}),m(M,{model:t,zIndex:3,overflow:"visible",testId:"graph-walk-rows",children:[Je(o,t.walkRowGroups?.sections??[],a.rowY,c,{ramp:t.referenceRampDomain,rowGenes:t.walkRowGenes,idPrefix:r}).map((d,b)=>p(D,{el:d},b)),a.headers.map(d=>p("text",{x:10,y:t.toScreen({x:0,y:d.top}).y+je-4,fontFamily:"sans-serif",fontSize:11,fontWeight:"bold",fill:"#333","data-testid":"graph-walk-section",children:d.title},d.key)),p(Cn,{model:t})]})]})}),ka=_n;export{Et as a,it as b,M as c,Kn as d,N as e,D as f,j as g,Gr as h,Dr as i,Zt as j,tn as k,Hr as l,$r as m,an as n,qr as o,Zr as p,Qr as q,eo as r,sn as s,to as t,no as u,po as v,To as w,Ao as x,pn as y,$o as z,bn as A,Qo as B,ka as C};
4
- //# sourceMappingURL=chunk-DIGIM3XY.js.map
4
+ //# sourceMappingURL=chunk-DQC5K7EW.js.map
@@ -1,2 +1,2 @@
1
1
  function o(t){return t===void 0||t==="*"?void 0:t}function s(t){let e=t.split(" ");return{refName:e[0],start:+e[1],end:+e[2],segmentCount:+e[3],pathCount:+e[4],inversion:e[5]==="1",shortestAlleleLength:+e[6],longestAlleleLength:+e[7],segments:e[11],shortestAllele:o(e[12]),longestAllele:o(e[13])}}function u(t,e){return t.key!==void 0||e.key!==void 0?t.key===e.key:t.refName===e.refName&&t.start===e.start&&t.end===e.end}function i(t){return t.key??`${t.refName}:${t.start}-${t.end}`}function b(t){let{shortestAlleleLength:e,longestAlleleLength:n}=t;return e===n?`${n.toLocaleString()} bp`:`${e.toLocaleString()}-${n.toLocaleString()} bp`}var r=2147483647;function a(t){let{pathCount:e,segmentCount:n,inversion:l}=t;return[`${n} segments`,e===r?"more paths than gfatools counts":`up to ${e.toLocaleString()} paths`,...l?["inversion"]:[]].join(", ")}export{s as a,u as b,i as c,b as d,r as e,a as f};
2
- //# sourceMappingURL=chunk-W5HHWDGZ.js.map
2
+ //# sourceMappingURL=chunk-G6NFDDMN.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@12.5.1/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-FX4RDMDN.js"],
3
+ "sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@12.6.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-FX4RDMDN.js"],
4
4
  "sourcesContent": ["// src/bubbles/bubbleLine.ts\nfunction sequence(field) {\n return field === void 0 || field === \"*\" ? void 0 : field;\n}\nfunction parseBubbleLine(line) {\n const cols = line.split(\"\t\");\n return {\n refName: cols[0],\n start: +cols[1],\n end: +cols[2],\n segmentCount: +cols[3],\n pathCount: +cols[4],\n inversion: cols[5] === \"1\",\n shortestAlleleLength: +cols[6],\n longestAlleleLength: +cols[7],\n segments: cols[11],\n shortestAllele: sequence(cols[12]),\n longestAllele: sequence(cols[13])\n };\n}\nfunction sameBubble(a, b) {\n return a.key !== void 0 || b.key !== void 0 ? a.key === b.key : a.refName === b.refName && a.start === b.start && a.end === b.end;\n}\nfunction bubbleKey(b) {\n return b.key ?? `${b.refName}:${b.start}-${b.end}`;\n}\nfunction bubbleLabel(bubble) {\n const { shortestAlleleLength: min, longestAlleleLength: max } = bubble;\n return min === max ? `${max.toLocaleString()} bp` : `${min.toLocaleString()}-${max.toLocaleString()} bp`;\n}\nvar SATURATED_PATH_COUNT = 2147483647;\nfunction bubbleDescription(bubble) {\n const { pathCount, segmentCount, inversion } = bubble;\n return [\n `${segmentCount} segments`,\n pathCount === SATURATED_PATH_COUNT ? \"more paths than gfatools counts\" : `up to ${pathCount.toLocaleString()} paths`,\n ...inversion ? [\"inversion\"] : []\n ].join(\", \");\n}\n\nexport {\n parseBubbleLine,\n sameBubble,\n bubbleKey,\n bubbleLabel,\n SATURATED_PATH_COUNT,\n bubbleDescription\n};\n"],
5
5
  "mappings": "AACA,SAASA,EAASC,EAAO,CACvB,OAAOA,IAAU,QAAUA,IAAU,IAAM,OAASA,CACtD,CACA,SAASC,EAAgBC,EAAM,CAC7B,IAAMC,EAAOD,EAAK,MAAM,GAAG,EAC3B,MAAO,CACL,QAASC,EAAK,CAAC,EACf,MAAO,CAACA,EAAK,CAAC,EACd,IAAK,CAACA,EAAK,CAAC,EACZ,aAAc,CAACA,EAAK,CAAC,EACrB,UAAW,CAACA,EAAK,CAAC,EAClB,UAAWA,EAAK,CAAC,IAAM,IACvB,qBAAsB,CAACA,EAAK,CAAC,EAC7B,oBAAqB,CAACA,EAAK,CAAC,EAC5B,SAAUA,EAAK,EAAE,EACjB,eAAgBJ,EAASI,EAAK,EAAE,CAAC,EACjC,cAAeJ,EAASI,EAAK,EAAE,CAAC,CAClC,CACF,CACA,SAASC,EAAWC,EAAGC,EAAG,CACxB,OAAOD,EAAE,MAAQ,QAAUC,EAAE,MAAQ,OAASD,EAAE,MAAQC,EAAE,IAAMD,EAAE,UAAYC,EAAE,SAAWD,EAAE,QAAUC,EAAE,OAASD,EAAE,MAAQC,EAAE,GAChI,CACA,SAASC,EAAUD,EAAG,CACpB,OAAOA,EAAE,KAAO,GAAGA,EAAE,OAAO,IAAIA,EAAE,KAAK,IAAIA,EAAE,GAAG,EAClD,CACA,SAASE,EAAYC,EAAQ,CAC3B,GAAM,CAAE,qBAAsBC,EAAK,oBAAqBC,CAAI,EAAIF,EAChE,OAAOC,IAAQC,EAAM,GAAGA,EAAI,eAAe,CAAC,MAAQ,GAAGD,EAAI,eAAe,CAAC,IAAIC,EAAI,eAAe,CAAC,KACrG,CACA,IAAIC,EAAuB,WAC3B,SAASC,EAAkBJ,EAAQ,CACjC,GAAM,CAAE,UAAAK,EAAW,aAAAC,EAAc,UAAAC,CAAU,EAAIP,EAC/C,MAAO,CACL,GAAGM,CAAY,YACfD,IAAcF,EAAuB,kCAAoC,SAASE,EAAU,eAAe,CAAC,SAC5G,GAAGE,EAAY,CAAC,WAAW,EAAI,CAAC,CAClC,EAAE,KAAK,IAAI,CACb",
6
6
  "names": ["sequence", "field", "parseBubbleLine", "line", "cols", "sameBubble", "a", "b", "bubbleKey", "bubbleLabel", "bubble", "min", "max", "SATURATED_PATH_COUNT", "bubbleDescription", "pathCount", "segmentCount", "inversion"]
@@ -1,2 +1,2 @@
1
- import{i as M,l as W,p as F}from"./chunk-X2QGBINE.js";import{b as O,h as B}from"./chunk-UC2NHZ7E.js";import{K as f,Q as A,X as _}from"./chunk-OPWSPSAE.js";import{f as R}from"./chunk-J2PN6CG3.js";import{D as x,E,H as S,d as C,o as T,q as I,r as w,s as L,t as N,w as D,y as G,z as P}from"./chunk-WE7DQVXF.js";import{b as t,c as r,d as s}from"./chunk-DUU6T2I5.js";var k=[{value:0,label:"Fastest"},{value:1,label:"Fast"},{value:2,label:"Default"},{value:3,label:"Fine"},{value:4,label:"Best"}];var U=s(function({label:n,value:e,options:o,testId:p,size:h,sx:a,disabled:m,title:u,shown:b,onChange:H}){let y=R();return r(L,{size:h,sx:a,disabled:m,title:u,children:[t(D,{id:y,shrink:!0,children:n}),t(x,{labelId:y,value:e,label:n,notched:!0,displayEmpty:!0,"data-testid":p,renderValue:i=>b??o.find(Y=>Y.value===i)?.label??i,onChange:i=>{H(i.target.value)},children:o.map(i=>t(P,{value:i.value,disabled:i.disabled,title:i.disabled?void 0:i.description,children:t(G,{primary:i.label,secondary:i.disabled?i.description:void 0})},i.value))})]})});var g=F()({section:{marginBottom:24},group:{marginBottom:16},heading:{marginBottom:8}}),l=s(function({warn:n=!1,children:e}){return t(S,{variant:"caption",component:"div",color:n?"warning.main":"text.secondary",children:e})}),v=s(function({title:n,children:e}){let{classes:o}=g();return r("section",{className:o.group,children:[t(S,{variant:"subtitle1",className:o.heading,children:n}),e]})}),Q=s(function({label:n,checked:e,onChange:o,children:p}){let{classes:h}=g();return r("div",{className:h.section,children:[t(N,{control:t(E,{checked:e,onChange:a=>{o(a.target.checked)}}),label:n}),p]})}),d=s(function({children:n,...e}){let{classes:o}=g();return r("div",{className:o.section,children:[t(U,{sx:{minWidth:200},...e}),n]})}),$=[5e3,2e4,5e4,1e5];function q(c){return[...new Set([...$,c])].sort((n,e)=>n-e).map(n=>({value:String(n),label:n.toLocaleString()}))}var z=s(function({label:n,choices:e,stored:o,auto:p,testId:h,onChange:a,children:m}){return e.length>0?t(d,{label:n,value:e.some(u=>u.trackId===o)?o:"",options:[{value:"",label:`Automatic (${p?.name??"none"})`},...e.map(({trackId:u,name:b})=>({value:u,label:b}))],testId:h,onChange:a,children:m}):null}),K=s(function(n){let{model:e,onClose:o,children:p}=n,{classes:h}=g();return r(C,{open:!0,onClose:o,title:"Graph settings",children:[r(w,{children:[r(v,{title:"Subgraph",children:[p,t(d,{label:"Node limit",value:String(e.maxGraphNodes),options:q(e.maxGraphNodes),testId:"graph-node-limit-select",onChange:a=>{e.setMaxGraphNodes(Number(a))},children:t(l,{children:"The most nodes a layout draws; past it the graph is declined. Walk rows take no limit."})})]}),r(v,{title:"Drawing",children:[e.anchorPaths.length>1?t(d,{label:"Reference path",value:e.activeReferencePath??"",options:e.anchorPaths.map(({name:a})=>({value:a,label:a})),testId:"graph-reference-path-select",onChange:a=>{e.setReferencePath(a),e.recomputeLayout()},children:t(l,{children:"The path the anchored layouts place x along"})}):null,t(d,{label:"Node width",value:e.nodeWidth,options:A,testId:"graph-node-width-select",onChange:a=>{e.setNodeWidth(a)},children:t(l,{children:"Depth as width. In a cut with walks, depth is how many haplotypes carry the node."})}),t(d,{label:"Link width",value:e.linkWidth,options:_,testId:"graph-link-width-select",onChange:a=>{e.setLinkWidth(a)},children:t(l,{children:"Walks as width, so a common route reads heavy and a private one thin."})}),r(Q,{label:"Draw paths",checked:e.drawPaths,onChange:a=>{e.setLayer("paths",a)},children:[t(l,{children:"Color each node by the paths through it, one lane per path"}),e.drawPaths&&!e.effectiveDrawPaths?t(l,{warn:!0,children:e.pathCount>f?`Off: ${e.pathCount.toLocaleString()} paths is past the ${f} this can tell apart`:"Off: this graph states no paths"}):null]}),t(z,{label:"Gene track",choices:e.geneTrackChoices,stored:e.geneTrackId,auto:W(e.geneTrackChoices,""),testId:"graph-gene-track-select",onChange:a=>{e.setGeneTrackId(a)},children:t(l,{children:"Where genes on the backbone come from"})}),t(z,{label:"Repeat track",choices:e.repeatTrackChoices,stored:e.repeatTrackId,auto:M(e.repeatTrackChoices,""),testId:"graph-repeat-track-select",onChange:a=>{e.setRepeatTrackId(a)},children:t(l,{children:"The tandem repeat annotation walk rows measure and tile by"})})]}),r(v,{title:"Force-directed layout",children:[e.hasGraph&&!e.usesLayoutEngine?t("div",{className:h.section,children:t(l,{warn:!0,children:"No effect on the current layout until Layout is Force-directed"})}):null,t(d,{label:"Engine",value:e.layoutEngine,options:O,testId:"graph-layout-engine-select",onChange:a=>{e.setLayoutEngine(a)},children:t(l,{children:"Stress keeps the reference straight, so a zoom keeps the picture; FMMM lets the whole graph settle."})}),t(d,{label:"Layout quality",value:String(e.layoutQuality),options:k.map(a=>({value:String(a.value),label:a.label})),testId:"graph-layout-quality-select",onChange:a=>{e.setLayoutQuality(Number(a))},children:t(l,{children:"The engine's iteration budget; higher is slower"})}),t(d,{label:"Bubble spread",value:e.bubbleSpread,options:B,testId:"graph-bubble-spread-select",onChange:a=>{e.setBubbleSpread(a)},children:t(l,{children:"How far the layout opens a bubble"})}),e.layoutEngine==="stress"?null:t(Q,{label:"Linear layout",checked:e.linearLayout,onChange:a=>{e.setLinearLayout(a)},children:t(l,{children:"Keeps a chain of nodes on one line where it can"})})]})]}),t(I,{children:t(T,{variant:"contained",color:"primary",onClick:o,children:"Close"})})]})}),be=K;export{U as a,be as b};
2
- //# sourceMappingURL=chunk-4XY7HUQR.js.map
1
+ import{i as M,l as W,p as F}from"./chunk-64OSFJLE.js";import{b as O,h as B}from"./chunk-S7DQGZX2.js";import{K as f,Q as A,X as _}from"./chunk-46O3IEW3.js";import{f as R}from"./chunk-J2PN6CG3.js";import{D as x,E,H as S,d as C,o as T,q as I,r as w,s as L,t as N,w as D,y as G,z as P}from"./chunk-WE7DQVXF.js";import{b as t,c as r,d as s}from"./chunk-DUU6T2I5.js";var k=[{value:0,label:"Fastest"},{value:1,label:"Fast"},{value:2,label:"Default"},{value:3,label:"Fine"},{value:4,label:"Best"}];var U=s(function({label:n,value:e,options:o,testId:p,size:h,sx:a,disabled:m,title:u,shown:b,onChange:H}){let y=R();return r(L,{size:h,sx:a,disabled:m,title:u,children:[t(D,{id:y,shrink:!0,children:n}),t(x,{labelId:y,value:e,label:n,notched:!0,displayEmpty:!0,"data-testid":p,renderValue:i=>b??o.find(Y=>Y.value===i)?.label??i,onChange:i=>{H(i.target.value)},children:o.map(i=>t(P,{value:i.value,disabled:i.disabled,title:i.disabled?void 0:i.description,children:t(G,{primary:i.label,secondary:i.disabled?i.description:void 0})},i.value))})]})});var g=F()({section:{marginBottom:24},group:{marginBottom:16},heading:{marginBottom:8}}),l=s(function({warn:n=!1,children:e}){return t(S,{variant:"caption",component:"div",color:n?"warning.main":"text.secondary",children:e})}),v=s(function({title:n,children:e}){let{classes:o}=g();return r("section",{className:o.group,children:[t(S,{variant:"subtitle1",className:o.heading,children:n}),e]})}),Q=s(function({label:n,checked:e,onChange:o,children:p}){let{classes:h}=g();return r("div",{className:h.section,children:[t(N,{control:t(E,{checked:e,onChange:a=>{o(a.target.checked)}}),label:n}),p]})}),d=s(function({children:n,...e}){let{classes:o}=g();return r("div",{className:o.section,children:[t(U,{sx:{minWidth:200},...e}),n]})}),$=[5e3,2e4,5e4,1e5];function q(c){return[...new Set([...$,c])].sort((n,e)=>n-e).map(n=>({value:String(n),label:n.toLocaleString()}))}var z=s(function({label:n,choices:e,stored:o,auto:p,testId:h,onChange:a,children:m}){return e.length>0?t(d,{label:n,value:e.some(u=>u.trackId===o)?o:"",options:[{value:"",label:`Automatic (${p?.name??"none"})`},...e.map(({trackId:u,name:b})=>({value:u,label:b}))],testId:h,onChange:a,children:m}):null}),K=s(function(n){let{model:e,onClose:o,children:p}=n,{classes:h}=g();return r(C,{open:!0,onClose:o,title:"Graph settings",children:[r(w,{children:[r(v,{title:"Subgraph",children:[p,t(d,{label:"Node limit",value:String(e.maxGraphNodes),options:q(e.maxGraphNodes),testId:"graph-node-limit-select",onChange:a=>{e.setMaxGraphNodes(Number(a))},children:t(l,{children:"The most nodes a layout draws; past it the graph is declined. Walk rows take no limit."})})]}),r(v,{title:"Drawing",children:[e.anchorPaths.length>1?t(d,{label:"Reference path",value:e.activeReferencePath??"",options:e.anchorPaths.map(({name:a})=>({value:a,label:a})),testId:"graph-reference-path-select",onChange:a=>{e.setReferencePath(a),e.recomputeLayout()},children:t(l,{children:"The path the anchored layouts place x along"})}):null,t(d,{label:"Node width",value:e.nodeWidth,options:A,testId:"graph-node-width-select",onChange:a=>{e.setNodeWidth(a)},children:t(l,{children:"Depth as width. In a cut with walks, depth is how many haplotypes carry the node."})}),t(d,{label:"Link width",value:e.linkWidth,options:_,testId:"graph-link-width-select",onChange:a=>{e.setLinkWidth(a)},children:t(l,{children:"Walks as width, so a common route reads heavy and a private one thin."})}),r(Q,{label:"Draw paths",checked:e.drawPaths,onChange:a=>{e.setLayer("paths",a)},children:[t(l,{children:"Color each node by the paths through it, one lane per path"}),e.drawPaths&&!e.effectiveDrawPaths?t(l,{warn:!0,children:e.pathCount>f?`Off: ${e.pathCount.toLocaleString()} paths is past the ${f} this can tell apart`:"Off: this graph states no paths"}):null]}),t(z,{label:"Gene track",choices:e.geneTrackChoices,stored:e.geneTrackId,auto:W(e.geneTrackChoices,""),testId:"graph-gene-track-select",onChange:a=>{e.setGeneTrackId(a)},children:t(l,{children:"Where genes on the backbone come from"})}),t(z,{label:"Repeat track",choices:e.repeatTrackChoices,stored:e.repeatTrackId,auto:M(e.repeatTrackChoices,""),testId:"graph-repeat-track-select",onChange:a=>{e.setRepeatTrackId(a)},children:t(l,{children:"The tandem repeat annotation walk rows measure and tile by"})})]}),r(v,{title:"Force-directed layout",children:[e.hasGraph&&!e.usesLayoutEngine?t("div",{className:h.section,children:t(l,{warn:!0,children:"No effect on the current layout until Layout is Force-directed"})}):null,t(d,{label:"Engine",value:e.layoutEngine,options:O,testId:"graph-layout-engine-select",onChange:a=>{e.setLayoutEngine(a)},children:t(l,{children:"Stress keeps the reference straight, so a zoom keeps the picture; FMMM lets the whole graph settle."})}),t(d,{label:"Layout quality",value:String(e.layoutQuality),options:k.map(a=>({value:String(a.value),label:a.label})),testId:"graph-layout-quality-select",onChange:a=>{e.setLayoutQuality(Number(a))},children:t(l,{children:"The engine's iteration budget; higher is slower"})}),t(d,{label:"Bubble spread",value:e.bubbleSpread,options:B,testId:"graph-bubble-spread-select",onChange:a=>{e.setBubbleSpread(a)},children:t(l,{children:"How far the layout opens a bubble"})}),e.layoutEngine==="stress"?null:t(Q,{label:"Linear layout",checked:e.linearLayout,onChange:a=>{e.setLinearLayout(a)},children:t(l,{children:"Keeps a chain of nodes on one line where it can"})})]})]}),t(I,{children:t(T,{variant:"contained",color:"primary",onClick:o,children:"Close"})})]})}),be=K;export{U as a,be as b};
2
+ //# sourceMappingURL=chunk-HC2YPYTO.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@12.5.1/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-K5SIJGAE.js", "../../src/GraphGenomeView/components/LabelledSelect.tsx", "../../src/GraphGenomeView/components/GraphSettingsDialog.tsx"],
3
+ "sources": ["../../node_modules/.pnpm/@jbrowse+bandage-core@12.6.2/node_modules/@jbrowse/bandage-core/dist/chunks/chunk-K5SIJGAE.js", "../../src/GraphGenomeView/components/LabelledSelect.tsx", "../../src/GraphGenomeView/components/GraphSettingsDialog.tsx"],
4
4
  "sourcesContent": ["// src/layoutQualities.ts\nvar LAYOUT_QUALITIES = [\n { value: 0, label: \"Fastest\" },\n { value: 1, label: \"Fast\" },\n { value: 2, label: \"Default\" },\n { value: 3, label: \"Fine\" },\n { value: 4, label: \"Best\" }\n];\n\nexport {\n LAYOUT_QUALITIES\n};\n", "import { useId } from 'react'\n\nimport {\n FormControl,\n InputLabel,\n ListItemText,\n MenuItem,\n Select,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\n\nimport type { SxProps } from '@mui/material'\n\ninterface SelectOption<T extends string> {\n value: T\n label: string\n // an option's tooltip, and the reason under a disabled one, whose tooltip\n // cannot open\n description?: string\n disabled?: boolean\n}\n\n// One dropdown with its label tied to it, so a screen reader names the combobox\nexport default observer(function LabelledSelect<T extends string>({\n label,\n value,\n options,\n testId,\n size,\n sx,\n disabled,\n title,\n shown,\n onChange,\n}: {\n label: string\n value: T\n options: readonly SelectOption<T>[]\n testId?: string\n size?: 'small' | 'medium'\n sx?: SxProps\n disabled?: boolean\n title?: string\n // what the closed select reads, when not the picked option's label\n shown?: string\n onChange: (value: T) => void\n}) {\n const labelId = useId()\n return (\n <FormControl size={size} sx={sx} disabled={disabled} title={title}>\n <InputLabel id={labelId} shrink>\n {label}\n </InputLabel>\n <Select\n labelId={labelId}\n value={value}\n label={label}\n notched\n displayEmpty\n data-testid={testId}\n renderValue={picked =>\n shown ?? options.find(o => o.value === picked)?.label ?? picked\n }\n onChange={e => {\n onChange(e.target.value as T)\n }}\n >\n {options.map(o => (\n <MenuItem\n key={o.value}\n value={o.value}\n disabled={o.disabled}\n title={o.disabled ? undefined : o.description}\n >\n <ListItemText\n primary={o.label}\n secondary={o.disabled ? o.description : undefined}\n />\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n )\n})\n", "import type { ReactNode } from 'react'\n\nimport { BUBBLE_SPREADS } from '@jbrowse/bandage-core/bubbleSpreads'\nimport { EDGE_WIDTHS } from '@jbrowse/bandage-core/edgeWidths'\nimport { LAYOUT_ENGINES } from '@jbrowse/bandage-core/layoutEngines'\nimport { LAYOUT_QUALITIES } from '@jbrowse/bandage-core/layoutQualities'\nimport { NODE_WIDTHS } from '@jbrowse/bandage-core/nodeWidths'\nimport { MAX_PATH_COLORS } from '@jbrowse/bandage-core/pathColors'\nimport { Dialog } from '@jbrowse/core/ui'\nimport {\n Button,\n DialogActions,\n DialogContent,\n FormControlLabel,\n Switch,\n Typography,\n} from '@mui/material'\nimport { observer } from 'mobx-react'\nimport { makeStyles } from 'tss-react/mui'\n\nimport LabelledSelect from './LabelledSelect'\nimport { pickGeneTrack } from '../genes/geneFeatures'\nimport { pickRepeatTrack } from '../repeats/repeatFeatures'\n\nimport type { GraphPaneModel } from '../model'\n\nconst useStyles = makeStyles()({\n section: {\n marginBottom: 24,\n },\n group: {\n marginBottom: 16,\n },\n heading: {\n marginBottom: 8,\n },\n})\n\nconst Caption = observer(function Caption({\n warn = false,\n children,\n}: {\n warn?: boolean\n children: ReactNode\n}) {\n return (\n <Typography\n variant=\"caption\"\n component=\"div\"\n color={warn ? 'warning.main' : 'text.secondary'}\n >\n {children}\n </Typography>\n )\n})\n\nconst Group = observer(function Group({\n title,\n children,\n}: {\n title: string\n children: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <section className={classes.group}>\n <Typography variant=\"subtitle1\" className={classes.heading}>\n {title}\n </Typography>\n {children}\n </section>\n )\n})\n\nconst SettingSwitch = observer(function SettingSwitch({\n label,\n checked,\n onChange,\n children,\n}: {\n label: string\n checked: boolean\n onChange: (checked: boolean) => void\n children?: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <div className={classes.section}>\n <FormControlLabel\n control={\n <Switch\n checked={checked}\n onChange={e => {\n onChange(e.target.checked)\n }}\n />\n }\n label={label}\n />\n {children}\n </div>\n )\n})\n\n// one dropdown setting, at the dialog's width, and its caption\nconst SettingSelect = observer(function SettingSelect<T extends string>({\n children,\n ...props\n}: Omit<Parameters<typeof LabelledSelect<T>>[0], 'size' | 'sx'> & {\n children?: ReactNode\n}) {\n const { classes } = useStyles()\n return (\n <div className={classes.section}>\n <LabelledSelect sx={{ minWidth: 200 }} {...props} />\n {children}\n </div>\n )\n})\n\nconst NODE_LIMITS = [5000, 20_000, 50_000, 100_000]\n\n// the presets, with a limit a session states among them\nfunction nodeLimitOptions(current: number) {\n return [...new Set([...NODE_LIMITS, current])]\n .sort((a, b) => a - b)\n .map(limit => ({ value: String(limit), label: limit.toLocaleString() }))\n}\n\ninterface NamedTrack {\n trackId: string\n name: string\n}\n\n// '' leaves the pick to the heuristic, so a session can go back to it\nconst TrackPickSetting = observer(function TrackPickSetting({\n label,\n choices,\n stored,\n auto,\n testId,\n onChange,\n children,\n}: {\n label: string\n choices: NamedTrack[]\n stored: string\n auto: NamedTrack | undefined\n testId: string\n onChange: (trackId: string) => void\n children: ReactNode\n}) {\n return choices.length > 0 ? (\n <SettingSelect\n label={label}\n value={choices.some(t => t.trackId === stored) ? stored : ''}\n options={[\n { value: '', label: `Automatic (${auto?.name ?? 'none'})` },\n ...choices.map(({ trackId, name }) => ({\n value: trackId,\n label: name,\n })),\n ]}\n testId={testId}\n onChange={onChange}\n >\n {children}\n </SettingSelect>\n ) : null\n})\n\n// Toggles the menus already offer (halos, genes, color) stay out of here.\n// `children` is the host's own part of the subgraph group.\nconst GraphSettingsDialog = observer(function GraphSettingsDialog(props: {\n model: GraphPaneModel\n onClose: () => void\n children?: ReactNode\n}) {\n const { model, onClose, children } = props\n const { classes } = useStyles()\n\n return (\n <Dialog open onClose={onClose} title=\"Graph settings\">\n <DialogContent>\n <Group title=\"Subgraph\">\n {children}\n <SettingSelect\n label=\"Node limit\"\n value={String(model.maxGraphNodes)}\n options={nodeLimitOptions(model.maxGraphNodes)}\n testId=\"graph-node-limit-select\"\n onChange={limit => {\n model.setMaxGraphNodes(Number(limit))\n }}\n >\n <Caption>\n The most nodes a layout draws; past it the graph is declined. Walk\n rows take no limit.\n </Caption>\n </SettingSelect>\n </Group>\n\n <Group title=\"Drawing\">\n {model.anchorPaths.length > 1 ? (\n <SettingSelect\n label=\"Reference path\"\n value={model.activeReferencePath ?? ''}\n options={model.anchorPaths.map(({ name }) => ({\n value: name,\n label: name,\n }))}\n testId=\"graph-reference-path-select\"\n onChange={name => {\n model.setReferencePath(name)\n void model.recomputeLayout()\n }}\n >\n <Caption>The path the anchored layouts place x along</Caption>\n </SettingSelect>\n ) : null}\n\n <SettingSelect\n label=\"Node width\"\n value={model.nodeWidth}\n options={NODE_WIDTHS}\n testId=\"graph-node-width-select\"\n onChange={width => {\n model.setNodeWidth(width)\n }}\n >\n <Caption>\n Depth as width. In a cut with walks, depth is how many haplotypes\n carry the node.\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Link width\"\n value={model.linkWidth}\n options={EDGE_WIDTHS}\n testId=\"graph-link-width-select\"\n onChange={links => {\n model.setLinkWidth(links)\n }}\n >\n <Caption>\n Walks as width, so a common route reads heavy and a private one\n thin.\n </Caption>\n </SettingSelect>\n\n <SettingSwitch\n label=\"Draw paths\"\n checked={model.drawPaths}\n onChange={draw => {\n model.setLayer('paths', draw)\n }}\n >\n <Caption>\n Color each node by the paths through it, one lane per path\n </Caption>\n {model.drawPaths && !model.effectiveDrawPaths ? (\n <Caption warn>\n {model.pathCount > MAX_PATH_COLORS\n ? `Off: ${model.pathCount.toLocaleString()} paths is past the ${MAX_PATH_COLORS} this can tell apart`\n : 'Off: this graph states no paths'}\n </Caption>\n ) : null}\n </SettingSwitch>\n\n <TrackPickSetting\n label=\"Gene track\"\n choices={model.geneTrackChoices}\n stored={model.geneTrackId}\n auto={pickGeneTrack(model.geneTrackChoices, '')}\n testId=\"graph-gene-track-select\"\n onChange={trackId => {\n model.setGeneTrackId(trackId)\n }}\n >\n <Caption>Where genes on the backbone come from</Caption>\n </TrackPickSetting>\n\n <TrackPickSetting\n label=\"Repeat track\"\n choices={model.repeatTrackChoices}\n stored={model.repeatTrackId}\n auto={pickRepeatTrack(model.repeatTrackChoices, '')}\n testId=\"graph-repeat-track-select\"\n onChange={trackId => {\n model.setRepeatTrackId(trackId)\n }}\n >\n <Caption>\n The tandem repeat annotation walk rows measure and tile by\n </Caption>\n </TrackPickSetting>\n </Group>\n\n <Group title=\"Force-directed layout\">\n {model.hasGraph && !model.usesLayoutEngine ? (\n <div className={classes.section}>\n <Caption warn>\n No effect on the current layout until Layout is Force-directed\n </Caption>\n </div>\n ) : null}\n\n <SettingSelect\n label=\"Engine\"\n value={model.layoutEngine}\n options={LAYOUT_ENGINES}\n testId=\"graph-layout-engine-select\"\n onChange={engine => {\n model.setLayoutEngine(engine)\n }}\n >\n <Caption>\n Stress keeps the reference straight, so a zoom keeps the picture;\n FMMM lets the whole graph settle.\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Layout quality\"\n value={String(model.layoutQuality)}\n options={LAYOUT_QUALITIES.map(q => ({\n value: String(q.value),\n label: q.label,\n }))}\n testId=\"graph-layout-quality-select\"\n onChange={quality => {\n model.setLayoutQuality(Number(quality))\n }}\n >\n <Caption>\n The engine&apos;s iteration budget; higher is slower\n </Caption>\n </SettingSelect>\n\n <SettingSelect\n label=\"Bubble spread\"\n value={model.bubbleSpread}\n options={BUBBLE_SPREADS}\n testId=\"graph-bubble-spread-select\"\n onChange={spread => {\n model.setBubbleSpread(spread)\n }}\n >\n <Caption>How far the layout opens a bubble</Caption>\n </SettingSelect>\n\n {model.layoutEngine === 'stress' ? null : (\n <SettingSwitch\n label=\"Linear layout\"\n checked={model.linearLayout}\n onChange={linear => {\n model.setLinearLayout(linear)\n }}\n >\n <Caption>Keeps a chain of nodes on one line where it can</Caption>\n </SettingSwitch>\n )}\n </Group>\n </DialogContent>\n\n <DialogActions>\n <Button variant=\"contained\" color=\"primary\" onClick={onClose}>\n Close\n </Button>\n </DialogActions>\n </Dialog>\n )\n})\n\nexport default GraphSettingsDialog\n"],
5
5
  "mappings": "yWACA,IAAIA,EAAmB,CACrB,CAAE,MAAO,EAAG,MAAO,SAAU,EAC7B,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,SAAU,EAC7B,CAAE,MAAO,EAAG,MAAO,MAAO,EAC1B,CAAE,MAAO,EAAG,MAAO,MAAO,CAC5B,ECgBA,IAAOC,EAAQC,EAAS,SAA0C,CAChE,MAAAC,EACA,MAAAC,EACA,QAAAC,EACA,OAAAC,EACA,KAAAC,EACA,GAAAC,EACA,SAAAC,EACA,MAAAC,EACA,MAAAC,EACA,SAAAC,CACF,EAYG,CACD,IAAMC,EAAUC,EAAM,EACtB,OACEC,EAACC,EAAA,CAAY,KAAMT,EAAM,GAAIC,EAAI,SAAUC,EAAU,MAAOC,EAC1D,UAAAO,EAACC,EAAA,CAAW,GAAIL,EAAS,OAAM,GAC5B,SAAAV,EACH,EACAc,EAACE,EAAA,CACC,QAASN,EACT,MAAOT,EACP,MAAOD,EACP,QAAO,GACP,aAAY,GACZ,cAAaG,EACb,YAAac,GACXT,GAASN,EAAQ,KAAKgB,GAAKA,EAAE,QAAUD,CAAM,GAAG,OAASA,EAE3D,SAAUE,GAAK,CACbV,EAASU,EAAE,OAAO,KAAU,CAC9B,EAEC,SAAAjB,EAAQ,IAAIgB,GACXJ,EAACM,EAAA,CAEC,MAAOF,EAAE,MACT,SAAUA,EAAE,SACZ,MAAOA,EAAE,SAAW,OAAYA,EAAE,YAElC,SAAAJ,EAACO,EAAA,CACC,QAASH,EAAE,MACX,UAAWA,EAAE,SAAWA,EAAE,YAAc,OAC1C,GARKA,EAAE,KAST,CACD,EACH,GACF,CAEJ,CAAC,ECzDD,IAAMI,EAAYC,EAAW,EAAE,CAC7B,QAAS,CACP,aAAc,EAChB,EACA,MAAO,CACL,aAAc,EAChB,EACA,QAAS,CACP,aAAc,CAChB,CACF,CAAC,EAEKC,EAAUC,EAAS,SAAiB,CACxC,KAAAC,EAAO,GACP,SAAAC,CACF,EAGG,CACD,OACEC,EAACC,EAAA,CACC,QAAQ,UACR,UAAU,MACV,MAAOH,EAAO,eAAiB,iBAE9B,SAAAC,EACH,CAEJ,CAAC,EAEKG,EAAQL,EAAS,SAAe,CACpC,MAAAM,EACA,SAAAJ,CACF,EAGG,CACD,GAAM,CAAE,QAAAK,CAAQ,EAAIV,EAAU,EAC9B,OACEW,EAAC,WAAQ,UAAWD,EAAQ,MAC1B,UAAAJ,EAACC,EAAA,CAAW,QAAQ,YAAY,UAAWG,EAAQ,QAChD,SAAAD,EACH,EACCJ,GACH,CAEJ,CAAC,EAEKO,EAAgBT,EAAS,SAAuB,CACpD,MAAAU,EACA,QAAAC,EACA,SAAAC,EACA,SAAAV,CACF,EAKG,CACD,GAAM,CAAE,QAAAK,CAAQ,EAAIV,EAAU,EAC9B,OACEW,EAAC,OAAI,UAAWD,EAAQ,QACtB,UAAAJ,EAACU,EAAA,CACC,QACEV,EAACW,EAAA,CACC,QAASH,EACT,SAAUI,GAAK,CACbH,EAASG,EAAE,OAAO,OAAO,CAC3B,EACF,EAEF,MAAOL,EACT,EACCR,GACH,CAEJ,CAAC,EAGKc,EAAgBhB,EAAS,SAAyC,CACtE,SAAAE,EACA,GAAGe,CACL,EAEG,CACD,GAAM,CAAE,QAAAV,CAAQ,EAAIV,EAAU,EAC9B,OACEW,EAAC,OAAI,UAAWD,EAAQ,QACtB,UAAAJ,EAACe,EAAA,CAAe,GAAI,CAAE,SAAU,GAAI,EAAI,GAAGD,EAAO,EACjDf,GACH,CAEJ,CAAC,EAEKiB,EAAc,CAAC,IAAM,IAAQ,IAAQ,GAAO,EAGlD,SAASC,EAAiBC,EAAiB,CACzC,MAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAGF,EAAaE,CAAO,CAAC,CAAC,EAC1C,KAAK,CAACC,EAAGC,IAAMD,EAAIC,CAAC,EACpB,IAAIC,IAAU,CAAE,MAAO,OAAOA,CAAK,EAAG,MAAOA,EAAM,eAAe,CAAE,EAAE,CAC3E,CAQA,IAAMC,EAAmBzB,EAAS,SAA0B,CAC1D,MAAAU,EACA,QAAAgB,EACA,OAAAC,EACA,KAAAC,EACA,OAAAC,EACA,SAAAjB,EACA,SAAAV,CACF,EAQG,CACD,OAAOwB,EAAQ,OAAS,EACtBvB,EAACa,EAAA,CACC,MAAON,EACP,MAAOgB,EAAQ,KAAKI,GAAKA,EAAE,UAAYH,CAAM,EAAIA,EAAS,GAC1D,QAAS,CACP,CAAE,MAAO,GAAI,MAAO,cAAcC,GAAM,MAAQ,MAAM,GAAI,EAC1D,GAAGF,EAAQ,IAAI,CAAC,CAAE,QAAAK,EAAS,KAAAC,CAAK,KAAO,CACrC,MAAOD,EACP,MAAOC,CACT,EAAE,CACJ,EACA,OAAQH,EACR,SAAUjB,EAET,SAAAV,EACH,EACE,IACN,CAAC,EAIK+B,EAAsBjC,EAAS,SAA6BiB,EAI/D,CACD,GAAM,CAAE,MAAAiB,EAAO,QAAAC,EAAS,SAAAjC,CAAS,EAAIe,EAC/B,CAAE,QAAAV,CAAQ,EAAIV,EAAU,EAE9B,OACEW,EAAC4B,EAAA,CAAO,KAAI,GAAC,QAASD,EAAS,MAAM,iBACnC,UAAA3B,EAAC6B,EAAA,CACC,UAAA7B,EAACH,EAAA,CAAM,MAAM,WACV,UAAAH,EACDC,EAACa,EAAA,CACC,MAAM,aACN,MAAO,OAAOkB,EAAM,aAAa,EACjC,QAASd,EAAiBc,EAAM,aAAa,EAC7C,OAAO,0BACP,SAAUV,GAAS,CACjBU,EAAM,iBAAiB,OAAOV,CAAK,CAAC,CACtC,EAEA,SAAArB,EAACJ,EAAA,CAAQ,kGAGT,EACF,GACF,EAEAS,EAACH,EAAA,CAAM,MAAM,UACV,UAAA6B,EAAM,YAAY,OAAS,EAC1B/B,EAACa,EAAA,CACC,MAAM,iBACN,MAAOkB,EAAM,qBAAuB,GACpC,QAASA,EAAM,YAAY,IAAI,CAAC,CAAE,KAAAF,CAAK,KAAO,CAC5C,MAAOA,EACP,MAAOA,CACT,EAAE,EACF,OAAO,8BACP,SAAUA,GAAQ,CAChBE,EAAM,iBAAiBF,CAAI,EACtBE,EAAM,gBAAgB,CAC7B,EAEA,SAAA/B,EAACJ,EAAA,CAAQ,uDAA2C,EACtD,EACE,KAEJI,EAACa,EAAA,CACC,MAAM,aACN,MAAOkB,EAAM,UACb,QAASI,EACT,OAAO,0BACP,SAAUC,GAAS,CACjBL,EAAM,aAAaK,CAAK,CAC1B,EAEA,SAAApC,EAACJ,EAAA,CAAQ,6FAGT,EACF,EAEAI,EAACa,EAAA,CACC,MAAM,aACN,MAAOkB,EAAM,UACb,QAASM,EACT,OAAO,0BACP,SAAUC,GAAS,CACjBP,EAAM,aAAaO,CAAK,CAC1B,EAEA,SAAAtC,EAACJ,EAAA,CAAQ,iFAGT,EACF,EAEAS,EAACC,EAAA,CACC,MAAM,aACN,QAASyB,EAAM,UACf,SAAUQ,GAAQ,CAChBR,EAAM,SAAS,QAASQ,CAAI,CAC9B,EAEA,UAAAvC,EAACJ,EAAA,CAAQ,sEAET,EACCmC,EAAM,WAAa,CAACA,EAAM,mBACzB/B,EAACJ,EAAA,CAAQ,KAAI,GACV,SAAAmC,EAAM,UAAYS,EACf,QAAQT,EAAM,UAAU,eAAe,CAAC,sBAAsBS,CAAe,uBAC7E,kCACN,EACE,MACN,EAEAxC,EAACsB,EAAA,CACC,MAAM,aACN,QAASS,EAAM,iBACf,OAAQA,EAAM,YACd,KAAMU,EAAcV,EAAM,iBAAkB,EAAE,EAC9C,OAAO,0BACP,SAAUH,GAAW,CACnBG,EAAM,eAAeH,CAAO,CAC9B,EAEA,SAAA5B,EAACJ,EAAA,CAAQ,iDAAqC,EAChD,EAEAI,EAACsB,EAAA,CACC,MAAM,eACN,QAASS,EAAM,mBACf,OAAQA,EAAM,cACd,KAAMW,EAAgBX,EAAM,mBAAoB,EAAE,EAClD,OAAO,4BACP,SAAUH,GAAW,CACnBG,EAAM,iBAAiBH,CAAO,CAChC,EAEA,SAAA5B,EAACJ,EAAA,CAAQ,sEAET,EACF,GACF,EAEAS,EAACH,EAAA,CAAM,MAAM,wBACV,UAAA6B,EAAM,UAAY,CAACA,EAAM,iBACxB/B,EAAC,OAAI,UAAWI,EAAQ,QACtB,SAAAJ,EAACJ,EAAA,CAAQ,KAAI,GAAC,0EAEd,EACF,EACE,KAEJI,EAACa,EAAA,CACC,MAAM,SACN,MAAOkB,EAAM,aACb,QAASY,EACT,OAAO,6BACP,SAAUC,GAAU,CAClBb,EAAM,gBAAgBa,CAAM,CAC9B,EAEA,SAAA5C,EAACJ,EAAA,CAAQ,+GAGT,EACF,EAEAI,EAACa,EAAA,CACC,MAAM,iBACN,MAAO,OAAOkB,EAAM,aAAa,EACjC,QAASc,EAAiB,IAAIC,IAAM,CAClC,MAAO,OAAOA,EAAE,KAAK,EACrB,MAAOA,EAAE,KACX,EAAE,EACF,OAAO,8BACP,SAAUC,GAAW,CACnBhB,EAAM,iBAAiB,OAAOgB,CAAO,CAAC,CACxC,EAEA,SAAA/C,EAACJ,EAAA,CAAQ,2DAET,EACF,EAEAI,EAACa,EAAA,CACC,MAAM,gBACN,MAAOkB,EAAM,aACb,QAASiB,EACT,OAAO,6BACP,SAAUC,GAAU,CAClBlB,EAAM,gBAAgBkB,CAAM,CAC9B,EAEA,SAAAjD,EAACJ,EAAA,CAAQ,6CAAiC,EAC5C,EAECmC,EAAM,eAAiB,SAAW,KACjC/B,EAACM,EAAA,CACC,MAAM,gBACN,QAASyB,EAAM,aACf,SAAUmB,GAAU,CAClBnB,EAAM,gBAAgBmB,CAAM,CAC9B,EAEA,SAAAlD,EAACJ,EAAA,CAAQ,2DAA+C,EAC1D,GAEJ,GACF,EAEAI,EAACmD,EAAA,CACC,SAAAnD,EAACoD,EAAA,CAAO,QAAQ,YAAY,MAAM,UAAU,QAASpB,EAAS,iBAE9D,EACF,GACF,CAEJ,CAAC,EAEMqB,GAAQvB",
6
6
  "names": ["LAYOUT_QUALITIES", "LabelledSelect_default", "observer", "label", "value", "options", "testId", "size", "sx", "disabled", "title", "shown", "onChange", "labelId", "useId", "jsxs", "FormControl", "jsx", "InputLabel", "Select", "picked", "o", "e", "MenuItem", "ListItemText", "useStyles", "makeStyles", "Caption", "observer", "warn", "children", "jsx", "Typography", "Group", "title", "classes", "jsxs", "SettingSwitch", "label", "checked", "onChange", "FormControlLabel", "Switch", "e", "SettingSelect", "props", "LabelledSelect_default", "NODE_LIMITS", "nodeLimitOptions", "current", "a", "b", "limit", "TrackPickSetting", "choices", "stored", "auto", "testId", "t", "trackId", "name", "GraphSettingsDialog", "model", "onClose", "Dialog", "DialogContent", "NODE_WIDTHS", "width", "EDGE_WIDTHS", "links", "draw", "MAX_PATH_COLORS", "pickGeneTrack", "pickRepeatTrack", "LAYOUT_ENGINES", "engine", "LAYOUT_QUALITIES", "q", "quality", "BUBBLE_SPREADS", "spread", "linear", "DialogActions", "Button", "GraphSettingsDialog_default"]
@@ -1,2 +1,2 @@
1
- import{a as B}from"./chunk-ZA5GPTUM.js";import{h as b,i as o,k as f,z as m}from"./chunk-VNWCN47G.js";import{h as u}from"./chunk-CL4PYWKC.js";var O={steps:"walkStepBudget",bytes:"walkByteBudget"},y=64,k=class{constructor(e,t){this.file=e;this.adapter=t;this.reader=new f(e)}async haplotypeNames(e={}){let{haplotypes:t}=await this.reader.header(e);return t.length>0?t:void 0}budgets(){return{stepBudget:this.adapter.getConf("walkStepBudget"),byteBudget:this.adapter.getConf("walkByteBudget"),budgetNames:O}}async subgraph(e,t,{signal:i,haplotypes:d,walkRows:s,expand:r,expandSamples:n}){let g=this.budgets(),p=o(d?.map(a=>u(this.adapter,a)),e),l=s&&p&&(d?.length??0)<=y?p:void 0,c=s&&n?.length&&n.length<=y?o(n.map(a=>u(this.adapter,a)),e):void 0,h=r?.length?a=>r.includes(a):void 0,{graph:w,kept:A,fragments:S,skips:x}=await this.reader.cut(e,t,{...g,stepBudget:s?1/0:g.stepBudget,signal:i,keep:p,...l||c||h?{expand:a=>!!l?.(a)||!!c?.(a)||!!h?.(a)}:{}});return B(w.tables(A,S,x),t,s)}async referenceNodes(e,t,i){let d=[];await m(this.file,e,await this.reader.queryStart(t.start,{...i,refName:e,end:t.end}),t.end,{signal:i.signal,lineCallback:r=>{let n=r.split(" ");n[3]==="ref"&&d.push(n)}});let s=new Set;return b(d).filter(r=>r.refName!==e||r.end<=t.start||r.start>=t.end||s.has(r.id)?!1:(s.add(r.id),!0))}};export{k as a};
2
- //# sourceMappingURL=chunk-HRTRECXN.js.map
1
+ import{a as B}from"./chunk-KACKTX2U.js";import{h as b,i as o,k as f,z as m}from"./chunk-YNMEZ4EZ.js";import{h as u}from"./chunk-2FG67WIZ.js";var O={steps:"walkStepBudget",bytes:"walkByteBudget"},y=64,k=class{constructor(e,t){this.file=e;this.adapter=t;this.reader=new f(e)}async haplotypeNames(e={}){let{haplotypes:t}=await this.reader.header(e);return t.length>0?t:void 0}budgets(){return{stepBudget:this.adapter.getConf("walkStepBudget"),byteBudget:this.adapter.getConf("walkByteBudget"),budgetNames:O}}async subgraph(e,t,{signal:i,haplotypes:d,walkRows:s,expand:r,expandSamples:n}){let g=this.budgets(),p=o(d?.map(a=>u(this.adapter,a)),e),l=s&&p&&(d?.length??0)<=y?p:void 0,c=s&&n?.length&&n.length<=y?o(n.map(a=>u(this.adapter,a)),e):void 0,h=r?.length?a=>r.includes(a):void 0,{graph:w,kept:A,fragments:S,skips:x}=await this.reader.cut(e,t,{...g,stepBudget:s?1/0:g.stepBudget,signal:i,keep:p,...l||c||h?{expand:a=>!!l?.(a)||!!c?.(a)||!!h?.(a)}:{}});return B(w.tables(A,S,x),t,s)}async referenceNodes(e,t,i){let d=[];await m(this.file,e,await this.reader.queryStart(t.start,{...i,refName:e,end:t.end}),t.end,{signal:i.signal,lineCallback:r=>{let n=r.split(" ");n[3]==="ref"&&d.push(n)}});let s=new Set;return b(d).filter(r=>r.refName!==e||r.end<=t.start||r.start>=t.end||s.has(r.id)?!1:(s.add(r.id),!0))}};export{k as a};
2
+ //# sourceMappingURL=chunk-HTH7NAV4.js.map
@@ -0,0 +1,2 @@
1
+ import{l as o}from"./chunk-5TT5TG4Q.js";function u(a,r,e){return e?{...a,walkRowRuns:o(a,r)}:a}export{u as a};
2
+ //# sourceMappingURL=chunk-KACKTX2U.js.map
@@ -1,2 +1,2 @@
1
- import{a as z,b as gt}from"./chunk-4XY7HUQR.js";import{B as wt,C as St,a as et,b as tt,c as J,d as nt,e as ot,f as Q,h as rt,i as at,j as it,k as st,l as lt,m as ct,o as ee,p as pt,q as te,r as ut,t as ue,u as dt,v as ft,w as vt,x as yt,z as bt}from"./chunk-DIGIM3XY.js";import{N as Ue,O as Je,R as pe,T as Qe,U as ht,V as mt,a as P,c as ze,f as q,g as We,h as Ne,q as Oe,r as Be,t as Ze,u as $e,v as je,w as Ke}from"./chunk-WE7XHNAH.js";import{p as _}from"./chunk-X2QGBINE.js";import{Aa as Ye,D as Ae,Jb as H,K as _e,Nb as le,O as De,P as Xe,Pb as ce,Rb as B,a as D,b as ye,fa as se,ja as U,lc as qe,na as Fe,pa as Ve,v as He}from"./chunk-WO644UAC.js";import{n as Te}from"./chunk-4DQWDJG7.js";import{e as G}from"./chunk-FLKXKTS2.js";import{j as $}from"./chunk-TC265JAP.js";import{a as Ee,e as T,f as Ie,g as Ge,h as k,i as C}from"./chunk-J2PN6CG3.js";import{D as Le,G as K,H as X,b as be,c as we,e as ie,k as Se,o as xe,p as Pe,s as Me,v as j,w as ke,y as Re,z as Ce}from"./chunk-WE7DQVXF.js";import{a as I,b as o,c as h,d}from"./chunk-DUU6T2I5.js";function xt(t){return Promise.resolve(new H(t))}var A=JBrowseExports["@jbrowse/render-core/useRenderingBackend"],hn=t=>A!=null&&t in Object(A)?A[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from '@jbrowse/render-core/useRenderingBackend' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var Pt=hn("useRenderingBackend"),bo=A&&A.__esModule?A.default:A;var de=tt(1),Mt=d(function({model:e}){let[n,i]=C(null);return T(()=>{if(!n)return;let r=new H(n),c=D(()=>{Ye(qe()),r.resize(e.paneWidth,e.canvasHeight),e.paintHover(r,e.drawnBatch)});return()=>{c(),r.dispose()}},[n,e]),o("canvas",{ref:i,"data-testid":"graph-hover-layer",style:de})});var ne=d(function({row:e,at:n,hint:i,after:r,column:c}){let l=c===void 0?void 0:{paddingLeft:c+5};return e.swatch?h("div",{title:[e.title,i].filter(Boolean).join(" \xB7 ")||void 0,children:[h("div",{style:te,children:[o("span",{style:{display:"flex",flex:"none",justifyContent:"center",width:c},children:o(ee,{swatch:e.swatch})}),h("span",{children:[e.strong?o("strong",{children:e.strong}):null,e.label]}),r]}),n?o("div",{style:l,"data-testid":"graph-walk-at",children:n}):e.under?o("div",{style:l,children:e.under}):null]}):o("div",{style:ut,children:e.label})}),mn={pointerEvents:"auto",cursor:"pointer",border:"none",background:"none",padding:"0 2px",font:"inherit",textDecoration:"underline"},kt=d(function({model:e}){let n=ct(e);if(n.length===0)return null;let i=n.flatMap(l=>l.rows),r=at(i),c=rt(i);return o("div",{style:{...pt,lineHeight:`${r}px`},children:n.map(({testid:l,rows:p,heading:s,spaced:u},m)=>h(Ee,{children:[s?o("div",{style:{...dt,paddingTop:m===0?0:ue},children:s}):null,o("div",{"data-testid":l,style:u?{paddingTop:ue}:void 0,children:p.map(w=>o(ne,{row:w,column:c,at:w.walk?e.hoveredOn(w.walk):void 0,after:w.closesBubble?o("button",{type:"button",style:mn,"data-testid":"graph-close-bubble",onClick:()=>{e.closeBubbles()},children:"close"}):null},w.key))})]},l))})});var gn={position:"absolute",left:0,top:0,zIndex:4,display:"grid",gap:De,lineHeight:"normal"},vn={height:Xe,padding:"2px 6px",boxSizing:"border-box",fontFamily:"inherit",fontSize:11,color:"inherit",cursor:"pointer",border:"none",background:"none",textAlign:"left",display:"block"},yn={position:"relative"},bn={gridColumn:"1 / -1",height:Je,padding:"2px 6px",boxSizing:"border-box",display:"flex",gap:14,fontSize:11,lineHeight:"15px"},wn=d(function({model:e,lift:n,width:i,height:r,cell:c,handlers:l,canvasStyle:p}){let[s,u]=C(null),[m,w]=C(null),x=n.walks[0];T(()=>{if(!s||!m)return;let E=new H(s),N=new H(m),O=ye(()=>e.buildDrawing(n,!1)),V,Y=[D(()=>{let R=e.facetGrid;R&&E.resize(R.width,R.height);let L=O.get();L&&(L!==V&&(E.uploadGeometry(L.batch),V=L),e.applySelection(E),e.paint(E))}),D(()=>{let R=e.facetGrid;R&&N.resize(R.width,R.height);let L=O.get();L&&e.paintHover(N,L.batch)})];return()=>{for(let R of Y)R();E.dispose(),N.dispose()}},[s,m,e,n]);let W=e.walkLabel(x.name);return h("div",{style:c,children:[o("button",{type:"button",style:vn,"data-testid":"graph-facet-title",onClick:()=>{e.liftWalks([x.name]),e.setFacet("")},children:o(ne,{row:st(e,x),hint:`click to lift ${W} alone`,at:e.hoveredOn(x)})}),h("div",{style:yn,children:[o("canvas",{ref:u,"data-testid":"graph-facet-canvas",style:{...p,width:i,height:r,display:"block"},...l}),o("canvas",{ref:w,style:de})]})]})}),Sn=d(function({model:e,handlers:n,canvasStyle:i}){let r=e.facetPanels,c=e.facetGrid,l=e.facetPlacement;if(!r||!c||!l)return null;let{columns:p,width:s,height:u}=c;return h("div",{"data-testid":"graph-facet-panels",style:{...gn,width:e.paneWidth,minHeight:e.canvasHeight,gridTemplateColumns:`repeat(${p}, ${s}px)`,background:U},children:[r.map((m,w)=>o(wn,{model:e,lift:m,width:s,height:u,cell:{gridRow:Math.floor(l.cells[w]/p)+1,gridColumn:l.cells[w]%p+1},handlers:n,canvasStyle:i},m.walks[0].name)),o("div",{style:{...bn,gridRow:Math.floor(l.cells.reduce((m,w)=>Math.max(m,w),-1/0)/p)+2},"data-testid":"graph-facet-key",children:lt(e).map(m=>o(ne,{row:m},m.key))})]})}),Rt=Sn;var Ct=P(o("path",{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2m2 10H3v4c0 1.1.9 2 2 2h4v-2H5zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2"}),"CropFree");var Lt=P([o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"},"0"),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z"},"1")],"ZoomIn");var Et=P(o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14M7 9h5v1H7z"}),"ZoomOut");var xn=d(function({model:e}){let n=e.colorSchemeLock;return o(z,{label:"Color",size:"small",sx:{minWidth:100},disabled:n!==void 0,title:n?.why,shown:n?.value,value:e.chosenColorScheme,options:Oe.map(({value:i})=>({value:i,label:e.colorSchemeLabel(i)})),testId:"graph-color-select",onChange:i=>{e.setColorScheme(i)}})}),It=xn;var Gt=_()({stats:{marginLeft:"auto"},perf:{color:"#888",fontVariantNumeric:"tabular-nums"}});function fe(t){return t===void 0?"\u2013":`${Math.round(t)}ms`}var Pn=d(function({model:e}){let{classes:n}=Gt(),{lastFetchMs:i,lastLayoutMs:r,lastGeometryMs:c}=e,l=i!==void 0||r!==void 0||c!==void 0;return e.showPerf&&l?h(X,{variant:"caption",className:n.perf,"data-testid":"graph-perf-stats",children:["fetch ",fe(i)," \xB7 layout ",fe(r)," \xB7 geom"," ",fe(c)]}):null}),Mn=d(function({model:e}){let{classes:n}=Gt();return h("div",{className:n.stats,"data-testid":"graph-stats","data-node-count":e.nodeCount,"data-edge-count":e.edgeCount,"data-path-count":e.pathCount,"data-fetch-ms":e.lastFetchMs??"","data-layout-ms":e.lastLayoutMs??"","data-geometry-ms":e.lastGeometryMs??"","data-geometry-strokes":e.lastGeometryStrokeCount??"",children:[h(X,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",o(Pn,{model:e})]})}),Tt=Mn;var kn=d(function({model:e}){let{graph:n}=e;return o(z,{label:"Layout",size:"small",sx:{minWidth:140},testId:"graph-layout-select",value:e.chosenLayoutMode,options:ze.map(({value:i,label:r,description:c,available:l})=>({value:i,label:r,description:c,disabled:n?!l(n):!1})),onChange:i=>{e.switchLayout(i)}})}),Ht=kn;var Rn=d(function({model:e}){return e.chosenLayoutMode!=="walkrows"||e.repeatChoices.length===0?null:o(z,{label:"Repeat",size:"small",sx:{minWidth:130,maxWidth:260},testId:"graph-repeat-select",value:e.selectedRepeat?.key??"",options:e.repeatOptions,onChange:n=>{e.setRepeatKey(n)}})}),At=Rn;var _t=P(o("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var zt=P(o("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var Cn=d(function({model:e}){let n=e.highlightMenuItems({picks:!1});return o(be,{size:"small",tooltip:"Graph options",menuItems:[...n.length>0?[{label:"Haplotypes",icon:ht,subMenu:n}]:[],...e.layoutOptionMenuItems({repeat:!1}),{label:"Show",icon:Be,subMenu:[...e.showMenuItems(),...e.modeDrawsNodes&&e.walkChoices.length>1?[{type:"checkbox",label:"Show walk rows under the graph",checked:e.walkStrip,onClick:()=>{e.setWalkStrip(!e.walkStrip)}}]:[],{type:"checkbox",label:"Show timings",checked:e.showPerf,onClick:()=>{e.setShowPerf(!e.showPerf)}}]},{type:"divider"},{label:"Graph settings...",icon:mt,helpText:"Subgraph node limit; node width and path colors; the force-directed layout engine",onClick:()=>{$(e).queueDialog(i=>[gt,{model:e,onClose:i}])}},{type:"divider"},{label:"Close graph",icon:_t,onClick:()=>{e.clearGraph()}}],children:o(zt,{})})}),Wt=Cn;var Ln=_()({formControl:{minWidth:130,maxWidth:260}}),En=d(function({model:e}){let{classes:n}=Ln(),i=Ie(),{walkChoices:r}=e;if(r.length===0||!e.liftsWalks)return null;let c=new Set(r.map(s=>s.name)),l=new Map(r.map(s=>[s.name,s.label])),p=e.walkLayers.map(s=>s.walk).filter(s=>c.has(s));return r.length>Ve?o(xe,{size:"small",variant:"outlined",color:"inherit","data-testid":"graph-walk-choose",onClick:()=>{$(e).queueDialog(s=>[Fe,{model:e,onClose:s}])},children:p.length>0?`${p.length} of ${r.length} haplotypes`:"Highlight haplotypes..."}):h(Me,{size:"small",className:n.formControl,children:[o(ke,{id:i,children:"Highlight"}),o(Le,{labelId:i,multiple:!0,value:p,label:"Highlight","data-testid":"graph-walk-select",renderValue:s=>s.map(u=>l.get(u)).join(", "),onChange:s=>{let{value:u}=s.target;e.liftAmongChoices(typeof u=="string"?u.split(","):u)},children:r.map(({name:s,label:u})=>h(Ce,{value:s,dense:!0,children:[o(Pe,{size:"small",checked:p.includes(s)}),o(Re,{primary:u})]},s))})]})}),Nt=En;var In=_()({toolbar:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #ddd"}}),Gn=d(function({model:e}){return o(X,{variant:"body2",children:e.zoomPercent})}),Tn=d(function({model:e}){let{classes:n}=In(),i=r=>{e.zoom(r,e.viewBox.width/2,e.viewBox.height/2)};return h("div",{className:n.toolbar,children:[o(Ht,{model:e}),o(It,{model:e}),o(Nt,{model:e}),o(At,{model:e}),o(K,{title:"Zoom in",children:o(j,{size:"small",onClick:()=>{i(1.5)},children:o(Lt,{})})}),o(K,{title:"Zoom out",children:o(j,{size:"small",onClick:()=>{i(1/1.5)},children:o(Et,{})})}),o(K,{title:"Zoom to fit",children:o(j,{size:"small",onClick:()=>{e.refitView()},children:o(Ct,{})})}),o(Gn,{model:e}),o(Tt,{model:e}),o(Wt,{model:e})]})}),Ot=Tn;var Hn={position:"absolute",bottom:Ue,lineHeight:"normal",background:"rgba(0,0,0,0.75)",color:"white",padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",zIndex:6};function he({label:t,readout:e}){return h(I,{children:[o("strong",{children:t})," \u2014 ",e]})}function An(t,e){if(e)return{testId:"graph-chip-tooltip",body:he(e)};let n=t.hoveredNode?t.hoverNodeById?.get(t.hoveredNode):void 0;if(n){let l=t.hoverDrawing?.members.get(n.id),p=Ne(n);return{body:h(I,{children:[o("strong",{children:n.name}),l?` and ${l.length-1} more`:""," \u2014"," ",n.length.toLocaleString()," bp, depth ",n.depth.toFixed(1),p?h(I,{children:[o("br",{}),p.sample," ",q(p)," (rank ",n.stable?.rank,")"]}):null,n.moved?h(I,{children:[o("br",{}),"End of a component too large to draw here"]}):null]})}}let i=t.hoveredEdge===null?void 0:t.graph?.edges[t.hoveredEdge];if(i){let l=We(i,t.deletions.find(p=>p.edgeIndex===t.hoveredEdge),p=>t.nodeById?.get(p)?.name??p);return{body:l.deletion?h(I,{children:[o("strong",{children:"Deletion"})," ",l.deletion.bp,o("br",{}),l.deletion.where]}):h(I,{children:["Edge: ",l.ends]})}}let r=t.hoveredWalkRowText;if(r)return{testId:"graph-walk-row-tooltip",body:he(r)};let c=t.hoveredTubeText;return c?{testId:"graph-tube-tooltip",body:he(c)}:void 0}var _n=d(function({model:e,chip:n}){let i=An(e,n);return i?o("div",{style:{...Hn,right:e.tooltipRightPx},"data-testid":i.testId,children:i.body}):null}),Dt=_n;var Xt=P(o("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var Bt=P(o("path",{d:"M10.83 8H21V6H8.83zm5 5H18v-2h-4.17zM14 16.83V18h-4v-2h3.17l-3-3H6v-2h2.17l-3-3H3V6h.17L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41z"}),"FilterListOff");var Ft=P(o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var zn={x:0,y:0};function Wn(t,e){let{own:n,reference:i,highlight:r}=t.nodeLaunchTargets(e);return[{label:"Node details",icon:Ft,onClick:()=>{t.showNodeDetails(e)}},...Qe({own:n,reference:i,highlight:r,onShowLinear:c=>{t.showInLinearView(c)},onHighlight:t.canHighlightInLinearView?c=>{t.highlightInLinearView(c)}:void 0})]}function Nn(t){return t>=1e3?`${Math.round(t/1e3)} k`:`${t}`}function On(t,e,n){let i=n??t.walkRowBars,r=t.walkRowLaunchTarget(e,i),c=r?.assembly,l=e>0?i?.rows[e-1]:void 0,p=l?.sample,s=!n&&t.walkRowBars,u=t.walkRowSamples;return[r&&c?{label:`Linear genome view \u2014 ${c} ${q(r.location)}`,icon:pe,onClick:()=>{t.showInLinearView({location:r.location,assembly:c})}}:{label:"Linear genome view",icon:pe,disabled:!0,disabledHelpText:r?`No assembly in this session is ${r.location.haplotype??r.label}`:"This walk states no contig coordinates",onClick:()=>{}},...l?.abridgedSteps?[{label:`Load the ${Nn(l.abridgedSteps)} abridged steps`,onClick:()=>{t.expandWalk(l.name)}}]:[],...l&&t.liftsWalks&&t.modeDrawsNodes?[{type:"checkbox",label:`Highlight ${l.label}`,checked:t.walkLayers.some(m=>m.walk===l.name),onClick:()=>{t.toggleWalk(l.name)}}]:[],...s&&p&&!(u?.length===1&&u[0]===p)?[{label:`Show only ${p}`,icon:Xt,onClick:()=>{t.setWalkRowSamples([p])}}]:[],...s&&u?[{label:"Show every sample",icon:Bt,onClick:()=>{t.setWalkRowSamples(void 0)}}]:[]]}var oe=d(function({model:e,at:n,onClose:i}){return o(we,{anchor:n,offset:zn,onClose:i,menuItems:()=>n===void 0?[]:"nodeId"in n?Wn(e,n.nodeId):On(e,n.row,n.bars)})});var Dn={display:"flex",flexWrap:"wrap",gap:"2px 14px",padding:"2px 8px 6px",fontSize:11,color:"#333"},Xn={position:"absolute",pointerEvents:"none",background:"rgba(255,255,255,0.92)",border:"1px solid #ccc",borderRadius:3,padding:"1px 6px",fontSize:11,whiteSpace:"nowrap",zIndex:4},Bn=d(function({bars:e,frame:n,ramp:i,rowGenes:r}){let c=ot(),l=Ge(()=>_e(e,n,{ramp:i,rowGenes:r,idPrefix:c}),[e,n,i,r,c]);return o(Q,{el:l})}),Fn=d(function({model:e}){let n=e.walkStripRows,i=e.walkStripFrame,r=e.stripHover,c=n?[n.reference,...n.rows]:[],l=r?c.findIndex(m=>m.name===r.row):-1,p=c[l];if(!n||!i||i.labelled||!r||!p)return null;let s=(n.origin+r.offset)*i.scaleX+i.translateX,u=s>i.width/2?{right:i.width-s+12}:{left:s+12};return h("div",{"data-testid":"graph-walk-strip-tip",style:{...Xn,...u,top:l*i.rowPx+i.translateY-18},children:[p.label," \xB7"," ",He(p,l===0?void 0:n.reference)]})}),Vn=d(function({model:e,bars:n,frame:i}){return o(Q,{el:$e(n,i,e.walkStripMarks)})}),Yn=d(function({model:e}){let n=e.walkStripRows,i=e.walkStripFrame,[r,c]=C();if(!n||!i)return null;let l=s=>{let u=s.currentTarget.getBoundingClientRect();return Ze(n,i,s.clientX-u.left,s.clientY-u.top)},p=Ae(n,{ramp:e.referenceRampDomain,rampCss:Te,genes:Ke(i,e.walkRowGenes,e.walkRowGeneGaps),annotation:e.walkRowAnnotation});return h("div",{"data-testid":"graph-walk-strip",style:{position:"relative",borderTop:"1px solid #ddd"},onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{G(e)&&(e.setPointerInPane(!1),e.setStripHover(null))},children:[h("svg",{width:i.width,height:i.height,style:{display:"block"},onMouseMove:s=>{let u=l(s);s.currentTarget.style.cursor=u&&u.index>0?"pointer":"",e.setStripHover(u?{row:u.row.name,offset:u.offset}:null)},onClick:s=>{let u=l(s);u&&u.index>0&&e.toggleWalk(u.row.name)},onContextMenu:s=>{let u=l(s);u&&(s.preventDefault(),c({clientX:s.clientX,clientY:s.clientY,row:u.index}))},children:[o(Bn,{bars:n,frame:i,ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes}),o(Vn,{model:e,bars:n,frame:i}),o(Q,{el:je(n,i,new Set(e.walkLayers.map(s=>s.walk)))})]}),o(Fn,{model:e}),h("div",{style:Dn,"data-testid":"graph-walk-strip-key",children:[p.map(s=>h("div",{style:te,children:[o(ee,{swatch:it(s.swatch)}),o("span",{children:s.label})]},s.label)),o("span",{style:{color:"#777"},children:"Ticks mark where each walk passes the node under the pointer; click a haplotype's bar to lift its walk"})]}),o(oe,{model:e,at:r&&{...r,bars:n},onClose:()=>{c(void 0)}})]})}),Vt=Yn;var Zn=d(function({model:e}){let n=e.walkStripLocator;return n?h(J,{model:e,zIndex:4,overflow:"visible",testId:"graph-walk-strip-locator",children:[o("circle",{cx:n.x,cy:n.y,r:11,fill:"none",stroke:"white",strokeWidth:4}),o("circle",{cx:n.x,cy:n.y,r:11,fill:"none",stroke:"#111",strokeWidth:1.75})]}):null}),Yt=Zn;var $n=1.1,jn=100,Kn=40,qn=800,Un=10,Zt=2;function me(t){let e=t.deltaY*(t.deltaMode===1?Kn:t.deltaMode===2?qn:1),n=(t.ctrlKey?Un:1)*e/jn;return $n**-Math.max(-Zt,Math.min(Zt,n))}var Jn=40,Qn=100,eo=24,$t=Math.log(16);function to(t,e){let n=t*Math.exp(-Math.max(0,e)/eo);return Math.abs(n)<.001?t:t-n}function no(t,e){let n=Math.abs(t.deltaX)>Math.abs(t.deltaY);return t.ctrlKey||t.metaKey||!n&&(!e||e.scrollZoom)?"zoom":n?"pan":"page"}function qt(t,e,n){T(()=>{if(!t)return;let i=-1/0,r={backlog:0,x:0,y:0,frame:0,last:0},c=p=>{let s=to(r.backlog,Math.min(100,p-r.last));r.backlog-=s,r.last=p,r.frame=r.backlog?requestAnimationFrame(c):0,G(n)&&n.zoom(Math.exp(s),r.x,r.y)},l=p=>{if(n.hostPlacesX||n.followsHostView)return;let m=((p.target instanceof Element?p.target.closest("canvas"):null)??(n.facetPanels?null:e))?.getBoundingClientRect();if(m&&p.clientY-m.top<n.referenceStripZonePx)return;let w=no(p,n.host);if(w!=="page"){if(n.host&&p.stopPropagation(),p.preventDefault(),w==="pan"){if(p.timeStamp-i>Qn){let x=p.deltaMode===1?Jn:1;n.setTransform(n.scale,n.translateX-p.deltaX*x,n.translateY)}return}i=p.timeStamp,m&&(r.x=p.clientX-m.left,r.y=p.clientY-m.top,r.backlog=Math.max(-$t,Math.min($t,r.backlog+Math.log(me(p)))),r.frame||(r.last=performance.now()-1e3/60,r.frame=requestAnimationFrame(c)))}};return t.addEventListener("wheel",l,{passive:!1}),()=>{cancelAnimationFrame(r.frame),t.removeEventListener("wheel",l)}},[t,e,n])}var jt=3,ge="data-gesture-owner",F=t=>({x:t.clientX,y:t.clientY});function Kt(t){let[e,n]=[...t.values()];return{spread:Math.hypot(e.x-n.x,e.y-n.y),mid:{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}}function Ut(t){let e=k({x:0,y:0}),n=k({x:0,y:0}),i=k(!1),r=k(void 0),c=a=>r.current!==void 0&&a.pointerId!==r.current,l=k(new Map),p=k(null),s=k(null),u=k(!1),m=k(null),w=k(!1),x=k({frame:0,pan:null,hover:null,pinch:!1});T(()=>()=>{cancelAnimationFrame(x.current.frame)},[]);let[W,E]=C(),[N,O]=C(!1),[V,Y]=C(void 0);function R(a){let f=a.currentTarget.getBoundingClientRect();return{x:a.clientX-f.left,y:a.clientY-f.top}}function L(a,f){if(t.layoutResult?.tubeMap)return t.tubeMapNodeAt(a,f);let g=t.referenceStripNodeAt(a,f);if(g)return g;let{nodePositions:v}=t;if(!v)return null;let{x:y,y:b}=se(a,f,t,t.axisScale);return le(v,y,b,t.axisScale,t.positionsVersion,t.nodeInk)}function en(a,f){let{nodePositions:g,graph:v}=t;if(!g||!v)return null;let{x:y,y:b}=se(a,f,t,t.axisScale);return ce(g,v,y,b,t.axisScale,t.effectiveDrawPaths&&!t.facetPanels,t.positionsVersion,t.deletionEdgeIndexes,t.hiddenEdgeIndexes,t.deletionRoutes,t.layoutResult?.stranded)}function tn(a){a.button===0&&a.preventDefault()}function nn(a){if(a.button!==0)return;let f=l.current;if(c(a)){t.isPanning&&!w.current&&a.pointerType==="touch"&&f.size===1&&(a.currentTarget.setPointerCapture(a.pointerId),f.set(a.pointerId,F(a)),s.current=Kt(f),i.current=!0);return}i.current=!1,n.current={x:a.clientX,y:a.clientY},a.currentTarget.removeAttribute(ge);let g=t.followsHostView;if(t.hostPlacesX||g&&a.shiftKey)return;a.currentTarget.setPointerCapture(a.pointerId),r.current=a.pointerId,p.current=a.currentTarget,f.clear(),f.set(a.pointerId,F(a));let{x:v,y}=R(a),b=y<t.referenceStripZonePx,M=t.layoutResult?.tubeMap||b?null:L(v,y);g&&M&&a.currentTarget.setAttribute(ge,""),w.current=g,u.current=b&&!g,M?t.setDraggingNode(M):t.setPanning(!0),e.current={x:a.clientX,y:a.clientY}}function ve(){let a=s.current,f=p.current;if(!a||!f)return;let g=Kt(l.current),v=f.getBoundingClientRect();a.spread>0&&g.spread>0&&t.zoom(g.spread/a.spread,a.mid.x-v.left,a.mid.y-v.top),t.setTransform(t.scale,t.translateX+g.mid.x-a.mid.x,t.translateY+g.mid.y-a.mid.y),s.current=g}function on(){let a=x.current,{pan:f,hover:g,pinch:v}=a;if(a.frame=0,a.pan=null,a.hover=null,a.pinch=!1,v&&ve(),f&&u.current?t.host?.horizontalScroll(-f.dx):f&&w.current?t.setTransform(t.scale,t.translateX,t.translateY+f.dy):f&&t.setTransform(t.scale,t.translateX+f.dx,t.translateY+f.dy),!g)return;let{x:y,y:b}=g,M=t.facetPanels?void 0:vt(t.overlayLabels,y,b);if(Y(S=>S?.label===M?.label&&S?.readout===M?.readout?S:M),t.walkRowBars){let S=t.walkRowAt(y,b);t.setHoveredWalkRow(S===void 0?null:t.walkRowList[S].name)}if(t.nodePositions&&t.graph){let S=L(y,b);t.setHoveredPanel(t.tubeMapPanelAt(b)),t.setHoveredNode(S,{x:y,y:b}),O(S!==null&&!t.hostPlacesX&&!t.layoutResult?.tubeMap&&b>=t.referenceStripZonePx),t.setHoveredTube(S===null&&t.layoutResult?.tubeMap?t.tubeAt(y,b):null),t.setHoveredEdge(S||t.layoutResult?.tubeMap||!t.hoverLightsEverything?null:en(y,b))}}function Z(){x.current.frame||(x.current.frame=requestAnimationFrame(on))}function rn(){let a=x.current;cancelAnimationFrame(a.frame),a.frame=0,a.pan=null,a.hover=null,a.pinch=!1}function an(a){let f=l.current;if(s.current&&f.has(a.pointerId)){f.set(a.pointerId,F(a)),x.current.pinch=!0,Z();return}if(c(a)||m.current)return;let g=a.clientX-e.current.x,v=a.clientY-e.current.y;e.current={x:a.clientX,y:a.clientY},Math.hypot(a.clientX-n.current.x,a.clientY-n.current.y)>jt&&(i.current=!0);let y=x.current;if(t.draggingNode)t.moveNode(t.draggingNode,g/t.scaleX,v/t.scaleY);else if(t.isPanning)y.pan={dx:(y.pan?.dx??0)+g,dy:(y.pan?.dy??0)+v},Z();else{let b=a.currentTarget.getBoundingClientRect();y.hover={x:a.clientX-b.left,y:a.clientY-b.top},Z()}}function re(a){let f=l.current;if(s.current&&f.has(a.pointerId)){x.current.pinch&&(x.current.pinch=!1,ve()),f.delete(a.pointerId),s.current=null;let[[g,v]]=[...f];r.current=g,e.current=v;return}c(a)||(r.current=void 0,f.clear(),G(t)&&t.stopDragging())}function sn(a){c(a)||(r.current=void 0,l.current.clear(),s.current=null,rn(),Y(void 0),O(!1),G(t)&&(t.stopDragging(),t.clearHover()))}function ln(a){let{x:f,y:g}=R(a),v=L(f,g),{clientX:y,clientY:b}=a;if(v){a.preventDefault(),E({clientX:y,clientY:b,nodeId:v});return}let M=t.walkRowAt(f,g);M!==void 0&&(a.preventDefault(),E({clientX:y,clientY:b,row:M}))}function cn(a){if(!i.current){let{x:f,y:g}=R(a),v=L(f,g);t.setSelectedNode(v),v&&t.showNodeDetails(v)}}T(()=>()=>{m.current?.end()},[]);function pn(a){if(a.button!==0||t.hostPlacesX||t.followsHostView||!(a.target instanceof Element)||!a.target.closest(`[${et}]`))return;m.current?.end(),u.current=!1,w.current=!1;let f=a.pointerId,g=F(a),v=g,y={moved:!1,end:()=>{window.removeEventListener("pointermove",b,!0),window.removeEventListener("pointerup",M,!0),window.removeEventListener("pointercancel",M,!0),y.moved&&G(t)&&t.stopDragging()}};function b(S){if(S.pointerId!==f)return;if(!y.moved){if(Math.hypot(S.clientX-g.x,S.clientY-g.y)<=jt)return;y.moved=!0,t.setPanning(!0)}let ae=x.current;ae.pan={dx:(ae.pan?.dx??0)+S.clientX-v.x,dy:(ae.pan?.dy??0)+S.clientY-v.y},v=F(S),Z()}function M(S){S.pointerId===f&&(y.end(),setTimeout(()=>{m.current===y&&(m.current=null)},0))}m.current=y,window.addEventListener("pointermove",b,!0),window.addEventListener("pointerup",M,!0),window.addEventListener("pointercancel",M,!0)}function un(a){m.current?.moved&&(m.current=null,a.stopPropagation())}let dn={cursor:t.isPanning||t.draggingNode?"grabbing":N?"move":"grab",touchAction:t.hostPlacesX?"auto":"none",overscrollBehavior:"contain"},fn=t.host!==void 0&&!t.hostPlacesX&&!t.followsHostView?{[ge]:"",onMouseDown:a=>{a.stopPropagation()}}:{};return{canvasStyle:dn,surfaceProps:fn,handlers:{onMouseDown:tn,onPointerDown:nn,onPointerMove:an,onPointerUp:re,onPointerCancel:re,onLostPointerCapture:re,onPointerLeave:sn,onClick:cn,onContextMenu:ln},contextMenu:W,hoveredChip:V,labelHandlers:{onPointerDown:pn,onClickCapture:un},closeContextMenu:()=>{E(void 0)}}}var oo={position:"relative"},ro={position:"relative",lineHeight:0,isolation:"isolate"},ao={position:"absolute",left:0,right:0,bottom:0,zIndex:0},io={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},so={position:"absolute",left:6,transform:"translateY(-50%)",background:"rgba(255,255,255,0.82)",padding:"0 4px",borderRadius:3,fontSize:11,lineHeight:"16px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:4},lo=d(function({model:e}){return o(I,{children:e.visibleRowLabels.map(({label:n,y:i,top:r})=>o("div",{"data-testid":"graph-row-label",style:{...so,top:r},children:n},i))})}),co={position:"absolute",top:B,right:B,display:"flex",flexDirection:"column",borderRadius:3,overflowX:"hidden",overflowY:"auto",zIndex:4},Jt={position:"absolute",transform:"translate(-50%, -50%)",background:"rgba(255,255,255,0.78)",padding:"0 3px",borderRadius:3,fontSize:10,lineHeight:"13px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:3},po={...Jt,color:"#18181c",fontWeight:600},uo=d(function({model:e}){let n=k(null),i=e.legendAtRest;return T(()=>{let r=n.current;if(!r||!i)return;let c=()=>{G(e)&&e.legendAtRest&&e.setLegendSize({width:r.offsetWidth,height:r.scrollHeight})};c();let l=new ResizeObserver(c);return l.observe(r),r.firstElementChild&&l.observe(r.firstElementChild),()=>{l.disconnect()}},[e,i]),o("div",{ref:n,style:{...co,top:B+e.referenceStripZonePx,maxHeight:e.canvasHeight-2*B-e.referenceStripZonePx},children:o(kt,{model:e})})}),fo=d(function({model:e}){let n=e.overlayLabels.sizes,i=n.flatMap(({key:r,leader:c})=>c?[{key:r,...c}]:[]);return h(I,{children:[i.length>0?o(J,{model:e,zIndex:2,overflow:"visible",children:i.map(({key:r,arcX:c,arcY:l,labelX:p,labelY:s})=>o("line",{"data-testid":"graph-label-leader",x1:c,y1:l,x2:p,y2:s,stroke:"#18181c",strokeWidth:1},r))}):null,n.map(({key:r,text:c,x:l,y:p,kind:s})=>o("div",{"data-testid":"graph-size-label",style:{...s==="deletion"?po:Jt,left:l,top:p},children:c},r))]})}),Qt=d(function({model:e,handle:{canvasRef:n,canvas:i},ownChrome:r}){let{handlers:c,canvasStyle:l,surfaceProps:p,labelHandlers:s,contextMenu:u,closeContextMenu:m,hoveredChip:w}=Ut(e),[x,W]=C(null);qt(x,i,e);let E=e.facetPanels!==void 0;return h("div",{style:oo,...p,children:[r?o(Ot,{model:e}):null,h("div",{ref:W,style:ro,...s,onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{G(e)&&e.setPointerInPane(!1)},children:[e.referenceStripShown?o("div",{style:{...ao,top:e.referenceStripZonePx,background:U}}):null,o("canvas",{ref:n,"data-testid":"graph-genome-canvas",style:{...l,width:e.paneWidth,height:e.canvasHeight,display:"block",position:"relative",zIndex:1},...c}),E?o(Rt,{model:e,handlers:c,canvasStyle:l}):h(I,{children:[o(wt,{model:e}),o(Mt,{model:e}),o(bt,{model:e}),o(lo,{model:e}),o(fo,{model:e}),o(nt,{model:e}),o(ft,{model:e}),o(yt,{model:e}),o(St,{model:e}),o(Yt,{model:e}),o(uo,{model:e})]}),r?o("div",{style:io,children:o(Se,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null,o(Dt,{model:e,chip:w})]}),e.walkStripShown?o(Vt,{model:e}):null,o(oe,{model:e,at:u,onClose:m}),r?.renderError?o(ie,{error:r.renderError,onReset:r.retryRender}):null,r&&e.error?o(ie,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),ho=d(function({model:e}){let{canvasRef:n,canvas:i,error:r,retry:c}=Pt(xt,e);return o(Qt,{model:e,handle:{canvasRef:n,canvas:i},ownChrome:{renderError:r,retryRender:c}})}),mo=d(function({model:e,handle:n}){return n?o(Qt,{model:e,handle:n}):o(ho,{model:e})}),Ki=mo;export{xt as a,Ki as b};
2
- //# sourceMappingURL=chunk-Y7MQVQAS.js.map
1
+ import{a as z,b as gt}from"./chunk-HC2YPYTO.js";import{B as wt,C as St,a as et,b as tt,c as J,d as nt,e as ot,f as Q,h as rt,i as at,j as it,k as st,l as lt,m as ct,o as ee,p as pt,q as te,r as ut,t as ue,u as dt,v as ft,w as vt,x as yt,z as bt}from"./chunk-DQC5K7EW.js";import{N as Ue,O as Je,R as pe,T as Qe,U as ht,V as mt,a as P,c as ze,f as q,g as We,h as Ne,q as Oe,r as Be,t as Ze,u as $e,v as je,w as Ke}from"./chunk-7BKSSU2R.js";import{p as _}from"./chunk-64OSFJLE.js";import{Aa as Ye,D as Ae,Jb as H,K as _e,Nb as le,O as De,P as Xe,Pb as ce,Rb as B,a as D,b as ye,fa as se,ja as U,lc as qe,na as Fe,pa as Ve,v as He}from"./chunk-W4Y2JUP7.js";import{n as Te}from"./chunk-T3FHGWNW.js";import{e as G}from"./chunk-FLKXKTS2.js";import{j as $}from"./chunk-TC265JAP.js";import{a as Ee,e as T,f as Ie,g as Ge,h as k,i as C}from"./chunk-J2PN6CG3.js";import{D as Le,G as K,H as X,b as be,c as we,e as ie,k as Se,o as xe,p as Pe,s as Me,v as j,w as ke,y as Re,z as Ce}from"./chunk-WE7DQVXF.js";import{a as I,b as o,c as h,d}from"./chunk-DUU6T2I5.js";function xt(t){return Promise.resolve(new H(t))}var A=JBrowseExports["@jbrowse/render-core/useRenderingBackend"],hn=t=>A!=null&&t in Object(A)?A[t]:Object.assign(function(){throw new Error("This JBrowse does not provide '"+t+"' from '@jbrowse/render-core/useRenderingBackend' to plugins: GraphGenomeView was built for a different JBrowse version, so update the plugin or JBrowse")},{jbrowseHostMissing:t});var Pt=hn("useRenderingBackend"),bo=A&&A.__esModule?A.default:A;var de=tt(1),Mt=d(function({model:e}){let[n,i]=C(null);return T(()=>{if(!n)return;let r=new H(n),c=D(()=>{Ye(qe()),r.resize(e.paneWidth,e.canvasHeight),e.paintHover(r,e.drawnBatch)});return()=>{c(),r.dispose()}},[n,e]),o("canvas",{ref:i,"data-testid":"graph-hover-layer",style:de})});var ne=d(function({row:e,at:n,hint:i,after:r,column:c}){let l=c===void 0?void 0:{paddingLeft:c+5};return e.swatch?h("div",{title:[e.title,i].filter(Boolean).join(" \xB7 ")||void 0,children:[h("div",{style:te,children:[o("span",{style:{display:"flex",flex:"none",justifyContent:"center",width:c},children:o(ee,{swatch:e.swatch})}),h("span",{children:[e.strong?o("strong",{children:e.strong}):null,e.label]}),r]}),n?o("div",{style:l,"data-testid":"graph-walk-at",children:n}):e.under?o("div",{style:l,children:e.under}):null]}):o("div",{style:ut,children:e.label})}),mn={pointerEvents:"auto",cursor:"pointer",border:"none",background:"none",padding:"0 2px",font:"inherit",textDecoration:"underline"},kt=d(function({model:e}){let n=ct(e);if(n.length===0)return null;let i=n.flatMap(l=>l.rows),r=at(i),c=rt(i);return o("div",{style:{...pt,lineHeight:`${r}px`},children:n.map(({testid:l,rows:p,heading:s,spaced:u},m)=>h(Ee,{children:[s?o("div",{style:{...dt,paddingTop:m===0?0:ue},children:s}):null,o("div",{"data-testid":l,style:u?{paddingTop:ue}:void 0,children:p.map(w=>o(ne,{row:w,column:c,at:w.walk?e.hoveredOn(w.walk):void 0,after:w.closesBubble?o("button",{type:"button",style:mn,"data-testid":"graph-close-bubble",onClick:()=>{e.closeBubbles()},children:"close"}):null},w.key))})]},l))})});var gn={position:"absolute",left:0,top:0,zIndex:4,display:"grid",gap:De,lineHeight:"normal"},vn={height:Xe,padding:"2px 6px",boxSizing:"border-box",fontFamily:"inherit",fontSize:11,color:"inherit",cursor:"pointer",border:"none",background:"none",textAlign:"left",display:"block"},yn={position:"relative"},bn={gridColumn:"1 / -1",height:Je,padding:"2px 6px",boxSizing:"border-box",display:"flex",gap:14,fontSize:11,lineHeight:"15px"},wn=d(function({model:e,lift:n,width:i,height:r,cell:c,handlers:l,canvasStyle:p}){let[s,u]=C(null),[m,w]=C(null),x=n.walks[0];T(()=>{if(!s||!m)return;let E=new H(s),N=new H(m),O=ye(()=>e.buildDrawing(n,!1)),V,Y=[D(()=>{let R=e.facetGrid;R&&E.resize(R.width,R.height);let L=O.get();L&&(L!==V&&(E.uploadGeometry(L.batch),V=L),e.applySelection(E),e.paint(E))}),D(()=>{let R=e.facetGrid;R&&N.resize(R.width,R.height);let L=O.get();L&&e.paintHover(N,L.batch)})];return()=>{for(let R of Y)R();E.dispose(),N.dispose()}},[s,m,e,n]);let W=e.walkLabel(x.name);return h("div",{style:c,children:[o("button",{type:"button",style:vn,"data-testid":"graph-facet-title",onClick:()=>{e.liftWalks([x.name]),e.setFacet("")},children:o(ne,{row:st(e,x),hint:`click to lift ${W} alone`,at:e.hoveredOn(x)})}),h("div",{style:yn,children:[o("canvas",{ref:u,"data-testid":"graph-facet-canvas",style:{...p,width:i,height:r,display:"block"},...l}),o("canvas",{ref:w,style:de})]})]})}),Sn=d(function({model:e,handlers:n,canvasStyle:i}){let r=e.facetPanels,c=e.facetGrid,l=e.facetPlacement;if(!r||!c||!l)return null;let{columns:p,width:s,height:u}=c;return h("div",{"data-testid":"graph-facet-panels",style:{...gn,width:e.paneWidth,minHeight:e.canvasHeight,gridTemplateColumns:`repeat(${p}, ${s}px)`,background:U},children:[r.map((m,w)=>o(wn,{model:e,lift:m,width:s,height:u,cell:{gridRow:Math.floor(l.cells[w]/p)+1,gridColumn:l.cells[w]%p+1},handlers:n,canvasStyle:i},m.walks[0].name)),o("div",{style:{...bn,gridRow:Math.floor(l.cells.reduce((m,w)=>Math.max(m,w),-1/0)/p)+2},"data-testid":"graph-facet-key",children:lt(e).map(m=>o(ne,{row:m},m.key))})]})}),Rt=Sn;var Ct=P(o("path",{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2m2 10H3v4c0 1.1.9 2 2 2h4v-2H5zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2"}),"CropFree");var Lt=P([o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"},"0"),o("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2z"},"1")],"ZoomIn");var Et=P(o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14M7 9h5v1H7z"}),"ZoomOut");var xn=d(function({model:e}){let n=e.colorSchemeLock;return o(z,{label:"Color",size:"small",sx:{minWidth:100},disabled:n!==void 0,title:n?.why,shown:n?.value,value:e.chosenColorScheme,options:Oe.map(({value:i})=>({value:i,label:e.colorSchemeLabel(i)})),testId:"graph-color-select",onChange:i=>{e.setColorScheme(i)}})}),It=xn;var Gt=_()({stats:{marginLeft:"auto"},perf:{color:"#888",fontVariantNumeric:"tabular-nums"}});function fe(t){return t===void 0?"\u2013":`${Math.round(t)}ms`}var Pn=d(function({model:e}){let{classes:n}=Gt(),{lastFetchMs:i,lastLayoutMs:r,lastGeometryMs:c}=e,l=i!==void 0||r!==void 0||c!==void 0;return e.showPerf&&l?h(X,{variant:"caption",className:n.perf,"data-testid":"graph-perf-stats",children:["fetch ",fe(i)," \xB7 layout ",fe(r)," \xB7 geom"," ",fe(c)]}):null}),Mn=d(function({model:e}){let{classes:n}=Gt();return h("div",{className:n.stats,"data-testid":"graph-stats","data-node-count":e.nodeCount,"data-edge-count":e.edgeCount,"data-path-count":e.pathCount,"data-fetch-ms":e.lastFetchMs??"","data-layout-ms":e.lastLayoutMs??"","data-geometry-ms":e.lastGeometryMs??"","data-geometry-strokes":e.lastGeometryStrokeCount??"",children:[h(X,{variant:"body2",component:"span",children:[e.nodeCount," nodes, ",e.edgeCount," edges",e.pathCount>0?`, ${e.pathCount} paths`:""]})," ",o(Pn,{model:e})]})}),Tt=Mn;var kn=d(function({model:e}){let{graph:n}=e;return o(z,{label:"Layout",size:"small",sx:{minWidth:140},testId:"graph-layout-select",value:e.chosenLayoutMode,options:ze.map(({value:i,label:r,description:c,available:l})=>({value:i,label:r,description:c,disabled:n?!l(n):!1})),onChange:i=>{e.switchLayout(i)}})}),Ht=kn;var Rn=d(function({model:e}){return e.chosenLayoutMode!=="walkrows"||e.repeatChoices.length===0?null:o(z,{label:"Repeat",size:"small",sx:{minWidth:130,maxWidth:260},testId:"graph-repeat-select",value:e.selectedRepeat?.key??"",options:e.repeatOptions,onChange:n=>{e.setRepeatKey(n)}})}),At=Rn;var _t=P(o("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");var zt=P(o("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var Cn=d(function({model:e}){let n=e.highlightMenuItems({picks:!1});return o(be,{size:"small",tooltip:"Graph options",menuItems:[...n.length>0?[{label:"Haplotypes",icon:ht,subMenu:n}]:[],...e.layoutOptionMenuItems({repeat:!1}),{label:"Show",icon:Be,subMenu:[...e.showMenuItems(),...e.modeDrawsNodes&&e.walkChoices.length>1?[{type:"checkbox",label:"Show walk rows under the graph",checked:e.walkStrip,onClick:()=>{e.setWalkStrip(!e.walkStrip)}}]:[],{type:"checkbox",label:"Show timings",checked:e.showPerf,onClick:()=>{e.setShowPerf(!e.showPerf)}}]},{type:"divider"},{label:"Graph settings...",icon:mt,helpText:"Subgraph node limit; node width and path colors; the force-directed layout engine",onClick:()=>{$(e).queueDialog(i=>[gt,{model:e,onClose:i}])}},{type:"divider"},{label:"Close graph",icon:_t,onClick:()=>{e.clearGraph()}}],children:o(zt,{})})}),Wt=Cn;var Ln=_()({formControl:{minWidth:130,maxWidth:260}}),En=d(function({model:e}){let{classes:n}=Ln(),i=Ie(),{walkChoices:r}=e;if(r.length===0||!e.liftsWalks)return null;let c=new Set(r.map(s=>s.name)),l=new Map(r.map(s=>[s.name,s.label])),p=e.walkLayers.map(s=>s.walk).filter(s=>c.has(s));return r.length>Ve?o(xe,{size:"small",variant:"outlined",color:"inherit","data-testid":"graph-walk-choose",onClick:()=>{$(e).queueDialog(s=>[Fe,{model:e,onClose:s}])},children:p.length>0?`${p.length} of ${r.length} haplotypes`:"Highlight haplotypes..."}):h(Me,{size:"small",className:n.formControl,children:[o(ke,{id:i,children:"Highlight"}),o(Le,{labelId:i,multiple:!0,value:p,label:"Highlight","data-testid":"graph-walk-select",renderValue:s=>s.map(u=>l.get(u)).join(", "),onChange:s=>{let{value:u}=s.target;e.liftAmongChoices(typeof u=="string"?u.split(","):u)},children:r.map(({name:s,label:u})=>h(Ce,{value:s,dense:!0,children:[o(Pe,{size:"small",checked:p.includes(s)}),o(Re,{primary:u})]},s))})]})}),Nt=En;var In=_()({toolbar:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4,padding:"2px 4px",borderBottom:"1px solid #ddd"}}),Gn=d(function({model:e}){return o(X,{variant:"body2",children:e.zoomPercent})}),Tn=d(function({model:e}){let{classes:n}=In(),i=r=>{e.zoom(r,e.viewBox.width/2,e.viewBox.height/2)};return h("div",{className:n.toolbar,children:[o(Ht,{model:e}),o(It,{model:e}),o(Nt,{model:e}),o(At,{model:e}),o(K,{title:"Zoom in",children:o(j,{size:"small",onClick:()=>{i(1.5)},children:o(Lt,{})})}),o(K,{title:"Zoom out",children:o(j,{size:"small",onClick:()=>{i(1/1.5)},children:o(Et,{})})}),o(K,{title:"Zoom to fit",children:o(j,{size:"small",onClick:()=>{e.refitView()},children:o(Ct,{})})}),o(Gn,{model:e}),o(Tt,{model:e}),o(Wt,{model:e})]})}),Ot=Tn;var Hn={position:"absolute",bottom:Ue,lineHeight:"normal",background:"rgba(0,0,0,0.75)",color:"white",padding:"4px 8px",borderRadius:4,fontSize:12,pointerEvents:"none",zIndex:6};function he({label:t,readout:e}){return h(I,{children:[o("strong",{children:t})," \u2014 ",e]})}function An(t,e){if(e)return{testId:"graph-chip-tooltip",body:he(e)};let n=t.hoveredNode?t.hoverNodeById?.get(t.hoveredNode):void 0;if(n){let l=t.hoverDrawing?.members.get(n.id),p=Ne(n);return{body:h(I,{children:[o("strong",{children:n.name}),l?` and ${l.length-1} more`:""," \u2014"," ",n.length.toLocaleString()," bp, depth ",n.depth.toFixed(1),p?h(I,{children:[o("br",{}),p.sample," ",q(p)," (rank ",n.stable?.rank,")"]}):null,n.moved?h(I,{children:[o("br",{}),"End of a component too large to draw here"]}):null]})}}let i=t.hoveredEdge===null?void 0:t.graph?.edges[t.hoveredEdge];if(i){let l=We(i,t.deletions.find(p=>p.edgeIndex===t.hoveredEdge),p=>t.nodeById?.get(p)?.name??p);return{body:l.deletion?h(I,{children:[o("strong",{children:"Deletion"})," ",l.deletion.bp,o("br",{}),l.deletion.where]}):h(I,{children:["Edge: ",l.ends]})}}let r=t.hoveredWalkRowText;if(r)return{testId:"graph-walk-row-tooltip",body:he(r)};let c=t.hoveredTubeText;return c?{testId:"graph-tube-tooltip",body:he(c)}:void 0}var _n=d(function({model:e,chip:n}){let i=An(e,n);return i?o("div",{style:{...Hn,right:e.tooltipRightPx},"data-testid":i.testId,children:i.body}):null}),Dt=_n;var Xt=P(o("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList");var Bt=P(o("path",{d:"M10.83 8H21V6H8.83zm5 5H18v-2h-4.17zM14 16.83V18h-4v-2h3.17l-3-3H6v-2h2.17l-3-3H3V6h.17L1.39 4.22 2.8 2.81l18.38 18.38-1.41 1.41z"}),"FilterListOff");var Ft=P(o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info");var zn={x:0,y:0};function Wn(t,e){let{own:n,reference:i,highlight:r}=t.nodeLaunchTargets(e);return[{label:"Node details",icon:Ft,onClick:()=>{t.showNodeDetails(e)}},...Qe({own:n,reference:i,highlight:r,onShowLinear:c=>{t.showInLinearView(c)},onHighlight:t.canHighlightInLinearView?c=>{t.highlightInLinearView(c)}:void 0})]}function Nn(t){return t>=1e3?`${Math.round(t/1e3)} k`:`${t}`}function On(t,e,n){let i=n??t.walkRowBars,r=t.walkRowLaunchTarget(e,i),c=r?.assembly,l=e>0?i?.rows[e-1]:void 0,p=l?.sample,s=!n&&t.walkRowBars,u=t.walkRowSamples;return[r&&c?{label:`Linear genome view \u2014 ${c} ${q(r.location)}`,icon:pe,onClick:()=>{t.showInLinearView({location:r.location,assembly:c})}}:{label:"Linear genome view",icon:pe,disabled:!0,disabledHelpText:r?`No assembly in this session is ${r.location.haplotype??r.label}`:"This walk states no contig coordinates",onClick:()=>{}},...l?.abridgedSteps?[{label:`Load the ${Nn(l.abridgedSteps)} abridged steps`,onClick:()=>{t.expandWalk(l.name)}}]:[],...l&&t.liftsWalks&&t.modeDrawsNodes?[{type:"checkbox",label:`Highlight ${l.label}`,checked:t.walkLayers.some(m=>m.walk===l.name),onClick:()=>{t.toggleWalk(l.name)}}]:[],...s&&p&&!(u?.length===1&&u[0]===p)?[{label:`Show only ${p}`,icon:Xt,onClick:()=>{t.setWalkRowSamples([p])}}]:[],...s&&u?[{label:"Show every sample",icon:Bt,onClick:()=>{t.setWalkRowSamples(void 0)}}]:[]]}var oe=d(function({model:e,at:n,onClose:i}){return o(we,{anchor:n,offset:zn,onClose:i,menuItems:()=>n===void 0?[]:"nodeId"in n?Wn(e,n.nodeId):On(e,n.row,n.bars)})});var Dn={display:"flex",flexWrap:"wrap",gap:"2px 14px",padding:"2px 8px 6px",fontSize:11,color:"#333"},Xn={position:"absolute",pointerEvents:"none",background:"rgba(255,255,255,0.92)",border:"1px solid #ccc",borderRadius:3,padding:"1px 6px",fontSize:11,whiteSpace:"nowrap",zIndex:4},Bn=d(function({bars:e,frame:n,ramp:i,rowGenes:r}){let c=ot(),l=Ge(()=>_e(e,n,{ramp:i,rowGenes:r,idPrefix:c}),[e,n,i,r,c]);return o(Q,{el:l})}),Fn=d(function({model:e}){let n=e.walkStripRows,i=e.walkStripFrame,r=e.stripHover,c=n?[n.reference,...n.rows]:[],l=r?c.findIndex(m=>m.name===r.row):-1,p=c[l];if(!n||!i||i.labelled||!r||!p)return null;let s=(n.origin+r.offset)*i.scaleX+i.translateX,u=s>i.width/2?{right:i.width-s+12}:{left:s+12};return h("div",{"data-testid":"graph-walk-strip-tip",style:{...Xn,...u,top:l*i.rowPx+i.translateY-18},children:[p.label," \xB7"," ",He(p,l===0?void 0:n.reference)]})}),Vn=d(function({model:e,bars:n,frame:i}){return o(Q,{el:$e(n,i,e.walkStripMarks)})}),Yn=d(function({model:e}){let n=e.walkStripRows,i=e.walkStripFrame,[r,c]=C();if(!n||!i)return null;let l=s=>{let u=s.currentTarget.getBoundingClientRect();return Ze(n,i,s.clientX-u.left,s.clientY-u.top)},p=Ae(n,{ramp:e.referenceRampDomain,rampCss:Te,genes:Ke(i,e.walkRowGenes,e.walkRowGeneGaps),annotation:e.walkRowAnnotation});return h("div",{"data-testid":"graph-walk-strip",style:{position:"relative",borderTop:"1px solid #ddd"},onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{G(e)&&(e.setPointerInPane(!1),e.setStripHover(null))},children:[h("svg",{width:i.width,height:i.height,style:{display:"block"},onMouseMove:s=>{let u=l(s);s.currentTarget.style.cursor=u&&u.index>0?"pointer":"",e.setStripHover(u?{row:u.row.name,offset:u.offset}:null)},onClick:s=>{let u=l(s);u&&u.index>0&&e.toggleWalk(u.row.name)},onContextMenu:s=>{let u=l(s);u&&(s.preventDefault(),c({clientX:s.clientX,clientY:s.clientY,row:u.index}))},children:[o(Bn,{bars:n,frame:i,ramp:e.referenceRampDomain,rowGenes:e.walkRowGenes}),o(Vn,{model:e,bars:n,frame:i}),o(Q,{el:je(n,i,new Set(e.walkLayers.map(s=>s.walk)))})]}),o(Fn,{model:e}),h("div",{style:Dn,"data-testid":"graph-walk-strip-key",children:[p.map(s=>h("div",{style:te,children:[o(ee,{swatch:it(s.swatch)}),o("span",{children:s.label})]},s.label)),o("span",{style:{color:"#777"},children:"Ticks mark where each walk passes the node under the pointer; click a haplotype's bar to lift its walk"})]}),o(oe,{model:e,at:r&&{...r,bars:n},onClose:()=>{c(void 0)}})]})}),Vt=Yn;var Zn=d(function({model:e}){let n=e.walkStripLocator;return n?h(J,{model:e,zIndex:4,overflow:"visible",testId:"graph-walk-strip-locator",children:[o("circle",{cx:n.x,cy:n.y,r:11,fill:"none",stroke:"white",strokeWidth:4}),o("circle",{cx:n.x,cy:n.y,r:11,fill:"none",stroke:"#111",strokeWidth:1.75})]}):null}),Yt=Zn;var $n=1.1,jn=100,Kn=40,qn=800,Un=10,Zt=2;function me(t){let e=t.deltaY*(t.deltaMode===1?Kn:t.deltaMode===2?qn:1),n=(t.ctrlKey?Un:1)*e/jn;return $n**-Math.max(-Zt,Math.min(Zt,n))}var Jn=40,Qn=100,eo=24,$t=Math.log(16);function to(t,e){let n=t*Math.exp(-Math.max(0,e)/eo);return Math.abs(n)<.001?t:t-n}function no(t,e){let n=Math.abs(t.deltaX)>Math.abs(t.deltaY);return t.ctrlKey||t.metaKey||!n&&(!e||e.scrollZoom)?"zoom":n?"pan":"page"}function qt(t,e,n){T(()=>{if(!t)return;let i=-1/0,r={backlog:0,x:0,y:0,frame:0,last:0},c=p=>{let s=to(r.backlog,Math.min(100,p-r.last));r.backlog-=s,r.last=p,r.frame=r.backlog?requestAnimationFrame(c):0,G(n)&&n.zoom(Math.exp(s),r.x,r.y)},l=p=>{if(n.hostPlacesX||n.followsHostView)return;let m=((p.target instanceof Element?p.target.closest("canvas"):null)??(n.facetPanels?null:e))?.getBoundingClientRect();if(m&&p.clientY-m.top<n.referenceStripZonePx)return;let w=no(p,n.host);if(w!=="page"){if(n.host&&p.stopPropagation(),p.preventDefault(),w==="pan"){if(p.timeStamp-i>Qn){let x=p.deltaMode===1?Jn:1;n.setTransform(n.scale,n.translateX-p.deltaX*x,n.translateY)}return}i=p.timeStamp,m&&(r.x=p.clientX-m.left,r.y=p.clientY-m.top,r.backlog=Math.max(-$t,Math.min($t,r.backlog+Math.log(me(p)))),r.frame||(r.last=performance.now()-1e3/60,r.frame=requestAnimationFrame(c)))}};return t.addEventListener("wheel",l,{passive:!1}),()=>{cancelAnimationFrame(r.frame),t.removeEventListener("wheel",l)}},[t,e,n])}var jt=3,ge="data-gesture-owner",F=t=>({x:t.clientX,y:t.clientY});function Kt(t){let[e,n]=[...t.values()];return{spread:Math.hypot(e.x-n.x,e.y-n.y),mid:{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}}function Ut(t){let e=k({x:0,y:0}),n=k({x:0,y:0}),i=k(!1),r=k(void 0),c=a=>r.current!==void 0&&a.pointerId!==r.current,l=k(new Map),p=k(null),s=k(null),u=k(!1),m=k(null),w=k(!1),x=k({frame:0,pan:null,hover:null,pinch:!1});T(()=>()=>{cancelAnimationFrame(x.current.frame)},[]);let[W,E]=C(),[N,O]=C(!1),[V,Y]=C(void 0);function R(a){let f=a.currentTarget.getBoundingClientRect();return{x:a.clientX-f.left,y:a.clientY-f.top}}function L(a,f){if(t.layoutResult?.tubeMap)return t.tubeMapNodeAt(a,f);let g=t.referenceStripNodeAt(a,f);if(g)return g;let{nodePositions:v}=t;if(!v)return null;let{x:y,y:b}=se(a,f,t,t.axisScale);return le(v,y,b,t.axisScale,t.positionsVersion,t.nodeInk)}function en(a,f){let{nodePositions:g,graph:v}=t;if(!g||!v)return null;let{x:y,y:b}=se(a,f,t,t.axisScale);return ce(g,v,y,b,t.axisScale,t.effectiveDrawPaths&&!t.facetPanels,t.positionsVersion,t.deletionEdgeIndexes,t.hiddenEdgeIndexes,t.deletionRoutes,t.layoutResult?.stranded)}function tn(a){a.button===0&&a.preventDefault()}function nn(a){if(a.button!==0)return;let f=l.current;if(c(a)){t.isPanning&&!w.current&&a.pointerType==="touch"&&f.size===1&&(a.currentTarget.setPointerCapture(a.pointerId),f.set(a.pointerId,F(a)),s.current=Kt(f),i.current=!0);return}i.current=!1,n.current={x:a.clientX,y:a.clientY},a.currentTarget.removeAttribute(ge);let g=t.followsHostView;if(t.hostPlacesX||g&&a.shiftKey)return;a.currentTarget.setPointerCapture(a.pointerId),r.current=a.pointerId,p.current=a.currentTarget,f.clear(),f.set(a.pointerId,F(a));let{x:v,y}=R(a),b=y<t.referenceStripZonePx,M=t.layoutResult?.tubeMap||b?null:L(v,y);g&&M&&a.currentTarget.setAttribute(ge,""),w.current=g,u.current=b&&!g,M?t.setDraggingNode(M):t.setPanning(!0),e.current={x:a.clientX,y:a.clientY}}function ve(){let a=s.current,f=p.current;if(!a||!f)return;let g=Kt(l.current),v=f.getBoundingClientRect();a.spread>0&&g.spread>0&&t.zoom(g.spread/a.spread,a.mid.x-v.left,a.mid.y-v.top),t.setTransform(t.scale,t.translateX+g.mid.x-a.mid.x,t.translateY+g.mid.y-a.mid.y),s.current=g}function on(){let a=x.current,{pan:f,hover:g,pinch:v}=a;if(a.frame=0,a.pan=null,a.hover=null,a.pinch=!1,v&&ve(),f&&u.current?t.host?.horizontalScroll(-f.dx):f&&w.current?t.setTransform(t.scale,t.translateX,t.translateY+f.dy):f&&t.setTransform(t.scale,t.translateX+f.dx,t.translateY+f.dy),!g)return;let{x:y,y:b}=g,M=t.facetPanels?void 0:vt(t.overlayLabels,y,b);if(Y(S=>S?.label===M?.label&&S?.readout===M?.readout?S:M),t.walkRowBars){let S=t.walkRowAt(y,b);t.setHoveredWalkRow(S===void 0?null:t.walkRowList[S].name)}if(t.nodePositions&&t.graph){let S=L(y,b);t.setHoveredPanel(t.tubeMapPanelAt(b)),t.setHoveredNode(S,{x:y,y:b}),O(S!==null&&!t.hostPlacesX&&!t.layoutResult?.tubeMap&&b>=t.referenceStripZonePx),t.setHoveredTube(S===null&&t.layoutResult?.tubeMap?t.tubeAt(y,b):null),t.setHoveredEdge(S||t.layoutResult?.tubeMap||!t.hoverLightsEverything?null:en(y,b))}}function Z(){x.current.frame||(x.current.frame=requestAnimationFrame(on))}function rn(){let a=x.current;cancelAnimationFrame(a.frame),a.frame=0,a.pan=null,a.hover=null,a.pinch=!1}function an(a){let f=l.current;if(s.current&&f.has(a.pointerId)){f.set(a.pointerId,F(a)),x.current.pinch=!0,Z();return}if(c(a)||m.current)return;let g=a.clientX-e.current.x,v=a.clientY-e.current.y;e.current={x:a.clientX,y:a.clientY},Math.hypot(a.clientX-n.current.x,a.clientY-n.current.y)>jt&&(i.current=!0);let y=x.current;if(t.draggingNode)t.moveNode(t.draggingNode,g/t.scaleX,v/t.scaleY);else if(t.isPanning)y.pan={dx:(y.pan?.dx??0)+g,dy:(y.pan?.dy??0)+v},Z();else{let b=a.currentTarget.getBoundingClientRect();y.hover={x:a.clientX-b.left,y:a.clientY-b.top},Z()}}function re(a){let f=l.current;if(s.current&&f.has(a.pointerId)){x.current.pinch&&(x.current.pinch=!1,ve()),f.delete(a.pointerId),s.current=null;let[[g,v]]=[...f];r.current=g,e.current=v;return}c(a)||(r.current=void 0,f.clear(),G(t)&&t.stopDragging())}function sn(a){c(a)||(r.current=void 0,l.current.clear(),s.current=null,rn(),Y(void 0),O(!1),G(t)&&(t.stopDragging(),t.clearHover()))}function ln(a){let{x:f,y:g}=R(a),v=L(f,g),{clientX:y,clientY:b}=a;if(v){a.preventDefault(),E({clientX:y,clientY:b,nodeId:v});return}let M=t.walkRowAt(f,g);M!==void 0&&(a.preventDefault(),E({clientX:y,clientY:b,row:M}))}function cn(a){if(!i.current){let{x:f,y:g}=R(a),v=L(f,g);t.setSelectedNode(v),v&&t.showNodeDetails(v)}}T(()=>()=>{m.current?.end()},[]);function pn(a){if(a.button!==0||t.hostPlacesX||t.followsHostView||!(a.target instanceof Element)||!a.target.closest(`[${et}]`))return;m.current?.end(),u.current=!1,w.current=!1;let f=a.pointerId,g=F(a),v=g,y={moved:!1,end:()=>{window.removeEventListener("pointermove",b,!0),window.removeEventListener("pointerup",M,!0),window.removeEventListener("pointercancel",M,!0),y.moved&&G(t)&&t.stopDragging()}};function b(S){if(S.pointerId!==f)return;if(!y.moved){if(Math.hypot(S.clientX-g.x,S.clientY-g.y)<=jt)return;y.moved=!0,t.setPanning(!0)}let ae=x.current;ae.pan={dx:(ae.pan?.dx??0)+S.clientX-v.x,dy:(ae.pan?.dy??0)+S.clientY-v.y},v=F(S),Z()}function M(S){S.pointerId===f&&(y.end(),setTimeout(()=>{m.current===y&&(m.current=null)},0))}m.current=y,window.addEventListener("pointermove",b,!0),window.addEventListener("pointerup",M,!0),window.addEventListener("pointercancel",M,!0)}function un(a){m.current?.moved&&(m.current=null,a.stopPropagation())}let dn={cursor:t.isPanning||t.draggingNode?"grabbing":N?"move":"grab",touchAction:t.hostPlacesX?"auto":"none",overscrollBehavior:"contain"},fn=t.host!==void 0&&!t.hostPlacesX&&!t.followsHostView?{[ge]:"",onMouseDown:a=>{a.stopPropagation()}}:{};return{canvasStyle:dn,surfaceProps:fn,handlers:{onMouseDown:tn,onPointerDown:nn,onPointerMove:an,onPointerUp:re,onPointerCancel:re,onLostPointerCapture:re,onPointerLeave:sn,onClick:cn,onContextMenu:ln},contextMenu:W,hoveredChip:V,labelHandlers:{onPointerDown:pn,onClickCapture:un},closeContextMenu:()=>{E(void 0)}}}var oo={position:"relative"},ro={position:"relative",lineHeight:0,isolation:"isolate"},ao={position:"absolute",left:0,right:0,bottom:0,zIndex:0},io={position:"absolute",inset:0,zIndex:10,lineHeight:"normal",pointerEvents:"none"},so={position:"absolute",left:6,transform:"translateY(-50%)",background:"rgba(255,255,255,0.82)",padding:"0 4px",borderRadius:3,fontSize:11,lineHeight:"16px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:4},lo=d(function({model:e}){return o(I,{children:e.visibleRowLabels.map(({label:n,y:i,top:r})=>o("div",{"data-testid":"graph-row-label",style:{...so,top:r},children:n},i))})}),co={position:"absolute",top:B,right:B,display:"flex",flexDirection:"column",borderRadius:3,overflowX:"hidden",overflowY:"auto",zIndex:4},Jt={position:"absolute",transform:"translate(-50%, -50%)",background:"rgba(255,255,255,0.78)",padding:"0 3px",borderRadius:3,fontSize:10,lineHeight:"13px",whiteSpace:"nowrap",pointerEvents:"none",zIndex:3},po={...Jt,color:"#18181c",fontWeight:600},uo=d(function({model:e}){let n=k(null),i=e.legendAtRest;return T(()=>{let r=n.current;if(!r||!i)return;let c=()=>{G(e)&&e.legendAtRest&&e.setLegendSize({width:r.offsetWidth,height:r.scrollHeight})};c();let l=new ResizeObserver(c);return l.observe(r),r.firstElementChild&&l.observe(r.firstElementChild),()=>{l.disconnect()}},[e,i]),o("div",{ref:n,style:{...co,top:B+e.referenceStripZonePx,maxHeight:e.canvasHeight-2*B-e.referenceStripZonePx},children:o(kt,{model:e})})}),fo=d(function({model:e}){let n=e.overlayLabels.sizes,i=n.flatMap(({key:r,leader:c})=>c?[{key:r,...c}]:[]);return h(I,{children:[i.length>0?o(J,{model:e,zIndex:2,overflow:"visible",children:i.map(({key:r,arcX:c,arcY:l,labelX:p,labelY:s})=>o("line",{"data-testid":"graph-label-leader",x1:c,y1:l,x2:p,y2:s,stroke:"#18181c",strokeWidth:1},r))}):null,n.map(({key:r,text:c,x:l,y:p,kind:s})=>o("div",{"data-testid":"graph-size-label",style:{...s==="deletion"?po:Jt,left:l,top:p},children:c},r))]})}),Qt=d(function({model:e,handle:{canvasRef:n,canvas:i},ownChrome:r}){let{handlers:c,canvasStyle:l,surfaceProps:p,labelHandlers:s,contextMenu:u,closeContextMenu:m,hoveredChip:w}=Ut(e),[x,W]=C(null);qt(x,i,e);let E=e.facetPanels!==void 0;return h("div",{style:oo,...p,children:[r?o(Ot,{model:e}):null,h("div",{ref:W,style:ro,...s,onMouseEnter:()=>{e.setPointerInPane(!0)},onMouseLeave:()=>{G(e)&&e.setPointerInPane(!1)},children:[e.referenceStripShown?o("div",{style:{...ao,top:e.referenceStripZonePx,background:U}}):null,o("canvas",{ref:n,"data-testid":"graph-genome-canvas",style:{...l,width:e.paneWidth,height:e.canvasHeight,display:"block",position:"relative",zIndex:1},...c}),E?o(Rt,{model:e,handlers:c,canvasStyle:l}):h(I,{children:[o(wt,{model:e}),o(Mt,{model:e}),o(bt,{model:e}),o(lo,{model:e}),o(fo,{model:e}),o(nt,{model:e}),o(ft,{model:e}),o(yt,{model:e}),o(St,{model:e}),o(Yt,{model:e}),o(uo,{model:e})]}),r?o("div",{style:io,children:o(Se,{isVisible:e.isLoading,immediate:!e.layoutResult,statusMessage:e.statusMessage,onCancel:e.canCancelLoad?()=>{e.cancelLoad()}:void 0})}):null,o(Dt,{model:e,chip:w})]}),e.walkStripShown?o(Vt,{model:e}):null,o(oe,{model:e,at:u,onClose:m}),r?.renderError?o(ie,{error:r.renderError,onReset:r.retryRender}):null,r&&e.error?o(ie,{error:e.error,onReset:e.canRetryLoad?()=>{e.retryLoad()}:void 0}):null]})}),ho=d(function({model:e}){let{canvasRef:n,canvas:i,error:r,retry:c}=Pt(xt,e);return o(Qt,{model:e,handle:{canvasRef:n,canvas:i},ownChrome:{renderError:r,retryRender:c}})}),mo=d(function({model:e,handle:n}){return n?o(Qt,{model:e,handle:n}):o(ho,{model:e})}),Ki=mo;export{xt as a,Ki as b};
2
+ //# sourceMappingURL=chunk-OS52UJIX.js.map