const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./C3_qgsss.js","./B-6m3w3Q.js","./entry.BNvRGC7P.css","./Dhm-f3w4.js","./BSbBT4Mj.js","./editor.d-_yvVgq.css","./monaco-setup.COQM9i0P.css"])))=>i.map(i=>d[i]);
import{$n as e,An as t,Dn as n,En as r,Fn as i,In as a,Ln as o,Nn as s,Rt as c,Wn as l,Xn as u,Zt as d,ar as f,cr as p,d as m,on as h,pn as g,qn as _,wn as v,zn as y}from"./B-6m3w3Q.js";var b={class:`flex flex-col gap-2`},x={class:`flex items-center justify-end gap-3 text-xs`},S={key:0,class:`flex cursor-pointer items-center gap-1`},C={key:1,class:`badge badge-ghost badge-sm`},w=s({__name:`MonacoYamlEditor.client`,props:{modelValue:{},readOnly:{type:Boolean,default:!1},language:{default:`yaml`}},emits:[`update:modelValue`],setup(s,{emit:w}){let T=s,E=w,{t:D}=c(),O=m(),k=d(),A=e(),j=e(!1),M=null,N=null,P=null;function F(){if(typeof document<`u`){let e=getComputedStyle(document.documentElement).colorScheme;if(e.includes(`dark`))return`vs-dark`;if(e.includes(`light`))return`vs`}return k.value?`vs-dark`:`vs`}return o(async()=>{M=(await h(()=>import(`./C3_qgsss.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ensureMonacoYaml();let e=T.language===`javascript`,t=M.Uri.parse(e?`inmemory://profile/script.js`:`inmemory://profile/config.yaml`);P=M.editor.getModel(t)??M.editor.createModel(T.modelValue,e?`javascript`:`yaml`,t),P.setValue(T.modelValue),N=M.editor.create(A.value,{model:P,theme:F(),readOnly:T.readOnly,automaticLayout:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,tabSize:2}),N.onDidChangeModelContent(()=>{E(`update:modelValue`,N.getValue())})}),a(()=>{N?.dispose(),P?.dispose(),N=null,P=null}),l(()=>T.modelValue,e=>{P&&e!==P.getValue()&&P.setValue(e)}),l(()=>T.readOnly,e=>N?.updateOptions({readOnly:e})),l([()=>O.curTheme,k],async()=>{await i(),M?.editor.setTheme(F())}),l(j,e=>{!M||!P||T.language!==`yaml`||M.editor.setModelLanguage(P,e?`plaintext`:`yaml`)}),(e,i)=>(y(),n(`div`,b,[v(`div`,x,[s.language===`yaml`?(y(),n(`label`,S,[_(v(`input`,{"onUpdate:modelValue":i[0]||=e=>u(j)?j.value=e:null,type:`checkbox`,class:`toggle toggle-xs`},null,512),[[g,f(j)]]),t(` `+p(f(D)(`editorDisableValidation`)),1)])):r(``,!0),s.readOnly?(y(),n(`span`,C,p(f(D)(`editorReadOnly`)),1)):r(``,!0)]),v(`div`,{ref_key:`container`,ref:A,class:`h-[60vh] w-full overflow-hidden rounded-lg border border-base-content/10`},null,512)]))}}),T=Object.assign(w,{__name:`MonacoYamlEditor`});export{T as default};