"use client";
// Workaround for react-datepicker and other cjs dependencies potentially inserting require("react") statements
import * as requireReact from 'react';
import * as requireReactDom from 'react-dom';

function require(m) {
 if (m === 'react') return requireReact;
 if (m === 'react-dom') return requireReactDom;
 throw new Error(`Unknown module ${m}`);
}
// Workaround end

import{c as Cr}from"react/compiler-runtime";import{jsx as qe}from"react/jsx-runtime";function me(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ye(t){if(Array.isArray(t))return t}function Je(t,e,r){return(e=tt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,o,i,c,u=[],a=!0,s=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(a=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);a=!0);}catch(l){s=!0,o=l}finally{try{if(!a&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(s)throw o}}return u}}function Xe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pe(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function oe(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pe(Object(r),!0).forEach(function(n){Je(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ge(t,e){if(t==null)return{};var r,n,o=Ze(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Ze(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function he(t,e){return Ye(t)||Qe(t,e)||rt(t,e)||Xe()}function et(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tt(t){var e=et(t,"string");return typeof e=="symbol"?e:e+""}function rt(t,e){if(t){if(typeof t=="string")return me(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?me(t,e):void 0}}function nt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ve(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ve(Object(r),!0).forEach(function(n){nt(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ve(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ot(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return e.reduceRight(function(o,i){return i(o)},n)}}function z(t){return function e(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=t.length?t.apply(this,o):function(){for(var c=arguments.length,u=new Array(c),a=0;a<c;a++)u[a]=arguments[a];return e.apply(r,[].concat(o,u))}}}function G(t){return{}.toString.call(t).includes("Object")}function it(t){return!Object.keys(t).length}function B(t){return typeof t=="function"}function at(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ct(t,e){return G(e)||D("changeType"),Object.keys(e).some(function(r){return!at(t,r)})&&D("changeField"),e}function ut(t){B(t)||D("selectorType")}function st(t){B(t)||G(t)||D("handlerType"),G(t)&&Object.values(t).some(function(e){return!B(e)})&&D("handlersType")}function lt(t){t||D("initialIsRequired"),G(t)||D("initialType"),it(t)&&D("initialContent")}function ft(t,e){throw new Error(t[e]||t.default)}var dt={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},D=z(ft)(dt),K={changes:ct,selector:ut,handler:st,initial:lt};function mt(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};K.initial(t),K.handler(e);var r={current:t},n=z(ht)(r,e),o=z(gt)(r),i=z(K.changes)(t),c=z(pt)(r);function u(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(l){return l};return K.selector(s),s(r.current)}function a(s){ot(n,o,i,c)(s)}return[u,a]}function pt(t,e){return B(e)?e(t.current):e}function gt(t,e){return t.current=be(be({},t.current),e),e}function ht(t,e,r){return B(e)?e(t.current):Object.keys(r).forEach(function(n){var o;return(o=e[n])===null||o===void 0?void 0:o.call(e,t.current[n])}),r}var vt={create:mt},ye=vt;var we={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Oe(t){return function e(){for(var r=this,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return o.length>=t.length?t.apply(this,o):function(){for(var c=arguments.length,u=new Array(c),a=0;a<c;a++)u[a]=arguments[a];return e.apply(r,[].concat(o,u))}}}function je(t){return{}.toString.call(t).includes("Object")}function bt(t){return t||Me("configIsRequired"),je(t)||Me("configType"),t.urls?(yt(),{paths:{vs:t.urls.monacoBase}}):t}function yt(){console.warn(Se.deprecation)}function wt(t,e){throw new Error(t[e]||t.default)}var Se={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
    You are using deprecated way of configuration.

    Instead of using
      monaco.config({ urls: { monacoBase: '...' } })
    use
      monaco.config({ paths: { vs: '...' } })

    For more please check the link https://github.com/suren-atoyan/monaco-loader#config
  `},Me=Oe(wt)(Se),xe={config:bt};var Pe=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(o){return r.reduceRight(function(i,c){return c(i)},o)}};function ie(t,e){return Object.keys(e).forEach(function(r){e[r]instanceof Object&&t[r]&&Object.assign(e[r],ie(t[r],e[r]))}),oe(oe({},t),e)}var Ot={type:"cancelation",msg:"operation is manually canceled"};function Y(t){var e=!1,r=new Promise(function(n,o){t.then(function(i){return e?o(Ot):n(i)}),t.catch(o)});return r.cancel=function(){return e=!0},r}var jt=["monaco"],Mt=ye.create({config:we,isInitialized:!1,resolve:null,reject:null,monaco:null}),Ee=he(Mt,2),V=Ee[0],J=Ee[1];function St(t){var e=xe.config(t),r=e.monaco,n=ge(e,jt);J(function(o){return{config:ie(o.config,n),monaco:r}})}function xt(){var t=V(function(e){var r=e.monaco,n=e.isInitialized,o=e.resolve;return{monaco:r,isInitialized:n,resolve:o}});if(!t.isInitialized){if(J({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),Y(ae);if(window.monaco&&window.monaco.editor)return Ce(window.monaco),t.resolve(window.monaco),Y(ae);Pe(Pt,Ct)(Tt)}return Y(ae)}function Pt(t){return document.body.appendChild(t)}function Et(t){var e=document.createElement("script");return t&&(e.src=t),e}function Ct(t){var e=V(function(n){var o=n.config,i=n.reject;return{config:o,reject:i}}),r=Et("".concat(e.config.paths.vs,"/loader.js"));return r.onload=function(){return t()},r.onerror=e.reject,r}function Tt(){var t=V(function(r){var n=r.config,o=r.resolve,i=r.reject;return{config:n,resolve:o,reject:i}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(r){var n=r.m||r;Ce(n),t.resolve(n)},function(r){t.reject(r)})}function Ce(t){V().monaco||J({monaco:t})}function At(){return V(function(t){var e=t.monaco;return e})}var ae=new Promise(function(t,e){return J({resolve:t,reject:e})}),$={config:St,init:xt,__getMonacoInstance:At};import{memo as Rt}from"react";import It,{useState as Te,useRef as W,useCallback as Ae,useEffect as Re}from"react";import{memo as Dt}from"react";import ce from"react";import _t from"react";import{useEffect as Vt}from"react";import{useEffect as Ut,useRef as qt}from"react";import{useState as mn}from"react";import{memo as Xt}from"react";import Zt,{useState as Ie,useEffect as Q,useRef as R,useCallback as er}from"react";import{useEffect as tr,useRef as rr}from"react";var Lt={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ue=Lt,$t={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Wt=$t;function kt({children:t}){return _t.createElement("div",{style:Wt.container},t)}var Nt=kt,Ht=Nt;function zt({width:t,height:e,isEditorReady:r,loading:n,_ref:o,className:i,wrapperProps:c}){return ce.createElement("section",{style:{...ue.wrapper,width:t,height:e},...c},!r&&ce.createElement(Ht,null,n),ce.createElement("div",{ref:o,style:{...ue.fullWidth,...!r&&ue.hide},className:i}))}var Bt=zt,De=Dt(Bt);function Ft(t){Vt(t,[])}var Le=Ft;function Kt(t,e,r=!0){let n=qt(!0);Ut(n.current||!r?()=>{n.current=!1}:t,e)}var S=Kt;function F(){}function k(t,e,r,n){return Gt(t,n)||Yt(t,e,r,n)}function Gt(t,e){return t.editor.getModel(_e(t,e))}function Yt(t,e,r,n){return t.editor.createModel(e,r,n?_e(t,n):void 0)}function _e(t,e){return t.Uri.parse(e)}function Jt({original:t,modified:e,language:r,originalLanguage:n,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:c,keepCurrentOriginalModel:u=!1,keepCurrentModifiedModel:a=!1,theme:s="light",loading:l="Loading...",options:d={},height:x="100%",width:w="100%",className:M,wrapperProps:E={},beforeMount:p=F,onMount:P=F}){let[y,L]=Te(!1),[A,g]=Te(!0),h=W(null),v=W(null),C=W(null),b=W(P),f=W(p),T=W(!1);Le(()=>{let m=$.init();return m.then(O=>(v.current=O)&&g(!1)).catch(O=>O?.type!=="cancelation"&&console.error("Monaco initialization: error:",O)),()=>h.current?H():m.cancel()}),S(()=>{if(h.current&&v.current){let m=h.current.getOriginalEditor(),O=k(v.current,t||"",n||r||"text",i||"");O!==m.getModel()&&m.setModel(O)}},[i],y),S(()=>{if(h.current&&v.current){let m=h.current.getModifiedEditor(),O=k(v.current,e||"",o||r||"text",c||"");O!==m.getModel()&&m.setModel(O)}},[c],y),S(()=>{let m=h.current.getModifiedEditor();m.getOption(v.current.editor.EditorOption.readOnly)?m.setValue(e||""):e!==m.getValue()&&(m.executeEdits("",[{range:m.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),m.pushUndoStop())},[e],y),S(()=>{h.current?.getModel()?.original.setValue(t||"")},[t],y),S(()=>{let{original:m,modified:O}=h.current.getModel();v.current.editor.setModelLanguage(m,n||r||"text"),v.current.editor.setModelLanguage(O,o||r||"text")},[r,n,o],y),S(()=>{v.current?.editor.setTheme(s)},[s],y),S(()=>{h.current?.updateOptions(d)},[d],y);let _=Ae(()=>{if(!v.current)return;f.current(v.current);let m=k(v.current,t||"",n||r||"text",i||""),O=k(v.current,e||"",o||r||"text",c||"");h.current?.setModel({original:m,modified:O})},[r,e,o,t,n,i,c]),q=Ae(()=>{!T.current&&C.current&&(h.current=v.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...d}),_(),v.current?.editor.setTheme(s),L(!0),T.current=!0)},[d,s,_]);Re(()=>{y&&b.current(h.current,v.current)},[y]),Re(()=>{!A&&!y&&q()},[A,y,q]);function H(){let m=h.current?.getModel();u||m?.original?.dispose(),a||m?.modified?.dispose(),h.current?.dispose()}return It.createElement(De,{width:w,height:x,isEditorReady:y,loading:l,_ref:C,className:M,wrapperProps:E})}var Qt=Jt,fn=Rt(Qt);function nr(t){let e=rr();return tr(()=>{e.current=t},[t]),e.current}var or=nr,X=new Map;function ir({defaultValue:t,defaultLanguage:e,defaultPath:r,value:n,language:o,path:i,theme:c="light",line:u,loading:a="Loading...",options:s={},overrideServices:l={},saveViewState:d=!0,keepCurrentModel:x=!1,width:w="100%",height:M="100%",className:E,wrapperProps:p={},beforeMount:P=F,onMount:y=F,onChange:L,onValidate:A=F}){let[g,h]=Ie(!1),[v,C]=Ie(!0),b=R(null),f=R(null),T=R(null),_=R(y),q=R(P),H=R(),m=R(n),O=or(i),fe=R(!1),te=R(!1);Le(()=>{let j=$.init();return j.then(I=>(b.current=I)&&C(!1)).catch(I=>I?.type!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>f.current?Ge():j.cancel()}),S(()=>{let j=k(b.current,t||n||"",e||o||"",i||r||"");j!==f.current?.getModel()&&(d&&X.set(O,f.current?.saveViewState()),f.current?.setModel(j),d&&f.current?.restoreViewState(X.get(i)))},[i],g),S(()=>{f.current?.updateOptions(s)},[s],g),S(()=>{!f.current||n===void 0||(f.current.getOption(b.current.editor.EditorOption.readOnly)?f.current.setValue(n):n!==f.current.getValue()&&(te.current=!0,f.current.executeEdits("",[{range:f.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),f.current.pushUndoStop(),te.current=!1))},[n],g),S(()=>{let j=f.current?.getModel();j&&o&&b.current?.editor.setModelLanguage(j,o)},[o],g),S(()=>{u!==void 0&&f.current?.revealLine(u)},[u],g),S(()=>{b.current?.editor.setTheme(c)},[c],g);let de=er(()=>{if(!(!T.current||!b.current)&&!fe.current){q.current(b.current);let j=i||r,I=k(b.current,n||t||"",e||o||"",j||"");f.current=b.current?.editor.create(T.current,{model:I,automaticLayout:!0,...s},l),d&&f.current.restoreViewState(X.get(j)),b.current.editor.setTheme(c),u!==void 0&&f.current.revealLine(u),h(!0),fe.current=!0}},[t,e,r,n,o,i,s,l,d,c,u]);Q(()=>{g&&_.current(f.current,b.current)},[g]),Q(()=>{!v&&!g&&de()},[v,g,de]),m.current=n,Q(()=>{g&&L&&(H.current?.dispose(),H.current=f.current?.onDidChangeModelContent(j=>{te.current||L(f.current.getValue(),j)}))},[g,L]),Q(()=>{if(g){let j=b.current.editor.onDidChangeMarkers(I=>{let re=f.current.getModel()?.uri;if(re&&I.find(ne=>ne.path===re.path)){let ne=b.current.editor.getModelMarkers({resource:re});A?.(ne)}});return()=>{j?.dispose()}}return()=>{}},[g,A]);function Ge(){H.current?.dispose(),x?d&&X.set(i,f.current.saveViewState()):f.current.getModel()?.dispose(),f.current.dispose()}return Zt.createElement(De,{width:w,height:M,isEditorReady:g,loading:a,_ref:T,className:E,wrapperProps:p})}var ar=ir,cr=Xt(ar),Z=cr;import Ke,{useState as Tr}from"react";import{c as br}from"react/compiler-runtime";import{jsx as yr}from"react/jsx-runtime";import{createContext as wr,use as Or,useEffect as jr,useState as He}from"react";import{c as dr}from"react/compiler-runtime";import{jsx as ke}from"react/jsx-runtime";import{createContext as mr,use as pr,useCallback as gr,useEffect as hr,useMemo as We}from"react";import{c as ur}from"react/compiler-runtime";import{useEffect as sr,useRef as lr,useState as fr}from"react";function $e(t,e){let r=ur(5),[n,o]=fr(t),i=lr(!0),c,u;r[0]!==t?(c=()=>{if(i.current){i.current=!1;return}o(t)},u=[t],r[0]=t,r[1]=c,r[2]=u):(c=r[1],u=r[2]),sr(c,u);let a=n??e,s;return r[3]!==a?(s=[a,o],r[3]=a,r[4]=s):s=r[4],s}var Ne=mr(void 0),vr=({children:t,config:e})=>{let[r,n]=$e(e),{collectionsBySlug:o,globalsBySlug:i}=We(()=>{let a={},s={};for(let l of r.collections)a[l.slug]=l;for(let l of r.globals)s[l.slug]=l;return{collectionsBySlug:a,globalsBySlug:s}},[r]),c=gr(a=>"collectionSlug"in a?o[a.collectionSlug]??null:"globalSlug"in a?i[a.globalSlug]??null:null,[o,i]),u=We(()=>({config:r,getEntityConfig:c,setConfig:n}),[r,c,n]);return ke(Ne,{value:u,children:t})},se=()=>pr(Ne),Cn=t=>{let e=dr(7),{children:r,config:n}=t,{config:o,setConfig:i}=se(),c,u;if(e[0]!==n||e[1]!==i?(c=()=>{i(n)},u=[n,i],e[0]=n,e[1]=i,e[2]=c,e[3]=u):(c=e[2],u=e[3]),hr(c,u),o!==n&&o.unauthenticated!==n.unauthenticated){let a;return e[4]!==r||e[5]!==n?(a=ke(vr,{config:n,children:r}),e[4]=r,e[5]=n,e[6]=a):a=e[6],a}return r};var Mr={autoMode:!0,setTheme:()=>null,theme:"light"},Be=wr(Mr);function ze(t,e,r){let n=new Date;n.setTime(n.getTime()+r*24*60*60*1e3);let o="expires="+n.toUTCString();document.cookie=t+"="+e+";"+o+";path=/"}var Sr=t=>{let e,r=window.document.cookie.split("; ").find(n=>n.startsWith(`${t}=`))?.split("=")[1];return r==="light"||r==="dark"?e=r:e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e),{theme:e,themeFromCookies:r}},xr="light",$n=t=>{let e=br(11),{children:r,theme:n}=t,{config:o}=se(),i=o.admin.theme,c=`${o.cookiePrefix||"payload"}-theme`,[u,a]=He(n||xr),[s,l]=He(),d,x;e[0]!==c||e[1]!==i?(d=()=>{if(i!=="all")return;let{theme:p,themeFromCookies:P}=Sr(c);a(p),l(!P)},x=[i,c],e[0]=c,e[1]=i,e[2]=d,e[3]=x):(d=e[2],x=e[3]),jr(d,x);let w;e[4]!==c?(w=p=>{if(p==="light"||p==="dark")a(p),l(!1),ze(c,p,365),document.documentElement.setAttribute("data-theme",p);else if(p==="auto"){ze(c,p,-1);let P=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";document.documentElement.setAttribute("data-theme",P),l(!0),a(P)}},e[4]=c,e[5]=w):w=e[5];let M=w,E;return e[6]!==s||e[7]!==r||e[8]!==M||e[9]!==u?(E=yr(Be,{value:{autoMode:s,setTheme:M,theme:u},children:r}),e[6]=s,e[7]=r,e[8]=M,e[9]=u,e[10]=E):E=e[10],E},Ve=()=>Or(Be);import{c as Er}from"react/compiler-runtime";import{jsx as U}from"react/jsx-runtime";import"react";import{c as Pr}from"react/compiler-runtime";import*as N from"react";var Fe=(t,e)=>{let r=Pr(9),n=e===void 0?!1:e,[o,i]=N.useState(!1),c=N.useRef(void 0),u;r[0]!==t?(u=()=>(i(!1),clearTimeout(c.current),c.current=setTimeout(()=>{i(!0)},t),()=>{clearTimeout(c.current)}),r[0]=t,r[1]=u):u=r[1];let a=u,s,l;r[2]!==a||r[3]!==n?(s=()=>{n&&a()},l=[a,n],r[2]=a,r[3]=n,r[4]=s,r[5]=l):(s=r[4],l=r[5]),N.useEffect(s,l);let d;return r[6]!==o||r[7]!==a?(d=[o,a],r[6]=o,r[7]=a,r[8]=d):d=r[8],d};var le=({animationDelay:t="0ms",className:e,disableInlineStyles:r=!1,height:n="60px",width:o="100%"})=>U("div",{className:["shimmer-effect",e].filter(Boolean).join(" "),style:{height:!r&&(typeof n=="number"?`${n}px`:n),width:!r&&(typeof o=="number"?`${o}px`:o)},children:U("div",{className:"shimmer-effect__shine",style:{animationDelay:t}})}),Fn=t=>{let e=Er(9),{className:r,count:n,height:o,renderDelay:i,shimmerDelay:c,shimmerItemClassName:u,width:a}=t,s=i===void 0?500:i,l=c===void 0?25:c,d=typeof l=="number"?`${l}ms`:l,[x]=Fe(s,!0);if(!x)return null;let w;e[0]!==n?(w=[...Array(n)],e[0]=n,e[1]=w):w=e[1];let M;return e[2]!==r||e[3]!==o||e[4]!==d||e[5]!==u||e[6]!==w||e[7]!==a?(M=U("div",{className:r,children:w.map((E,p)=>U("div",{className:u,children:U(le,{animationDelay:`calc(${p} * ${d})`,height:o,width:a})},p))}),e[2]=r,e[3]=o,e[4]=d,e[5]=u,e[6]=w,e[7]=a,e[8]=M):M=e[8],M};var ee={insertSpaces:!1,tabSize:4,trimAutoWhitespace:!1},Ue={hideCursorInOverviewRuler:!0,minimap:{enabled:!1},overviewRulerBorder:!1,readOnly:!1,scrollbar:{alwaysConsumeMouseWheel:!1},scrollBeyondLastLine:!1,wordWrap:"on"};var Ar="default"in Z?Z.default:Z,Rr="code-editor",Ir=t=>{let e=Cr(10),{className:r,maxHeight:n,minHeight:o,options:i,readOnly:c,recalculatedHeightAt:u,value:a,...s}=t,l=o??56,d=Ke.useRef(u),{insertSpaces:x,tabSize:w,trimAutoWhitespace:M,...E}=i||{},p=i?.padding?(i.padding.top||0)+(i.padding?.bottom||0):0,[P,y]=Tr(l),{theme:L}=Ve(),A=s?.defaultLanguage?`language--${s.defaultLanguage}`:"",g=c&&"read-only",h;e[0]!==r||e[1]!==A||e[2]!==g?(h=[Rr,r,A,g].filter(Boolean),e[0]=r,e[1]=A,e[2]=g,e[3]=h):h=e[3];let v=h.join(" "),C,b;return e[4]!==l||e[5]!==p||e[6]!==u||e[7]!==a?(C=()=>{u&&u>d.current&&(y(a?Math.max(l,a.split(`
`).length*18+2+p):l),d.current=u)},b=[a,l,p,u],e[4]=l,e[5]=p,e[6]=u,e[7]=a,e[8]=C,e[9]=b):(C=e[8],b=e[9]),Ke.useEffect(C,b),qe(Ar,{className:v,height:n?Math.min(P,n):P,loading:qe(le,{height:P}),options:{...Ue,...E,readOnly:!!c,detectIndentation:!1,insertSpaces:void 0,tabSize:void 0,trimAutoWhitespace:void 0},theme:L==="dark"?"vs-dark":"vs",value:a,...s,onChange:(f,T)=>{s.onChange?.(f,T),y(f?Math.max(l,f.split(`
`).length*18+2+p):l)},onMount:(f,T)=>{s.onMount?.(f,T);let _=f.getModel();_&&_.updateOptions({insertSpaces:x??ee.insertSpaces,tabSize:w??ee.tabSize,trimAutoWhitespace:M??ee.trimAutoWhitespace}),y(Math.max(l,f.getValue().split(`
`).length*18+2+p))}})},eo=Ir;export{$e as a,vr as b,se as c,Cn as d,Fe as e,le as f,Fn as g,xr as h,$n as i,Ve as j,ee as k,eo as l};
//# sourceMappingURL=chunk-TBYRZYQJ.js.map
