Files
e-tib.com/.next/static/chunks/acb65bd067741882.js
Marc Mintel d14122005d Initial commit: E-TIB production hardening & E2E foundation
Former-commit-id: ef04fca3d76375630c05aac117bf586953f3b657
2026-04-28 19:11:38 +02:00

17 lines
38 KiB
JavaScript

;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="771b79a5-c73d-7000-800f-ab72ceac287c")}catch(e){}}();
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,529173,e=>{"use strict";var t=e.i(268576),n=e.i(785316),r=e.i(452797),i=e.i(638857),a=e.i(907358),o=e.i(678457),l=e.i(138452),s=e.i(226150),u=e.i(734789),c=e.i(503144),d=e.i(703057),m=({data:e,featureKey:n,fieldMapOverride:d,handleDrawerSubmit:m,schemaFieldsPathOverride:f,schemaPath:h,schemaPathSuffix:g})=>{let{t:p}=(0,l.useTranslation)(),{id:b,collectionSlug:y,getDocPreferences:v,globalSlug:S}=(0,i.useDocumentInfo)(),{fields:w}=(0,i.useDocumentForm)(),M=(0,o.useLexicalEditable)(),x=(0,a.useRef)(new AbortController),[k,j]=(0,a.useState)(!1),{fieldProps:{featureClientSchemaMap:O}}=(0,t.b)(),{getFormState:C}=(0,i.useServerFunctions)(),P=f??`${h}.lexical_internal_feature.${n}${g?`.${g}`:""}`,D=d??O[n]?.[P];(0,a.useEffect)(()=>{let t=new AbortController;return(async()=>{let{state:n}=await C({id:b,collectionSlug:y,data:e??{},docPermissions:{fields:!0},docPreferences:await v(),documentFormState:(0,u.deepCopyObjectSimpleWithoutReactComponents)(w,{excludeFiles:!0}),globalSlug:S,initialBlockData:e,operation:"update",readOnly:!M,renderAllFields:!0,schemaPath:P,signal:t.signal});j(n)})(),()=>{(0,s.abortAndIgnore)(t)}},[P,b,e,C,y,M,S,v,w]);let E=(0,a.useCallback)(async({formState:e})=>{(0,s.abortAndIgnore)(x.current);let t=new AbortController;x.current=t;let{state:n}=await C({id:b,collectionSlug:y,docPermissions:{fields:!0},docPreferences:await v(),documentFormState:(0,u.deepCopyObjectSimpleWithoutReactComponents)(w,{excludeFiles:!0}),formState:e,globalSlug:S,initialBlockFormState:e,operation:"update",readOnly:!M,schemaPath:P,signal:t.signal});return n||e},[C,b,M,y,v,w,S,P]);return(0,a.useEffect)(()=>()=>{(0,s.abortAndIgnore)(x.current)},[]),!1===k?null:(0,r.jsxs)(i.Form,{beforeSubmit:[E],disableValidationOnSubmit:!0,fields:Array.isArray(D)?D:[],initialState:k,onChange:[E],onSubmit:m,uuid:(0,c.v4)(),children:[(0,r.jsx)(i.RenderFields,{fields:Array.isArray(D)?D:[],forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:P,permissions:!0,readOnly:!M}),(0,r.jsx)(i.FormSubmit,{children:p("fields:saveChanges")})]})},f=e=>{let t,a=(0,n.c)(15),{className:o,data:l,drawerSlug:s,drawerTitle:u,featureKey:c,fieldMapOverride:d,handleDrawerSubmit:f,schemaFieldsPathOverride:h,schemaPath:g,schemaPathSuffix:p}=e,{closeModal:b}=(0,i.useModal)(),y=u??"",v;return a[0]!==b||a[1]!==s||a[2]!==f?(v=(e,t)=>{b(s),setTimeout(()=>{f(e,t)},1)},a[0]=b,a[1]=s,a[2]=f,a[3]=v):v=a[3],a[4]!==o||a[5]!==l||a[6]!==s||a[7]!==c||a[8]!==d||a[9]!==h||a[10]!==g||a[11]!==p||a[12]!==y||a[13]!==v?(t=(0,r.jsx)(i.EditDepthProvider,{children:(0,r.jsx)(i.Drawer,{className:o,slug:s,title:y,children:(0,r.jsx)(m,{data:l,featureKey:c,fieldMapOverride:d,handleDrawerSubmit:v,schemaFieldsPathOverride:h,schemaPath:g,schemaPathSuffix:p})})}),a[4]=o,a[5]=l,a[6]=s,a[7]=c,a[8]=d,a[9]=h,a[10]=g,a[11]=p,a[12]=y,a[13]=v,a[14]=t):t=a[14],t},h=(0,d.createCommand)("INSERT_UPLOAD_WITH_DRAWER_COMMAND");e.s(["a",()=>f,"b",()=>h])},836566,e=>{"use strict";var t=e.i(785316),n=e.i(452797),r=e.i(600745),i=e.i(638857),a=e.i(703057),o=e.i(907358),l=e=>{let l,s,u=(0,t.c)(21),[c]=(0,r.useLexicalComposerContext)(),[d,m]=(0,o.useState)(null),[f,h]=(0,o.useState)(!1),[g,p,b]=(0,i.useDocumentDrawer)(e),{closeDrawer:y,drawerSlug:v}=b,{modalState:S}=(0,i.useModal)(),w;u[0]!==c?(w=()=>{c.read(()=>{m((0,a.$getSelection)()??(0,a.$getPreviousSelection)())}),h(!0)},u[0]=c,u[1]=w):w=u[1];let M=w,x;u[2]!==c||u[3]!==d?(x=()=>{d&&c.update(()=>{(0,a.$setSelection)(d.clone())},{discrete:!0,skipTransforms:!0})},u[2]=c,u[3]=d,u[4]=x):x=u[4];let k=x,j;u[5]!==y?(j=()=>{y()},u[5]=y,u[6]=j):j=u[6];let O=j,C,P;return u[7]!==v||u[8]!==S||u[9]!==k||u[10]!==f?(C=()=>{if(!f)return;let e=S[v];e&&!e?.isOpen&&(h(!1),setTimeout(()=>{k()},1))},P=[S,v,k,f],u[7]=v,u[8]=S,u[9]=k,u[10]=f,u[11]=C,u[12]=P):(C=u[11],P=u[12]),(0,o.useEffect)(C,P),u[13]!==p||u[14]!==M?(l=e=>(0,n.jsx)(p,{...e,onClick:M}),u[13]=p,u[14]=M,u[15]=l):l=u[15],u[16]!==g||u[17]!==O||u[18]!==v||u[19]!==l?(s={closeDocumentDrawer:O,DocumentDrawer:g,documentDrawerSlug:v,DocumentDrawerToggler:l},u[16]=g,u[17]=O,u[18]=v,u[19]=l,u[20]=s):s=u[20],s};e.s(["a",()=>l])},492421,e=>{"use strict";let t={};function n(){return t}e.s(["getDefaultOptions",()=>n])},487122,511518,e=>{"use strict";let t=Symbol.for("constructDateFrom");function n(e,n){return"function"==typeof e?e(n):e&&"object"==typeof e&&t in e?e[t](n):e instanceof Date?new e.constructor(n):new Date(n)}e.s(["constructFromSymbol",0,t,"millisecondsInDay",0,864e5,"millisecondsInWeek",0,6048e5],511518),e.s(["constructFrom",()=>n],487122)},516467,e=>{"use strict";var t=e.i(487122);function n(e,n){return(0,t.constructFrom)(n||e,e)}e.s(["toDate",()=>n])},539392,e=>{"use strict";var t=e.i(487122);function n(e,...r){let i=t.constructFrom.bind(null,e||r.find(e=>"object"==typeof e));return r.map(i)}e.s(["normalizeDates",()=>n])},954259,e=>{"use strict";var t=e.i(492421),n=e.i(516467);function r(e,r){let i=(0,t.getDefaultOptions)(),a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=(0,n.toDate)(e,r?.in),l=o.getDay();return o.setDate(o.getDate()-(7*(l<a)+l-a)),o.setHours(0,0,0,0),o}e.s(["startOfWeek",()=>r])},597979,(e,t,n)=>{"use strict";var r=e.r(907358).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;n.c=function(e){return r.H.useMemoCache(e)}},785316,(e,t,n)=>{"use strict";t.exports=e.r(597979)},624503,e=>{"use strict";var t,n,r=e.i(907358);e.i(910353);var i=e.i(785316),a=e.i(452797);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e){return function t(){for(var n=this,r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++)r[a]=arguments[a];return t.apply(n,[].concat(i,r))}}}function c(e){return({}).toString.call(e).includes("Object")}function d(e){return"function"==typeof e}var m=u(function(e,t){throw Error(e[t]||e.default)})({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"}),f=function(e,t){return c(t)||m("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&m("changeField"),t},h=function(e){d(e)||m("selectorType")},g=function(e){d(e)||c(e)||m("handlerType"),c(e)&&Object.values(e).some(function(e){return!d(e)})&&m("handlersType")},p=function(e){e||m("initialIsRequired"),c(e)||m("initialType"),Object.keys(e).length||m("initialContent")};function b(e,t){return d(t)?t(e.current):t}function y(e,t){return e.current=s(s({},e.current),t),t}function v(e,t,n){return d(t)?t(e.current):Object.keys(n).forEach(function(n){var r;return null==(r=t[n])?void 0:r.call(t,e.current[n])}),n}var S={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
`},w=(t=function(e,t){throw Error(e[t]||e.default)},function e(){for(var n=this,r=arguments.length,i=Array(r),a=0;a<r;a++)i[a]=arguments[a];return i.length>=t.length?t.apply(this,i):function(){for(var t=arguments.length,r=Array(t),a=0;a<t;a++)r[a]=arguments[a];return e.apply(n,[].concat(i,r))}})(S),M=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},x={type:"cancelation",msg:"operation is manually canceled"};function k(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(x):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var j=function(e){if(Array.isArray(e))return e}(n=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(e),g(t);var n={current:e},r=u(v)(n,t),i=u(y)(n),a=u(f)(e),o=u(b)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return h(e),e(n.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(r,i,a,o)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e,t){var n=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a,o,l=[],s=!0,u=!1;try{a=(n=n.call(e)).next,!0;for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),2!==l.length);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return l}}(n,2)||function(e,t){if(e){if("string"==typeof e)return o(e,2);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,2):void 0}}(n,2)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}(),O=j[0],C=j[1];function P(e){return document.body.appendChild(e)}function D(e){var t,n,r=O(function(e){return{config:e.config,reject:e.reject}}),i=(t="".concat(r.config.paths.vs,"/loader.js"),n=document.createElement("script"),t&&(n.src=t),n);return i.onload=function(){return e()},i.onerror=r.reject,i}function E(){var e=O(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var n=t.m||t;F(n),e.resolve(n)},function(t){e.reject(t)})}function F(e){O().monaco||C({monaco:e})}var T=new Promise(function(e,t){return C({resolve:e,reject:t})}),_=function(){var e=O(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(C({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),k(T);if(window.monaco&&window.monaco.editor)return F(window.monaco),e.resolve(window.monaco),k(T);M(P,D)(E)}return k(T)},R={display:"flex",position:"relative",textAlign:"initial"},A={width:"100%"},B={display:"none"},N={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},W=function({children:e}){return r.default.createElement("div",{style:N},e)},I=(0,r.memo)(function({width:e,height:t,isEditorReady:n,loading:i,_ref:a,className:o,wrapperProps:l}){return r.default.createElement("section",{style:{...R,width:e,height:t},...l},!n&&r.default.createElement(W,null,i),r.default.createElement("div",{ref:a,style:{...A,...!n&&B},className:o}))}),L=function(e){(0,r.useEffect)(e,[])},$=function(e,t,n=!0){let i=(0,r.useRef)(!0);(0,r.useEffect)(i.current||!n?()=>{i.current=!1}:e,t)};function z(){}function V(e,t,n,r){var i,a,o,l,s,u;return i=e,a=r,i.editor.getModel(U(i,a))||(o=e,l=t,s=n,u=r,o.editor.createModel(l,s,u?U(o,u):void 0))}function U(e,t){return e.Uri.parse(t)}(0,r.memo)(function({original:e,modified:t,language:n,originalLanguage:i,modifiedLanguage:a,originalModelPath:o,modifiedModelPath:l,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:u=!1,theme:c="light",loading:d="Loading...",options:m={},height:f="100%",width:h="100%",className:g,wrapperProps:p={},beforeMount:b=z,onMount:y=z}){let[v,S]=(0,r.useState)(!1),[w,M]=(0,r.useState)(!0),x=(0,r.useRef)(null),k=(0,r.useRef)(null),j=(0,r.useRef)(null),O=(0,r.useRef)(y),C=(0,r.useRef)(b),P=(0,r.useRef)(!1);L(()=>{let e=_();return e.then(e=>(k.current=e)&&M(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return x.current?(t=x.current?.getModel(),void(s||t?.original?.dispose(),u||t?.modified?.dispose(),x.current?.dispose())):e.cancel()}}),$(()=>{if(x.current&&k.current){let t=x.current.getOriginalEditor(),r=V(k.current,e||"",i||n||"text",o||"");r!==t.getModel()&&t.setModel(r)}},[o],v),$(()=>{if(x.current&&k.current){let e=x.current.getModifiedEditor(),r=V(k.current,t||"",a||n||"text",l||"");r!==e.getModel()&&e.setModel(r)}},[l],v),$(()=>{let e=x.current.getModifiedEditor();e.getOption(k.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),$(()=>{x.current?.getModel()?.original.setValue(e||"")},[e],v),$(()=>{let{original:e,modified:t}=x.current.getModel();k.current.editor.setModelLanguage(e,i||n||"text"),k.current.editor.setModelLanguage(t,a||n||"text")},[n,i,a],v),$(()=>{k.current?.editor.setTheme(c)},[c],v),$(()=>{x.current?.updateOptions(m)},[m],v);let D=(0,r.useCallback)(()=>{if(!k.current)return;C.current(k.current);let r=V(k.current,e||"",i||n||"text",o||""),s=V(k.current,t||"",a||n||"text",l||"");x.current?.setModel({original:r,modified:s})},[n,t,a,e,i,o,l]),E=(0,r.useCallback)(()=>{!P.current&&j.current&&(x.current=k.current.editor.createDiffEditor(j.current,{automaticLayout:!0,...m}),D(),k.current?.editor.setTheme(c),S(!0),P.current=!0)},[m,c,D]);return(0,r.useEffect)(()=>{v&&O.current(x.current,k.current)},[v]),(0,r.useEffect)(()=>{w||v||E()},[w,v,E]),r.default.createElement(I,{width:h,height:f,isEditorReady:v,loading:d,_ref:j,className:g,wrapperProps:p})});var q=function(e){let t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current},J=new Map,H=(0,r.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:n,value:i,language:a,path:o,theme:l="light",line:s,loading:u="Loading...",options:c={},overrideServices:d={},saveViewState:m=!0,keepCurrentModel:f=!1,width:h="100%",height:g="100%",className:p,wrapperProps:b={},beforeMount:y=z,onMount:v=z,onChange:S,onValidate:w=z}){let[M,x]=(0,r.useState)(!1),[k,j]=(0,r.useState)(!0),O=(0,r.useRef)(null),C=(0,r.useRef)(null),P=(0,r.useRef)(null),D=(0,r.useRef)(v),E=(0,r.useRef)(y),F=(0,r.useRef)(),T=(0,r.useRef)(i),R=q(o),A=(0,r.useRef)(!1),B=(0,r.useRef)(!1);L(()=>{let e=_();return e.then(e=>(O.current=e)&&j(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>C.current?void(F.current?.dispose(),f?m&&J.set(o,C.current.saveViewState()):C.current.getModel()?.dispose(),C.current.dispose()):e.cancel()}),$(()=>{let r=V(O.current,e||i||"",t||a||"",o||n||"");r!==C.current?.getModel()&&(m&&J.set(R,C.current?.saveViewState()),C.current?.setModel(r),m&&C.current?.restoreViewState(J.get(o)))},[o],M),$(()=>{C.current?.updateOptions(c)},[c],M),$(()=>{C.current&&void 0!==i&&(C.current.getOption(O.current.editor.EditorOption.readOnly)?C.current.setValue(i):i!==C.current.getValue()&&(B.current=!0,C.current.executeEdits("",[{range:C.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),C.current.pushUndoStop(),B.current=!1))},[i],M),$(()=>{let e=C.current?.getModel();e&&a&&O.current?.editor.setModelLanguage(e,a)},[a],M),$(()=>{void 0!==s&&C.current?.revealLine(s)},[s],M),$(()=>{O.current?.editor.setTheme(l)},[l],M);let N=(0,r.useCallback)(()=>{if(!(!P.current||!O.current)&&!A.current){E.current(O.current);let r=o||n,u=V(O.current,i||e||"",t||a||"",r||"");C.current=O.current?.editor.create(P.current,{model:u,automaticLayout:!0,...c},d),m&&C.current.restoreViewState(J.get(r)),O.current.editor.setTheme(l),void 0!==s&&C.current.revealLine(s),x(!0),A.current=!0}},[e,t,n,i,a,o,c,d,m,l,s]);return(0,r.useEffect)(()=>{M&&D.current(C.current,O.current)},[M]),(0,r.useEffect)(()=>{k||M||N()},[k,M,N]),T.current=i,(0,r.useEffect)(()=>{M&&S&&(F.current?.dispose(),F.current=C.current?.onDidChangeModelContent(e=>{B.current||S(C.current.getValue(),e)}))},[M,S]),(0,r.useEffect)(()=>{if(M){let e=O.current.editor.onDidChangeMarkers(e=>{let t=C.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=O.current.editor.getModelMarkers({resource:t});w?.(e)}});return()=>{e?.dispose()}}return()=>{}},[M,w]),r.default.createElement(I,{width:h,height:g,isEditorReady:M,loading:u,_ref:P,className:p,wrapperProps:b})});function K(e,t){let n=(0,i.c)(5),[a,o]=(0,r.useState)(e),l=(0,r.useRef)(!0),s,u;n[0]!==e?(s=()=>{if(l.current){l.current=!1;return}o(e)},u=[e],n[0]=e,n[1]=s,n[2]=u):(s=n[1],u=n[2]),(0,r.useEffect)(s,u);let c=a??t,d;return n[3]!==c?(d=[c,o],n[3]=c,n[4]=d):d=n[4],d}var X=(0,r.createContext)(void 0),Y=({children:e,config:t})=>{let[n,i]=K(t),{collectionsBySlug:o,globalsBySlug:l}=(0,r.useMemo)(()=>{let e={},t={};for(let t of n.collections)e[t.slug]=t;for(let e of n.globals)t[e.slug]=e;return{collectionsBySlug:e,globalsBySlug:t}},[n]),s=(0,r.useCallback)(e=>"collectionSlug"in e&&e.collectionSlug?o[e.collectionSlug]??null:"globalSlug"in e&&e.globalSlug?l[e.globalSlug]??null:null,[o,l]),u=(0,r.useMemo)(()=>({config:n,getEntityConfig:s,setConfig:i}),[n,s,i]);return(0,a.jsx)(X,{value:u,children:e})},Q=()=>(0,r.use)(X),G=e=>{let t=(0,i.c)(7),{children:n,config:o}=e,{config:l,setConfig:s}=Q(),u,c;if(t[0]!==o||t[1]!==s?(u=()=>{s(o)},c=[o,s],t[0]=o,t[1]=s,t[2]=u,t[3]=c):(u=t[2],c=t[3]),(0,r.useEffect)(u,c),l!==o&&l.unauthenticated!==o.unauthenticated){let e;return t[4]!==n||t[5]!==o?(e=(0,a.jsx)(Y,{config:o,children:n}),t[4]=n,t[5]=o,t[6]=e):e=t[6],e}return n},Z=(0,r.createContext)({autoMode:!0,setTheme:()=>null,theme:"light"});function ee(e,t,n){let r=new Date;r.setTime(r.getTime()+24*n*36e5);let i="expires="+r.toUTCString();document.cookie=e+"="+t+";"+i+";path=/"}var et="light",en=e=>{let t,n=(0,i.c)(11),{children:o,theme:l}=e,{config:s}=Q(),u=s.admin.theme,c=`${s.cookiePrefix||"payload"}-theme`,[d,m]=(0,r.useState)(l||et),[f,h]=(0,r.useState)(),g,p;n[0]!==c||n[1]!==u?(g=()=>{let e,t;if("all"!==u)return;let{theme:n,themeFromCookies:r}=(e="light"===(t=window.document.cookie.split("; ").find(e=>e.startsWith(`${c}=`))?.split("=")[1])||"dark"===t?t:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",document.documentElement.setAttribute("data-theme",e),{theme:e,themeFromCookies:t});m(n),h(!r)},p=[u,c],n[0]=c,n[1]=u,n[2]=g,n[3]=p):(g=n[2],p=n[3]),(0,r.useEffect)(g,p),n[4]!==c?(t=e=>{if("light"===e||"dark"===e)m(e),h(!1),ee(c,e,365),document.documentElement.setAttribute("data-theme",e);else if("auto"===e){ee(c,e,-1);let t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";document.documentElement.setAttribute("data-theme",t),h(!0),m(t)}},n[4]=c,n[5]=t):t=n[5];let b=t,y;return n[6]!==f||n[7]!==o||n[8]!==b||n[9]!==d?(y=(0,a.jsx)(Z,{value:{autoMode:f,setTheme:b,theme:d},children:o}),n[6]=f,n[7]=o,n[8]=b,n[9]=d,n[10]=y):y=n[10],y},er=()=>(0,r.use)(Z),ei=(e,t)=>{let n,a=(0,i.c)(9),o=void 0!==t&&t,[l,s]=r.useState(!1),u=r.useRef(void 0),c;a[0]!==e?(c=()=>(s(!1),clearTimeout(u.current),u.current=setTimeout(()=>{s(!0)},e),()=>{clearTimeout(u.current)}),a[0]=e,a[1]=c):c=a[1];let d=c,m,f;return a[2]!==d||a[3]!==o?(m=()=>{o&&d()},f=[d,o],a[2]=d,a[3]=o,a[4]=m,a[5]=f):(m=a[4],f=a[5]),r.useEffect(m,f),a[6]!==l||a[7]!==d?(n=[l,d],a[6]=l,a[7]=d,a[8]=n):n=a[8],n},ea="shimmer-effect",eo=({animationDelay:e="0ms",className:t,disableInlineStyles:n=!1,height:r="60px",transparent:i,width:o="100%",...l})=>(0,a.jsx)("div",{...l,className:[ea,i&&`${ea}--transparent`,t].filter(Boolean).join(" "),style:{...l?.style||{},height:!n&&("number"==typeof r?`${r}px`:r),width:!n&&("number"==typeof o?`${o}px`:o)},children:(0,a.jsx)("div",{className:"shimmer-effect__shine",style:{animationDelay:e}})}),el=e=>{let t,n,r=(0,i.c)(9),{className:o,count:l,height:s,renderDelay:u,shimmerDelay:c,shimmerItemClassName:d,width:m}=e,f=void 0===c?25:c,h="number"==typeof f?`${f}ms`:f,[g]=ei(void 0===u?500:u,!0);return g?(r[0]!==l?(t=[...Array(l)],r[0]=l,r[1]=t):t=r[1],r[2]!==o||r[3]!==s||r[4]!==h||r[5]!==d||r[6]!==t||r[7]!==m?(n=(0,a.jsx)("div",{className:o,children:t.map((e,t)=>(0,a.jsx)("div",{className:d,children:(0,a.jsx)(eo,{animationDelay:`calc(${t} * ${h})`,height:s,width:m})},t))}),r[2]=o,r[3]=s,r[4]=h,r[5]=d,r[6]=t,r[7]=m,r[8]=n):n=r[8],n):null},es={insertSpaces:!1,tabSize:4,trimAutoWhitespace:!1},eu={hideCursorInOverviewRuler:!0,minimap:{enabled:!1},overviewRulerBorder:!1,readOnly:!1,scrollbar:{alwaysConsumeMouseWheel:!1},scrollBeyondLastLine:!1,wordWrap:"on"},ec="default"in H?H.default:H,ed=e=>{let t=(0,i.c)(10),{className:n,maxHeight:o,minHeight:l,options:s,readOnly:u,recalculatedHeightAt:c,value:d,...m}=e,f=l??56,h=r.default.useRef(c),{insertSpaces:g,tabSize:p,trimAutoWhitespace:b,...y}=s||{},v=s?.padding?(s.padding.top||0)+(s.padding?.bottom||0):0,[S,w]=(0,r.useState)(f),{theme:M}=er(),x=m?.defaultLanguage?`language--${m.defaultLanguage}`:"",k=u&&"read-only",j;t[0]!==n||t[1]!==x||t[2]!==k?(j=["code-editor",n,x,k].filter(Boolean),t[0]=n,t[1]=x,t[2]=k,t[3]=j):j=t[3];let O=j.join(" "),C,P;return t[4]!==f||t[5]!==v||t[6]!==c||t[7]!==d?(C=()=>{c&&c>h.current&&(w(d?Math.max(f,18*d.split(`
`).length+2+v):f),h.current=c)},P=[d,f,v,c],t[4]=f,t[5]=v,t[6]=c,t[7]=d,t[8]=C,t[9]=P):(C=t[8],P=t[9]),r.default.useEffect(C,P),(0,a.jsx)(ec,{className:O,height:o?Math.min(S,o):S,loading:(0,a.jsx)(eo,{height:S}),options:{...eu,...y,readOnly:!!u,detectIndentation:!1,insertSpaces:void 0,tabSize:void 0,trimAutoWhitespace:void 0},theme:"dark"===M?"vs-dark":"vs",value:d,...m,onChange:(e,t)=>{m.onChange?.(e,t),w(e?Math.max(f,18*e.split(`
`).length+2+v):f)},onMount:(e,t)=>{m.onMount?.(e,t);let n=e.getModel();n&&n.updateOptions({insertSpaces:g??es.insertSpaces,tabSize:p??es.tabSize,trimAutoWhitespace:b??es.trimAutoWhitespace}),w(Math.max(f,18*e.getValue().split(`
`).length+2+v))}})};e.s(["a",()=>K,"b",()=>Y,"c",()=>Q,"d",()=>G,"e",()=>ei,"f",()=>eo,"g",()=>el,"h",()=>et,"i",()=>en,"j",()=>er,"k",()=>es,"l",()=>ed])},244874,e=>{"use strict";let t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};var n=e.i(716609);let r={date:(0,n.buildFormatLongFn)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:(0,n.buildFormatLongFn)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n.buildFormatLongFn)({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},i={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};var a=e.i(649859);let o={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:(0,a.buildLocalizeFn)({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:(0,a.buildLocalizeFn)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:(0,a.buildLocalizeFn)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:(0,a.buildLocalizeFn)({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:(0,a.buildLocalizeFn)({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};var l=e.i(369796);let s={code:"en-US",formatDistance:(e,n,r)=>{let i,a=t[e];if(i="string"==typeof a?a:1===n?a.one:a.other.replace("{{count}}",n.toString()),r?.addSuffix)if(r.comparison&&r.comparison>0)return"in "+i;else return i+" ago";return i},formatLong:r,formatRelative:(e,t,n,r)=>i[e],localize:o,match:{ordinalNumber:(0,e.i(91081).buildMatchPatternFn)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:(0,l.buildMatchFn)({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:(0,l.buildMatchFn)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:(0,l.buildMatchFn)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,l.buildMatchFn)({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,l.buildMatchFn)({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};e.s(["default",0,s,"enUS",0,s],244874)},200860,e=>{"use strict";var t=e.i(785316),n=e.i(600745),r=e.i(638857),i=e.i(703057),a=e.i(907358),o=(e,o)=>{let l,s=(0,t.c)(24),[u]=(0,n.useLexicalComposerContext)(),[c,d]=(0,a.useState)(null),[m,f]=(0,a.useState)(!1),{closeModal:h,modalState:g,toggleModal:p}=(0,r.useModal)(),b;s[0]!==u?(b=()=>{u.read(()=>{d((0,i.$getSelection)()??(0,i.$getPreviousSelection)())})},s[0]=u,s[1]=b):b=s[1];let y=b,v;s[2]!==u||s[3]!==c?(v=()=>{c&&u.update(()=>{(0,i.$setSelection)(c.clone())},{discrete:!0,skipTransforms:!0})},s[2]=u,s[3]=c,s[4]=v):v=s[4];let S=v,w;s[5]!==h||s[6]!==e?(w=()=>{h(e)},s[5]=h,s[6]=e,s[7]=w):w=s[7];let M=w,x=g?.[e]?.isOpen,k;s[8]!==x||s[9]!==S||s[10]!==e||s[11]!==y||s[12]!==p?(k=()=>{x?S():y(),f(!0),p(e)},s[8]=x,s[9]=S,s[10]=e,s[11]=y,s[12]=p,s[13]=k):k=s[13];let j=k,O,C;return s[14]!==g||s[15]!==o||s[16]!==S||s[17]!==e||s[18]!==m?(O=()=>{if(!m)return;let t=g[e];t&&!t?.isOpen&&(f(!1),o?setTimeout(()=>{S()},0):S())},C=[g,e,S,m,o],s[14]=g,s[15]=o,s[16]=S,s[17]=e,s[18]=m,s[19]=O,s[20]=C):(O=s[19],C=s[20]),(0,a.useEffect)(O,C),s[21]!==M||s[22]!==j?(l={closeDrawer:M,toggleDrawer:j},s[21]=M,s[22]=j,s[23]=l):l=s[23],l};e.s(["a",()=>o])},503144,e=>{"use strict";let t="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);for(var n,r=new Uint8Array(16),i=[],a=0;a<256;++a)i.push((a+256).toString(16).slice(1));e.s(["v4",0,function(e,a,o){if(t&&!a&&!e)return t();var l=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)})();if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,a){o=o||0;for(var s=0;s<16;++s)a[o+s]=l[s];return a}return function(e,t=0){return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}(l)}],503144)},289571,e=>{"use strict";var t=(0,e.i(703057).createCommand)("INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND");e.s(["a",()=>t])},4497,e=>{"use strict";var t=e.i(624503);e.s(["ShimmerEffect",()=>t.f])},843461,e=>{"use strict";var t=e.i(200860),n=e.i(268576),r=e.i(452797),i=e.i(600745),a=e.i(678457),o=e.i(704333),l=e.i(638857),s=e.i(4497),u=e.i(55686),c=e.i(138452),d=e.i(226150),m=e.i(703057),f=e.i(734789),h=e.i(817159),g=e.i(907358),p=e.i(503144),b=e.i(756961),y=class extends m.DecoratorNode{__cacheBuster;__fields;constructor({cacheBuster:e,fields:t,key:n}){super(n),this.__fields=t,this.__cacheBuster=e||0}static clone(e){return new this({cacheBuster:e.__cacheBuster,fields:e.__fields,key:e.__key})}static getType(){return"inlineBlock"}static importDOM(){return{}}static importJSON(e){var t;return t=e.fields,(0,m.$applyNodeReplacement)(new y({fields:{...t,id:t?.id||new b.default.default().toHexString()}}))}static isInline(){return!1}canIndent(){return!0}createDOM(e){let t=document.createElement("span");return(0,m.addClassNamesToElement)(t,e?.theme?.inlineBlock),t}decorate(e,t){return null}exportDOM(){let e=document.createElement("span");e.classList.add("inline-block-container");let t=document.createTextNode(this.getTextContent());return e.append(t),{element:e}}exportJSON(){return{type:"inlineBlock",fields:this.getFields(),version:1}}getCacheBuster(){return this.getLatest().__cacheBuster}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}isInline(){return!0}setFields(e,t){let n=this.getWritable();n.__fields=e,t||n.__cacheBuster++}updateDOM(){return!1}},v=g.default.lazy(()=>e.A(355830).then(e=>({default:e.InlineBlockComponent}))),S=class extends y{static clone(e){return super.clone(e)}static getType(){return super.getType()}static importJSON(e){return w(e.fields)}decorate(e,t){return(0,r.jsx)(v,{cacheBuster:this.getCacheBuster(),className:t.theme.inlineBlock??"LexicalEditorTheme__inlineBlock",formData:this.getFields(),nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function w(e){return(0,m.$applyNodeReplacement)(new S({fields:{...e,id:e?.id||new b.default.default().toHexString()}}))}function M(e){return e instanceof S}var x=(0,g.createContext)({initialState:!1}),k=()=>g.default.use(x),j=e=>{let{cacheBuster:b,className:y,formData:v,nodeKey:S}=e,[w]=(0,i.useLexicalComposerContext)(),k=(0,a.useLexicalEditable)(),{i18n:j,t:O}=(0,c.useTranslation)(),{createdInlineBlock:C,fieldProps:{featureClientSchemaMap:P,initialLexicalFormState:D,schemaPath:E},setCreatedInlineBlock:F,uuid:T}=(0,n.b)(),{fields:_}=(0,l.useDocumentForm)(),{getFormState:R}=(0,l.useServerFunctions)(),A=(0,l.useEditDepth)(),B=(0,g.useRef)(!1),[N,W]=g.default.useState(()=>{let e=D?.[v.id]?.formState;return!!e&&Object.fromEntries(Object.entries(e).map(([e,t])=>[e,e in v?{...t,initialValue:v[e],value:v[e]}:t]))}),I=(0,g.useRef)(!1),L=(0,g.useRef)(b);(0,g.useEffect)(()=>{I.current?(L.current!==b&&W(!1),L.current=b):I.current=!0},[b]);let[$,z]=g.default.useState(N?._components?.customComponents?.BlockLabel),[V,U]=g.default.useState(N?._components?.customComponents?.Block),q=(0,l.formatDrawerSlug)({slug:`lexical-inlineBlocks-create-${T}-${v.id}`,depth:A}),{toggleDrawer:J}=(0,t.a)(q,!0),H=(0,g.useRef)(null),{id:K,collectionSlug:X,getDocPreferences:Y,globalSlug:Q}=(0,l.useDocumentInfo)(),{config:G}=(0,u.useConfig)(),Z=`${E}.lexical_internal_feature.blocks.lexical_inline_blocks.${v.blockType}`,ee=P.blocks?.[Z]?.[0],et=ee.blockReferences?"string"==typeof ee?.blockReferences?.[0]?G.blocksMap[ee?.blockReferences?.[0]]:ee?.blockReferences?.[0]:ee?.blocks?.[0],en=et?.fields??[];(0,g.useEffect)(()=>{B.current||C?.getKey()!==S||(en.length>2&&J(),F?.(void 0),B.current=!0)},[en.length,C,S,F,J]);let er=(0,g.useCallback)(()=>{w.update(()=>{(0,m.$getNodeByKey)(S)?.remove()})},[w,S]),ei=et?.labels?.singular?(0,o.getTranslation)(et?.labels.singular,j):et?.slug,ea=(0,g.useRef)(new AbortController),eo=`${E}.lexical_internal_feature.blocks.lexical_inline_blocks.${et?.slug}.fields`;(0,g.useEffect)(()=>{let e=new AbortController;return v&&!N&&(async()=>{let{state:t}=await R({id:K,collectionSlug:X,data:v,docPermissions:{fields:!0},docPreferences:await Y(),documentFormState:(0,f.deepCopyObjectSimpleWithoutReactComponents)(_,{excludeFiles:!0}),globalSlug:Q,initialBlockData:v,initialBlockFormState:v,operation:"update",readOnly:!k,renderAllFields:!0,schemaPath:eo,signal:e.signal});if(t){let e=(0,h.reduceFieldsToValues)((0,f.deepCopyObjectSimpleWithoutReactComponents)(t,{excludeFiles:!0}),!0);w.update(()=>{let t=(0,m.$getNodeByKey)(S);t&&M(t)&&(e.blockType=v.blockType,t.setFields(e,!0))}),W(t),z(t._components?.customComponents?.BlockLabel),U(t._components?.customComponents?.Block)}})(),()=>{(0,d.abortAndIgnore)(e)}},[R,w,S,k,eo,K,v,N,X,Q,Y,_]);let el=(0,g.useCallback)(async({formState:e,submit:t})=>{(0,d.abortAndIgnore)(ea.current);let n=new AbortController;ea.current=n;let{state:r}=await R({id:K,collectionSlug:X,docPermissions:{fields:!0},docPreferences:await Y(),documentFormState:(0,f.deepCopyObjectSimpleWithoutReactComponents)(_,{excludeFiles:!0}),formState:e,globalSlug:Q,initialBlockFormState:e,operation:"update",readOnly:!k,renderAllFields:!!t,schemaPath:eo,signal:n.signal});return r?(t&&(z(r._components?.customComponents?.BlockLabel),U(r._components?.customComponents?.Block)),r):e},[R,K,X,Y,_,Q,k,eo]);(0,g.useEffect)(()=>()=>{N&&Object.keys(N).some(e=>N[e]&&v[e]!==N[e].value)&&W(!1),(0,d.abortAndIgnore)(ea.current)},[v,N]);let es=(0,g.useCallback)((e,t)=>{t.blockType=v.blockType,w.update(()=>{let e=(0,m.$getNodeByKey)(S);e&&M(e)&&e.setFields(t,!0)})},[w,S,v]),eu=(0,g.useMemo)(()=>()=>(0,r.jsx)(l.Button,{buttonStyle:"icon-label",className:`${y}__removeButton`,disabled:!k,icon:"x",onClick:e=>{e.preventDefault(),er()},round:!0,size:"small",tooltip:O("lexical:blocks:inlineBlocks:remove",{label:ei})}),[y,ei,k,er,O]),ec=(0,g.useMemo)(()=>()=>(0,r.jsx)(l.Button,{buttonStyle:"icon-label",className:`${y}__editButton`,disabled:!k,el:"button",icon:"edit",onClick:()=>{J()},round:!0,size:"small",tooltip:O("lexical:blocks:inlineBlocks:edit",{label:ei})}),[y,ei,k,O,J]),ed=(0,g.useMemo)(()=>({children:e,className:t})=>(0,r.jsx)("div",{className:[`${y}__container`,y+"-"+v.blockType,t].filter(Boolean).join(" "),ref:H,children:e}),[y,v.blockType]),em=(0,g.useMemo)(()=>$?()=>$:()=>(0,r.jsx)("div",{children:et?.labels?(0,o.getTranslation)(et?.labels.singular,j):""}),[$,et?.labels,j]);return et?(0,r.jsxs)(l.Form,{beforeSubmit:[async({formState:e})=>await el({formState:e,submit:!0})],disableValidationOnSubmit:!0,el:"div",fields:et?.fields,initialState:N||{},onChange:[el],onSubmit:(e,t)=>{es(e,t),J()},uuid:(0,p.v4)(),children:[(0,r.jsx)(l.EditDepthProvider,{children:(0,r.jsx)(l.Drawer,{className:"",slug:q,title:O(`lexical:blocks:inlineBlocks:${v?.id?"edit":"create"}`,{label:ei??O("lexical:blocks:inlineBlocks:label")}),children:N?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.RenderFields,{fields:et?.fields,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:eo,permissions:!0,readOnly:!k}),(0,r.jsx)(l.FormSubmit,{programmaticSubmit:!0,children:O("fields:saveChanges")})]}):null})}),V?(0,r.jsx)(x,{value:{EditButton:ec,initialState:N,InlineBlockContainer:ed,Label:em,nodeKey:S,RemoveButton:eu},children:V}):(0,r.jsxs)(ed,{children:[N?(0,r.jsx)(em,{}):(0,r.jsx)(s.ShimmerEffect,{height:"15px",width:"40px"}),k?(0,r.jsxs)("div",{className:`${y}__actions`,children:[(0,r.jsx)(ec,{}),(0,r.jsx)(eu,{})]}):null]})]}):(0,r.jsxs)(ed,{className:`${y}-not-found`,children:[(0,r.jsxs)("span",{children:["Error: Block '",v.blockType,"' not found"]}),k?(0,r.jsx)("div",{className:`${y}__actions`,children:(0,r.jsx)(eu,{})}):null]})};e.s(["a",()=>k,"b",()=>j,"c",()=>S,"d",()=>w,"e",()=>M])}]);
//# debugId=771b79a5-c73d-7000-800f-ab72ceac287c