"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[3459],{43459:(s,n,i)=>{i.r(n),i.d(n,{default:()=>x});var e=i(32761),o=i(68446),r=i(7552),a=i(59773),t=i(67112),l=i(76218),c=i(28194),h=i(69092),d=i(30698),u=i(69500);function g({onConfirm:s,onCancel:n,reason:i}){const[e,o]=(0,r.useState)(!1);return(0,u.jsxs)(t.Dialog,{open:!0,maxWidth:"xl",title:"Warning",onClose:n,children:[(0,u.jsx)(l.A,{children:(0,u.jsxs)(c.A,{severity:"warning",style:{width:800},children:["This link contains a cross origin config that has the following unknown plugins:",(0,u.jsx)("ul",{children:i.map((s=>(0,u.jsxs)("li",{children:[(0,a.lc)(s)," - (",(0,a.Hm)(s),")"]},JSON.stringify(s))))}),"Please ensure you trust the source of this link."," ",(0,u.jsx)(h.A,{onClick:()=>{o(!e)},children:"Why am I seeing this?"}),e?(0,u.jsx)("div",{children:"Config files can load arbitrary javascript files via plugins. For security purposes, we display this message when a cross-origin config is detected to be loading plugins that are not in our plugin store"}):null]})}),(0,u.jsxs)(d.A,{children:[(0,u.jsx)(h.A,{color:"primary",variant:"contained",onClick:()=>{s()},children:"Yes, I trust it"}),(0,u.jsx)(h.A,{color:"secondary",variant:"contained",onClick:()=>{n()},children:"Cancel"})]})]})}function p({onConfirm:s,onCancel:n,reason:i}){const[e,o]=(0,r.useState)(!1);return(0,u.jsxs)(t.Dialog,{open:!0,maxWidth:"xl",title:"Warning",onClose:n,children:[(0,u.jsx)(l.A,{children:(0,u.jsxs)(c.A,{severity:"warning",style:{width:800},children:["This link contains a session that has the following unknown plugins:",(0,u.jsx)("ul",{children:i.map((s=>(0,u.jsxs)("li",{children:[(0,a.lc)(s)," - (",(0,a.Hm)(s),")"]},JSON.stringify(s))))}),"Please ensure you trust the source of this session.",(0,u.jsx)(h.A,{onClick:()=>{o(!e)},children:"Why am I seeing this?"}),e?(0,u.jsx)("div",{children:"Sessions can load arbitrary javascript files via session plugins. For security purposes, we display this message when sessions contain plugins that are not from our plugin store"}):null]})}),(0,u.jsxs)(d.A,{children:[(0,u.jsx)(h.A,{color:"primary",variant:"contained",onClick:()=>{s()},children:"Yes, I trust it"}),(0,u.jsx)(h.A,{variant:"contained",color:"secondary",onClick:()=>{n()},children:"Cancel"})]})]})}var j=i(55252);const x=(0,o.observer)((function({sessionTriaged:s,loader:n}){return"session"===s.origin?(0,u.jsx)(p,{onConfirm:async()=>{const i=JSON.parse(JSON.stringify(s.snap));await n.setSessionSnapshot({...i,id:(0,e.Ak)()},!0),n.setSessionTriaged(void 0)},onCancel:()=>{n.setBlankSession(!0),n.setSessionTriaged(void 0)},reason:s.reason}):(0,u.jsx)(g,{onConfirm:async()=>{const i=JSON.parse(JSON.stringify(s.snap));await n.fetchPlugins(i),n.setConfigSnapshot({...i,id:(0,e.Ak)()}),n.setSessionTriaged(void 0)},onCancel:async()=>{await(0,j.A)(),n.setSessionTriaged(void 0)},reason:s.reason})}))}}]);
//# sourceMappingURL=3459.9bc79fe1.chunk.js.map