"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../@babel/runtime/helpers/esm/extends.js"),t=require("../../../@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"),i=require("react"),r=require("./useCodeMirror.js"),a=require("react/jsx-runtime"),o=require("./theme/light.js"),n=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],s=i.forwardRef((o,s)=>{var{className:h,value:l="",selection:d,extensions:u=[],onChange:m,onStatistics:c,onCreateEditor:p,onUpdate:g,autoFocus:x,theme:b="light",height:f,minHeight:C,maxHeight:v,width:W,minWidth:y,maxWidth:S,basicSetup:j,placeholder:w,indentWithTab:H,editable:q,readOnly:E,root:M,initialState:O}=o,T=t.default(o,n),N=i.useRef(null),{state:F,view:L,container:U,setContainer:P}=r.useCodeMirror({root:M,value:l,autoFocus:x,theme:b,height:f,minHeight:C,maxHeight:v,width:W,minWidth:y,maxWidth:S,basicSetup:j,placeholder:w,indentWithTab:H,editable:q,readOnly:E,selection:d,onChange:m,onStatistics:c,onCreateEditor:p,onUpdate:g,extensions:u,initialState:O});i.useImperativeHandle(s,()=>({editor:N.current,state:F,view:L}),[N,U,F,L]);var R=i.useCallback(e=>{N.current=e,P(e)},[P]);if("string"!=typeof l)throw new Error("value must be typeof string but got "+typeof l);var _="string"==typeof b?"cm-theme-"+b:"cm-theme";return a.jsx("div",e.default({ref:R,className:_+(h?" "+h:"")},T))});s.displayName="CodeMirror",exports.ExternalChange=r.ExternalChange,exports.useCodeMirror=r.useCodeMirror,exports.defaultLightThemeOption=o.defaultLightThemeOption,exports.default=s;
//# sourceMappingURL=index.js.map
