"use strict";(self.webpackChunk_jbrowse_web=self.webpackChunk_jbrowse_web||[]).push([[7447],{7447:function(e,n,a){a.r(n);var t=a(56666),i=a(96234),l=a(30969),o=a(90550),s=a(59767),r=a(59071),u=a(72807),d=a(87006),c=a(6698),h=a(96074),f=a(72097),g=a(53276),b=a(81073),m=a(94551),x=a(23038),j=a(37574),v=(0,g.ZL)()((function(e){return{dialogContent:{display:"flex",flexDirection:"column"},expand:{transform:"rotate(0deg)",marginLeft:"auto",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest})},expandOpen:{transform:"rotate(180deg)"}}})),Z=(0,o.observer)((function(e){var n=e.onClose,a=e.model,o=v(),g=o.classes,Z=o.cx,p=(0,l.useState)(""),C=(0,i.Z)(p,2),S=C[0],w=C[1],U=(0,l.useState)(""),k=(0,i.Z)(U,2),L=k[0],y=k[1],P=(0,l.useState)(""),R=(0,i.Z)(P,2),N=R[0],_=R[1],A=(0,l.useState)(""),D=(0,i.Z)(A,2),J=D[0],E=D[1],I=(0,l.useState)(!1),M=(0,i.Z)(I,2),O=M[0],T=M[1],B=(0,b.getSession)(a).jbrowse,q=Boolean(S&&L||N||J);function z(){S&&L?B.addPlugin({name:S,umdUrl:L}):N?B.addPlugin({esmUrl:N}):J&&B.addPlugin({cjsUrl:J})}return(0,j.jsx)(s.Dialog,{open:!0,onClose:n,title:"Add custom plugin",children:(0,j.jsxs)("form",{onSubmit:z,children:[(0,j.jsxs)(r.Z,{className:g.dialogContent,children:[(0,j.jsx)(u.Z,{children:"Enter the name of the plugin and its URL. The name should match what is defined in the plugin's build."}),(0,j.jsx)(d.Z,{label:"Plugin name",variant:"outlined",value:S,onChange:function(e){return w(e.target.value)}}),(0,j.jsx)(d.Z,{label:"Plugin URL",variant:"outlined",value:L,onChange:function(e){return y(e.target.value)}}),(0,j.jsxs)(u.Z,{onClick:function(){return T(!O)},children:[(0,j.jsx)(m.Z,{className:Z(g.expand,(0,t.Z)({},g.expandOpen,O)),"aria-expanded":O,"aria-label":"show more",children:(0,j.jsx)(x.Z,{})}),"Advanced options"]}),(0,j.jsx)(c.Z,{in:O,children:(0,j.jsxs)("div",{className:g.dialogContent,children:[(0,j.jsx)(u.Z,{children:"The above fields assume that the plugin is built in UMD format. If your plugin is in another format, or you have additional builds you want to add (such as a CJS build for using NodeJS APIs in desktop), you can enter the URLs for those builds below."}),(0,j.jsx)(d.Z,{label:"ESM build URL",variant:"outlined",value:N,onChange:function(e){return _(e.target.value)}}),(0,j.jsx)(d.Z,{label:"CJS build URL",variant:"outlined",value:J,onChange:function(e){return E(e.target.value)}})]})})]}),(0,j.jsxs)(h.Z,{children:[(0,j.jsx)(f.Z,{variant:"contained",onClick:n,children:"Cancel"}),(0,j.jsx)(f.Z,{variant:"contained",color:"primary",onClick:z,disabled:!q,children:"Submit"})]})]})})}));n.default=Z}}]);
//# sourceMappingURL=7447.d380a115.chunk.js.map