"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[7126],{53740:(e,t,n)=>{n.d(t,{A:()=>g});var r=n(7552),o=n(68446),a=n(99546),l=n(68584),s=n(72241),i=n(9502);function c(e,t){const n=t?(0,i.h)(t):void 0;let r=e.get("start"),o=e.get("end");const a=e.get("strand"),l=e.get("mate"),s=e.get("refName");let c,m=0,d=0,u=0,g=0;if(["<TRA","<DEL","<INV","<INS","<DUP","<CNV"].some((e=>t?.startsWith(e)))){const t=e.get("INFO"),n=t?.END?.[0]??o;c=t?.CHR2?.[0]??s,m=n,d=n-1,o=r+1}else if(n?.MatePosition){const e=n.MatePosition.split(":");g="left"===n.MateDirection?1:-1,u="left"===n.Join?-1:1,m=+e[1],d=+e[1]-1,c=e[0]}return{k1:{refName:s,start:r,end:o,strand:a,mateDirection:g},k2:l??{refName:c,end:m,start:d,mateDirection:u}}}function m(e,t){const{k1:n,k2:r}=c(e,t);return[e.get("name"),e.get("id"),(0,a.assembleLocString)(n),(0,a.assembleLocString)(r),e.get("INFO")?.SVTYPE,t].filter((e=>!!e)).join(" - ")}const d=(0,o.observer)((function({model:e,feature:t,alt:n,assembly:o,view:a}){const[i,d]=(0,r.useState)(!1),{height:u}=e,{k1:g,k2:f}=c(t,n),b=(0,r.useRef)(null),k=(0,l.getConf)(e,"color",{feature:t,alt:n}),h=o.getCanonicalRefName(g.refName)||g.refName,E=o.getCanonicalRefName(f.refName)||f.refName,p=g.start,v=f.start,x=a.bpToPx({refName:h,coord:p})?.offsetPx,N=a.bpToPx({refName:E,coord:v})?.offsetPx;if(void 0!==x&&void 0!==N){const o=(N-x)/2,l=Math.abs(o),c=Math.min(u,l),h=x-a.offsetPx,E=N-a.offsetPx,p=i?"black":k,v=3;return l>1?r.createElement(r.Fragment,null,r.createElement("path",{d:`M ${h} 0 C ${h} ${c}, ${E} ${c}, ${E} 0`,ref:b,stroke:p,strokeWidth:v,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),fill:"none",pointerEvents:"stroke"}),void 0!==g.mateDirection?r.createElement("line",{stroke:p,strokeWidth:v,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),x1:h,x2:h+20*g.mateDirection,y1:1.5,y2:1.5}):null,void 0!==f.mateDirection?r.createElement("line",{stroke:p,strokeWidth:v,onMouseOut:()=>d(!1),onMouseOver:()=>d(!0),onClick:()=>e.selectFeature(t),x1:E,x2:E+20*f.mateDirection,y1:1.5,y2:1.5}):null,i?r.createElement(s.A,{contents:m(t,n)}):null):null}return null})),u=(0,o.observer)((function({model:e,exportSVG:t,children:n}){const{height:o}=e,l=(0,a.getContainingView)(e),s=Math.round(l.dynamicBlocks.totalWidthPx);return t?r.createElement(r.Fragment,null,n):r.createElement("svg",{width:s,height:o},n)})),g=(0,o.observer)((function({model:e,exportSVG:t}){const n=(0,a.getContainingView)(e),o=(0,a.getSession)(e),{assemblyManager:l}=o,{features:s}=e,i=l.get(n.assemblyNames[0]);return i?r.createElement(u,{model:e,exportSVG:t},s?.map((t=>{const a=t.get("ALT");return a?.map((a=>r.createElement(d,{key:t.id()+"-"+a,session:o,feature:t,alt:a,view:n,model:e,assembly:i})))??r.createElement(d,{key:t.id(),session:o,feature:t,view:n,model:e,assembly:i})}))):null}))},87126:(e,t,n)=>{n.r(t),n.d(t,{default:()=>v});var r=n(7552),o=n(68446),a=n(89003),l=n(61723),s=n(48735),i=n(68666),c=n(75785),m=n(38130),d=n(2047),u=n(99546);const g=(0,r.lazy)((()=>Promise.all([n.e(9245),n.e(4630)]).then(n.bind(n,74630)))),f=(0,c.n9)()((e=>({loading:{backgroundColor:e.palette.background.default,backgroundImage:`repeating-linear-gradient(45deg, transparent, transparent 5px, ${e.palette.action.disabledBackground} 5px, ${e.palette.action.disabledBackground} 10px)`,position:"absolute",bottom:0,height:50,width:300,right:0,pointerEvents:"none",textAlign:"center"}}))),b=(0,o.observer)((function({model:e,children:t}){const{error:n,regionTooLarge:o}=e;return n?r.createElement(i.LW,{message:`${n}`,severity:"error",action:r.createElement(r.Fragment,null,r.createElement(a.A,{title:"Reload"},r.createElement(l.A,{"data-testid":"reload_button",onClick:()=>e.reload()},r.createElement(m.A,null))),r.createElement(a.A,{title:"Show stack trace"},r.createElement(l.A,{onClick:()=>{(0,u.getSession)(e).queueDialog((t=>[g,{onClose:t,error:e.error}]))}},r.createElement(d.A,null))))}):o?e.regionCannotBeRendered():r.createElement(k,{model:e},t)})),k=(0,o.observer)((function({model:e,children:t}){const{loading:n}=e;return r.createElement("div",null,t,n?r.createElement(h,{model:e}):null)})),h=(0,o.observer)((function({model:e}){const{classes:t}=f(),{message:n}=e;return r.createElement("div",{className:t.loading},r.createElement(s.LoadingEllipses,{message:n}))})),E=b;var p=n(53740);const v=(0,o.observer)((function({model:e,exportSVG:t}){return r.createElement(E,{model:e},r.createElement(p.A,{model:e,exportSVG:t}))}))}}]);
//# sourceMappingURL=7126.e7a4dfc2.chunk.js.map