"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9230],{69230:function(e,n,s){s.r(n),s.d(n,{default:function(){return f}});var t=s(29362),a=s(20699),r=s(27013),l=s(92880),o=s(45089),i=s(73161),u=s.n(i),c=s(6400),h=s(40929),m=s(41427),p=s(54599),x=s(18248);function d(e){let{disabled:n=!1,value:s,onValueChange:a,language:r,className:l}=e,[o]=(0,h.useState)(null!=r?r:"json"),{resolvedTheme:i}=(0,x.useTheme)(),u=(0,h.useRef)(),c=(0,m.Ik)();(0,h.useEffect)(()=>{c&&u.current&&c.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[],enableSchemaRequest:!0,comments:"ignore"})},[c]);let d=(0,p.Z)(e=>{requestAnimationFrame(()=>a(e))},500);return(0,t.jsx)(m.ZP,{language:o,theme:"dark"===i?"vs-dark":"light",value:s,onChange:d,onMount:(e,n)=>{u.current=e,n.languages.json.jsonDefaults.setDiagnosticsOptions({comments:"ignore"})},className:l,options:{lineNumbersMinChars:6,readOnly:n,minimap:{enabled:!1},contextmenu:!1,fontSize:16,fontWeight:"500"}})}var g=s(19869),f=e=>{let{open:n,onOpenChange:s,onConfirm:i}=e,[m,p]=(0,h.useState)(""),x=(0,h.useMemo)(()=>{try{if(!m)return g.o;let e=u().parse(m);if((0,c.Z)(e))return e;return g.o}catch(e){return g.o}},[m]);return(0,t.jsx)(a.Vq,{modal:!0,open:n,onOpenChange:s,children:(0,t.jsxs)(a.cZ,{onClose:()=>s(!1),children:[(0,t.jsx)(a.fK,{children:(0,t.jsx)(a.$N,{children:(0,t.jsx)(r.X6,{size:"h2",children:"Import Workflow"})})}),(0,t.jsx)(l.Z,{}),(0,t.jsx)(a.Be,{className:"px-3 pt-1 pb-3 grid gap-y-1.5 h-[400px] overflow-y-auto",children:(0,t.jsx)(d,{value:m,onValueChange:e=>p(e)})}),(0,t.jsx)(l.Z,{}),(0,t.jsxs)(a.cN,{className:"gap-x-4",children:[(0,t.jsx)(o.z,{type:"button",className:"min-w-[92px] px-[24px]",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),(0,t.jsx)(o.z,{type:"button",className:"min-w-[92px] px-[24px]",disabled:!m,onClick:()=>{m&&i(x)},children:"Confirm"})]})]})})}}}]);