import{k as u,l as m,f as p,j as e,E as d,G as h,p as x,m as F,g as f,aS as S,az as j,ax as k,a9 as t}from"./app-BgLa5dit.js";import{u as y}from"./B_g5BN6j.chunk.js";import{Q as v}from"./CWs2EUPM.chunk.js";import"./BE59vaMU.chunk.js";import"./KIVqng-q.chunk.js";function b(s){return e.jsxs(j,{children:[e.jsx(k,{name:"name",id:"name",placeholder:"e.g. Steven's Fave Ingestion Filter",label:"Name",showRequiredStar:!0}),e.jsxs("p",{children:[e.jsx("strong",{children:"Note:"})," Views can be accessed by other staff with access to Curation Studio."]}),e.jsxs(t,{children:[e.jsx(t.Cancel,{onClick:s.closePopup}),e.jsx(t.Submit,{variant:"dark",text:"Save view"})]})]})}function C(s){const l=u(),a=m(),o=y(s.queryParams,s.stage),{appLink:i}=p.getCurrentRoute();function n({name:r}){l(x.createQuickFilter(r,s.stage,F.serializeFilterRequestBody(o))).then(c=>{a.success(`Successfully created quick filter: ${c.name}`),f.trigger({...i,params:{...S.pick(i.params,["presentationId","limit","query","cursor"]),quickFilter:c.id}})}).catch(()=>a.error(`Failed to create quick filter: ${r}. Please try again.`)).finally(s.closePopup)}return e.jsx(d,{title:"Save view",closePopup:s.closePopup,backdrop:"static",children:e.jsx(h,{initialValues:{name:""},validationSchema:v,onSubmit:n,children:e.jsx(b,{closePopup:s.closePopup})})})}export{C as SaveQuickFilterView};
//# sourceMappingURL=7j3gA9bL.chunk.js.map
