"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[6524],{6524:function(e,n,t){t.r(n);var r=t(96234),a=t(33028),i=t(30969),o=t(22714),c=t(75617),s=t(93717),l=t(24684),u=t(80975),d=t(24940),p=t(51526),f=t(90550),m=t(81073),h=t(34760),g=t.n(h),v=t(47762),j=t(99703),x=t(37574),S=(0,o.Z)((function(){return{compact:{paddingRight:0,paddingTop:0,paddingBottom:0}}})),w=["clipPos","flags"];function y(e){var n=S(),t=e.feature.flags;return(0,x.jsxs)(v.BaseCard,(0,a.Z)((0,a.Z)({},e),{},{title:"Flags",children:[(0,x.jsx)(v.SimpleValue,{name:"Flag",value:t}),(0,x.jsx)(c.Z,{children:["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,r){var a=t&1<<r,i="".concat(e,"_").concat(a);return(0,x.jsx)(s.Z,{control:(0,x.jsx)(l.Z,{className:n.compact,checked:Boolean(a),name:e,readOnly:!0}),label:e},i)}))})]}))}function Z(e){var n=e.value,t=(0,i.useState)(!1),a=(0,r.Z)(t,2),o=a[0],c=a[1],s=String(n);return s.length>100?(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("button",{type:"button",onClick:function(){return g()(s)},children:"Copy"}),(0,x.jsx)("button",{type:"button",onClick:function(){return c((function(e){return!e}))},children:o?"Show less":"Show more"}),(0,x.jsx)("div",{children:o?s:"".concat(s.slice(0,100),"...")})]}):(0,x.jsx)("div",{children:s})}function b(e){var n=e.tag,t=e.model,i=(0,m.getSession)(t);return(0,x.jsxs)(v.BaseCard,(0,a.Z)((0,a.Z)({},e),{},{title:"Supplementary alignments",children:[(0,x.jsx)(u.Z,{children:"List of supplementary alignment locations"}),(0,x.jsx)("ul",{children:n.split(";").filter((function(e){return!!e})).map((function(e,n){var a=e.split(","),o=(0,r.Z)(a,4),c=o[0],s=o[1],l=o[2],u=function(e){for(var n=(0,j.parseCigar)(e),t=0,r=0;r<n.length;r+=2){var a=+n[r],i=n[r+1];"H"!==i&&"S"!==i&&"I"!==i&&(t+=a)}return t}(o[3]),p=Math.floor(u/5),f=+s,m=+s+u,h="".concat(c,":").concat(Math.max(1,f-p),"-").concat(m+p),g=f.toLocaleString("en-US"),v=m.toLocaleString("en-US"),S="".concat(c,":").concat(g,"-").concat(v," (").concat(l,")");return(0,x.jsx)("li",{children:(0,x.jsx)(d.Z,{onClick:function(e){e.preventDefault();var n=t.view;try{if(!n)throw new Error("No view associated with this view anymore");n.navToLocString(h)}catch(r){console.error(r),i.notify("".concat(r))}},href:"#",children:S})},"".concat(h,"-").concat(n))}))})]}))}function C(e){var n=e.locString,t=e.model,r=(0,m.getSession)(t);return(0,x.jsx)(d.Z,{onClick:function(){var e=t.view;try{e?e.navToLocString(n):r.notify("No view associated with this feature detail panel anymore","warning")}catch(a){console.error(a),r.notify("".concat(a))}},href:"#",children:n})}n.default=(0,f.observer)((function(e){var n=e.model,t=JSON.parse(JSON.stringify(n.featureData)),r=t.tags&&t.tags.SA||t.SA;return(0,x.jsxs)(p.Z,{"data-testid":"alignment-side-drawer",children:[(0,x.jsx)(v.FeatureDetails,(0,a.Z)((0,a.Z)({},e),{},{omit:w,feature:t,formatter:function(e,t){return"next_segment_position"===t?(0,x.jsx)(C,{model:n,locString:e}):(0,x.jsx)(Z,{value:e})}})),r?(0,x.jsx)(b,{model:n,tag:r}):null,(0,x.jsx)(y,(0,a.Z)({feature:t},e))]})}))}}]);
//# sourceMappingURL=6524.45513347.chunk.js.map