import{j as n,_ as b}from"./main.2.8.10.js";import{b as m}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{F as v}from"./Integrations.BFhED4ck.js";import{u as N}from"./Note.DalStCGz.js";import"./react-vendor.P7K3d6op.js";import"./SnackMsg.7BjcJK1j.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";const _=({customActionConf:e,setCustomActionConf:d,formFields:o,isInfo:u})=>{const a=m.useRef(null);m.useEffect(()=>()=>{a.current=null},[]);const g=l=>{d(t=>N(t,s=>{s.value=l,s.isValid=!1})),a.current&&h(),a.current=""};function p(l){return o.map(t=>({label:t.label,kind:monaco.languages.CompletionItemKind.Function,insertText:`'${t.name}'`,range:l}))}const c=(l,t)=>{a.current=t},h=(l,t)=>{a.current.languages.registerCompletionItemProvider("php",{provideCompletionItems:function(s,r){if(!s.getValueInRange({startLineNumber:r.lineNumber,startColumn:r.column-10,endLineNumber:r.lineNumber,endColumn:r.column}).match(/\$trigger\[?/))return{suggestions:[]};const i=s.getWordUntilPosition(r),x={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:i.startColumn,endColumn:i.endColumn};return{suggestions:p(x)}}})};return n.jsx("div",{className:"flx ",children:u?n.jsxs("div",{children:[n.jsx("div",{className:"mt-3",style:{width:"1500px"},children:n.jsx("b",{children:b("Custom Action:","bit-integrations")})}),n.jsx("textarea",{className:"btcd-paper-inp w-6 mt-1",style:{resize:"none"},rows:"20",value:e.value,type:"text",disabled:u})]}):n.jsx(v,{width:"100%",className:"monaco-editor",height:"50vh",theme:"vs-dark",defaultLanguage:"php",defaultValue:e==null?void 0:e.defaultValue,value:e==null?void 0:e.value,onChange:g,onMount:c})})};export{_ as default};
