"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[7998,5471],{66935:function(e,t,n){n.r(t);var r=n(32723),a=n(34795),c=n(96234),o=n(33028),i=n(96902),s=n(52),l=n(80367),u=n(32114),d=n(35388),p=n(63348),f=n(6880),h=n(91188),m=n(4782),v=n(97531),x=n(21051),g=n.n(x),Z=n(73636),j=n.n(Z),w=n(58941),S=n(24793),b=n(29938),k=(0,h.ZL)()({compact:{paddingRight:0,paddingTop:0,paddingBottom:0}}),y=["clipPos","flags"];function C(e){var t=k().classes,n=e.feature.flags;return(0,b.jsxs)(w.BaseCard,(0,o.Z)((0,o.Z)({},e),{},{title:"Flags",children:[(0,b.jsx)(w.SimpleValue,{name:"Flag",value:n}),(0,b.jsx)(s.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=n&1<<r,c="".concat(e,"_").concat(a);return(0,b.jsx)(l.Z,{control:(0,b.jsx)(u.Z,{className:t.compact,checked:Boolean(a),name:e,readOnly:!0}),label:e},c)}))})]}))}function L(e){var t=e.value,n=(0,i.useState)(!1),r=(0,c.Z)(n,2),a=r[0],o=r[1],s=(0,i.useState)(!1),l=(0,c.Z)(s,2),u=l[0],d=l[1],p=String(t);return p.length>100?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("button",{type:"button",onClick:function(){g()(p),d(!0),setTimeout((function(){d(!1)}),700)},children:u?"Copied to clipboard":"Copy"}),(0,b.jsx)("button",{type:"button",onClick:function(){return o((function(e){return!e}))},children:a?"Show less":"Show more"}),(0,b.jsx)("div",{children:a?p:"".concat(p.slice(0,100),"...")})]}):(0,b.jsx)("div",{children:p})}function _(e){var t=e.tag,n=e.model,i=(0,v.getSession)(n);return(0,b.jsxs)(w.BaseCard,(0,o.Z)((0,o.Z)({},e),{},{title:"Supplementary alignments",children:[(0,b.jsx)(d.Z,{children:"List of supplementary alignment locations"}),(0,b.jsx)("ul",{children:t.split(";").filter((function(e){return!!e})).map((function(e,t){var o=e.split(","),s=(0,c.Z)(o,4),l=s[0],u=s[1],d=s[2],f=function(e){for(var t=(0,S.parseCigar)(e),n=0,r=0;r<t.length;r+=2){var a=+t[r],c=t[r+1];"H"!==c&&"S"!==c&&"I"!==c&&(n+=a)}return n}(s[3]),h=Math.floor(f/5),m=+u,v=+u+f,x="".concat(l,":").concat(Math.max(1,m-h),"-").concat(v+h),g=m.toLocaleString("en-US"),Z=v.toLocaleString("en-US"),j="".concat(l,":").concat(g,"-").concat(Z," (").concat(d,")");return(0,b.jsx)("li",{children:(0,b.jsx)(p.Z,{onClick:function(){var e=(0,a.Z)((0,r.Z)().mark((function e(t){var a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),a=n.view,e.prev=2,!a){e.next=8;break}return e.next=6,a.navToLocString(x);case 6:e.next=9;break;case 8:throw new Error("No view associated with this view anymore");case 9:e.next=15;break;case 11:e.prev=11,e.t0=e.catch(2),console.error(e.t0),i.notify("".concat(e.t0));case 15:case"end":return e.stop()}}),e,null,[[2,11]])})));return function(t){return e.apply(this,arguments)}}(),href:"#",children:j})},"".concat(x,"-").concat(t))}))})]}))}function B(e){var t=e.locString,n=e.model,c=(0,v.getSession)(n);return(0,b.jsx)(p.Z,{onClick:(0,a.Z)((0,r.Z)().mark((function e(){var a;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.view){e.next=3;break}throw new Error("No view associated with this feature detail panel anymore");case 3:return e.prev=3,e.next=6,a.navToLocString(t);case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(3),console.error(e.t0),c.notify("".concat(e.t0));case 12:case"end":return e.stop()}}),e,null,[[3,8]])}))),href:"#",children:t})}t.default=(0,m.observer)((function(e){var t=e.model,n=j()(t.featureData),r=n.tags&&n.tags.SA||n.SA;return(0,b.jsxs)(f.Z,{"data-testid":"alignment-side-drawer",children:[(0,b.jsx)(w.FeatureDetails,(0,o.Z)((0,o.Z)({},e),{},{omit:y,feature:n,formatter:function(e,n){return"next_segment_position"===n?(0,b.jsx)(B,{model:t,locString:e}):(0,b.jsx)(L,{value:e})}})),r?(0,b.jsx)(_,{model:t,tag:r}):null,void 0!==n.flags?(0,b.jsx)(C,(0,o.Z)({feature:n},e)):null]})}))},25471:function(e,t,n){var r=n(71600);t.Z=void 0;var a=r(n(7152)),c=n(29938),o=(0,a.default)((0,c.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z"}),"Settings");t.Z=o}}]);
//# sourceMappingURL=7998.bb536a91.chunk.js.map