(this["webpackJsonp@jbrowse/web"]=this["webpackJsonp@jbrowse/web"]||[]).push([[53],{2282:function(e,t,a){"use strict";a.r(t);var n=a(29),r=a(1),c=a.n(r),i=a(51),o=a(2249),l=a(2219),s=a(2315),u=a(2205),m=a(2254),p=a(2197),d=a(84),f=a(82),g=a(421),v=a.n(g),b=a(483),E=a(276),S=Object(i.a)((function(){return{compact:{paddingRight:0,paddingTop:0,paddingBottom:0}}})),h=["clipPos","flags"];function w(e){var t=S(),a=e.feature.flags;return c.a.createElement(b.BaseCard,Object.assign({},e,{title:"Flags"}),c.a.createElement(b.SimpleValue,{name:"Flag",value:a}),c.a.createElement(o.a,null,["read paired","read mapped in proper pair","read unmapped","mate unmapped","read reverse strand","mate reverse strand","first in pair","second in pair","not primary alignment","read fails platform/vendor quality checks","read is PCR or optical duplicate","supplementary alignment"].map((function(e,n){var r=a&1<<n,i="".concat(e,"_").concat(r);return c.a.createElement(l.a,{key:i,control:c.a.createElement(s.a,{className:t.compact,checked:Boolean(r),name:e,readOnly:!0}),label:e})}))))}function y(e){var t=e.value,a=Object(r.useState)(!1),i=Object(n.a)(a,2),o=i[0],l=i[1],s=String(t);return s.length>100?c.a.createElement(c.a.Fragment,null,c.a.createElement("button",{type:"button",onClick:function(){return v()(s)}},"Copy"),c.a.createElement("button",{type:"button",onClick:function(){return l((function(e){return!e}))}},o?"Show less":"Show more"),c.a.createElement("div",null,o?s:"".concat(s.slice(0,100),"..."))):c.a.createElement("div",null,s)}function O(e){var t=e.tag,a=e.model,r=Object(f.getSession)(a);return c.a.createElement(b.BaseCard,Object.assign({},e,{title:"Supplementary alignments"}),c.a.createElement(u.a,null,"List of supplementary alignment locations"),c.a.createElement("ul",null,t.split(";").filter((function(e){return!!e})).map((function(e,t){var i=e.split(","),o=Object(n.a)(i,4),l=o[0],s=o[1],u=o[2],p=function(e){for(var t=Object(E.parseCigar)(e),a=0,n=0;n<t.length;n+=2){var r=+t[n],c=t[n+1];"H"!==c&&"S"!==c&&"I"!==c&&(a+=r)}return a}(o[3]),d=Math.floor(p/5),f=+s,g=+s+p,v="".concat(l,":").concat(Math.max(1,f-d),"-").concat(g+d),b=f.toLocaleString("en-US"),S=g.toLocaleString("en-US"),h="".concat(l,":").concat(b,"-").concat(S," (").concat(u,")");return c.a.createElement("li",{key:"".concat(v,"-").concat(t)},c.a.createElement(m.a,{onClick:function(){var e=a.view;e?e.navToLocString(v):r.notify("No view associated with this feature detail panel anymore","warning")},href:"#"},h))}))))}function j(e){var t=e.locString,a=e.model,n=Object(f.getSession)(a);return c.a.createElement(m.a,{onClick:function(){var e=a.view;e?e.navToLocString(t):n.notify("No view associated with this feature detail panel anymore","warning")},href:"#"},t)}t.default=Object(d.observer)((function(e){var t=e.model,a=JSON.parse(JSON.stringify(t.featureData)),n=a.tags&&a.tags.SA||a.SA;return c.a.createElement(p.a,{"data-testid":"alignment-side-drawer"},c.a.createElement(b.FeatureDetails,Object.assign({},e,{omit:h,feature:a,formatter:function(e,a){return"next_segment_position"===a?c.a.createElement(j,{model:t,locString:e}):c.a.createElement(y,{value:e})}})),n?c.a.createElement(O,{model:t,tag:n}):null,c.a.createElement(w,Object.assign({feature:a},e)))}))}}]);
//# sourceMappingURL=53.065a7a73.chunk.js.map