comparison x/static/js/3425.be85a6ad.chunk.js @ 125:49f3d3878413 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author fubar
date Sat, 05 Oct 2024 23:58:05 +0000
parents
children
comparison
equal deleted inserted replaced
124:137e08517410 125:49f3d3878413
1 "use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[3425],{23425:(e,t,a)=>{a.r(t),a.d(t,{default:()=>k});var n=a(7552),r=a(68446),o=a(99546),s=a(92516),i=a(49823),c=a(29499),l=a(63011),d=a(41578),m=a(36715),p=a(63165),u=a(1343),h=a(58507),f=a(5401),A=a(99834),b=a(75785),y=a(550),x=a(7720),w=a(84495),g=a(32984);const v=(0,b.n9)()((e=>({expandIcon:{color:e.palette.tertiary.contrastText||"#fff"},minWidth:{minWidth:500}}))),k=(0,r.observer)((function({onClose:e,model:t}){const{classes:a}=v(),[r,b]=(0,n.useState)(),[k,S]=(0,n.useState)(),[E,C]=(0,n.useState)(""),I=(0,o.getSession)(t),{assemblyNames:N}=I,[R,W]=(0,n.useState)(N[0]),[M,j]=(0,n.useState)("shareLinkAccordion");return n.createElement(i.Dialog,{open:!0,onClose:e,maxWidth:"xl",title:"Import bookmarks"},n.createElement(c.A,{className:a.minWidth},n.createElement(l.A,{expanded:"shareLinkAccordion"===M,onChange:()=>{j("shareLinkAccordion")}},n.createElement(d.A,{expandIcon:n.createElement(x.A,{className:a.expandIcon})},n.createElement(m.A,{style:{display:"flex",alignItems:"center",gap:"5px"}},"Import from share link")),n.createElement(p.A,null,n.createElement(m.A,null,"Paste a bookmark share link generated by the 'Share' button from the bookmarks widget"),n.createElement(u.A,{label:"Enter Share URL",variant:"outlined",fullWidth:!0,value:E,onChange:e=>{C(e.target.value)}}))),n.createElement(l.A,{expanded:"fileAccordion"===M,onChange:()=>{j("fileAccordion")}},n.createElement(d.A,{expandIcon:n.createElement(x.A,{className:a.expandIcon})},n.createElement(m.A,null,"Import from file")),n.createElement(p.A,null,n.createElement(i.FileSelector,{location:r,setLocation:b,name:"File",description:'Choose a BED or TSV format file to import. Required TSV column headers are "chrom, start, end, label, assembly_name".'}),n.createElement(i.AssemblySelector,{onChange:e=>{W(e)},helperText:"Select the assembly for BED file.",session:I,selected:R}))),k?n.createElement(i.ErrorMessage,{error:k}):null),n.createElement(h.A,null,n.createElement(f.A,{variant:"contained",color:"secondary",onClick:e},"Cancel"),n.createElement(f.A,{"data-testid":"dialogImport",variant:"contained",color:"primary",disabled:!r&&!E,startIcon:n.createElement(y.A,null),onClick:async()=>{try{if("fileAccordion"===M&&r){const e=(await(0,A.openLocation)(r).readFile("utf8")).split(/\n|\r\n|\r/).filter((e=>!!e.trim()));"BED"==((a=e[0]).startsWith("chrom")&&a.includes("assembly_name")?"TSV":"BED")?t.importBookmarks(await async function(e,t){return e.filter((e=>!e.startsWith("#"))).map((e=>{const[a,n,r,o]=e.split("\t");return{assemblyName:t,refName:a,start:+n,end:+r,label:"."===o?void 0:o}}))}(e,R)):t.importBookmarks(await async function(e){return e[0].startsWith("chrom")&&(e=e.slice(1)),e.filter((e=>!e.startsWith("#"))).map((e=>{const[t,a,n,r,o]=e.split("\t");return{assemblyName:o,refName:t,start:+a,end:+n,label:"."===r?void 0:r}}))}(e))}else"shareLinkAccordion"===M&&E&&(0,s.xv)(I)&&t.importBookmarks(await async function(e,t){const a=new URL(e),n=a.searchParams.get("bookmarks"),r=a.searchParams.get("password"),o=await(0,g.Z)(`${t??"https://share.jbrowse.org/api/v1/"}load`,n||"",r||"");return JSON.parse(await(0,w.LP)(o)).sharedBookmarks}(E,I.shareURL));e()}catch(e){console.error(e),S(e)}var a}},"Import")))}))},32984:(e,t,a)=>{a.d(t,{J:()=>i,Z:()=>c});var n=a(84495);const r=async(e,t)=>(await Promise.all([a.e(7753),a.e(9831),a.e(5156)]).then(a.t.bind(a,29831,23))).encrypt(e,t).toString(),o=async(e,t)=>{const n=await Promise.all([a.e(7753),a.e(9831),a.e(5156)]).then(a.t.bind(a,29831,23)),r=await Promise.all([a.e(7753),a.e(6235)]).then(a.t.bind(a,12598,23));return n.decrypt(e,t).toString(r)};function s(e){try{return JSON.parse(e).message}catch(t){return e}}async function i(e,t,a){const o=await(0,n.eW)(JSON.stringify(e)),i=window.btoa([...window.crypto.getRandomValues(new Uint8Array(10))].map((e=>String.fromCharCode(e))).join("")).replaceAll(/[+/]/g,"").slice(0,5);const c=await r(o,i),l=new FormData;l.append("session",c),l.append("dateShared",`${Date.now()}`),l.append("referer",a);const d=await fetch(`${t}share`,{method:"POST",mode:"cors",body:l});if(!d.ok){const e=await d.text();throw new Error(s(e))}return{json:await d.json(),encryptedSession:c,password:i}}async function c(e,t,a,n){const r=t.split("share-")[1],i=`${e}?sessionId=${encodeURIComponent(r)}`,c=await fetch(i,{signal:n});if(!c.ok){const e=await c.text();throw new Error(s(e))}const l=await c.json();return o(l.session,a)}},7720:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(74893),r=a(69500);const o=(0,n.A)((0,r.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore")},63165:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(7552),r=a(93878),o=a(70799),s=a(51148),i=a(60129),c=a(4785),l=a(79509),d=a(69500);const m=(0,s.Ay)("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})((0,i.A)((({theme:e})=>({padding:e.spacing(1,2,2)})))),p=n.forwardRef((function(e,t){const a=(0,c.b)({props:e,name:"MuiAccordionDetails"}),{className:n,...s}=a,i=a,p=(e=>{const{classes:t}=e;return(0,o.A)({root:["root"]},l.n,t)})(i);return(0,d.jsx)(m,{className:(0,r.A)(p.root,n),ref:t,ownerState:i,...s})}))},79509:(e,t,a)=>{a.d(t,{A:()=>s,n:()=>o});var n=a(33761),r=a(85693);function o(e){return(0,r.Ay)("MuiAccordionDetails",e)}const s=(0,n.A)("MuiAccordionDetails",["root"])},41578:(e,t,a)=>{a.d(t,{A:()=>x});var n=a(7552),r=a(93878),o=a(70799),s=a(51148),i=a(60129),c=a(4785),l=a(48054),d=a(51132),m=a(33761),p=a(85693);function u(e){return(0,p.Ay)("MuiAccordionSummary",e)}const h=(0,m.A)("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]);var f=a(69500);const A=(0,s.Ay)(l.A,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})((0,i.A)((({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${h.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${h.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${h.disabled})`]:{cursor:"pointer"},variants:[{props:e=>!e.disableGutters,style:{[`&.${h.expanded}`]:{minHeight:64}}}]}}))),b=(0,s.Ay)("div",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})((0,i.A)((({theme:e})=>({display:"flex",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${h.expanded}`]:{margin:"20px 0"}}}]})))),y=(0,s.Ay)("div",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})((0,i.A)((({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${h.expanded}`]:{transform:"rotate(180deg)"}})))),x=n.forwardRef((function(e,t){const a=(0,c.b)({props:e,name:"MuiAccordionSummary"}),{children:s,className:i,expandIcon:l,focusVisibleClassName:m,onClick:p,...h}=a,{disabled:x=!1,disableGutters:w,expanded:g,toggle:v}=n.useContext(d.A),k={...a,expanded:g,disabled:x,disableGutters:w},S=(e=>{const{classes:t,expanded:a,disabled:n,disableGutters:r}=e,s={root:["root",a&&"expanded",n&&"disabled",!r&&"gutters"],focusVisible:["focusVisible"],content:["content",a&&"expanded",!r&&"contentGutters"],expandIconWrapper:["expandIconWrapper",a&&"expanded"]};return(0,o.A)(s,u,t)})(k);return(0,f.jsxs)(A,{focusRipple:!1,disableRipple:!0,disabled:x,component:"div","aria-expanded":g,className:(0,r.A)(S.root,i),focusVisibleClassName:(0,r.A)(S.focusVisible,m),onClick:e=>{v&&v(e),p&&p(e)},ref:t,ownerState:k,...h,children:[(0,f.jsx)(b,{className:S.content,ownerState:k,children:s}),l&&(0,f.jsx)(y,{className:S.expandIconWrapper,ownerState:k,children:l})]})}))}}]);
2 //# sourceMappingURL=3425.be85a6ad.chunk.js.map