import{j as n,_ as b}from"./main.2.9.0.js";import{b as m}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{F as v}from"./Integrations.DL8wqGct.js";import{u as N}from"./Note.NSUdvR3c.js";import"./react-vendor.P7K3d6op.js";import"./SnackMsg.DYSD96P4.js";import"./Table.BfF8RYFZ.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};
