"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[2412],{92412:(e,t,s)=>{s.r(t),s.d(t,{default:()=>j});var r=s(7552),l=s(49823),n=s(43283),i=s(29499),a=s(1343),o=s(58507),c=s(5401),d=s(68446),h=s(75785),u=s(69500);const x=(0,h.n9)()({dialogContent:{width:"80em"},textAreaFont:{fontFamily:"Courier New"},error:{color:"red",fontSize:"0.8em"}}),j=(0,d.observer)((function({model:e,handleClose:t}){const{classes:s}=x(),{activeFilters:d}=e,[h,j]=(0,r.useState)(d.join("\n")),[m,p]=(0,r.useState)();return(0,r.useEffect)((()=>{try{h.split("\n").map((e=>e.trim())).filter((e=>!!e)).map((e=>{var t;t=e.trim(),(0,n.A)(t)})),p(void 0)}catch(e){console.error(e),p(e)}}),[h]),(0,u.jsxs)(l.Dialog,{maxWidth:"xl",open:!0,onClose:t,title:"Add track filters",children:[(0,u.jsxs)(i.A,{children:[(0,u.jsxs)("div",{children:["Add filters, in jexl format, one per line, starting with the string jexl:. Examples:"," ",(0,u.jsxs)("ul",{children:[(0,u.jsxs)("li",{children:[(0,u.jsx)("code",{children:"jexl:get(feature,'name')=='BRCA1'"})," - show only feature where the name attribute is BRCA1"]}),(0,u.jsxs)("li",{children:[(0,u.jsx)("code",{children:"jexl:get(feature,'type')=='gene'"})," - show only gene type features in a GFF that has many other feature types"]}),(0,u.jsxs)("li",{children:[(0,u.jsx)("code",{children:"jexl:get(feature,'score') > 400"})," - show only features that have a score greater than 400"]})]})]}),m?(0,u.jsx)("p",{className:s.error,children:`${m}`}):null,(0,u.jsx)(a.A,{variant:"outlined",multiline:!0,minRows:5,maxRows:10,className:s.dialogContent,fullWidth:!0,value:h,onChange:e=>{j(e.target.value)},slotProps:{input:{classes:{input:s.textAreaFont}}}})]}),(0,u.jsxs)(o.A,{children:[(0,u.jsx)(c.A,{variant:"contained",color:"primary",type:"submit",autoFocus:!0,disabled:!!m,onClick:()=>{e.setJexlFilters(h.split("\n")),t()},children:"Submit"}),(0,u.jsx)(c.A,{variant:"contained",color:"secondary",onClick:()=>{t()},children:"Cancel"})]})]})}))}}]);
//# sourceMappingURL=2412.41f4de31.chunk.js.map