this.webpackChunk([37],{1287:function(e,t,a){"use strict";a.r(t);var n=a(6),r=a(0),c=a.n(r),o=a(146),i=a(852),l=a(842),u=a(656),s=a(80),m=a(897),p=a(119),d=a(16),f=a(7),g=a(170),v=a.n(g),E=a(435),S=a(77),h=Object(o.a)((function(){return{compact:{paddingRight:0,paddingTop:0,paddingBottom:0}}})),b=["clipPos","flags"];function y(e){var t=h(),a=e.feature.flags;return c.a.createElement(E.BaseCard,Object.assign({},e,{title:"Flags"}),c.a.createElement(E.SimpleValue,{name:"Flag",value:a}),c.a.createElement(i.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,o="".concat(e,"_").concat(r);return c.a.createElement(l.a,{key:o,control:c.a.createElement(u.a,{className:t.compact,checked:Boolean(r),name:e,readOnly:!0}),label:e})}))))}function O(e){var t=e.value,a=Object(r.useState)(!1),o=Object(n.a)(a,2),i=o[0],l=o[1],u=String(t);return u.length>100?c.a.createElement(c.a.Fragment,null,c.a.createElement("button",{type:"button",onClick:function(){return v()(u)}},"Copy"),c.a.createElement("button",{type:"button",onClick:function(){return l((function(e){return!e}))}},i?"Show less":"Show more"),c.a.createElement("div",null,i?u:"".concat(u.slice(0,100),"..."))):c.a.createElement("div",null,u)}function w(e){var t=e.tag,a=e.model,r=Object(f.getSession)(a);return c.a.createElement(E.BaseCard,Object.assign({},e,{title:"Supplementary alignments"}),c.a.createElement(s.a,null,"List of supplementary alignment locations"),c.a.createElement("ul",null,t.split(";").filter((function(e){return!!e})).map((function(e,t){var o=e.split(","),i=Object(n.a)(o,4),l=i[0],u=i[1],s=i[2],p=function(e){for(var t=Object(S.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}(i[3]),d=Math.floor(p/5),f=+u,g=+u+p,v="".concat(l,":").concat(Math.max(1,f-d),"-").concat(g+d),E=f.toLocaleString("en-US"),h=g.toLocaleString("en-US"),b="".concat(l,":").concat(E,"-").concat(h," (").concat(s,")");return c.a.createElement("li",{key:"".concat(v,"-").concat(t)},c.a.createElement(m.a,{onClick:function(){var e=a.view;try{if(!e)throw new Error("No view associated with this view anymore");e.navToLocString(v)}catch(t){console.error(t),r.notify("".concat(t))}},href:"#"},b))}))))}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;try{e?e.navToLocString(t):n.notify("No view associated with this feature detail panel anymore","warning")}catch(r){console.error(r),n.notify("".concat(r))}},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(E.FeatureDetails,Object.assign({},e,{omit:b,feature:a,formatter:function(e,a){return"next_segment_position"===a?c.a.createElement(j,{model:t,locString:e}):c.a.createElement(O,{value:e})}})),n?c.a.createElement(w,{model:t,tag:n}):null,c.a.createElement(y,Object.assign({feature:a},e)))}))}});
//# sourceMappingURL=37.67b1db759ea9fbaf17d9.worker.js.map