@yext/pages-components 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var hf;function Q_(){if(hf)return Fl;hf=1;var t=et,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function g(p,C,v){var T,O={},R=null,b=null;v!==void 0&&(R=""+v),C.key!==void 0&&(R=""+C.key),C.ref!==void 0&&(b=C.ref);for(T in C)r.call(C,T)&&!d.hasOwnProperty(T)&&(O[T]=C[T]);if(p&&p.defaultProps)for(T in C=p.defaultProps,C)O[T]===void 0&&(O[T]=C[T]);return{$$typeof:e,type:p,key:R,ref:b,props:O,_owner:c.current}}return Fl.Fragment=n,Fl.jsx=g,Fl.jsxs=g,Fl}var Bl={};/**
9
+ */var hf;function Q_(){if(hf)return Fl;hf=1;var t=et,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function g(p,N,v){var T,O={},b=null,R=null;v!==void 0&&(b=""+v),N.key!==void 0&&(b=""+N.key),N.ref!==void 0&&(R=N.ref);for(T in N)r.call(N,T)&&!d.hasOwnProperty(T)&&(O[T]=N[T]);if(p&&p.defaultProps)for(T in N=p.defaultProps,N)O[T]===void 0&&(O[T]=N[T]);return{$$typeof:e,type:p,key:b,ref:R,props:O,_owner:c.current}}return Fl.Fragment=n,Fl.jsx=g,Fl.jsxs=g,Fl}var Bl={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,93 +14,93 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var gf;function ey(){return gf||(gf=1,process.env.NODE_ENV!=="production"&&function(){var t=et,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),p=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),b=Symbol.for("react.offscreen"),x=Symbol.iterator,w="@@iterator";function $(ye){if(ye===null||typeof ye!="object")return null;var Ge=x&&ye[x]||ye[w];return typeof Ge=="function"?Ge:null}var W=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(ye){{for(var Ge=arguments.length,nt=new Array(Ge>1?Ge-1:0),Nt=1;Nt<Ge;Nt++)nt[Nt-1]=arguments[Nt];H("error",ye,nt)}}function H(ye,Ge,nt){{var Nt=W.ReactDebugCurrentFrame,Ht=Nt.getStackAddendum();Ht!==""&&(Ge+="%s",nt=nt.concat([Ht]));var Kt=nt.map(function($t){return String($t)});Kt.unshift("Warning: "+Ge),Function.prototype.apply.call(console[ye],console,Kt)}}var B=!1,z=!1,X=!1,ee=!1,le=!1,j;j=Symbol.for("react.module.reference");function U(ye){return!!(typeof ye=="string"||typeof ye=="function"||ye===r||ye===d||le||ye===c||ye===v||ye===T||ee||ye===b||B||z||X||typeof ye=="object"&&ye!==null&&(ye.$$typeof===R||ye.$$typeof===O||ye.$$typeof===g||ye.$$typeof===p||ye.$$typeof===C||ye.$$typeof===j||ye.getModuleId!==void 0))}function q(ye,Ge,nt){var Nt=ye.displayName;if(Nt)return Nt;var Ht=Ge.displayName||Ge.name||"";return Ht!==""?nt+"("+Ht+")":nt}function me(ye){return ye.displayName||"Context"}function _e(ye){if(ye==null)return null;if(typeof ye.tag=="number"&&P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof ye=="function")return ye.displayName||ye.name||null;if(typeof ye=="string")return ye;switch(ye){case r:return"Fragment";case n:return"Portal";case d:return"Profiler";case c:return"StrictMode";case v:return"Suspense";case T:return"SuspenseList"}if(typeof ye=="object")switch(ye.$$typeof){case p:var Ge=ye;return me(Ge)+".Consumer";case g:var nt=ye;return me(nt._context)+".Provider";case C:return q(ye,ye.render,"ForwardRef");case O:var Nt=ye.displayName||null;return Nt!==null?Nt:_e(ye.type)||"Memo";case R:{var Ht=ye,Kt=Ht._payload,$t=Ht._init;try{return _e($t(Kt))}catch{return null}}}return null}var pe=Object.assign,ue=0,K,D,V,ne,Y,G,Q;function k(){}k.__reactDisabledLog=!0;function m(){{if(ue===0){K=console.log,D=console.info,V=console.warn,ne=console.error,Y=console.group,G=console.groupCollapsed,Q=console.groupEnd;var ye={configurable:!0,enumerable:!0,value:k,writable:!0};Object.defineProperties(console,{info:ye,log:ye,warn:ye,error:ye,group:ye,groupCollapsed:ye,groupEnd:ye})}ue++}}function y(){{if(ue--,ue===0){var ye={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:pe({},ye,{value:K}),info:pe({},ye,{value:D}),warn:pe({},ye,{value:V}),error:pe({},ye,{value:ne}),group:pe({},ye,{value:Y}),groupCollapsed:pe({},ye,{value:G}),groupEnd:pe({},ye,{value:Q})})}ue<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var M=W.ReactCurrentDispatcher,Z;function ae(ye,Ge,nt){{if(Z===void 0)try{throw Error()}catch(Ht){var Nt=Ht.stack.trim().match(/\n( *(at )?)/);Z=Nt&&Nt[1]||""}return`
17
+ */var gf;function ey(){return gf||(gf=1,process.env.NODE_ENV!=="production"&&function(){var t=et,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),p=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),x=Symbol.iterator,w="@@iterator";function P(ye){if(ye===null||typeof ye!="object")return null;var Ge=x&&ye[x]||ye[w];return typeof Ge=="function"?Ge:null}var H=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(ye){{for(var Ge=arguments.length,nt=new Array(Ge>1?Ge-1:0),Nt=1;Nt<Ge;Nt++)nt[Nt-1]=arguments[Nt];W("error",ye,nt)}}function W(ye,Ge,nt){{var Nt=H.ReactDebugCurrentFrame,Ht=Nt.getStackAddendum();Ht!==""&&(Ge+="%s",nt=nt.concat([Ht]));var Kt=nt.map(function($t){return String($t)});Kt.unshift("Warning: "+Ge),Function.prototype.apply.call(console[ye],console,Kt)}}var B=!1,z=!1,X=!1,ee=!1,le=!1,j;j=Symbol.for("react.module.reference");function U(ye){return!!(typeof ye=="string"||typeof ye=="function"||ye===r||ye===d||le||ye===c||ye===v||ye===T||ee||ye===R||B||z||X||typeof ye=="object"&&ye!==null&&(ye.$$typeof===b||ye.$$typeof===O||ye.$$typeof===g||ye.$$typeof===p||ye.$$typeof===N||ye.$$typeof===j||ye.getModuleId!==void 0))}function q(ye,Ge,nt){var Nt=ye.displayName;if(Nt)return Nt;var Ht=Ge.displayName||Ge.name||"";return Ht!==""?nt+"("+Ht+")":nt}function me(ye){return ye.displayName||"Context"}function _e(ye){if(ye==null)return null;if(typeof ye.tag=="number"&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof ye=="function")return ye.displayName||ye.name||null;if(typeof ye=="string")return ye;switch(ye){case r:return"Fragment";case n:return"Portal";case d:return"Profiler";case c:return"StrictMode";case v:return"Suspense";case T:return"SuspenseList"}if(typeof ye=="object")switch(ye.$$typeof){case p:var Ge=ye;return me(Ge)+".Consumer";case g:var nt=ye;return me(nt._context)+".Provider";case N:return q(ye,ye.render,"ForwardRef");case O:var Nt=ye.displayName||null;return Nt!==null?Nt:_e(ye.type)||"Memo";case b:{var Ht=ye,Kt=Ht._payload,$t=Ht._init;try{return _e($t(Kt))}catch{return null}}}return null}var pe=Object.assign,ue=0,K,D,V,ne,Y,G,Q;function k(){}k.__reactDisabledLog=!0;function m(){{if(ue===0){K=console.log,D=console.info,V=console.warn,ne=console.error,Y=console.group,G=console.groupCollapsed,Q=console.groupEnd;var ye={configurable:!0,enumerable:!0,value:k,writable:!0};Object.defineProperties(console,{info:ye,log:ye,warn:ye,error:ye,group:ye,groupCollapsed:ye,groupEnd:ye})}ue++}}function y(){{if(ue--,ue===0){var ye={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:pe({},ye,{value:K}),info:pe({},ye,{value:D}),warn:pe({},ye,{value:V}),error:pe({},ye,{value:ne}),group:pe({},ye,{value:Y}),groupCollapsed:pe({},ye,{value:G}),groupEnd:pe({},ye,{value:Q})})}ue<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var M=H.ReactCurrentDispatcher,Z;function ae(ye,Ge,nt){{if(Z===void 0)try{throw Error()}catch(Ht){var Nt=Ht.stack.trim().match(/\n( *(at )?)/);Z=Nt&&Nt[1]||""}return`
18
18
  `+Z+ye}}var he=!1,se;{var Te=typeof WeakMap=="function"?WeakMap:Map;se=new Te}function be(ye,Ge){if(!ye||he)return"";{var nt=se.get(ye);if(nt!==void 0)return nt}var Nt;he=!0;var Ht=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Kt;Kt=M.current,M.current=null,m();try{if(Ge){var $t=function(){throw Error()};if(Object.defineProperty($t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($t,[])}catch(qn){Nt=qn}Reflect.construct(ye,[],$t)}else{try{$t.call()}catch(qn){Nt=qn}ye.call($t.prototype)}}else{try{throw Error()}catch(qn){Nt=qn}ye()}}catch(qn){if(qn&&Nt&&typeof qn.stack=="string"){for(var Pt=qn.stack.split(`
19
19
  `),mn=Nt.stack.split(`
20
20
  `),sn=Pt.length-1,nn=mn.length-1;sn>=1&&nn>=0&&Pt[sn]!==mn[nn];)nn--;for(;sn>=1&&nn>=0;sn--,nn--)if(Pt[sn]!==mn[nn]){if(sn!==1||nn!==1)do if(sn--,nn--,nn<0||Pt[sn]!==mn[nn]){var $n=`
21
- `+Pt[sn].replace(" at new "," at ");return ye.displayName&&$n.includes("<anonymous>")&&($n=$n.replace("<anonymous>",ye.displayName)),typeof ye=="function"&&se.set(ye,$n),$n}while(sn>=1&&nn>=0);break}}}finally{he=!1,M.current=Kt,y(),Error.prepareStackTrace=Ht}var pr=ye?ye.displayName||ye.name:"",mi=pr?ae(pr):"";return typeof ye=="function"&&se.set(ye,mi),mi}function Ue(ye,Ge,nt){return be(ye,!1)}function re(ye){var Ge=ye.prototype;return!!(Ge&&Ge.isReactComponent)}function te(ye,Ge,nt){if(ye==null)return"";if(typeof ye=="function")return be(ye,re(ye));if(typeof ye=="string")return ae(ye);switch(ye){case v:return ae("Suspense");case T:return ae("SuspenseList")}if(typeof ye=="object")switch(ye.$$typeof){case C:return Ue(ye.render);case O:return te(ye.type,Ge,nt);case R:{var Nt=ye,Ht=Nt._payload,Kt=Nt._init;try{return te(Kt(Ht),Ge,nt)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,we={},Le=W.ReactDebugCurrentFrame;function Be(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);Le.setExtraStackFrame(nt)}else Le.setExtraStackFrame(null)}function Ye(ye,Ge,nt,Nt,Ht){{var Kt=Function.call.bind(ce);for(var $t in ye)if(Kt(ye,$t)){var Pt=void 0;try{if(typeof ye[$t]!="function"){var mn=Error((Nt||"React class")+": "+nt+" type `"+$t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof ye[$t]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw mn.name="Invariant Violation",mn}Pt=ye[$t](Ge,$t,Nt,nt,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(sn){Pt=sn}Pt&&!(Pt instanceof Error)&&(Be(Ht),P("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Nt||"React class",nt,$t,typeof Pt),Be(null)),Pt instanceof Error&&!(Pt.message in we)&&(we[Pt.message]=!0,Be(Ht),P("Failed %s type: %s",nt,Pt.message),Be(null))}}}var ct=Array.isArray;function yt(ye){return ct(ye)}function dt(ye){{var Ge=typeof Symbol=="function"&&Symbol.toStringTag,nt=Ge&&ye[Symbol.toStringTag]||ye.constructor.name||"Object";return nt}}function ve(ye){try{return ie(ye),!1}catch{return!0}}function ie(ye){return""+ye}function fe(ye){if(ve(ye))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dt(ye)),ie(ye)}var Oe=W.ReactCurrentOwner,Re={key:!0,ref:!0,__self:!0,__source:!0},De,We,qe;qe={};function Qe(ye){if(ce.call(ye,"ref")){var Ge=Object.getOwnPropertyDescriptor(ye,"ref").get;if(Ge&&Ge.isReactWarning)return!1}return ye.ref!==void 0}function ft(ye){if(ce.call(ye,"key")){var Ge=Object.getOwnPropertyDescriptor(ye,"key").get;if(Ge&&Ge.isReactWarning)return!1}return ye.key!==void 0}function kt(ye,Ge){if(typeof ye.ref=="string"&&Oe.current&&Ge&&Oe.current.stateNode!==Ge){var nt=_e(Oe.current.type);qe[nt]||(P('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_e(Oe.current.type),ye.ref),qe[nt]=!0)}}function je(ye,Ge){{var nt=function(){De||(De=!0,P("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"key",{get:nt,configurable:!0})}}function Ve(ye,Ge){{var nt=function(){We||(We=!0,P("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"ref",{get:nt,configurable:!0})}}var rt=function(ye,Ge,nt,Nt,Ht,Kt,$t){var Pt={$$typeof:e,type:ye,key:Ge,ref:nt,props:$t,_owner:Kt};return Pt._store={},Object.defineProperty(Pt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Pt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Nt}),Object.defineProperty(Pt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ht}),Object.freeze&&(Object.freeze(Pt.props),Object.freeze(Pt)),Pt};function _t(ye,Ge,nt,Nt,Ht){{var Kt,$t={},Pt=null,mn=null;nt!==void 0&&(fe(nt),Pt=""+nt),ft(Ge)&&(fe(Ge.key),Pt=""+Ge.key),Qe(Ge)&&(mn=Ge.ref,kt(Ge,Ht));for(Kt in Ge)ce.call(Ge,Kt)&&!Re.hasOwnProperty(Kt)&&($t[Kt]=Ge[Kt]);if(ye&&ye.defaultProps){var sn=ye.defaultProps;for(Kt in sn)$t[Kt]===void 0&&($t[Kt]=sn[Kt])}if(Pt||mn){var nn=typeof ye=="function"?ye.displayName||ye.name||"Unknown":ye;Pt&&je($t,nn),mn&&Ve($t,nn)}return rt(ye,Pt,mn,Ht,Nt,Oe.current,$t)}}var Et=W.ReactCurrentOwner,St=W.ReactDebugCurrentFrame;function Ot(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);St.setExtraStackFrame(nt)}else St.setExtraStackFrame(null)}var At;At=!1;function xt(ye){return typeof ye=="object"&&ye!==null&&ye.$$typeof===e}function Qt(){{if(Et.current){var ye=_e(Et.current.type);if(ye)return`
21
+ `+Pt[sn].replace(" at new "," at ");return ye.displayName&&$n.includes("<anonymous>")&&($n=$n.replace("<anonymous>",ye.displayName)),typeof ye=="function"&&se.set(ye,$n),$n}while(sn>=1&&nn>=0);break}}}finally{he=!1,M.current=Kt,y(),Error.prepareStackTrace=Ht}var pr=ye?ye.displayName||ye.name:"",mi=pr?ae(pr):"";return typeof ye=="function"&&se.set(ye,mi),mi}function Ue(ye,Ge,nt){return be(ye,!1)}function re(ye){var Ge=ye.prototype;return!!(Ge&&Ge.isReactComponent)}function te(ye,Ge,nt){if(ye==null)return"";if(typeof ye=="function")return be(ye,re(ye));if(typeof ye=="string")return ae(ye);switch(ye){case v:return ae("Suspense");case T:return ae("SuspenseList")}if(typeof ye=="object")switch(ye.$$typeof){case N:return Ue(ye.render);case O:return te(ye.type,Ge,nt);case b:{var Nt=ye,Ht=Nt._payload,Kt=Nt._init;try{return te(Kt(Ht),Ge,nt)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,we={},Le=H.ReactDebugCurrentFrame;function Be(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);Le.setExtraStackFrame(nt)}else Le.setExtraStackFrame(null)}function Ye(ye,Ge,nt,Nt,Ht){{var Kt=Function.call.bind(ce);for(var $t in ye)if(Kt(ye,$t)){var Pt=void 0;try{if(typeof ye[$t]!="function"){var mn=Error((Nt||"React class")+": "+nt+" type `"+$t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof ye[$t]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw mn.name="Invariant Violation",mn}Pt=ye[$t](Ge,$t,Nt,nt,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(sn){Pt=sn}Pt&&!(Pt instanceof Error)&&(Be(Ht),$("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Nt||"React class",nt,$t,typeof Pt),Be(null)),Pt instanceof Error&&!(Pt.message in we)&&(we[Pt.message]=!0,Be(Ht),$("Failed %s type: %s",nt,Pt.message),Be(null))}}}var ct=Array.isArray;function yt(ye){return ct(ye)}function dt(ye){{var Ge=typeof Symbol=="function"&&Symbol.toStringTag,nt=Ge&&ye[Symbol.toStringTag]||ye.constructor.name||"Object";return nt}}function ve(ye){try{return ie(ye),!1}catch{return!0}}function ie(ye){return""+ye}function fe(ye){if(ve(ye))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",dt(ye)),ie(ye)}var Oe=H.ReactCurrentOwner,Re={key:!0,ref:!0,__self:!0,__source:!0},De,We,qe;qe={};function Qe(ye){if(ce.call(ye,"ref")){var Ge=Object.getOwnPropertyDescriptor(ye,"ref").get;if(Ge&&Ge.isReactWarning)return!1}return ye.ref!==void 0}function ft(ye){if(ce.call(ye,"key")){var Ge=Object.getOwnPropertyDescriptor(ye,"key").get;if(Ge&&Ge.isReactWarning)return!1}return ye.key!==void 0}function kt(ye,Ge){if(typeof ye.ref=="string"&&Oe.current&&Ge&&Oe.current.stateNode!==Ge){var nt=_e(Oe.current.type);qe[nt]||($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',_e(Oe.current.type),ye.ref),qe[nt]=!0)}}function je(ye,Ge){{var nt=function(){De||(De=!0,$("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"key",{get:nt,configurable:!0})}}function Ve(ye,Ge){{var nt=function(){We||(We=!0,$("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ge))};nt.isReactWarning=!0,Object.defineProperty(ye,"ref",{get:nt,configurable:!0})}}var rt=function(ye,Ge,nt,Nt,Ht,Kt,$t){var Pt={$$typeof:e,type:ye,key:Ge,ref:nt,props:$t,_owner:Kt};return Pt._store={},Object.defineProperty(Pt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Pt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Nt}),Object.defineProperty(Pt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Ht}),Object.freeze&&(Object.freeze(Pt.props),Object.freeze(Pt)),Pt};function _t(ye,Ge,nt,Nt,Ht){{var Kt,$t={},Pt=null,mn=null;nt!==void 0&&(fe(nt),Pt=""+nt),ft(Ge)&&(fe(Ge.key),Pt=""+Ge.key),Qe(Ge)&&(mn=Ge.ref,kt(Ge,Ht));for(Kt in Ge)ce.call(Ge,Kt)&&!Re.hasOwnProperty(Kt)&&($t[Kt]=Ge[Kt]);if(ye&&ye.defaultProps){var sn=ye.defaultProps;for(Kt in sn)$t[Kt]===void 0&&($t[Kt]=sn[Kt])}if(Pt||mn){var nn=typeof ye=="function"?ye.displayName||ye.name||"Unknown":ye;Pt&&je($t,nn),mn&&Ve($t,nn)}return rt(ye,Pt,mn,Ht,Nt,Oe.current,$t)}}var Et=H.ReactCurrentOwner,St=H.ReactDebugCurrentFrame;function Ot(ye){if(ye){var Ge=ye._owner,nt=te(ye.type,ye._source,Ge?Ge.type:null);St.setExtraStackFrame(nt)}else St.setExtraStackFrame(null)}var At;At=!1;function xt(ye){return typeof ye=="object"&&ye!==null&&ye.$$typeof===e}function Qt(){{if(Et.current){var ye=_e(Et.current.type);if(ye)return`
22
22
 
23
23
  Check the render method of \``+ye+"`."}return""}}function bt(ye){return""}var Ut={};function It(ye){{var Ge=Qt();if(!Ge){var nt=typeof ye=="string"?ye:ye.displayName||ye.name;nt&&(Ge=`
24
24
 
25
- Check the top-level render call using <`+nt+">.")}return Ge}}function hr(ye,Ge){{if(!ye._store||ye._store.validated||ye.key!=null)return;ye._store.validated=!0;var nt=It(Ge);if(Ut[nt])return;Ut[nt]=!0;var Nt="";ye&&ye._owner&&ye._owner!==Et.current&&(Nt=" It was passed a child from "+_e(ye._owner.type)+"."),Ot(ye),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',nt,Nt),Ot(null)}}function Sr(ye,Ge){{if(typeof ye!="object")return;if(yt(ye))for(var nt=0;nt<ye.length;nt++){var Nt=ye[nt];xt(Nt)&&hr(Nt,Ge)}else if(xt(ye))ye._store&&(ye._store.validated=!0);else if(ye){var Ht=$(ye);if(typeof Ht=="function"&&Ht!==ye.entries)for(var Kt=Ht.call(ye),$t;!($t=Kt.next()).done;)xt($t.value)&&hr($t.value,Ge)}}}function Fi(ye){{var Ge=ye.type;if(Ge==null||typeof Ge=="string")return;var nt;if(typeof Ge=="function")nt=Ge.propTypes;else if(typeof Ge=="object"&&(Ge.$$typeof===C||Ge.$$typeof===O))nt=Ge.propTypes;else return;if(nt){var Nt=_e(Ge);Ye(nt,ye.props,"prop",Nt,ye)}else if(Ge.PropTypes!==void 0&&!At){At=!0;var Ht=_e(Ge);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ht||"Unknown")}typeof Ge.getDefaultProps=="function"&&!Ge.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ps(ye){{for(var Ge=Object.keys(ye.props),nt=0;nt<Ge.length;nt++){var Nt=Ge[nt];if(Nt!=="children"&&Nt!=="key"){Ot(ye),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Nt),Ot(null);break}}ye.ref!==null&&(Ot(ye),P("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function ms(ye,Ge,nt,Nt,Ht,Kt){{var $t=U(ye);if(!$t){var Pt="";(ye===void 0||typeof ye=="object"&&ye!==null&&Object.keys(ye).length===0)&&(Pt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var mn=bt();mn?Pt+=mn:Pt+=Qt();var sn;ye===null?sn="null":yt(ye)?sn="array":ye!==void 0&&ye.$$typeof===e?(sn="<"+(_e(ye.type)||"Unknown")+" />",Pt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof ye,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,Pt)}var nn=_t(ye,Ge,nt,Ht,Kt);if(nn==null)return nn;if($t){var $n=Ge.children;if($n!==void 0)if(Nt)if(yt($n)){for(var pr=0;pr<$n.length;pr++)Sr($n[pr],ye);Object.freeze&&Object.freeze($n)}else P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Sr($n,ye)}return ye===r?ps(nn):Fi(nn),nn}}function fn(ye,Ge,nt){return ms(ye,Ge,nt,!0)}function gr(ye,Ge,nt){return ms(ye,Ge,nt,!1)}var Jr=gr,_s=fn;Bl.Fragment=r,Bl.jsx=Jr,Bl.jsxs=_s}()),Bl}process.env.NODE_ENV==="production"?Hu.exports=Q_():Hu.exports=ey();var at=Hu.exports;function ty(t){switch(t){case"AD":case"AM":case"AT":case"AX":case"AZ":case"BA":case"BY":case"CY":case"CZ":case"DK":case"DZ":case"EC":case"EH":case"ET":case"FI":case"FR":case"GE":case"GF":case"GI":case"GP":case"GW":case"HT":case"KE":case"KV":case"KW":case"LA":case"LU":case"MC":case"MD":case"ME":case"MG":case"MK":case"MQ":case"MZ":case"NC":case"NL":case"NO":case"PL":case"PT":case"PY":case"RE":case"RS":case"SA":case"SE":case"SJ":case"SM":case"SN":case"TC":case"TJ":case"TM":case"TN":case"TZ":case"UY":case"VG":case"ZM":return[["line1"],["line2"],["postalCode","city"],["countryCode"]];case"AF":case"IR":return[["line1"],["line2"],["city"],["region"],["postalCode"],["countryCode"]];case"AG":case"AO":case"AW":case"BJ":case"BO":case"BS":case"BZ":case"CI":case"CW":case"DJ":case"FJ":case"GA":case"GH":case"GM":case"GY":case"JM":case"KI":case"LY":case"MW":case"NA":case"NR":case"PS":case"QA":case"RW":case"SC":case"SR":case"SX":case"TG":case"TT":case"UG":case"VU":return[["line1"],["line2"],["city"],["countryCode"]];case"AL":case"EE":case"IS":return[["line1"],["line2"],["postalCode","city"]];case"AR":return[["line1"],["line2"],["postalCode","city",",","region"],["countryCode"]];case"AS":case"BB":case"BD":case"BM":case"BN":case"BT":case"CR":case"DO":case"FK":case"FM":case"GR":case"GU":case"JO":case"KZ":case"LB":case"LK":case"LS":case"MA":case"MH":case"MM":case"MR":case"MT":case"MV":case"NG":case"PG":case"PK":case"PR":case"RO":case"SG":case"VC":case"WS":return[["line1"],["line2"],["city","postalCode"],["countryCode"]];case"AU":case"CA":case"SZ":case"US":case"VI":return[["line1"],["line2"],["city",",","region","postalCode"],["countryCode"]];case"BE":case"PE":return[["line1"],["line2"],["postalCode","sublocality","city"],["countryCode"]];case"BF":case"BI":case"BQ":case"BW":case"CF":case"CG":case"CM":case"DM":case"ER":case"GQ":case"KM":case"ML":case"SY":case"TD":case"ZW":return[["line1"],["line2"],["city"],["region"],["countryCode"]];case"BG":return[["line1"],["postalCode","region"],["countryCode"]];case"BH":return[["line1"],["line2"],["sublocality","city"],["countryCode"]];case"BR":return[["line1"],["line2"],["sublocality"],["city","region"],["postalCode"],["countryCode"]];case"CH":case"DE":case"GT":case"IT":case"LI":case"MY":case"NI":case"OM":case"SK":case"VA":return[["line1"],["line2"],["postalCode","city","region"],["countryCode"]];case"CL":case"PF":return[["line1"],["line2"],["city","postalCode","region"],["countryCode"]];case"CN":return[["region","city","sublocality"],["line1"],["line2"],["countryCode"]];case"CO":case"ID":case"IQ":case"KH":case"MP":case"NP":case"PW":case"UA":return[["line1"],["line2"],["city","region","postalCode"],["countryCode"]];case"EG":return[["line1"],["line2"],["sublocality","city","region","postalCode"],["countryCode"]];case"ES":case"IL":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"GB":case"MN":case"ZA":return[["line1"],["line2"],["sublocality","city","postalCode"],["countryCode"]];case"GG":case"IM":case"JE":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"GN":return[["line1","line2","city"],["countryCode"]];case"HK":return[["line1"],["line2"],["sublocality"],["city"],["region"],["countryCode"]];case"HR":return[["line1"],["postalCode","city","region"],["countryCode"]];case"HU":case"SI":return[["postalCode","city"],["line1"],["line2"],["countryCode"]];case"IE":return[["line1"],["line2"],["sublocality"],["city","region","postalCode"],["countryCode"]];case"IN":case"VE":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"JP":return[["line2"],["line1","sublocality"],["city","region"],["postalCode"],["countryCode"]];case"KR":return[["countryCode"],["region","city","sublocality","line1"],["line2"],["postalCode"]];case"KY":return[["line1"],["line2"],["postalCode"],["countryCode"]];case"LT":return[["line1"],["postalCode","city","sublocality","region"],["countryCode"]];case"LV":return[["line1"],["city",",","postalCode"],["countryCode"]];case"MO":return[["line1"],["line2"],["sublocality"],["city"],["countryCode"]];case"MU":return[["line1"],["line2"],["city"],["region","postalCode"],["countryCode"]];case"MX":return[["line1"],["line2"],["sublocality"],["postalCode","city",",","region"],["countryCode"]];case"NE":case"SD":return[["line1"],["line2"],["postalCode"],["city"],["region"],["countryCode"]];case"NZ":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"PH":case"TW":case"VN":return[["line1"],["line2"],["sublocality","city"],["region","postalCode"],["countryCode"]];case"RU":return[["line1"],["line2"],["city"],["postalCode"],["countryCode"]];case"SB":case"SL":case"ST":case"TL":case"TO":case"TV":return[["line1"],["line2"],["city",",","region"],["countryCode"]];case"TH":case"TR":return[["line1"],["line2"],["sublocality"],["postalCode","city"],["countryCode"]];case"UZ":return[["line1"],["line2"],["region","postalCode"],["countryCode"]]}return[["line1","line2"],["city","region","postalCode"],["countryCode"]]}const sp={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Wu={APPLE:"apple",BING:"bing"},ny=(t,e)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[t];return r&&e[r]},ry=(t,e=[],n,r={route:!1},c)=>{const d="Failed to construct query for maps service.";let g=t&&yf([t.line1,t.line2,t.city,t.region,t.postalCode,t.countryCode]);switch(r.provider){case Wu.APPLE:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return pf(`${c.latitude},${c.longitude}`,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return pf(g,r.route)}case Wu.BING:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return mf(`${c.latitude},${c.longitude}`,r.route);if(g=t&&yf([t.line1,t.city,t.region,t.postalCode]),!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return mf(g,r.route)}default:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return _f(`${c.latitude},${c.longitude}`,r.route);const p=e.find(C=>{var v;return((v=C==null?void 0:C.publisher)==null?void 0:v.toUpperCase())===sp.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return iy(n,g,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return _f(g,r.route)}}},pf=(t,e)=>e?`https://maps.apple.com/?daddr=${t}`:`https://maps.apple.com/?address=${t}`,mf=(t,e)=>e?`https://bing.com/maps/default.aspx?rtp=adr.${t}`:`https://bing.com/maps/default.aspx?where1=${t}`,iy=(t,e,n)=>{const r=e?`&query=${e}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${t}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${t}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${t}&destination=direct`},_f=(t,e)=>e?`https://maps.google.com/maps/dir/?api=1&destination=${t}`:`https://maps.google.com/maps/search/?api=1&query=${t}`,yf=(t=[])=>{if(!t.length)return"";const e=t.filter(Boolean).join(", ");return encodeURI(e)},oy=({address:t,lines:e,separator:n=",",...r})=>{const c=(e||ty(t.countryCode)).map(d=>at.jsx(sy,{address:t,line:d,separator:n},d.toString()));return et.createElement("div",{...r,key:t.toString()},c)},sy=({address:t,line:e,separator:n})=>{const r=[];for(const c of e){if(c===","){r.push(at.jsx("span",{children:n},c));continue}const d=t[c];if(!d)continue;const g=ny(c,t);if(g){r.push(at.jsxs(X_.Fragment,{children:[" ",at.jsx("abbr",{title:g,children:d})]},c));continue}r.push(at.jsx("span",{children:" "+d},c))}return at.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay=typeof window<"u"&&typeof window.document<"u",cy=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,uy=(typeof self>"u"?"undefined":ly(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",dy=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),fy=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Nf=tl.isBrowser=ay;tl.isWebWorker=uy;var hy=tl.isNode=cy;tl.isJsDom=dy;var gy=tl.isDeno=fy;class py{constructor(){Vn(this,"name");Vn(this,"isServerSide");Vn(this,"version");var e;gy?(this.name="deno",this.version="",Nf&&(this.version=((e=window.Deno)==null?void 0:e.version.deno)||""),this.isServerSide=!0):hy?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):Nf?(this.name="browser",this.version=navigator.userAgent,this.isServerSide=!1):(this.name="unknown",this.version="",this.isServerSide=!1)}getNodeMajorVersion(){if(this.name!=="node")throw new Error("Not running in Node.");return+this.version.split(".")[0]}}const Xs=()=>new py,my=(...t)=>typeof window<"u"&&window.IS_PRODUCTION||!1;function Yc(t){if(!cd(t))throw new Error("Parameter was not an error")}function cd(t){return _y(t)==="[object Error]"||t instanceof Error}function _y(t){return Object.prototype.toString.call(t)}function yy(t){let e,n="";if(t.length===0)e={};else if(cd(t[0]))e={cause:t[0]},n=t.slice(1).join(" ")||"";else if(t[0]&&typeof t[0]=="object")e=Object.assign({},t[0]),n=t.slice(1).join(" ")||"";else if(typeof t[0]=="string")e={},n=n=t.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:e,shortMessage:n}}class hi extends Error{constructor(e,n){const r=[...arguments],{options:c,shortMessage:d}=yy(r);let g=d;if(c.cause&&(g=`${g}: ${c.cause.message}`),super(g),this.message=g,c.name&&typeof c.name=="string"?this.name=c.name:this.name="Layerr",c.cause&&Object.defineProperty(this,"_cause",{value:c.cause}),Object.defineProperty(this,"_info",{value:{}}),c.info&&typeof c.info=="object"&&Object.assign(this._info,c.info),Error.captureStackTrace){const p=c.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(e){return Yc(e),e._cause&&cd(e._cause)?e._cause:null}static fullStack(e){Yc(e);const n=hi.cause(e);return n?`${e.stack}
25
+ Check the top-level render call using <`+nt+">.")}return Ge}}function hr(ye,Ge){{if(!ye._store||ye._store.validated||ye.key!=null)return;ye._store.validated=!0;var nt=It(Ge);if(Ut[nt])return;Ut[nt]=!0;var Nt="";ye&&ye._owner&&ye._owner!==Et.current&&(Nt=" It was passed a child from "+_e(ye._owner.type)+"."),Ot(ye),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',nt,Nt),Ot(null)}}function Sr(ye,Ge){{if(typeof ye!="object")return;if(yt(ye))for(var nt=0;nt<ye.length;nt++){var Nt=ye[nt];xt(Nt)&&hr(Nt,Ge)}else if(xt(ye))ye._store&&(ye._store.validated=!0);else if(ye){var Ht=P(ye);if(typeof Ht=="function"&&Ht!==ye.entries)for(var Kt=Ht.call(ye),$t;!($t=Kt.next()).done;)xt($t.value)&&hr($t.value,Ge)}}}function Fi(ye){{var Ge=ye.type;if(Ge==null||typeof Ge=="string")return;var nt;if(typeof Ge=="function")nt=Ge.propTypes;else if(typeof Ge=="object"&&(Ge.$$typeof===N||Ge.$$typeof===O))nt=Ge.propTypes;else return;if(nt){var Nt=_e(Ge);Ye(nt,ye.props,"prop",Nt,ye)}else if(Ge.PropTypes!==void 0&&!At){At=!0;var Ht=_e(Ge);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Ht||"Unknown")}typeof Ge.getDefaultProps=="function"&&!Ge.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ps(ye){{for(var Ge=Object.keys(ye.props),nt=0;nt<Ge.length;nt++){var Nt=Ge[nt];if(Nt!=="children"&&Nt!=="key"){Ot(ye),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Nt),Ot(null);break}}ye.ref!==null&&(Ot(ye),$("Invalid attribute `ref` supplied to `React.Fragment`."),Ot(null))}}function ms(ye,Ge,nt,Nt,Ht,Kt){{var $t=U(ye);if(!$t){var Pt="";(ye===void 0||typeof ye=="object"&&ye!==null&&Object.keys(ye).length===0)&&(Pt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var mn=bt();mn?Pt+=mn:Pt+=Qt();var sn;ye===null?sn="null":yt(ye)?sn="array":ye!==void 0&&ye.$$typeof===e?(sn="<"+(_e(ye.type)||"Unknown")+" />",Pt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof ye,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,Pt)}var nn=_t(ye,Ge,nt,Ht,Kt);if(nn==null)return nn;if($t){var $n=Ge.children;if($n!==void 0)if(Nt)if(yt($n)){for(var pr=0;pr<$n.length;pr++)Sr($n[pr],ye);Object.freeze&&Object.freeze($n)}else $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Sr($n,ye)}return ye===r?ps(nn):Fi(nn),nn}}function fn(ye,Ge,nt){return ms(ye,Ge,nt,!0)}function gr(ye,Ge,nt){return ms(ye,Ge,nt,!1)}var Jr=gr,_s=fn;Bl.Fragment=r,Bl.jsx=Jr,Bl.jsxs=_s}()),Bl}process.env.NODE_ENV==="production"?Hu.exports=Q_():Hu.exports=ey();var at=Hu.exports;function ty(t){switch(t){case"AD":case"AM":case"AT":case"AX":case"AZ":case"BA":case"BY":case"CY":case"CZ":case"DK":case"DZ":case"EC":case"EH":case"ET":case"FI":case"FR":case"GE":case"GF":case"GI":case"GP":case"GW":case"HT":case"KE":case"KV":case"KW":case"LA":case"LU":case"MC":case"MD":case"ME":case"MG":case"MK":case"MQ":case"MZ":case"NC":case"NL":case"NO":case"PL":case"PT":case"PY":case"RE":case"RS":case"SA":case"SE":case"SJ":case"SM":case"SN":case"TC":case"TJ":case"TM":case"TN":case"TZ":case"UY":case"VG":case"ZM":return[["line1"],["line2"],["postalCode","city"],["countryCode"]];case"AF":case"IR":return[["line1"],["line2"],["city"],["region"],["postalCode"],["countryCode"]];case"AG":case"AO":case"AW":case"BJ":case"BO":case"BS":case"BZ":case"CI":case"CW":case"DJ":case"FJ":case"GA":case"GH":case"GM":case"GY":case"JM":case"KI":case"LY":case"MW":case"NA":case"NR":case"PS":case"QA":case"RW":case"SC":case"SR":case"SX":case"TG":case"TT":case"UG":case"VU":return[["line1"],["line2"],["city"],["countryCode"]];case"AL":case"EE":case"IS":return[["line1"],["line2"],["postalCode","city"]];case"AR":return[["line1"],["line2"],["postalCode","city",",","region"],["countryCode"]];case"AS":case"BB":case"BD":case"BM":case"BN":case"BT":case"CR":case"DO":case"FK":case"FM":case"GR":case"GU":case"JO":case"KZ":case"LB":case"LK":case"LS":case"MA":case"MH":case"MM":case"MR":case"MT":case"MV":case"NG":case"PG":case"PK":case"PR":case"RO":case"SG":case"VC":case"WS":return[["line1"],["line2"],["city","postalCode"],["countryCode"]];case"AU":case"CA":case"SZ":case"US":case"VI":return[["line1"],["line2"],["city",",","region","postalCode"],["countryCode"]];case"BE":case"PE":return[["line1"],["line2"],["postalCode","sublocality","city"],["countryCode"]];case"BF":case"BI":case"BQ":case"BW":case"CF":case"CG":case"CM":case"DM":case"ER":case"GQ":case"KM":case"ML":case"SY":case"TD":case"ZW":return[["line1"],["line2"],["city"],["region"],["countryCode"]];case"BG":return[["line1"],["postalCode","region"],["countryCode"]];case"BH":return[["line1"],["line2"],["sublocality","city"],["countryCode"]];case"BR":return[["line1"],["line2"],["sublocality"],["city","region"],["postalCode"],["countryCode"]];case"CH":case"DE":case"GT":case"IT":case"LI":case"MY":case"NI":case"OM":case"SK":case"VA":return[["line1"],["line2"],["postalCode","city","region"],["countryCode"]];case"CL":case"PF":return[["line1"],["line2"],["city","postalCode","region"],["countryCode"]];case"CN":return[["region","city","sublocality"],["line1"],["line2"],["countryCode"]];case"CO":case"ID":case"IQ":case"KH":case"MP":case"NP":case"PW":case"UA":return[["line1"],["line2"],["city","region","postalCode"],["countryCode"]];case"EG":return[["line1"],["line2"],["sublocality","city","region","postalCode"],["countryCode"]];case"ES":case"IL":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"GB":case"MN":case"ZA":return[["line1"],["line2"],["sublocality","city","postalCode"],["countryCode"]];case"GG":case"IM":case"JE":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"GN":return[["line1","line2","city"],["countryCode"]];case"HK":return[["line1"],["line2"],["sublocality"],["city"],["region"],["countryCode"]];case"HR":return[["line1"],["postalCode","city","region"],["countryCode"]];case"HU":case"SI":return[["postalCode","city"],["line1"],["line2"],["countryCode"]];case"IE":return[["line1"],["line2"],["sublocality"],["city","region","postalCode"],["countryCode"]];case"IN":case"VE":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"JP":return[["line2"],["line1","sublocality"],["city","region"],["postalCode"],["countryCode"]];case"KR":return[["countryCode"],["region","city","sublocality","line1"],["line2"],["postalCode"]];case"KY":return[["line1"],["line2"],["postalCode"],["countryCode"]];case"LT":return[["line1"],["postalCode","city","sublocality","region"],["countryCode"]];case"LV":return[["line1"],["city",",","postalCode"],["countryCode"]];case"MO":return[["line1"],["line2"],["sublocality"],["city"],["countryCode"]];case"MU":return[["line1"],["line2"],["city"],["region","postalCode"],["countryCode"]];case"MX":return[["line1"],["line2"],["sublocality"],["postalCode","city",",","region"],["countryCode"]];case"NE":case"SD":return[["line1"],["line2"],["postalCode"],["city"],["region"],["countryCode"]];case"NZ":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"PH":case"TW":case"VN":return[["line1"],["line2"],["sublocality","city"],["region","postalCode"],["countryCode"]];case"RU":return[["line1"],["line2"],["city"],["postalCode"],["countryCode"]];case"SB":case"SL":case"ST":case"TL":case"TO":case"TV":return[["line1"],["line2"],["city",",","region"],["countryCode"]];case"TH":case"TR":return[["line1"],["line2"],["sublocality"],["postalCode","city"],["countryCode"]];case"UZ":return[["line1"],["line2"],["region","postalCode"],["countryCode"]]}return[["line1","line2"],["city","region","postalCode"],["countryCode"]]}const sp={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Wu={APPLE:"apple",BING:"bing"},ny=(t,e)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[t];return r&&e[r]},ry=(t,e=[],n,r={route:!1},c)=>{const d="Failed to construct query for maps service.";let g=t&&yf([t.line1,t.line2,t.city,t.region,t.postalCode,t.countryCode]);switch(r.provider){case Wu.APPLE:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return pf(`${c.latitude},${c.longitude}`,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return pf(g,r.route)}case Wu.BING:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return mf(`${c.latitude},${c.longitude}`,r.route);if(g=t&&yf([t.line1,t.city,t.region,t.postalCode]),!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return mf(g,r.route)}default:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return _f(`${c.latitude},${c.longitude}`,r.route);const p=e.find(N=>{var v;return((v=N==null?void 0:N.publisher)==null?void 0:v.toUpperCase())===sp.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return iy(n,g,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return _f(g,r.route)}}},pf=(t,e)=>e?`https://maps.apple.com/?daddr=${t}`:`https://maps.apple.com/?address=${t}`,mf=(t,e)=>e?`https://bing.com/maps/default.aspx?rtp=adr.${t}`:`https://bing.com/maps/default.aspx?where1=${t}`,iy=(t,e,n)=>{const r=e?`&query=${e}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${t}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${t}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${t}&destination=direct`},_f=(t,e)=>e?`https://maps.google.com/maps/dir/?api=1&destination=${t}`:`https://maps.google.com/maps/search/?api=1&query=${t}`,yf=(t=[])=>{if(!t.length)return"";const e=t.filter(Boolean).join(", ");return encodeURI(e)},oy=({address:t,lines:e,separator:n=",",...r})=>{const c=(e||ty(t.countryCode)).map(d=>at.jsx(sy,{address:t,line:d,separator:n},d.toString()));return et.createElement("div",{...r,key:t.toString()},c)},sy=({address:t,line:e,separator:n})=>{const r=[];for(const c of e){if(c===","){r.push(at.jsx("span",{children:n},c));continue}const d=t[c];if(!d)continue;const g=ny(c,t);if(g){r.push(at.jsxs(X_.Fragment,{children:[" ",at.jsx("abbr",{title:g,children:d})]},c));continue}r.push(at.jsx("span",{children:" "+d},c))}return at.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ay=typeof window<"u"&&typeof window.document<"u",cy=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,uy=(typeof self>"u"?"undefined":ly(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",dy=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),fy=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Nf=tl.isBrowser=ay;tl.isWebWorker=uy;var hy=tl.isNode=cy;tl.isJsDom=dy;var gy=tl.isDeno=fy;class py{constructor(){Vn(this,"name");Vn(this,"isServerSide");Vn(this,"version");var e;gy?(this.name="deno",this.version="",Nf&&(this.version=((e=window.Deno)==null?void 0:e.version.deno)||""),this.isServerSide=!0):hy?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):Nf?(this.name="browser",this.version=navigator.userAgent,this.isServerSide=!1):(this.name="unknown",this.version="",this.isServerSide=!1)}getNodeMajorVersion(){if(this.name!=="node")throw new Error("Not running in Node.");return+this.version.split(".")[0]}}const Xs=()=>new py,my=(...t)=>typeof window<"u"&&window.IS_PRODUCTION||!1;function Yc(t){if(!cd(t))throw new Error("Parameter was not an error")}function cd(t){return _y(t)==="[object Error]"||t instanceof Error}function _y(t){return Object.prototype.toString.call(t)}function yy(t){let e,n="";if(t.length===0)e={};else if(cd(t[0]))e={cause:t[0]},n=t.slice(1).join(" ")||"";else if(t[0]&&typeof t[0]=="object")e=Object.assign({},t[0]),n=t.slice(1).join(" ")||"";else if(typeof t[0]=="string")e={},n=n=t.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:e,shortMessage:n}}class hi extends Error{constructor(e,n){const r=[...arguments],{options:c,shortMessage:d}=yy(r);let g=d;if(c.cause&&(g=`${g}: ${c.cause.message}`),super(g),this.message=g,c.name&&typeof c.name=="string"?this.name=c.name:this.name="Layerr",c.cause&&Object.defineProperty(this,"_cause",{value:c.cause}),Object.defineProperty(this,"_info",{value:{}}),c.info&&typeof c.info=="object"&&Object.assign(this._info,c.info),Error.captureStackTrace){const p=c.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(e){return Yc(e),e._cause&&cd(e._cause)?e._cause:null}static fullStack(e){Yc(e);const n=hi.cause(e);return n?`${e.stack}
26
26
  caused by: ${hi.fullStack(n)}`:e.stack}static info(e){Yc(e);const n={},r=hi.cause(e);return r&&Object.assign(n,hi.info(r)),e._info&&Object.assign(n,e._info),n}cause(){return hi.cause(this)}toString(){let e=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(e=`${e}: ${this.message}`),e}}const lp="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ql=32,Cf=0xffffffffffff,Ny=10,Cy=16,jl=Object.freeze({source:"ulid"});function Ey(t){const e=Ty(),n=e&&(e.crypto||e.msCrypto)||null;if(typeof(n==null?void 0:n.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return n.getRandomValues(r),r[0]/255};if(typeof(n==null?void 0:n.randomBytes)=="function")return()=>n.randomBytes(1).readUInt8()/255;throw new hi({info:{code:"PRNG_DETECT",...jl}},"Failed to find a reliable PRNG")}function Ty(){return Sy()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function xy(t,e){let n="";for(;t>0;t--)n=wy(e)+n;return n}function vy(t,e){if(isNaN(t))throw new hi({info:{code:"ENC_TIME_NAN",...jl}},`Time must be a number: ${t}`);if(t>Cf)throw new hi({info:{code:"ENC_TIME_SIZE_EXCEED",...jl}},`Cannot encode a time larger than ${Cf}: ${t}`);if(t<0)throw new hi({info:{code:"ENC_TIME_NEG",...jl}},`Time must be positive: ${t}`);if(Number.isInteger(t)===!1)throw new hi({info:{code:"ENC_TIME_TYPE",...jl}},`Time must be an integer: ${t}`);let n,r="";for(let c=e;c>0;c--)n=t%ql,r=lp.charAt(n)+r,t=(t-n)/ql;return r}function Sy(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function wy(t){let e=Math.floor(t()*ql);return e===ql&&(e=ql-1),lp.charAt(e)}function Oy(t,e){const n=Ey(),r=isNaN(t)?Date.now():t;return vy(r,Ny)+xy(Cy,n)}var Ef="yext_analytics_session_id";function Dy(){if(typeof window>"u")return null;try{var t=window.sessionStorage.getItem(Ef);return t||(t=Oy(),window.sessionStorage.setItem(Ef,t)),t}catch(e){return console.warn(`Unable to use browser sessionStorage for sessionId.
27
- `,e),null}}const Ay="@yext/analytics",My="1.0.0-beta.5",Ry="An analytics library for Yext",by="fusion@yext.com",Ly="BSD-3-Clause",ky="./lib/commonjs/src/index.js",Iy="./lib/esm/src/index.js",Py="./lib/analytics.d.ts",$y=["analytics","report","events","yext"],Fy=["src","lib","THIRD-PARTY-NOTICES"],By={build:"rm -rf lib/** && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && npm run format-check && npm run api-extractor && npm run generate-docs && npm run generate-notices && vite build",prepare:"husky install","format-check":"prettier --check . && eslint .","format-fix":"prettier --write . && eslint . --fix","api-extractor":"api-extractor run --local --verbose","generate-docs":"api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",prepublishOnly:"npm run build",test:"jest && playwright test",dev:"tsc -p tsconfig.esm.json --watch","generate-notices":"generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"},Hy={"@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@microsoft/api-documenter":"^7.15.3","@microsoft/api-extractor":"^7.19.4","@playwright/test":"^1.38.0","@types/jest":"^29.5.12","@types/node":"^20.6.0","@typescript-eslint/eslint-plugin":"^6.19.1","@typescript-eslint/parser":"^6.19.1",eslint:"^7.32.0","fetch-mock-jest":"^1.5.1","generate-license-file":"^1.3.0",husky:"^8.0.3",jest:"^27.0.6","jest-fetch-mock":"^3.0.3",prettier:"^3.0.3",typescript:"^4.1.5",vite:"^4.4.9"},Wy={bail:!1,verbose:!0,collectCoverage:!0,testEnvironment:"jsdom",collectCoverageFrom:["src/**","!src/utils/**"],moduleFileExtensions:["js","ts"],moduleDirectories:["node_modules","<rootDir>"],testMatch:["<rootDir>/tests/**/*.ts"],resetMocks:!0,restoreMocks:!0,clearMocks:!0,passWithNoTests:!0},Ky={ulidx:"^2.0.0"},Tf={name:Ay,version:My,description:Ry,author:by,license:Ly,main:ky,module:Iy,types:Py,keywords:$y,files:Fy,scripts:By,devDependencies:Hy,jest:Wy,dependencies:Ky};function zy(t,e,n){return n.debug?(ap(!0,e,n),!0):navigator.sendBeacon(t,JSON.stringify(e))}function Uy(t,e,n){return n.debug?(ap(!1,e,n),Promise.resolve(new Response)):fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0})}function Gy(t,e){return!e&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function ap(t,e,n){var r=t?"Beacon":"fetch()";console.log("[DEBUG] AnalyticsConfig object at time of call to report():",n),console.log("[DEBUG] The following EventPayload would be sent to the Yext Events API using ".concat(r,":"),e)}var Ku=function(){return Ku=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(t[c]=e[c])}return t},Ku.apply(this,arguments)},zu=function(t,e){if(!e||Object.keys(e).length===0)return t;if(!t||Object.keys(t).length===0)return e;var n=JSON.parse(JSON.stringify(t));for(var r in e)if(e.hasOwnProperty(r)){var c=e[r];c==null?delete n[r]:typeof c!="object"?n[r]=c:n[r]=zu(n[r],c)}return Ku({},n)},Yy="yextevents.com/accounts/me/events";function jy(t,e){var n=t==="SANDBOX",r=e==null?void 0:e.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+Yy}var Vy=function(t,e,n,r){function c(d){return d instanceof n?d:new n(function(g){g(d)})}return new(n||(n=Promise))(function(d,g){function p(T){try{v(r.next(T))}catch(O){g(O)}}function C(T){try{v(r.throw(T))}catch(O){g(O)}}function v(T){T.done?d(T.value):c(T.value).then(p,C)}v((r=r.apply(t,e||[])).next())})},qy=function(t,e){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,c,d,g;return g={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function p(v){return function(T){return C([v,T])}}function C(v){if(r)throw new TypeError("Generator is already executing.");for(;g&&(g=0,v[0]&&(n=0)),n;)try{if(r=1,c&&(d=v[0]&2?c.return:v[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,v[1])).done)return d;switch(c=0,d&&(v=[v[0]&2,d.value]),v[0]){case 0:case 1:d=v;break;case 4:return n.label++,{value:v[1],done:!1};case 5:n.label++,c=v[1],v=[0];continue;case 7:v=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(v[0]===6||v[0]===2)){n=0;continue}if(v[0]===3&&(!d||v[1]>d[0]&&v[1]<d[3])){n.label=v[1];break}if(v[0]===6&&n.label<d[1]){n.label=d[1],d=v;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(v);break}d[2]&&n.ops.pop(),n.trys.pop();continue}v=e.call(t,n)}catch(T){v=[6,T],c=0}finally{r=d=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},Zy=function(){function t(e,n){if(e.authorizationType!=="apiKey"&&e.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!e.authorization)throw new Error("Authorization must be provided.");this.config=e,this.payload=n}return t.prototype.with=function(e){var n=this.payload===void 0?e:zu(this.payload,e);return new t(this.config,n)},t.prototype.report=function(e){var n;return Vy(this,void 0,void 0,function(){var r,c,d,g,p=this;return qy(this,function(C){return r=zu((n=this.payload)!==null&&n!==void 0?n:{},e??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Dy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Tf.version:r.clientSdk=(g={},g.ANALYTICS=Tf.version,g),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,c=Gy(r,this.config.forceFetch),d=jy(this.config.env,this.config.region),c?[2,new Promise(function(v,T){zy(d,r,p.config)?v(""):T("Failed Beacon Call")})]:[2,Uy(d,r,this.config).then(function(v){return v}).catch(function(v){return v})]})})},t}();function Jy(t){return new Zy(t)}function Uu(t){return t?t.toLowerCase().trim().replace(/\s/g,""):""}function cp(t,e){return[t,e].filter(n=>!!n).map(n=>Uu(n)).join("_")}const Xy=t=>{switch(Math.floor(t/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},ud=et.createContext(null),Qy=et.lazy(()=>Promise.resolve().then(()=>require("./debugger-D4yFabmm.cjs")));function eN(t){const{children:e,apiKey:n,currency:r,templateData:c,requireOptIn:d,disableSessionTracking:g,enableDebugging:p}=t,C=et.useRef(null),[v,T]=et.useState(!1);et.useEffect(()=>{T(!0)},[]),C.current===null&&(C.current=new up(n,r,c,d,g,p??sc()));const O=C.current;return at.jsxs(at.Fragment,{children:[at.jsx(ud.Provider,{value:O,children:e}),v&&(p||sc())&&Xs().name==="browser"?at.jsx(et.Suspense,{fallback:at.jsx(at.Fragment,{}),children:at.jsx(Qy,{})}):null]})}function sc(){return Xs().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class up{constructor(e,n,r,c,d,g=!1){Vn(this,"_optedIn");Vn(this,"_sessionTrackingEnabled");Vn(this,"_analyticsEventService");Vn(this,"_pageViewFired",!1);this.apiKey=e,this.defaultCurrency=n,this.templateData=r,this.enableDebugging=g,this._optedIn=!c,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Xs().name!=="browser"||!this._optedIn)return;if(!my()&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const e=Xy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:e||"US",sessionTrackingEnabled:this._sessionTrackingEnabled,debug:this.getDebugEnabled()},r={pages:{siteUid:this.templateData.document.siteId,template:this.templateData.document.__.name},entity:this.templateData.document.uid||void 0};this._analyticsEventService=Jy(n).with(r)}canTrack(){return Xs().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(e){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:e}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var e;if(!this.canTrack())return Promise.resolve(void 0);await((e=this._analyticsEventService)==null?void 0:e.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(e){var O;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:c,currency:d,amount:g,destinationUrl:p,customTags:C,customValues:v}=e;let T;g&&(T={amount:g,currency:d||this.defaultCurrency}),await((O=this._analyticsEventService)==null?void 0:O.report({action:n,pages:{scope:Uu(r)||void 0,originalEventName:cp(r||"",Uu(c)||"")},value:T,destinationUrl:p,customTags:C,customValues:v}))}getDebugEnabled(){return this.enableDebugging||sc()}}const Gu=et.createContext({name:""}),dd=()=>et.useContext(Gu).name;function tN(t){var g;const e=dd(),[n]=et.useState({name:cp(e,t.name)}),r=(g=nl())==null?void 0:g.getDebugEnabled(),[c,d]=et.useState(!1);return et.useEffect(()=>{d(!0)},[]),r&&c?at.jsx("section",{"data-ya-scope":n.name,children:at.jsx(Gu.Provider,{value:n,children:t.children})}):at.jsx(Gu.Provider,{value:n,children:t.children})}function nl(){const t=et.useContext(ud);if(!t)return t;Xs().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await t.optIn()});const e=dd();return{getDebugEnabled(){return t.getDebugEnabled()},identify(n){return t.identify(n)},optIn(){return t.optIn()},pageView(){return t.pageView()},track(n){return t.track({...n,scope:n.scope??e})}}}const nN=()=>{var t;return(t=nl())==null?void 0:t.track},rN=()=>{var t;return(t=nl())==null?void 0:t.pageView},iN=()=>{var t;return(t=nl())==null?void 0:t.identify},Ao={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},oN=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}const n=t.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${t}`);return}r="eu"}if(!t.pathname.startsWith("/f")){console.error(`Invalid path: ${t}`);return}const c=t.pathname.replace(/^\//,"").split("/");if(c.length<2||c.length>3){console.error(`Invalid path: ${t}`);return}let d;if(c[0]==="f")d="prod";else switch(c[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${t}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${t}`);return}let g;if(c.length===3&&(g=parseInt(c[1]),Number.isNaN(g))){console.error(`Invalid account id: ${t}`);return}const p=c[c.length-1].split("."),C=p.length===2?`.${p[1]}`:"",v=p[0];return{scheme:e,partition:r,env:d,accountId:g,contentHash:v,extension:C}},sN=(t,e,n)=>{const r=`https://dyn${t.partition==="us"?"":`.${t.partition}`}.mktgcdn.com`;let c="f";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}const d=t.accountId!==void 0?`${t.accountId}/`:"";return`${r}/${c}/${d}${t.contentHash}${t.extension}/width=${Math.round(e)},height=${Math.round(n)}`},lN=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}if(t.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${t}`);return}if(!t.pathname.startsWith("/p")){console.error(`Invalid path: ${t}`);return}const n=t.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${t}`);return}let r;if(n[0]==="p")r="prod";else switch(n[0].replace("p-","")){case"sandbox":{r="sbx";break}case"qa":{r="qa";break}case"dev":{r="dev";break}default:{console.error(`Invalid path: ${t}`);return}}const c=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${t}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${t}`);return}}const g=n[n.length-1].split("."),p=g.length===2?`.${g[1]}`:"",C=g[0];return{scheme:e,env:r,contentHash:c,aspectRatio:d,name:C,extension:p}},aN=(t,e,n)=>{const r="https://dyn.mktgcdn.com";let c="p";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}return`${r}/${c}/${t.contentHash}/width=${Math.round(e)},height=${Math.round(n)}`},Yu=(t,e,n)=>{if(!dp(t)){console.error(`Invalid image url: ${t}.`);return}const r=new URL(t);if(r.pathname.startsWith("/p")){const c=lN(r);if(c)return aN(c,e,n)}else if(r.pathname.startsWith("/f")){const c=oN(r);if(c)return sN(c,e,n)}return t},dp=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"},cN=({image:t,className:e,width:n,height:r,aspectRatio:c,layout:d=Ao.INTRINSIC,placeholder:g,imgOverrides:p,style:C={},loading:v="lazy"})=>{const T=et.useRef(null),[O,R]=et.useState(!1),b="image"in t?t.image:t;et.useEffect(()=>{var le;(le=T.current)!=null&&le.complete&&R(!0)},[]),uN(d,b.width,b.height,n,r,c);const x=Math.abs(b.width);x||console.warn("Invalid image width.");const w=Math.abs(b.height);if(w||console.warn("Invalid image height."),!dp(b.url))return console.error(`Invalid image url: ${b.url}`),at.jsx(at.Fragment,{children:g!=null&&g});const $=n&&n>0?n:void 0,W=r&&r>0?r:void 0,{src:P,imgStyle:H,widths:B}=dN(d,x,w,C,b.url,$,W,c),z=B.map(le=>`${Yu(b.url,le,w/x*le)} ${le}w`).join(", "),X=[640,768,1024,1280,1536],ee=B.map((le,j)=>j===B.length-1?`${le}px`:`(max-width: ${X[j]}px) ${le}px`).join(", ");return at.jsxs(at.Fragment,{children:[!O&&g!=null&&g,at.jsx("img",{ref:T,style:H,src:P,className:e,width:$,height:W,srcSet:z,sizes:ee,loading:v,alt:b.alternateText||"",...p})]})},uN=(t,e,n,r,c,d)=>{if(e<0&&console.warn(`Invalid image width: ${e}.`),n<0&&console.warn(`Invalid image height: ${n}.`),t===Ao.FIXED){if(!r&&!c){console.warn("Using fixed layout but neither width nor height is passed as props.");return}r&&r<0&&console.warn(`Using fixed layout but width is invalid: ${r}.`),c&&c<0&&console.warn(`Using fixed layout but height is invalid: ${c}.`);return}(r||c)&&console.warn("Width or height is passed in but layout is not fixed. These will have no impact. If you want to have a fixed height or width then set layout to fixed."),t===Ao.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},dN=(t,e,n,r,c,d,g,p)=>{let C=[100,320,640,960,1280,1920],v=Yu(c,500,500);const T={...r};switch(T.objectFit=T.objectFit||"cover",T.objectPosition=T.objectPosition||"center",t){case Ao.INTRINSIC:T.maxWidth=e,T.width="100%",T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Ao.FIXED:{const{fixedWidth:O,fixedHeight:R,fixedWidths:b}=fN(e,n,C,d,g);T.width=O,T.height=R,C=b,v=Yu(c,O,R);break}case Ao.ASPECT:T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Ao.FILL:T.width="100%",T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;default:console.warn(`Unrecognized layout: ${t}.`);break}return{src:v,imgStyle:T,widths:C}},fN=(t,e,n,r,c)=>r&&c?{fixedWidth:r,fixedHeight:c,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*e/t,fixedWidths:[r]}:c?{fixedWidth:c/e*t,fixedHeight:c,fixedWidths:[c/e*t]}:{fixedWidth:t,fixedHeight:e,fixedWidths:n};var fp={exports:{}};/*!
27
+ `,e),null}}const Ay="@yext/analytics",My="1.0.0-beta.5",Ry="An analytics library for Yext",by="fusion@yext.com",Ly="BSD-3-Clause",ky="./lib/commonjs/src/index.js",Iy="./lib/esm/src/index.js",Py="./lib/analytics.d.ts",$y=["analytics","report","events","yext"],Fy=["src","lib","THIRD-PARTY-NOTICES"],By={build:"rm -rf lib/** && tsc -p tsconfig.cjs.json && tsc -p tsconfig.esm.json && npm run format-check && npm run api-extractor && npm run generate-docs && npm run generate-notices && vite build",prepare:"husky install","format-check":"prettier --check . && eslint .","format-fix":"prettier --write . && eslint . --fix","api-extractor":"api-extractor run --local --verbose","generate-docs":"api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",prepublishOnly:"npm run build",test:"jest && playwright test",dev:"tsc -p tsconfig.esm.json --watch","generate-notices":"generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite"},Hy={"@babel/preset-env":"^7.14.7","@babel/preset-typescript":"^7.14.5","@microsoft/api-documenter":"^7.15.3","@microsoft/api-extractor":"^7.19.4","@playwright/test":"^1.38.0","@types/jest":"^29.5.12","@types/node":"^20.6.0","@typescript-eslint/eslint-plugin":"^6.19.1","@typescript-eslint/parser":"^6.19.1",eslint:"^7.32.0","fetch-mock-jest":"^1.5.1","generate-license-file":"^1.3.0",husky:"^8.0.3",jest:"^27.0.6","jest-fetch-mock":"^3.0.3",prettier:"^3.0.3",typescript:"^4.1.5",vite:"^4.4.9"},Wy={bail:!1,verbose:!0,collectCoverage:!0,testEnvironment:"jsdom",collectCoverageFrom:["src/**","!src/utils/**"],moduleFileExtensions:["js","ts"],moduleDirectories:["node_modules","<rootDir>"],testMatch:["<rootDir>/tests/**/*.ts"],resetMocks:!0,restoreMocks:!0,clearMocks:!0,passWithNoTests:!0},Ky={ulidx:"^2.0.0"},Tf={name:Ay,version:My,description:Ry,author:by,license:Ly,main:ky,module:Iy,types:Py,keywords:$y,files:Fy,scripts:By,devDependencies:Hy,jest:Wy,dependencies:Ky};function zy(t,e,n){return n.debug?(ap(!0,e,n),!0):navigator.sendBeacon(t,JSON.stringify(e))}function Uy(t,e,n){return n.debug?(ap(!1,e,n),Promise.resolve(new Response)):fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0})}function Gy(t,e){return!e&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function ap(t,e,n){var r=t?"Beacon":"fetch()";console.log("[DEBUG] AnalyticsConfig object at time of call to report():",n),console.log("[DEBUG] The following EventPayload would be sent to the Yext Events API using ".concat(r,":"),e)}var Ku=function(){return Ku=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(t[c]=e[c])}return t},Ku.apply(this,arguments)},zu=function(t,e){if(!e||Object.keys(e).length===0)return t;if(!t||Object.keys(t).length===0)return e;var n=JSON.parse(JSON.stringify(t));for(var r in e)if(e.hasOwnProperty(r)){var c=e[r];c==null?delete n[r]:typeof c!="object"?n[r]=c:n[r]=zu(n[r],c)}return Ku({},n)},Yy="yextevents.com/accounts/me/events";function jy(t,e){var n=t==="SANDBOX",r=e==null?void 0:e.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+Yy}var Vy=function(t,e,n,r){function c(d){return d instanceof n?d:new n(function(g){g(d)})}return new(n||(n=Promise))(function(d,g){function p(T){try{v(r.next(T))}catch(O){g(O)}}function N(T){try{v(r.throw(T))}catch(O){g(O)}}function v(T){T.done?d(T.value):c(T.value).then(p,N)}v((r=r.apply(t,e||[])).next())})},qy=function(t,e){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,c,d,g;return g={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function p(v){return function(T){return N([v,T])}}function N(v){if(r)throw new TypeError("Generator is already executing.");for(;g&&(g=0,v[0]&&(n=0)),n;)try{if(r=1,c&&(d=v[0]&2?c.return:v[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,v[1])).done)return d;switch(c=0,d&&(v=[v[0]&2,d.value]),v[0]){case 0:case 1:d=v;break;case 4:return n.label++,{value:v[1],done:!1};case 5:n.label++,c=v[1],v=[0];continue;case 7:v=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(v[0]===6||v[0]===2)){n=0;continue}if(v[0]===3&&(!d||v[1]>d[0]&&v[1]<d[3])){n.label=v[1];break}if(v[0]===6&&n.label<d[1]){n.label=d[1],d=v;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(v);break}d[2]&&n.ops.pop(),n.trys.pop();continue}v=e.call(t,n)}catch(T){v=[6,T],c=0}finally{r=d=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},Zy=function(){function t(e,n){if(e.authorizationType!=="apiKey"&&e.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!e.authorization)throw new Error("Authorization must be provided.");this.config=e,this.payload=n}return t.prototype.with=function(e){var n=this.payload===void 0?e:zu(this.payload,e);return new t(this.config,n)},t.prototype.report=function(e){var n;return Vy(this,void 0,void 0,function(){var r,c,d,g,p=this;return qy(this,function(N){return r=zu((n=this.payload)!==null&&n!==void 0?n:{},e??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Dy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Tf.version:r.clientSdk=(g={},g.ANALYTICS=Tf.version,g),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,c=Gy(r,this.config.forceFetch),d=jy(this.config.env,this.config.region),c?[2,new Promise(function(v,T){zy(d,r,p.config)?v(""):T("Failed Beacon Call")})]:[2,Uy(d,r,this.config).then(function(v){return v}).catch(function(v){return v})]})})},t}();function Jy(t){return new Zy(t)}function Uu(t){return t?t.toLowerCase().trim().replace(/\s/g,""):""}function cp(t,e){return[t,e].filter(n=>!!n).map(n=>Uu(n)).join("_")}const Xy=t=>{switch(Math.floor(t/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},ud=et.createContext(null),Qy=et.lazy(()=>Promise.resolve().then(()=>require("./debugger-D1L4Q0Ym.cjs")));function eN(t){const{children:e,apiKey:n,currency:r,templateData:c,requireOptIn:d,disableSessionTracking:g,enableDebugging:p}=t,N=et.useRef(null),[v,T]=et.useState(!1);et.useEffect(()=>{T(!0)},[]),N.current===null&&(N.current=new up(n,r,c,d,g,p??sc()));const O=N.current;return at.jsxs(at.Fragment,{children:[at.jsx(ud.Provider,{value:O,children:e}),v&&(p||sc())&&Xs().name==="browser"?at.jsx(et.Suspense,{fallback:at.jsx(at.Fragment,{}),children:at.jsx(Qy,{})}):null]})}function sc(){return Xs().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class up{constructor(e,n,r,c,d,g=!1){Vn(this,"_optedIn");Vn(this,"_sessionTrackingEnabled");Vn(this,"_analyticsEventService");Vn(this,"_pageViewFired",!1);this.apiKey=e,this.defaultCurrency=n,this.templateData=r,this.enableDebugging=g,this._optedIn=!c,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Xs().name!=="browser"||!this._optedIn)return;if(!my()&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const e=Xy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:e||"US",sessionTrackingEnabled:this._sessionTrackingEnabled,debug:this.getDebugEnabled()},r={pages:{siteUid:this.templateData.document.siteId,template:this.templateData.document.__.name},entity:this.templateData.document.uid||void 0};this._analyticsEventService=Jy(n).with(r)}canTrack(){return Xs().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(e){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:e}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var e;if(!this.canTrack())return Promise.resolve(void 0);await((e=this._analyticsEventService)==null?void 0:e.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(e){var O;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:c,currency:d,amount:g,destinationUrl:p,customTags:N,customValues:v}=e;let T;g&&(T={amount:g,currency:d||this.defaultCurrency}),await((O=this._analyticsEventService)==null?void 0:O.report({action:n,pages:{scope:Uu(r)||void 0,originalEventName:cp(r||"",Uu(c)||"")},value:T,destinationUrl:p,customTags:N,customValues:v}))}getDebugEnabled(){return this.enableDebugging||sc()}}const Gu=et.createContext({name:""}),dd=()=>et.useContext(Gu).name;function tN(t){var g;const e=dd(),[n]=et.useState({name:cp(e,t.name)}),r=(g=nl())==null?void 0:g.getDebugEnabled(),[c,d]=et.useState(!1);return et.useEffect(()=>{d(!0)},[]),r&&c?at.jsx("section",{"data-ya-scope":n.name,children:at.jsx(Gu.Provider,{value:n,children:t.children})}):at.jsx(Gu.Provider,{value:n,children:t.children})}function nl(){const t=et.useContext(ud);if(!t)return t;Xs().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await t.optIn()});const e=dd();return{getDebugEnabled(){return t.getDebugEnabled()},identify(n){return t.identify(n)},optIn(){return t.optIn()},pageView(){return t.pageView()},track(n){return t.track({...n,scope:n.scope??e})}}}const nN=()=>{var t;return(t=nl())==null?void 0:t.track},rN=()=>{var t;return(t=nl())==null?void 0:t.pageView},iN=()=>{var t;return(t=nl())==null?void 0:t.identify},Ao={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},oN=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}const n=t.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${t}`);return}r="eu"}if(!t.pathname.startsWith("/f")){console.error(`Invalid path: ${t}`);return}const c=t.pathname.replace(/^\//,"").split("/");if(c.length<2||c.length>3){console.error(`Invalid path: ${t}`);return}let d;if(c[0]==="f")d="prod";else switch(c[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${t}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${t}`);return}let g;if(c.length===3&&(g=parseInt(c[1]),Number.isNaN(g))){console.error(`Invalid account id: ${t}`);return}const p=c[c.length-1].split("."),N=p.length===2?`.${p[1]}`:"",v=p[0];return{scheme:e,partition:r,env:d,accountId:g,contentHash:v,extension:N}},sN=(t,e,n)=>{const r=`https://dyn${t.partition==="us"?"":`.${t.partition}`}.mktgcdn.com`;let c="f";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}const d=t.accountId!==void 0?`${t.accountId}/`:"";return`${r}/${c}/${d}${t.contentHash}${t.extension}/width=${Math.round(e)},height=${Math.round(n)}`},lN=t=>{const e=t.protocol.slice(0,-1);if(e!=="http"&&e!=="https"){console.error(`Invalid scheme: ${t}`);return}if(t.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${t}`);return}if(!t.pathname.startsWith("/p")){console.error(`Invalid path: ${t}`);return}const n=t.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${t}`);return}let r;if(n[0]==="p")r="prod";else switch(n[0].replace("p-","")){case"sandbox":{r="sbx";break}case"qa":{r="qa";break}case"dev":{r="dev";break}default:{console.error(`Invalid path: ${t}`);return}}const c=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${t}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${t}`);return}}const g=n[n.length-1].split("."),p=g.length===2?`.${g[1]}`:"",N=g[0];return{scheme:e,env:r,contentHash:c,aspectRatio:d,name:N,extension:p}},aN=(t,e,n)=>{const r="https://dyn.mktgcdn.com";let c="p";switch(t.env){case"prod":break;case"sbx":{c+="-sandbox";break}default:c+=`-${t.env.toString()}`}return`${r}/${c}/${t.contentHash}/width=${Math.round(e)},height=${Math.round(n)}`},Yu=(t,e,n)=>{if(!dp(t)){console.error(`Invalid image url: ${t}.`);return}const r=new URL(t);if(r.pathname.startsWith("/p")){const c=lN(r);if(c)return aN(c,e,n)}else if(r.pathname.startsWith("/f")){const c=oN(r);if(c)return sN(c,e,n)}return t},dp=t=>{let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"},cN=({image:t,className:e,width:n,height:r,aspectRatio:c,layout:d=Ao.INTRINSIC,placeholder:g,imgOverrides:p,style:N={},loading:v="lazy"})=>{const T=et.useRef(null),[O,b]=et.useState(!1),R="image"in t?t.image:t;et.useEffect(()=>{var le;(le=T.current)!=null&&le.complete&&b(!0)},[]),uN(d,R.width,R.height,n,r,c);const x=Math.abs(R.width);x||console.warn("Invalid image width.");const w=Math.abs(R.height);if(w||console.warn("Invalid image height."),!dp(R.url))return console.error(`Invalid image url: ${R.url}`),at.jsx(at.Fragment,{children:g!=null&&g});const P=n&&n>0?n:void 0,H=r&&r>0?r:void 0,{src:$,imgStyle:W,widths:B}=dN(d,x,w,N,R.url,P,H,c),z=B.map(le=>`${Yu(R.url,le,w/x*le)} ${le}w`).join(", "),X=[640,768,1024,1280,1536],ee=B.map((le,j)=>j===B.length-1?`${le}px`:`(max-width: ${X[j]}px) ${le}px`).join(", ");return at.jsxs(at.Fragment,{children:[!O&&g!=null&&g,at.jsx("img",{ref:T,style:W,src:$,className:e,width:P,height:H,srcSet:z,sizes:ee,loading:v,alt:R.alternateText||"",...p})]})},uN=(t,e,n,r,c,d)=>{if(e<0&&console.warn(`Invalid image width: ${e}.`),n<0&&console.warn(`Invalid image height: ${n}.`),t===Ao.FIXED){if(!r&&!c){console.warn("Using fixed layout but neither width nor height is passed as props.");return}r&&r<0&&console.warn(`Using fixed layout but width is invalid: ${r}.`),c&&c<0&&console.warn(`Using fixed layout but height is invalid: ${c}.`);return}(r||c)&&console.warn("Width or height is passed in but layout is not fixed. These will have no impact. If you want to have a fixed height or width then set layout to fixed."),t===Ao.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},dN=(t,e,n,r,c,d,g,p)=>{let N=[100,320,640,960,1280,1920],v=Yu(c,500,500);const T={...r};switch(T.objectFit=T.objectFit||"cover",T.objectPosition=T.objectPosition||"center",t){case Ao.INTRINSIC:T.maxWidth=e,T.width="100%",T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Ao.FIXED:{const{fixedWidth:O,fixedHeight:b,fixedWidths:R}=fN(e,n,N,d,g);T.width=O,T.height=b,N=R,v=Yu(c,O,b);break}case Ao.ASPECT:T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;case Ao.FILL:T.width="100%",T.aspectRatio=p?`${p}`:`${e} / ${n}`;break;default:console.warn(`Unrecognized layout: ${t}.`);break}return{src:v,imgStyle:T,widths:N}},fN=(t,e,n,r,c)=>r&&c?{fixedWidth:r,fixedHeight:c,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*e/t,fixedWidths:[r]}:c?{fixedWidth:c/e*t,fixedHeight:c,fixedWidths:[c/e*t]}:{fixedWidth:t,fixedHeight:e,fixedWidths:n};var fp={exports:{}};/*!
28
28
  Copyright (c) 2018 Jed Watson.
29
29
  Licensed under the MIT License (MIT), see
30
30
  http://jedwatson.github.io/classnames
31
- */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],c=0;c<arguments.length;c++){var d=arguments[c];if(d){var g=typeof d;if(g==="string"||g==="number")r.push(d);else if(Array.isArray(d)){if(d.length){var p=n.apply(null,d);p&&r.push(p)}}else if(g==="object"){if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]")){r.push(d.toString());continue}for(var C in d)e.call(d,C)&&d[C]&&r.push(C)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(fp);var hN=fp.exports;const Qs=ad(hN),xf=t=>t.linkType==="Email"||!t.linkType&&hp(t.link)?t.link.startsWith("mailto:")?t.link:`mailto:${t.link}`:t.linkType==="Phone"?t.link.startsWith("tel:")?t.link:`tel:${t.link}`:t.link,hp=t=>t.startsWith("mailto:")?!0:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t),gN=t=>t.cta??{link:t.href},gp=et.forwardRef(function(e,n){const r=gN(e),{children:c,onClick:d,className:g,eventName:p,scope:C,currency:v,amount:T,cta:O,obfuscate:R,customTags:b,customValues:x,...w}=e,$=O?"CTA_CLICK":"LINK",W=p||(O?"cta":"link"),P=nl();if(!(r!=null&&r.link))throw new Error("CTA's link is undefined");const H=R||R!==!1&&hp(r.link),B=async ee=>{const le=ee.currentTarget;let j="";if(H){ee.preventDefault();const U=le.href.split("/").at(-1);U&&(j=atob(U))}if(P!==null)try{await P.track({action:$,scope:e.scope,eventName:W,currency:v,amount:T,destinationUrl:j||le.href,customTags:b,customValues:x})}catch{console.error("Failed to report click Analytics Event")}d&&d(ee),j&&(window.location.href=j)},z=H?"Obfuscated, set a label or child":r.link,X={className:Qs("Link",g),href:H?btoa(xf(r)):xf(r),onClick:B,rel:e.target&&!e.rel?"noopener":void 0,ref:n};return P!=null&&P.getDebugEnabled()&&(X["data-ya-action"]=$,X["data-ya-scopeoverride"]=C,X["data-ya-eventname"]=W),at.jsx("a",{...X,...w,suppressHydrationWarning:!0,children:c||r.label||z})}),pN={URL:"URL",Email:"Email",Phone:"Phone"},dn=Object.freeze({DEGREE:Symbol("deg"),KILOMETER:Symbol("km"),MILE:Symbol("mi"),RADIAN:Symbol("r")}),jr=Object.freeze({MERCATOR:Symbol("mercator"),SPHERICAL:Symbol("spherical")}),jc=3959,Vc=6371,mN=["latitude","lat"],_N=["longitude","lon","lng","long"];function vf(t,e){for(const n of e)if(t[n]||t[n]===0)return t[n]}function Sf(t){switch(typeof t){case"string":case"number":const e=Number.parseFloat(t);if(Number.isNaN(e))throw new Error(`'${t}' must be convertible to a Number'`);return e;default:throw new Error(`typeof '${t}' must be a number or a string that can be converted to a number, is '${typeof t}'`)}}function cs(t){return t*Math.PI/180}function Ji(t){return t/Math.PI*180}function yN(t,e){const n=cs(t.latitude),r=cs(e.latitude),c=r-n,d=cs(e.longitude-t.longitude),g=Math.pow(Math.sin(c/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g))}function NN(t,e){const n=Math.tan(Math.PI/360*(t+90)),r=Math.tan(Math.PI/360*(e+90));return Math.log(r/n)}function CN(t,e){const r=Math.tan(Math.PI/360*(t+90))*Math.pow(Math.E,e);return Math.atan(r)*360/Math.PI-90}class tn{constructor(e,n){let r=e;typeof e=="object"&&(r=vf(e,mN),n=vf(e,_N),r=typeof r=="function"?r():r,n=typeof n=="function"?n():n),this.latitude=r,this.longitude=n}get latitude(){return this._lat}get longitude(){return this._lon}get normalLon(){return((this._lon+180)%360+360)%360-180}set latitude(e){this._lat=Math.max(-90,Math.min(Sf(e),90))}set longitude(e){this._lon=Sf(e)}add(e,n,r=dn.DEGREE,c=jr.SPHERICAL){if(c===jr.MERCATOR&&(r===dn.DEGREE||r===dn.RADIAN)){const d=r===dn.DEGREE?cs(e):e,g=r===dn.DEGREE?n:Ji(n);this.latitude=CN(this.latitude,d),this.longitude+=g}else switch(r){case dn.DEGREE:this.latitude+=e,this.longitude+=n;break;case dn.KILOMETER:this.latitude+=Ji(e)*Vc,this.longitude+=Ji(n)*Vc*Math.cos(cs(this.latitude));break;case dn.MILE:this.latitude+=Ji(e)*jc,this.longitude+=Ji(n)*jc*Math.cos(cs(this.latitude));break;case dn.RADIAN:this.latitude+=Ji(e),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${r}`)}}distanceTo(e,n=dn.MILE,r=jr.SPHERICAL){if(r===jr.MERCATOR&&(n===dn.DEGREE||n===dn.RADIAN)){const c=NN(this.latitude,e.latitude),d=Math.abs(e.normalLon-this.normalLon),g=cs(Math.min(d,360-d)),p=Math.sqrt(Math.pow(c,2)+Math.pow(g,2));switch(n){case dn.DEGREE:return Ji(p);case dn.RADIAN:return p;default:throw new Error(`unit unhandled: ${n}`)}}else{const c=yN(this,e);switch(n){case dn.DEGREE:return Ji(c);case dn.KILOMETER:return c*Vc;case dn.MILE:return c*jc;case dn.RADIAN:return c;default:throw new Error(`unit unhandled: ${n}`)}}}equals(e){return e&&e.latitude===this.latitude&&e.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function pp(t,e=()=>null){const n=document.createElement("script");n.async=!0,n.onload=e,n.src=t,document.head.appendChild(n)}const dr={FUNCTION:"function"};function vr(t,e){if(typeof t!==e)throw new Error(`Expected an object of type '${e}' but received '${typeof t}'`)}function fr(t,e){let n;try{n=t instanceof e}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${e.name}' but received '${t.constructor.name}'`)}class mp{constructor(e,n){fr(e,hs),fr(n,HTMLElement),this.providerMapClass=e.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(e){return this.controlEnabled=e,this}withPanHandler(e){return vr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return vr(e,dr.FUNCTION),this.panStartHandler=e,this}withProviderOptions(e){return this.providerOptions=e,this}build(){const e=this.providerMapClass;return new e(this)}}class rl{constructor(e){fr(e,mp),this._panHandler=e.panHandler,this._panStartHandler=e.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(e,n){throw new Error("not implemented")}setZoom(e,n){throw new Error("not implemented")}setZoomCenter(e,n,r){this.setZoom(e,r),this.setCenter(n,r)}}class _p{constructor(e){fr(e,hs),this.providerPinClass=e.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={}}withClickHandler(e){return vr(e,dr.FUNCTION),this.clickHandler=e,this}withFocusHandler(e){return vr(e,dr.FUNCTION),this.focusHandler=e,this}withHoverHandler(e){return vr(e,dr.FUNCTION),this.hoverHandler=e,this}withIcons(e){return this.icons=e,this}build(){const e=this.providerPinClass;return new e(this)}}class fd{constructor(e){fr(e,_p),this._clickHandler=e.clickHandler,this._focusHandler=e.focusHandler,this._hoverHandler=e.hoverHandler,this._icons=e.icons}setCoordinate(e){throw new Error("not implemented")}setMap(e,n){throw new Error("not implemented")}setProperties(e){throw new Error("not implemented")}}const EN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class gc extends fd{static get baseStyle(){return EN}constructor(e){super(e),this._pinEl=document.createElement("button"),Object.assign(this._pinEl.style,this.constructor.baseStyle),this._pinAlt=document.createElement("span"),this._pinAlt.classList.add("sr-only"),this._pinEl.appendChild(this._pinAlt),this._wrapper=document.createElement("div"),this._wrapper.style.pointerEvents="none",this._wrapper.appendChild(this._pinEl),this.addListeners()}addListeners(){this._wrapper.addEventListener("click",()=>this._clickHandler()),this._wrapper.addEventListener("focusin",()=>this._focusHandler(!0)),this._wrapper.addEventListener("focusout",()=>this._focusHandler(!1)),this._wrapper.addEventListener("mouseover",()=>this._hoverHandler(!0)),this._wrapper.addEventListener("mouseout",()=>this._hoverHandler(!1))}getPinElement(){return this._pinEl}getWrapperElement(){return this._wrapper}setProperties(e){this.setElementProperties(e);const n=e.getClass(),r=e.getElement()||this._pinEl,c=e.getZIndex();r.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=c,this._wrapper.setAttribute("class",n),r!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(r)))}setElementProperties(e){const n=e.getAnchorX(),r=e.getAnchorY(),c=e.getHeight(),d=this._icons[e.getIcon()],g=e.getSRText(),p=e.getWidth();Object.assign(this._pinEl.style,{backgroundImage:d?`url("${d}")`:"",height:c+"px",transform:`translate(${-100*n}%, ${-100*r}%)`,width:p+"px"}),this._pinAlt.innerText=g}}class fs{constructor(){this.loadFunction=(e,n,r,c)=>e(),this.mapClass=rl,this.pinClass=fd,this.providerName=""}withLoadFunction(e){return vr(e,dr.FUNCTION),this.loadFunction=e,this}withMapClass(e){return this.mapClass=e,this}withPinClass(e){return this.pinClass=e,this}withProviderName(e){return this.providerName=e,this}build(){return new hs(this)}}class hs{constructor(e){fr(e,fs),this._loadFunction=e.loadFunction,this._mapClass=e.mapClass,this._pinClass=e.pinClass,this._providerName=e.providerName,this._loadPromise=new Promise((n,r)=>{this._resolveLoad=n,this._rejectLoad=r}),this._apiKey="",this._loadInvoked=!1,this._loaded=!1,this._options={}}get loaded(){return this._loaded}getMapClass(){return this._mapClass}getPinClass(){return this._pinClass}getProviderName(){return this._providerName}async load(e=this._apiKey,n=this._options){this._loadInvoked||(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,e,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(e,n=null){this._loadInvoked||(this._apiKey=e,this._options=n||this._options)}}const wf={GEOCODER:"geocoder",PLACES:"places"};class TN extends rl{constructor(e){super(e),this.map=new google.maps.Map(e.wrapper,{disableDefaultUI:!e.controlEnabled,fullscreenControl:!1,gestureHandling:e.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:e.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...e.providerOptions}),this._moving=!1,google.maps.event.addListener(this.map,"bounds_changed",()=>{this._moving||(this._moving=!0,this._panStartHandler())}),google.maps.event.addListener(this.map,"idle",()=>{this._moving=!1,this._panHandler()})}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new google.maps.LatLng(e.latitude,e.longitude);n?this.map.panTo(r):this.map.setCenter(r)}setZoom(e,n){this.map.setZoom(Math.floor(e))}setZoomCenter(e,n,r){this.setCenter(n,r),this.setZoom(e,r)}}class xN extends gc{constructor(e){super(e),this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper);const n=this;class r extends google.maps.OverlayView{draw(){var g;const d=(g=this.getProjection())==null?void 0:g.fromLatLngToDivPixel(n._latLng);d&&(n._wrapper.style.left=d.x+"px",n._wrapper.style.top=d.y+"px")}onAdd(){this.getPanes().floatPane.appendChild(n._wrapper)}onRemove(){var d;(d=n._wrapper.parentNode)==null||d.removeChild(n._wrapper)}}this.pin=new r}setCoordinate(e){this._latLng=new google.maps.LatLng(e.latitude,e.longitude),this.pin.draw()}setMap(e,n){this.pin.setMap(e?e.getProviderMap().map:null)}}const Of="GoogleMapsCallback_b7d77ff2",vN="https://maps.googleapis.com/maps/api/js";function SN(t,e,n,{autocomplete:r=!1,channel:c=window.location.hostname,client:d,language:g,region:p,libraries:C=[],loading:v="async",params:T={}}={}){window[Of]=t,r&&C.push(wf.GEOCODER,wf.PLACES);const O={callback:Of,channel:c,libraries:C.join(","),...T};n&&(O.key=n),d&&(O.client=d),g&&(O.language=g),p&&(O.region=p),v&&(O.loading=v),pp(vN+"?"+Object.entries(O).map(([R,b])=>R+"="+b).join("&"))}const yp=new fs().withLoadFunction(SN).withMapClass(TN).withPinClass(xN).withProviderName("Google").build();class ls{static fit(e){const n=e.map(v=>v.latitude),r=Math.max(...n),c=Math.min(...n),d=e.map(v=>v.normalLon).sort((v,T)=>v-T),g=d.map((v,T)=>({distance:(T<d.length-1?d[T+1]:d[0]+360)-v,index:T})).reduce((v,T)=>T.distance>v.distance?T:v).index,p=d[g],C=d[(g+1)%d.length];return new this(new tn(c,C),new tn(r,p))}constructor(e,n){this._ne=new tn(n),this._sw=new tn(e)}get ne(){return this._ne}get sw(){return this._sw}set ne(e){this._ne=new tn(e)}set sw(e){this._sw=new tn(e)}contains(e){const n=this._sw.latitude<=e.latitude&&e.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,c=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=e.normalLon&&e.normalLon<=this._ne.normalLon:this._sw.normalLon<=e.normalLon||e.normalLon<=this._ne.normalLon;return n&&(r||c)}extend(e){if(this._ne.latitude=Math.max(this._ne.latitude,e.latitude),this._sw.latitude=Math.min(this._sw.latitude,e.latitude),!this.contains(e)){const n=((e.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-e.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(e=jr.SPHERICAL){const n=new tn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,dn.DEGREE,e),c=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,dn.DEGREE,e),n.longitude=c,n}}class wN{constructor(){this._anchorX=.5,this._anchorY=1,this._height=39,this._icon="default",this._srText="map pin",this._width=33,this._zIndex=0,this._class="",this._element=null}getAnchorX(){return this._anchorX}getAnchorY(){return this._anchorY}getClass(){return this._class}getElement(){return this._element}getHeight(){return this._height}getIcon(){return this._icon}getSRText(){return this._srText}getWidth(){return this._width}getZIndex(){return this._zIndex}setAnchorX(e){return this._anchorX=e,this}setAnchorY(e){return this._anchorY=e,this}setClass(e){return this._class=e,this}setElement(e){return this._element=e,this}setHeight(e){return this._height=e,this}setIcon(e){return this._icon=e,this}setSRText(e){return this._srText=e,this}setWidth(e){return this._width=e,this}setZIndex(e){return this._zIndex=e,this}}class hd{constructor(){this.coordinate=new tn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=e=>new wN,this.provider=null,this.type=""}withCoordinate(e){return this.coordinate=new tn(e),this}withHideOffscreen(e){return this.hideOffscreen=e,this}withIcon(e,n){return this.icons[e]=n,this}withPropertiesForStatus(e){return vr(e,dr.FUNCTION),this.propertiesForStatus=e,this}withProvider(e){return fr(e,hs),this.provider=e,this}withType(e){return this.type=e,this}build(){return new ON(this)}}class ON{constructor(e){if(fr(e,hd),fr(e.provider,hs),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=e.coordinate,this._hideOffscreen=e.hideOffscreen,this._icons={...e.icons},this._propertiesForStatus=e.propertiesForStatus,this._type=e.type,this._clickHandler=()=>null,this._focusHandler=n=>this._hoverHandler(n),this._hoverHandler=n=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new _p(e.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(n=>this._focusHandler(n)).withHoverHandler(n=>this._hoverHandler(n)).build(),this._pin.setCoordinate(e.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(e){return this._icons[e]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(e){vr(e,dr.FUNCTION),this._clickHandler=e}setCoordinate(e){this._coordinate=new tn(e),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(e){vr(e,dr.FUNCTION),this._focusHandler=e}setHoverHandler(e){vr(e,dr.FUNCTION),this._hoverHandler=e}setMap(e){if(e!==this._map&&(e!==null&&fr(e,Cp),this._pin.setMap(e,this._hidden?null:this._map),this._map=e,this._hidden=!1,this._cancelHiddenUpdater(),e&&this._hideOffscreen)){let n=!1;const r=new Promise(c=>{this._cancelHiddenUpdater=()=>{n=!0,c()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,e.moving()]),await Promise.race([r,e.idle()])})()}}setStatus(e){Object.assign(this._status,e),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const e=this._map.getBounds().contains(this._coordinate);this._hidden&&e?this._pin.setMap(this._map,null):!this._hidden&&!e&&this._pin.setMap(null,this._map),this._hidden=!e}}}const vo=.98;function Ya(t,e){return Math.max(typeof t==dr.FUNCTION?t():t||0,0)/e}class Np{constructor(){this.controlEnabled=!0,this.defaultCenter=new tn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(e,n)=>null,this.panStartHandler=e=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(e){return this.controlEnabled=e,this}withDefaultCenter(e){return this.defaultCenter=new tn(e),this}withDefaultZoom(e){return this.defaultZoom=e,this}withLegendPins(e){return this.legendPins=Array.from(e),this}withPadding(e){return this.padding=e,this}withPanHandler(e){return vr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return vr(e,dr.FUNCTION),this.panStartHandler=e,this}withProvider(e){return fr(e,hs),this.provider=e,this}withProviderOptions(e){return this.providerOptions=e,this}withSinglePinZoom(e){return this.singlePinZoom=e,this}withWrapper(e){return fr(e,HTMLElement),this.wrapper=e,this}build(){return new Cp(this)}}let Cp=class{constructor(e){if(fr(e,Np),fr(e.provider,hs),fr(e.wrapper,HTMLElement),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=e.defaultCenter,this._defaultZoom=e.defaultZoom,this._legendPins=e.legendPins,this._provider=e.provider,this._singlePinZoom=e.singlePinZoom,this._wrapper=e.wrapper,this._padding={},this.setPadding(e.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(e.panHandler),this.setPanStartHandler(e.panStartHandler);this._wrapper.firstChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new mp(e.provider,this._wrapper).withControlEnabled(e.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(e.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(e,n=!1,r=this._singlePinZoom){e.length?this.setBounds(ls.fit(e),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){if(!this._cachedBounds){const e=this._wrapper.offsetHeight,n=this._wrapper.offsetWidth,r=this.getZoom(),c=this.getCenter(),d=360/Math.pow(2,r+8),g=n*d,p=e*d;this._cachedBounds=new ls(c,c),this._cachedBounds.ne.add(p/2,g/2,dn.DEGREE,jr.MERCATOR),this._cachedBounds.sw.add(-p/2,-g/2,dn.DEGREE,jr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new ls(this._cachedBounds.sw,this._cachedBounds.ne)}getCenter(){return this._map.getCenter()}getProviderMap(){return this._map}getZoom(){return this._map.getZoom()}async idle(){await this._idlePromise}async moving(){await this._movingPromise}newPinOptions(){return new hd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const e=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler(e,new ls(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler(new ls(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:e,sw:n},r=!1,c={},d=1/0){const g=this._wrapper.offsetHeight,p=this._wrapper.offsetWidth;if(!g||!p)return;let C=Ya(c.bottom,g),v=Ya(c.left,p),T=Ya(c.right,p),O=Ya(c.top,g),R=v+T,b=C+O;R>vo&&(v*=vo/R,T*=vo/R,R=vo),b>vo&&(C*=vo/b,O*=vo/b,b=vo);const x=g*(1-b),w=p*(1-R),$=new ls(n,e),W=new tn($.ne.latitude,$.sw.longitude),P=$.sw.distanceTo(W,dn.DEGREE,jr.MERCATOR),H=($.ne.longitude-W.longitude+360)%360;let B=Math.max(P,H*x/w)/(1-b),z=Math.max(H,P*w/x)/(1-R),X=Math.log2(p*360/z)-8;X>d&&(X=d,z=p*360/2**(X+8),B=z*g/p);const ee=$.getCenter(jr.MERCATOR),le=(O-C)/2*B,j=(T-v)/2*z;ee.add(le,j,dn.DEGREE,jr.MERCATOR),this.setZoomCenter(X,ee,r)}setCenter(e,n=!1){this._map.setCenter(new tn(e),n)}setPadding({bottom:e=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:c=this._padding.top}){return this._padding={bottom:e,left:n,right:r,top:c},this}setPanHandler(e){vr(e,dr.FUNCTION),this._panHandler=e}setPanStartHandler(e){vr(e,dr.FUNCTION),this._panStartHandler=e}setZoom(e,n=!1){this._map.setZoom(e,n)}setZoomCenter(e,n,r=!1){this._map.setZoomCenter(e,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(e=>this._resolveMoving=e),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(e=>this._resolveIdle=e),this._resolveMoving()}};const pc=et.createContext(null);function DN(){const t=et.useContext(pc);if(!t||t.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return t.map}const Ep=({apiKey:t,bounds:e,children:n,className:r,clientKey:c,controls:d=!0,defaultCenter:g={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:C,padding:v={bottom:50,left:50,right:50,top:50},panHandler:T=()=>null,panStartHandler:O=()=>null,provider:R=yp,providerOptions:b={},singleZoom:x=14})=>{const w=et.useRef(null),[$,W]=et.useState(g),[P,H]=et.useState(!1),[B,z]=et.useState(),[X,ee]=et.useState(p),le=(j,U)=>{T(j,U),W(U.getCenter())};return et.useEffect(()=>{!P||!B||ee(B.getZoom())},[$]),et.useEffect(()=>{if(!e||!P||!B)return;const j=e.map(U=>new tn(U));B.fitCoordinates(j)},[JSON.stringify(e),B]),et.useEffect(()=>{if(!P||B)return;const j=new Np().withControlEnabled(d).withDefaultCenter($).withDefaultZoom(X).withPadding(v).withPanHandler(le).withPanStartHandler(O).withProvider(R).withProviderOptions(b).withSinglePinZoom(x).withWrapper(w.current).build();z(j),C&&(C.current=j)},[P]),et.useEffect(()=>{P||B||!w.current||R.load(t,{...b,...c&&{client:c}}).then(()=>H(!0))},[]),at.jsx("div",{className:Qs({"is-loaded":P},r),id:"map",ref:w,"data-testid":"map",children:B&&at.jsx(pc.Provider,{value:{map:B,provider:R},children:n})})},AN=({count:t})=>at.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:at.jsxs("g",{fill:"none",fillRule:"evenodd",children:[at.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),at.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:at.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:t})})]})}),gd=et.createContext(null);function MN(){const t=et.useContext(gd);if(!t)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return t}const RN=({clusterRadius:t=50,children:e,ClusterTemplate:n=AN})=>{const{map:r}=et.useContext(pc),[c,d]=et.useState([]),[g,p]=et.useState(),[C,v]=et.useState([]),[T,O]=et.useState([]);return et.useEffect(()=>{p(bN(c,r.getZoom(),t))},[c,r.getZoom()]),et.useEffect(()=>{O(()=>[]),v(()=>[]),(g==null?void 0:g.length)!==0&&(g==null||g.forEach(R=>{if(R.length===1){R[0].pin.setMap(r);return}if(R.length>1){const b=ls.fit(R.map(w=>w.pin.getCoordinate())).getCenter(jr.MERCATOR),x=`cluster-{${b._lat},${b._lon}}`;R.forEach(w=>w.pin.setMap(null)),v(w=>[...w,x]),O(w=>[...w,at.jsx(pd,{coordinate:b,id:x,onClick:()=>r.fitCoordinates(R.map($=>$.pin.getCoordinate()),!0,1/0),children:at.jsx(n,{count:R.length})},x)])}}))},[g]),at.jsx(gd.Provider,{value:{clusters:g??[],clusterIds:C,setPinStore:d},children:at.jsxs(at.Fragment,{children:[T.map((R,b)=>at.jsx(et.Fragment,{children:R},b)),e]})})},bN=(t,e,n)=>{const r=n*Math.PI/2**(e+7),c=t.map((p,C)=>[C]),d=[];t.forEach((p,C)=>{for(let v=C;v<t.length;v++)v!==C&&new tn(p.pin.getCoordinate()).distanceTo(new tn(t[v].pin.getCoordinate()),dn.RADIAN,jr.MERCATOR)<=r&&(c[C].push(v),c[v].push(C))});let g=1;for(;g;){g=0;let p;if(c.forEach((T,O)=>{T.length>g&&(g=T.length,p=O)}),!g)break;const C=c[p??0],v=[];c[p??0]=[];for(const T of C){const O=c[T];v.push(t[T]),c[T]=[],O.forEach(R=>c[R].splice(c[R].indexOf(T),1))}d.push(v)}return d},LN=at.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),pd=({children:t,coordinate:e,hideOffscreen:n=!1,id:r,icon:c=LN,onClick:d=()=>null,onFocus:g=()=>null,onHover:p=()=>null,zIndex:C})=>{const{map:v,provider:T}=et.useContext(pc),O=et.useContext(gd),R=et.useMemo(()=>new hd().withCoordinate(e).withHideOffscreen(n).withProvider(T).build(),[]);et.useEffect(()=>{if(C!==0&&!C)return;const x=R.getProviderPin().getWrapperElement();x&&(x.style.zIndex=C.toString())},[C]),et.useEffect(()=>{R.setMap(v),R.setClickHandler(()=>d(r)),R.setFocusHandler(w=>g(w,r)),R.setHoverHandler(w=>p(w,r));const x=O==null?void 0:O.clusterIds.includes(r);return O&&!x&&O.setPinStore(w=>[...w,{pin:R,id:r}]),()=>{R.setMap(null),O&&O.setPinStore(w=>w.filter($=>$.id!==r))}},[]);const b=t||c;if(b){const x=R.getProviderPin().getPinElement();return Object.assign(x.style,{height:"auto",width:"auto"}),ld.createPortal(b,x)}return null},kN=({children:t,coordinate:e,linkSameTab:n,pinUrl:r,onClick:c=()=>null,onHover:d=()=>null,onFocus:g=()=>null,...p})=>at.jsx(Ep,{bounds:[e],...p,children:at.jsx(pd,{coordinate:e,id:"location-map-marker",onClick:c,onHover:d,onFocus:g,children:r?at.jsx(gp,{href:r,target:n?"_self":"_blank",children:t}):t||void 0})});var qc={},Hl={},Df;function IN(){if(Df)return Hl;Df=1;var t=et;const e=t.createContext(null);function n(c,d){let g=null;c!=null&&(g=c[1]);function p(){return d??(g!=null?g.getTheme():null)}return{getTheme:p}}function r(){const c=t.useContext(e);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}return Hl.LexicalComposerContext=e,Hl.createLexicalComposerContext=n,Hl.useLexicalComposerContext=r,Hl}var Wl={},Af;function PN(){if(Af)return Wl;Af=1;var t=et;function e(r){let c=new URLSearchParams;c.append("code",r);for(let d=1;d<arguments.length;d++)c.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${c} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=t.createContext(null);return Wl.LexicalComposerContext=n,Wl.createLexicalComposerContext=function(r,c){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return c??(d!=null?d.getTheme():null)}}},Wl.useLexicalComposerContext=function(){let r=t.useContext(n);return r==null&&e(8),r},Wl}var Zc,Mf;function Un(){return Mf||(Mf=1,Zc=process.env.NODE_ENV==="development"?IN():PN()),Zc}var Pe={},Rf;function $N(){if(Rf)return Pe;Rf=1;function t(u){return{type:u}}const e=t("SELECTION_CHANGE_COMMAND"),n=t("CLICK_COMMAND"),r=t("DELETE_CHARACTER_COMMAND"),c=t("INSERT_LINE_BREAK_COMMAND"),d=t("INSERT_PARAGRAPH_COMMAND"),g=t("CONTROLLED_TEXT_INSERTION_COMMAND"),p=t("PASTE_COMMAND"),C=t("REMOVE_TEXT_COMMAND"),v=t("DELETE_WORD_COMMAND"),T=t("DELETE_LINE_COMMAND"),O=t("FORMAT_TEXT_COMMAND"),R=t("UNDO_COMMAND"),b=t("REDO_COMMAND"),x=t("KEYDOWN_COMMAND"),w=t("KEY_ARROW_RIGHT_COMMAND"),$=t("MOVE_TO_END"),W=t("KEY_ARROW_LEFT_COMMAND"),P=t("MOVE_TO_START"),H=t("KEY_ARROW_UP_COMMAND"),B=t("KEY_ARROW_DOWN_COMMAND"),z=t("KEY_ENTER_COMMAND"),X=t("KEY_SPACE_COMMAND"),ee=t("KEY_BACKSPACE_COMMAND"),le=t("KEY_ESCAPE_COMMAND"),j=t("KEY_DELETE_COMMAND"),U=t("KEY_TAB_COMMAND"),q=t("INSERT_TAB_COMMAND"),me=t("INDENT_CONTENT_COMMAND"),_e=t("OUTDENT_CONTENT_COMMAND"),pe=t("DROP_COMMAND"),ue=t("FORMAT_ELEMENT_COMMAND"),K=t("DRAGSTART_COMMAND"),D=t("DRAGOVER_COMMAND"),V=t("DRAGEND_COMMAND"),ne=t("COPY_COMMAND"),Y=t("CUT_COMMAND"),G=t("SELECT_ALL_COMMAND"),Q=t("CLEAR_EDITOR_COMMAND"),k=t("CLEAR_HISTORY_COMMAND"),m=t("CAN_REDO_COMMAND"),y=t("CAN_UNDO_COMMAND"),M=t("FOCUS_COMMAND"),Z=t("BLUR_COMMAND"),ae=t("KEY_MODIFIER_COMMAND"),he=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=he&&"documentMode"in document?document.documentMode:null,Te=he&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),be=he&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ue=he&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,re=he&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),te=he&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ce=he&&/Android/.test(navigator.userAgent),we=he&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Le=he&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!we,Be=1,Ye=3,ct=0,yt=1,dt=2,ve=0,ie=1,fe=2,Oe=1,Re=2,De=4,We=8,qe=16,Qe=32,ft=64,kt=128,je=Oe|Re|De|We|qe|Qe|ft|kt,Ve=1,rt=2,_t=1,Et=2,St=3,Ot=4,At=5,xt=6,Qt=" ",Ut=re||te||Le?Qt:"​",It=`
31
+ */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var r=[],c=0;c<arguments.length;c++){var d=arguments[c];if(d){var g=typeof d;if(g==="string"||g==="number")r.push(d);else if(Array.isArray(d)){if(d.length){var p=n.apply(null,d);p&&r.push(p)}}else if(g==="object"){if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]")){r.push(d.toString());continue}for(var N in d)e.call(d,N)&&d[N]&&r.push(N)}}}return r.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(fp);var hN=fp.exports;const Qs=ad(hN),xf=t=>t.linkType==="Email"||!t.linkType&&hp(t.link)?t.link.startsWith("mailto:")?t.link:`mailto:${t.link}`:t.linkType==="Phone"?t.link.startsWith("tel:")?t.link:`tel:${t.link}`:t.link,hp=t=>t.startsWith("mailto:")?!0:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t),gN=t=>t.cta??{link:t.href},gp=et.forwardRef(function(e,n){const r=gN(e),{children:c,onClick:d,className:g,eventName:p,scope:N,currency:v,amount:T,cta:O,obfuscate:b,customTags:R,customValues:x,...w}=e,P=O?"CTA_CLICK":"LINK",H=p||(O?"cta":"link"),$=nl();if(!(r!=null&&r.link))throw new Error("CTA's link is undefined");const W=b||b!==!1&&hp(r.link),B=async ee=>{const le=ee.currentTarget;let j="";if(W){ee.preventDefault();const U=le.href.split("/").at(-1);U&&(j=atob(U))}if($!==null)try{await $.track({action:P,scope:e.scope,eventName:H,currency:v,amount:T,destinationUrl:j||le.href,customTags:R,customValues:x})}catch{console.error("Failed to report click Analytics Event")}d&&d(ee),j&&(window.location.href=j)},z=W?"Obfuscated, set a label or child":r.link,X={className:Qs("Link",g),href:W?btoa(xf(r)):xf(r),onClick:B,rel:e.target&&!e.rel?"noopener":void 0,ref:n};return $!=null&&$.getDebugEnabled()&&(X["data-ya-action"]=P,X["data-ya-scopeoverride"]=N,X["data-ya-eventname"]=H),at.jsx("a",{...X,...w,suppressHydrationWarning:!0,children:c||r.label||z})}),pN={URL:"URL",Email:"Email",Phone:"Phone"},dn=Object.freeze({DEGREE:Symbol("deg"),KILOMETER:Symbol("km"),MILE:Symbol("mi"),RADIAN:Symbol("r")}),jr=Object.freeze({MERCATOR:Symbol("mercator"),SPHERICAL:Symbol("spherical")}),jc=3959,Vc=6371,mN=["latitude","lat"],_N=["longitude","lon","lng","long"];function vf(t,e){for(const n of e)if(t[n]||t[n]===0)return t[n]}function Sf(t){switch(typeof t){case"string":case"number":const e=Number.parseFloat(t);if(Number.isNaN(e))throw new Error(`'${t}' must be convertible to a Number'`);return e;default:throw new Error(`typeof '${t}' must be a number or a string that can be converted to a number, is '${typeof t}'`)}}function cs(t){return t*Math.PI/180}function Ji(t){return t/Math.PI*180}function yN(t,e){const n=cs(t.latitude),r=cs(e.latitude),c=r-n,d=cs(e.longitude-t.longitude),g=Math.pow(Math.sin(c/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g))}function NN(t,e){const n=Math.tan(Math.PI/360*(t+90)),r=Math.tan(Math.PI/360*(e+90));return Math.log(r/n)}function CN(t,e){const r=Math.tan(Math.PI/360*(t+90))*Math.pow(Math.E,e);return Math.atan(r)*360/Math.PI-90}class tn{constructor(e,n){let r=e;typeof e=="object"&&(r=vf(e,mN),n=vf(e,_N),r=typeof r=="function"?r():r,n=typeof n=="function"?n():n),this.latitude=r,this.longitude=n}get latitude(){return this._lat}get longitude(){return this._lon}get normalLon(){return((this._lon+180)%360+360)%360-180}set latitude(e){this._lat=Math.max(-90,Math.min(Sf(e),90))}set longitude(e){this._lon=Sf(e)}add(e,n,r=dn.DEGREE,c=jr.SPHERICAL){if(c===jr.MERCATOR&&(r===dn.DEGREE||r===dn.RADIAN)){const d=r===dn.DEGREE?cs(e):e,g=r===dn.DEGREE?n:Ji(n);this.latitude=CN(this.latitude,d),this.longitude+=g}else switch(r){case dn.DEGREE:this.latitude+=e,this.longitude+=n;break;case dn.KILOMETER:this.latitude+=Ji(e)*Vc,this.longitude+=Ji(n)*Vc*Math.cos(cs(this.latitude));break;case dn.MILE:this.latitude+=Ji(e)*jc,this.longitude+=Ji(n)*jc*Math.cos(cs(this.latitude));break;case dn.RADIAN:this.latitude+=Ji(e),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${r}`)}}distanceTo(e,n=dn.MILE,r=jr.SPHERICAL){if(r===jr.MERCATOR&&(n===dn.DEGREE||n===dn.RADIAN)){const c=NN(this.latitude,e.latitude),d=Math.abs(e.normalLon-this.normalLon),g=cs(Math.min(d,360-d)),p=Math.sqrt(Math.pow(c,2)+Math.pow(g,2));switch(n){case dn.DEGREE:return Ji(p);case dn.RADIAN:return p;default:throw new Error(`unit unhandled: ${n}`)}}else{const c=yN(this,e);switch(n){case dn.DEGREE:return Ji(c);case dn.KILOMETER:return c*Vc;case dn.MILE:return c*jc;case dn.RADIAN:return c;default:throw new Error(`unit unhandled: ${n}`)}}}equals(e){return e&&e.latitude===this.latitude&&e.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function pp(t,e=()=>null){const n=document.createElement("script");n.async=!0,n.onload=e,n.src=t,document.head.appendChild(n)}const dr={FUNCTION:"function"};function vr(t,e){if(typeof t!==e)throw new Error(`Expected an object of type '${e}' but received '${typeof t}'`)}function fr(t,e){let n;try{n=t instanceof e}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${e.name}' but received '${t.constructor.name}'`)}class mp{constructor(e,n){fr(e,hs),fr(n,HTMLElement),this.providerMapClass=e.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(e){return this.controlEnabled=e,this}withPanHandler(e){return vr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return vr(e,dr.FUNCTION),this.panStartHandler=e,this}withProviderOptions(e){return this.providerOptions=e,this}build(){const e=this.providerMapClass;return new e(this)}}class rl{constructor(e){fr(e,mp),this._panHandler=e.panHandler,this._panStartHandler=e.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(e,n){throw new Error("not implemented")}setZoom(e,n){throw new Error("not implemented")}setZoomCenter(e,n,r){this.setZoom(e,r),this.setCenter(n,r)}}class _p{constructor(e){fr(e,hs),this.providerPinClass=e.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(e){return vr(e,dr.FUNCTION),this.clickHandler=e,this}withFocusHandler(e){return vr(e,dr.FUNCTION),this.focusHandler=e,this}withHoverHandler(e){return vr(e,dr.FUNCTION),this.hoverHandler=e,this}withIcons(e){return this.icons=e,this}withHasPinUrl(e){return this.hasPinUrl=e,this}build(){const e=this.providerPinClass;return new e(this)}}class fd{constructor(e){fr(e,_p),this._clickHandler=e.clickHandler,this._focusHandler=e.focusHandler,this._hoverHandler=e.hoverHandler,this._icons=e.icons}setCoordinate(e){throw new Error("not implemented")}setMap(e,n){throw new Error("not implemented")}setProperties(e){throw new Error("not implemented")}}const EN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class gc extends fd{static get baseStyle(){return EN}constructor(e){super(e),this._pinEl=e.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,this.constructor.baseStyle),this._pinAlt=document.createElement("span"),this._pinAlt.classList.add("sr-only"),this._pinEl.appendChild(this._pinAlt),this._wrapper=document.createElement("div"),this._wrapper.style.pointerEvents="none",this._wrapper.appendChild(this._pinEl),this.addListeners()}addListeners(){this._wrapper.addEventListener("click",()=>this._clickHandler()),this._wrapper.addEventListener("focusin",()=>this._focusHandler(!0)),this._wrapper.addEventListener("focusout",()=>this._focusHandler(!1)),this._wrapper.addEventListener("mouseover",()=>this._hoverHandler(!0)),this._wrapper.addEventListener("mouseout",()=>this._hoverHandler(!1))}getPinElement(){return this._pinEl}getWrapperElement(){return this._wrapper}setProperties(e){this.setElementProperties(e);const n=e.getClass(),r=e.getElement()||this._pinEl,c=e.getZIndex();r.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=c,this._wrapper.setAttribute("class",n),r!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(r)))}setElementProperties(e){const n=e.getAnchorX(),r=e.getAnchorY(),c=e.getHeight(),d=this._icons[e.getIcon()],g=e.getSRText(),p=e.getWidth();Object.assign(this._pinEl.style,{backgroundImage:d?`url("${d}")`:"",height:c+"px",transform:`translate(${-100*n}%, ${-100*r}%)`,width:p+"px"}),this._pinAlt.innerText=g}}class fs{constructor(){this.loadFunction=(e,n,r,c)=>e(),this.mapClass=rl,this.pinClass=fd,this.providerName=""}withLoadFunction(e){return vr(e,dr.FUNCTION),this.loadFunction=e,this}withMapClass(e){return this.mapClass=e,this}withPinClass(e){return this.pinClass=e,this}withProviderName(e){return this.providerName=e,this}build(){return new hs(this)}}class hs{constructor(e){fr(e,fs),this._loadFunction=e.loadFunction,this._mapClass=e.mapClass,this._pinClass=e.pinClass,this._providerName=e.providerName,this._loadPromise=new Promise((n,r)=>{this._resolveLoad=n,this._rejectLoad=r}),this._apiKey="",this._loadInvoked=!1,this._loaded=!1,this._options={}}get loaded(){return this._loaded}getMapClass(){return this._mapClass}getPinClass(){return this._pinClass}getProviderName(){return this._providerName}async load(e=this._apiKey,n=this._options){this._loadInvoked||(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,e,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(e,n=null){this._loadInvoked||(this._apiKey=e,this._options=n||this._options)}}const wf={GEOCODER:"geocoder",PLACES:"places"};class TN extends rl{constructor(e){super(e),this.map=new google.maps.Map(e.wrapper,{disableDefaultUI:!e.controlEnabled,fullscreenControl:!1,gestureHandling:e.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:e.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...e.providerOptions}),this._moving=!1,google.maps.event.addListener(this.map,"bounds_changed",()=>{this._moving||(this._moving=!0,this._panStartHandler())}),google.maps.event.addListener(this.map,"idle",()=>{this._moving=!1,this._panHandler()})}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new google.maps.LatLng(e.latitude,e.longitude);n?this.map.panTo(r):this.map.setCenter(r)}setZoom(e,n){this.map.setZoom(Math.floor(e))}setZoomCenter(e,n,r){this.setCenter(n,r),this.setZoom(e,r)}}class xN extends gc{constructor(e){super(e),this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper);const n=this;class r extends google.maps.OverlayView{draw(){var g;const d=(g=this.getProjection())==null?void 0:g.fromLatLngToDivPixel(n._latLng);d&&(n._wrapper.style.left=d.x+"px",n._wrapper.style.top=d.y+"px")}onAdd(){this.getPanes().floatPane.appendChild(n._wrapper)}onRemove(){var d;(d=n._wrapper.parentNode)==null||d.removeChild(n._wrapper)}}this.pin=new r}setCoordinate(e){this._latLng=new google.maps.LatLng(e.latitude,e.longitude),this.pin.draw()}setMap(e,n){this.pin.setMap(e?e.getProviderMap().map:null)}}const Of="GoogleMapsCallback_b7d77ff2",vN="https://maps.googleapis.com/maps/api/js";function SN(t,e,n,{autocomplete:r=!1,channel:c=window.location.hostname,client:d,language:g,region:p,libraries:N=[],loading:v="async",params:T={}}={}){window[Of]=t,r&&N.push(wf.GEOCODER,wf.PLACES);const O={callback:Of,channel:c,libraries:N.join(","),...T};n&&(O.key=n),d&&(O.client=d),g&&(O.language=g),p&&(O.region=p),v&&(O.loading=v),pp(vN+"?"+Object.entries(O).map(([b,R])=>b+"="+R).join("&"))}const yp=new fs().withLoadFunction(SN).withMapClass(TN).withPinClass(xN).withProviderName("Google").build();class ls{static fit(e){const n=e.map(v=>v.latitude),r=Math.max(...n),c=Math.min(...n),d=e.map(v=>v.normalLon).sort((v,T)=>v-T),g=d.map((v,T)=>({distance:(T<d.length-1?d[T+1]:d[0]+360)-v,index:T})).reduce((v,T)=>T.distance>v.distance?T:v).index,p=d[g],N=d[(g+1)%d.length];return new this(new tn(c,N),new tn(r,p))}constructor(e,n){this._ne=new tn(n),this._sw=new tn(e)}get ne(){return this._ne}get sw(){return this._sw}set ne(e){this._ne=new tn(e)}set sw(e){this._sw=new tn(e)}contains(e){const n=this._sw.latitude<=e.latitude&&e.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,c=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=e.normalLon&&e.normalLon<=this._ne.normalLon:this._sw.normalLon<=e.normalLon||e.normalLon<=this._ne.normalLon;return n&&(r||c)}extend(e){if(this._ne.latitude=Math.max(this._ne.latitude,e.latitude),this._sw.latitude=Math.min(this._sw.latitude,e.latitude),!this.contains(e)){const n=((e.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-e.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(e=jr.SPHERICAL){const n=new tn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,dn.DEGREE,e),c=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,dn.DEGREE,e),n.longitude=c,n}}class wN{constructor(){this._anchorX=.5,this._anchorY=1,this._height=39,this._icon="default",this._srText="map pin",this._width=33,this._zIndex=0,this._class="",this._element=null}getAnchorX(){return this._anchorX}getAnchorY(){return this._anchorY}getClass(){return this._class}getElement(){return this._element}getHeight(){return this._height}getIcon(){return this._icon}getSRText(){return this._srText}getWidth(){return this._width}getZIndex(){return this._zIndex}setAnchorX(e){return this._anchorX=e,this}setAnchorY(e){return this._anchorY=e,this}setClass(e){return this._class=e,this}setElement(e){return this._element=e,this}setHeight(e){return this._height=e,this}setIcon(e){return this._icon=e,this}setSRText(e){return this._srText=e,this}setWidth(e){return this._width=e,this}setZIndex(e){return this._zIndex=e,this}}class hd{constructor(){this.coordinate=new tn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=e=>new wN,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(e){return this.coordinate=new tn(e),this}withHideOffscreen(e){return this.hideOffscreen=e,this}withIcon(e,n){return this.icons[e]=n,this}withPropertiesForStatus(e){return vr(e,dr.FUNCTION),this.propertiesForStatus=e,this}withProvider(e){return fr(e,hs),this.provider=e,this}withType(e){return this.type=e,this}withHasPinUrl(e){return this.hasPinUrl=e,this}build(){return new ON(this)}}class ON{constructor(e){if(fr(e,hd),fr(e.provider,hs),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=e.coordinate,this._hideOffscreen=e.hideOffscreen,this._icons={...e.icons},this._propertiesForStatus=e.propertiesForStatus,this._type=e.type,this._clickHandler=()=>null,this._focusHandler=n=>this._hoverHandler(n),this._hoverHandler=n=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new _p(e.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(n=>this._focusHandler(n)).withHoverHandler(n=>this._hoverHandler(n)).withHasPinUrl(e.hasPinUrl).build(),this._pin.setCoordinate(e.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(e){return this._icons[e]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(e){vr(e,dr.FUNCTION),this._clickHandler=e}setCoordinate(e){this._coordinate=new tn(e),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(e){vr(e,dr.FUNCTION),this._focusHandler=e}setHoverHandler(e){vr(e,dr.FUNCTION),this._hoverHandler=e}setMap(e){if(e!==this._map&&(e!==null&&fr(e,Cp),this._pin.setMap(e,this._hidden?null:this._map),this._map=e,this._hidden=!1,this._cancelHiddenUpdater(),e&&this._hideOffscreen)){let n=!1;const r=new Promise(c=>{this._cancelHiddenUpdater=()=>{n=!0,c()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,e.moving()]),await Promise.race([r,e.idle()])})()}}setStatus(e){Object.assign(this._status,e),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const e=this._map.getBounds().contains(this._coordinate);this._hidden&&e?this._pin.setMap(this._map,null):!this._hidden&&!e&&this._pin.setMap(null,this._map),this._hidden=!e}}}const vo=.98;function Ya(t,e){return Math.max(typeof t==dr.FUNCTION?t():t||0,0)/e}class Np{constructor(){this.controlEnabled=!0,this.defaultCenter=new tn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(e,n)=>null,this.panStartHandler=e=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(e){return this.controlEnabled=e,this}withDefaultCenter(e){return this.defaultCenter=new tn(e),this}withDefaultZoom(e){return this.defaultZoom=e,this}withLegendPins(e){return this.legendPins=Array.from(e),this}withPadding(e){return this.padding=e,this}withPanHandler(e){return vr(e,dr.FUNCTION),this.panHandler=e,this}withPanStartHandler(e){return vr(e,dr.FUNCTION),this.panStartHandler=e,this}withProvider(e){return fr(e,hs),this.provider=e,this}withProviderOptions(e){return this.providerOptions=e,this}withSinglePinZoom(e){return this.singlePinZoom=e,this}withWrapper(e){return fr(e,HTMLElement),this.wrapper=e,this}build(){return new Cp(this)}}let Cp=class{constructor(e){if(fr(e,Np),fr(e.provider,hs),fr(e.wrapper,HTMLElement),!e.provider.loaded)throw new Error(`MapProvider '${e.provider.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=e.defaultCenter,this._defaultZoom=e.defaultZoom,this._legendPins=e.legendPins,this._provider=e.provider,this._singlePinZoom=e.singlePinZoom,this._wrapper=e.wrapper,this._padding={},this.setPadding(e.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(e.panHandler),this.setPanStartHandler(e.panStartHandler);this._wrapper.firstChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new mp(e.provider,this._wrapper).withControlEnabled(e.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(e.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(e,n=!1,r=this._singlePinZoom){e.length?this.setBounds(ls.fit(e),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){if(!this._cachedBounds){const e=this._wrapper.offsetHeight,n=this._wrapper.offsetWidth,r=this.getZoom(),c=this.getCenter(),d=360/Math.pow(2,r+8),g=n*d,p=e*d;this._cachedBounds=new ls(c,c),this._cachedBounds.ne.add(p/2,g/2,dn.DEGREE,jr.MERCATOR),this._cachedBounds.sw.add(-p/2,-g/2,dn.DEGREE,jr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new ls(this._cachedBounds.sw,this._cachedBounds.ne)}getCenter(){return this._map.getCenter()}getProviderMap(){return this._map}getZoom(){return this._map.getZoom()}async idle(){await this._idlePromise}async moving(){await this._movingPromise}newPinOptions(){return new hd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const e=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler(e,new ls(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler(new ls(new tn(this._currentBounds.sw),new tn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:e,sw:n},r=!1,c={},d=1/0){const g=this._wrapper.offsetHeight,p=this._wrapper.offsetWidth;if(!g||!p)return;let N=Ya(c.bottom,g),v=Ya(c.left,p),T=Ya(c.right,p),O=Ya(c.top,g),b=v+T,R=N+O;b>vo&&(v*=vo/b,T*=vo/b,b=vo),R>vo&&(N*=vo/R,O*=vo/R,R=vo);const x=g*(1-R),w=p*(1-b),P=new ls(n,e),H=new tn(P.ne.latitude,P.sw.longitude),$=P.sw.distanceTo(H,dn.DEGREE,jr.MERCATOR),W=(P.ne.longitude-H.longitude+360)%360;let B=Math.max($,W*x/w)/(1-R),z=Math.max(W,$*w/x)/(1-b),X=Math.log2(p*360/z)-8;X>d&&(X=d,z=p*360/2**(X+8),B=z*g/p);const ee=P.getCenter(jr.MERCATOR),le=(O-N)/2*B,j=(T-v)/2*z;ee.add(le,j,dn.DEGREE,jr.MERCATOR),this.setZoomCenter(X,ee,r)}setCenter(e,n=!1){this._map.setCenter(new tn(e),n)}setPadding({bottom:e=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:c=this._padding.top}){return this._padding={bottom:e,left:n,right:r,top:c},this}setPanHandler(e){vr(e,dr.FUNCTION),this._panHandler=e}setPanStartHandler(e){vr(e,dr.FUNCTION),this._panStartHandler=e}setZoom(e,n=!1){this._map.setZoom(e,n)}setZoomCenter(e,n,r=!1){this._map.setZoomCenter(e,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(e=>this._resolveMoving=e),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(e=>this._resolveIdle=e),this._resolveMoving()}};const pc=et.createContext(null);function DN(){const t=et.useContext(pc);if(!t||t.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return t.map}const Ep=({apiKey:t,bounds:e,children:n,className:r,clientKey:c,controls:d=!0,defaultCenter:g={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:N,padding:v={bottom:50,left:50,right:50,top:50},panHandler:T=()=>null,panStartHandler:O=()=>null,provider:b=yp,providerOptions:R={},singleZoom:x=14})=>{const w=et.useRef(null),[P,H]=et.useState(g),[$,W]=et.useState(!1),[B,z]=et.useState(),[X,ee]=et.useState(p),le=(j,U)=>{T(j,U),H(U.getCenter())};return et.useEffect(()=>{!$||!B||ee(B.getZoom())},[P]),et.useEffect(()=>{if(!e||!$||!B)return;const j=e.map(U=>new tn(U));B.fitCoordinates(j)},[JSON.stringify(e),B]),et.useEffect(()=>{if(!$||B)return;const j=new Np().withControlEnabled(d).withDefaultCenter(P).withDefaultZoom(X).withPadding(v).withPanHandler(le).withPanStartHandler(O).withProvider(b).withProviderOptions(R).withSinglePinZoom(x).withWrapper(w.current).build();z(j),N&&(N.current=j)},[$]),et.useEffect(()=>{$||B||!w.current||b.load(t,{...R,...c&&{client:c}}).then(()=>W(!0))},[]),at.jsx("div",{className:Qs({"is-loaded":$},r),id:"map",ref:w,"data-testid":"map",children:B&&at.jsx(pc.Provider,{value:{map:B,provider:b},children:n})})},AN=({count:t})=>at.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:at.jsxs("g",{fill:"none",fillRule:"evenodd",children:[at.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),at.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:at.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:t})})]})}),gd=et.createContext(null);function MN(){const t=et.useContext(gd);if(!t)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return t}const RN=({clusterRadius:t=50,children:e,ClusterTemplate:n=AN})=>{const{map:r}=et.useContext(pc),[c,d]=et.useState([]),[g,p]=et.useState(),[N,v]=et.useState([]),[T,O]=et.useState([]);return et.useEffect(()=>{p(bN(c,r.getZoom(),t))},[c,r.getZoom()]),et.useEffect(()=>{O(()=>[]),v(()=>[]),(g==null?void 0:g.length)!==0&&(g==null||g.forEach(b=>{if(b.length===1){b[0].pin.setMap(r);return}if(b.length>1){const R=ls.fit(b.map(w=>w.pin.getCoordinate())).getCenter(jr.MERCATOR),x=`cluster-{${R._lat},${R._lon}}`;b.forEach(w=>w.pin.setMap(null)),v(w=>[...w,x]),O(w=>[...w,at.jsx(pd,{coordinate:R,id:x,onClick:()=>r.fitCoordinates(b.map(P=>P.pin.getCoordinate()),!0,1/0),children:at.jsx(n,{count:b.length})},x)])}}))},[g]),at.jsx(gd.Provider,{value:{clusters:g??[],clusterIds:N,setPinStore:d},children:at.jsxs(at.Fragment,{children:[T.map((b,R)=>at.jsx(et.Fragment,{children:b},R)),e]})})},bN=(t,e,n)=>{const r=n*Math.PI/2**(e+7),c=t.map((p,N)=>[N]),d=[];t.forEach((p,N)=>{for(let v=N;v<t.length;v++)v!==N&&new tn(p.pin.getCoordinate()).distanceTo(new tn(t[v].pin.getCoordinate()),dn.RADIAN,jr.MERCATOR)<=r&&(c[N].push(v),c[v].push(N))});let g=1;for(;g;){g=0;let p;if(c.forEach((T,O)=>{T.length>g&&(g=T.length,p=O)}),!g)break;const N=c[p??0],v=[];c[p??0]=[];for(const T of N){const O=c[T];v.push(t[T]),c[T]=[],O.forEach(b=>c[b].splice(c[b].indexOf(T),1))}d.push(v)}return d},LN=at.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),pd=({children:t,coordinate:e,hideOffscreen:n=!1,id:r,icon:c=LN,onClick:d=()=>null,onFocus:g=()=>null,onHover:p=()=>null,zIndex:N,hasPinUrl:v})=>{const{map:T,provider:O}=et.useContext(pc),b=et.useContext(gd),R=et.useMemo(()=>new hd().withCoordinate(e).withHideOffscreen(n).withProvider(O).withHasPinUrl(v).build(),[]);et.useEffect(()=>{if(N!==0&&!N)return;const w=R.getProviderPin().getWrapperElement();w&&(w.style.zIndex=N.toString())},[N]),et.useEffect(()=>{R.setMap(T),R.setClickHandler(()=>d(r)),R.setFocusHandler(P=>g(P,r)),R.setHoverHandler(P=>p(P,r));const w=b==null?void 0:b.clusterIds.includes(r);return b&&!w&&b.setPinStore(P=>[...P,{pin:R,id:r}]),()=>{R.setMap(null),b&&b.setPinStore(P=>P.filter(H=>H.id!==r))}},[]);const x=t||c;if(x){const w=R.getProviderPin().getPinElement();return Object.assign(w.style,{height:"auto",width:"auto"}),ld.createPortal(x,w)}return null},kN=({children:t,coordinate:e,linkSameTab:n,pinUrl:r,onClick:c=()=>null,onHover:d=()=>null,onFocus:g=()=>null,...p})=>{var N;return at.jsx(Ep,{bounds:[e],...p,children:at.jsx(pd,{coordinate:e,id:"location-map-marker",onClick:c,onHover:d,onFocus:g,hasPinUrl:((N=r||"")==null?void 0:N.length)>0,children:r?at.jsx(gp,{href:r,target:n?"_self":"_blank",children:t}):t||void 0})})};var qc={},Hl={},Df;function IN(){if(Df)return Hl;Df=1;var t=et;const e=t.createContext(null);function n(c,d){let g=null;c!=null&&(g=c[1]);function p(){return d??(g!=null?g.getTheme():null)}return{getTheme:p}}function r(){const c=t.useContext(e);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}return Hl.LexicalComposerContext=e,Hl.createLexicalComposerContext=n,Hl.useLexicalComposerContext=r,Hl}var Wl={},Af;function PN(){if(Af)return Wl;Af=1;var t=et;function e(r){let c=new URLSearchParams;c.append("code",r);for(let d=1;d<arguments.length;d++)c.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${c} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=t.createContext(null);return Wl.LexicalComposerContext=n,Wl.createLexicalComposerContext=function(r,c){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return c??(d!=null?d.getTheme():null)}}},Wl.useLexicalComposerContext=function(){let r=t.useContext(n);return r==null&&e(8),r},Wl}var Zc,Mf;function Un(){return Mf||(Mf=1,Zc=process.env.NODE_ENV==="development"?IN():PN()),Zc}var Pe={},Rf;function $N(){if(Rf)return Pe;Rf=1;function t(u){return{type:u}}const e=t("SELECTION_CHANGE_COMMAND"),n=t("CLICK_COMMAND"),r=t("DELETE_CHARACTER_COMMAND"),c=t("INSERT_LINE_BREAK_COMMAND"),d=t("INSERT_PARAGRAPH_COMMAND"),g=t("CONTROLLED_TEXT_INSERTION_COMMAND"),p=t("PASTE_COMMAND"),N=t("REMOVE_TEXT_COMMAND"),v=t("DELETE_WORD_COMMAND"),T=t("DELETE_LINE_COMMAND"),O=t("FORMAT_TEXT_COMMAND"),b=t("UNDO_COMMAND"),R=t("REDO_COMMAND"),x=t("KEYDOWN_COMMAND"),w=t("KEY_ARROW_RIGHT_COMMAND"),P=t("MOVE_TO_END"),H=t("KEY_ARROW_LEFT_COMMAND"),$=t("MOVE_TO_START"),W=t("KEY_ARROW_UP_COMMAND"),B=t("KEY_ARROW_DOWN_COMMAND"),z=t("KEY_ENTER_COMMAND"),X=t("KEY_SPACE_COMMAND"),ee=t("KEY_BACKSPACE_COMMAND"),le=t("KEY_ESCAPE_COMMAND"),j=t("KEY_DELETE_COMMAND"),U=t("KEY_TAB_COMMAND"),q=t("INSERT_TAB_COMMAND"),me=t("INDENT_CONTENT_COMMAND"),_e=t("OUTDENT_CONTENT_COMMAND"),pe=t("DROP_COMMAND"),ue=t("FORMAT_ELEMENT_COMMAND"),K=t("DRAGSTART_COMMAND"),D=t("DRAGOVER_COMMAND"),V=t("DRAGEND_COMMAND"),ne=t("COPY_COMMAND"),Y=t("CUT_COMMAND"),G=t("SELECT_ALL_COMMAND"),Q=t("CLEAR_EDITOR_COMMAND"),k=t("CLEAR_HISTORY_COMMAND"),m=t("CAN_REDO_COMMAND"),y=t("CAN_UNDO_COMMAND"),M=t("FOCUS_COMMAND"),Z=t("BLUR_COMMAND"),ae=t("KEY_MODIFIER_COMMAND"),he=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=he&&"documentMode"in document?document.documentMode:null,Te=he&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),be=he&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Ue=he&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,re=he&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),te=he&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ce=he&&/Android/.test(navigator.userAgent),we=he&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Le=he&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!we,Be=1,Ye=3,ct=0,yt=1,dt=2,ve=0,ie=1,fe=2,Oe=1,Re=2,De=4,We=8,qe=16,Qe=32,ft=64,kt=128,je=Oe|Re|De|We|qe|Qe|ft|kt,Ve=1,rt=2,_t=1,Et=2,St=3,Ot=4,At=5,xt=6,Qt=" ",Ut=re||te||Le?Qt:"​",It=`
32
32
 
33
- `,hr=be?Qt:Ut,Sr="֑-߿יִ-﷽ﹰ-ﻼ",Fi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ps=new RegExp("^[^"+Fi+"]*["+Sr+"]"),ms=new RegExp("^[^"+Sr+"]*["+Fi+"]"),fn={bold:Oe,code:qe,highlight:kt,italic:Re,strikethrough:De,subscript:Qe,superscript:ft,underline:We},gr={directionless:Ve,unmergeable:rt},Jr={center:Et,end:xt,justify:Ot,left:_t,right:St,start:At},_s={[Et]:"center",[xt]:"end",[Ot]:"justify",[_t]:"left",[St]:"right",[At]:"start"},ye={normal:ve,segmented:fe,token:ie},Ge={[ve]:"normal",[fe]:"segmented",[ie]:"token"},nt=100;let Nt=!1,Ht=0;function Kt(){return Nt}function $t(u){Ht=u.timeStamp}function Pt(u){Ht===0&&Wi(u).addEventListener("textInput",$t,!0)}function mn(u,o,a){return o.__lexicalLineBreak===u||u[`__lexicalKey_${a._key}`]!==void 0}function sn(u){return u.getEditorState().read(()=>{const o=cn();return o!==null?o.clone():null})}function nn(u,o,a){const f=_r(a._window);let _=null,E=null;f!==null&&f.anchorNode===u&&(_=f.anchorOffset,E=f.focusOffset);const I=u.nodeValue;I!==null&&Po(o,I,_,E,!1)}function $n(u,o,a){if(pt(u)){const f=u.anchor.getNode();if(f.is(a)&&u.format!==f.getFormat())return!1}return o.nodeType===Ye&&a.isAttached()}function pr(u,o,a){Nt=!0;const f=performance.now()-Ht>nt;try{Rr(u,()=>{const _=cn()||sn(u),E=new Map,I=u.getRootElement(),F=u._editorState,oe=u._blockCursorElement;let de=!1,Ne="";for(let xe=0;xe<o.length;xe++){const Ce=o[xe],He=Ce.type,Ie=Ce.target;let Me=mr(Ie,F);if(!(Me===null&&Ie!==I||Sn(Me))){if(He==="characterData")f&&gt(Me)&&$n(_,Ie,Me)&&nn(Ie,Me,u);else if(He==="childList"){de=!0;const mt=Ce.addedNodes;for(let Ft=0;Ft<mt.length;Ft++){const Rt=mt[Ft],Ct=Ni(Rt),vt=Rt.parentNode;if(vt!=null&&Rt!==oe&&Ct===null&&(Rt.nodeName!=="BR"||!mn(Rt,vt,u))){if(be){const Wt=Rt.innerText||Rt.nodeValue;Wt&&(Ne+=Wt)}vt.removeChild(Rt)}}const ze=Ce.removedNodes,tt=ze.length;if(tt>0){let Ft=0;for(let Rt=0;Rt<tt;Rt++){const Ct=ze[Rt];(Ct.nodeName==="BR"&&mn(Ct,Ie,u)||oe===Ct)&&(Ie.appendChild(Ct),Ft++)}tt!==Ft&&(Ie===I&&(Me=Ci(F)),E.set(Ie,Me))}}}}if(E.size>0)for(const[xe,Ce]of E)if(Je(Ce)){const He=Ce.getChildrenKeys();let Ie=xe.firstChild;for(let Me=0;Me<He.length;Me++){const mt=He[Me],ze=u.getElementByKey(mt);ze!==null&&(Ie==null?(xe.appendChild(ze),Ie=ze):Ie!==ze&&xe.replaceChild(ze,Ie),Ie=Ie.nextSibling)}}else gt(Ce)&&Ce.markDirty();const Ee=a.takeRecords();if(Ee.length>0){for(let xe=0;xe<Ee.length;xe++){const Ce=Ee[xe],He=Ce.addedNodes,Ie=Ce.target;for(let Me=0;Me<He.length;Me++){const mt=He[Me],ze=mt.parentNode;ze!=null&&mt.nodeName==="BR"&&!mn(mt,Ie,u)&&ze.removeChild(mt)}}a.takeRecords()}_!==null&&(de&&(_.dirty=!0,Or(_)),be&&Ta(u)&&_.insertRawText(Ne))})}finally{Nt=!1}}function mi(u){const o=u._observer;if(o!==null){const a=o.takeRecords();pr(u,a,o)}}function qn(u){Pt(u),u._observer=new MutationObserver((o,a)=>{pr(u,o,a)})}function ul(u,o){const a=u.__mode,f=u.__format,_=u.__style,E=o.__mode,I=o.__format,F=o.__style;return(a===null||a===E)&&(f===null||f===I)&&(_===null||_===F)}function Xr(u,o){const a=u.mergeWithSibling(o),f=gn()._normalizedNodes;return f.add(u.__key),f.add(o.__key),a}function dl(u){let o=u;if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable()){o.remove();return}let a;for(;(a=o.getPreviousSibling())!==null&&gt(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else if(ul(a,o)){o=Xr(a,o);break}else break;let f;for(;(f=o.getNextSibling())!==null&&gt(f)&&f.isSimpleText()&&!f.isUnmergeable();)if(f.__text==="")f.remove();else if(ul(o,f)){o=Xr(o,f);break}else break}function Bi(u){return ys(u.anchor),ys(u.focus),u}function ys(u){for(;u.type==="element";){const o=u.getNode(),a=u.offset;let f,_;if(a===o.getChildrenSize()?(f=o.getChildAtIndex(a-1),_=!0):(f=o.getChildAtIndex(a),_=!1),gt(f)){u.set(f.__key,_?f.getTextContentSize():0,"text");break}else if(!Je(f))break;u.set(f.__key,_?f.getChildrenSize():0,"element")}}let fl=1;function hl(){return""+fl++}function kr(u,o){const a=u._nodes.get(o);if(a===void 0)throw Error(`registeredNode: Type ${o} not found`);return a}const Ns=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function wc(u){return Sn(mr(u))}function io(u){const o=document.activeElement;if(o===null)return!1;const a=o.nodeName;return Sn(mr(u))&&(a==="INPUT"||a==="TEXTAREA"||o.contentEditable==="true"&&o.__lexicalEditor==null)}function Qr(u,o,a){const f=u.getRootElement();try{return f!==null&&f.contains(o)&&f.contains(a)&&o!==null&&!io(o)&&Lo(o)===u}catch{return!1}}function Lo(u){let o=u;for(;o!=null;){const a=o.__lexicalEditor;if(a!=null)return a;o=Os(o)}return null}function la(u){return ps.test(u)?"rtl":ms.test(u)?"ltr":null}function gl(u){return u.isToken()||u.isSegmented()}function On(u){return u.nodeType===Ye}function Ln(u){let o=u;for(;o!=null;){if(On(o))return o;o=o.firstChild}return null}function wr(u,o,a){const f=fn[o];if(a!==null&&(u&f)===(a&f))return u;let _=u^f;return o==="subscript"?_&=~fn.superscript:o==="superscript"&&(_&=~fn.subscript),_}function _i(u){return gt(u)||Di(u)||Sn(u)}function Fn(u,o){if(o!=null){u.__key=o;return}nr(),Xd();const a=gn(),f=bi(),_=hl();f._nodeMap.set(_,u),Je(u)?a._dirtyElements.set(_,!0):a._dirtyLeaves.add(_),a._cloneNotNeeded.add(_),a._dirtyType=yt,u.__key=_}function ko(u,o,a){let f=u;for(;f!==null;){if(a.has(f))return;const _=o.get(f);if(_===void 0)break;a.set(f,!1),f=_.__parent}}function yi(u){const o=u.getParent();if(o!==null){const a=u.getWritable(),f=o.getWritable(),_=u.getPreviousSibling(),E=u.getNextSibling();if(_===null)if(E!==null){const I=E.getWritable();f.__first=E.__key,I.__prev=null}else f.__first=null;else{const I=_.getWritable();if(E!==null){const F=E.getWritable();F.__prev=I.__key,I.__next=F.__key}else I.__next=null;a.__prev=null}if(E===null)if(_!==null){const I=_.getWritable();f.__last=_.__key,I.__next=null}else f.__last=null;else{const I=E.getWritable();if(_!==null){const F=_.getWritable();F.__next=I.__key,I.__prev=F.__key}else I.__prev=null;a.__next=null}f.__size--,a.__parent=null}}function oo(u){Xd();const o=u.getLatest(),a=o.__parent,f=bi(),_=gn(),E=f._nodeMap,I=_._dirtyElements;a!==null&&ko(a,E,I);const F=o.__key;_._dirtyType=yt,Je(u)?I.set(F,!0):_._dirtyLeaves.add(F)}function Cs(u){const o=u.getPreviousSibling(),a=u.getNextSibling();o!==null&&oo(o),a!==null&&oo(a)}function _n(u){nr();const o=gn(),a=o._compositionKey;if(u!==a){if(o._compositionKey=u,a!==null){const f=En(a);f!==null&&f.getWritable()}if(u!==null){const f=En(u);f!==null&&f.getWritable()}}}function Ir(){return Ws()?null:gn()._compositionKey}function En(u,o){const f=(o||bi())._nodeMap.get(u);return f===void 0?null:f}function Ni(u,o){const a=gn(),f=u[`__lexicalKey_${a._key}`];return f!==void 0?En(f,o):null}function mr(u,o){let a=u;for(;a!=null;){const f=Ni(a,o);if(f!==null)return f;a=Os(a)}return null}function Es(u){const o=u._decorators,a=Object.assign({},o);return u._pendingDecorators=a,a}function so(u){return u.read(()=>Zn().getTextContent())}function Ts(u,o){Rr(u,()=>{const a=bi();if(a.isEmpty())return;if(o==="root"){Zn().markDirty();return}const f=a._nodeMap;for(const[,_]of f)_.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Zn(){return Ci(bi())}function Ci(u){return u._nodeMap.get("root")}function Or(u){nr();const o=bi();if(u!==null){if(Object.isFrozen(u))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");u.dirty=!0,u.setCachedNodes(null)}o._selection=u}function aa(){nr();const u=gn();mi(u)}function ei(u){const o=gn(),a=ca(u,o);if(a===null){const f=o.getRootElement();return u===f?En("root"):null}return En(a)}function xs(u,o){return o?u.getTextContentSize():0}function ca(u,o){let a=u;for(;a!=null;){const f=a[`__lexicalKey_${o._key}`];if(f!==void 0)return f;a=Os(a)}return null}function pl(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function vs(u){const o=[];let a=u;for(;a!==null;)o.push(a),a=a._parentEditor;return o}function Io(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function lo(u){return u.nodeType===Ye?u.nodeValue:null}function Ss(u,o,a){const f=_r(o._window);if(f===null)return;const _=f.anchorNode;let{anchorOffset:E,focusOffset:I}=f;if(_!==null){let F=lo(_);const oe=mr(_);if(F!==null&&gt(oe)){if(F===Ut&&a){const de=a.length;F=a,E=de,I=de}F!==null&&Po(oe,F,E,I,u)}}}function Po(u,o,a,f,_){let E=u;if(E.isAttached()&&(_||!E.isDirty())){const I=E.isComposing();let F=o;(I||_)&&o[o.length-1]===Ut&&(F=o.slice(0,-1));const oe=E.getTextContent();if(_||F!==oe){if(F===""){if(_n(null),!re&&!te&&!Le){const Ie=gn();setTimeout(()=>{Ie.update(()=>{E.isAttached()&&E.remove()})},20)}else E.remove();return}const de=E.getParent(),Ne=Hs(),Ee=E.getTextContentSize(),xe=Ir(),Ce=E.getKey();if(E.isToken()||xe!==null&&Ce===xe&&!I||pt(Ne)&&(de!==null&&!de.canInsertTextBefore()&&Ne.anchor.offset===0||Ne.anchor.key===u.__key&&Ne.anchor.offset===0&&!E.canInsertTextBefore()||Ne.focus.key===u.__key&&Ne.focus.offset===Ee&&!E.canInsertTextAfter())){E.markDirty();return}const He=cn();if(!pt(He)||a===null||f===null){E.setTextContent(F);return}if(He.setTextNodeRange(E,a,E,f),E.isSegmented()){const Ie=E.getTextContent(),Me=Wn(Ie);E.replace(Me),E=Me}E.setTextContent(F)}}}function ml(u){const o=u.getPreviousSibling();return(gt(o)||Je(o)&&o.isInline())&&!o.canInsertTextAfter()}function ti(u,o){if(o.isSegmented())return!0;if(!u.isCollapsed())return!1;const a=u.anchor.offset,f=o.getParentOrThrow(),_=o.isToken();return a===0?!o.canInsertTextBefore()||!f.canInsertTextBefore()||_||ml(o):a===o.getTextContentSize()?!o.canInsertTextAfter()||!f.canInsertTextAfter()||_:!1}function _l(u,o,a,f){return u===9&&!o&&!a&&!f}function $o(u,o,a,f){return u===66&&!o&&ni(a,f)}function ua(u,o,a,f){return u===73&&!o&&ni(a,f)}function da(u,o,a,f){return u===85&&!o&&ni(a,f)}function ao(u,o){return Ea(u)&&!o}function Fo(u,o){return Ea(u)&&o}function yl(u,o){return Te&&o&&u===79}function Nl(u,o,a){return Pr(u)&&(Te?o:a)}function Bo(u,o,a){return $r(u)&&(Te?o:a)}function Ho(u,o){return Te&&o&&Pr(u)}function fa(u,o){return Te&&o&&$r(u)}function ha(u,o,a,f){return Te?o||a?!1:Pr(u)||u===72&&f:f||o||a?!1:Pr(u)}function ga(u,o,a,f,_){return Te?a||f||_?!1:$r(u)||u===68&&o:o||f||_?!1:$r(u)}function pa(u,o,a,f){return u===90&&!o&&ni(a,f)}function Oc(u,o,a,f){return Te?u===90&&a&&o:u===89&&f||u===90&&f&&o}function Dc(u,o,a,f){return o?!1:u===67?Te?a:f:!1}function ma(u,o,a,f){return o?!1:u===88?Te?a:f:!1}function _a(u){return u===37}function ya(u){return u===39}function Ac(u){return u===38}function Mc(u){return u===40}function Cl(u,o,a,f){return _a(u)&&!o&&!f&&!a}function Rc(u,o,a,f,_){return _a(u)&&!f&&!a&&(o||_)}function bc(u,o,a,f){return ya(u)&&!o&&!f&&!a}function Na(u,o,a,f,_){return ya(u)&&!f&&!a&&(o||_)}function co(u,o,a){return Ac(u)&&!o&&!a}function Ca(u,o,a){return Mc(u)&&!o&&!a}function Lc(u,o,a,f){return u||o||a||f}function El(u){return u===32}function ni(u,o){return Te?u:o}function Ea(u){return u===13}function Pr(u){return u===8}function kc(u){return u===27}function $r(u){return u===46}function Ei(u,o,a){return u===65&&ni(o,a)}function Tl(){const u=Zn(),o=u.select(0,u.getChildrenSize());Or(Bi(o))}function Hi(u,o){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const a=u.__lexicalClassNameCache,f=a[o];if(f!==void 0)return f;const _=u[o];if(typeof _=="string"){const E=_.split(" ");return a[o]=E,E}return _}function Wo(u,o,a,f,_){if(a.size===0)return;const E=f.__type,I=f.__key,F=o.get(E);if(F===void 0)throw Error(`Type ${E} not in registeredNodes`);const oe=F.klass;let de=u.get(oe);de===void 0&&(de=new Map,u.set(oe,de));const Ne=de.get(I),Ee=Ne==="destroyed"&&_==="created";(Ne===void 0||Ee)&&de.set(I,Ee?"updated":_)}function xl(u){const o=bi(),a=o._readOnly,f=u.getType(),_=o._nodeMap,E=[];for(const[,I]of _)I instanceof u&&I.__type===f&&(a||I.isAttached())&&E.push(I);return E}function Ko(u,o,a){const f=u.getParent();let _=a,E=u;return f!==null&&(o&&a===0?(_=E.getIndexWithinParent(),E=f):!o&&a===E.getChildrenSize()&&(_=E.getIndexWithinParent()+1,E=f)),E.getChildAtIndex(o?_-1:_)}function ri(u,o){const a=u.offset;if(u.type==="element"){const f=u.getNode();return Ko(f,o,a)}else{const f=u.getNode();if(o&&a===0||!o&&a===f.getTextContentSize()){const _=o?f.getPreviousSibling():f.getNextSibling();return _===null?Ko(f.getParentOrThrow(),o,f.getIndexWithinParent()+(o?0:1)):_}}return null}function Ta(u){const o=Wi(u).event,a=o&&o.inputType;return a==="insertFromPaste"||a==="insertFromPasteAsQuotation"}function st(u,o,a){return rf(u,o,a)}function zo(u){return!br(u)&&!u.isLastChild()&&!u.isInline()}function ws(u,o){const a=u._keyToDOMMap.get(o);if(a===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${o}`);return a}function Os(u){const o=u.assignedSlot||u.parentElement;return o!==null&&o.nodeType===11?o.host:o}function xa(u,o,a){const f=a.ownerDocument,_=f.defaultView;if(_===null)return;let{top:E,bottom:I}=o,F=0,oe=0,de=a;for(;de!==null;){const Ne=de===f.body;if(Ne)F=0,oe=Wi(u).innerHeight;else{const xe=de.getBoundingClientRect();F=xe.top,oe=xe.bottom}let Ee=0;if(E<F?Ee=-(F-E):I>oe&&(Ee=I-oe),Ee!==0)if(Ne)_.scrollBy(0,Ee);else{const xe=de.scrollTop;de.scrollTop+=Ee;const Ce=de.scrollTop-xe;E-=Ce,I-=Ce}if(Ne)break;de=Os(de)}}function Ic(u){return gn()._updateTags.has(u)}function Ti(u){nr(),gn()._updateTags.add(u)}function Bn(u){const o=cn();if(!pt(o)||!Je(u))return o;const{anchor:a,focus:f}=o,_=a.getNode(),E=f.getNode();return ht(_,u)&&a.set(u.__key,0,"element"),ht(E,u)&&f.set(u.__key,0,"element"),o}function ht(u,o){let a=u.getParent();for(;a!==null;){if(a.is(o))return!0;a=a.getParent()}return!1}function uo(u){const o=u.ownerDocument;return o&&o.defaultView||null}function Wi(u){const o=u._window;if(o===null)throw Error("window object not found");return o}function va(u){return Je(u)&&u.isInline()||Sn(u)&&u.isInline()}function Dr(u){let o=u.getParentOrThrow();for(;o!==null;){if(Fr(o))return o;o=o.getParentOrThrow()}return o}function Fr(u){return br(u)||Je(u)&&u.isShadowRoot()}function vl(u){const o=u.constructor.clone(u);return Fn(o,null),o}function fo(u){const o=gn(),a=u.constructor.getType(),f=o._nodes.get(a);if(f===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const _=f.replace;if(_!==null){const E=_(u);if(!(E instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return E}return u}function Br(u,o){const a=u.getParent();if(br(a)&&!Je(o)&&!Sn(o))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Sl(u){const o=u.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let f=o.blockCursor;if(f!==void 0){if(typeof f=="string"){const _=f.split(" ");f=o.blockCursor=_}f!==void 0&&a.classList.add(...f)}return a}function ho(u){return(Sn(u)||Je(u)&&!u.canBeEmpty())&&!u.isInline()}function wt(u,o,a){a.style.removeProperty("caret-color"),o._blockCursorElement=null;const f=u.parentElement;f!==null&&f.removeChild(u)}function wl(u,o,a){let f=u._blockCursorElement;if(pt(a)&&a.isCollapsed()&&a.anchor.type==="element"&&o.contains(document.activeElement)){const _=a.anchor,E=_.getNode(),I=_.offset,F=E.getChildrenSize();let oe=!1,de=null;if(I===F){const Ne=E.getChildAtIndex(I-1);ho(Ne)&&(oe=!0)}else{const Ne=E.getChildAtIndex(I);if(ho(Ne)){const Ee=Ne.getPreviousSibling();(Ee===null||ho(Ee))&&(oe=!0,de=u.getElementByKey(Ne.__key))}}if(oe){const Ne=u.getElementByKey(E.__key);f===null&&(u._blockCursorElement=f=Sl(u._config)),o.style.caretColor="transparent",de===null?Ne.appendChild(f):Ne.insertBefore(f,de);return}}f!==null&&wt(f,u,o)}function _r(u){return he?(u||window).getSelection():null}function Ds(u,o){let a=u.getChildAtIndex(o);if(a==null&&(a=u),Fr(u))throw Error("Can not call $splitNode() on root element");const f=I=>{const F=I.getParentOrThrow(),oe=Fr(F),de=I===a&&!oe?I:vl(I);if(oe)return I.insertAfter(de),[I,de,de];{const[Ne,Ee,xe]=f(F),Ce=I.getNextSiblings();return xe.append(de,...Ce),[Ne,Ee,de]}},[_,E]=f(a);return[_,E]}function Uo(u,o){let a=u;for(;a!==Zn()&&a!=null;){if(o(a))return a;a=a.getParent()}return null}function Ki(u){const o=[],a=[u];for(;a.length>0;){const f=a.pop();if(f===void 0)throw Error("Stack.length > 0; can't be undefined");Je(f)&&a.unshift(...f.getChildren()),f!==u&&o.push(f)}return o}function Go(u){return Yo(u)&&u.tagName==="A"}function Yo(u){return u.nodeType===1}function zi(u){if(Sn(u)&&!u.isInline())return!0;if(!Je(u)||Fr(u))return!1;const o=u.getFirstChild(),a=o===null||Di(o)||gt(o)||o.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&a}function As(u,o){let a=u;for(;a!==null&&a.getParent()!==null&&!o(a);)a=a.getParentOrThrow();return o(a)?a:null}function Sa(u,o){const a=u._decorators;let _=u._pendingDecorators||a;const E=o._nodeMap;let I;for(I in _)E.has(I)||(_===a&&(_=Es(u)),delete _[I])}function Ol(u,o,a,f,_,E){let I=u.getFirstChild();for(;I!==null;){const F=I.__key;I.__parent===o&&(Je(I)&&Ol(I,F,a,f,_,E),a.has(F)||E.delete(F),_.push(F)),I=I.getNextSibling()}}function wa(u,o,a,f){const _=u._nodeMap,E=o._nodeMap,I=[];for(const[F]of f){const oe=E.get(F);oe!==void 0&&(oe.isAttached()||(Je(oe)&&Ol(oe,F,_,E,I,f),_.has(F)||f.delete(F),I.push(F)))}for(const F of I)E.delete(F);for(const F of a){const oe=E.get(F);oe!==void 0&&!oe.isAttached()&&(_.has(F)||a.delete(F),E.delete(F))}}let Tn="",Gn="",Ar="",xi,Hn,Vt,Ui=!1,go=!1,jo,Ms=null,po,Rs,vi,ii,Vo,qo;function yn(u,o){const a=vi.get(u);if(o!==null){const f=an(u);f.parentNode===o&&o.removeChild(f)}if(ii.has(u)||Hn._keyToDOMMap.delete(u),Je(a)){const f=_o(a,vi);xn(f,0,f.length-1,null)}a!==void 0&&Wo(qo,Vt,jo,a,"destroyed")}function xn(u,o,a,f){let _=o;for(;_<=a;++_){const E=u[_];E!==void 0&&yn(E,f)}}function vn(u,o){u.setProperty("text-align",o)}const Dl="40px";function mo(u,o){const a=xi.theme.indent;if(typeof a=="string"){const _=u.classList.contains(a);o>0&&!_?u.classList.add(a):o<1&&_&&u.classList.remove(a)}const f=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||Dl;u.style.setProperty("padding-inline-start",o===0?"":`calc(${o} * ${f})`)}function Al(u,o){const a=u.style;o===0?vn(a,""):o===_t?vn(a,"left"):o===Et?vn(a,"center"):o===St?vn(a,"right"):o===Ot?vn(a,"justify"):o===At?vn(a,"start"):o===xt&&vn(a,"end")}function oi(u,o,a){const f=ii.get(u);if(f===void 0)throw Error("createNode: node does not exist in nodeMap");const _=f.createDOM(xi,Hn);if(Ma(u,_,Hn),gt(f)?_.setAttribute("data-lexical-text","true"):Sn(f)&&_.setAttribute("data-lexical-decorator","true"),Je(f)){const E=f.__indent,I=f.__size;if(E!==0&&mo(_,E),I!==0){const oe=I-1,de=_o(f,ii);Jn(de,oe,f,_)}const F=f.__format;F!==0&&Al(_,F),f.isInline()||Ml(null,f,_),zo(f)&&(Tn+=It,Ar+=It)}else{const E=f.getTextContent();if(Sn(f)){const I=f.decorate(Hn,xi);I!==null&&yo(u,I),_.contentEditable="false"}else gt(f)&&(f.isDirectionless()||(Gn+=E));Tn+=E,Ar+=E}if(o!==null)if(a!=null)o.insertBefore(_,a);else{const E=o.__lexicalLineBreak;E!=null?o.insertBefore(_,E):o.appendChild(_)}return Object.freeze(f),Wo(qo,Vt,jo,f,"created"),_}function Jn(u,o,a,f){const _=Gn;Gn="",yr(u,a,0,o,f,null),Oa(a,f),Gn=_}function yr(u,o,a,f,_,E){const I=Tn;Tn="";let F=a;for(;F<=f;++F)oi(u[F],_,E);zo(o)&&(Tn+=It),_.__lexicalTextContent=Tn,Tn=I+Tn}function ln(u,o){const a=o.get(u);return Di(a)||Sn(a)&&a.isInline()}function Ml(u,o,a){const f=u!==null&&(u.__size===0||ln(u.__last,vi)),_=o.__size===0||ln(o.__last,ii);if(f){if(!_){const E=a.__lexicalLineBreak;E!=null&&a.removeChild(E),a.__lexicalLineBreak=null}}else if(_){const E=document.createElement("br");a.__lexicalLineBreak=E,a.appendChild(E)}}function Oa(u,o){const a=o.__lexicalDirTextContent,f=o.__lexicalDir;if(a!==Gn||f!==Ms){const _=Gn==="",E=_?Ms:la(Gn);if(E!==f){const I=o.classList,F=xi.theme;let oe=f!==null?F[f]:void 0,de=E!==null?F[E]:void 0;if(oe!==void 0){if(typeof oe=="string"){const Ne=oe.split(" ");oe=F[f]=Ne}I.remove(...oe)}if(E===null||_&&E==="ltr")o.removeAttribute("dir");else{if(de!==void 0){if(typeof de=="string"){const Ne=de.split(" ");de=F[E]=Ne}de!==void 0&&I.add(...de)}o.dir=E}if(!go){const Ne=u.getWritable();Ne.__dir=E}}Ms=E,o.__lexicalDirTextContent=Gn,o.__lexicalDir=E}}function Pc(u,o,a){const f=Gn;Gn="",Da(u,o,a),Oa(o,a),Gn=f}function _o(u,o){const a=[];let f=u.__first;for(;f!==null;){const _=o.get(f);if(_===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");a.push(f),f=_.__next}return a}function Da(u,o,a){const f=Tn,_=u.__size,E=o.__size;if(Tn="",_===1&&E===1){const I=u.__first,F=o.__first;if(I===F)Mr(I,a);else{const oe=an(I),de=oi(F,null,null);a.replaceChild(de,oe),yn(I,null)}}else{const I=_o(u,vi),F=_o(o,ii);if(_===0)E!==0&&yr(F,o,0,E-1,a,null);else if(E===0){if(_!==0){const de=a.__lexicalLineBreak==null;xn(I,0,_-1,de?null:a),de&&(a.textContent="")}}else Aa(o,I,F,_,E,a)}zo(o)&&(Tn+=It),a.__lexicalTextContent=Tn,Tn=f+Tn}function Mr(u,o){const a=vi.get(u);let f=ii.get(u);if(a===void 0||f===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const _=Ui||Rs.has(u)||po.has(u),E=ws(Hn,u);if(a===f&&!_){if(Je(a)){const I=E.__lexicalTextContent;I!==void 0&&(Tn+=I,Ar+=I);const F=E.__lexicalDirTextContent;F!==void 0&&(Gn+=F)}else{const I=a.getTextContent();gt(a)&&!a.isDirectionless()&&(Gn+=I),Ar+=I,Tn+=I}return E}if(a!==f&&_&&Wo(qo,Vt,jo,f,"updated"),f.updateDOM(a,E,xi)){const I=oi(u,null,null);if(o===null)throw Error("reconcileNode: parentDOM is null");return o.replaceChild(I,E),yn(u,null),I}if(Je(a)&&Je(f)){const I=f.__indent;I!==a.__indent&&mo(E,I);const F=f.__format;F!==a.__format&&Al(E,F),_&&(Pc(a,f,E),!br(f)&&!f.isInline()&&Ml(a,f,E)),zo(f)&&(Tn+=It,Ar+=It)}else{const I=f.getTextContent();if(Sn(f)){const F=f.decorate(Hn,xi);F!==null&&yo(u,F)}else gt(f)&&!f.isDirectionless()&&(Gn+=I);Tn+=I,Ar+=I}return!go&&br(f)&&f.__cachedText!==Ar&&(f=f.getWritable(),f.__cachedText=Ar),Object.freeze(f),E}function yo(u,o){let a=Hn._pendingDecorators;const f=Hn._decorators;if(a===null){if(f[u]===o)return;a=Es(Hn)}a[u]=o}function ot(u){return u.firstChild}function bs(u){let o=u.nextSibling;return o!==null&&o===Hn._blockCursorElement&&(o=o.nextSibling),o}function Aa(u,o,a,f,_,E){const I=f-1,F=_-1;let oe,de,Ne=ot(E),Ee=0,xe=0;for(;Ee<=I&&xe<=F;){const Ie=o[Ee],Me=a[xe];if(Ie===Me)Ne=bs(Mr(Me,E)),Ee++,xe++;else{oe===void 0&&(oe=new Set(o)),de===void 0&&(de=new Set(a));const mt=de.has(Ie),ze=oe.has(Me);if(!mt)Ne=bs(an(Ie)),yn(Ie,E),Ee++;else if(!ze)oi(Me,E,Ne),xe++;else{const tt=ws(Hn,Me);tt===Ne?Ne=bs(Mr(Me,E)):(Ne!=null?E.insertBefore(tt,Ne):E.appendChild(tt),Mr(Me,E)),Ee++,xe++}}}const Ce=Ee>I,He=xe>F;if(Ce&&!He){const Ie=a[F+1],Me=Ie===void 0?null:Hn.getElementByKey(Ie);yr(a,u,xe,F,E,Me)}else He&&!Ce&&xn(o,Ee,I,E)}function sr(u,o,a,f,_,E){Tn="",Ar="",Gn="",Ui=f===dt,Ms=null,Hn=a,xi=a._config,Vt=a._nodes,jo=Hn._listeners.mutation,po=_,Rs=E,vi=u._nodeMap,ii=o._nodeMap,go=o._readOnly,Vo=new Map(a._keyToDOMMap);const I=new Map;return qo=I,Mr("root",null),Hn=void 0,Vt=void 0,po=void 0,Rs=void 0,vi=void 0,ii=void 0,xi=void 0,Vo=void 0,qo=void 0,I}function Ma(u,o,a){const f=a._keyToDOMMap;o["__lexicalKey_"+a._key]=u,f.set(u,o)}function an(u){const o=Vo.get(u);if(o===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return o}const Xn=Object.freeze({}),Ze=30,Ls=[["keydown",S],["pointerdown",ka],["compositionstart",s],["compositionend",N],["input",i],["click",Nr],["cut",Xn],["copy",Xn],["dragstart",Xn],["dragover",Xn],["dragend",Xn],["paste",Xn],["focus",Xn],["blur",Xn],["drop",Xn]];Ue&&Ls.push(["beforeinput",(u,o)=>l(u,o)]);let Hr=0,tr=0,Ra=0,Si=null,No=0,Co=!1,wi=!1,Zo=!1,lr=!1,Rl=[0,"",0,"root",0];function ba(u,o,a,f,_){const E=u.anchor,I=u.focus,F=E.getNode(),oe=gn(),de=_r(oe._window),Ne=de!==null?de.anchorNode:null,Ee=E.key,xe=oe.getElementByKey(Ee),Ce=a.length;return Ee!==I.key||!gt(F)||(!_&&(!Ue||Ra<f+50)||F.isDirty()&&Ce<2||pl(a))&&E.offset!==I.offset&&!F.isComposing()||gl(F)||F.isDirty()&&Ce>1||(_||!Ue)&&xe!==null&&!F.isComposing()&&Ne!==Ln(xe)||de!==null&&o!==null&&(!o.collapsed||o.startContainer!==de.anchorNode||o.startOffset!==de.anchorOffset)||F.getFormat()!==u.format||F.getStyle()!==u.style||ti(u,F)}function La(u,o){return u!==null&&u.nodeValue!==null&&u.nodeType===Ye&&o!==0&&o!==u.nodeValue.length}function ks(u,o,a){const{anchorNode:f,anchorOffset:_,focusNode:E,focusOffset:I}=u;Co&&(Co=!1,La(f,_)&&La(E,I))||Rr(o,()=>{if(!a){Or(null);return}if(!Qr(o,f,E))return;const F=cn();if(pt(F)){const oe=F.anchor,de=oe.getNode();if(F.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&(F.dirty=!0);const Ne=Wi(o).event,Ee=Ne?Ne.timeStamp:performance.now(),[xe,Ce,He,Ie,Me]=Rl,mt=Zn(),ze=o.isComposing()===!1&&mt.getTextContent()==="";Ee<Me+200&&oe.offset===He&&oe.key===Ie?(F.format=xe,F.style=Ce):oe.type==="text"?(F.format=de.getFormat(),F.style=de.getStyle()):oe.type==="element"&&!ze&&(F.format=0,F.style="")}else{let Ne=je,Ee=!1;const xe=F.getNodes(),Ce=xe.length;for(let He=0;He<Ce;He++){const Ie=xe[He];if(gt(Ie)&&(Ee=!0,Ne&=Ie.getFormat(),Ne===0))break}F.format=Ee?Ne:0}}st(o,e,void 0)})}function Nr(u,o){Rr(o,()=>{const a=cn(),f=_r(o._window),_=Hs();if(f){if(pt(a)){const E=a.anchor,I=E.getNode();if(E.type==="element"&&E.offset===0&&a.isCollapsed()&&!br(I)&&Zn().getChildrenSize()===1&&I.getTopLevelElementOrThrow().isEmpty()&&_!==null&&a.is(_))f.removeAllRanges(),a.dirty=!0;else if(u.detail===3&&!a.isCollapsed()){const oe=a.focus.getNode();I!==oe&&(Je(I)?I.select(0):I.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const E=f.anchorNode;if(E!==null){const I=E.nodeType;if(I===Be||I===Ye){const F=Fc(_,f,o);Or(F)}}}}st(o,n,u)})}function ka(u,o){const a=u.target,f=u.pointerType;a instanceof Node&&f!=="touch"&&Rr(o,()=>{wc(a)||(wi=!0)})}function Is(u){if(!u.getTargetRanges)return null;const o=u.getTargetRanges();return o.length===0?null:o[0]}function Ia(u,o){return u!==o||Je(u)||Je(o)||!u.isToken()||!o.isToken()}function Jo(u){return tr===229&&u<Hr+Ze}function l(u,o){const a=u.inputType,f=Is(u);a==="deleteCompositionText"||be&&Ta(o)||a!=="insertCompositionText"&&Rr(o,()=>{const _=cn();if(a==="deleteContentBackward"){if(_===null){const Ne=Hs();if(!pt(Ne))return;Or(Ne.clone())}if(pt(_)){if(ce&&_n(_.anchor.key),Jo(u.timeStamp)&&o.isComposing()&&_.anchor.key===_.focus.key){if(_n(null),Hr=0,setTimeout(()=>{Rr(o,()=>{_n(null)})},Ze),pt(_)){const Ee=_.anchor.getNode();Ee.markDirty(),_.format=Ee.getFormat(),_.style=Ee.getStyle()}_.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),st(o,r,!0))}else u.preventDefault(),st(o,r,!0);return}}if(!pt(_))return;const E=u.data;Si!==null&&Ss(!1,o,Si),(!_.dirty||Si!==null)&&_.isCollapsed()&&!br(_.anchor.getNode())&&f!==null&&_.applyDOMRange(f),Si=null;const I=_.anchor,F=_.focus,oe=I.getNode(),de=F.getNode();if(a==="insertText"||a==="insertTranspose"){if(E===`
34
- `)u.preventDefault(),st(o,c,!1);else if(E===It)u.preventDefault(),st(o,d,void 0);else if(E==null&&u.dataTransfer){const Ne=u.dataTransfer.getData("text/plain");u.preventDefault(),_.insertRawText(Ne)}else E!=null&&ba(_,f,E,u.timeStamp,!0)?(u.preventDefault(),st(o,g,E)):Si=E;Ra=u.timeStamp;return}switch(u.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{st(o,g,u);break}case"insertFromComposition":{_n(null),st(o,g,u);break}case"insertLineBreak":{_n(null),st(o,c,!1);break}case"insertParagraph":{_n(null),Zo&&!te?(Zo=!1,st(o,c,!1)):st(o,d,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{st(o,p,u);break}case"deleteByComposition":{Ia(oe,de)&&st(o,C,u);break}case"deleteByDrag":case"deleteByCut":{st(o,C,u);break}case"deleteContent":{st(o,r,!1);break}case"deleteWordBackward":{st(o,v,!0);break}case"deleteWordForward":{st(o,v,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{st(o,T,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{st(o,T,!1);break}case"formatStrikeThrough":{st(o,O,"strikethrough");break}case"formatBold":{st(o,O,"bold");break}case"formatItalic":{st(o,O,"italic");break}case"formatUnderline":{st(o,O,"underline");break}case"historyUndo":{st(o,R,void 0);break}case"historyRedo":{st(o,b,void 0);break}}})}function i(u,o){u.stopPropagation(),Rr(o,()=>{const a=cn(),f=u.data,_=Is(u);if(f!=null&&pt(a)&&ba(a,_,f,u.timeStamp,!1)){lr&&(h(o,f),lr=!1);const E=a.anchor,I=E.getNode(),F=_r(o._window);if(F===null)return;const oe=E.offset;(!Ue||a.isCollapsed()||!gt(I)||F.anchorNode===null||I.getTextContent().slice(0,oe)+f+I.getTextContent().slice(oe+a.focus.offset)!==lo(F.anchorNode))&&st(o,g,f);const de=f.length;be&&de>1&&u.inputType==="insertCompositionText"&&!o.isComposing()&&(a.anchor.offset-=de),!re&&!te&&!Le&&o.isComposing()&&(Hr=0,_n(null))}else Ss(!1,o,f!==null?f:void 0),lr&&(h(o,f||void 0),lr=!1);aa()}),Si=null}function s(u,o){Rr(o,()=>{const a=cn();if(pt(a)&&!o.isComposing()){const f=a.anchor,_=a.anchor.getNode();_n(f.key),(u.timeStamp<Hr+Ze||f.type==="element"||!a.isCollapsed()||_.getFormat()!==a.format||_.getStyle()!==a.style)&&st(o,g,hr)}})}function h(u,o){const a=u._compositionKey;if(_n(null),a!==null&&o!=null){if(o===""){const f=En(a),_=Ln(u.getElementByKey(a));_!==null&&_.nodeValue!==null&&gt(f)&&Po(f,_.nodeValue,null,null,!0);return}if(o[o.length-1]===`
35
- `){const f=cn();if(pt(f)){const _=f.focus;f.anchor.set(_.key,_.offset,_.type),st(u,z,null);return}}}Ss(!0,u,o)}function N(u,o){be?lr=!0:Rr(o,()=>{h(o,u.data)})}function S(u,o){if(Hr=u.timeStamp,tr=u.keyCode,o.isComposing())return;const{keyCode:a,shiftKey:f,ctrlKey:_,metaKey:E,altKey:I}=u;if(!st(o,x,u)){if(bc(a,_,I,E))st(o,w,u);else if(Na(a,_,f,I,E))st(o,$,u);else if(Cl(a,_,I,E))st(o,W,u);else if(Rc(a,_,f,I,E))st(o,P,u);else if(co(a,_,E))st(o,H,u);else if(Ca(a,_,E))st(o,B,u);else if(Fo(a,f))Zo=!0,st(o,z,u);else if(El(a))st(o,X,u);else if(yl(a,_))u.preventDefault(),Zo=!0,st(o,c,!0);else if(ao(a,f))Zo=!1,st(o,z,u);else if(ha(a,I,E,_))Pr(a)?st(o,ee,u):(u.preventDefault(),st(o,r,!0));else if(kc(a))st(o,le,u);else if(ga(a,_,f,I,E))$r(a)?st(o,j,u):(u.preventDefault(),st(o,r,!1));else if(Nl(a,I,_))u.preventDefault(),st(o,v,!0);else if(Bo(a,I,_))u.preventDefault(),st(o,v,!1);else if(Ho(a,E))u.preventDefault(),st(o,T,!0);else if(fa(a,E))u.preventDefault(),st(o,T,!1);else if($o(a,I,E,_))u.preventDefault(),st(o,O,"bold");else if(da(a,I,E,_))u.preventDefault(),st(o,O,"underline");else if(ua(a,I,E,_))u.preventDefault(),st(o,O,"italic");else if(_l(a,I,_,E))st(o,U,u);else if(pa(a,f,E,_))u.preventDefault(),st(o,R,void 0);else if(Oc(a,f,E,_))u.preventDefault(),st(o,b,void 0);else{const F=o._editorState._selection;Er(F)?Dc(a,f,E,_)?(u.preventDefault(),st(o,ne,u)):ma(a,f,E,_)?(u.preventDefault(),st(o,Y,u)):Ei(a,E,_)&&(u.preventDefault(),st(o,G,u)):!be&&Ei(a,E,_)&&(u.preventDefault(),st(o,G,u))}Lc(_,f,I,E)&&st(o,ae,u)}}function A(u){let o=u.__lexicalEventHandles;return o===void 0&&(o=[],u.__lexicalEventHandles=o),o}const J=new Map;function ge(u){const o=u.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,f=_r(a);if(f===null)return;const _=Lo(f.anchorNode);if(_===null)return;wi&&(wi=!1,Rr(_,()=>{const Ne=Hs(),Ee=f.anchorNode;if(Ee===null)return;const xe=Ee.nodeType;if(xe!==Be&&xe!==Ye)return;const Ce=Fc(Ne,f,_);Or(Ce)}));const E=vs(_),I=E[E.length-1],F=I._key,oe=J.get(F),de=oe||I;de!==_&&ks(f,de,!1),ks(f,_,!0),_!==I?J.set(F,_):oe&&J.delete(F)}function Se(u){u._lexicalHandled=!0}function Fe(u){return u._lexicalHandled===!0}function Ke(u,o){No===0&&u.ownerDocument.addEventListener("selectionchange",ge),No++,u.__lexicalEditor=o;const a=A(u);for(let f=0;f<Ls.length;f++){const[_,E]=Ls[f],I=typeof E=="function"?F=>{Fe(F)||(Se(F),o.isEditable()&&E(F,o))}:F=>{if(!Fe(F)&&(Se(F),o.isEditable()))switch(_){case"cut":return st(o,Y,F);case"copy":return st(o,ne,F);case"paste":return st(o,p,F);case"dragstart":return st(o,K,F);case"dragover":return st(o,D,F);case"dragend":return st(o,V,F);case"focus":return st(o,M,F);case"blur":return st(o,Z,F);case"drop":return st(o,pe,F)}};u.addEventListener(_,I),a.push(()=>{u.removeEventListener(_,I)})}}function ke(u){No!==0&&(No--,No===0&&u.ownerDocument.removeEventListener("selectionchange",ge));const o=u.__lexicalEditor;o!=null&&(Ae(o),u.__lexicalEditor=null);const a=A(u);for(let f=0;f<a.length;f++)a[f]();u.__lexicalEventHandles=[]}function Ae(u){if(u._parentEditor!==null){const o=vs(u),f=o[o.length-1]._key;J.get(f)===u&&J.delete(f)}else J.delete(u._key)}function Xe(){Co=!0}function ut(u,o,a,f,_){Rl=[u,o,a,f,_]}function Tt(u,o,a){nr();const f=u.__key,_=u.getParent();if(_===null)return;const E=Bn(u);let I=!1;if(pt(E)&&o){const F=E.anchor,oe=E.focus;F.key===f&&(za(F,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0),oe.key===f&&(za(oe,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0)}else Er(E)&&o&&u.isSelected()&&u.selectPrevious();if(pt(E)&&o&&!I){const F=u.getIndexWithinParent();yi(u),Ka(E,_,F,-1)}else yi(u);!a&&!Fr(_)&&!_.canBeEmpty()&&_.isEmpty()&&Tt(_,o),o&&br(_)&&_.isEmpty()&&_.selectEnd()}class Mt{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(o){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(o){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Fn(this,o),this.__type!=="root"&&(nr(),hn(this.__type,this.constructor))}getType(){return this.__type}isAttached(){let o=this.__key;for(;o!==null;){if(o==="root")return!0;const a=En(o);if(a===null)break;o=a.__parent}return!1}isSelected(o){const a=o||cn();if(a==null)return!1;const f=a.getNodes().some(_=>_.__key===this.__key);return gt(this)?f:pt(a)&&a.anchor.type==="element"&&a.focus.type==="element"&&a.anchor.key===a.focus.key&&a.anchor.offset===a.focus.offset?!1:f}getKey(){return this.__key}getIndexWithinParent(){const o=this.getParent();if(o===null)return-1;let a=o.getFirstChild(),f=0;for(;a!==null;){if(this.is(a))return f;f++,a=a.getNextSibling()}return-1}getParent(){const o=this.getLatest().__parent;return o===null?null:En(o)}getParentOrThrow(){const o=this.getParent();if(o===null)throw Error(`Expected node ${this.__key} to have a parent.`);return o}getTopLevelElement(){let o=this;for(;o!==null;){const a=o.getParent();if(Fr(a))return o;o=a}return null}getTopLevelElementOrThrow(){const o=this.getTopLevelElement();if(o===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return o}getParents(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a),a=a.getParent();return o}getParentKeys(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a.__key),a=a.getParent();return o}getPreviousSibling(){const a=this.getLatest().__prev;return a===null?null:En(a)}getPreviousSiblings(){const o=[],a=this.getParent();if(a===null)return o;let f=a.getFirstChild();for(;f!==null&&!f.is(this);)o.push(f),f=f.getNextSibling();return o}getNextSibling(){const a=this.getLatest().__next;return a===null?null:En(a)}getNextSiblings(){const o=[];let a=this.getNextSibling();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getCommonAncestor(o){const a=this.getParents(),f=o.getParents();Je(this)&&a.unshift(this),Je(o)&&f.unshift(o);const _=a.length,E=f.length;if(_===0||E===0||a[_-1]!==f[E-1])return null;const I=new Set(f);for(let F=0;F<_;F++){const oe=a[F];if(I.has(oe))return oe}return null}is(o){return o==null?!1:this.__key===o.__key}isBefore(o){if(this===o)return!1;if(o.isParentOf(this))return!0;if(this.isParentOf(o))return!1;const a=this.getCommonAncestor(o);let f=0,_=0,E=this;for(;;){const I=E.getParentOrThrow();if(I===a){f=E.getIndexWithinParent();break}E=I}for(E=o;;){const I=E.getParentOrThrow();if(I===a){_=E.getIndexWithinParent();break}E=I}return f<_}isParentOf(o){const a=this.__key;if(a===o.__key)return!1;let f=o;for(;f!==null;){if(f.__key===a)return!0;f=f.getParent()}return!1}getNodesBetween(o){const a=this.isBefore(o),f=[],_=new Set;let E=this;for(;;){const I=E.__key;if(_.has(I)||(_.add(I),f.push(E)),E===o)break;const F=Je(E)?a?E.getFirstChild():E.getLastChild():null;if(F!==null){E=F;continue}const oe=a?E.getNextSibling():E.getPreviousSibling();if(oe!==null){E=oe;continue}const de=E.getParentOrThrow();if(_.has(de.__key)||f.push(de),de===o)break;let Ne=null,Ee=de;do{if(Ee===null)throw Error("getNodesBetween: ancestor is null");Ne=a?Ee.getNextSibling():Ee.getPreviousSibling(),Ee=Ee.getParent(),Ee!==null&&Ne===null&&!_.has(Ee.__key)&&f.push(Ee)}while(Ne===null);E=Ne}return a||f.reverse(),f}isDirty(){const a=gn()._dirtyLeaves;return a!==null&&a.has(this.__key)}getLatest(){const o=En(this.__key);if(o===null)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return o}getWritable(){nr();const o=bi(),a=gn(),f=o._nodeMap,_=this.__key,E=this.getLatest(),I=E.__parent,F=a._cloneNotNeeded,oe=cn();if(Cr(oe)&&oe.setCachedNodes(null),F.has(_))return oo(E),E;const Ne=E.constructor.clone(E);return Ne.__parent=I,Ne.__next=E.__next,Ne.__prev=E.__prev,Je(E)&&Je(Ne)?(Ne.__first=E.__first,Ne.__last=E.__last,Ne.__size=E.__size,Ne.__indent=E.__indent,Ne.__format=E.__format,Ne.__dir=E.__dir):gt(E)&&gt(Ne)&&(Ne.__format=E.__format,Ne.__style=E.__style,Ne.__mode=E.__mode,Ne.__detail=E.__detail),F.add(_),Ne.__key=_,oo(Ne),f.set(_,Ne),Ne}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(o,a){throw Error("createDOM: base method not extended")}updateDOM(o,a,f){throw Error("updateDOM: base method not extended")}exportDOM(o){return{element:this.createDOM(o._config,o)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(o){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(o){Tt(this,!0,o)}replace(o,a){nr();let f=cn();f!==null&&(f=f.clone()),Br(this,o);const _=this.getLatest(),E=this.__key,I=o.__key,F=o.getWritable(),oe=this.getParentOrThrow().getWritable(),de=oe.__size;yi(F);const Ne=_.getPreviousSibling(),Ee=_.getNextSibling(),xe=_.__prev,Ce=_.__next,He=_.__parent;if(Tt(_,!1,!0),Ne===null)oe.__first=I;else{const Ie=Ne.getWritable();Ie.__next=I}if(F.__prev=xe,Ee===null)oe.__last=I;else{const Ie=Ee.getWritable();Ie.__prev=I}if(F.__next=Ce,F.__parent=He,oe.__size=de,a&&this.getChildren().forEach(Ie=>{F.append(Ie)}),pt(f)){Or(f);const Ie=f.anchor,Me=f.focus;Ie.key===E&&Ha(Ie,F),Me.key===E&&Ha(Me,F)}return Ir()===E&&_n(I),F}insertAfter(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.getParent(),I=cn();let F=!1,oe=!1;if(E!==null){const Ce=o.getIndexWithinParent();if(yi(_),pt(I)){const He=E.__key,Ie=I.anchor,Me=I.focus;F=Ie.type==="element"&&Ie.key===He&&Ie.offset===Ce+1,oe=Me.type==="element"&&Me.key===He&&Me.offset===Ce+1}}const de=this.getNextSibling(),Ne=this.getParentOrThrow().getWritable(),Ee=_.__key,xe=f.__next;if(de===null)Ne.__last=Ee;else{const Ce=de.getWritable();Ce.__prev=Ee}if(Ne.__size++,f.__next=Ee,_.__next=xe,_.__prev=f.__key,_.__parent=f.__parent,a&&pt(I)){const Ce=this.getIndexWithinParent();Ka(I,Ne,Ce+1);const He=Ne.__key;F&&I.anchor.set(He,Ce+2,"element"),oe&&I.focus.set(He,Ce+2,"element")}return o}insertBefore(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.__key;yi(_);const I=this.getPreviousSibling(),F=this.getParentOrThrow().getWritable(),oe=f.__prev,de=this.getIndexWithinParent();if(I===null)F.__first=E;else{const Ee=I.getWritable();Ee.__next=E}F.__size++,f.__prev=E,_.__prev=oe,_.__next=f.__key,_.__parent=f.__parent;const Ne=cn();if(a&&pt(Ne)){const Ee=this.getParentOrThrow();Ka(Ne,Ee,de)}return o}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(o,a){nr();const f=this.getPreviousSibling(),_=this.getParentOrThrow();if(f===null)return _.select(0,0);if(Je(f))return f.select();if(!gt(f)){const E=f.getIndexWithinParent()+1;return _.select(E,E)}return f.select(o,a)}selectNext(o,a){nr();const f=this.getNextSibling(),_=this.getParentOrThrow();if(f===null)return _.select();if(Je(f))return f.select(0,0);if(!gt(f)){const E=f.getIndexWithinParent();return _.select(E,E)}return f.select(o,a)}markDirty(){this.getWritable()}}function hn(u,o){const a=gn()._nodes.get(u);if(a===void 0)throw Error(`Create node: Attempted to create node ${o.name} that was not configured to be used on the editor.`);const f=a.klass;if(f!==o)throw Error(`Create node: Type ${u} in node ${o.name} does not match registered node ${f.name} with the same type`)}function ar(u,o,a){const f=o.getParentOrThrow().getLastChild();let _=o;const E=[o];for(;_!==f;){if(!_.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");_=_.getNextSibling(),E.push(_)}let I=u;for(const F of E)I=I.insertAfter(F)}class Wr extends Mt{static getType(){return"linebreak"}static clone(o){return new Wr(o.__key)}constructor(o){super(o)}getTextContent(){return`
33
+ `,hr=be?Qt:Ut,Sr="֑-߿יִ-﷽ﹰ-ﻼ",Fi="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",ps=new RegExp("^[^"+Fi+"]*["+Sr+"]"),ms=new RegExp("^[^"+Sr+"]*["+Fi+"]"),fn={bold:Oe,code:qe,highlight:kt,italic:Re,strikethrough:De,subscript:Qe,superscript:ft,underline:We},gr={directionless:Ve,unmergeable:rt},Jr={center:Et,end:xt,justify:Ot,left:_t,right:St,start:At},_s={[Et]:"center",[xt]:"end",[Ot]:"justify",[_t]:"left",[St]:"right",[At]:"start"},ye={normal:ve,segmented:fe,token:ie},Ge={[ve]:"normal",[fe]:"segmented",[ie]:"token"},nt=100;let Nt=!1,Ht=0;function Kt(){return Nt}function $t(u){Ht=u.timeStamp}function Pt(u){Ht===0&&Wi(u).addEventListener("textInput",$t,!0)}function mn(u,o,a){return o.__lexicalLineBreak===u||u[`__lexicalKey_${a._key}`]!==void 0}function sn(u){return u.getEditorState().read(()=>{const o=cn();return o!==null?o.clone():null})}function nn(u,o,a){const f=_r(a._window);let _=null,E=null;f!==null&&f.anchorNode===u&&(_=f.anchorOffset,E=f.focusOffset);const I=u.nodeValue;I!==null&&Po(o,I,_,E,!1)}function $n(u,o,a){if(pt(u)){const f=u.anchor.getNode();if(f.is(a)&&u.format!==f.getFormat())return!1}return o.nodeType===Ye&&a.isAttached()}function pr(u,o,a){Nt=!0;const f=performance.now()-Ht>nt;try{Rr(u,()=>{const _=cn()||sn(u),E=new Map,I=u.getRootElement(),F=u._editorState,oe=u._blockCursorElement;let de=!1,Ne="";for(let xe=0;xe<o.length;xe++){const Ce=o[xe],He=Ce.type,Ie=Ce.target;let Me=mr(Ie,F);if(!(Me===null&&Ie!==I||Sn(Me))){if(He==="characterData")f&&gt(Me)&&$n(_,Ie,Me)&&nn(Ie,Me,u);else if(He==="childList"){de=!0;const mt=Ce.addedNodes;for(let Ft=0;Ft<mt.length;Ft++){const Rt=mt[Ft],Ct=Ni(Rt),vt=Rt.parentNode;if(vt!=null&&Rt!==oe&&Ct===null&&(Rt.nodeName!=="BR"||!mn(Rt,vt,u))){if(be){const Wt=Rt.innerText||Rt.nodeValue;Wt&&(Ne+=Wt)}vt.removeChild(Rt)}}const ze=Ce.removedNodes,tt=ze.length;if(tt>0){let Ft=0;for(let Rt=0;Rt<tt;Rt++){const Ct=ze[Rt];(Ct.nodeName==="BR"&&mn(Ct,Ie,u)||oe===Ct)&&(Ie.appendChild(Ct),Ft++)}tt!==Ft&&(Ie===I&&(Me=Ci(F)),E.set(Ie,Me))}}}}if(E.size>0)for(const[xe,Ce]of E)if(Je(Ce)){const He=Ce.getChildrenKeys();let Ie=xe.firstChild;for(let Me=0;Me<He.length;Me++){const mt=He[Me],ze=u.getElementByKey(mt);ze!==null&&(Ie==null?(xe.appendChild(ze),Ie=ze):Ie!==ze&&xe.replaceChild(ze,Ie),Ie=Ie.nextSibling)}}else gt(Ce)&&Ce.markDirty();const Ee=a.takeRecords();if(Ee.length>0){for(let xe=0;xe<Ee.length;xe++){const Ce=Ee[xe],He=Ce.addedNodes,Ie=Ce.target;for(let Me=0;Me<He.length;Me++){const mt=He[Me],ze=mt.parentNode;ze!=null&&mt.nodeName==="BR"&&!mn(mt,Ie,u)&&ze.removeChild(mt)}}a.takeRecords()}_!==null&&(de&&(_.dirty=!0,Or(_)),be&&Ta(u)&&_.insertRawText(Ne))})}finally{Nt=!1}}function mi(u){const o=u._observer;if(o!==null){const a=o.takeRecords();pr(u,a,o)}}function qn(u){Pt(u),u._observer=new MutationObserver((o,a)=>{pr(u,o,a)})}function ul(u,o){const a=u.__mode,f=u.__format,_=u.__style,E=o.__mode,I=o.__format,F=o.__style;return(a===null||a===E)&&(f===null||f===I)&&(_===null||_===F)}function Xr(u,o){const a=u.mergeWithSibling(o),f=gn()._normalizedNodes;return f.add(u.__key),f.add(o.__key),a}function dl(u){let o=u;if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable()){o.remove();return}let a;for(;(a=o.getPreviousSibling())!==null&&gt(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else if(ul(a,o)){o=Xr(a,o);break}else break;let f;for(;(f=o.getNextSibling())!==null&&gt(f)&&f.isSimpleText()&&!f.isUnmergeable();)if(f.__text==="")f.remove();else if(ul(o,f)){o=Xr(o,f);break}else break}function Bi(u){return ys(u.anchor),ys(u.focus),u}function ys(u){for(;u.type==="element";){const o=u.getNode(),a=u.offset;let f,_;if(a===o.getChildrenSize()?(f=o.getChildAtIndex(a-1),_=!0):(f=o.getChildAtIndex(a),_=!1),gt(f)){u.set(f.__key,_?f.getTextContentSize():0,"text");break}else if(!Je(f))break;u.set(f.__key,_?f.getChildrenSize():0,"element")}}let fl=1;function hl(){return""+fl++}function kr(u,o){const a=u._nodes.get(o);if(a===void 0)throw Error(`registeredNode: Type ${o} not found`);return a}const Ns=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function wc(u){return Sn(mr(u))}function io(u){const o=document.activeElement;if(o===null)return!1;const a=o.nodeName;return Sn(mr(u))&&(a==="INPUT"||a==="TEXTAREA"||o.contentEditable==="true"&&o.__lexicalEditor==null)}function Qr(u,o,a){const f=u.getRootElement();try{return f!==null&&f.contains(o)&&f.contains(a)&&o!==null&&!io(o)&&Lo(o)===u}catch{return!1}}function Lo(u){let o=u;for(;o!=null;){const a=o.__lexicalEditor;if(a!=null)return a;o=Os(o)}return null}function la(u){return ps.test(u)?"rtl":ms.test(u)?"ltr":null}function gl(u){return u.isToken()||u.isSegmented()}function On(u){return u.nodeType===Ye}function Ln(u){let o=u;for(;o!=null;){if(On(o))return o;o=o.firstChild}return null}function wr(u,o,a){const f=fn[o];if(a!==null&&(u&f)===(a&f))return u;let _=u^f;return o==="subscript"?_&=~fn.superscript:o==="superscript"&&(_&=~fn.subscript),_}function _i(u){return gt(u)||Di(u)||Sn(u)}function Fn(u,o){if(o!=null){u.__key=o;return}nr(),Xd();const a=gn(),f=bi(),_=hl();f._nodeMap.set(_,u),Je(u)?a._dirtyElements.set(_,!0):a._dirtyLeaves.add(_),a._cloneNotNeeded.add(_),a._dirtyType=yt,u.__key=_}function ko(u,o,a){let f=u;for(;f!==null;){if(a.has(f))return;const _=o.get(f);if(_===void 0)break;a.set(f,!1),f=_.__parent}}function yi(u){const o=u.getParent();if(o!==null){const a=u.getWritable(),f=o.getWritable(),_=u.getPreviousSibling(),E=u.getNextSibling();if(_===null)if(E!==null){const I=E.getWritable();f.__first=E.__key,I.__prev=null}else f.__first=null;else{const I=_.getWritable();if(E!==null){const F=E.getWritable();F.__prev=I.__key,I.__next=F.__key}else I.__next=null;a.__prev=null}if(E===null)if(_!==null){const I=_.getWritable();f.__last=_.__key,I.__next=null}else f.__last=null;else{const I=E.getWritable();if(_!==null){const F=_.getWritable();F.__next=I.__key,I.__prev=F.__key}else I.__prev=null;a.__next=null}f.__size--,a.__parent=null}}function oo(u){Xd();const o=u.getLatest(),a=o.__parent,f=bi(),_=gn(),E=f._nodeMap,I=_._dirtyElements;a!==null&&ko(a,E,I);const F=o.__key;_._dirtyType=yt,Je(u)?I.set(F,!0):_._dirtyLeaves.add(F)}function Cs(u){const o=u.getPreviousSibling(),a=u.getNextSibling();o!==null&&oo(o),a!==null&&oo(a)}function _n(u){nr();const o=gn(),a=o._compositionKey;if(u!==a){if(o._compositionKey=u,a!==null){const f=En(a);f!==null&&f.getWritable()}if(u!==null){const f=En(u);f!==null&&f.getWritable()}}}function Ir(){return Ws()?null:gn()._compositionKey}function En(u,o){const f=(o||bi())._nodeMap.get(u);return f===void 0?null:f}function Ni(u,o){const a=gn(),f=u[`__lexicalKey_${a._key}`];return f!==void 0?En(f,o):null}function mr(u,o){let a=u;for(;a!=null;){const f=Ni(a,o);if(f!==null)return f;a=Os(a)}return null}function Es(u){const o=u._decorators,a=Object.assign({},o);return u._pendingDecorators=a,a}function so(u){return u.read(()=>Zn().getTextContent())}function Ts(u,o){Rr(u,()=>{const a=bi();if(a.isEmpty())return;if(o==="root"){Zn().markDirty();return}const f=a._nodeMap;for(const[,_]of f)_.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Zn(){return Ci(bi())}function Ci(u){return u._nodeMap.get("root")}function Or(u){nr();const o=bi();if(u!==null){if(Object.isFrozen(u))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");u.dirty=!0,u.setCachedNodes(null)}o._selection=u}function aa(){nr();const u=gn();mi(u)}function ei(u){const o=gn(),a=ca(u,o);if(a===null){const f=o.getRootElement();return u===f?En("root"):null}return En(a)}function xs(u,o){return o?u.getTextContentSize():0}function ca(u,o){let a=u;for(;a!=null;){const f=a[`__lexicalKey_${o._key}`];if(f!==void 0)return f;a=Os(a)}return null}function pl(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function vs(u){const o=[];let a=u;for(;a!==null;)o.push(a),a=a._parentEditor;return o}function Io(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function lo(u){return u.nodeType===Ye?u.nodeValue:null}function Ss(u,o,a){const f=_r(o._window);if(f===null)return;const _=f.anchorNode;let{anchorOffset:E,focusOffset:I}=f;if(_!==null){let F=lo(_);const oe=mr(_);if(F!==null&&gt(oe)){if(F===Ut&&a){const de=a.length;F=a,E=de,I=de}F!==null&&Po(oe,F,E,I,u)}}}function Po(u,o,a,f,_){let E=u;if(E.isAttached()&&(_||!E.isDirty())){const I=E.isComposing();let F=o;(I||_)&&o[o.length-1]===Ut&&(F=o.slice(0,-1));const oe=E.getTextContent();if(_||F!==oe){if(F===""){if(_n(null),!re&&!te&&!Le){const Ie=gn();setTimeout(()=>{Ie.update(()=>{E.isAttached()&&E.remove()})},20)}else E.remove();return}const de=E.getParent(),Ne=Hs(),Ee=E.getTextContentSize(),xe=Ir(),Ce=E.getKey();if(E.isToken()||xe!==null&&Ce===xe&&!I||pt(Ne)&&(de!==null&&!de.canInsertTextBefore()&&Ne.anchor.offset===0||Ne.anchor.key===u.__key&&Ne.anchor.offset===0&&!E.canInsertTextBefore()||Ne.focus.key===u.__key&&Ne.focus.offset===Ee&&!E.canInsertTextAfter())){E.markDirty();return}const He=cn();if(!pt(He)||a===null||f===null){E.setTextContent(F);return}if(He.setTextNodeRange(E,a,E,f),E.isSegmented()){const Ie=E.getTextContent(),Me=Wn(Ie);E.replace(Me),E=Me}E.setTextContent(F)}}}function ml(u){const o=u.getPreviousSibling();return(gt(o)||Je(o)&&o.isInline())&&!o.canInsertTextAfter()}function ti(u,o){if(o.isSegmented())return!0;if(!u.isCollapsed())return!1;const a=u.anchor.offset,f=o.getParentOrThrow(),_=o.isToken();return a===0?!o.canInsertTextBefore()||!f.canInsertTextBefore()||_||ml(o):a===o.getTextContentSize()?!o.canInsertTextAfter()||!f.canInsertTextAfter()||_:!1}function _l(u,o,a,f){return u===9&&!o&&!a&&!f}function $o(u,o,a,f){return u===66&&!o&&ni(a,f)}function ua(u,o,a,f){return u===73&&!o&&ni(a,f)}function da(u,o,a,f){return u===85&&!o&&ni(a,f)}function ao(u,o){return Ea(u)&&!o}function Fo(u,o){return Ea(u)&&o}function yl(u,o){return Te&&o&&u===79}function Nl(u,o,a){return Pr(u)&&(Te?o:a)}function Bo(u,o,a){return $r(u)&&(Te?o:a)}function Ho(u,o){return Te&&o&&Pr(u)}function fa(u,o){return Te&&o&&$r(u)}function ha(u,o,a,f){return Te?o||a?!1:Pr(u)||u===72&&f:f||o||a?!1:Pr(u)}function ga(u,o,a,f,_){return Te?a||f||_?!1:$r(u)||u===68&&o:o||f||_?!1:$r(u)}function pa(u,o,a,f){return u===90&&!o&&ni(a,f)}function Oc(u,o,a,f){return Te?u===90&&a&&o:u===89&&f||u===90&&f&&o}function Dc(u,o,a,f){return o?!1:u===67?Te?a:f:!1}function ma(u,o,a,f){return o?!1:u===88?Te?a:f:!1}function _a(u){return u===37}function ya(u){return u===39}function Ac(u){return u===38}function Mc(u){return u===40}function Cl(u,o,a,f){return _a(u)&&!o&&!f&&!a}function Rc(u,o,a,f,_){return _a(u)&&!f&&!a&&(o||_)}function bc(u,o,a,f){return ya(u)&&!o&&!f&&!a}function Na(u,o,a,f,_){return ya(u)&&!f&&!a&&(o||_)}function co(u,o,a){return Ac(u)&&!o&&!a}function Ca(u,o,a){return Mc(u)&&!o&&!a}function Lc(u,o,a,f){return u||o||a||f}function El(u){return u===32}function ni(u,o){return Te?u:o}function Ea(u){return u===13}function Pr(u){return u===8}function kc(u){return u===27}function $r(u){return u===46}function Ei(u,o,a){return u===65&&ni(o,a)}function Tl(){const u=Zn(),o=u.select(0,u.getChildrenSize());Or(Bi(o))}function Hi(u,o){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const a=u.__lexicalClassNameCache,f=a[o];if(f!==void 0)return f;const _=u[o];if(typeof _=="string"){const E=_.split(" ");return a[o]=E,E}return _}function Wo(u,o,a,f,_){if(a.size===0)return;const E=f.__type,I=f.__key,F=o.get(E);if(F===void 0)throw Error(`Type ${E} not in registeredNodes`);const oe=F.klass;let de=u.get(oe);de===void 0&&(de=new Map,u.set(oe,de));const Ne=de.get(I),Ee=Ne==="destroyed"&&_==="created";(Ne===void 0||Ee)&&de.set(I,Ee?"updated":_)}function xl(u){const o=bi(),a=o._readOnly,f=u.getType(),_=o._nodeMap,E=[];for(const[,I]of _)I instanceof u&&I.__type===f&&(a||I.isAttached())&&E.push(I);return E}function Ko(u,o,a){const f=u.getParent();let _=a,E=u;return f!==null&&(o&&a===0?(_=E.getIndexWithinParent(),E=f):!o&&a===E.getChildrenSize()&&(_=E.getIndexWithinParent()+1,E=f)),E.getChildAtIndex(o?_-1:_)}function ri(u,o){const a=u.offset;if(u.type==="element"){const f=u.getNode();return Ko(f,o,a)}else{const f=u.getNode();if(o&&a===0||!o&&a===f.getTextContentSize()){const _=o?f.getPreviousSibling():f.getNextSibling();return _===null?Ko(f.getParentOrThrow(),o,f.getIndexWithinParent()+(o?0:1)):_}}return null}function Ta(u){const o=Wi(u).event,a=o&&o.inputType;return a==="insertFromPaste"||a==="insertFromPasteAsQuotation"}function st(u,o,a){return rf(u,o,a)}function zo(u){return!br(u)&&!u.isLastChild()&&!u.isInline()}function ws(u,o){const a=u._keyToDOMMap.get(o);if(a===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${o}`);return a}function Os(u){const o=u.assignedSlot||u.parentElement;return o!==null&&o.nodeType===11?o.host:o}function xa(u,o,a){const f=a.ownerDocument,_=f.defaultView;if(_===null)return;let{top:E,bottom:I}=o,F=0,oe=0,de=a;for(;de!==null;){const Ne=de===f.body;if(Ne)F=0,oe=Wi(u).innerHeight;else{const xe=de.getBoundingClientRect();F=xe.top,oe=xe.bottom}let Ee=0;if(E<F?Ee=-(F-E):I>oe&&(Ee=I-oe),Ee!==0)if(Ne)_.scrollBy(0,Ee);else{const xe=de.scrollTop;de.scrollTop+=Ee;const Ce=de.scrollTop-xe;E-=Ce,I-=Ce}if(Ne)break;de=Os(de)}}function Ic(u){return gn()._updateTags.has(u)}function Ti(u){nr(),gn()._updateTags.add(u)}function Bn(u){const o=cn();if(!pt(o)||!Je(u))return o;const{anchor:a,focus:f}=o,_=a.getNode(),E=f.getNode();return ht(_,u)&&a.set(u.__key,0,"element"),ht(E,u)&&f.set(u.__key,0,"element"),o}function ht(u,o){let a=u.getParent();for(;a!==null;){if(a.is(o))return!0;a=a.getParent()}return!1}function uo(u){const o=u.ownerDocument;return o&&o.defaultView||null}function Wi(u){const o=u._window;if(o===null)throw Error("window object not found");return o}function va(u){return Je(u)&&u.isInline()||Sn(u)&&u.isInline()}function Dr(u){let o=u.getParentOrThrow();for(;o!==null;){if(Fr(o))return o;o=o.getParentOrThrow()}return o}function Fr(u){return br(u)||Je(u)&&u.isShadowRoot()}function vl(u){const o=u.constructor.clone(u);return Fn(o,null),o}function fo(u){const o=gn(),a=u.constructor.getType(),f=o._nodes.get(a);if(f===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const _=f.replace;if(_!==null){const E=_(u);if(!(E instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return E}return u}function Br(u,o){const a=u.getParent();if(br(a)&&!Je(o)&&!Sn(o))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Sl(u){const o=u.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let f=o.blockCursor;if(f!==void 0){if(typeof f=="string"){const _=f.split(" ");f=o.blockCursor=_}f!==void 0&&a.classList.add(...f)}return a}function ho(u){return(Sn(u)||Je(u)&&!u.canBeEmpty())&&!u.isInline()}function wt(u,o,a){a.style.removeProperty("caret-color"),o._blockCursorElement=null;const f=u.parentElement;f!==null&&f.removeChild(u)}function wl(u,o,a){let f=u._blockCursorElement;if(pt(a)&&a.isCollapsed()&&a.anchor.type==="element"&&o.contains(document.activeElement)){const _=a.anchor,E=_.getNode(),I=_.offset,F=E.getChildrenSize();let oe=!1,de=null;if(I===F){const Ne=E.getChildAtIndex(I-1);ho(Ne)&&(oe=!0)}else{const Ne=E.getChildAtIndex(I);if(ho(Ne)){const Ee=Ne.getPreviousSibling();(Ee===null||ho(Ee))&&(oe=!0,de=u.getElementByKey(Ne.__key))}}if(oe){const Ne=u.getElementByKey(E.__key);f===null&&(u._blockCursorElement=f=Sl(u._config)),o.style.caretColor="transparent",de===null?Ne.appendChild(f):Ne.insertBefore(f,de);return}}f!==null&&wt(f,u,o)}function _r(u){return he?(u||window).getSelection():null}function Ds(u,o){let a=u.getChildAtIndex(o);if(a==null&&(a=u),Fr(u))throw Error("Can not call $splitNode() on root element");const f=I=>{const F=I.getParentOrThrow(),oe=Fr(F),de=I===a&&!oe?I:vl(I);if(oe)return I.insertAfter(de),[I,de,de];{const[Ne,Ee,xe]=f(F),Ce=I.getNextSiblings();return xe.append(de,...Ce),[Ne,Ee,de]}},[_,E]=f(a);return[_,E]}function Uo(u,o){let a=u;for(;a!==Zn()&&a!=null;){if(o(a))return a;a=a.getParent()}return null}function Ki(u){const o=[],a=[u];for(;a.length>0;){const f=a.pop();if(f===void 0)throw Error("Stack.length > 0; can't be undefined");Je(f)&&a.unshift(...f.getChildren()),f!==u&&o.push(f)}return o}function Go(u){return Yo(u)&&u.tagName==="A"}function Yo(u){return u.nodeType===1}function zi(u){if(Sn(u)&&!u.isInline())return!0;if(!Je(u)||Fr(u))return!1;const o=u.getFirstChild(),a=o===null||Di(o)||gt(o)||o.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&a}function As(u,o){let a=u;for(;a!==null&&a.getParent()!==null&&!o(a);)a=a.getParentOrThrow();return o(a)?a:null}function Sa(u,o){const a=u._decorators;let _=u._pendingDecorators||a;const E=o._nodeMap;let I;for(I in _)E.has(I)||(_===a&&(_=Es(u)),delete _[I])}function Ol(u,o,a,f,_,E){let I=u.getFirstChild();for(;I!==null;){const F=I.__key;I.__parent===o&&(Je(I)&&Ol(I,F,a,f,_,E),a.has(F)||E.delete(F),_.push(F)),I=I.getNextSibling()}}function wa(u,o,a,f){const _=u._nodeMap,E=o._nodeMap,I=[];for(const[F]of f){const oe=E.get(F);oe!==void 0&&(oe.isAttached()||(Je(oe)&&Ol(oe,F,_,E,I,f),_.has(F)||f.delete(F),I.push(F)))}for(const F of I)E.delete(F);for(const F of a){const oe=E.get(F);oe!==void 0&&!oe.isAttached()&&(_.has(F)||a.delete(F),E.delete(F))}}let Tn="",Gn="",Ar="",xi,Hn,Vt,Ui=!1,go=!1,jo,Ms=null,po,Rs,vi,ii,Vo,qo;function yn(u,o){const a=vi.get(u);if(o!==null){const f=an(u);f.parentNode===o&&o.removeChild(f)}if(ii.has(u)||Hn._keyToDOMMap.delete(u),Je(a)){const f=_o(a,vi);xn(f,0,f.length-1,null)}a!==void 0&&Wo(qo,Vt,jo,a,"destroyed")}function xn(u,o,a,f){let _=o;for(;_<=a;++_){const E=u[_];E!==void 0&&yn(E,f)}}function vn(u,o){u.setProperty("text-align",o)}const Dl="40px";function mo(u,o){const a=xi.theme.indent;if(typeof a=="string"){const _=u.classList.contains(a);o>0&&!_?u.classList.add(a):o<1&&_&&u.classList.remove(a)}const f=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||Dl;u.style.setProperty("padding-inline-start",o===0?"":`calc(${o} * ${f})`)}function Al(u,o){const a=u.style;o===0?vn(a,""):o===_t?vn(a,"left"):o===Et?vn(a,"center"):o===St?vn(a,"right"):o===Ot?vn(a,"justify"):o===At?vn(a,"start"):o===xt&&vn(a,"end")}function oi(u,o,a){const f=ii.get(u);if(f===void 0)throw Error("createNode: node does not exist in nodeMap");const _=f.createDOM(xi,Hn);if(Ma(u,_,Hn),gt(f)?_.setAttribute("data-lexical-text","true"):Sn(f)&&_.setAttribute("data-lexical-decorator","true"),Je(f)){const E=f.__indent,I=f.__size;if(E!==0&&mo(_,E),I!==0){const oe=I-1,de=_o(f,ii);Jn(de,oe,f,_)}const F=f.__format;F!==0&&Al(_,F),f.isInline()||Ml(null,f,_),zo(f)&&(Tn+=It,Ar+=It)}else{const E=f.getTextContent();if(Sn(f)){const I=f.decorate(Hn,xi);I!==null&&yo(u,I),_.contentEditable="false"}else gt(f)&&(f.isDirectionless()||(Gn+=E));Tn+=E,Ar+=E}if(o!==null)if(a!=null)o.insertBefore(_,a);else{const E=o.__lexicalLineBreak;E!=null?o.insertBefore(_,E):o.appendChild(_)}return Object.freeze(f),Wo(qo,Vt,jo,f,"created"),_}function Jn(u,o,a,f){const _=Gn;Gn="",yr(u,a,0,o,f,null),Oa(a,f),Gn=_}function yr(u,o,a,f,_,E){const I=Tn;Tn="";let F=a;for(;F<=f;++F)oi(u[F],_,E);zo(o)&&(Tn+=It),_.__lexicalTextContent=Tn,Tn=I+Tn}function ln(u,o){const a=o.get(u);return Di(a)||Sn(a)&&a.isInline()}function Ml(u,o,a){const f=u!==null&&(u.__size===0||ln(u.__last,vi)),_=o.__size===0||ln(o.__last,ii);if(f){if(!_){const E=a.__lexicalLineBreak;E!=null&&a.removeChild(E),a.__lexicalLineBreak=null}}else if(_){const E=document.createElement("br");a.__lexicalLineBreak=E,a.appendChild(E)}}function Oa(u,o){const a=o.__lexicalDirTextContent,f=o.__lexicalDir;if(a!==Gn||f!==Ms){const _=Gn==="",E=_?Ms:la(Gn);if(E!==f){const I=o.classList,F=xi.theme;let oe=f!==null?F[f]:void 0,de=E!==null?F[E]:void 0;if(oe!==void 0){if(typeof oe=="string"){const Ne=oe.split(" ");oe=F[f]=Ne}I.remove(...oe)}if(E===null||_&&E==="ltr")o.removeAttribute("dir");else{if(de!==void 0){if(typeof de=="string"){const Ne=de.split(" ");de=F[E]=Ne}de!==void 0&&I.add(...de)}o.dir=E}if(!go){const Ne=u.getWritable();Ne.__dir=E}}Ms=E,o.__lexicalDirTextContent=Gn,o.__lexicalDir=E}}function Pc(u,o,a){const f=Gn;Gn="",Da(u,o,a),Oa(o,a),Gn=f}function _o(u,o){const a=[];let f=u.__first;for(;f!==null;){const _=o.get(f);if(_===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");a.push(f),f=_.__next}return a}function Da(u,o,a){const f=Tn,_=u.__size,E=o.__size;if(Tn="",_===1&&E===1){const I=u.__first,F=o.__first;if(I===F)Mr(I,a);else{const oe=an(I),de=oi(F,null,null);a.replaceChild(de,oe),yn(I,null)}}else{const I=_o(u,vi),F=_o(o,ii);if(_===0)E!==0&&yr(F,o,0,E-1,a,null);else if(E===0){if(_!==0){const de=a.__lexicalLineBreak==null;xn(I,0,_-1,de?null:a),de&&(a.textContent="")}}else Aa(o,I,F,_,E,a)}zo(o)&&(Tn+=It),a.__lexicalTextContent=Tn,Tn=f+Tn}function Mr(u,o){const a=vi.get(u);let f=ii.get(u);if(a===void 0||f===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const _=Ui||Rs.has(u)||po.has(u),E=ws(Hn,u);if(a===f&&!_){if(Je(a)){const I=E.__lexicalTextContent;I!==void 0&&(Tn+=I,Ar+=I);const F=E.__lexicalDirTextContent;F!==void 0&&(Gn+=F)}else{const I=a.getTextContent();gt(a)&&!a.isDirectionless()&&(Gn+=I),Ar+=I,Tn+=I}return E}if(a!==f&&_&&Wo(qo,Vt,jo,f,"updated"),f.updateDOM(a,E,xi)){const I=oi(u,null,null);if(o===null)throw Error("reconcileNode: parentDOM is null");return o.replaceChild(I,E),yn(u,null),I}if(Je(a)&&Je(f)){const I=f.__indent;I!==a.__indent&&mo(E,I);const F=f.__format;F!==a.__format&&Al(E,F),_&&(Pc(a,f,E),!br(f)&&!f.isInline()&&Ml(a,f,E)),zo(f)&&(Tn+=It,Ar+=It)}else{const I=f.getTextContent();if(Sn(f)){const F=f.decorate(Hn,xi);F!==null&&yo(u,F)}else gt(f)&&!f.isDirectionless()&&(Gn+=I);Tn+=I,Ar+=I}return!go&&br(f)&&f.__cachedText!==Ar&&(f=f.getWritable(),f.__cachedText=Ar),Object.freeze(f),E}function yo(u,o){let a=Hn._pendingDecorators;const f=Hn._decorators;if(a===null){if(f[u]===o)return;a=Es(Hn)}a[u]=o}function ot(u){return u.firstChild}function bs(u){let o=u.nextSibling;return o!==null&&o===Hn._blockCursorElement&&(o=o.nextSibling),o}function Aa(u,o,a,f,_,E){const I=f-1,F=_-1;let oe,de,Ne=ot(E),Ee=0,xe=0;for(;Ee<=I&&xe<=F;){const Ie=o[Ee],Me=a[xe];if(Ie===Me)Ne=bs(Mr(Me,E)),Ee++,xe++;else{oe===void 0&&(oe=new Set(o)),de===void 0&&(de=new Set(a));const mt=de.has(Ie),ze=oe.has(Me);if(!mt)Ne=bs(an(Ie)),yn(Ie,E),Ee++;else if(!ze)oi(Me,E,Ne),xe++;else{const tt=ws(Hn,Me);tt===Ne?Ne=bs(Mr(Me,E)):(Ne!=null?E.insertBefore(tt,Ne):E.appendChild(tt),Mr(Me,E)),Ee++,xe++}}}const Ce=Ee>I,He=xe>F;if(Ce&&!He){const Ie=a[F+1],Me=Ie===void 0?null:Hn.getElementByKey(Ie);yr(a,u,xe,F,E,Me)}else He&&!Ce&&xn(o,Ee,I,E)}function sr(u,o,a,f,_,E){Tn="",Ar="",Gn="",Ui=f===dt,Ms=null,Hn=a,xi=a._config,Vt=a._nodes,jo=Hn._listeners.mutation,po=_,Rs=E,vi=u._nodeMap,ii=o._nodeMap,go=o._readOnly,Vo=new Map(a._keyToDOMMap);const I=new Map;return qo=I,Mr("root",null),Hn=void 0,Vt=void 0,po=void 0,Rs=void 0,vi=void 0,ii=void 0,xi=void 0,Vo=void 0,qo=void 0,I}function Ma(u,o,a){const f=a._keyToDOMMap;o["__lexicalKey_"+a._key]=u,f.set(u,o)}function an(u){const o=Vo.get(u);if(o===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return o}const Xn=Object.freeze({}),Ze=30,Ls=[["keydown",S],["pointerdown",ka],["compositionstart",s],["compositionend",C],["input",i],["click",Nr],["cut",Xn],["copy",Xn],["dragstart",Xn],["dragover",Xn],["dragend",Xn],["paste",Xn],["focus",Xn],["blur",Xn],["drop",Xn]];Ue&&Ls.push(["beforeinput",(u,o)=>l(u,o)]);let Hr=0,tr=0,Ra=0,Si=null,No=0,Co=!1,wi=!1,Zo=!1,lr=!1,Rl=[0,"",0,"root",0];function ba(u,o,a,f,_){const E=u.anchor,I=u.focus,F=E.getNode(),oe=gn(),de=_r(oe._window),Ne=de!==null?de.anchorNode:null,Ee=E.key,xe=oe.getElementByKey(Ee),Ce=a.length;return Ee!==I.key||!gt(F)||(!_&&(!Ue||Ra<f+50)||F.isDirty()&&Ce<2||pl(a))&&E.offset!==I.offset&&!F.isComposing()||gl(F)||F.isDirty()&&Ce>1||(_||!Ue)&&xe!==null&&!F.isComposing()&&Ne!==Ln(xe)||de!==null&&o!==null&&(!o.collapsed||o.startContainer!==de.anchorNode||o.startOffset!==de.anchorOffset)||F.getFormat()!==u.format||F.getStyle()!==u.style||ti(u,F)}function La(u,o){return u!==null&&u.nodeValue!==null&&u.nodeType===Ye&&o!==0&&o!==u.nodeValue.length}function ks(u,o,a){const{anchorNode:f,anchorOffset:_,focusNode:E,focusOffset:I}=u;Co&&(Co=!1,La(f,_)&&La(E,I))||Rr(o,()=>{if(!a){Or(null);return}if(!Qr(o,f,E))return;const F=cn();if(pt(F)){const oe=F.anchor,de=oe.getNode();if(F.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&(F.dirty=!0);const Ne=Wi(o).event,Ee=Ne?Ne.timeStamp:performance.now(),[xe,Ce,He,Ie,Me]=Rl,mt=Zn(),ze=o.isComposing()===!1&&mt.getTextContent()==="";Ee<Me+200&&oe.offset===He&&oe.key===Ie?(F.format=xe,F.style=Ce):oe.type==="text"?(F.format=de.getFormat(),F.style=de.getStyle()):oe.type==="element"&&!ze&&(F.format=0,F.style="")}else{let Ne=je,Ee=!1;const xe=F.getNodes(),Ce=xe.length;for(let He=0;He<Ce;He++){const Ie=xe[He];if(gt(Ie)&&(Ee=!0,Ne&=Ie.getFormat(),Ne===0))break}F.format=Ee?Ne:0}}st(o,e,void 0)})}function Nr(u,o){Rr(o,()=>{const a=cn(),f=_r(o._window),_=Hs();if(f){if(pt(a)){const E=a.anchor,I=E.getNode();if(E.type==="element"&&E.offset===0&&a.isCollapsed()&&!br(I)&&Zn().getChildrenSize()===1&&I.getTopLevelElementOrThrow().isEmpty()&&_!==null&&a.is(_))f.removeAllRanges(),a.dirty=!0;else if(u.detail===3&&!a.isCollapsed()){const oe=a.focus.getNode();I!==oe&&(Je(I)?I.select(0):I.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const E=f.anchorNode;if(E!==null){const I=E.nodeType;if(I===Be||I===Ye){const F=Fc(_,f,o);Or(F)}}}}st(o,n,u)})}function ka(u,o){const a=u.target,f=u.pointerType;a instanceof Node&&f!=="touch"&&Rr(o,()=>{wc(a)||(wi=!0)})}function Is(u){if(!u.getTargetRanges)return null;const o=u.getTargetRanges();return o.length===0?null:o[0]}function Ia(u,o){return u!==o||Je(u)||Je(o)||!u.isToken()||!o.isToken()}function Jo(u){return tr===229&&u<Hr+Ze}function l(u,o){const a=u.inputType,f=Is(u);a==="deleteCompositionText"||be&&Ta(o)||a!=="insertCompositionText"&&Rr(o,()=>{const _=cn();if(a==="deleteContentBackward"){if(_===null){const Ne=Hs();if(!pt(Ne))return;Or(Ne.clone())}if(pt(_)){if(ce&&_n(_.anchor.key),Jo(u.timeStamp)&&o.isComposing()&&_.anchor.key===_.focus.key){if(_n(null),Hr=0,setTimeout(()=>{Rr(o,()=>{_n(null)})},Ze),pt(_)){const Ee=_.anchor.getNode();Ee.markDirty(),_.format=Ee.getFormat(),_.style=Ee.getStyle()}_.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),st(o,r,!0))}else u.preventDefault(),st(o,r,!0);return}}if(!pt(_))return;const E=u.data;Si!==null&&Ss(!1,o,Si),(!_.dirty||Si!==null)&&_.isCollapsed()&&!br(_.anchor.getNode())&&f!==null&&_.applyDOMRange(f),Si=null;const I=_.anchor,F=_.focus,oe=I.getNode(),de=F.getNode();if(a==="insertText"||a==="insertTranspose"){if(E===`
34
+ `)u.preventDefault(),st(o,c,!1);else if(E===It)u.preventDefault(),st(o,d,void 0);else if(E==null&&u.dataTransfer){const Ne=u.dataTransfer.getData("text/plain");u.preventDefault(),_.insertRawText(Ne)}else E!=null&&ba(_,f,E,u.timeStamp,!0)?(u.preventDefault(),st(o,g,E)):Si=E;Ra=u.timeStamp;return}switch(u.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{st(o,g,u);break}case"insertFromComposition":{_n(null),st(o,g,u);break}case"insertLineBreak":{_n(null),st(o,c,!1);break}case"insertParagraph":{_n(null),Zo&&!te?(Zo=!1,st(o,c,!1)):st(o,d,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{st(o,p,u);break}case"deleteByComposition":{Ia(oe,de)&&st(o,N,u);break}case"deleteByDrag":case"deleteByCut":{st(o,N,u);break}case"deleteContent":{st(o,r,!1);break}case"deleteWordBackward":{st(o,v,!0);break}case"deleteWordForward":{st(o,v,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{st(o,T,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{st(o,T,!1);break}case"formatStrikeThrough":{st(o,O,"strikethrough");break}case"formatBold":{st(o,O,"bold");break}case"formatItalic":{st(o,O,"italic");break}case"formatUnderline":{st(o,O,"underline");break}case"historyUndo":{st(o,b,void 0);break}case"historyRedo":{st(o,R,void 0);break}}})}function i(u,o){u.stopPropagation(),Rr(o,()=>{const a=cn(),f=u.data,_=Is(u);if(f!=null&&pt(a)&&ba(a,_,f,u.timeStamp,!1)){lr&&(h(o,f),lr=!1);const E=a.anchor,I=E.getNode(),F=_r(o._window);if(F===null)return;const oe=E.offset;(!Ue||a.isCollapsed()||!gt(I)||F.anchorNode===null||I.getTextContent().slice(0,oe)+f+I.getTextContent().slice(oe+a.focus.offset)!==lo(F.anchorNode))&&st(o,g,f);const de=f.length;be&&de>1&&u.inputType==="insertCompositionText"&&!o.isComposing()&&(a.anchor.offset-=de),!re&&!te&&!Le&&o.isComposing()&&(Hr=0,_n(null))}else Ss(!1,o,f!==null?f:void 0),lr&&(h(o,f||void 0),lr=!1);aa()}),Si=null}function s(u,o){Rr(o,()=>{const a=cn();if(pt(a)&&!o.isComposing()){const f=a.anchor,_=a.anchor.getNode();_n(f.key),(u.timeStamp<Hr+Ze||f.type==="element"||!a.isCollapsed()||_.getFormat()!==a.format||_.getStyle()!==a.style)&&st(o,g,hr)}})}function h(u,o){const a=u._compositionKey;if(_n(null),a!==null&&o!=null){if(o===""){const f=En(a),_=Ln(u.getElementByKey(a));_!==null&&_.nodeValue!==null&&gt(f)&&Po(f,_.nodeValue,null,null,!0);return}if(o[o.length-1]===`
35
+ `){const f=cn();if(pt(f)){const _=f.focus;f.anchor.set(_.key,_.offset,_.type),st(u,z,null);return}}}Ss(!0,u,o)}function C(u,o){be?lr=!0:Rr(o,()=>{h(o,u.data)})}function S(u,o){if(Hr=u.timeStamp,tr=u.keyCode,o.isComposing())return;const{keyCode:a,shiftKey:f,ctrlKey:_,metaKey:E,altKey:I}=u;if(!st(o,x,u)){if(bc(a,_,I,E))st(o,w,u);else if(Na(a,_,f,I,E))st(o,P,u);else if(Cl(a,_,I,E))st(o,H,u);else if(Rc(a,_,f,I,E))st(o,$,u);else if(co(a,_,E))st(o,W,u);else if(Ca(a,_,E))st(o,B,u);else if(Fo(a,f))Zo=!0,st(o,z,u);else if(El(a))st(o,X,u);else if(yl(a,_))u.preventDefault(),Zo=!0,st(o,c,!0);else if(ao(a,f))Zo=!1,st(o,z,u);else if(ha(a,I,E,_))Pr(a)?st(o,ee,u):(u.preventDefault(),st(o,r,!0));else if(kc(a))st(o,le,u);else if(ga(a,_,f,I,E))$r(a)?st(o,j,u):(u.preventDefault(),st(o,r,!1));else if(Nl(a,I,_))u.preventDefault(),st(o,v,!0);else if(Bo(a,I,_))u.preventDefault(),st(o,v,!1);else if(Ho(a,E))u.preventDefault(),st(o,T,!0);else if(fa(a,E))u.preventDefault(),st(o,T,!1);else if($o(a,I,E,_))u.preventDefault(),st(o,O,"bold");else if(da(a,I,E,_))u.preventDefault(),st(o,O,"underline");else if(ua(a,I,E,_))u.preventDefault(),st(o,O,"italic");else if(_l(a,I,_,E))st(o,U,u);else if(pa(a,f,E,_))u.preventDefault(),st(o,b,void 0);else if(Oc(a,f,E,_))u.preventDefault(),st(o,R,void 0);else{const F=o._editorState._selection;Er(F)?Dc(a,f,E,_)?(u.preventDefault(),st(o,ne,u)):ma(a,f,E,_)?(u.preventDefault(),st(o,Y,u)):Ei(a,E,_)&&(u.preventDefault(),st(o,G,u)):!be&&Ei(a,E,_)&&(u.preventDefault(),st(o,G,u))}Lc(_,f,I,E)&&st(o,ae,u)}}function A(u){let o=u.__lexicalEventHandles;return o===void 0&&(o=[],u.__lexicalEventHandles=o),o}const J=new Map;function ge(u){const o=u.target,a=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,f=_r(a);if(f===null)return;const _=Lo(f.anchorNode);if(_===null)return;wi&&(wi=!1,Rr(_,()=>{const Ne=Hs(),Ee=f.anchorNode;if(Ee===null)return;const xe=Ee.nodeType;if(xe!==Be&&xe!==Ye)return;const Ce=Fc(Ne,f,_);Or(Ce)}));const E=vs(_),I=E[E.length-1],F=I._key,oe=J.get(F),de=oe||I;de!==_&&ks(f,de,!1),ks(f,_,!0),_!==I?J.set(F,_):oe&&J.delete(F)}function Se(u){u._lexicalHandled=!0}function Fe(u){return u._lexicalHandled===!0}function Ke(u,o){No===0&&u.ownerDocument.addEventListener("selectionchange",ge),No++,u.__lexicalEditor=o;const a=A(u);for(let f=0;f<Ls.length;f++){const[_,E]=Ls[f],I=typeof E=="function"?F=>{Fe(F)||(Se(F),o.isEditable()&&E(F,o))}:F=>{if(!Fe(F)&&(Se(F),o.isEditable()))switch(_){case"cut":return st(o,Y,F);case"copy":return st(o,ne,F);case"paste":return st(o,p,F);case"dragstart":return st(o,K,F);case"dragover":return st(o,D,F);case"dragend":return st(o,V,F);case"focus":return st(o,M,F);case"blur":return st(o,Z,F);case"drop":return st(o,pe,F)}};u.addEventListener(_,I),a.push(()=>{u.removeEventListener(_,I)})}}function ke(u){No!==0&&(No--,No===0&&u.ownerDocument.removeEventListener("selectionchange",ge));const o=u.__lexicalEditor;o!=null&&(Ae(o),u.__lexicalEditor=null);const a=A(u);for(let f=0;f<a.length;f++)a[f]();u.__lexicalEventHandles=[]}function Ae(u){if(u._parentEditor!==null){const o=vs(u),f=o[o.length-1]._key;J.get(f)===u&&J.delete(f)}else J.delete(u._key)}function Xe(){Co=!0}function ut(u,o,a,f,_){Rl=[u,o,a,f,_]}function Tt(u,o,a){nr();const f=u.__key,_=u.getParent();if(_===null)return;const E=Bn(u);let I=!1;if(pt(E)&&o){const F=E.anchor,oe=E.focus;F.key===f&&(za(F,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0),oe.key===f&&(za(oe,u,_,u.getPreviousSibling(),u.getNextSibling()),I=!0)}else Er(E)&&o&&u.isSelected()&&u.selectPrevious();if(pt(E)&&o&&!I){const F=u.getIndexWithinParent();yi(u),Ka(E,_,F,-1)}else yi(u);!a&&!Fr(_)&&!_.canBeEmpty()&&_.isEmpty()&&Tt(_,o),o&&br(_)&&_.isEmpty()&&_.selectEnd()}class Mt{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(o){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(o){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Fn(this,o),this.__type!=="root"&&(nr(),hn(this.__type,this.constructor))}getType(){return this.__type}isAttached(){let o=this.__key;for(;o!==null;){if(o==="root")return!0;const a=En(o);if(a===null)break;o=a.__parent}return!1}isSelected(o){const a=o||cn();if(a==null)return!1;const f=a.getNodes().some(_=>_.__key===this.__key);return gt(this)?f:pt(a)&&a.anchor.type==="element"&&a.focus.type==="element"&&a.anchor.key===a.focus.key&&a.anchor.offset===a.focus.offset?!1:f}getKey(){return this.__key}getIndexWithinParent(){const o=this.getParent();if(o===null)return-1;let a=o.getFirstChild(),f=0;for(;a!==null;){if(this.is(a))return f;f++,a=a.getNextSibling()}return-1}getParent(){const o=this.getLatest().__parent;return o===null?null:En(o)}getParentOrThrow(){const o=this.getParent();if(o===null)throw Error(`Expected node ${this.__key} to have a parent.`);return o}getTopLevelElement(){let o=this;for(;o!==null;){const a=o.getParent();if(Fr(a))return o;o=a}return null}getTopLevelElementOrThrow(){const o=this.getTopLevelElement();if(o===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return o}getParents(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a),a=a.getParent();return o}getParentKeys(){const o=[];let a=this.getParent();for(;a!==null;)o.push(a.__key),a=a.getParent();return o}getPreviousSibling(){const a=this.getLatest().__prev;return a===null?null:En(a)}getPreviousSiblings(){const o=[],a=this.getParent();if(a===null)return o;let f=a.getFirstChild();for(;f!==null&&!f.is(this);)o.push(f),f=f.getNextSibling();return o}getNextSibling(){const a=this.getLatest().__next;return a===null?null:En(a)}getNextSiblings(){const o=[];let a=this.getNextSibling();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getCommonAncestor(o){const a=this.getParents(),f=o.getParents();Je(this)&&a.unshift(this),Je(o)&&f.unshift(o);const _=a.length,E=f.length;if(_===0||E===0||a[_-1]!==f[E-1])return null;const I=new Set(f);for(let F=0;F<_;F++){const oe=a[F];if(I.has(oe))return oe}return null}is(o){return o==null?!1:this.__key===o.__key}isBefore(o){if(this===o)return!1;if(o.isParentOf(this))return!0;if(this.isParentOf(o))return!1;const a=this.getCommonAncestor(o);let f=0,_=0,E=this;for(;;){const I=E.getParentOrThrow();if(I===a){f=E.getIndexWithinParent();break}E=I}for(E=o;;){const I=E.getParentOrThrow();if(I===a){_=E.getIndexWithinParent();break}E=I}return f<_}isParentOf(o){const a=this.__key;if(a===o.__key)return!1;let f=o;for(;f!==null;){if(f.__key===a)return!0;f=f.getParent()}return!1}getNodesBetween(o){const a=this.isBefore(o),f=[],_=new Set;let E=this;for(;;){const I=E.__key;if(_.has(I)||(_.add(I),f.push(E)),E===o)break;const F=Je(E)?a?E.getFirstChild():E.getLastChild():null;if(F!==null){E=F;continue}const oe=a?E.getNextSibling():E.getPreviousSibling();if(oe!==null){E=oe;continue}const de=E.getParentOrThrow();if(_.has(de.__key)||f.push(de),de===o)break;let Ne=null,Ee=de;do{if(Ee===null)throw Error("getNodesBetween: ancestor is null");Ne=a?Ee.getNextSibling():Ee.getPreviousSibling(),Ee=Ee.getParent(),Ee!==null&&Ne===null&&!_.has(Ee.__key)&&f.push(Ee)}while(Ne===null);E=Ne}return a||f.reverse(),f}isDirty(){const a=gn()._dirtyLeaves;return a!==null&&a.has(this.__key)}getLatest(){const o=En(this.__key);if(o===null)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return o}getWritable(){nr();const o=bi(),a=gn(),f=o._nodeMap,_=this.__key,E=this.getLatest(),I=E.__parent,F=a._cloneNotNeeded,oe=cn();if(Cr(oe)&&oe.setCachedNodes(null),F.has(_))return oo(E),E;const Ne=E.constructor.clone(E);return Ne.__parent=I,Ne.__next=E.__next,Ne.__prev=E.__prev,Je(E)&&Je(Ne)?(Ne.__first=E.__first,Ne.__last=E.__last,Ne.__size=E.__size,Ne.__indent=E.__indent,Ne.__format=E.__format,Ne.__dir=E.__dir):gt(E)&&gt(Ne)&&(Ne.__format=E.__format,Ne.__style=E.__style,Ne.__mode=E.__mode,Ne.__detail=E.__detail),F.add(_),Ne.__key=_,oo(Ne),f.set(_,Ne),Ne}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(o,a){throw Error("createDOM: base method not extended")}updateDOM(o,a,f){throw Error("updateDOM: base method not extended")}exportDOM(o){return{element:this.createDOM(o._config,o)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(o){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(o){Tt(this,!0,o)}replace(o,a){nr();let f=cn();f!==null&&(f=f.clone()),Br(this,o);const _=this.getLatest(),E=this.__key,I=o.__key,F=o.getWritable(),oe=this.getParentOrThrow().getWritable(),de=oe.__size;yi(F);const Ne=_.getPreviousSibling(),Ee=_.getNextSibling(),xe=_.__prev,Ce=_.__next,He=_.__parent;if(Tt(_,!1,!0),Ne===null)oe.__first=I;else{const Ie=Ne.getWritable();Ie.__next=I}if(F.__prev=xe,Ee===null)oe.__last=I;else{const Ie=Ee.getWritable();Ie.__prev=I}if(F.__next=Ce,F.__parent=He,oe.__size=de,a&&this.getChildren().forEach(Ie=>{F.append(Ie)}),pt(f)){Or(f);const Ie=f.anchor,Me=f.focus;Ie.key===E&&Ha(Ie,F),Me.key===E&&Ha(Me,F)}return Ir()===E&&_n(I),F}insertAfter(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.getParent(),I=cn();let F=!1,oe=!1;if(E!==null){const Ce=o.getIndexWithinParent();if(yi(_),pt(I)){const He=E.__key,Ie=I.anchor,Me=I.focus;F=Ie.type==="element"&&Ie.key===He&&Ie.offset===Ce+1,oe=Me.type==="element"&&Me.key===He&&Me.offset===Ce+1}}const de=this.getNextSibling(),Ne=this.getParentOrThrow().getWritable(),Ee=_.__key,xe=f.__next;if(de===null)Ne.__last=Ee;else{const Ce=de.getWritable();Ce.__prev=Ee}if(Ne.__size++,f.__next=Ee,_.__next=xe,_.__prev=f.__key,_.__parent=f.__parent,a&&pt(I)){const Ce=this.getIndexWithinParent();Ka(I,Ne,Ce+1);const He=Ne.__key;F&&I.anchor.set(He,Ce+2,"element"),oe&&I.focus.set(He,Ce+2,"element")}return o}insertBefore(o,a=!0){nr(),Br(this,o);const f=this.getWritable(),_=o.getWritable(),E=_.__key;yi(_);const I=this.getPreviousSibling(),F=this.getParentOrThrow().getWritable(),oe=f.__prev,de=this.getIndexWithinParent();if(I===null)F.__first=E;else{const Ee=I.getWritable();Ee.__next=E}F.__size++,f.__prev=E,_.__prev=oe,_.__next=f.__key,_.__parent=f.__parent;const Ne=cn();if(a&&pt(Ne)){const Ee=this.getParentOrThrow();Ka(Ne,Ee,de)}return o}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(o,a){nr();const f=this.getPreviousSibling(),_=this.getParentOrThrow();if(f===null)return _.select(0,0);if(Je(f))return f.select();if(!gt(f)){const E=f.getIndexWithinParent()+1;return _.select(E,E)}return f.select(o,a)}selectNext(o,a){nr();const f=this.getNextSibling(),_=this.getParentOrThrow();if(f===null)return _.select();if(Je(f))return f.select(0,0);if(!gt(f)){const E=f.getIndexWithinParent();return _.select(E,E)}return f.select(o,a)}markDirty(){this.getWritable()}}function hn(u,o){const a=gn()._nodes.get(u);if(a===void 0)throw Error(`Create node: Attempted to create node ${o.name} that was not configured to be used on the editor.`);const f=a.klass;if(f!==o)throw Error(`Create node: Type ${u} in node ${o.name} does not match registered node ${f.name} with the same type`)}function ar(u,o,a){const f=o.getParentOrThrow().getLastChild();let _=o;const E=[o];for(;_!==f;){if(!_.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");_=_.getNextSibling(),E.push(_)}let I=u;for(const F of E)I=I.insertAfter(F)}class Wr extends Mt{static getType(){return"linebreak"}static clone(o){return new Wr(o.__key)}constructor(o){super(o)}getTextContent(){return`
36
36
  `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:o=>{const a=o.parentElement;let f,_;return a!==null&&((f=a.firstChild)===o||f.nextSibling===o&&f.nodeType===Ye&&(f.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((_=a.lastChild)===o||_.previousSibling===o&&_.nodeType===Ye&&(_.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:si,priority:0}}}}static importJSON(o){return Oi()}exportJSON(){return{type:"linebreak",version:1}}}function si(u){return{node:Oi()}}function Oi(){return fo(new Wr)}function Di(u){return u instanceof Wr}function Eo(u,o){return o&qe?"code":o&kt?"mark":o&Qe?"sub":o&ft?"sup":null}function bl(u,o){return o&Oe?"strong":o&Re?"em":"span"}function Ps(u,o,a,f,_){const E=f.classList;let I=Hi(_,"base");I!==void 0&&E.add(...I),I=Hi(_,"underlineStrikethrough");let F=!1;const oe=o&We&&o&De,de=a&We&&a&De;I!==void 0&&(de?(F=!0,oe||E.add(...I)):oe&&E.remove(...I));for(const Ne in fn){const xe=fn[Ne];if(I=Hi(_,Ne),I!==void 0)if(a&xe){if(F&&(Ne==="underline"||Ne==="strikethrough")){o&xe&&E.remove(...I);continue}(!(o&xe)||oe&&Ne==="underline"||Ne==="strikethrough")&&E.add(...I)}else o&xe&&E.remove(...I)}}function Kr(u,o){const a=u.length,f=o.length;let _=0,E=0;for(;_<a&&_<f&&u[_]===o[_];)_++;for(;E+_<a&&E+_<f&&u[a-E-1]===o[f-E-1];)E++;return[_,a-_-E,o.slice(_,f-E)]}function To(u,o,a){const f=o.firstChild,_=a.isComposing(),I=u+(_?Ut:"");if(f==null)o.textContent=I;else{const F=f.nodeValue;if(F!==I)if(_||be){const[oe,de,Ne]=Kr(F,I);de!==0&&f.deleteData(oe,de),f.insertData(oe,Ne)}else f.nodeValue=I}}function $s(u,o,a,f,_,E){To(_,u,o);const F=E.theme.text;F!==void 0&&Ps(a,0,f,u,F)}function Xo(u,o){const a=document.createElement(o);return a.appendChild(u),a}class Gi extends Mt{static getType(){return"text"}static clone(o){return new Gi(o.__text,o.__key)}constructor(o,a){super(a),this.__text=o,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const o=this.getLatest();return Ge[o.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===ie}isComposing(){return this.__key===Ir()}isSegmented(){return this.getLatest().__mode===fe}isDirectionless(){return(this.getLatest().__detail&Ve)!==0}isUnmergeable(){return(this.getLatest().__detail&rt)!==0}hasFormat(o){const a=fn[o];return(this.getFormat()&a)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(o,a){const _=this.getLatest().__format;return wr(_,o,a)}createDOM(o){const a=this.__format,f=Eo(this,a),_=bl(this,a),E=f===null?_:f,I=document.createElement(E);let F=I;this.hasFormat("code")&&I.setAttribute("spellcheck","false"),f!==null&&(F=document.createElement(_),I.appendChild(F));const oe=this.__text;$s(F,this,_,a,oe,o);const de=this.__style;return de!==""&&(I.style.cssText=de),I}updateDOM(o,a,f){const _=this.__text,E=o.__format,I=this.__format,F=Eo(this,E),oe=Eo(this,I),de=bl(this,E),Ne=bl(this,I);if((F===null?de:F)!==(oe===null?Ne:oe))return!0;if(F===oe&&de!==Ne){const ze=a.firstChild;if(ze==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const tt=document.createElement(Ne);return $s(tt,this,Ne,I,_,f),a.replaceChild(tt,ze),!1}let Ce=a;if(oe!==null&&F!==null&&(Ce=a.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");To(_,Ce,this);const Ie=f.theme.text;Ie!==void 0&&E!==I&&Ps(Ne,E,I,Ce,Ie);const Me=o.__style,mt=this.__style;return Me!==mt&&(a.style.cssText=mt),!1}static importDOM(){return{"#text":()=>({conversion:kl,priority:0}),b:()=>({conversion:$a,priority:0}),code:()=>({conversion:zr,priority:0}),em:()=>({conversion:zr,priority:0}),i:()=>({conversion:zr,priority:0}),s:()=>({conversion:zr,priority:0}),span:()=>({conversion:Pa,priority:0}),strong:()=>({conversion:zr,priority:0}),sub:()=>({conversion:zr,priority:0}),sup:()=>({conversion:zr,priority:0}),u:()=>({conversion:zr,priority:0})}}static importJSON(o){const a=Wn(o.text);return a.setFormat(o.format),a.setDetail(o.detail),a.setMode(o.mode),a.setStyle(o.style),a}exportDOM(o){let{element:a}=super.exportDOM(o);if(!(a!==null&&Yo(a)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return a.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(a=Xo(a,"b")),this.hasFormat("italic")&&(a=Xo(a,"i")),this.hasFormat("strikethrough")&&(a=Xo(a,"s")),this.hasFormat("underline")&&(a=Xo(a,"u")),{element:a}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(o,a){}setFormat(o){const a=this.getWritable();return a.__format=typeof o=="string"?fn[o]:o,a}setDetail(o){const a=this.getWritable();return a.__detail=typeof o=="string"?gr[o]:o,a}setStyle(o){const a=this.getWritable();return a.__style=o,a}toggleFormat(o){const a=this.getFormat(),f=wr(a,o,null);return this.setFormat(f)}toggleDirectionless(){const o=this.getWritable();return o.__detail^=Ve,o}toggleUnmergeable(){const o=this.getWritable();return o.__detail^=rt,o}setMode(o){const a=ye[o];if(this.__mode===a)return this;const f=this.getWritable();return f.__mode=a,f}setTextContent(o){if(this.__text===o)return this;const a=this.getWritable();return a.__text=o,a}select(o,a){nr();let f=o,_=a;const E=cn(),I=this.getTextContent(),F=this.__key;if(typeof I=="string"){const oe=I.length;f===void 0&&(f=oe),_===void 0&&(_=oe)}else f=0,_=0;if(pt(E)){const oe=Ir();(oe===E.anchor.key||oe===E.focus.key)&&_n(F),E.setTextNodeRange(this,f,this,_)}else return Yd(F,f,F,_,"text","text");return E}selectStart(){return this.select(0,0)}selectEnd(){const o=this.getTextContentSize();return this.select(o,o)}spliceText(o,a,f,_){const E=this.getWritable(),I=E.__text,F=f.length;let oe=o;oe<0&&(oe=F+oe,oe<0&&(oe=0));const de=cn();if(_&&pt(de)){const Ee=o+F;de.setTextNodeRange(E,Ee,E,Ee)}const Ne=I.slice(0,oe)+f+I.slice(oe+a);return E.__text=Ne,E}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...o){nr();const a=this.getLatest(),f=a.getTextContent(),_=a.__key,E=Ir(),I=new Set(o),F=[],oe=f.length;let de="";for(let vt=0;vt<oe;vt++)de!==""&&I.has(vt)&&(F.push(de),de=""),de+=f[vt];de!==""&&F.push(de);const Ne=F.length;if(Ne===0)return[];if(F[0]===f)return[a];const Ee=F[0],xe=a.getParentOrThrow();let Ce;const He=a.getFormat(),Ie=a.getStyle(),Me=a.__detail;let mt=!1;a.isSegmented()?(Ce=Wn(Ee),Ce.__format=He,Ce.__style=Ie,Ce.__detail=Me,mt=!0):(Ce=a.getWritable(),Ce.__text=Ee);const ze=cn(),tt=[Ce];let Ft=Ee.length;for(let vt=1;vt<Ne;vt++){const Wt=F[vt],Zt=Wt.length,pn=Wn(Wt).getWritable();pn.__format=He,pn.__style=Ie,pn.__detail=Me;const qt=pn.__key,Dn=Ft+Zt;if(pt(ze)){const ai=ze.anchor,Zi=ze.focus;ai.key===_&&ai.type==="text"&&ai.offset>Ft&&ai.offset<=Dn&&(ai.key=qt,ai.offset-=Ft,ze.dirty=!0),Zi.key===_&&Zi.type==="text"&&Zi.offset>Ft&&Zi.offset<=Dn&&(Zi.key=qt,Zi.offset-=Ft,ze.dirty=!0)}E===_&&_n(qt),Ft=Dn,tt.push(pn)}Cs(this);const Rt=xe.getWritable(),Ct=this.getIndexWithinParent();return mt?(Rt.splice(Ct,0,tt),this.remove()):Rt.splice(Ct,1,tt),pt(ze)&&Ka(ze,xe,Ct,Ne-1),tt}mergeWithSibling(o){const a=o===this.getPreviousSibling();if(!a&&o!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const f=this.__key,_=o.__key,E=this.__text,I=E.length;Ir()===_&&_n(f);const oe=cn();if(pt(oe)){const xe=oe.anchor,Ce=oe.focus;xe!==null&&xe.key===_&&(Vd(xe,a,f,o,I),oe.dirty=!0),Ce!==null&&Ce.key===_&&(Vd(Ce,a,f,o,I),oe.dirty=!0)}const de=o.__text,Ne=a?de+E:E+de;this.setTextContent(Ne);const Ee=this.getWritable();return o.remove(),Ee}isTextEntity(){return!1}}function Pa(u){const o=u,a=o.style.fontWeight==="700",f=o.style.textDecoration==="line-through",_=o.style.fontStyle==="italic",E=o.style.textDecoration==="underline",I=o.style.verticalAlign;return{forChild:F=>(gt(F)&&(a&&F.toggleFormat("bold"),f&&F.toggleFormat("strikethrough"),_&&F.toggleFormat("italic"),E&&F.toggleFormat("underline"),I==="sub"&&F.toggleFormat("subscript"),I==="super"&&F.toggleFormat("superscript")),F),node:null}}function $a(u){const a=u.style.fontWeight==="normal";return{forChild:f=>(gt(f)&&!a&&f.toggleFormat("bold"),f),node:null}}const Qo=new WeakMap;function Fa(u){return u.nodeName==="PRE"||u.nodeType===Be&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function Ll(u){let o,a=u.parentNode;const f=[u];for(;a!==null&&(o=Qo.get(a))===void 0&&!Fa(a);)f.push(a),a=a.parentNode;const _=o===void 0?a:o;for(let E=0;E<f.length;E++)Qo.set(f[E],_);return _}function kl(u){const o=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let f=o.textContent||"";if(Ll(o)!==null){const _=f.split(/(\r?\n|\t)/),E=[],I=_.length;for(let F=0;F<I;F++){const oe=_[F];oe===`
37
37
  `||oe===`\r
38
38
  `?E.push(Oi()):oe===" "?E.push(Yi()):oe!==""&&E.push(Wn(oe))}return{node:E}}if(f=f.replace(/\r/g,"").replace(/[ \t\n]+/g," "),f==="")return{node:null};if(f[0]===" "){let _=o,E=!0;for(;_!==null&&(_=xo(_,!1))!==null;){const I=_.textContent||"";if(I.length>0){/[ \t\n]$/.test(I)&&(f=f.slice(1)),E=!1;break}}E&&(f=f.slice(1))}if(f[f.length-1]===" "){let _=o,E=!0;for(;_!==null&&(_=xo(_,!0))!==null;)if((_.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){E=!1;break}E&&(f=f.slice(0,f.length-1))}return f===""?{node:null}:{node:Wn(f)}}const Ba=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/,"i");function xo(u,o){let a=u;for(;;){let f;for(;(f=o?a.nextSibling:a.previousSibling)===null;){const E=a.parentElement;if(E===null)return null;a=E}if(a=f,a.nodeType===Be){const E=a.style.display;if(E===""&&a.nodeName.match(Ba)===null||E!==""&&!E.startsWith("inline"))return null}let _=a;for(;(_=o?a.firstChild:a.lastChild)!==null;)a=_;if(a.nodeType===Ye)return a;if(a.nodeName==="BR")return null}}const Fs={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function zr(u){const o=Fs[u.nodeName.toLowerCase()];return o===void 0?{node:null}:{forChild:a=>(gt(a)&&!a.hasFormat(o)&&a.toggleFormat(o),a),node:null}}function Wn(u=""){return fo(new Gi(u))}function gt(u){return u instanceof Gi}class Ai extends Gi{static getType(){return"tab"}static clone(o){const a=new Ai(o.__key);return a.__text=o.__text,a.__format=o.__format,a.__style=o.__style,a}constructor(o){super(" ",o),this.__detail=rt}static importDOM(){return null}static importJSON(o){const a=Yi();return a.setFormat(o.format),a.setStyle(o.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(o){throw Error("TabNode does not support setTextContent")}setDetail(o){throw Error("TabNode does not support setDetail")}setMode(o){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Yi(){return fo(new Ai)}function es(u){return u instanceof Ai}class Mi{constructor(o,a,f){this._selection=null,this.key=o,this.offset=a,this.type=f}is(o){return this.key===o.key&&this.offset===o.offset&&this.type===o.type}isBefore(o){let a=this.getNode(),f=o.getNode();const _=this.offset,E=o.offset;if(Je(a)){const I=a.getDescendantByIndex(_);a=I??a}if(Je(f)){const I=f.getDescendantByIndex(E);f=I??f}return a===f?_<E:a.isBefore(f)}getNode(){const o=this.key,a=En(o);if(a===null)throw Error("Point.getNode: node not found");return a}set(o,a,f){const _=this._selection,E=this.key;this.key=o,this.offset=a,this.type=f,Ws()||(Ir()===E&&_n(o),_!==null&&(_.setCachedNodes(null),_.dirty=!0))}}function Ur(u,o,a){return new Mi(u,o,a)}function ts(u,o){let a=o.__key,f=u.offset,_="element";if(gt(o)){_="text";const E=o.getTextContentSize();f>E&&(f=E)}else if(!Je(o)){const E=o.getNextSibling();if(gt(E))a=E.__key,f=0,_="text";else{const I=o.getParent();I&&(a=I.__key,f=o.getIndexWithinParent()+1)}}u.set(a,f,_)}function Ha(u,o){if(Je(o)){const a=o.getLastDescendant();Je(a)||gt(a)?ts(u,a):ts(u,o)}else ts(u,o)}function Il(u,o,a,f){const _=u.getNode(),E=_.getChildAtIndex(u.offset),I=Wn(),F=br(_)?qi().append(I):I;I.setFormat(a),I.setStyle(f),E===null?_.append(F):E.insertBefore(F),u.is(o)&&o.set(I.__key,0,"text"),u.set(I.__key,0,"text")}function li(u,o,a,f){u.key=o,u.offset=a,u.type=f}class rn{constructor(o,a){this.anchor=o,this.focus=a,o._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return Cr(o)?this.anchor.is(o.anchor)&&this.focus.is(o.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return er(this)}}class kn{constructor(o){this.dirty=!1,this._nodes=o,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){if(!Er(o))return!1;const a=this._nodes,f=o._nodes;return a.size===f.size&&Array.from(a).every(_=>f.has(_))}add(o){this.dirty=!0,this._nodes.add(o),this._cachedNodes=null}delete(o){this.dirty=!0,this._nodes.delete(o),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(o){return this._nodes.has(o)}clone(){return new kn(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(o){}insertText(){}insertNodes(o){const a=this.getNodes(),f=a.length,_=a[f-1];let E;if(gt(_))E=_.select();else{const I=_.getIndexWithinParent()+1;E=_.getParentOrThrow().select(I,I)}E.insertNodes(o);for(let I=0;I<f;I++)a[I].remove()}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this._nodes,f=[];for(const _ of a){const E=En(_);E!==null&&f.push(E)}return Ws()||(this._cachedNodes=f),f}getTextContent(){const o=this.getNodes();let a="";for(let f=0;f<o.length;f++)a+=o[f].getTextContent();return a}}function pt(u){return u instanceof In}function Cr(u){return u instanceof rn}function ji(u){const[o,,a]=Zd(u),f=a.getChildren(),_=f.length,E=f[0].getChildren().length,I=new Array(_);for(let F=0;F<_;F++)I[F]=new Array(E);for(let F=0;F<_;F++){const de=f[F].getChildren();let Ne=0;for(let Ee=0;Ee<de.length;Ee++){for(;I[F][Ne];)Ne++;const xe=de[Ee],Ce=xe.__rowSpan||1,He=xe.__colSpan||1;for(let Ie=0;Ie<Ce;Ie++)for(let Me=0;Me<He;Me++)I[F+Ie][Ne+Me]=xe;if(o===xe)return{colSpan:He,columnIndex:Ne,rowIndex:F,rowSpan:Ce};Ne+=He}}return null}class Qn extends rn{constructor(o,a,f){super(a,f),this.gridKey=o}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return cr(o)?this.gridKey===o.gridKey&&this.anchor.is(o.anchor)&&this.focus.is(o.focus):!1}set(o,a,f){this.dirty=!0,this.gridKey=o,this.anchor.key=a,this.focus.key=f,this._cachedNodes=null}clone(){return new Qn(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(o){}insertText(){}insertNodes(o){const a=this.focus.getNode();Bi(a.select(0,a.getChildrenSize())).insertNodes(o)}getShape(){const o=En(this.anchor.key);if(!Gr(o))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const a=ji(o);if(a===null)throw Error("getCellRect: expected to find AnchorNode");const f=En(this.focus.key);if(!Gr(f))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const _=ji(f);if(_===null)throw Error("getCellRect: expected to find focusCellNode");const E=Math.min(a.columnIndex,_.columnIndex),I=Math.max(a.columnIndex,_.columnIndex),F=Math.min(a.rowIndex,_.rowIndex),oe=Math.max(a.rowIndex,_.rowIndex);return{fromX:Math.min(E,I),fromY:Math.min(F,oe),toX:Math.max(E,I),toY:Math.max(F,oe)}}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this.anchor.getNode(),f=this.focus.getNode(),_=Uo(a,Gr),E=Uo(f,Gr);if(!Gr(_))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!Gr(E))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const I=_.getParent();if(!$l(I))throw Error("Expected anchorCell to have a parent GridRowNode");const F=I.getParent();if(!Gc(F))throw Error("Expected tableNode to have a parent GridNode");const oe=E.getParents()[1];if(oe!==F){if(F.isParentOf(E)){const vt=oe.getParent();if(vt==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,E.getKey(),vt.getKey())}else{const vt=F.getParent();if(vt==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,vt.getKey(),E.getKey())}return this.getNodes()}const[de,Ne,Ee]=qd(F,_,E);let xe=Math.min(Ne.startColumn,Ee.startColumn),Ce=Math.min(Ne.startRow,Ee.startRow),He=Math.max(Ne.startColumn+Ne.cell.__colSpan-1,Ee.startColumn+Ee.cell.__colSpan-1),Ie=Math.max(Ne.startRow+Ne.cell.__rowSpan-1,Ee.startRow+Ee.cell.__rowSpan-1),Me=xe,mt=Ce,ze=xe,tt=Ce;function Ft(vt){const{cell:Wt,startColumn:Zt,startRow:pn}=vt;xe=Math.min(xe,Zt),Ce=Math.min(Ce,pn),He=Math.max(He,Zt+Wt.__colSpan-1),Ie=Math.max(Ie,pn+Wt.__rowSpan-1)}for(;xe<Me||Ce<mt||He>ze||Ie>tt;){if(xe<Me){const vt=tt-mt,Wt=Me-1;for(let Zt=0;Zt<=vt;Zt++)Ft(de[mt+Zt][Wt]);Me=Wt}if(Ce<mt){const vt=ze-Me,Wt=mt-1;for(let Zt=0;Zt<=vt;Zt++)Ft(de[Wt][Me+Zt]);mt=Wt}if(He>ze){const vt=tt-mt,Wt=ze+1;for(let Zt=0;Zt<=vt;Zt++)Ft(de[mt+Zt][Wt]);ze=Wt}if(Ie>tt){const vt=ze-Me,Wt=tt+1;for(let Zt=0;Zt<=vt;Zt++)Ft(de[Wt][Me+Zt]);tt=Wt}}const Rt=[F];let Ct=null;for(let vt=Ce;vt<=Ie;vt++)for(let Wt=xe;Wt<=He;Wt++){const{cell:Zt}=de[vt][Wt],pn=Zt.getParent();if(!$l(pn))throw Error("Expected GridCellNode parent to be a GridRowNode");pn!==Ct&&Rt.push(pn),Rt.push(Zt,...Ki(Zt)),Ct=pn}return Ws()||(this._cachedNodes=Rt),Rt}getTextContent(){const o=this.getNodes();let a="";for(let f=0;f<o.length;f++)a+=o[f].getTextContent();return a}}function cr(u){return u instanceof Qn}class In extends rn{constructor(o,a,f,_){super(o,a),this.format=f,this.style=_}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return pt(o)?this.anchor.is(o.anchor)&&this.focus.is(o.focus)&&this.format===o.format&&this.style===o.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const a=this.anchor,f=this.focus,_=a.isBefore(f),E=_?a:f,I=_?f:a;let F=E.getNode(),oe=I.getNode();const de=E.offset,Ne=I.offset;if(Je(F)){const xe=F.getDescendantByIndex(de);F=xe??F}if(Je(oe)){let xe=oe.getDescendantByIndex(Ne);xe!==null&&xe!==F&&oe.getChildAtIndex(Ne)===xe&&(xe=xe.getPreviousSibling()),oe=xe??oe}let Ee;return F.is(oe)?Je(F)&&F.getChildrenSize()>0?Ee=[]:Ee=[F]:Ee=F.getNodesBetween(oe),Ws()||(this._cachedNodes=Ee),Ee}setTextNodeRange(o,a,f,_){li(this.anchor,o.__key,a,"text"),li(this.focus,f.__key,_,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const o=this.getNodes();if(o.length===0)return"";const a=o[0],f=o[o.length-1],_=this.anchor,E=this.focus,I=_.isBefore(E),[F,oe]=er(this);let de="",Ne=!0;for(let Ee=0;Ee<o.length;Ee++){const xe=o[Ee];if(Je(xe)&&!xe.isInline())Ne||(de+=`
39
39
  `),xe.isEmpty()?Ne=!1:Ne=!0;else if(Ne=!1,gt(xe)){let Ce=xe.getTextContent();xe===a?xe===f?(_.type!=="element"||E.type!=="element"||E.offset===_.offset)&&(Ce=F<oe?Ce.slice(F,oe):Ce.slice(oe,F)):Ce=I?Ce.slice(F):Ce.slice(oe):xe===f&&(Ce=I?Ce.slice(0,oe):Ce.slice(0,F)),de+=Ce}else(Sn(xe)||Di(xe))&&(xe!==f||!this.isCollapsed())&&(de+=xe.getTextContent())}return de}applyDOMRange(o){const a=gn(),_=a.getEditorState()._selection,E=Gd(o.startContainer,o.startOffset,o.endContainer,o.endOffset,a,_);if(E===null)return;const[I,F]=E;li(this.anchor,I.key,I.offset,I.type),li(this.focus,F.key,F.offset,F.type),this._cachedNodes=null}clone(){const o=this.anchor,a=this.focus;return new In(Ur(o.key,o.offset,o.type),Ur(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(o){this.format=wr(this.format,o,null),this.dirty=!0}setStyle(o){this.style=o,this.dirty=!0}hasFormat(o){const a=fn[o];return(this.format&a)!==0}insertRawText(o){const a=o.split(/(\r?\n|\t)/),f=[],_=a.length;for(let E=0;E<_;E++){const I=a[E];I===`
40
40
  `||I===`\r
41
- `?f.push(Oi()):I===" "?f.push(Yi()):f.push(Wn(I))}this.insertNodes(f)}insertText(o){const a=this.anchor,f=this.focus,_=this.isCollapsed()||a.isBefore(f),E=this.format,I=this.style;_&&a.type==="element"?Il(a,f,E,I):!_&&f.type==="element"&&Il(f,a,E,I);const F=this.getNodes(),oe=F.length,de=_?a:f,Ne=_?f:a,Ee=de.offset,xe=Ne.offset;let Ce=F[0];if(!gt(Ce))throw Error("insertText: first node is not a text node");const Ie=Ce.getTextContent().length,Me=Ce.getParentOrThrow(),mt=oe-1;let ze=F[mt];if(this.isCollapsed()&&Ee===Ie&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!Me.canInsertTextAfter()&&Ce.getNextSibling()===null)){let tt=Ce.getNextSibling();if((!gt(tt)||!tt.canInsertTextBefore()||gl(tt))&&(tt=Wn(),tt.setFormat(E),Me.canInsertTextAfter()?Ce.insertAfter(tt):Me.insertAfter(tt)),tt.select(0,0),Ce=tt,o!==""){this.insertText(o);return}}else if(this.isCollapsed()&&Ee===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!Me.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let tt=Ce.getPreviousSibling();if((!gt(tt)||gl(tt))&&(tt=Wn(),tt.setFormat(E),Me.canInsertTextBefore()?Ce.insertBefore(tt):Me.insertBefore(tt)),tt.select(),Ce=tt,o!==""){this.insertText(o);return}}else if(Ce.isSegmented()&&Ee!==Ie){const tt=Wn(Ce.getTextContent());tt.setFormat(E),Ce.replace(tt),Ce=tt}else if(!this.isCollapsed()&&o!==""){const tt=ze.getParent();if(!Me.canInsertTextBefore()||!Me.canInsertTextAfter()||Je(tt)&&(!tt.canInsertTextBefore()||!tt.canInsertTextAfter())){this.insertText(""),Ud(this.anchor,this.focus,null),this.insertText(o);return}}if(oe===1){if(Ce.isToken()){const Ct=Wn(o);Ct.select(),Ce.replace(Ct);return}const tt=Ce.getFormat(),Ft=Ce.getStyle();if(Ee===xe&&(tt!==E||Ft!==I))if(Ce.getTextContent()==="")Ce.setFormat(E),Ce.setStyle(I);else{const Ct=Wn(o);if(Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ee===0)Ce.insertBefore(Ct,!1);else{const[vt]=Ce.splitText(Ee);vt.insertAfter(Ct,!1)}Ct.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);return}else if(es(Ce)){const Ct=Wn(o);Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ce.replace(Ct);return}const Rt=xe-Ee;Ce=Ce.spliceText(Ee,Rt,o,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=o.length:(this.format=tt,this.style=Ft))}else{const tt=new Set([...Ce.getParentKeys(),...ze.getParentKeys()]),Ft=Je(Ce)?Ce:Ce.getParentOrThrow();let Rt=Je(ze)?ze:ze.getParentOrThrow(),Ct=ze;if(!Ft.is(Rt)&&Rt.isInline())do Ct=Rt,Rt=Rt.getParentOrThrow();while(Rt.isInline());if(Ne.type==="text"&&(xe!==0||ze.getTextContent()==="")||Ne.type==="element"&&ze.getIndexWithinParent()<xe)if(gt(ze)&&!ze.isToken()&&xe!==ze.getTextContentSize()){if(ze.isSegmented()){const qt=Wn(ze.getTextContent());ze.replace(qt),ze=qt}!br(Ne.getNode())&&Ne.type==="text"&&(ze=ze.spliceText(0,xe,"")),tt.add(ze.__key)}else{const qt=ze.getParentOrThrow();!qt.canBeEmpty()&&qt.getChildrenSize()===1?qt.remove():ze.remove()}else tt.add(ze.__key);const vt=Rt.getChildren(),Wt=new Set(F),Zt=Ft.is(Rt),pn=Ft.isInline()&&Ce.getNextSibling()===null?Ft:Ce;for(let qt=vt.length-1;qt>=0;qt--){const Dn=vt[qt];if(Dn.is(Ce)||Je(Dn)&&Dn.isParentOf(Ce))break;Dn.isAttached()&&(!Wt.has(Dn)||Dn.is(Ct)?Zt||pn.insertAfter(Dn,!1):Dn.remove())}if(!Zt){let qt=Rt,Dn=null;for(;qt!==null;){const ai=qt.getChildren(),Zi=ai.length;(Zi===0||ai[Zi-1].is(Dn))&&(tt.delete(qt.__key),Dn=qt),qt=qt.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(Ee,Ie-Ee,o,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);else if(Ee===Ie)Ce.select();else{const qt=Wn(o);qt.select(),Ce.replace(qt)}for(let qt=1;qt<oe;qt++){const Dn=F[qt],ai=Dn.__key;tt.has(ai)||Dn.remove()}}}removeText(){this.insertText("")}formatText(o){if(this.isCollapsed()){this.toggleFormat(o),_n(null);return}const a=this.getNodes(),f=[];for(const ze of a)gt(ze)&&f.push(ze);const _=f.length;if(_===0){this.toggleFormat(o),_n(null);return}const E=this.anchor,I=this.focus,F=this.isBackward(),oe=F?I:E,de=F?E:I;let Ne=0,Ee=f[0],xe=oe.type==="element"?0:oe.offset;if(oe.type==="text"&&xe===Ee.getTextContentSize()&&(Ne=1,Ee=f[1],xe=0),Ee==null)return;const Ce=Ee.getFormatFlags(o,null),He=_-1;let Ie=f[He];const Me=de.type==="text"?de.offset:Ie.getTextContentSize();if(Ee.is(Ie)){if(xe===Me)return;if(xe===0&&Me===Ee.getTextContentSize())Ee.setFormat(Ce);else{const ze=Ee.splitText(xe,Me),tt=xe===0?ze[0]:ze[1];tt.setFormat(Ce),oe.type==="text"&&oe.set(tt.__key,0,"text"),de.type==="text"&&de.set(tt.__key,Me-xe,"text")}this.format=Ce;return}xe!==0&&([,Ee]=Ee.splitText(xe),xe=0),Ee.setFormat(Ce);const mt=Ie.getFormatFlags(o,Ce);Me>0&&(Me!==Ie.getTextContentSize()&&([Ie]=Ie.splitText(Me)),Ie.setFormat(mt));for(let ze=Ne+1;ze<He;ze++){const tt=f[ze];if(!tt.isToken()){const Ft=tt.getFormatFlags(o,mt);tt.setFormat(Ft)}}oe.type==="text"&&oe.set(Ee.__key,xe,"text"),de.type==="text"&&de.set(Ie.__key,Me,"text"),this.format=Ce|mt}insertNodes(o){if(o.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const Me=cn();if(!pt(Me))throw Error("Expected RangeSelection after insertParagraph");return Me.insertNodes(o)}const a=As(this.anchor.getNode(),zi),f=o[o.length-1];if("__language"in a){if("__language"in o[0])this.insertText(o[0].getTextContent());else{const Me=Bc(this);a.splice(Me,0,o),f.selectEnd()}return}const _=Me=>(Je(Me)||Sn(Me))&&!Me.isInline();if(!o.some(_)){const Me=Bc(this);a.splice(Me,0,o),f.selectEnd();return}const E=w_(o),I=E.getLastDescendant(),F=E.getChildren(),oe=Me=>"__value"in Me&&"__checked"in Me,de=Me=>Je(Me)&&zi(Me)&&!Me.isEmpty()&&Je(a)&&(!a.isEmpty()||oe(a)),Ee=!Je(a)||!a.isEmpty()?this.insertParagraph():null,xe=F[F.length-1];let Ce=F[0];de(Ce)&&(a.append(...Ce.getChildren()),Ce=F[1]),Ce&&ar(a,Ce);const He=As(I,zi);Ee&&Je(He)&&(oe(Ee)||zi(xe))&&(He.append(...Ee.getChildren()),Ee.remove()),Je(a)&&a.isEmpty()&&a.remove(),I.selectEnd();const Ie=Je(a)?a.getLastChild():null;Di(Ie)&&He!==a&&Ie.remove()}insertParagraph(){if(this.anchor.key==="root"){const I=qi();return Zn().splice(this.anchor.offset,0,[I]),I.select(),I}const o=Bc(this),a=As(this.anchor.getNode(),zi),f=a.getChildAtIndex(o),_=f?[f,...f.getNextSiblings()]:[],E=a.insertNewAfter(this,!1);return E?(E.append(..._),E.selectStart(),E):null}insertLineBreak(o){const a=Oi();if(this.insertNodes([a]),o){const f=a.getParentOrThrow(),_=a.getIndexWithinParent();f.select(_,_)}}extract(){const o=this.getNodes(),a=o.length,f=a-1,_=this.anchor,E=this.focus;let I=o[0],F=o[f];const[oe,de]=er(this);if(a===0)return[];if(a===1){if(gt(I)&&!this.isCollapsed()){const Ee=oe>de?de:oe,xe=oe>de?oe:de,Ce=I.splitText(Ee,xe),He=Ee===0?Ce[0]:Ce[1];return He!=null?[He]:[]}return[I]}const Ne=_.isBefore(E);if(gt(I)){const Ee=Ne?oe:de;Ee===I.getTextContentSize()?o.shift():Ee!==0&&([,I]=I.splitText(Ee),o[0]=I)}if(gt(F)){const xe=F.getTextContent().length,Ce=Ne?de:oe;Ce===0?o.pop():Ce!==xe&&([F]=F.splitText(Ce),o[f]=F)}return o}modify(o,a,f){const _=this.focus,E=this.anchor,I=o==="move",F=ri(_,a);if(Sn(F)&&!F.isIsolated()){if(I&&F.isKeyboardSelectable()){const Ce=$c();Ce.add(F.__key),Or(Ce);return}const xe=a?F.getPreviousSibling():F.getNextSibling();if(gt(xe)){const Ce=xe.__key,He=a?xe.getTextContent().length:0;_.set(Ce,He,"text"),I&&E.set(Ce,He,"text");return}else{const Ce=F.getParentOrThrow();let He,Ie;Je(xe)?(Ie=xe.__key,He=a?xe.getChildrenSize():0):(He=F.getIndexWithinParent(),Ie=Ce.__key,a||He++),_.set(Ie,He,"element"),I&&E.set(Ie,He,"element");return}}const oe=gn(),de=_r(oe._window);if(!de)return;const Ne=oe._blockCursorElement,Ee=oe._rootElement;if(Ee!==null&&Ne!==null&&Je(F)&&!F.isInline()&&!F.canBeEmpty()&&wt(Ne,oe,Ee),Bs(de,o,a?"backward":"forward",f),de.rangeCount>0){const xe=de.getRangeAt(0),Ce=this.anchor.getNode(),He=br(Ce)?Ce:Dr(Ce);if(this.applyDOMRange(xe),this.dirty=!0,!I){const Ie=this.getNodes(),Me=[];let mt=!1;for(let ze=0;ze<Ie.length;ze++){const tt=Ie[ze];ht(tt,He)?Me.push(tt):mt=!0}if(mt&&Me.length>0)if(a){const ze=Me[0];Je(ze)?ze.selectStart():ze.getParentOrThrow().selectStart()}else{const ze=Me[Me.length-1];Je(ze)?ze.selectEnd():ze.getParentOrThrow().selectEnd()}(de.anchorNode!==xe.startContainer||de.anchorOffset!==xe.startOffset)&&Vi(this)}}}deleteCharacter(o){const a=this.isCollapsed();if(this.isCollapsed()){const f=this.anchor,_=this.focus;let E=f.getNode();if(!o&&(f.type==="element"&&Je(E)&&f.offset===E.getChildrenSize()||f.type==="text"&&f.offset===E.getTextContentSize())){const F=E.getParent(),oe=E.getNextSibling()||(F===null?null:F.getNextSibling());if(Je(oe)&&oe.isShadowRoot())return}const I=ri(_,o);if(Sn(I)&&!I.isIsolated()){if(I.isKeyboardSelectable()&&Je(E)&&E.getChildrenSize()===0){E.remove();const F=$c();F.add(I.__key),Or(F)}else I.remove(),gn().dispatchCommand(e,void 0);return}else if(!o&&Je(I)&&Je(E)&&E.isEmpty()){E.remove(),I.selectStart();return}if(this.modify("extend",o,"character"),this.isCollapsed()){if(o&&f.offset===0&&(f.type==="element"?f.getNode():f.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const F=_.type==="text"?_.getNode():null;if(E=f.type==="text"?f.getNode():null,F!==null&&F.isSegmented()){const oe=_.offset,de=F.getTextContentSize();if(F.is(E)||o&&oe!==de||!o&&oe!==0){Wd(F,o,oe);return}}else if(E!==null&&E.isSegmented()){const oe=f.offset,de=E.getTextContentSize();if(E.is(F)||o&&oe!==0||!o&&oe!==de){Wd(E,o,oe);return}}Wa(this,o)}}if(this.removeText(),o&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const f=this.anchor.getNode();f.isEmpty()&&br(f.getParent())&&f.getIndexWithinParent()===0&&f.collapseAtStart(this)}}deleteLine(o){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",o,"lineboundary"),(o?this.focus:this.anchor).offset===0&&this.modify("extend",o,"character")),this.removeText()}deleteWord(o){this.isCollapsed()&&this.modify("extend",o,"word"),this.removeText()}}function Er(u){return u instanceof kn}function Ri(u){const o=u.offset;if(u.type==="text")return o;const a=u.getNode();return o===a.getChildrenSize()?a.getTextContent().length:0}function er(u){const o=u.anchor,a=u.focus;return o.type==="element"&&a.type==="element"&&o.key===a.key&&o.offset===a.offset?[0,0]:[Ri(o),Ri(a)]}function Vi(u){const o=u.focus,a=u.anchor,f=a.key,_=a.offset,E=a.type;li(a,o.key,o.offset,o.type),li(o,f,_,E),u._cachedNodes=null}function Bs(u,o,a,f){u.modify(o,a,f)}function Wa(u,o){const a=u.anchor,f=u.focus,_=a.getNode(),E=f.getNode();if(_===E&&a.type==="text"&&f.type==="text"){const I=a.offset,F=f.offset,oe=I<F,de=oe?I:F,Ne=oe?F:I,Ee=Ne-1;if(de!==Ee){const xe=_.getTextContent().slice(de,Ne);pl(xe)||(o?f.offset=Ee:a.offset=Ee)}}}function Wd(u,o,a){const f=u,E=f.getTextContent().split(/(?=\s)/g),I=E.length;let F=0,oe=0;for(let Ne=0;Ne<I;Ne++){const Ee=E[Ne],xe=Ne===I-1;if(oe=F,F+=Ee.length,o&&F===a||F>a||xe){E.splice(Ne,1),xe&&(oe=void 0);break}}const de=E.join("").trim();de===""?f.remove():(f.setTextContent(de),f.select(oe,oe))}function __(u,o,a){const f=u.getParent();return a===null||f===null||!f.canBeEmpty()||f!==a.getNode()}function Kd(u,o,a,f){let _=o,E;if(u.nodeType===Be){let I=!1;const F=u.childNodes,oe=F.length;_===oe&&(I=!0,_=oe-1);let de=F[_],Ne=!1;if(de===f._blockCursorElement?(de=F[_+1],Ne=!0):f._blockCursorElement!==null&&_--,E=ei(de),gt(E))_=xs(E,I);else{let Ee=ei(u);if(Ee===null)return null;if(Je(Ee)){let xe=Ee.getChildAtIndex(_);if(Je(xe)&&__(xe,_,a)){const Ce=I?xe.getLastDescendant():xe.getFirstDescendant();Ce===null?(Ee=xe,_=0):(xe=Ce,Ee=Je(xe)?xe:xe.getParentOrThrow())}gt(xe)?(E=xe,Ee=null,_=xs(xe,I)):xe!==Ee&&I&&!Ne&&_++}else{const xe=Ee.getIndexWithinParent();o===0&&Sn(Ee)&&ei(u)===Ee?_=xe:_=xe+1,Ee=Ee.getParentOrThrow()}if(Je(Ee))return Ur(Ee.__key,_,"element")}}else E=ei(u);return gt(E)?Ur(E.__key,_,"text"):null}function zd(u,o,a){const f=u.offset,_=u.getNode();if(f===0){const E=_.getPreviousSibling(),I=_.getParent();if(!o)Je(E)&&!a&&E.isInline()?(u.key=E.__key,u.offset=E.getChildrenSize(),u.type="element"):gt(E)&&(u.key=E.__key,u.offset=E.getTextContent().length);else if((a||!o)&&E===null&&Je(I)&&I.isInline()){const F=I.getPreviousSibling();gt(F)&&(u.key=F.__key,u.offset=F.getTextContent().length)}}else if(f===_.getTextContent().length){const E=_.getNextSibling(),I=_.getParent();if(o&&Je(E)&&E.isInline())u.key=E.__key,u.offset=0,u.type="element";else if((a||o)&&E===null&&Je(I)&&I.isInline()&&!I.canInsertTextAfter()){const F=I.getNextSibling();gt(F)&&(u.key=F.__key,u.offset=0)}}}function Ud(u,o,a){if(u.type==="text"&&o.type==="text"){const f=u.isBefore(o),_=u.is(o);zd(u,f,_),zd(o,!f,_),_&&(o.key=u.key,o.offset=u.offset,o.type=u.type);const E=gn();if(E.isComposing()&&E._compositionKey!==u.key&&pt(a)){const I=a.anchor,F=a.focus;li(u,I.key,I.offset,I.type),li(o,F.key,F.offset,F.type)}}}function Gd(u,o,a,f,_,E){if(u===null||a===null||!Qr(_,u,a))return null;const I=Kd(u,o,pt(E)?E.anchor:null,_);if(I===null)return null;const F=Kd(a,f,pt(E)?E.focus:null,_);if(F===null)return null;if(I.type==="element"&&F.type==="element"){const oe=ei(u),de=ei(a);if(Sn(oe)&&Sn(de))return null}return Ud(I,F,E),[I,F]}function y_(u){return Je(u)&&!u.isInline()}function Yd(u,o,a,f,_,E){const I=bi(),F=new In(Ur(u,o,_),Ur(a,f,E),0,"");return F.dirty=!0,I._selection=F,F}function N_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new In(u,o,0,"")}function $c(){return new kn(new Set)}function C_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new Qn("root",u,o)}function E_(u){const a=u.getEditorState()._selection,f=_r(u._window);return pt(a)||a==null?Fc(a,f,u):a.clone()}function Fc(u,o,a){const f=a._window;if(f===null)return null;const _=f.event,E=_?_.type:void 0,I=E==="selectionchange",F=!Kt()&&(I||E==="beforeinput"||E==="compositionstart"||E==="compositionend"||E==="click"&&_&&_.detail===3||E==="drop"||E===void 0);let oe,de,Ne,Ee;if(!pt(u)||F){if(o===null)return null;if(oe=o.anchorNode,de=o.focusNode,Ne=o.anchorOffset,Ee=o.focusOffset,I&&pt(u)&&!Qr(a,oe,de))return u.clone()}else return u.clone();const xe=Gd(oe,Ne,de,Ee,a,u);if(xe===null)return null;const[Ce,He]=xe;return new In(Ce,He,pt(u)?u.format:0,pt(u)?u.style:"")}function cn(){return bi()._selection}function Hs(){return gn()._editorState._selection}function Ka(u,o,a,f=1){const _=u.anchor,E=u.focus,I=_.getNode(),F=E.getNode();if(!o.is(I)&&!o.is(F))return;const oe=o.__key;if(u.isCollapsed()){const de=_.offset;if(a<=de&&f>0||a<de&&f<0){const Ne=Math.max(0,de+f);_.set(oe,Ne,"element"),E.set(oe,Ne,"element"),jd(u)}}else{const de=u.isBackward(),Ne=de?E:_,Ee=Ne.getNode(),xe=de?_:E,Ce=xe.getNode();if(o.is(Ee)){const He=Ne.offset;(a<=He&&f>0||a<He&&f<0)&&Ne.set(oe,Math.max(0,He+f),"element")}if(o.is(Ce)){const He=xe.offset;(a<=He&&f>0||a<He&&f<0)&&xe.set(oe,Math.max(0,He+f),"element")}}jd(u)}function jd(u){const o=u.anchor,a=o.offset,f=u.focus,_=f.offset,E=o.getNode(),I=f.getNode();if(u.isCollapsed()){if(!Je(E))return;const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text"),f.set(de.__key,Ne,"text")}return}if(Je(E)){const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text")}}if(Je(I)){const F=I.getChildrenSize(),oe=_>=F,de=oe?I.getChildAtIndex(F-1):I.getChildAtIndex(_);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),f.set(de.__key,Ne,"text")}}}function T_(u,o){const f=o.getEditorState()._selection,_=u._selection;if(pt(_)){const E=_.anchor,I=_.focus;let F;if(E.type==="text"&&(F=E.getNode(),F.selectionTransform(f,_)),I.type==="text"){const oe=I.getNode();F!==oe&&oe.selectionTransform(f,_)}}}function za(u,o,a,f,_){let E=null,I=0,F=null;f!==null?(E=f.__key,gt(f)?(I=f.getTextContentSize(),F="text"):Je(f)&&(I=f.getChildrenSize(),F="element")):_!==null&&(E=_.__key,gt(_)?F="text":Je(_)&&(F="element")),E!==null&&F!==null?u.set(E,I,F):(I=o.getIndexWithinParent(),I===-1&&(I=a.getChildrenSize()),u.set(a.__key,I,"element"))}function Vd(u,o,a,f,_){u.type==="text"?(u.key=a,o||(u.offset+=_)):u.offset>f.getIndexWithinParent()&&(u.offset-=1)}function x_(u,o,a,f,_,E,I){const F=f.anchorNode,oe=f.focusNode,de=f.anchorOffset,Ne=f.focusOffset,Ee=document.activeElement;if(_.has("collaboration")&&Ee!==E||Ee!==null&&io(Ee))return;if(!pt(o)){u!==null&&Qr(a,F,oe)&&f.removeAllRanges();return}const xe=o.anchor,Ce=o.focus,He=xe.key,Ie=Ce.key,Me=ws(a,He),mt=ws(a,Ie),ze=xe.offset,tt=Ce.offset,Ft=o.format,Rt=o.style,Ct=o.isCollapsed();let vt=Me,Wt=mt,Zt=!1;if(xe.type==="text"){vt=Ln(Me);const pn=xe.getNode();Zt=pn.getFormat()!==Ft||pn.getStyle()!==Rt}else pt(u)&&u.anchor.type==="text"&&(Zt=!0);if(Ce.type==="text"&&(Wt=Ln(mt)),!(vt===null||Wt===null)&&(Ct&&(u===null||Zt||pt(u)&&(u.format!==Ft||u.style!==Rt))&&ut(Ft,Rt,ze,He,performance.now()),!(de===ze&&Ne===tt&&F===vt&&oe===Wt&&!(f.type==="Range"&&Ct)&&((Ee===null||!E.contains(Ee))&&E.focus({preventScroll:!0}),xe.type!=="element")))){try{f.setBaseAndExtent(vt,ze,Wt,tt)}catch{}if(!_.has("skip-scroll-into-view")&&o.isCollapsed()&&E!==null&&E===document.activeElement){const pn=o instanceof In&&o.anchor.type==="element"?vt.childNodes[ze]||null:f.rangeCount>0?f.getRangeAt(0):null;if(pn!==null){let qt;if(pn instanceof Text){const Dn=document.createRange();Dn.selectNode(pn),qt=Dn.getBoundingClientRect()}else qt=pn.getBoundingClientRect();xa(a,qt,E)}}Xe()}}function v_(u){let o=cn()||Hs();o===null&&(o=Zn().selectEnd()),o.insertNodes(u)}function S_(){const u=cn();return u===null?"":u.getTextContent()}function qd(u,o,a){const f=[];let _=null,E=null;function I(de,Ne,Ee){const xe={cell:Ee,startColumn:Ne,startRow:de},Ce=Ee.__rowSpan,He=Ee.__colSpan;for(let Ie=0;Ie<Ce;Ie++){f[de+Ie]===void 0&&(f[de+Ie]=[]);for(let Me=0;Me<He;Me++)f[de+Ie][Ne+Me]=xe}o.is(Ee)&&(_=xe),a.is(Ee)&&(E=xe)}function F(de,Ne){return f[de]===void 0||f[de][Ne]===void 0}const oe=u.getChildren();for(let de=0;de<oe.length;de++){const Ne=oe[de];if(!$l(Ne))throw Error("Expected GridNode children to be GridRowNode");const Ee=Ne.getChildren();let xe=0;for(const Ce of Ee){if(!Gr(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!F(de,xe);)xe++;I(de,xe,Ce),xe+=Ce.__colSpan}}if(_===null)throw Error("Anchor not found in Grid");if(E===null)throw Error("Focus not found in Grid");return[f,_,E]}function Zd(u){let o;if(u instanceof Uc)o=u;else if(u instanceof Mt){const _=Uo(u,Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}else{const _=Uo(u.getNode(),Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}const a=o.getParent();if(!$l(a))throw Error("Expected GridCellNode to have a parent GridRowNode");const f=a.getParent();if(!Gc(f))throw Error("Expected GridRowNode to have a parent GridNode");return[o,a,f]}function Bc(u){u.isCollapsed()||u.removeText();const o=u.anchor,a=o.getNode();if(!gt(a))return o.offset;const f=a.getParent();if(!f){const oe=qi();return Zn().append(oe),oe.select(),0}const _=a.splitText(o.offset);if(_.length===0)return 0;const E=o.offset===0?0:1,I=_[0].getIndexWithinParent()+E;if(!f.isInline()||I===0)return I;const F=f.getChildAtIndex(I);return F&&f.insertNewAfter(u).append(F,...F.getNextSiblings()),f.getIndexWithinParent()+E}function w_(u){const o=qi();let a=null;for(let f=0;f<u.length;f++){const _=u[f],E=Di(_);if(E||Sn(_)&&_.isInline()||Je(_)&&_.isInline()||gt(_)||_.isParentRequired()){if(a===null&&(a=_.createParentElementNode(),o.append(a),E))continue;a!==null&&a.append(_)}else o.append(_),a=null}return o}let Yn=null,jn=null,Tr=!1,Hc=!1,Ua=0;const Jd={characterData:!0,childList:!0,subtree:!0};function Ws(){return Tr||Yn!==null&&Yn._readOnly}function nr(){if(Tr)throw Error("Cannot use method in read-only mode.")}function Xd(){if(Ua>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function bi(){if(Yn===null)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return Yn}function gn(){if(jn===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return jn}function O_(){return jn}function Qd(u,o,a){const f=o.__type,_=kr(u,f);let E=a.get(f);E===void 0&&(E=Array.from(_.transforms),a.set(f,E));const I=E.length;for(let F=0;F<I&&(E[F](o),!!o.isAttached());F++);}function ef(u,o){return u!==void 0&&u.__key!==o&&u.isAttached()}function D_(u,o){const a=o._dirtyLeaves,f=u._nodeMap;for(const _ of a){const E=f.get(_);gt(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&dl(E)}}function A_(u,o){const a=o._dirtyLeaves,f=o._dirtyElements,_=u._nodeMap,E=Ir(),I=new Map;let F=a,oe=F.size,de=f,Ne=de.size;for(;oe>0||Ne>0;){if(oe>0){o._dirtyLeaves=new Set;for(const Ee of F){const xe=_.get(Ee);gt(xe)&&xe.isAttached()&&xe.isSimpleText()&&!xe.isUnmergeable()&&dl(xe),xe!==void 0&&ef(xe,E)&&Qd(o,xe,I),a.add(Ee)}if(F=o._dirtyLeaves,oe=F.size,oe>0){Ua++;continue}}o._dirtyLeaves=new Set,o._dirtyElements=new Map;for(const Ee of de){const xe=Ee[0],Ce=Ee[1];if(xe!=="root"&&!Ce)continue;const He=_.get(xe);He!==void 0&&ef(He,E)&&Qd(o,He,I),f.set(xe,Ce)}F=o._dirtyLeaves,oe=F.size,de=o._dirtyElements,Ne=de.size,Ua++}o._dirtyLeaves=a,o._dirtyElements=f}function M_(u){return Wc(u,gn()._nodes)}function Wc(u,o){const a=u.type,f=o.get(a);if(f===void 0)throw Error(`parseEditorState: type "${a}" + not found`);const _=f.klass;if(u.type!==_.getType())throw Error(`LexicalNode: Node ${_.name} does not implement .importJSON().`);const E=_.importJSON(u),I=u.children;if(Je(E)&&Array.isArray(I))for(let F=0;F<I.length;F++){const oe=I[F],de=Wc(oe,o);E.append(de)}return E}function R_(u,o,a){const f=zc(),_=Yn,E=Tr,I=jn,F=o._dirtyElements,oe=o._dirtyLeaves,de=o._cloneNotNeeded,Ne=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Yn=f,Tr=!1,jn=o;try{const Ee=o._nodes,xe=u.root;Wc(xe,Ee),a&&a(),f._readOnly=!0,nf(f)}catch(Ee){Ee instanceof Error&&o._onError(Ee)}finally{o._dirtyElements=F,o._dirtyLeaves=oe,o._cloneNotNeeded=de,o._dirtyType=Ne,Yn=_,Tr=E,jn=I}return f}function tf(u,o){const a=Yn,f=Tr,_=jn;Yn=u,Tr=!0,jn=null;try{return o()}finally{Yn=a,Tr=f,jn=_}}function nf(u){const o=u._nodeMap;o.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},o.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},o.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function ns(u,o){const a=u._pendingEditorState,f=u._rootElement,_=u._headless||f===null;if(a===null)return;const E=u._editorState,I=E._selection,F=a._selection,oe=u._dirtyType!==ct,de=Yn,Ne=Tr,Ee=jn,xe=u._updating,Ce=u._observer;let He=null;if(u._pendingEditorState=null,u._editorState=a,!_&&oe&&Ce!==null){jn=u,Yn=a,Tr=!1,u._updating=!0;try{const Ct=u._dirtyType,vt=u._dirtyElements,Wt=u._dirtyLeaves;Ce.disconnect(),He=sr(E,a,u,Ct,vt,Wt)}catch(Ct){if(Ct instanceof Error&&u._onError(Ct),!Hc)cf(u,null,f,a),qn(u),u._dirtyType=dt,Hc=!0,ns(u,E),Hc=!1;else throw Ct;return}finally{Ce.observe(f,Jd),u._updating=xe,Yn=de,Tr=Ne,jn=Ee}}a._readOnly||(a._readOnly=!0,nf(a),pt(F)&&(Object.freeze(F.anchor),Object.freeze(F.focus)),Object.freeze(F));const Ie=u._dirtyLeaves,Me=u._dirtyElements,mt=u._normalizedNodes,ze=u._updateTags,tt=u._deferred;oe&&(u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),Sa(u,a);const Ft=_?null:_r(u._window);if(u._editable&&Ft!==null&&(oe||F===null||F.dirty)){jn=u,Yn=a;try{if(Ce!==null&&Ce.disconnect(),oe||F===null||F.dirty){const Ct=u._blockCursorElement;Ct!==null&&wt(Ct,u,f),x_(I,F,u,Ft,ze,f)}wl(u,f,F),Ce!==null&&Ce.observe(f,Jd)}finally{jn=Ee,Yn=de}}He!==null&&L_(u,He,ze,Ie,E),!pt(F)&&F!==null&&(I===null||!I.is(F))&&u.dispatchCommand(e,void 0);const Rt=u._pendingDecorators;Rt!==null&&(u._decorators=Rt,u._pendingDecorators=null,Pl("decorator",u,!0,Rt)),b_(u,o||E,a),Pl("update",u,!0,{dirtyElements:Me,dirtyLeaves:Ie,editorState:a,normalizedNodes:mt,prevEditorState:o||E,tags:ze}),I_(u,tt),k_(u)}function b_(u,o,a){const f=so(o),_=so(a);f!==_&&Pl("textcontent",u,!0,_)}function L_(u,o,a,f,_){const E=Array.from(u._listeners.mutation),I=E.length;for(let F=0;F<I;F++){const[oe,de]=E[F],Ne=o.get(de);Ne!==void 0&&oe(Ne,{dirtyLeaves:f,prevEditorState:_,updateTags:a})}}function Pl(u,o,a,...f){const _=o._updating;o._updating=a;try{const E=Array.from(o._listeners[u]);for(let I=0;I<E.length;I++)E[I].apply(null,f)}finally{o._updating=_}}function rf(u,o,a){if(u._updating===!1||jn!==u){let _=!1;return u.update(()=>{_=rf(u,o,a)}),_}const f=vs(u);for(let _=4;_>=0;_--)for(let E=0;E<f.length;E++){const oe=f[E]._commands.get(o);if(oe!==void 0){const de=oe[_];if(de!==void 0){const Ne=Array.from(de),Ee=Ne.length;for(let xe=0;xe<Ee;xe++)if(Ne[xe](a,u)===!0)return!0}}}return!1}function k_(u){const o=u._updates;if(o.length!==0){const a=o.shift();if(a){const[f,_]=a;sf(u,f,_)}}}function I_(u,o){if(u._deferred=[],o.length!==0){const a=u._updating;u._updating=!0;try{for(let f=0;f<o.length;f++)o[f]()}finally{u._updating=a}}}function of(u,o){const a=u._updates;let f=o||!1;for(;a.length!==0;){const _=a.shift();if(_){const[E,I]=_;let F,oe;I!==void 0&&(F=I.onUpdate,oe=I.tag,I.skipTransforms&&(f=!0),F&&u._deferred.push(F),oe&&u._updateTags.add(oe)),E()}}return f}function sf(u,o,a){const f=u._updateTags;let _,E,I=!1,F=!1;a!==void 0&&(_=a.onUpdate,E=a.tag,E!=null&&f.add(E),I=a.skipTransforms||!1,F=a.discrete||!1),_&&u._deferred.push(_);const oe=u._editorState;let de=u._pendingEditorState,Ne=!1;(de===null||de._readOnly)&&(de=u._pendingEditorState=F_(de||oe),Ne=!0),de._flushSync=F;const Ee=Yn,xe=Tr,Ce=jn,He=u._updating;Yn=de,Tr=!1,u._updating=!0,jn=u;try{Ne&&(u._headless?oe._selection!=null&&(de._selection=oe._selection.clone()):de._selection=E_(u));const Me=u._compositionKey;o(),I=of(u,I),T_(de,u),u._dirtyType!==ct&&(I?D_(de,u):A_(de,u),of(u),wa(oe,de,u._dirtyLeaves,u._dirtyElements));const mt=u._compositionKey;Me!==mt&&(de._flushSync=!0);const ze=de._selection;if(pt(ze)){const tt=de._nodeMap,Ft=ze.anchor.key,Rt=ze.focus.key;if(tt.get(Ft)===void 0||tt.get(Rt)===void 0)throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Er(ze)&&ze._nodes.size===0&&(de._selection=null)}catch(Me){Me instanceof Error&&u._onError(Me),u._pendingEditorState=oe,u._dirtyType=dt,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),ns(u);return}finally{Yn=Ee,Tr=xe,jn=Ce,u._updating=He,Ua=0}u._dirtyType!==ct||$_(de,u)?de._flushSync?(de._flushSync=!1,ns(u)):Ne&&Ns(()=>{ns(u)}):(de._flushSync=!1,Ne&&(f.clear(),u._deferred=[],u._pendingEditorState=null))}function Rr(u,o,a){u._updating?u._updates.push([o,a]):sf(u,o,a)}class Kc extends Mt{constructor(o){super(o)}decorate(o,a){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Sn(u){return u instanceof Kc}class rs extends Mt{constructor(o){super(o),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const o=this.getFormat();return _s[o]||""}getIndent(){return this.getLatest().__indent}getChildren(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getChildrenKeys(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a.__key),a=a.getNextSibling();return o}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const a=gn()._dirtyElements;return a!==null&&a.has(this.__key)}isLastChild(){const o=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(o)}getAllTextNodes(){const o=[];let a=this.getFirstChild();for(;a!==null;){if(gt(a)&&o.push(a),Je(a)){const f=a.getAllTextNodes();o.push(...f)}a=a.getNextSibling()}return o}getFirstDescendant(){let o=this.getFirstChild();for(;o!==null;){if(Je(o)){const a=o.getFirstChild();if(a!==null){o=a;continue}}break}return o}getLastDescendant(){let o=this.getLastChild();for(;o!==null;){if(Je(o)){const a=o.getLastChild();if(a!==null){o=a;continue}}break}return o}getDescendantByIndex(o){const a=this.getChildren(),f=a.length;if(o>=f){const E=a[f-1];return Je(E)&&E.getLastDescendant()||E||null}const _=a[o];return Je(_)&&_.getFirstDescendant()||_||null}getFirstChild(){const a=this.getLatest().__first;return a===null?null:En(a)}getFirstChildOrThrow(){const o=this.getFirstChild();if(o===null)throw Error(`Expected node ${this.__key} to have a first child.`);return o}getLastChild(){const a=this.getLatest().__last;return a===null?null:En(a)}getLastChildOrThrow(){const o=this.getLastChild();if(o===null)throw Error(`Expected node ${this.__key} to have a last child.`);return o}getChildAtIndex(o){const a=this.getChildrenSize();let f,_;if(o<a/2){for(f=this.getFirstChild(),_=0;f!==null&&_<=o;){if(_===o)return f;f=f.getNextSibling(),_++}return null}for(f=this.getLastChild(),_=a-1;f!==null&&_>=o;){if(_===o)return f;f=f.getPreviousSibling(),_--}return null}getTextContent(){let o="";const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContent(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It)}return o}getTextContentSize(){let o=0;const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContentSize(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It.length)}return o}getDirection(){return this.getLatest().__dir}hasFormat(o){if(o!==""){const a=Jr[o];return(this.getFormat()&a)!==0}return!1}select(o,a){nr();const f=cn();let _=o,E=a;const I=this.getChildrenSize();if(!this.canBeEmpty()){if(o===0&&a===0){const oe=this.getFirstChild();if(gt(oe)||Je(oe))return oe.select(0,0)}else if((o===void 0||o===I)&&(a===void 0||a===I)){const oe=this.getLastChild();if(gt(oe)||Je(oe))return oe.select()}}_===void 0&&(_=I),E===void 0&&(E=I);const F=this.__key;if(pt(f))f.anchor.set(F,_,"element"),f.focus.set(F,E,"element"),f.dirty=!0;else return Yd(F,_,F,E,"element","element");return f}selectStart(){const o=this.getFirstDescendant();return o?o.selectStart():this.select()}selectEnd(){const o=this.getLastDescendant();return o?o.selectEnd():this.select()}clear(){const o=this.getWritable();return this.getChildren().forEach(f=>f.remove()),o}append(...o){return this.splice(this.getChildrenSize(),0,o)}setDirection(o){const a=this.getWritable();return a.__dir=o,a}setFormat(o){const a=this.getWritable();return a.__format=o!==""?Jr[o]:0,this}setIndent(o){const a=this.getWritable();return a.__indent=o,this}splice(o,a,f){const _=f.length,E=this.getChildrenSize(),I=this.getWritable(),F=I.__key,oe=[],de=[],Ne=this.getChildAtIndex(o+a);let Ee=null,xe=E-a+_;if(o!==0)if(o===E)Ee=this.getLastChild();else{const He=this.getChildAtIndex(o);He!==null&&(Ee=He.getPreviousSibling())}if(a>0){let He=Ee===null?this.getFirstChild():Ee.getNextSibling();for(let Ie=0;Ie<a;Ie++){if(He===null)throw Error("splice: sibling not found");const Me=He.getNextSibling(),mt=He.__key,ze=He.getWritable();yi(ze),de.push(mt),He=Me}}let Ce=Ee;for(let He=0;He<_;He++){const Ie=f[He];Ce!==null&&Ie.is(Ce)&&(Ee=Ce=Ce.getPreviousSibling());const Me=Ie.getWritable();Me.__parent===F&&xe--,yi(Me);const mt=Ie.__key;if(Ce===null)I.__first=mt,Me.__prev=null;else{const ze=Ce.getWritable();ze.__next=mt,Me.__prev=ze.__key}if(Ie.__key===F)throw Error("append: attempting to append self");Me.__parent=F,oe.push(mt),Ce=Ie}if(o+a===E){if(Ce!==null){const He=Ce.getWritable();He.__next=null,I.__last=Ce.__key}}else if(Ne!==null){const He=Ne.getWritable();if(Ce!==null){const Ie=Ce.getWritable();He.__prev=Ce.__key,Ie.__next=Ne.__key}else He.__prev=null}if(I.__size=xe,de.length){const He=cn();if(pt(He)){const Ie=new Set(de),Me=new Set(oe),{anchor:mt,focus:ze}=He;lf(mt,Ie,Me)&&za(mt,mt.getNode(),this,Ee,Ne),lf(ze,Ie,Me)&&za(ze,ze.getNode(),this,Ee,Ne),xe===0&&!this.canBeEmpty()&&!Fr(this)&&this.remove()}}return I}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(o,a){return null}canIndent(){return!0}collapseAtStart(o){return!1}excludeFromCopy(o){return!1}canExtractContents(){return!0}canReplaceWith(o){return!0}canInsertAfter(o){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(o){return!1}extractWithChild(o,a,f){return!1}}function Je(u){return u instanceof rs}function lf(u,o,a){let f=u.getNode();for(;f;){const _=f.__key;if(o.has(_)&&!a.has(_))return!0;f=f.getParent()}return!1}class Ks extends rs{static getType(){return"root"}static clone(){return new Ks}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const o=this.__cachedText;return(Ws()||gn()._dirtyType===ct)&&o!==null?o:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(o){throw Error("replace: cannot be called on root nodes")}insertBefore(o){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(o){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(o,a){return!1}append(...o){for(let a=0;a<o.length;a++){const f=o[a];if(!Je(f)&&!Sn(f))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...o)}static importJSON(o){const a=Zn();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function P_(){return new Ks}function br(u){return u instanceof Ks}function $_(u,o){const a=o.getEditorState()._selection,f=u._selection;if(f!==null){if(f.dirty||!f.is(a))return!0}else if(a!==null)return!0;return!1}function F_(u){return new Ga(new Map(u._nodeMap))}function zc(){return new Ga(new Map([["root",P_()]]))}function af(u){const o=u.exportJSON(),a=u.constructor;if(o.type!==a.getType())throw Error(`LexicalNode: Node ${a.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);const f=o.children;if(Je(u)){if(!Array.isArray(f))throw Error(`LexicalNode: Node ${a.name} is an element but .exportJSON() does not have a children array.`);const _=u.getChildren();for(let E=0;E<_.length;E++){const I=_[E],F=af(I);f.push(F)}}return o}class Ga{constructor(o,a){this._nodeMap=o,this._selection=a||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(o){return tf(this,o)}clone(o){const a=new Ga(this._nodeMap,o===void 0?this._selection:o);return a._readOnly=!0,a}toJSON(){return tf(this,()=>({root:af(Zn())}))}}class zs extends rs{static getType(){return"paragraph"}static clone(o){return new zs(o.__key)}createDOM(o){const a=document.createElement("p"),f=Hi(o.theme,"paragraph");return f!==void 0&&a.classList.add(...f),a}updateDOM(o,a,f){return!1}static importDOM(){return{p:o=>({conversion:B_,priority:0})}}exportDOM(o){const{element:a}=super.exportDOM(o);if(a&&Yo(a)){this.isEmpty()&&a.append(document.createElement("br"));const f=this.getFormatType();a.style.textAlign=f;const _=this.getDirection();_&&(a.dir=_);const E=this.getIndent();E>0&&(a.style.textIndent=`${E*20}px`)}return{element:a}}static importJSON(o){const a=qi();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(o,a){const f=qi(),_=this.getDirection();return f.setDirection(_),this.insertAfter(f,a),f}collapseAtStart(){const o=this.getChildren();if(o.length===0||gt(o[0])&&o[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function B_(u){const o=qi();if(u.style){o.setFormat(u.style.textAlign);const a=parseInt(u.style.textIndent,10)/20;a>0&&o.setIndent(a)}return{node:o}}function qi(){return fo(new zs)}function H_(u){return u instanceof zs}const W_=0,K_=1,z_=2,U_=3,G_=4;function cf(u,o,a,f){const _=u._keyToDOMMap;_.clear(),u._editorState=zc(),u._pendingEditorState=f,u._compositionKey=null,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const E=u._observer;E!==null&&(E.disconnect(),u._observer=null),o!==null&&(o.textContent=""),a!==null&&(a.textContent="",_.set("root",a))}function Y_(u,o){const a=new Map,f=new Set,_=E=>{Object.keys(E).forEach(I=>{let F=a.get(I);F===void 0&&(F=[],a.set(I,F)),F.push(E[I])})};return u.forEach(E=>{const I=E.klass.importDOM!=null?E.klass.importDOM.bind(E.klass):null;if(I==null||f.has(I))return;f.add(I);const F=I();F!==null&&_(F)}),o&&_(o),a}function j_(u){const o=u||{},a=O_(),f=o.theme||{},_=u===void 0?a:o.parentEditor||null,E=o.disableEvents||!1,I=zc(),F=o.namespace||(_!==null?_._config.namespace:Io()),oe=o.editorState,de=[Ks,Gi,Wr,Ai,zs,...o.nodes||[]],{onError:Ne,html:Ee}=o,xe=o.editable!==void 0?o.editable:!0;let Ce;if(u===void 0&&a!==null)Ce=a._nodes;else{Ce=new Map;for(let Ie=0;Ie<de.length;Ie++){let Me=de[Ie],mt=null,ze=null;if(typeof Me!="function"){const Ct=Me;Me=Ct.replace,mt=Ct.with,ze=Ct.withKlass||null}{const Ct=Me.name;if(Ct!=="RootNode"){const vt=Me.prototype;["getType","clone"].forEach(Wt=>{Me.hasOwnProperty(Wt)||console.warn(`${Ct} must implement static "${Wt}" method`)}),!Me.hasOwnProperty("importDOM")&&Me.hasOwnProperty("exportDOM")&&console.warn(`${Ct} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),vt instanceof Kc&&(vt.hasOwnProperty("decorate")||console.warn(`${vt.constructor.name} must implement "decorate" method`)),Me.hasOwnProperty("importJSON")||console.warn(`${Ct} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),vt.hasOwnProperty("exportJSON")||console.warn(`${Ct} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const tt=Me.getType(),Ft=Me.transform(),Rt=new Set;Ft!==null&&Rt.add(Ft),Ce.set(tt,{exportDOM:Ee&&Ee.export?Ee.export.get(Me):void 0,klass:Me,replace:mt,replaceWithKlass:ze,transforms:Rt})}}const He=new V_(I,_,Ce,{disableEvents:E,namespace:F,theme:f},Ne||console.error,Y_(Ce,Ee?Ee.import:void 0),xe);return oe!==void 0&&(He._pendingEditorState=oe,He._dirtyType=dt),He}class V_{constructor(o,a,f,_,E,I,F){this._parentEditor=a,this._rootElement=null,this._editorState=o,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=_,this._nodes=f,this._decorators={},this._pendingDecorators=null,this._dirtyType=ct,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Io(),this._onError=E,this._htmlConversions=I,this._editable=F,this._headless=a!==null&&a._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(o){const a=this._listeners.update;return a.add(o),()=>{a.delete(o)}}registerEditableListener(o){const a=this._listeners.editable;return a.add(o),()=>{a.delete(o)}}registerDecoratorListener(o){const a=this._listeners.decorator;return a.add(o),()=>{a.delete(o)}}registerTextContentListener(o){const a=this._listeners.textcontent;return a.add(o),()=>{a.delete(o)}}registerRootListener(o){const a=this._listeners.root;return o(this._rootElement,null),a.add(o),()=>{o(null,this._rootElement),a.delete(o)}}registerCommand(o,a,f){if(f===void 0)throw Error('Listener for type "command" requires a "priority".');const _=this._commands;_.has(o)||_.set(o,[new Set,new Set,new Set,new Set,new Set]);const E=_.get(o);if(E===void 0)throw Error(`registerCommand: Command ${String(o)} not found in command map`);const I=E[f];return I.add(a),()=>{I.delete(a),E.every(F=>F.size===0)&&_.delete(o)}}registerMutationListener(o,a){if(this._nodes.get(o.getType())===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);const _=this._listeners.mutation;return _.set(a,o),()=>{_.delete(a)}}registerNodeTransformToKlass(o,a){const f=o.getType(),_=this._nodes.get(f);if(_===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);return _.transforms.add(a),_}registerNodeTransform(o,a){const f=this.registerNodeTransformToKlass(o,a),_=[f],E=f.replaceWithKlass;if(E!=null){const I=this.registerNodeTransformToKlass(E,a);_.push(I)}return Ts(this,o.getType()),()=>{_.forEach(I=>I.transforms.delete(a))}}hasNode(o){return this._nodes.has(o.getType())}hasNodes(o){return o.every(this.hasNode.bind(this))}dispatchCommand(o,a){return st(this,o,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(o){const a=this._rootElement;if(o!==a){const f=Hi(this._config.theme,"root"),_=this._pendingEditorState||this._editorState;if(this._rootElement=o,cf(this,a,o,_),a!==null&&(this._config.disableEvents||ke(a),f!=null&&a.classList.remove(...f)),o!==null){const E=uo(o),I=o.style;I.userSelect="text",I.whiteSpace="pre-wrap",I.wordBreak="break-word",o.setAttribute("data-lexical-editor","true"),this._window=E,this._dirtyType=dt,qn(this),this._updateTags.add("history-merge"),ns(this),this._config.disableEvents||Ke(o,this),f!=null&&o.classList.add(...f)}else this._editorState=_,this._pendingEditorState=null,this._window=null;Pl("root",this,!1,o,a)}}getElementByKey(o){return this._keyToDOMMap.get(o)||null}getEditorState(){return this._editorState}setEditorState(o,a){if(o.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");mi(this);const f=this._pendingEditorState,_=this._updateTags,E=a!==void 0?a.tag:null;f!==null&&!f.isEmpty()&&(E!=null&&_.add(E),ns(this)),this._pendingEditorState=o,this._dirtyType=dt,this._dirtyElements.set("root",!1),this._compositionKey=null,E!=null&&_.add(E),ns(this)}parseEditorState(o,a){const f=typeof o=="string"?JSON.parse(o):o;return R_(f,this,a)}update(o,a){Rr(this,o,a)}focus(o,a={}){const f=this._rootElement;f!==null&&(f.setAttribute("autocapitalize","off"),Rr(this,()=>{const _=cn(),E=Zn();_!==null?_.dirty=!0:E.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?E.selectStart():E.selectEnd())},{onUpdate:()=>{f.removeAttribute("autocapitalize"),o&&o()},tag:"focus"}),this._pendingEditorState===null&&f.removeAttribute("autocapitalize"))}blur(){const o=this._rootElement;o!==null&&o.blur();const a=_r(this._window);a!==null&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(o){this._editable!==o&&(this._editable=o,Pl("editable",this,!0,o))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Uc extends rs{constructor(o,a){super(a),this.__colSpan=o,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(o){return this.getWritable().__colSpan=o,this}getRowSpan(){return this.__rowSpan}setRowSpan(o){return this.getWritable().__rowSpan=o,this}}function Gr(u){return u instanceof Uc}class uf extends rs{}function Gc(u){return u instanceof uf}class df extends rs{}function $l(u){return u instanceof df}return Pe.$INTERNAL_isPointSelection=Cr,Pe.$addUpdateTag=Ti,Pe.$applyNodeReplacement=fo,Pe.$copyNode=vl,Pe.$createLineBreakNode=Oi,Pe.$createNodeSelection=$c,Pe.$createParagraphNode=qi,Pe.$createRangeSelection=N_,Pe.$createTabNode=Yi,Pe.$createTextNode=Wn,Pe.$getAdjacentNode=ri,Pe.$getNearestNodeFromDOMNode=mr,Pe.$getNearestRootOrShadowRoot=Dr,Pe.$getNodeByKey=En,Pe.$getPreviousSelection=Hs,Pe.$getRoot=Zn,Pe.$getSelection=cn,Pe.$getTextContent=S_,Pe.$hasAncestor=ht,Pe.$hasUpdateTag=Ic,Pe.$insertNodes=v_,Pe.$isBlockElementNode=y_,Pe.$isDecoratorNode=Sn,Pe.$isElementNode=Je,Pe.$isInlineElementOrDecoratorNode=va,Pe.$isLeafNode=_i,Pe.$isLineBreakNode=Di,Pe.$isNodeSelection=Er,Pe.$isParagraphNode=H_,Pe.$isRangeSelection=pt,Pe.$isRootNode=br,Pe.$isRootOrShadowRoot=Fr,Pe.$isTabNode=es,Pe.$isTextNode=gt,Pe.$nodesOfType=xl,Pe.$normalizeSelection__EXPERIMENTAL=Bi,Pe.$parseSerializedNode=M_,Pe.$selectAll=Tl,Pe.$setCompositionKey=_n,Pe.$setSelection=Or,Pe.$splitNode=Ds,Pe.BLUR_COMMAND=Z,Pe.CAN_REDO_COMMAND=m,Pe.CAN_UNDO_COMMAND=y,Pe.CLEAR_EDITOR_COMMAND=Q,Pe.CLEAR_HISTORY_COMMAND=k,Pe.CLICK_COMMAND=n,Pe.COMMAND_PRIORITY_CRITICAL=G_,Pe.COMMAND_PRIORITY_EDITOR=W_,Pe.COMMAND_PRIORITY_HIGH=U_,Pe.COMMAND_PRIORITY_LOW=K_,Pe.COMMAND_PRIORITY_NORMAL=z_,Pe.CONTROLLED_TEXT_INSERTION_COMMAND=g,Pe.COPY_COMMAND=ne,Pe.CUT_COMMAND=Y,Pe.DELETE_CHARACTER_COMMAND=r,Pe.DELETE_LINE_COMMAND=T,Pe.DELETE_WORD_COMMAND=v,Pe.DEPRECATED_$computeGridMap=qd,Pe.DEPRECATED_$createGridSelection=C_,Pe.DEPRECATED_$getGridCellNodeRect=ji,Pe.DEPRECATED_$getNodeTriplet=Zd,Pe.DEPRECATED_$isGridCellNode=Gr,Pe.DEPRECATED_$isGridNode=Gc,Pe.DEPRECATED_$isGridRowNode=$l,Pe.DEPRECATED_$isGridSelection=cr,Pe.DEPRECATED_GridCellNode=Uc,Pe.DEPRECATED_GridNode=uf,Pe.DEPRECATED_GridRowNode=df,Pe.DRAGEND_COMMAND=V,Pe.DRAGOVER_COMMAND=D,Pe.DRAGSTART_COMMAND=K,Pe.DROP_COMMAND=pe,Pe.DecoratorNode=Kc,Pe.ElementNode=rs,Pe.FOCUS_COMMAND=M,Pe.FORMAT_ELEMENT_COMMAND=ue,Pe.FORMAT_TEXT_COMMAND=O,Pe.INDENT_CONTENT_COMMAND=me,Pe.INSERT_LINE_BREAK_COMMAND=c,Pe.INSERT_PARAGRAPH_COMMAND=d,Pe.INSERT_TAB_COMMAND=q,Pe.KEY_ARROW_DOWN_COMMAND=B,Pe.KEY_ARROW_LEFT_COMMAND=W,Pe.KEY_ARROW_RIGHT_COMMAND=w,Pe.KEY_ARROW_UP_COMMAND=H,Pe.KEY_BACKSPACE_COMMAND=ee,Pe.KEY_DELETE_COMMAND=j,Pe.KEY_DOWN_COMMAND=x,Pe.KEY_ENTER_COMMAND=z,Pe.KEY_ESCAPE_COMMAND=le,Pe.KEY_MODIFIER_COMMAND=ae,Pe.KEY_SPACE_COMMAND=X,Pe.KEY_TAB_COMMAND=U,Pe.LineBreakNode=Wr,Pe.MOVE_TO_END=$,Pe.MOVE_TO_START=P,Pe.OUTDENT_CONTENT_COMMAND=_e,Pe.PASTE_COMMAND=p,Pe.ParagraphNode=zs,Pe.REDO_COMMAND=b,Pe.REMOVE_TEXT_COMMAND=C,Pe.RootNode=Ks,Pe.SELECTION_CHANGE_COMMAND=e,Pe.SELECT_ALL_COMMAND=G,Pe.TabNode=Ai,Pe.TextNode=Gi,Pe.UNDO_COMMAND=R,Pe.createCommand=t,Pe.createEditor=j_,Pe.getNearestEditorFromDOMNode=Lo,Pe.isHTMLAnchorElement=Go,Pe.isHTMLElement=Yo,Pe.isSelectionCapturedInDecoratorInput=io,Pe.isSelectionWithinEditor=Qr,Pe}var $e={},bf;function FN(){if(bf)return $e;bf=1;let t={},e={},n={},r={},c={},d={},g={},p={},C={},v={},T={},O={},R={},b={},x={},w={},$={},W={},P={},H={},B={},z={},X={},ee={},le={},j={},U={},q={},me={},_e={},pe={},ue={},K={},D={},V={},ne={};function Y(l){let i=new URLSearchParams;i.append("code",l);for(let s=1;s<arguments.length;s++)i.append("v",arguments[s]);throw Error(`Minified Lexical error #${l}; visit https://lexical.dev/docs/error?${i} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q=G&&"documentMode"in document?document.documentMode:null,k=G&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),m=G&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),y=G&&"InputEvent"in window&&!Q?"getTargetRanges"in new window.InputEvent("input"):!1,M=G&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Z=G&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ae=G&&/Android/.test(navigator.userAgent),he=G&&/^(?=.*Chrome).*/i.test(navigator.userAgent),se=G&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!he,Te=M||Z||se?" ":"​",be=m?" ":Te,Ue=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,re=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,te={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ce={directionless:1,unmergeable:2},we={center:2,end:6,justify:4,left:1,right:3,start:5},Le={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Be={normal:0,segmented:2,token:1},Ye={0:"normal",2:"segmented",1:"token"},ct=!1,yt=0;function dt(l){yt=l.timeStamp}function ve(l,i,s){return i.__lexicalLineBreak===l||l[`__lexicalKey_${s._key}`]!==void 0}function ie(l){return l.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function fe(l,i,s){ct=!0;let h=100<performance.now()-yt;try{sr(l,()=>{let N=Vt()||ie(l);var S=new Map,A=l.getRootElement(),J=l._editorState,ge=l._blockCursorElement;let Se=!1,Fe="";for(var Ke=0;Ke<i.length;Ke++){var ke=i[Ke],Ae=ke.type,Xe=ke.target,ut=Sr(Xe,J);if(!(ut===null&&Xe!==A||an(ut))){if(Ae==="characterData"){if(ke=h&&ht(ut))e:{ke=N,Ae=Xe;var Tt=ut;if(wt(ke)){var Mt=ke.anchor.getNode();if(Mt.is(Tt)&&ke.format!==Mt.getFormat()){ke=!1;break e}}ke=Ae.nodeType===3&&Tt.isAttached()}ke&&(Tt=kr(l._window),Ae=ke=null,Tt!==null&&Tt.anchorNode===Xe&&(ke=Tt.anchorOffset,Ae=Tt.focusOffset),Xe=Xe.nodeValue,Xe!==null&&Nt(ut,Xe,ke,Ae,!1))}else if(Ae==="childList"){for(Se=!0,Ae=ke.addedNodes,Tt=0;Tt<Ae.length;Tt++){Mt=Ae[Tt];var hn=hr(Mt),ar=Mt.parentNode;ar==null||Mt===ge||hn!==null||Mt.nodeName==="BR"&&ve(Mt,ar,l)||(m&&(hn=Mt.innerText||Mt.nodeValue)&&(Fe+=hn),ar.removeChild(Mt))}if(ke=ke.removedNodes,Ae=ke.length,0<Ae){for(Tt=0,Mt=0;Mt<Ae;Mt++)ar=ke[Mt],(ar.nodeName==="BR"&&ve(ar,Xe,l)||ge===ar)&&(Xe.appendChild(ar),Tt++);Ae!==Tt&&(Xe===A&&(ut=J._nodeMap.get("root")),S.set(Xe,ut))}}}}if(0<S.size)for(let[Wr,si]of S)if(Ze(si))for(S=si.getChildrenKeys(),A=Wr.firstChild,J=0;J<S.length;J++)ge=l.getElementByKey(S[J]),ge!==null&&(A==null?(Wr.appendChild(ge),A=ge):A!==ge&&Wr.replaceChild(ge,A),A=A.nextSibling);else ht(si)&&si.markDirty();if(S=s.takeRecords(),0<S.length){for(A=0;A<S.length;A++)for(ge=S[A],J=ge.addedNodes,ge=ge.target,Ke=0;Ke<J.length;Ke++)ut=J[Ke],Xe=ut.parentNode,Xe==null||ut.nodeName!=="BR"||ve(ut,ge,l)||Xe.removeChild(ut);s.takeRecords()}N!==null&&(Se&&(N.dirty=!0,gr(N)),m&&sn(l)&&N.insertRawText(Fe))})}finally{ct=!1}}function Oe(l){let i=l._observer;if(i!==null){let s=i.takeRecords();fe(l,s,i)}}function Re(l){yt===0&&qn(l).addEventListener("textInput",dt,!0),l._observer=new MutationObserver((i,s)=>{fe(l,i,s)})}function De(l,i){let s=l.__mode,h=l.__format;l=l.__style;let N=i.__mode,S=i.__format;return i=i.__style,(s===null||s===N)&&(h===null||h===S)&&(l===null||l===i)}function We(l,i){let s=l.mergeWithSibling(i),h=ln()._normalizedNodes;return h.add(l.__key),h.add(i.__key),s}function qe(l){if(l.__text===""&&l.isSimpleText()&&!l.isUnmergeable())l.remove();else{for(var i;(i=l.getPreviousSibling())!==null&&ht(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{De(i,l)&&(l=We(i,l));break}for(var s;(s=l.getNextSibling())!==null&&ht(s)&&s.isSimpleText()&&!s.isUnmergeable();)if(s.__text==="")s.remove();else{De(l,s)&&We(l,s);break}}}function Qe(l){return ft(l.anchor),ft(l.focus),l}function ft(l){for(;l.type==="element";){var i=l.getNode(),s=l.offset;if(s===i.getChildrenSize()?(i=i.getChildAtIndex(s-1),s=!0):(i=i.getChildAtIndex(s),s=!1),ht(i)){l.set(i.__key,s?i.getTextContentSize():0,"text");break}else if(!Ze(i))break;l.set(i.__key,s?i.getChildrenSize():0,"element")}}let kt=1,je=typeof queueMicrotask=="function"?queueMicrotask:l=>{Promise.resolve().then(l)};function Ve(l){let i=document.activeElement;if(i===null)return!1;let s=i.nodeName;return an(Sr(l))&&(s==="INPUT"||s==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function rt(l,i,s){let h=l.getRootElement();try{return h!==null&&h.contains(i)&&h.contains(s)&&i!==null&&!Ve(i)&&_t(i)===l}catch{return!1}}function _t(l){for(;l!=null;){let i=l.__lexicalEditor;if(i!=null)return i;l=pr(l)}return null}function Et(l){return l.isToken()||l.isSegmented()}function St(l){for(;l!=null;){if(l.nodeType===3)return l;l=l.firstChild}return null}function Ot(l,i,s){let h=te[i];return s!==null&&(l&h)===(s&h)||(l^=h,i==="subscript"?l&=~te.superscript:i==="superscript"&&(l&=~te.subscript)),l}function At(l,i){if(i!=null)l.__key=i;else{Jn(),99<mo&&Y(14),i=ln();var s=yr(),h=""+kt++;s._nodeMap.set(h,l),Ze(l)?i._dirtyElements.set(h,!0):i._dirtyLeaves.add(h),i._cloneNotNeeded.add(h),i._dirtyType=1,l.__key=h}}function xt(l){var i=l.getParent();if(i!==null){let N=l.getWritable();i=i.getWritable();var s=l.getPreviousSibling();if(l=l.getNextSibling(),s===null)if(l!==null){var h=l.getWritable();i.__first=l.__key,h.__prev=null}else i.__first=null;else{if(h=s.getWritable(),l!==null){let S=l.getWritable();S.__prev=h.__key,h.__next=S.__key}else h.__next=null;N.__prev=null}l===null?s!==null?(l=s.getWritable(),i.__last=s.__key,l.__next=null):i.__last=null:(l=l.getWritable(),s!==null?(s=s.getWritable(),s.__next=l.__key,l.__prev=s.__key):l.__prev=null,N.__next=null),i.__size--,N.__parent=null}}function Qt(l){99<mo&&Y(14);var i=l.getLatest(),s=i.__parent,h=yr();let N=ln(),S=h._nodeMap;if(h=N._dirtyElements,s!==null)e:for(;s!==null;){if(h.has(s))break e;let A=S.get(s);if(A===void 0)break;h.set(s,!1),s=A.__parent}i=i.__key,N._dirtyType=1,Ze(l)?h.set(i,!0):N._dirtyLeaves.add(i)}function bt(l){Jn();var i=ln();let s=i._compositionKey;l!==s&&(i._compositionKey=l,s!==null&&(i=It(s),i!==null&&i.getWritable()),l!==null&&(l=It(l),l!==null&&l.getWritable()))}function Ut(){return oi()?null:ln()._compositionKey}function It(l,i){return l=(i||yr())._nodeMap.get(l),l===void 0?null:l}function hr(l,i){let s=ln();return l=l[`__lexicalKey_${s._key}`],l!==void 0?It(l,i):null}function Sr(l,i){for(;l!=null;){let s=hr(l,i);if(s!==null)return s;l=pr(l)}return null}function Fi(l){let i=Object.assign({},l._decorators);return l._pendingDecorators=i}function ps(l){return l.read(()=>fn().getTextContent())}function ms(l,i){sr(l,()=>{var s=yr();if(!s.isEmpty())if(i==="root")fn().markDirty();else{s=s._nodeMap;for(let[,h]of s)h.markDirty()}},l._pendingEditorState===null?{tag:"history-merge"}:void 0)}function fn(){return yr()._nodeMap.get("root")}function gr(l){Jn();let i=yr();l!==null&&(l.dirty=!0,l.setCachedNodes(null)),i._selection=l}function Jr(l){var i=ln(),s;e:{for(s=l;s!=null;){let h=s[`__lexicalKey_${i._key}`];if(h!==void 0){s=h;break e}s=pr(s)}s=null}return s===null?(i=i.getRootElement(),l===i?It("root"):null):It(s)}function _s(l){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(l)}function ye(l){let i=[];for(;l!==null;)i.push(l),l=l._parentEditor;return i}function Ge(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function nt(l,i,s){if(i=kr(i._window),i!==null){var h=i.anchorNode,{anchorOffset:N,focusOffset:S}=i;if(h!==null&&(i=h.nodeType===3?h.nodeValue:null,h=Sr(h),i!==null&&ht(h))){if(i===Te&&s){let A=s.length;i=s,S=N=A}i!==null&&Nt(h,i,N,S,l)}}}function Nt(l,i,s,h,N){let S=l;if(S.isAttached()&&(N||!S.isDirty())){let Se=S.isComposing(),Fe=i;if((Se||N)&&i[i.length-1]===Te&&(Fe=i.slice(0,-1)),i=S.getTextContent(),N||Fe!==i)if(Fe==="")if(bt(null),M||Z||se)S.remove();else{let Ke=ln();setTimeout(()=>{Ke.update(()=>{S.isAttached()&&S.remove()})},20)}else{N=S.getParent(),i=Ui();var A=S.getTextContentSize(),J=Ut(),ge=S.getKey();S.isToken()||J!==null&&ge===J&&!Se||wt(i)&&(N!==null&&!N.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===l.__key&&i.anchor.offset===0&&!S.canInsertTextBefore()||i.focus.key===l.__key&&i.focus.offset===A&&!S.canInsertTextAfter())?S.markDirty():(l=Vt(),wt(l)&&s!==null&&h!==null&&(l.setTextNodeRange(S,s,S,h),S.isSegmented()&&(s=S.getTextContent(),s=Bn(s),S.replace(s),S=s)),S.setTextContent(Fe))}}}function Ht(l,i){if(i.isSegmented())return!0;if(!l.isCollapsed())return!1;l=l.anchor.offset;let s=i.getParentOrThrow(),h=i.isToken();return l===0?((l=!i.canInsertTextBefore()||!s.canInsertTextBefore()||h)||(i=i.getPreviousSibling(),l=(ht(i)||Ze(i)&&i.isInline())&&!i.canInsertTextAfter()),l):l===i.getTextContentSize()?!i.canInsertTextAfter()||!s.canInsertTextAfter()||h:!1}function Kt(l,i){l.__lexicalClassNameCache===void 0&&(l.__lexicalClassNameCache={});let s=l.__lexicalClassNameCache,h=s[i];return h!==void 0?h:(l=l[i],typeof l=="string"?(l=l.split(" "),s[i]=l):l)}function $t(l,i,s,h,N){s.size!==0&&(s=h.__type,h=h.__key,i=i.get(s),i===void 0&&Y(33,s),s=i.klass,i=l.get(s),i===void 0&&(i=new Map,l.set(s,i)),l=i.get(h),s=l==="destroyed"&&N==="created",(l===void 0||s)&&i.set(h,s?"updated":N))}function Pt(l,i,s){let h=l.getParent(),N=s;return h!==null&&(i&&s===0?(N=l.getIndexWithinParent(),l=h):i||s!==l.getChildrenSize()||(N=l.getIndexWithinParent()+1,l=h)),l.getChildAtIndex(i?N-1:N)}function mn(l,i){var s=l.offset;return l.type==="element"?(l=l.getNode(),Pt(l,i,s)):(l=l.getNode(),i&&s===0||!i&&s===l.getTextContentSize()?(s=i?l.getPreviousSibling():l.getNextSibling(),s===null?Pt(l.getParentOrThrow(),i,l.getIndexWithinParent()+(i?0:1)):s):null)}function sn(l){return l=(l=qn(l).event)&&l.inputType,l==="insertFromPaste"||l==="insertFromPasteAsQuotation"}function nn(l){return!tr(l)&&!l.isLastChild()&&!l.isInline()}function $n(l,i){return l=l._keyToDOMMap.get(i),l===void 0&&Y(75,i),l}function pr(l){return l=l.assignedSlot||l.parentElement,l!==null&&l.nodeType===11?l.host:l}function mi(l,i){for(l=l.getParent();l!==null;){if(l.is(i))return!0;l=l.getParent()}return!1}function qn(l){return l=l._window,l===null&&Y(78),l}function ul(l){for(l=l.getParentOrThrow();l!==null&&!Xr(l);)l=l.getParentOrThrow();return l}function Xr(l){return tr(l)||Ze(l)&&l.isShadowRoot()}function dl(l){return l=l.constructor.clone(l),At(l,null),l}function Bi(l){var i=ln();let s=l.constructor.getType();return i=i._nodes.get(s),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(l),i instanceof l.constructor||Y(98),i):l}function ys(l,i){l=l.getParent(),!tr(l)||Ze(i)||an(i)||Y(99)}function fl(l){return(an(l)||Ze(l)&&!l.canBeEmpty())&&!l.isInline()}function hl(l,i,s){s.style.removeProperty("caret-color"),i._blockCursorElement=null,i=l.parentElement,i!==null&&i.removeChild(l)}function kr(l){return G?(l||window).getSelection():null}function Ns(l,i){for(;l!==fn()&&l!=null;){if(i(l))return l;l=l.getParent()}return null}function wc(l){let i=[],s=[l];for(;0<s.length;){let h=s.pop();h===void 0&&Y(112),Ze(h)&&s.unshift(...h.getChildren()),h!==l&&i.push(h)}return i}function io(l){return l.nodeType===1}function Qr(l){if(an(l)&&!l.isInline())return!0;if(!Ze(l)||Xr(l))return!1;var i=l.getFirstChild();return i=i===null||Ei(i)||ht(i)||i.isInline(),!l.isInline()&&l.canBeEmpty()!==!1&&i}function Lo(l,i){for(;l!==null&&l.getParent()!==null&&!i(l);)l=l.getParentOrThrow();return i(l)?l:null}function la(l,i,s,h,N,S){for(l=l.getFirstChild();l!==null;){let A=l.__key;l.__parent===i&&(Ze(l)&&la(l,A,s,h,N,S),s.has(A)||S.delete(A),N.push(A)),l=l.getNextSibling()}}function gl(l,i,s,h){l=l._nodeMap,i=i._nodeMap;let N=[];for(let[S]of h){let A=i.get(S);A===void 0||A.isAttached()||(Ze(A)&&la(A,S,l,i,N,h),l.has(S)||h.delete(S),N.push(S))}for(let S of N)i.delete(S);for(let S of s)h=i.get(S),h===void 0||h.isAttached()||(l.has(S)||s.delete(S),i.delete(S))}let On="",Ln="",wr="",_i,Fn,ko,yi=!1,oo=!1,Cs,_n=null,Ir,En,Ni,mr,Es,so;function Ts(l,i){let s=Ni.get(l);if(i!==null){let h=ml(l);h.parentNode===i&&i.removeChild(h)}mr.has(l)||Fn._keyToDOMMap.delete(l),Ze(s)&&(l=Io(s,Ni),Zn(l,0,l.length-1,null)),s!==void 0&&$t(so,ko,Cs,s,"destroyed")}function Zn(l,i,s,h){for(;i<=s;++i){let N=l[i];N!==void 0&&Ts(N,h)}}function Ci(l,i){l.setProperty("text-align",i)}function Or(l,i){var s=_i.theme.indent;if(typeof s=="string"){let h=l.classList.contains(s);0<i&&!h?l.classList.add(s):1>i&&h&&l.classList.remove(s)}s=getComputedStyle(l).getPropertyValue("--lexical-indent-base-value")||"40px",l.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${s})`)}function aa(l,i){l=l.style,i===0?Ci(l,""):i===1?Ci(l,"left"):i===2?Ci(l,"center"):i===3?Ci(l,"right"):i===4?Ci(l,"justify"):i===5?Ci(l,"start"):i===6&&Ci(l,"end")}function ei(l,i,s){let h=mr.get(l);h===void 0&&Y(60);let N=h.createDOM(_i,Fn);var S=Fn._keyToDOMMap;if(N["__lexicalKey_"+Fn._key]=l,S.set(l,N),ht(h)?N.setAttribute("data-lexical-text","true"):an(h)&&N.setAttribute("data-lexical-decorator","true"),Ze(h)){if(l=h.__indent,S=h.__size,l!==0&&Or(N,l),S!==0){--S,l=Io(h,mr);var A=Ln;Ln="",xs(l,h,0,S,N,null),vs(h,N),Ln=A}l=h.__format,l!==0&&aa(N,l),h.isInline()||pl(null,h,N),nn(h)&&(On+=`
41
+ `?f.push(Oi()):I===" "?f.push(Yi()):f.push(Wn(I))}this.insertNodes(f)}insertText(o){const a=this.anchor,f=this.focus,_=this.isCollapsed()||a.isBefore(f),E=this.format,I=this.style;_&&a.type==="element"?Il(a,f,E,I):!_&&f.type==="element"&&Il(f,a,E,I);const F=this.getNodes(),oe=F.length,de=_?a:f,Ne=_?f:a,Ee=de.offset,xe=Ne.offset;let Ce=F[0];if(!gt(Ce))throw Error("insertText: first node is not a text node");const Ie=Ce.getTextContent().length,Me=Ce.getParentOrThrow(),mt=oe-1;let ze=F[mt];if(this.isCollapsed()&&Ee===Ie&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!Me.canInsertTextAfter()&&Ce.getNextSibling()===null)){let tt=Ce.getNextSibling();if((!gt(tt)||!tt.canInsertTextBefore()||gl(tt))&&(tt=Wn(),tt.setFormat(E),Me.canInsertTextAfter()?Ce.insertAfter(tt):Me.insertAfter(tt)),tt.select(0,0),Ce=tt,o!==""){this.insertText(o);return}}else if(this.isCollapsed()&&Ee===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!Me.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let tt=Ce.getPreviousSibling();if((!gt(tt)||gl(tt))&&(tt=Wn(),tt.setFormat(E),Me.canInsertTextBefore()?Ce.insertBefore(tt):Me.insertBefore(tt)),tt.select(),Ce=tt,o!==""){this.insertText(o);return}}else if(Ce.isSegmented()&&Ee!==Ie){const tt=Wn(Ce.getTextContent());tt.setFormat(E),Ce.replace(tt),Ce=tt}else if(!this.isCollapsed()&&o!==""){const tt=ze.getParent();if(!Me.canInsertTextBefore()||!Me.canInsertTextAfter()||Je(tt)&&(!tt.canInsertTextBefore()||!tt.canInsertTextAfter())){this.insertText(""),Ud(this.anchor,this.focus,null),this.insertText(o);return}}if(oe===1){if(Ce.isToken()){const Ct=Wn(o);Ct.select(),Ce.replace(Ct);return}const tt=Ce.getFormat(),Ft=Ce.getStyle();if(Ee===xe&&(tt!==E||Ft!==I))if(Ce.getTextContent()==="")Ce.setFormat(E),Ce.setStyle(I);else{const Ct=Wn(o);if(Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ee===0)Ce.insertBefore(Ct,!1);else{const[vt]=Ce.splitText(Ee);vt.insertAfter(Ct,!1)}Ct.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);return}else if(es(Ce)){const Ct=Wn(o);Ct.setFormat(E),Ct.setStyle(I),Ct.select(),Ce.replace(Ct);return}const Rt=xe-Ee;Ce=Ce.spliceText(Ee,Rt,o,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=o.length:(this.format=tt,this.style=Ft))}else{const tt=new Set([...Ce.getParentKeys(),...ze.getParentKeys()]),Ft=Je(Ce)?Ce:Ce.getParentOrThrow();let Rt=Je(ze)?ze:ze.getParentOrThrow(),Ct=ze;if(!Ft.is(Rt)&&Rt.isInline())do Ct=Rt,Rt=Rt.getParentOrThrow();while(Rt.isInline());if(Ne.type==="text"&&(xe!==0||ze.getTextContent()==="")||Ne.type==="element"&&ze.getIndexWithinParent()<xe)if(gt(ze)&&!ze.isToken()&&xe!==ze.getTextContentSize()){if(ze.isSegmented()){const qt=Wn(ze.getTextContent());ze.replace(qt),ze=qt}!br(Ne.getNode())&&Ne.type==="text"&&(ze=ze.spliceText(0,xe,"")),tt.add(ze.__key)}else{const qt=ze.getParentOrThrow();!qt.canBeEmpty()&&qt.getChildrenSize()===1?qt.remove():ze.remove()}else tt.add(ze.__key);const vt=Rt.getChildren(),Wt=new Set(F),Zt=Ft.is(Rt),pn=Ft.isInline()&&Ce.getNextSibling()===null?Ft:Ce;for(let qt=vt.length-1;qt>=0;qt--){const Dn=vt[qt];if(Dn.is(Ce)||Je(Dn)&&Dn.isParentOf(Ce))break;Dn.isAttached()&&(!Wt.has(Dn)||Dn.is(Ct)?Zt||pn.insertAfter(Dn,!1):Dn.remove())}if(!Zt){let qt=Rt,Dn=null;for(;qt!==null;){const ai=qt.getChildren(),Zi=ai.length;(Zi===0||ai[Zi-1].is(Dn))&&(tt.delete(qt.__key),Dn=qt),qt=qt.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(Ee,Ie-Ee,o,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);else if(Ee===Ie)Ce.select();else{const qt=Wn(o);qt.select(),Ce.replace(qt)}for(let qt=1;qt<oe;qt++){const Dn=F[qt],ai=Dn.__key;tt.has(ai)||Dn.remove()}}}removeText(){this.insertText("")}formatText(o){if(this.isCollapsed()){this.toggleFormat(o),_n(null);return}const a=this.getNodes(),f=[];for(const ze of a)gt(ze)&&f.push(ze);const _=f.length;if(_===0){this.toggleFormat(o),_n(null);return}const E=this.anchor,I=this.focus,F=this.isBackward(),oe=F?I:E,de=F?E:I;let Ne=0,Ee=f[0],xe=oe.type==="element"?0:oe.offset;if(oe.type==="text"&&xe===Ee.getTextContentSize()&&(Ne=1,Ee=f[1],xe=0),Ee==null)return;const Ce=Ee.getFormatFlags(o,null),He=_-1;let Ie=f[He];const Me=de.type==="text"?de.offset:Ie.getTextContentSize();if(Ee.is(Ie)){if(xe===Me)return;if(xe===0&&Me===Ee.getTextContentSize())Ee.setFormat(Ce);else{const ze=Ee.splitText(xe,Me),tt=xe===0?ze[0]:ze[1];tt.setFormat(Ce),oe.type==="text"&&oe.set(tt.__key,0,"text"),de.type==="text"&&de.set(tt.__key,Me-xe,"text")}this.format=Ce;return}xe!==0&&([,Ee]=Ee.splitText(xe),xe=0),Ee.setFormat(Ce);const mt=Ie.getFormatFlags(o,Ce);Me>0&&(Me!==Ie.getTextContentSize()&&([Ie]=Ie.splitText(Me)),Ie.setFormat(mt));for(let ze=Ne+1;ze<He;ze++){const tt=f[ze];if(!tt.isToken()){const Ft=tt.getFormatFlags(o,mt);tt.setFormat(Ft)}}oe.type==="text"&&oe.set(Ee.__key,xe,"text"),de.type==="text"&&de.set(Ie.__key,Me,"text"),this.format=Ce|mt}insertNodes(o){if(o.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const Me=cn();if(!pt(Me))throw Error("Expected RangeSelection after insertParagraph");return Me.insertNodes(o)}const a=As(this.anchor.getNode(),zi),f=o[o.length-1];if("__language"in a){if("__language"in o[0])this.insertText(o[0].getTextContent());else{const Me=Bc(this);a.splice(Me,0,o),f.selectEnd()}return}const _=Me=>(Je(Me)||Sn(Me))&&!Me.isInline();if(!o.some(_)){const Me=Bc(this);a.splice(Me,0,o),f.selectEnd();return}const E=w_(o),I=E.getLastDescendant(),F=E.getChildren(),oe=Me=>"__value"in Me&&"__checked"in Me,de=Me=>Je(Me)&&zi(Me)&&!Me.isEmpty()&&Je(a)&&(!a.isEmpty()||oe(a)),Ee=!Je(a)||!a.isEmpty()?this.insertParagraph():null,xe=F[F.length-1];let Ce=F[0];de(Ce)&&(a.append(...Ce.getChildren()),Ce=F[1]),Ce&&ar(a,Ce);const He=As(I,zi);Ee&&Je(He)&&(oe(Ee)||zi(xe))&&(He.append(...Ee.getChildren()),Ee.remove()),Je(a)&&a.isEmpty()&&a.remove(),I.selectEnd();const Ie=Je(a)?a.getLastChild():null;Di(Ie)&&He!==a&&Ie.remove()}insertParagraph(){if(this.anchor.key==="root"){const I=qi();return Zn().splice(this.anchor.offset,0,[I]),I.select(),I}const o=Bc(this),a=As(this.anchor.getNode(),zi),f=a.getChildAtIndex(o),_=f?[f,...f.getNextSiblings()]:[],E=a.insertNewAfter(this,!1);return E?(E.append(..._),E.selectStart(),E):null}insertLineBreak(o){const a=Oi();if(this.insertNodes([a]),o){const f=a.getParentOrThrow(),_=a.getIndexWithinParent();f.select(_,_)}}extract(){const o=this.getNodes(),a=o.length,f=a-1,_=this.anchor,E=this.focus;let I=o[0],F=o[f];const[oe,de]=er(this);if(a===0)return[];if(a===1){if(gt(I)&&!this.isCollapsed()){const Ee=oe>de?de:oe,xe=oe>de?oe:de,Ce=I.splitText(Ee,xe),He=Ee===0?Ce[0]:Ce[1];return He!=null?[He]:[]}return[I]}const Ne=_.isBefore(E);if(gt(I)){const Ee=Ne?oe:de;Ee===I.getTextContentSize()?o.shift():Ee!==0&&([,I]=I.splitText(Ee),o[0]=I)}if(gt(F)){const xe=F.getTextContent().length,Ce=Ne?de:oe;Ce===0?o.pop():Ce!==xe&&([F]=F.splitText(Ce),o[f]=F)}return o}modify(o,a,f){const _=this.focus,E=this.anchor,I=o==="move",F=ri(_,a);if(Sn(F)&&!F.isIsolated()){if(I&&F.isKeyboardSelectable()){const Ce=$c();Ce.add(F.__key),Or(Ce);return}const xe=a?F.getPreviousSibling():F.getNextSibling();if(gt(xe)){const Ce=xe.__key,He=a?xe.getTextContent().length:0;_.set(Ce,He,"text"),I&&E.set(Ce,He,"text");return}else{const Ce=F.getParentOrThrow();let He,Ie;Je(xe)?(Ie=xe.__key,He=a?xe.getChildrenSize():0):(He=F.getIndexWithinParent(),Ie=Ce.__key,a||He++),_.set(Ie,He,"element"),I&&E.set(Ie,He,"element");return}}const oe=gn(),de=_r(oe._window);if(!de)return;const Ne=oe._blockCursorElement,Ee=oe._rootElement;if(Ee!==null&&Ne!==null&&Je(F)&&!F.isInline()&&!F.canBeEmpty()&&wt(Ne,oe,Ee),Bs(de,o,a?"backward":"forward",f),de.rangeCount>0){const xe=de.getRangeAt(0),Ce=this.anchor.getNode(),He=br(Ce)?Ce:Dr(Ce);if(this.applyDOMRange(xe),this.dirty=!0,!I){const Ie=this.getNodes(),Me=[];let mt=!1;for(let ze=0;ze<Ie.length;ze++){const tt=Ie[ze];ht(tt,He)?Me.push(tt):mt=!0}if(mt&&Me.length>0)if(a){const ze=Me[0];Je(ze)?ze.selectStart():ze.getParentOrThrow().selectStart()}else{const ze=Me[Me.length-1];Je(ze)?ze.selectEnd():ze.getParentOrThrow().selectEnd()}(de.anchorNode!==xe.startContainer||de.anchorOffset!==xe.startOffset)&&Vi(this)}}}deleteCharacter(o){const a=this.isCollapsed();if(this.isCollapsed()){const f=this.anchor,_=this.focus;let E=f.getNode();if(!o&&(f.type==="element"&&Je(E)&&f.offset===E.getChildrenSize()||f.type==="text"&&f.offset===E.getTextContentSize())){const F=E.getParent(),oe=E.getNextSibling()||(F===null?null:F.getNextSibling());if(Je(oe)&&oe.isShadowRoot())return}const I=ri(_,o);if(Sn(I)&&!I.isIsolated()){if(I.isKeyboardSelectable()&&Je(E)&&E.getChildrenSize()===0){E.remove();const F=$c();F.add(I.__key),Or(F)}else I.remove(),gn().dispatchCommand(e,void 0);return}else if(!o&&Je(I)&&Je(E)&&E.isEmpty()){E.remove(),I.selectStart();return}if(this.modify("extend",o,"character"),this.isCollapsed()){if(o&&f.offset===0&&(f.type==="element"?f.getNode():f.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const F=_.type==="text"?_.getNode():null;if(E=f.type==="text"?f.getNode():null,F!==null&&F.isSegmented()){const oe=_.offset,de=F.getTextContentSize();if(F.is(E)||o&&oe!==de||!o&&oe!==0){Wd(F,o,oe);return}}else if(E!==null&&E.isSegmented()){const oe=f.offset,de=E.getTextContentSize();if(E.is(F)||o&&oe!==0||!o&&oe!==de){Wd(E,o,oe);return}}Wa(this,o)}}if(this.removeText(),o&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const f=this.anchor.getNode();f.isEmpty()&&br(f.getParent())&&f.getIndexWithinParent()===0&&f.collapseAtStart(this)}}deleteLine(o){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",o,"lineboundary"),(o?this.focus:this.anchor).offset===0&&this.modify("extend",o,"character")),this.removeText()}deleteWord(o){this.isCollapsed()&&this.modify("extend",o,"word"),this.removeText()}}function Er(u){return u instanceof kn}function Ri(u){const o=u.offset;if(u.type==="text")return o;const a=u.getNode();return o===a.getChildrenSize()?a.getTextContent().length:0}function er(u){const o=u.anchor,a=u.focus;return o.type==="element"&&a.type==="element"&&o.key===a.key&&o.offset===a.offset?[0,0]:[Ri(o),Ri(a)]}function Vi(u){const o=u.focus,a=u.anchor,f=a.key,_=a.offset,E=a.type;li(a,o.key,o.offset,o.type),li(o,f,_,E),u._cachedNodes=null}function Bs(u,o,a,f){u.modify(o,a,f)}function Wa(u,o){const a=u.anchor,f=u.focus,_=a.getNode(),E=f.getNode();if(_===E&&a.type==="text"&&f.type==="text"){const I=a.offset,F=f.offset,oe=I<F,de=oe?I:F,Ne=oe?F:I,Ee=Ne-1;if(de!==Ee){const xe=_.getTextContent().slice(de,Ne);pl(xe)||(o?f.offset=Ee:a.offset=Ee)}}}function Wd(u,o,a){const f=u,E=f.getTextContent().split(/(?=\s)/g),I=E.length;let F=0,oe=0;for(let Ne=0;Ne<I;Ne++){const Ee=E[Ne],xe=Ne===I-1;if(oe=F,F+=Ee.length,o&&F===a||F>a||xe){E.splice(Ne,1),xe&&(oe=void 0);break}}const de=E.join("").trim();de===""?f.remove():(f.setTextContent(de),f.select(oe,oe))}function __(u,o,a){const f=u.getParent();return a===null||f===null||!f.canBeEmpty()||f!==a.getNode()}function Kd(u,o,a,f){let _=o,E;if(u.nodeType===Be){let I=!1;const F=u.childNodes,oe=F.length;_===oe&&(I=!0,_=oe-1);let de=F[_],Ne=!1;if(de===f._blockCursorElement?(de=F[_+1],Ne=!0):f._blockCursorElement!==null&&_--,E=ei(de),gt(E))_=xs(E,I);else{let Ee=ei(u);if(Ee===null)return null;if(Je(Ee)){let xe=Ee.getChildAtIndex(_);if(Je(xe)&&__(xe,_,a)){const Ce=I?xe.getLastDescendant():xe.getFirstDescendant();Ce===null?(Ee=xe,_=0):(xe=Ce,Ee=Je(xe)?xe:xe.getParentOrThrow())}gt(xe)?(E=xe,Ee=null,_=xs(xe,I)):xe!==Ee&&I&&!Ne&&_++}else{const xe=Ee.getIndexWithinParent();o===0&&Sn(Ee)&&ei(u)===Ee?_=xe:_=xe+1,Ee=Ee.getParentOrThrow()}if(Je(Ee))return Ur(Ee.__key,_,"element")}}else E=ei(u);return gt(E)?Ur(E.__key,_,"text"):null}function zd(u,o,a){const f=u.offset,_=u.getNode();if(f===0){const E=_.getPreviousSibling(),I=_.getParent();if(!o)Je(E)&&!a&&E.isInline()?(u.key=E.__key,u.offset=E.getChildrenSize(),u.type="element"):gt(E)&&(u.key=E.__key,u.offset=E.getTextContent().length);else if((a||!o)&&E===null&&Je(I)&&I.isInline()){const F=I.getPreviousSibling();gt(F)&&(u.key=F.__key,u.offset=F.getTextContent().length)}}else if(f===_.getTextContent().length){const E=_.getNextSibling(),I=_.getParent();if(o&&Je(E)&&E.isInline())u.key=E.__key,u.offset=0,u.type="element";else if((a||o)&&E===null&&Je(I)&&I.isInline()&&!I.canInsertTextAfter()){const F=I.getNextSibling();gt(F)&&(u.key=F.__key,u.offset=0)}}}function Ud(u,o,a){if(u.type==="text"&&o.type==="text"){const f=u.isBefore(o),_=u.is(o);zd(u,f,_),zd(o,!f,_),_&&(o.key=u.key,o.offset=u.offset,o.type=u.type);const E=gn();if(E.isComposing()&&E._compositionKey!==u.key&&pt(a)){const I=a.anchor,F=a.focus;li(u,I.key,I.offset,I.type),li(o,F.key,F.offset,F.type)}}}function Gd(u,o,a,f,_,E){if(u===null||a===null||!Qr(_,u,a))return null;const I=Kd(u,o,pt(E)?E.anchor:null,_);if(I===null)return null;const F=Kd(a,f,pt(E)?E.focus:null,_);if(F===null)return null;if(I.type==="element"&&F.type==="element"){const oe=ei(u),de=ei(a);if(Sn(oe)&&Sn(de))return null}return Ud(I,F,E),[I,F]}function y_(u){return Je(u)&&!u.isInline()}function Yd(u,o,a,f,_,E){const I=bi(),F=new In(Ur(u,o,_),Ur(a,f,E),0,"");return F.dirty=!0,I._selection=F,F}function N_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new In(u,o,0,"")}function $c(){return new kn(new Set)}function C_(){const u=Ur("root",0,"element"),o=Ur("root",0,"element");return new Qn("root",u,o)}function E_(u){const a=u.getEditorState()._selection,f=_r(u._window);return pt(a)||a==null?Fc(a,f,u):a.clone()}function Fc(u,o,a){const f=a._window;if(f===null)return null;const _=f.event,E=_?_.type:void 0,I=E==="selectionchange",F=!Kt()&&(I||E==="beforeinput"||E==="compositionstart"||E==="compositionend"||E==="click"&&_&&_.detail===3||E==="drop"||E===void 0);let oe,de,Ne,Ee;if(!pt(u)||F){if(o===null)return null;if(oe=o.anchorNode,de=o.focusNode,Ne=o.anchorOffset,Ee=o.focusOffset,I&&pt(u)&&!Qr(a,oe,de))return u.clone()}else return u.clone();const xe=Gd(oe,Ne,de,Ee,a,u);if(xe===null)return null;const[Ce,He]=xe;return new In(Ce,He,pt(u)?u.format:0,pt(u)?u.style:"")}function cn(){return bi()._selection}function Hs(){return gn()._editorState._selection}function Ka(u,o,a,f=1){const _=u.anchor,E=u.focus,I=_.getNode(),F=E.getNode();if(!o.is(I)&&!o.is(F))return;const oe=o.__key;if(u.isCollapsed()){const de=_.offset;if(a<=de&&f>0||a<de&&f<0){const Ne=Math.max(0,de+f);_.set(oe,Ne,"element"),E.set(oe,Ne,"element"),jd(u)}}else{const de=u.isBackward(),Ne=de?E:_,Ee=Ne.getNode(),xe=de?_:E,Ce=xe.getNode();if(o.is(Ee)){const He=Ne.offset;(a<=He&&f>0||a<He&&f<0)&&Ne.set(oe,Math.max(0,He+f),"element")}if(o.is(Ce)){const He=xe.offset;(a<=He&&f>0||a<He&&f<0)&&xe.set(oe,Math.max(0,He+f),"element")}}jd(u)}function jd(u){const o=u.anchor,a=o.offset,f=u.focus,_=f.offset,E=o.getNode(),I=f.getNode();if(u.isCollapsed()){if(!Je(E))return;const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text"),f.set(de.__key,Ne,"text")}return}if(Je(E)){const F=E.getChildrenSize(),oe=a>=F,de=oe?E.getChildAtIndex(F-1):E.getChildAtIndex(a);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),o.set(de.__key,Ne,"text")}}if(Je(I)){const F=I.getChildrenSize(),oe=_>=F,de=oe?I.getChildAtIndex(F-1):I.getChildAtIndex(_);if(gt(de)){let Ne=0;oe&&(Ne=de.getTextContentSize()),f.set(de.__key,Ne,"text")}}}function T_(u,o){const f=o.getEditorState()._selection,_=u._selection;if(pt(_)){const E=_.anchor,I=_.focus;let F;if(E.type==="text"&&(F=E.getNode(),F.selectionTransform(f,_)),I.type==="text"){const oe=I.getNode();F!==oe&&oe.selectionTransform(f,_)}}}function za(u,o,a,f,_){let E=null,I=0,F=null;f!==null?(E=f.__key,gt(f)?(I=f.getTextContentSize(),F="text"):Je(f)&&(I=f.getChildrenSize(),F="element")):_!==null&&(E=_.__key,gt(_)?F="text":Je(_)&&(F="element")),E!==null&&F!==null?u.set(E,I,F):(I=o.getIndexWithinParent(),I===-1&&(I=a.getChildrenSize()),u.set(a.__key,I,"element"))}function Vd(u,o,a,f,_){u.type==="text"?(u.key=a,o||(u.offset+=_)):u.offset>f.getIndexWithinParent()&&(u.offset-=1)}function x_(u,o,a,f,_,E,I){const F=f.anchorNode,oe=f.focusNode,de=f.anchorOffset,Ne=f.focusOffset,Ee=document.activeElement;if(_.has("collaboration")&&Ee!==E||Ee!==null&&io(Ee))return;if(!pt(o)){u!==null&&Qr(a,F,oe)&&f.removeAllRanges();return}const xe=o.anchor,Ce=o.focus,He=xe.key,Ie=Ce.key,Me=ws(a,He),mt=ws(a,Ie),ze=xe.offset,tt=Ce.offset,Ft=o.format,Rt=o.style,Ct=o.isCollapsed();let vt=Me,Wt=mt,Zt=!1;if(xe.type==="text"){vt=Ln(Me);const pn=xe.getNode();Zt=pn.getFormat()!==Ft||pn.getStyle()!==Rt}else pt(u)&&u.anchor.type==="text"&&(Zt=!0);if(Ce.type==="text"&&(Wt=Ln(mt)),!(vt===null||Wt===null)&&(Ct&&(u===null||Zt||pt(u)&&(u.format!==Ft||u.style!==Rt))&&ut(Ft,Rt,ze,He,performance.now()),!(de===ze&&Ne===tt&&F===vt&&oe===Wt&&!(f.type==="Range"&&Ct)&&((Ee===null||!E.contains(Ee))&&E.focus({preventScroll:!0}),xe.type!=="element")))){try{f.setBaseAndExtent(vt,ze,Wt,tt)}catch{}if(!_.has("skip-scroll-into-view")&&o.isCollapsed()&&E!==null&&E===document.activeElement){const pn=o instanceof In&&o.anchor.type==="element"?vt.childNodes[ze]||null:f.rangeCount>0?f.getRangeAt(0):null;if(pn!==null){let qt;if(pn instanceof Text){const Dn=document.createRange();Dn.selectNode(pn),qt=Dn.getBoundingClientRect()}else qt=pn.getBoundingClientRect();xa(a,qt,E)}}Xe()}}function v_(u){let o=cn()||Hs();o===null&&(o=Zn().selectEnd()),o.insertNodes(u)}function S_(){const u=cn();return u===null?"":u.getTextContent()}function qd(u,o,a){const f=[];let _=null,E=null;function I(de,Ne,Ee){const xe={cell:Ee,startColumn:Ne,startRow:de},Ce=Ee.__rowSpan,He=Ee.__colSpan;for(let Ie=0;Ie<Ce;Ie++){f[de+Ie]===void 0&&(f[de+Ie]=[]);for(let Me=0;Me<He;Me++)f[de+Ie][Ne+Me]=xe}o.is(Ee)&&(_=xe),a.is(Ee)&&(E=xe)}function F(de,Ne){return f[de]===void 0||f[de][Ne]===void 0}const oe=u.getChildren();for(let de=0;de<oe.length;de++){const Ne=oe[de];if(!$l(Ne))throw Error("Expected GridNode children to be GridRowNode");const Ee=Ne.getChildren();let xe=0;for(const Ce of Ee){if(!Gr(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!F(de,xe);)xe++;I(de,xe,Ce),xe+=Ce.__colSpan}}if(_===null)throw Error("Anchor not found in Grid");if(E===null)throw Error("Focus not found in Grid");return[f,_,E]}function Zd(u){let o;if(u instanceof Uc)o=u;else if(u instanceof Mt){const _=Uo(u,Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}else{const _=Uo(u.getNode(),Gr);if(!Gr(_))throw Error("Expected to find a parent GridCellNode");o=_}const a=o.getParent();if(!$l(a))throw Error("Expected GridCellNode to have a parent GridRowNode");const f=a.getParent();if(!Gc(f))throw Error("Expected GridRowNode to have a parent GridNode");return[o,a,f]}function Bc(u){u.isCollapsed()||u.removeText();const o=u.anchor,a=o.getNode();if(!gt(a))return o.offset;const f=a.getParent();if(!f){const oe=qi();return Zn().append(oe),oe.select(),0}const _=a.splitText(o.offset);if(_.length===0)return 0;const E=o.offset===0?0:1,I=_[0].getIndexWithinParent()+E;if(!f.isInline()||I===0)return I;const F=f.getChildAtIndex(I);return F&&f.insertNewAfter(u).append(F,...F.getNextSiblings()),f.getIndexWithinParent()+E}function w_(u){const o=qi();let a=null;for(let f=0;f<u.length;f++){const _=u[f],E=Di(_);if(E||Sn(_)&&_.isInline()||Je(_)&&_.isInline()||gt(_)||_.isParentRequired()){if(a===null&&(a=_.createParentElementNode(),o.append(a),E))continue;a!==null&&a.append(_)}else o.append(_),a=null}return o}let Yn=null,jn=null,Tr=!1,Hc=!1,Ua=0;const Jd={characterData:!0,childList:!0,subtree:!0};function Ws(){return Tr||Yn!==null&&Yn._readOnly}function nr(){if(Tr)throw Error("Cannot use method in read-only mode.")}function Xd(){if(Ua>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function bi(){if(Yn===null)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return Yn}function gn(){if(jn===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return jn}function O_(){return jn}function Qd(u,o,a){const f=o.__type,_=kr(u,f);let E=a.get(f);E===void 0&&(E=Array.from(_.transforms),a.set(f,E));const I=E.length;for(let F=0;F<I&&(E[F](o),!!o.isAttached());F++);}function ef(u,o){return u!==void 0&&u.__key!==o&&u.isAttached()}function D_(u,o){const a=o._dirtyLeaves,f=u._nodeMap;for(const _ of a){const E=f.get(_);gt(E)&&E.isAttached()&&E.isSimpleText()&&!E.isUnmergeable()&&dl(E)}}function A_(u,o){const a=o._dirtyLeaves,f=o._dirtyElements,_=u._nodeMap,E=Ir(),I=new Map;let F=a,oe=F.size,de=f,Ne=de.size;for(;oe>0||Ne>0;){if(oe>0){o._dirtyLeaves=new Set;for(const Ee of F){const xe=_.get(Ee);gt(xe)&&xe.isAttached()&&xe.isSimpleText()&&!xe.isUnmergeable()&&dl(xe),xe!==void 0&&ef(xe,E)&&Qd(o,xe,I),a.add(Ee)}if(F=o._dirtyLeaves,oe=F.size,oe>0){Ua++;continue}}o._dirtyLeaves=new Set,o._dirtyElements=new Map;for(const Ee of de){const xe=Ee[0],Ce=Ee[1];if(xe!=="root"&&!Ce)continue;const He=_.get(xe);He!==void 0&&ef(He,E)&&Qd(o,He,I),f.set(xe,Ce)}F=o._dirtyLeaves,oe=F.size,de=o._dirtyElements,Ne=de.size,Ua++}o._dirtyLeaves=a,o._dirtyElements=f}function M_(u){return Wc(u,gn()._nodes)}function Wc(u,o){const a=u.type,f=o.get(a);if(f===void 0)throw Error(`parseEditorState: type "${a}" + not found`);const _=f.klass;if(u.type!==_.getType())throw Error(`LexicalNode: Node ${_.name} does not implement .importJSON().`);const E=_.importJSON(u),I=u.children;if(Je(E)&&Array.isArray(I))for(let F=0;F<I.length;F++){const oe=I[F],de=Wc(oe,o);E.append(de)}return E}function R_(u,o,a){const f=zc(),_=Yn,E=Tr,I=jn,F=o._dirtyElements,oe=o._dirtyLeaves,de=o._cloneNotNeeded,Ne=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,Yn=f,Tr=!1,jn=o;try{const Ee=o._nodes,xe=u.root;Wc(xe,Ee),a&&a(),f._readOnly=!0,nf(f)}catch(Ee){Ee instanceof Error&&o._onError(Ee)}finally{o._dirtyElements=F,o._dirtyLeaves=oe,o._cloneNotNeeded=de,o._dirtyType=Ne,Yn=_,Tr=E,jn=I}return f}function tf(u,o){const a=Yn,f=Tr,_=jn;Yn=u,Tr=!0,jn=null;try{return o()}finally{Yn=a,Tr=f,jn=_}}function nf(u){const o=u._nodeMap;o.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},o.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},o.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function ns(u,o){const a=u._pendingEditorState,f=u._rootElement,_=u._headless||f===null;if(a===null)return;const E=u._editorState,I=E._selection,F=a._selection,oe=u._dirtyType!==ct,de=Yn,Ne=Tr,Ee=jn,xe=u._updating,Ce=u._observer;let He=null;if(u._pendingEditorState=null,u._editorState=a,!_&&oe&&Ce!==null){jn=u,Yn=a,Tr=!1,u._updating=!0;try{const Ct=u._dirtyType,vt=u._dirtyElements,Wt=u._dirtyLeaves;Ce.disconnect(),He=sr(E,a,u,Ct,vt,Wt)}catch(Ct){if(Ct instanceof Error&&u._onError(Ct),!Hc)cf(u,null,f,a),qn(u),u._dirtyType=dt,Hc=!0,ns(u,E),Hc=!1;else throw Ct;return}finally{Ce.observe(f,Jd),u._updating=xe,Yn=de,Tr=Ne,jn=Ee}}a._readOnly||(a._readOnly=!0,nf(a),pt(F)&&(Object.freeze(F.anchor),Object.freeze(F.focus)),Object.freeze(F));const Ie=u._dirtyLeaves,Me=u._dirtyElements,mt=u._normalizedNodes,ze=u._updateTags,tt=u._deferred;oe&&(u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),Sa(u,a);const Ft=_?null:_r(u._window);if(u._editable&&Ft!==null&&(oe||F===null||F.dirty)){jn=u,Yn=a;try{if(Ce!==null&&Ce.disconnect(),oe||F===null||F.dirty){const Ct=u._blockCursorElement;Ct!==null&&wt(Ct,u,f),x_(I,F,u,Ft,ze,f)}wl(u,f,F),Ce!==null&&Ce.observe(f,Jd)}finally{jn=Ee,Yn=de}}He!==null&&L_(u,He,ze,Ie,E),!pt(F)&&F!==null&&(I===null||!I.is(F))&&u.dispatchCommand(e,void 0);const Rt=u._pendingDecorators;Rt!==null&&(u._decorators=Rt,u._pendingDecorators=null,Pl("decorator",u,!0,Rt)),b_(u,o||E,a),Pl("update",u,!0,{dirtyElements:Me,dirtyLeaves:Ie,editorState:a,normalizedNodes:mt,prevEditorState:o||E,tags:ze}),I_(u,tt),k_(u)}function b_(u,o,a){const f=so(o),_=so(a);f!==_&&Pl("textcontent",u,!0,_)}function L_(u,o,a,f,_){const E=Array.from(u._listeners.mutation),I=E.length;for(let F=0;F<I;F++){const[oe,de]=E[F],Ne=o.get(de);Ne!==void 0&&oe(Ne,{dirtyLeaves:f,prevEditorState:_,updateTags:a})}}function Pl(u,o,a,...f){const _=o._updating;o._updating=a;try{const E=Array.from(o._listeners[u]);for(let I=0;I<E.length;I++)E[I].apply(null,f)}finally{o._updating=_}}function rf(u,o,a){if(u._updating===!1||jn!==u){let _=!1;return u.update(()=>{_=rf(u,o,a)}),_}const f=vs(u);for(let _=4;_>=0;_--)for(let E=0;E<f.length;E++){const oe=f[E]._commands.get(o);if(oe!==void 0){const de=oe[_];if(de!==void 0){const Ne=Array.from(de),Ee=Ne.length;for(let xe=0;xe<Ee;xe++)if(Ne[xe](a,u)===!0)return!0}}}return!1}function k_(u){const o=u._updates;if(o.length!==0){const a=o.shift();if(a){const[f,_]=a;sf(u,f,_)}}}function I_(u,o){if(u._deferred=[],o.length!==0){const a=u._updating;u._updating=!0;try{for(let f=0;f<o.length;f++)o[f]()}finally{u._updating=a}}}function of(u,o){const a=u._updates;let f=o||!1;for(;a.length!==0;){const _=a.shift();if(_){const[E,I]=_;let F,oe;I!==void 0&&(F=I.onUpdate,oe=I.tag,I.skipTransforms&&(f=!0),F&&u._deferred.push(F),oe&&u._updateTags.add(oe)),E()}}return f}function sf(u,o,a){const f=u._updateTags;let _,E,I=!1,F=!1;a!==void 0&&(_=a.onUpdate,E=a.tag,E!=null&&f.add(E),I=a.skipTransforms||!1,F=a.discrete||!1),_&&u._deferred.push(_);const oe=u._editorState;let de=u._pendingEditorState,Ne=!1;(de===null||de._readOnly)&&(de=u._pendingEditorState=F_(de||oe),Ne=!0),de._flushSync=F;const Ee=Yn,xe=Tr,Ce=jn,He=u._updating;Yn=de,Tr=!1,u._updating=!0,jn=u;try{Ne&&(u._headless?oe._selection!=null&&(de._selection=oe._selection.clone()):de._selection=E_(u));const Me=u._compositionKey;o(),I=of(u,I),T_(de,u),u._dirtyType!==ct&&(I?D_(de,u):A_(de,u),of(u),wa(oe,de,u._dirtyLeaves,u._dirtyElements));const mt=u._compositionKey;Me!==mt&&(de._flushSync=!0);const ze=de._selection;if(pt(ze)){const tt=de._nodeMap,Ft=ze.anchor.key,Rt=ze.focus.key;if(tt.get(Ft)===void 0||tt.get(Rt)===void 0)throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Er(ze)&&ze._nodes.size===0&&(de._selection=null)}catch(Me){Me instanceof Error&&u._onError(Me),u._pendingEditorState=oe,u._dirtyType=dt,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),ns(u);return}finally{Yn=Ee,Tr=xe,jn=Ce,u._updating=He,Ua=0}u._dirtyType!==ct||$_(de,u)?de._flushSync?(de._flushSync=!1,ns(u)):Ne&&Ns(()=>{ns(u)}):(de._flushSync=!1,Ne&&(f.clear(),u._deferred=[],u._pendingEditorState=null))}function Rr(u,o,a){u._updating?u._updates.push([o,a]):sf(u,o,a)}class Kc extends Mt{constructor(o){super(o)}decorate(o,a){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Sn(u){return u instanceof Kc}class rs extends Mt{constructor(o){super(o),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const o=this.getFormat();return _s[o]||""}getIndent(){return this.getLatest().__indent}getChildren(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a),a=a.getNextSibling();return o}getChildrenKeys(){const o=[];let a=this.getFirstChild();for(;a!==null;)o.push(a.__key),a=a.getNextSibling();return o}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const a=gn()._dirtyElements;return a!==null&&a.has(this.__key)}isLastChild(){const o=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(o)}getAllTextNodes(){const o=[];let a=this.getFirstChild();for(;a!==null;){if(gt(a)&&o.push(a),Je(a)){const f=a.getAllTextNodes();o.push(...f)}a=a.getNextSibling()}return o}getFirstDescendant(){let o=this.getFirstChild();for(;o!==null;){if(Je(o)){const a=o.getFirstChild();if(a!==null){o=a;continue}}break}return o}getLastDescendant(){let o=this.getLastChild();for(;o!==null;){if(Je(o)){const a=o.getLastChild();if(a!==null){o=a;continue}}break}return o}getDescendantByIndex(o){const a=this.getChildren(),f=a.length;if(o>=f){const E=a[f-1];return Je(E)&&E.getLastDescendant()||E||null}const _=a[o];return Je(_)&&_.getFirstDescendant()||_||null}getFirstChild(){const a=this.getLatest().__first;return a===null?null:En(a)}getFirstChildOrThrow(){const o=this.getFirstChild();if(o===null)throw Error(`Expected node ${this.__key} to have a first child.`);return o}getLastChild(){const a=this.getLatest().__last;return a===null?null:En(a)}getLastChildOrThrow(){const o=this.getLastChild();if(o===null)throw Error(`Expected node ${this.__key} to have a last child.`);return o}getChildAtIndex(o){const a=this.getChildrenSize();let f,_;if(o<a/2){for(f=this.getFirstChild(),_=0;f!==null&&_<=o;){if(_===o)return f;f=f.getNextSibling(),_++}return null}for(f=this.getLastChild(),_=a-1;f!==null&&_>=o;){if(_===o)return f;f=f.getPreviousSibling(),_--}return null}getTextContent(){let o="";const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContent(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It)}return o}getTextContentSize(){let o=0;const a=this.getChildren(),f=a.length;for(let _=0;_<f;_++){const E=a[_];o+=E.getTextContentSize(),Je(E)&&_!==f-1&&!E.isInline()&&(o+=It.length)}return o}getDirection(){return this.getLatest().__dir}hasFormat(o){if(o!==""){const a=Jr[o];return(this.getFormat()&a)!==0}return!1}select(o,a){nr();const f=cn();let _=o,E=a;const I=this.getChildrenSize();if(!this.canBeEmpty()){if(o===0&&a===0){const oe=this.getFirstChild();if(gt(oe)||Je(oe))return oe.select(0,0)}else if((o===void 0||o===I)&&(a===void 0||a===I)){const oe=this.getLastChild();if(gt(oe)||Je(oe))return oe.select()}}_===void 0&&(_=I),E===void 0&&(E=I);const F=this.__key;if(pt(f))f.anchor.set(F,_,"element"),f.focus.set(F,E,"element"),f.dirty=!0;else return Yd(F,_,F,E,"element","element");return f}selectStart(){const o=this.getFirstDescendant();return o?o.selectStart():this.select()}selectEnd(){const o=this.getLastDescendant();return o?o.selectEnd():this.select()}clear(){const o=this.getWritable();return this.getChildren().forEach(f=>f.remove()),o}append(...o){return this.splice(this.getChildrenSize(),0,o)}setDirection(o){const a=this.getWritable();return a.__dir=o,a}setFormat(o){const a=this.getWritable();return a.__format=o!==""?Jr[o]:0,this}setIndent(o){const a=this.getWritable();return a.__indent=o,this}splice(o,a,f){const _=f.length,E=this.getChildrenSize(),I=this.getWritable(),F=I.__key,oe=[],de=[],Ne=this.getChildAtIndex(o+a);let Ee=null,xe=E-a+_;if(o!==0)if(o===E)Ee=this.getLastChild();else{const He=this.getChildAtIndex(o);He!==null&&(Ee=He.getPreviousSibling())}if(a>0){let He=Ee===null?this.getFirstChild():Ee.getNextSibling();for(let Ie=0;Ie<a;Ie++){if(He===null)throw Error("splice: sibling not found");const Me=He.getNextSibling(),mt=He.__key,ze=He.getWritable();yi(ze),de.push(mt),He=Me}}let Ce=Ee;for(let He=0;He<_;He++){const Ie=f[He];Ce!==null&&Ie.is(Ce)&&(Ee=Ce=Ce.getPreviousSibling());const Me=Ie.getWritable();Me.__parent===F&&xe--,yi(Me);const mt=Ie.__key;if(Ce===null)I.__first=mt,Me.__prev=null;else{const ze=Ce.getWritable();ze.__next=mt,Me.__prev=ze.__key}if(Ie.__key===F)throw Error("append: attempting to append self");Me.__parent=F,oe.push(mt),Ce=Ie}if(o+a===E){if(Ce!==null){const He=Ce.getWritable();He.__next=null,I.__last=Ce.__key}}else if(Ne!==null){const He=Ne.getWritable();if(Ce!==null){const Ie=Ce.getWritable();He.__prev=Ce.__key,Ie.__next=Ne.__key}else He.__prev=null}if(I.__size=xe,de.length){const He=cn();if(pt(He)){const Ie=new Set(de),Me=new Set(oe),{anchor:mt,focus:ze}=He;lf(mt,Ie,Me)&&za(mt,mt.getNode(),this,Ee,Ne),lf(ze,Ie,Me)&&za(ze,ze.getNode(),this,Ee,Ne),xe===0&&!this.canBeEmpty()&&!Fr(this)&&this.remove()}}return I}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(o,a){return null}canIndent(){return!0}collapseAtStart(o){return!1}excludeFromCopy(o){return!1}canExtractContents(){return!0}canReplaceWith(o){return!0}canInsertAfter(o){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(o){return!1}extractWithChild(o,a,f){return!1}}function Je(u){return u instanceof rs}function lf(u,o,a){let f=u.getNode();for(;f;){const _=f.__key;if(o.has(_)&&!a.has(_))return!0;f=f.getParent()}return!1}class Ks extends rs{static getType(){return"root"}static clone(){return new Ks}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const o=this.__cachedText;return(Ws()||gn()._dirtyType===ct)&&o!==null?o:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(o){throw Error("replace: cannot be called on root nodes")}insertBefore(o){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(o){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(o,a){return!1}append(...o){for(let a=0;a<o.length;a++){const f=o[a];if(!Je(f)&&!Sn(f))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...o)}static importJSON(o){const a=Zn();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function P_(){return new Ks}function br(u){return u instanceof Ks}function $_(u,o){const a=o.getEditorState()._selection,f=u._selection;if(f!==null){if(f.dirty||!f.is(a))return!0}else if(a!==null)return!0;return!1}function F_(u){return new Ga(new Map(u._nodeMap))}function zc(){return new Ga(new Map([["root",P_()]]))}function af(u){const o=u.exportJSON(),a=u.constructor;if(o.type!==a.getType())throw Error(`LexicalNode: Node ${a.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);const f=o.children;if(Je(u)){if(!Array.isArray(f))throw Error(`LexicalNode: Node ${a.name} is an element but .exportJSON() does not have a children array.`);const _=u.getChildren();for(let E=0;E<_.length;E++){const I=_[E],F=af(I);f.push(F)}}return o}class Ga{constructor(o,a){this._nodeMap=o,this._selection=a||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(o){return tf(this,o)}clone(o){const a=new Ga(this._nodeMap,o===void 0?this._selection:o);return a._readOnly=!0,a}toJSON(){return tf(this,()=>({root:af(Zn())}))}}class zs extends rs{static getType(){return"paragraph"}static clone(o){return new zs(o.__key)}createDOM(o){const a=document.createElement("p"),f=Hi(o.theme,"paragraph");return f!==void 0&&a.classList.add(...f),a}updateDOM(o,a,f){return!1}static importDOM(){return{p:o=>({conversion:B_,priority:0})}}exportDOM(o){const{element:a}=super.exportDOM(o);if(a&&Yo(a)){this.isEmpty()&&a.append(document.createElement("br"));const f=this.getFormatType();a.style.textAlign=f;const _=this.getDirection();_&&(a.dir=_);const E=this.getIndent();E>0&&(a.style.textIndent=`${E*20}px`)}return{element:a}}static importJSON(o){const a=qi();return a.setFormat(o.format),a.setIndent(o.indent),a.setDirection(o.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(o,a){const f=qi(),_=this.getDirection();return f.setDirection(_),this.insertAfter(f,a),f}collapseAtStart(){const o=this.getChildren();if(o.length===0||gt(o[0])&&o[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function B_(u){const o=qi();if(u.style){o.setFormat(u.style.textAlign);const a=parseInt(u.style.textIndent,10)/20;a>0&&o.setIndent(a)}return{node:o}}function qi(){return fo(new zs)}function H_(u){return u instanceof zs}const W_=0,K_=1,z_=2,U_=3,G_=4;function cf(u,o,a,f){const _=u._keyToDOMMap;_.clear(),u._editorState=zc(),u._pendingEditorState=f,u._compositionKey=null,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const E=u._observer;E!==null&&(E.disconnect(),u._observer=null),o!==null&&(o.textContent=""),a!==null&&(a.textContent="",_.set("root",a))}function Y_(u,o){const a=new Map,f=new Set,_=E=>{Object.keys(E).forEach(I=>{let F=a.get(I);F===void 0&&(F=[],a.set(I,F)),F.push(E[I])})};return u.forEach(E=>{const I=E.klass.importDOM!=null?E.klass.importDOM.bind(E.klass):null;if(I==null||f.has(I))return;f.add(I);const F=I();F!==null&&_(F)}),o&&_(o),a}function j_(u){const o=u||{},a=O_(),f=o.theme||{},_=u===void 0?a:o.parentEditor||null,E=o.disableEvents||!1,I=zc(),F=o.namespace||(_!==null?_._config.namespace:Io()),oe=o.editorState,de=[Ks,Gi,Wr,Ai,zs,...o.nodes||[]],{onError:Ne,html:Ee}=o,xe=o.editable!==void 0?o.editable:!0;let Ce;if(u===void 0&&a!==null)Ce=a._nodes;else{Ce=new Map;for(let Ie=0;Ie<de.length;Ie++){let Me=de[Ie],mt=null,ze=null;if(typeof Me!="function"){const Ct=Me;Me=Ct.replace,mt=Ct.with,ze=Ct.withKlass||null}{const Ct=Me.name;if(Ct!=="RootNode"){const vt=Me.prototype;["getType","clone"].forEach(Wt=>{Me.hasOwnProperty(Wt)||console.warn(`${Ct} must implement static "${Wt}" method`)}),!Me.hasOwnProperty("importDOM")&&Me.hasOwnProperty("exportDOM")&&console.warn(`${Ct} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),vt instanceof Kc&&(vt.hasOwnProperty("decorate")||console.warn(`${vt.constructor.name} must implement "decorate" method`)),Me.hasOwnProperty("importJSON")||console.warn(`${Ct} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),vt.hasOwnProperty("exportJSON")||console.warn(`${Ct} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const tt=Me.getType(),Ft=Me.transform(),Rt=new Set;Ft!==null&&Rt.add(Ft),Ce.set(tt,{exportDOM:Ee&&Ee.export?Ee.export.get(Me):void 0,klass:Me,replace:mt,replaceWithKlass:ze,transforms:Rt})}}const He=new V_(I,_,Ce,{disableEvents:E,namespace:F,theme:f},Ne||console.error,Y_(Ce,Ee?Ee.import:void 0),xe);return oe!==void 0&&(He._pendingEditorState=oe,He._dirtyType=dt),He}class V_{constructor(o,a,f,_,E,I,F){this._parentEditor=a,this._rootElement=null,this._editorState=o,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=_,this._nodes=f,this._decorators={},this._pendingDecorators=null,this._dirtyType=ct,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Io(),this._onError=E,this._htmlConversions=I,this._editable=F,this._headless=a!==null&&a._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(o){const a=this._listeners.update;return a.add(o),()=>{a.delete(o)}}registerEditableListener(o){const a=this._listeners.editable;return a.add(o),()=>{a.delete(o)}}registerDecoratorListener(o){const a=this._listeners.decorator;return a.add(o),()=>{a.delete(o)}}registerTextContentListener(o){const a=this._listeners.textcontent;return a.add(o),()=>{a.delete(o)}}registerRootListener(o){const a=this._listeners.root;return o(this._rootElement,null),a.add(o),()=>{o(null,this._rootElement),a.delete(o)}}registerCommand(o,a,f){if(f===void 0)throw Error('Listener for type "command" requires a "priority".');const _=this._commands;_.has(o)||_.set(o,[new Set,new Set,new Set,new Set,new Set]);const E=_.get(o);if(E===void 0)throw Error(`registerCommand: Command ${String(o)} not found in command map`);const I=E[f];return I.add(a),()=>{I.delete(a),E.every(F=>F.size===0)&&_.delete(o)}}registerMutationListener(o,a){if(this._nodes.get(o.getType())===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);const _=this._listeners.mutation;return _.set(a,o),()=>{_.delete(a)}}registerNodeTransformToKlass(o,a){const f=o.getType(),_=this._nodes.get(f);if(_===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);return _.transforms.add(a),_}registerNodeTransform(o,a){const f=this.registerNodeTransformToKlass(o,a),_=[f],E=f.replaceWithKlass;if(E!=null){const I=this.registerNodeTransformToKlass(E,a);_.push(I)}return Ts(this,o.getType()),()=>{_.forEach(I=>I.transforms.delete(a))}}hasNode(o){return this._nodes.has(o.getType())}hasNodes(o){return o.every(this.hasNode.bind(this))}dispatchCommand(o,a){return st(this,o,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(o){const a=this._rootElement;if(o!==a){const f=Hi(this._config.theme,"root"),_=this._pendingEditorState||this._editorState;if(this._rootElement=o,cf(this,a,o,_),a!==null&&(this._config.disableEvents||ke(a),f!=null&&a.classList.remove(...f)),o!==null){const E=uo(o),I=o.style;I.userSelect="text",I.whiteSpace="pre-wrap",I.wordBreak="break-word",o.setAttribute("data-lexical-editor","true"),this._window=E,this._dirtyType=dt,qn(this),this._updateTags.add("history-merge"),ns(this),this._config.disableEvents||Ke(o,this),f!=null&&o.classList.add(...f)}else this._editorState=_,this._pendingEditorState=null,this._window=null;Pl("root",this,!1,o,a)}}getElementByKey(o){return this._keyToDOMMap.get(o)||null}getEditorState(){return this._editorState}setEditorState(o,a){if(o.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");mi(this);const f=this._pendingEditorState,_=this._updateTags,E=a!==void 0?a.tag:null;f!==null&&!f.isEmpty()&&(E!=null&&_.add(E),ns(this)),this._pendingEditorState=o,this._dirtyType=dt,this._dirtyElements.set("root",!1),this._compositionKey=null,E!=null&&_.add(E),ns(this)}parseEditorState(o,a){const f=typeof o=="string"?JSON.parse(o):o;return R_(f,this,a)}update(o,a){Rr(this,o,a)}focus(o,a={}){const f=this._rootElement;f!==null&&(f.setAttribute("autocapitalize","off"),Rr(this,()=>{const _=cn(),E=Zn();_!==null?_.dirty=!0:E.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?E.selectStart():E.selectEnd())},{onUpdate:()=>{f.removeAttribute("autocapitalize"),o&&o()},tag:"focus"}),this._pendingEditorState===null&&f.removeAttribute("autocapitalize"))}blur(){const o=this._rootElement;o!==null&&o.blur();const a=_r(this._window);a!==null&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(o){this._editable!==o&&(this._editable=o,Pl("editable",this,!0,o))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Uc extends rs{constructor(o,a){super(a),this.__colSpan=o,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(o){return this.getWritable().__colSpan=o,this}getRowSpan(){return this.__rowSpan}setRowSpan(o){return this.getWritable().__rowSpan=o,this}}function Gr(u){return u instanceof Uc}class uf extends rs{}function Gc(u){return u instanceof uf}class df extends rs{}function $l(u){return u instanceof df}return Pe.$INTERNAL_isPointSelection=Cr,Pe.$addUpdateTag=Ti,Pe.$applyNodeReplacement=fo,Pe.$copyNode=vl,Pe.$createLineBreakNode=Oi,Pe.$createNodeSelection=$c,Pe.$createParagraphNode=qi,Pe.$createRangeSelection=N_,Pe.$createTabNode=Yi,Pe.$createTextNode=Wn,Pe.$getAdjacentNode=ri,Pe.$getNearestNodeFromDOMNode=mr,Pe.$getNearestRootOrShadowRoot=Dr,Pe.$getNodeByKey=En,Pe.$getPreviousSelection=Hs,Pe.$getRoot=Zn,Pe.$getSelection=cn,Pe.$getTextContent=S_,Pe.$hasAncestor=ht,Pe.$hasUpdateTag=Ic,Pe.$insertNodes=v_,Pe.$isBlockElementNode=y_,Pe.$isDecoratorNode=Sn,Pe.$isElementNode=Je,Pe.$isInlineElementOrDecoratorNode=va,Pe.$isLeafNode=_i,Pe.$isLineBreakNode=Di,Pe.$isNodeSelection=Er,Pe.$isParagraphNode=H_,Pe.$isRangeSelection=pt,Pe.$isRootNode=br,Pe.$isRootOrShadowRoot=Fr,Pe.$isTabNode=es,Pe.$isTextNode=gt,Pe.$nodesOfType=xl,Pe.$normalizeSelection__EXPERIMENTAL=Bi,Pe.$parseSerializedNode=M_,Pe.$selectAll=Tl,Pe.$setCompositionKey=_n,Pe.$setSelection=Or,Pe.$splitNode=Ds,Pe.BLUR_COMMAND=Z,Pe.CAN_REDO_COMMAND=m,Pe.CAN_UNDO_COMMAND=y,Pe.CLEAR_EDITOR_COMMAND=Q,Pe.CLEAR_HISTORY_COMMAND=k,Pe.CLICK_COMMAND=n,Pe.COMMAND_PRIORITY_CRITICAL=G_,Pe.COMMAND_PRIORITY_EDITOR=W_,Pe.COMMAND_PRIORITY_HIGH=U_,Pe.COMMAND_PRIORITY_LOW=K_,Pe.COMMAND_PRIORITY_NORMAL=z_,Pe.CONTROLLED_TEXT_INSERTION_COMMAND=g,Pe.COPY_COMMAND=ne,Pe.CUT_COMMAND=Y,Pe.DELETE_CHARACTER_COMMAND=r,Pe.DELETE_LINE_COMMAND=T,Pe.DELETE_WORD_COMMAND=v,Pe.DEPRECATED_$computeGridMap=qd,Pe.DEPRECATED_$createGridSelection=C_,Pe.DEPRECATED_$getGridCellNodeRect=ji,Pe.DEPRECATED_$getNodeTriplet=Zd,Pe.DEPRECATED_$isGridCellNode=Gr,Pe.DEPRECATED_$isGridNode=Gc,Pe.DEPRECATED_$isGridRowNode=$l,Pe.DEPRECATED_$isGridSelection=cr,Pe.DEPRECATED_GridCellNode=Uc,Pe.DEPRECATED_GridNode=uf,Pe.DEPRECATED_GridRowNode=df,Pe.DRAGEND_COMMAND=V,Pe.DRAGOVER_COMMAND=D,Pe.DRAGSTART_COMMAND=K,Pe.DROP_COMMAND=pe,Pe.DecoratorNode=Kc,Pe.ElementNode=rs,Pe.FOCUS_COMMAND=M,Pe.FORMAT_ELEMENT_COMMAND=ue,Pe.FORMAT_TEXT_COMMAND=O,Pe.INDENT_CONTENT_COMMAND=me,Pe.INSERT_LINE_BREAK_COMMAND=c,Pe.INSERT_PARAGRAPH_COMMAND=d,Pe.INSERT_TAB_COMMAND=q,Pe.KEY_ARROW_DOWN_COMMAND=B,Pe.KEY_ARROW_LEFT_COMMAND=H,Pe.KEY_ARROW_RIGHT_COMMAND=w,Pe.KEY_ARROW_UP_COMMAND=W,Pe.KEY_BACKSPACE_COMMAND=ee,Pe.KEY_DELETE_COMMAND=j,Pe.KEY_DOWN_COMMAND=x,Pe.KEY_ENTER_COMMAND=z,Pe.KEY_ESCAPE_COMMAND=le,Pe.KEY_MODIFIER_COMMAND=ae,Pe.KEY_SPACE_COMMAND=X,Pe.KEY_TAB_COMMAND=U,Pe.LineBreakNode=Wr,Pe.MOVE_TO_END=P,Pe.MOVE_TO_START=$,Pe.OUTDENT_CONTENT_COMMAND=_e,Pe.PASTE_COMMAND=p,Pe.ParagraphNode=zs,Pe.REDO_COMMAND=R,Pe.REMOVE_TEXT_COMMAND=N,Pe.RootNode=Ks,Pe.SELECTION_CHANGE_COMMAND=e,Pe.SELECT_ALL_COMMAND=G,Pe.TabNode=Ai,Pe.TextNode=Gi,Pe.UNDO_COMMAND=b,Pe.createCommand=t,Pe.createEditor=j_,Pe.getNearestEditorFromDOMNode=Lo,Pe.isHTMLAnchorElement=Go,Pe.isHTMLElement=Yo,Pe.isSelectionCapturedInDecoratorInput=io,Pe.isSelectionWithinEditor=Qr,Pe}var $e={},bf;function FN(){if(bf)return $e;bf=1;let t={},e={},n={},r={},c={},d={},g={},p={},N={},v={},T={},O={},b={},R={},x={},w={},P={},H={},$={},W={},B={},z={},X={},ee={},le={},j={},U={},q={},me={},_e={},pe={},ue={},K={},D={},V={},ne={};function Y(l){let i=new URLSearchParams;i.append("code",l);for(let s=1;s<arguments.length;s++)i.append("v",arguments[s]);throw Error(`Minified Lexical error #${l}; visit https://lexical.dev/docs/error?${i} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q=G&&"documentMode"in document?document.documentMode:null,k=G&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),m=G&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),y=G&&"InputEvent"in window&&!Q?"getTargetRanges"in new window.InputEvent("input"):!1,M=G&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),Z=G&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,ae=G&&/Android/.test(navigator.userAgent),he=G&&/^(?=.*Chrome).*/i.test(navigator.userAgent),se=G&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!he,Te=M||Z||se?" ":"​",be=m?" ":Te,Ue=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,re=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,te={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ce={directionless:1,unmergeable:2},we={center:2,end:6,justify:4,left:1,right:3,start:5},Le={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Be={normal:0,segmented:2,token:1},Ye={0:"normal",2:"segmented",1:"token"},ct=!1,yt=0;function dt(l){yt=l.timeStamp}function ve(l,i,s){return i.__lexicalLineBreak===l||l[`__lexicalKey_${s._key}`]!==void 0}function ie(l){return l.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function fe(l,i,s){ct=!0;let h=100<performance.now()-yt;try{sr(l,()=>{let C=Vt()||ie(l);var S=new Map,A=l.getRootElement(),J=l._editorState,ge=l._blockCursorElement;let Se=!1,Fe="";for(var Ke=0;Ke<i.length;Ke++){var ke=i[Ke],Ae=ke.type,Xe=ke.target,ut=Sr(Xe,J);if(!(ut===null&&Xe!==A||an(ut))){if(Ae==="characterData"){if(ke=h&&ht(ut))e:{ke=C,Ae=Xe;var Tt=ut;if(wt(ke)){var Mt=ke.anchor.getNode();if(Mt.is(Tt)&&ke.format!==Mt.getFormat()){ke=!1;break e}}ke=Ae.nodeType===3&&Tt.isAttached()}ke&&(Tt=kr(l._window),Ae=ke=null,Tt!==null&&Tt.anchorNode===Xe&&(ke=Tt.anchorOffset,Ae=Tt.focusOffset),Xe=Xe.nodeValue,Xe!==null&&Nt(ut,Xe,ke,Ae,!1))}else if(Ae==="childList"){for(Se=!0,Ae=ke.addedNodes,Tt=0;Tt<Ae.length;Tt++){Mt=Ae[Tt];var hn=hr(Mt),ar=Mt.parentNode;ar==null||Mt===ge||hn!==null||Mt.nodeName==="BR"&&ve(Mt,ar,l)||(m&&(hn=Mt.innerText||Mt.nodeValue)&&(Fe+=hn),ar.removeChild(Mt))}if(ke=ke.removedNodes,Ae=ke.length,0<Ae){for(Tt=0,Mt=0;Mt<Ae;Mt++)ar=ke[Mt],(ar.nodeName==="BR"&&ve(ar,Xe,l)||ge===ar)&&(Xe.appendChild(ar),Tt++);Ae!==Tt&&(Xe===A&&(ut=J._nodeMap.get("root")),S.set(Xe,ut))}}}}if(0<S.size)for(let[Wr,si]of S)if(Ze(si))for(S=si.getChildrenKeys(),A=Wr.firstChild,J=0;J<S.length;J++)ge=l.getElementByKey(S[J]),ge!==null&&(A==null?(Wr.appendChild(ge),A=ge):A!==ge&&Wr.replaceChild(ge,A),A=A.nextSibling);else ht(si)&&si.markDirty();if(S=s.takeRecords(),0<S.length){for(A=0;A<S.length;A++)for(ge=S[A],J=ge.addedNodes,ge=ge.target,Ke=0;Ke<J.length;Ke++)ut=J[Ke],Xe=ut.parentNode,Xe==null||ut.nodeName!=="BR"||ve(ut,ge,l)||Xe.removeChild(ut);s.takeRecords()}C!==null&&(Se&&(C.dirty=!0,gr(C)),m&&sn(l)&&C.insertRawText(Fe))})}finally{ct=!1}}function Oe(l){let i=l._observer;if(i!==null){let s=i.takeRecords();fe(l,s,i)}}function Re(l){yt===0&&qn(l).addEventListener("textInput",dt,!0),l._observer=new MutationObserver((i,s)=>{fe(l,i,s)})}function De(l,i){let s=l.__mode,h=l.__format;l=l.__style;let C=i.__mode,S=i.__format;return i=i.__style,(s===null||s===C)&&(h===null||h===S)&&(l===null||l===i)}function We(l,i){let s=l.mergeWithSibling(i),h=ln()._normalizedNodes;return h.add(l.__key),h.add(i.__key),s}function qe(l){if(l.__text===""&&l.isSimpleText()&&!l.isUnmergeable())l.remove();else{for(var i;(i=l.getPreviousSibling())!==null&&ht(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{De(i,l)&&(l=We(i,l));break}for(var s;(s=l.getNextSibling())!==null&&ht(s)&&s.isSimpleText()&&!s.isUnmergeable();)if(s.__text==="")s.remove();else{De(l,s)&&We(l,s);break}}}function Qe(l){return ft(l.anchor),ft(l.focus),l}function ft(l){for(;l.type==="element";){var i=l.getNode(),s=l.offset;if(s===i.getChildrenSize()?(i=i.getChildAtIndex(s-1),s=!0):(i=i.getChildAtIndex(s),s=!1),ht(i)){l.set(i.__key,s?i.getTextContentSize():0,"text");break}else if(!Ze(i))break;l.set(i.__key,s?i.getChildrenSize():0,"element")}}let kt=1,je=typeof queueMicrotask=="function"?queueMicrotask:l=>{Promise.resolve().then(l)};function Ve(l){let i=document.activeElement;if(i===null)return!1;let s=i.nodeName;return an(Sr(l))&&(s==="INPUT"||s==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function rt(l,i,s){let h=l.getRootElement();try{return h!==null&&h.contains(i)&&h.contains(s)&&i!==null&&!Ve(i)&&_t(i)===l}catch{return!1}}function _t(l){for(;l!=null;){let i=l.__lexicalEditor;if(i!=null)return i;l=pr(l)}return null}function Et(l){return l.isToken()||l.isSegmented()}function St(l){for(;l!=null;){if(l.nodeType===3)return l;l=l.firstChild}return null}function Ot(l,i,s){let h=te[i];return s!==null&&(l&h)===(s&h)||(l^=h,i==="subscript"?l&=~te.superscript:i==="superscript"&&(l&=~te.subscript)),l}function At(l,i){if(i!=null)l.__key=i;else{Jn(),99<mo&&Y(14),i=ln();var s=yr(),h=""+kt++;s._nodeMap.set(h,l),Ze(l)?i._dirtyElements.set(h,!0):i._dirtyLeaves.add(h),i._cloneNotNeeded.add(h),i._dirtyType=1,l.__key=h}}function xt(l){var i=l.getParent();if(i!==null){let C=l.getWritable();i=i.getWritable();var s=l.getPreviousSibling();if(l=l.getNextSibling(),s===null)if(l!==null){var h=l.getWritable();i.__first=l.__key,h.__prev=null}else i.__first=null;else{if(h=s.getWritable(),l!==null){let S=l.getWritable();S.__prev=h.__key,h.__next=S.__key}else h.__next=null;C.__prev=null}l===null?s!==null?(l=s.getWritable(),i.__last=s.__key,l.__next=null):i.__last=null:(l=l.getWritable(),s!==null?(s=s.getWritable(),s.__next=l.__key,l.__prev=s.__key):l.__prev=null,C.__next=null),i.__size--,C.__parent=null}}function Qt(l){99<mo&&Y(14);var i=l.getLatest(),s=i.__parent,h=yr();let C=ln(),S=h._nodeMap;if(h=C._dirtyElements,s!==null)e:for(;s!==null;){if(h.has(s))break e;let A=S.get(s);if(A===void 0)break;h.set(s,!1),s=A.__parent}i=i.__key,C._dirtyType=1,Ze(l)?h.set(i,!0):C._dirtyLeaves.add(i)}function bt(l){Jn();var i=ln();let s=i._compositionKey;l!==s&&(i._compositionKey=l,s!==null&&(i=It(s),i!==null&&i.getWritable()),l!==null&&(l=It(l),l!==null&&l.getWritable()))}function Ut(){return oi()?null:ln()._compositionKey}function It(l,i){return l=(i||yr())._nodeMap.get(l),l===void 0?null:l}function hr(l,i){let s=ln();return l=l[`__lexicalKey_${s._key}`],l!==void 0?It(l,i):null}function Sr(l,i){for(;l!=null;){let s=hr(l,i);if(s!==null)return s;l=pr(l)}return null}function Fi(l){let i=Object.assign({},l._decorators);return l._pendingDecorators=i}function ps(l){return l.read(()=>fn().getTextContent())}function ms(l,i){sr(l,()=>{var s=yr();if(!s.isEmpty())if(i==="root")fn().markDirty();else{s=s._nodeMap;for(let[,h]of s)h.markDirty()}},l._pendingEditorState===null?{tag:"history-merge"}:void 0)}function fn(){return yr()._nodeMap.get("root")}function gr(l){Jn();let i=yr();l!==null&&(l.dirty=!0,l.setCachedNodes(null)),i._selection=l}function Jr(l){var i=ln(),s;e:{for(s=l;s!=null;){let h=s[`__lexicalKey_${i._key}`];if(h!==void 0){s=h;break e}s=pr(s)}s=null}return s===null?(i=i.getRootElement(),l===i?It("root"):null):It(s)}function _s(l){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(l)}function ye(l){let i=[];for(;l!==null;)i.push(l),l=l._parentEditor;return i}function Ge(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function nt(l,i,s){if(i=kr(i._window),i!==null){var h=i.anchorNode,{anchorOffset:C,focusOffset:S}=i;if(h!==null&&(i=h.nodeType===3?h.nodeValue:null,h=Sr(h),i!==null&&ht(h))){if(i===Te&&s){let A=s.length;i=s,S=C=A}i!==null&&Nt(h,i,C,S,l)}}}function Nt(l,i,s,h,C){let S=l;if(S.isAttached()&&(C||!S.isDirty())){let Se=S.isComposing(),Fe=i;if((Se||C)&&i[i.length-1]===Te&&(Fe=i.slice(0,-1)),i=S.getTextContent(),C||Fe!==i)if(Fe==="")if(bt(null),M||Z||se)S.remove();else{let Ke=ln();setTimeout(()=>{Ke.update(()=>{S.isAttached()&&S.remove()})},20)}else{C=S.getParent(),i=Ui();var A=S.getTextContentSize(),J=Ut(),ge=S.getKey();S.isToken()||J!==null&&ge===J&&!Se||wt(i)&&(C!==null&&!C.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===l.__key&&i.anchor.offset===0&&!S.canInsertTextBefore()||i.focus.key===l.__key&&i.focus.offset===A&&!S.canInsertTextAfter())?S.markDirty():(l=Vt(),wt(l)&&s!==null&&h!==null&&(l.setTextNodeRange(S,s,S,h),S.isSegmented()&&(s=S.getTextContent(),s=Bn(s),S.replace(s),S=s)),S.setTextContent(Fe))}}}function Ht(l,i){if(i.isSegmented())return!0;if(!l.isCollapsed())return!1;l=l.anchor.offset;let s=i.getParentOrThrow(),h=i.isToken();return l===0?((l=!i.canInsertTextBefore()||!s.canInsertTextBefore()||h)||(i=i.getPreviousSibling(),l=(ht(i)||Ze(i)&&i.isInline())&&!i.canInsertTextAfter()),l):l===i.getTextContentSize()?!i.canInsertTextAfter()||!s.canInsertTextAfter()||h:!1}function Kt(l,i){l.__lexicalClassNameCache===void 0&&(l.__lexicalClassNameCache={});let s=l.__lexicalClassNameCache,h=s[i];return h!==void 0?h:(l=l[i],typeof l=="string"?(l=l.split(" "),s[i]=l):l)}function $t(l,i,s,h,C){s.size!==0&&(s=h.__type,h=h.__key,i=i.get(s),i===void 0&&Y(33,s),s=i.klass,i=l.get(s),i===void 0&&(i=new Map,l.set(s,i)),l=i.get(h),s=l==="destroyed"&&C==="created",(l===void 0||s)&&i.set(h,s?"updated":C))}function Pt(l,i,s){let h=l.getParent(),C=s;return h!==null&&(i&&s===0?(C=l.getIndexWithinParent(),l=h):i||s!==l.getChildrenSize()||(C=l.getIndexWithinParent()+1,l=h)),l.getChildAtIndex(i?C-1:C)}function mn(l,i){var s=l.offset;return l.type==="element"?(l=l.getNode(),Pt(l,i,s)):(l=l.getNode(),i&&s===0||!i&&s===l.getTextContentSize()?(s=i?l.getPreviousSibling():l.getNextSibling(),s===null?Pt(l.getParentOrThrow(),i,l.getIndexWithinParent()+(i?0:1)):s):null)}function sn(l){return l=(l=qn(l).event)&&l.inputType,l==="insertFromPaste"||l==="insertFromPasteAsQuotation"}function nn(l){return!tr(l)&&!l.isLastChild()&&!l.isInline()}function $n(l,i){return l=l._keyToDOMMap.get(i),l===void 0&&Y(75,i),l}function pr(l){return l=l.assignedSlot||l.parentElement,l!==null&&l.nodeType===11?l.host:l}function mi(l,i){for(l=l.getParent();l!==null;){if(l.is(i))return!0;l=l.getParent()}return!1}function qn(l){return l=l._window,l===null&&Y(78),l}function ul(l){for(l=l.getParentOrThrow();l!==null&&!Xr(l);)l=l.getParentOrThrow();return l}function Xr(l){return tr(l)||Ze(l)&&l.isShadowRoot()}function dl(l){return l=l.constructor.clone(l),At(l,null),l}function Bi(l){var i=ln();let s=l.constructor.getType();return i=i._nodes.get(s),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(l),i instanceof l.constructor||Y(98),i):l}function ys(l,i){l=l.getParent(),!tr(l)||Ze(i)||an(i)||Y(99)}function fl(l){return(an(l)||Ze(l)&&!l.canBeEmpty())&&!l.isInline()}function hl(l,i,s){s.style.removeProperty("caret-color"),i._blockCursorElement=null,i=l.parentElement,i!==null&&i.removeChild(l)}function kr(l){return G?(l||window).getSelection():null}function Ns(l,i){for(;l!==fn()&&l!=null;){if(i(l))return l;l=l.getParent()}return null}function wc(l){let i=[],s=[l];for(;0<s.length;){let h=s.pop();h===void 0&&Y(112),Ze(h)&&s.unshift(...h.getChildren()),h!==l&&i.push(h)}return i}function io(l){return l.nodeType===1}function Qr(l){if(an(l)&&!l.isInline())return!0;if(!Ze(l)||Xr(l))return!1;var i=l.getFirstChild();return i=i===null||Ei(i)||ht(i)||i.isInline(),!l.isInline()&&l.canBeEmpty()!==!1&&i}function Lo(l,i){for(;l!==null&&l.getParent()!==null&&!i(l);)l=l.getParentOrThrow();return i(l)?l:null}function la(l,i,s,h,C,S){for(l=l.getFirstChild();l!==null;){let A=l.__key;l.__parent===i&&(Ze(l)&&la(l,A,s,h,C,S),s.has(A)||S.delete(A),C.push(A)),l=l.getNextSibling()}}function gl(l,i,s,h){l=l._nodeMap,i=i._nodeMap;let C=[];for(let[S]of h){let A=i.get(S);A===void 0||A.isAttached()||(Ze(A)&&la(A,S,l,i,C,h),l.has(S)||h.delete(S),C.push(S))}for(let S of C)i.delete(S);for(let S of s)h=i.get(S),h===void 0||h.isAttached()||(l.has(S)||s.delete(S),i.delete(S))}let On="",Ln="",wr="",_i,Fn,ko,yi=!1,oo=!1,Cs,_n=null,Ir,En,Ni,mr,Es,so;function Ts(l,i){let s=Ni.get(l);if(i!==null){let h=ml(l);h.parentNode===i&&i.removeChild(h)}mr.has(l)||Fn._keyToDOMMap.delete(l),Ze(s)&&(l=Io(s,Ni),Zn(l,0,l.length-1,null)),s!==void 0&&$t(so,ko,Cs,s,"destroyed")}function Zn(l,i,s,h){for(;i<=s;++i){let C=l[i];C!==void 0&&Ts(C,h)}}function Ci(l,i){l.setProperty("text-align",i)}function Or(l,i){var s=_i.theme.indent;if(typeof s=="string"){let h=l.classList.contains(s);0<i&&!h?l.classList.add(s):1>i&&h&&l.classList.remove(s)}s=getComputedStyle(l).getPropertyValue("--lexical-indent-base-value")||"40px",l.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${s})`)}function aa(l,i){l=l.style,i===0?Ci(l,""):i===1?Ci(l,"left"):i===2?Ci(l,"center"):i===3?Ci(l,"right"):i===4?Ci(l,"justify"):i===5?Ci(l,"start"):i===6&&Ci(l,"end")}function ei(l,i,s){let h=mr.get(l);h===void 0&&Y(60);let C=h.createDOM(_i,Fn);var S=Fn._keyToDOMMap;if(C["__lexicalKey_"+Fn._key]=l,S.set(l,C),ht(h)?C.setAttribute("data-lexical-text","true"):an(h)&&C.setAttribute("data-lexical-decorator","true"),Ze(h)){if(l=h.__indent,S=h.__size,l!==0&&Or(C,l),S!==0){--S,l=Io(h,mr);var A=Ln;Ln="",xs(l,h,0,S,C,null),vs(h,C),Ln=A}l=h.__format,l!==0&&aa(C,l),h.isInline()||pl(null,h,C),nn(h)&&(On+=`
42
42
 
43
43
  `,wr+=`
44
44
 
45
- `)}else S=h.getTextContent(),an(h)?(A=h.decorate(Fn,_i),A!==null&&Ss(l,A),N.contentEditable="false"):ht(h)&&(h.isDirectionless()||(Ln+=S)),On+=S,wr+=S;return i!==null&&(s!=null?i.insertBefore(N,s):(s=i.__lexicalLineBreak,s!=null?i.insertBefore(N,s):i.appendChild(N))),$t(so,ko,Cs,h,"created"),N}function xs(l,i,s,h,N,S){let A=On;for(On="";s<=h;++s)ei(l[s],N,S);nn(i)&&(On+=`
45
+ `)}else S=h.getTextContent(),an(h)?(A=h.decorate(Fn,_i),A!==null&&Ss(l,A),C.contentEditable="false"):ht(h)&&(h.isDirectionless()||(Ln+=S)),On+=S,wr+=S;return i!==null&&(s!=null?i.insertBefore(C,s):(s=i.__lexicalLineBreak,s!=null?i.insertBefore(C,s):i.appendChild(C))),$t(so,ko,Cs,h,"created"),C}function xs(l,i,s,h,C,S){let A=On;for(On="";s<=h;++s)ei(l[s],C,S);nn(i)&&(On+=`
46
46
 
47
- `),N.__lexicalTextContent=On,On=A+On}function ca(l,i){return l=i.get(l),Ei(l)||an(l)&&l.isInline()}function pl(l,i,s){l=l!==null&&(l.__size===0||ca(l.__last,Ni)),i=i.__size===0||ca(i.__last,mr),l?i||(i=s.__lexicalLineBreak,i!=null&&s.removeChild(i),s.__lexicalLineBreak=null):i&&(i=document.createElement("br"),s.__lexicalLineBreak=i,s.appendChild(i))}function vs(l,i){var s=i.__lexicalDir;if(i.__lexicalDirTextContent!==Ln||s!==_n){let S=Ln==="";if(S)var h=_n;else h=Ln,h=Ue.test(h)?"rtl":re.test(h)?"ltr":null;if(h!==s){let A=i.classList,J=_i.theme;var N=s!==null?J[s]:void 0;let ge=h!==null?J[h]:void 0;N!==void 0&&(typeof N=="string"&&(N=N.split(" "),N=J[s]=N),A.remove(...N)),h===null||S&&h==="ltr"?i.removeAttribute("dir"):(ge!==void 0&&(typeof ge=="string"&&(s=ge.split(" "),ge=J[h]=s),ge!==void 0&&A.add(...ge)),i.dir=h),oo||(l.getWritable().__dir=h)}_n=h,i.__lexicalDirTextContent=Ln,i.__lexicalDir=h}}function Io(l,i){let s=[];for(l=l.__first;l!==null;){let h=i.get(l);h===void 0&&Y(101),s.push(l),l=h.__next}return s}function lo(l,i){var s=Ni.get(l),h=mr.get(l);s!==void 0&&h!==void 0||Y(61);var N=yi||En.has(l)||Ir.has(l);let S=$n(Fn,l);if(s===h&&!N)return Ze(s)?(h=S.__lexicalTextContent,h!==void 0&&(On+=h,wr+=h),h=S.__lexicalDirTextContent,h!==void 0&&(Ln+=h)):(h=s.getTextContent(),ht(s)&&!s.isDirectionless()&&(Ln+=h),wr+=h,On+=h),S;if(s!==h&&N&&$t(so,ko,Cs,h,"updated"),h.updateDOM(s,S,_i))return h=ei(l,null,null),i===null&&Y(62),i.replaceChild(h,S),Ts(l,null),h;if(Ze(s)&&Ze(h)){if(l=h.__indent,l!==s.__indent&&Or(S,l),l=h.__format,l!==s.__format&&aa(S,l),N){l=h,N=Ln,Ln="",i=On;var A=s.__size,J=l.__size;if(On="",A===1&&J===1){var ge=s.__first,Se=l.__first;if(ge===Se)lo(ge,S);else{var Fe=ml(ge);Se=ei(Se,null,null),S.replaceChild(Se,Fe),Ts(ge,null)}}else{Se=Io(s,Ni);var Ke=Io(l,mr);if(A===0)J!==0&&xs(Ke,l,0,J-1,S,null);else if(J===0)A!==0&&(ge=S.__lexicalLineBreak==null,Zn(Se,0,A-1,ge?null:S),ge&&(S.textContent=""));else{var ke=Se;Se=Ke,Ke=A-1,A=J-1;let Xe=S.firstChild,ut=0;for(J=0;ut<=Ke&&J<=A;){var Ae=ke[ut];let Tt=Se[J];if(Ae===Tt)Xe=Po(lo(Tt,S)),ut++,J++;else{ge===void 0&&(ge=new Set(ke)),Fe===void 0&&(Fe=new Set(Se));let Mt=Fe.has(Ae),hn=ge.has(Tt);Mt?(hn?(Ae=$n(Fn,Tt),Ae===Xe?Xe=Po(lo(Tt,S)):(Xe!=null?S.insertBefore(Ae,Xe):S.appendChild(Ae),lo(Tt,S)),ut++):ei(Tt,S,Xe),J++):(Xe=Po(ml(Ae)),Ts(Ae,S),ut++)}}ge=ut>Ke,Fe=J>A,ge&&!Fe?(ge=Se[A+1],ge=ge===void 0?null:Fn.getElementByKey(ge),xs(Se,l,J,A,S,ge)):Fe&&!ge&&Zn(ke,ut,Ke,S)}}nn(l)&&(On+=`
47
+ `),C.__lexicalTextContent=On,On=A+On}function ca(l,i){return l=i.get(l),Ei(l)||an(l)&&l.isInline()}function pl(l,i,s){l=l!==null&&(l.__size===0||ca(l.__last,Ni)),i=i.__size===0||ca(i.__last,mr),l?i||(i=s.__lexicalLineBreak,i!=null&&s.removeChild(i),s.__lexicalLineBreak=null):i&&(i=document.createElement("br"),s.__lexicalLineBreak=i,s.appendChild(i))}function vs(l,i){var s=i.__lexicalDir;if(i.__lexicalDirTextContent!==Ln||s!==_n){let S=Ln==="";if(S)var h=_n;else h=Ln,h=Ue.test(h)?"rtl":re.test(h)?"ltr":null;if(h!==s){let A=i.classList,J=_i.theme;var C=s!==null?J[s]:void 0;let ge=h!==null?J[h]:void 0;C!==void 0&&(typeof C=="string"&&(C=C.split(" "),C=J[s]=C),A.remove(...C)),h===null||S&&h==="ltr"?i.removeAttribute("dir"):(ge!==void 0&&(typeof ge=="string"&&(s=ge.split(" "),ge=J[h]=s),ge!==void 0&&A.add(...ge)),i.dir=h),oo||(l.getWritable().__dir=h)}_n=h,i.__lexicalDirTextContent=Ln,i.__lexicalDir=h}}function Io(l,i){let s=[];for(l=l.__first;l!==null;){let h=i.get(l);h===void 0&&Y(101),s.push(l),l=h.__next}return s}function lo(l,i){var s=Ni.get(l),h=mr.get(l);s!==void 0&&h!==void 0||Y(61);var C=yi||En.has(l)||Ir.has(l);let S=$n(Fn,l);if(s===h&&!C)return Ze(s)?(h=S.__lexicalTextContent,h!==void 0&&(On+=h,wr+=h),h=S.__lexicalDirTextContent,h!==void 0&&(Ln+=h)):(h=s.getTextContent(),ht(s)&&!s.isDirectionless()&&(Ln+=h),wr+=h,On+=h),S;if(s!==h&&C&&$t(so,ko,Cs,h,"updated"),h.updateDOM(s,S,_i))return h=ei(l,null,null),i===null&&Y(62),i.replaceChild(h,S),Ts(l,null),h;if(Ze(s)&&Ze(h)){if(l=h.__indent,l!==s.__indent&&Or(S,l),l=h.__format,l!==s.__format&&aa(S,l),C){l=h,C=Ln,Ln="",i=On;var A=s.__size,J=l.__size;if(On="",A===1&&J===1){var ge=s.__first,Se=l.__first;if(ge===Se)lo(ge,S);else{var Fe=ml(ge);Se=ei(Se,null,null),S.replaceChild(Se,Fe),Ts(ge,null)}}else{Se=Io(s,Ni);var Ke=Io(l,mr);if(A===0)J!==0&&xs(Ke,l,0,J-1,S,null);else if(J===0)A!==0&&(ge=S.__lexicalLineBreak==null,Zn(Se,0,A-1,ge?null:S),ge&&(S.textContent=""));else{var ke=Se;Se=Ke,Ke=A-1,A=J-1;let Xe=S.firstChild,ut=0;for(J=0;ut<=Ke&&J<=A;){var Ae=ke[ut];let Tt=Se[J];if(Ae===Tt)Xe=Po(lo(Tt,S)),ut++,J++;else{ge===void 0&&(ge=new Set(ke)),Fe===void 0&&(Fe=new Set(Se));let Mt=Fe.has(Ae),hn=ge.has(Tt);Mt?(hn?(Ae=$n(Fn,Tt),Ae===Xe?Xe=Po(lo(Tt,S)):(Xe!=null?S.insertBefore(Ae,Xe):S.appendChild(Ae),lo(Tt,S)),ut++):ei(Tt,S,Xe),J++):(Xe=Po(ml(Ae)),Ts(Ae,S),ut++)}}ge=ut>Ke,Fe=J>A,ge&&!Fe?(ge=Se[A+1],ge=ge===void 0?null:Fn.getElementByKey(ge),xs(Se,l,J,A,S,ge)):Fe&&!ge&&Zn(ke,ut,Ke,S)}}nn(l)&&(On+=`
48
48
 
49
- `),S.__lexicalTextContent=On,On=i+On,vs(l,S),Ln=N,tr(h)||h.isInline()||pl(s,h,S)}nn(h)&&(On+=`
49
+ `),S.__lexicalTextContent=On,On=i+On,vs(l,S),Ln=C,tr(h)||h.isInline()||pl(s,h,S)}nn(h)&&(On+=`
50
50
 
51
51
  `,wr+=`
52
52
 
53
- `)}else s=h.getTextContent(),an(h)?(N=h.decorate(Fn,_i),N!==null&&Ss(l,N)):ht(h)&&!h.isDirectionless()&&(Ln+=s),On+=s,wr+=s;return!oo&&tr(h)&&h.__cachedText!==wr&&(h=h.getWritable(),h.__cachedText=wr),S}function Ss(l,i){let s=Fn._pendingDecorators,h=Fn._decorators;if(s===null){if(h[l]===i)return;s=Fi(Fn)}s[l]=i}function Po(l){return l=l.nextSibling,l!==null&&l===Fn._blockCursorElement&&(l=l.nextSibling),l}function ml(l){let i=Es.get(l);return i===void 0&&Y(75,l),i}let ti=Object.freeze({}),_l=[["keydown",bc],["pointerdown",Dc],["compositionstart",Mc],["compositionend",Rc],["input",Ac],["click",Oc],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];y&&_l.push(["beforeinput",(l,i)=>ya(l,i)]);let $o=0,ua=0,da=0,ao=null,Fo=0,yl=!1,Nl=!1,Bo=!1,Ho=!1,fa=[0,"",0,"root",0];function ha(l,i,s,h,N){let S=l.anchor,A=l.focus,J=S.getNode();var ge=ln();let Se=kr(ge._window),Fe=Se!==null?Se.anchorNode:null,Ke=S.key;ge=ge.getElementByKey(Ke);let ke=s.length;return Ke!==A.key||!ht(J)||(!N&&(!y||da<h+50)||J.isDirty()&&2>ke||_s(s))&&S.offset!==A.offset&&!J.isComposing()||Et(J)||J.isDirty()&&1<ke||(N||!y)&&ge!==null&&!J.isComposing()&&Fe!==St(ge)||Se!==null&&i!==null&&(!i.collapsed||i.startContainer!==Se.anchorNode||i.startOffset!==Se.anchorOffset)||J.getFormat()!==l.format||J.getStyle()!==l.style||Ht(l,J)}function ga(l,i){return l!==null&&l.nodeValue!==null&&l.nodeType===3&&i!==0&&i!==l.nodeValue.length}function pa(l,i,s){let{anchorNode:h,anchorOffset:N,focusNode:S,focusOffset:A}=l;yl&&(yl=!1,ga(h,N)&&ga(S,A))||sr(i,()=>{if(!s)gr(null);else if(rt(i,h,S)){var J=Vt();if(wt(J)){var ge=J.anchor,Se=ge.getNode();if(J.isCollapsed()){l.type==="Range"&&l.anchorNode===l.focusNode&&(J.dirty=!0);var Fe=qn(i).event;Fe=Fe?Fe.timeStamp:performance.now();let[ke,Ae,Xe,ut,Tt]=fa;var Ke=fn();Ke=i.isComposing()===!1&&Ke.getTextContent()==="",Fe<Tt+200&&ge.offset===Xe&&ge.key===ut?(J.format=ke,J.style=Ae):ge.type==="text"?(J.format=Se.getFormat(),J.style=Se.getStyle()):ge.type!=="element"||Ke||(J.format=0,J.style="")}else{ge=255,Se=!1,Fe=J.getNodes(),Ke=Fe.length;for(let ke=0;ke<Ke;ke++){let Ae=Fe[ke];if(ht(Ae)&&(Se=!0,ge&=Ae.getFormat(),ge===0))break}J.format=Se?ge:0}}ot(i,t,void 0)}})}function Oc(l,i){sr(i,()=>{let s=Vt();var h=kr(i._window);let N=Ui();if(h)if(wt(s)){let A=s.anchor;var S=A.getNode();A.type==="element"&&A.offset===0&&s.isCollapsed()&&!tr(S)&&fn().getChildrenSize()===1&&S.getTopLevelElementOrThrow().isEmpty()&&N!==null&&s.is(N)?(h.removeAllRanges(),s.dirty=!0):l.detail!==3||s.isCollapsed()||(h=s.focus.getNode(),S!==h&&(Ze(S)?S.select(0):S.getParentOrThrow().select(0)))}else l.pointerType==="touch"&&(S=h.anchorNode,S!==null&&(S=S.nodeType,S===1||S===3))&&(h=Hn(N,h,i),gr(h));ot(i,e,l)})}function Dc(l,i){let s=l.target;l=l.pointerType,s instanceof Node&&l!=="touch"&&sr(i,()=>{an(Sr(s))||(Nl=!0)})}function ma(l){return l.getTargetRanges?(l=l.getTargetRanges(),l.length===0?null:l[0]):null}function _a(l,i){return l!==i||Ze(l)||Ze(i)||!l.isToken()||!i.isToken()}function ya(l,i){let s=l.inputType,h=ma(l);s==="deleteCompositionText"||m&&sn(i)||s!=="insertCompositionText"&&sr(i,()=>{let N=Vt();if(s==="deleteContentBackward"){if(N===null){var S=Ui();if(!wt(S))return;gr(S.clone())}if(wt(N)){ae&&bt(N.anchor.key),ua===229&&l.timeStamp<$o+30&&i.isComposing()&&N.anchor.key===N.focus.key?(bt(null),$o=0,setTimeout(()=>{sr(i,()=>{bt(null)})},30),wt(N)&&(S=N.anchor.getNode(),S.markDirty(),N.format=S.getFormat(),N.style=S.getStyle()),1>=N.anchor.getNode().getTextContent().length&&(l.preventDefault(),ot(i,n,!0))):(l.preventDefault(),ot(i,n,!0));return}}if(wt(N)){S=l.data,ao!==null&&nt(!1,i,ao),N.dirty&&ao===null||!N.isCollapsed()||tr(N.anchor.getNode())||h===null||N.applyDOMRange(h),ao=null;var A=N.focus,J=N.anchor.getNode();if(A=A.getNode(),s==="insertText"||s==="insertTranspose")S===`
53
+ `)}else s=h.getTextContent(),an(h)?(C=h.decorate(Fn,_i),C!==null&&Ss(l,C)):ht(h)&&!h.isDirectionless()&&(Ln+=s),On+=s,wr+=s;return!oo&&tr(h)&&h.__cachedText!==wr&&(h=h.getWritable(),h.__cachedText=wr),S}function Ss(l,i){let s=Fn._pendingDecorators,h=Fn._decorators;if(s===null){if(h[l]===i)return;s=Fi(Fn)}s[l]=i}function Po(l){return l=l.nextSibling,l!==null&&l===Fn._blockCursorElement&&(l=l.nextSibling),l}function ml(l){let i=Es.get(l);return i===void 0&&Y(75,l),i}let ti=Object.freeze({}),_l=[["keydown",bc],["pointerdown",Dc],["compositionstart",Mc],["compositionend",Rc],["input",Ac],["click",Oc],["cut",ti],["copy",ti],["dragstart",ti],["dragover",ti],["dragend",ti],["paste",ti],["focus",ti],["blur",ti],["drop",ti]];y&&_l.push(["beforeinput",(l,i)=>ya(l,i)]);let $o=0,ua=0,da=0,ao=null,Fo=0,yl=!1,Nl=!1,Bo=!1,Ho=!1,fa=[0,"",0,"root",0];function ha(l,i,s,h,C){let S=l.anchor,A=l.focus,J=S.getNode();var ge=ln();let Se=kr(ge._window),Fe=Se!==null?Se.anchorNode:null,Ke=S.key;ge=ge.getElementByKey(Ke);let ke=s.length;return Ke!==A.key||!ht(J)||(!C&&(!y||da<h+50)||J.isDirty()&&2>ke||_s(s))&&S.offset!==A.offset&&!J.isComposing()||Et(J)||J.isDirty()&&1<ke||(C||!y)&&ge!==null&&!J.isComposing()&&Fe!==St(ge)||Se!==null&&i!==null&&(!i.collapsed||i.startContainer!==Se.anchorNode||i.startOffset!==Se.anchorOffset)||J.getFormat()!==l.format||J.getStyle()!==l.style||Ht(l,J)}function ga(l,i){return l!==null&&l.nodeValue!==null&&l.nodeType===3&&i!==0&&i!==l.nodeValue.length}function pa(l,i,s){let{anchorNode:h,anchorOffset:C,focusNode:S,focusOffset:A}=l;yl&&(yl=!1,ga(h,C)&&ga(S,A))||sr(i,()=>{if(!s)gr(null);else if(rt(i,h,S)){var J=Vt();if(wt(J)){var ge=J.anchor,Se=ge.getNode();if(J.isCollapsed()){l.type==="Range"&&l.anchorNode===l.focusNode&&(J.dirty=!0);var Fe=qn(i).event;Fe=Fe?Fe.timeStamp:performance.now();let[ke,Ae,Xe,ut,Tt]=fa;var Ke=fn();Ke=i.isComposing()===!1&&Ke.getTextContent()==="",Fe<Tt+200&&ge.offset===Xe&&ge.key===ut?(J.format=ke,J.style=Ae):ge.type==="text"?(J.format=Se.getFormat(),J.style=Se.getStyle()):ge.type!=="element"||Ke||(J.format=0,J.style="")}else{ge=255,Se=!1,Fe=J.getNodes(),Ke=Fe.length;for(let ke=0;ke<Ke;ke++){let Ae=Fe[ke];if(ht(Ae)&&(Se=!0,ge&=Ae.getFormat(),ge===0))break}J.format=Se?ge:0}}ot(i,t,void 0)}})}function Oc(l,i){sr(i,()=>{let s=Vt();var h=kr(i._window);let C=Ui();if(h)if(wt(s)){let A=s.anchor;var S=A.getNode();A.type==="element"&&A.offset===0&&s.isCollapsed()&&!tr(S)&&fn().getChildrenSize()===1&&S.getTopLevelElementOrThrow().isEmpty()&&C!==null&&s.is(C)?(h.removeAllRanges(),s.dirty=!0):l.detail!==3||s.isCollapsed()||(h=s.focus.getNode(),S!==h&&(Ze(S)?S.select(0):S.getParentOrThrow().select(0)))}else l.pointerType==="touch"&&(S=h.anchorNode,S!==null&&(S=S.nodeType,S===1||S===3))&&(h=Hn(C,h,i),gr(h));ot(i,e,l)})}function Dc(l,i){let s=l.target;l=l.pointerType,s instanceof Node&&l!=="touch"&&sr(i,()=>{an(Sr(s))||(Nl=!0)})}function ma(l){return l.getTargetRanges?(l=l.getTargetRanges(),l.length===0?null:l[0]):null}function _a(l,i){return l!==i||Ze(l)||Ze(i)||!l.isToken()||!i.isToken()}function ya(l,i){let s=l.inputType,h=ma(l);s==="deleteCompositionText"||m&&sn(i)||s!=="insertCompositionText"&&sr(i,()=>{let C=Vt();if(s==="deleteContentBackward"){if(C===null){var S=Ui();if(!wt(S))return;gr(S.clone())}if(wt(C)){ae&&bt(C.anchor.key),ua===229&&l.timeStamp<$o+30&&i.isComposing()&&C.anchor.key===C.focus.key?(bt(null),$o=0,setTimeout(()=>{sr(i,()=>{bt(null)})},30),wt(C)&&(S=C.anchor.getNode(),S.markDirty(),C.format=S.getFormat(),C.style=S.getStyle()),1>=C.anchor.getNode().getTextContent().length&&(l.preventDefault(),ot(i,n,!0))):(l.preventDefault(),ot(i,n,!0));return}}if(wt(C)){S=l.data,ao!==null&&nt(!1,i,ao),C.dirty&&ao===null||!C.isCollapsed()||tr(C.anchor.getNode())||h===null||C.applyDOMRange(h),ao=null;var A=C.focus,J=C.anchor.getNode();if(A=A.getNode(),s==="insertText"||s==="insertTranspose")S===`
54
54
  `?(l.preventDefault(),ot(i,r,!1)):S===`
55
55
 
56
- `?(l.preventDefault(),ot(i,c,void 0)):S==null&&l.dataTransfer?(S=l.dataTransfer.getData("text/plain"),l.preventDefault(),N.insertRawText(S)):S!=null&&ha(N,h,S,l.timeStamp,!0)?(l.preventDefault(),ot(i,d,S)):ao=S,da=l.timeStamp;else switch(l.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ot(i,d,l);break;case"insertFromComposition":bt(null),ot(i,d,l);break;case"insertLineBreak":bt(null),ot(i,r,!1);break;case"insertParagraph":bt(null),Bo&&!Z?(Bo=!1,ot(i,r,!1)):ot(i,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ot(i,g,l);break;case"deleteByComposition":_a(J,A)&&ot(i,p,l);break;case"deleteByDrag":case"deleteByCut":ot(i,p,l);break;case"deleteContent":ot(i,n,!1);break;case"deleteWordBackward":ot(i,C,!0);break;case"deleteWordForward":ot(i,C,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ot(i,v,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ot(i,v,!1);break;case"formatStrikeThrough":ot(i,T,"strikethrough");break;case"formatBold":ot(i,T,"bold");break;case"formatItalic":ot(i,T,"italic");break;case"formatUnderline":ot(i,T,"underline");break;case"historyUndo":ot(i,O,void 0);break;case"historyRedo":ot(i,R,void 0)}}})}function Ac(l,i){l.stopPropagation(),sr(i,()=>{var s=Vt(),h=l.data,N=ma(l);if(h!=null&&wt(s)&&ha(s,N,h,l.timeStamp,!1)){Ho&&(Cl(i,h),Ho=!1);var S=s.anchor,A=S.getNode();if(N=kr(i._window),N===null)return;let J=S.offset;(S=y&&!s.isCollapsed()&&ht(A)&&N.anchorNode!==null)&&(A=A.getTextContent().slice(0,J)+h+A.getTextContent().slice(J+s.focus.offset),N=N.anchorNode,S=A===(N.nodeType===3?N.nodeValue:null)),S||ot(i,d,h),h=h.length,m&&1<h&&l.inputType==="insertCompositionText"&&!i.isComposing()&&(s.anchor.offset-=h),M||Z||se||!i.isComposing()||($o=0,bt(null))}else nt(!1,i,h!==null?h:void 0),Ho&&(Cl(i,h||void 0),Ho=!1);Jn(),s=ln(),Oe(s)}),ao=null}function Mc(l,i){sr(i,()=>{let s=Vt();if(wt(s)&&!i.isComposing()){let h=s.anchor,N=s.anchor.getNode();bt(h.key),(l.timeStamp<$o+30||h.type==="element"||!s.isCollapsed()||N.getFormat()!==s.format||N.getStyle()!==s.style)&&ot(i,d,be)}})}function Cl(l,i){var s=l._compositionKey;if(bt(null),s!==null&&i!=null){if(i===""){i=It(s),l=St(l.getElementByKey(s)),l!==null&&l.nodeValue!==null&&ht(i)&&Nt(i,l.nodeValue,null,null,!0);return}if(i[i.length-1]===`
57
- `&&(s=Vt(),wt(s))){i=s.focus,s.anchor.set(i.key,i.offset,i.type),ot(l,B,null);return}}nt(!0,l,i)}function Rc(l,i){m?Ho=!0:sr(i,()=>{Cl(i,l.data)})}function bc(l,i){if($o=l.timeStamp,ua=l.keyCode,!i.isComposing()){var{keyCode:s,shiftKey:h,ctrlKey:N,metaKey:S,altKey:A}=l;if(!ot(i,b,l)){if(s!==39||N||S||A)if(s!==39||A||h||!N&&!S)if(s!==37||N||S||A)if(s!==37||A||h||!N&&!S)if(s!==38||N||S)if(s!==40||N||S)if(s===13&&h)Bo=!0,ot(i,B,l);else if(s===32)ot(i,z,l);else if(k&&N&&s===79)l.preventDefault(),Bo=!0,ot(i,r,!0);else if(s!==13||h){var J=k?A||S?!1:s===8||s===72&&N:N||A||S?!1:s===8;J?s===8?ot(i,X,l):(l.preventDefault(),ot(i,n,!0)):s===27?ot(i,ee,l):(J=k?h||A||S?!1:s===46||s===68&&N:N||A||S?!1:s===46,J?s===46?ot(i,le,l):(l.preventDefault(),ot(i,n,!1)):s===8&&(k?A:N)?(l.preventDefault(),ot(i,C,!0)):s===46&&(k?A:N)?(l.preventDefault(),ot(i,C,!1)):k&&S&&s===8?(l.preventDefault(),ot(i,v,!0)):k&&S&&s===46?(l.preventDefault(),ot(i,v,!1)):s===66&&!A&&(k?S:N)?(l.preventDefault(),ot(i,T,"bold")):s===85&&!A&&(k?S:N)?(l.preventDefault(),ot(i,T,"underline")):s===73&&!A&&(k?S:N)?(l.preventDefault(),ot(i,T,"italic")):s!==9||A||N||S?s===90&&!h&&(k?S:N)?(l.preventDefault(),ot(i,O,void 0)):(J=k?s===90&&S&&h:s===89&&N||s===90&&N&&h,J?(l.preventDefault(),ot(i,R,void 0)):Go(i._editorState._selection)?(J=h?!1:s===67?k?S:N:!1,J?(l.preventDefault(),ot(i,pe,l)):(J=h?!1:s===88?k?S:N:!1,J?(l.preventDefault(),ot(i,ue,l)):s===65&&(k?S:N)&&(l.preventDefault(),ot(i,K,l)))):!m&&s===65&&(k?S:N)&&(l.preventDefault(),ot(i,K,l))):ot(i,j,l))}else Bo=!1,ot(i,B,l);else ot(i,H,l);else ot(i,P,l);else ot(i,W,l);else ot(i,$,l);else ot(i,w,l);else ot(i,x,l);(N||h||A||S)&&ot(i,ne,l)}}}function Na(l){let i=l.__lexicalEventHandles;return i===void 0&&(i=[],l.__lexicalEventHandles=i),i}let co=new Map;function Ca(l){l=l.target;let i=kr(l==null?null:l.nodeType===9?l.defaultView:l.ownerDocument.defaultView);if(i!==null){var s=_t(i.anchorNode);if(s!==null){Nl&&(Nl=!1,sr(s,()=>{var A=Ui(),J=i.anchorNode;J!==null&&(J=J.nodeType,J===1||J===3)&&(A=Hn(A,i,s),gr(A))})),l=ye(s),l=l[l.length-1];var h=l._key,N=co.get(h),S=N||l;S!==s&&pa(i,S,!1),pa(i,s,!0),s!==l?co.set(h,s):N&&co.delete(h)}}}function Lc(l,i){Fo===0&&l.ownerDocument.addEventListener("selectionchange",Ca),Fo++,l.__lexicalEditor=i;let s=Na(l);for(let h=0;h<_l.length;h++){let[N,S]=_l[h],A=typeof S=="function"?J=>{J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()&&S(J,i))}:J=>{if(J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()))switch(N){case"cut":return ot(i,ue,J);case"copy":return ot(i,pe,J);case"paste":return ot(i,g,J);case"dragstart":return ot(i,q,J);case"dragover":return ot(i,me,J);case"dragend":return ot(i,_e,J);case"focus":return ot(i,D,J);case"blur":return ot(i,V,J);case"drop":return ot(i,U,J)}};l.addEventListener(N,A),s.push(()=>{l.removeEventListener(N,A)})}}function El(l,i,s){Jn();var h=l.__key;let N=l.getParent();if(N!==null){var S=Vt();if(wt(S)&&Ze(l)){var{anchor:A,focus:J}=S,ge=A.getNode(),Se=J.getNode();mi(ge,l)&&A.set(l.__key,0,"element"),mi(Se,l)&&J.set(l.__key,0,"element")}if(ge=S,Se=!1,wt(ge)&&i){S=ge.anchor;let Fe=ge.focus;S.key===h&&(po(S,l,N,l.getPreviousSibling(),l.getNextSibling()),Se=!0),Fe.key===h&&(po(Fe,l,N,l.getPreviousSibling(),l.getNextSibling()),Se=!0)}else Go(ge)&&i&&l.isSelected()&&l.selectPrevious();wt(ge)&&i&&!Se?(h=l.getIndexWithinParent(),xt(l),go(ge,N,h,-1)):xt(l),s||Xr(N)||N.canBeEmpty()||!N.isEmpty()||El(N,i),i&&tr(N)&&N.isEmpty()&&N.selectEnd()}}class ni{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,At(this,i)}getType(){return this.__type}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=It(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let s=i.getNodes().some(h=>h.__key===this.__key);return ht(this)?s:wt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:s}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let s=0;for(;i!==null;){if(this.is(i))return s;s++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:It(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let s=i.getParent();if(Xr(s))return i;i=s}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],s=this.getParent();for(;s!==null;)i.push(s),s=s.getParent();return i}getParentKeys(){let i=[],s=this.getParent();for(;s!==null;)i.push(s.__key),s=s.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:It(i)}getPreviousSiblings(){let i=[];var s=this.getParent();if(s===null)return i;for(s=s.getFirstChild();s!==null&&!s.is(this);)i.push(s),s=s.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:It(i)}getNextSiblings(){let i=[],s=this.getNextSibling();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getCommonAncestor(i){let s=this.getParents();var h=i.getParents();Ze(this)&&s.unshift(this),Ze(i)&&h.unshift(i),i=s.length;var N=h.length;if(i===0||N===0||s[i-1]!==h[N-1])return null;for(h=new Set(h),N=0;N<i;N++){let S=s[N];if(h.has(S))return S}return null}is(i){return i==null?!1:this.__key===i.__key}isBefore(i){if(this===i)return!1;if(i.isParentOf(this))return!0;if(this.isParentOf(i))return!1;var s=this.getCommonAncestor(i);let h=this;for(;;){var N=h.getParentOrThrow();if(N===s){N=h.getIndexWithinParent();break}h=N}for(h=i;;){if(i=h.getParentOrThrow(),i===s){s=h.getIndexWithinParent();break}h=i}return N<s}isParentOf(i){let s=this.__key;if(s===i.__key)return!1;for(;i!==null;){if(i.__key===s)return!0;i=i.getParent()}return!1}getNodesBetween(i){let s=this.isBefore(i),h=[],N=new Set;for(var S=this;;){var A=S.__key;if(N.has(A)||(N.add(A),h.push(S)),S===i)break;if(A=Ze(S)?s?S.getFirstChild():S.getLastChild():null,A!==null)S=A;else if(A=s?S.getNextSibling():S.getPreviousSibling(),A!==null)S=A;else{if(S=S.getParentOrThrow(),N.has(S.__key)||h.push(S),S===i)break;A=S;do A===null&&Y(68),S=s?A.getNextSibling():A.getPreviousSibling(),A=A.getParent(),A!==null&&(S!==null||N.has(A.__key)||h.push(A));while(S===null)}}return s||h.reverse(),h}isDirty(){let i=ln()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=It(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=yr(),s=ln();i=i._nodeMap;let h=this.__key,N=this.getLatest(),S=N.__parent;s=s._cloneNotNeeded;var A=Vt();return wl(A)&&A.setCachedNodes(null),s.has(h)?(Qt(N),N):(A=N.constructor.clone(N),A.__parent=S,A.__next=N.__next,A.__prev=N.__prev,Ze(N)&&Ze(A)?(A.__first=N.__first,A.__last=N.__last,A.__size=N.__size,A.__indent=N.__indent,A.__format=N.__format,A.__dir=N.__dir):ht(N)&&ht(A)&&(A.__format=N.__format,A.__style=N.__style,A.__mode=N.__mode,A.__detail=N.__detail),s.add(h),A.__key=h,Qt(A),i.set(h,A),A)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){El(this,!0,i)}replace(i,s){Jn();var h=Vt();h!==null&&(h=h.clone()),ys(this,i);let N=this.getLatest(),S=this.__key,A=i.__key,J=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;xt(J);let Se=N.getPreviousSibling(),Fe=N.getNextSibling(),Ke=N.__prev,ke=N.__next,Ae=N.__parent;return El(N,!1,!0),Se===null?i.__first=A:Se.getWritable().__next=A,J.__prev=Ke,Fe===null?i.__last=A:Fe.getWritable().__prev=A,J.__next=ke,J.__parent=Ae,i.__size=ge,s&&this.getChildren().forEach(Xe=>{J.append(Xe)}),wt(h)&&(gr(h),s=h.anchor,h=h.focus,s.key===S&&vl(s,J),h.key===S&&vl(h,J)),Ut()===S&&bt(A),J}insertAfter(i,s=!0){Jn(),ys(this,i);var h=this.getWritable();let N=i.getWritable();var S=N.getParent();let A=Vt();var J=!1,ge=!1;if(S!==null){var Se=i.getIndexWithinParent();xt(N),wt(A)&&(ge=S.__key,J=A.anchor,S=A.focus,J=J.type==="element"&&J.key===ge&&J.offset===Se+1,ge=S.type==="element"&&S.key===ge&&S.offset===Se+1)}S=this.getNextSibling(),Se=this.getParentOrThrow().getWritable();let Fe=N.__key,Ke=h.__next;return S===null?Se.__last=Fe:S.getWritable().__prev=Fe,Se.__size++,h.__next=Fe,N.__next=Ke,N.__prev=h.__key,N.__parent=h.__parent,s&&wt(A)&&(s=this.getIndexWithinParent(),go(A,Se,s+1),h=Se.__key,J&&A.anchor.set(h,s+2,"element"),ge&&A.focus.set(h,s+2,"element")),i}insertBefore(i,s=!0){Jn(),ys(this,i);var h=this.getWritable();let N=i.getWritable(),S=N.__key;xt(N);let A=this.getPreviousSibling(),J=this.getParentOrThrow().getWritable(),ge=h.__prev,Se=this.getIndexWithinParent();return A===null?J.__first=S:A.getWritable().__next=S,J.__size++,h.__prev=S,N.__prev=ge,N.__next=h.__key,N.__parent=h.__parent,h=Vt(),s&&wt(h)&&(s=this.getParentOrThrow(),go(h,s,Se)),i}isParentRequired(){return!1}createParentElementNode(){return lr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,s){Jn();let h=this.getPreviousSibling(),N=this.getParentOrThrow();return h===null?N.select(0,0):Ze(h)?h.select():ht(h)?h.select(i,s):(i=h.getIndexWithinParent()+1,N.select(i,i))}selectNext(i,s){Jn();let h=this.getNextSibling(),N=this.getParentOrThrow();return h===null?N.select():Ze(h)?h.select(0,0):ht(h)?h.select(i,s):(i=h.getIndexWithinParent(),N.select(i,i))}markDirty(){this.getWritable()}}function Ea(l,i,s){s=s||i.getParentOrThrow().getLastChild();let h=i;for(i=[i];h!==s;){if(!h.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");h=h.getNextSibling(),i.push(h)}for(let N of i)l=l.insertAfter(N)}class Pr extends ni{static getType(){return"linebreak"}static clone(i){return new Pr(i.__key)}constructor(i){super(i)}getTextContent(){return`
58
- `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let s=i.parentElement,h,N;return s!==null&&((h=s.firstChild)===i||h.nextSibling===i&&h.nodeType===3&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((N=s.lastChild)===i||N.previousSibling===i&&N.nodeType===3&&(N.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:kc,priority:0}}}}static importJSON(){return $r()}exportJSON(){return{type:"linebreak",version:1}}}function kc(){return{node:$r()}}function $r(){return Bi(new Pr)}function Ei(l){return l instanceof Pr}function Tl(l,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function Hi(l,i){return i&1?"strong":i&2?"em":"span"}function Wo(l,i,s,h,N){l=h.classList,h=Kt(N,"base"),h!==void 0&&l.add(...h),h=Kt(N,"underlineStrikethrough");let S=!1,A=i&8&&i&4;var J=s&8&&s&4;h!==void 0&&(J?(S=!0,A||l.add(...h)):A&&l.remove(...h));for(let ge in te)J=te[ge],h=Kt(N,ge),h!==void 0&&(s&J?!S||ge!=="underline"&&ge!=="strikethrough"?(!(i&J)||A&&ge==="underline"||ge==="strikethrough")&&l.add(...h):i&J&&l.remove(...h):i&J&&l.remove(...h))}function xl(l,i,s){let h=i.firstChild;if(s=s.isComposing(),l+=s?Te:"",h==null)i.textContent=l;else if(i=h.nodeValue,i!==l)if(s||m){s=i.length;let N=l.length,S=0,A=0;for(;S<s&&S<N&&i[S]===l[S];)S++;for(;A+S<s&&A+S<N&&i[s-A-1]===l[N-A-1];)A++;l=[S,s-S-A,l.slice(S,N-A)];let[J,ge,Se]=l;ge!==0&&h.deleteData(J,ge),h.insertData(J,Se)}else h.nodeValue=l}function Ko(l,i){return i=document.createElement(i),i.appendChild(l),i}class ri extends ni{static getType(){return"text"}static clone(i){return new ri(i.__text,i.__key)}constructor(i,s){super(s),this.__text=i,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let i=this.getLatest();return Ye[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ut()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(this.getLatest().__detail&1)!==0}isUnmergeable(){return(this.getLatest().__detail&2)!==0}hasFormat(i){return i=te[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,s){let h=this.getLatest().__format;return Ot(h,i,s)}createDOM(i){var s=this.__format,h=Tl(this,s);let N=Hi(this,s),S=document.createElement(h===null?N:h),A=S;return this.hasFormat("code")&&S.setAttribute("spellcheck","false"),h!==null&&(A=document.createElement(N),S.appendChild(A)),h=A,xl(this.__text,h,this),i=i.theme.text,i!==void 0&&Wo(N,0,s,h,i),s=this.__style,s!==""&&(S.style.cssText=s),S}updateDOM(i,s,h){let N=this.__text;var S=i.__format,A=this.__format,J=Tl(this,S);let ge=Tl(this,A);var Se=Hi(this,S);let Fe=Hi(this,A);return(J===null?Se:J)!==(ge===null?Fe:ge)?!0:J===ge&&Se!==Fe?(S=s.firstChild,S==null&&Y(48),i=J=document.createElement(Fe),xl(N,i,this),h=h.theme.text,h!==void 0&&Wo(Fe,0,A,i,h),s.replaceChild(J,S),!1):(Se=s,ge!==null&&J!==null&&(Se=s.firstChild,Se==null&&Y(49)),xl(N,Se,this),h=h.theme.text,h!==void 0&&S!==A&&Wo(Fe,S,A,Se,h),A=this.__style,i.__style!==A&&(s.style.cssText=A),!1)}static importDOM(){return{"#text":()=>({conversion:ws,priority:0}),b:()=>({conversion:st,priority:0}),code:()=>({conversion:Ti,priority:0}),em:()=>({conversion:Ti,priority:0}),i:()=>({conversion:Ti,priority:0}),s:()=>({conversion:Ti,priority:0}),span:()=>({conversion:Ta,priority:0}),strong:()=>({conversion:Ti,priority:0}),sub:()=>({conversion:Ti,priority:0}),sup:()=>({conversion:Ti,priority:0}),u:()=>({conversion:Ti,priority:0})}}static importJSON(i){let s=Bn(i.text);return s.setFormat(i.format),s.setDetail(i.detail),s.setMode(i.mode),s.setStyle(i.style),s}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&io(i)||Y(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=Ko(i,"b")),this.hasFormat("italic")&&(i=Ko(i,"i")),this.hasFormat("strikethrough")&&(i=Ko(i,"s")),this.hasFormat("underline")&&(i=Ko(i,"u")),{element:i}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(i){let s=this.getWritable();return s.__format=typeof i=="string"?te[i]:i,s}setDetail(i){let s=this.getWritable();return s.__detail=typeof i=="string"?ce[i]:i,s}setStyle(i){let s=this.getWritable();return s.__style=i,s}toggleFormat(i){let s=this.getFormat();return i=Ot(s,i,null),this.setFormat(i)}toggleDirectionless(){let i=this.getWritable();return i.__detail^=1,i}toggleUnmergeable(){let i=this.getWritable();return i.__detail^=2,i}setMode(i){if(i=Be[i],this.__mode===i)return this;let s=this.getWritable();return s.__mode=i,s}setTextContent(i){if(this.__text===i)return this;let s=this.getWritable();return s.__text=i,s}select(i,s){Jn();let h=Vt();var N=this.getTextContent();let S=this.__key;if(typeof N=="string"?(N=N.length,i===void 0&&(i=N),s===void 0&&(s=N)):s=i=0,wt(h))N=Ut(),N!==h.anchor.key&&N!==h.focus.key||bt(S),h.setTextNodeRange(this,i,this,s);else return Gn(S,i,S,s,"text","text");return h}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,s,h,N){let S=this.getWritable(),A=S.__text,J=h.length,ge=i;0>ge&&(ge=J+ge,0>ge&&(ge=0));let Se=Vt();return N&&wt(Se)&&(i+=J,Se.setTextNodeRange(S,i,S,i)),s=A.slice(0,ge)+h+A.slice(ge+s),S.__text=s,S}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Jn();var s=this.getLatest(),h=s.getTextContent(),N=s.__key,S=Ut(),A=new Set(i);i=[];for(var J=h.length,ge="",Se=0;Se<J;Se++)ge!==""&&A.has(Se)&&(i.push(ge),ge=""),ge+=h[Se];if(ge!==""&&i.push(ge),A=i.length,A===0)return[];if(i[0]===h)return[s];var Fe=i[0];h=s.getParentOrThrow(),Se=s.getFormat();let Ke=s.getStyle(),ke=s.__detail;J=!1,s.isSegmented()?(ge=Bn(Fe),ge.__format=Se,ge.__style=Ke,ge.__detail=ke,J=!0):(ge=s.getWritable(),ge.__text=Fe),s=Vt(),ge=[ge],Fe=Fe.length;for(let ut=1;ut<A;ut++){var Ae=i[ut],Xe=Ae.length;Ae=Bn(Ae).getWritable(),Ae.__format=Se,Ae.__style=Ke,Ae.__detail=ke;let Tt=Ae.__key;if(Xe=Fe+Xe,wt(s)){let Mt=s.anchor,hn=s.focus;Mt.key===N&&Mt.type==="text"&&Mt.offset>Fe&&Mt.offset<=Xe&&(Mt.key=Tt,Mt.offset-=Fe,s.dirty=!0),hn.key===N&&hn.type==="text"&&hn.offset>Fe&&hn.offset<=Xe&&(hn.key=Tt,hn.offset-=Fe,s.dirty=!0)}S===N&&bt(Tt),Fe=Xe,ge.push(Ae)}return N=this.getPreviousSibling(),S=this.getNextSibling(),N!==null&&Qt(N),S!==null&&Qt(S),N=h.getWritable(),S=this.getIndexWithinParent(),J?(N.splice(S,0,ge),this.remove()):N.splice(S,1,ge),wt(s)&&go(s,h,S,A-1),ge}mergeWithSibling(i){var s=i===this.getPreviousSibling();s||i===this.getNextSibling()||Y(50);var h=this.__key;let N=i.__key,S=this.__text,A=S.length;Ut()===N&&bt(h);let J=Vt();if(wt(J)){let ge=J.anchor,Se=J.focus;ge!==null&&ge.key===N&&(Rs(ge,s,h,i,A),J.dirty=!0),Se!==null&&Se.key===N&&(Rs(Se,s,h,i,A),J.dirty=!0)}return h=i.__text,this.setTextContent(s?h+S:S+h),s=this.getWritable(),i.remove(),s}isTextEntity(){return!1}}function Ta(l){let i=l.style.fontWeight==="700",s=l.style.textDecoration==="line-through",h=l.style.fontStyle==="italic",N=l.style.textDecoration==="underline",S=l.style.verticalAlign;return{forChild:A=>(ht(A)&&(i&&A.toggleFormat("bold"),s&&A.toggleFormat("strikethrough"),h&&A.toggleFormat("italic"),N&&A.toggleFormat("underline"),S==="sub"&&A.toggleFormat("subscript"),S==="super"&&A.toggleFormat("superscript")),A),node:null}}function st(l){let i=l.style.fontWeight==="normal";return{forChild:s=>(ht(s)&&!i&&s.toggleFormat("bold"),s),node:null}}let zo=new WeakMap;function ws(l){l.parentElement===null&&Y(129);for(var i=l.textContent||"",s,h=l.parentNode,N=[l];h!==null&&(s=zo.get(h))===void 0&&!(h.nodeName==="PRE"||h.nodeType===1&&h.style!==void 0&&h.style.whiteSpace!==void 0&&h.style.whiteSpace.startsWith("pre"));)N.push(h),h=h.parentNode;for(s=s===void 0?h:s,h=0;h<N.length;h++)zo.set(N[h],s);if(s!==null){for(i=i.split(/(\r?\n|\t)/),l=[],N=i.length,s=0;s<N;s++)h=i[s],h===`
56
+ `?(l.preventDefault(),ot(i,c,void 0)):S==null&&l.dataTransfer?(S=l.dataTransfer.getData("text/plain"),l.preventDefault(),C.insertRawText(S)):S!=null&&ha(C,h,S,l.timeStamp,!0)?(l.preventDefault(),ot(i,d,S)):ao=S,da=l.timeStamp;else switch(l.preventDefault(),s){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ot(i,d,l);break;case"insertFromComposition":bt(null),ot(i,d,l);break;case"insertLineBreak":bt(null),ot(i,r,!1);break;case"insertParagraph":bt(null),Bo&&!Z?(Bo=!1,ot(i,r,!1)):ot(i,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ot(i,g,l);break;case"deleteByComposition":_a(J,A)&&ot(i,p,l);break;case"deleteByDrag":case"deleteByCut":ot(i,p,l);break;case"deleteContent":ot(i,n,!1);break;case"deleteWordBackward":ot(i,N,!0);break;case"deleteWordForward":ot(i,N,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ot(i,v,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ot(i,v,!1);break;case"formatStrikeThrough":ot(i,T,"strikethrough");break;case"formatBold":ot(i,T,"bold");break;case"formatItalic":ot(i,T,"italic");break;case"formatUnderline":ot(i,T,"underline");break;case"historyUndo":ot(i,O,void 0);break;case"historyRedo":ot(i,b,void 0)}}})}function Ac(l,i){l.stopPropagation(),sr(i,()=>{var s=Vt(),h=l.data,C=ma(l);if(h!=null&&wt(s)&&ha(s,C,h,l.timeStamp,!1)){Ho&&(Cl(i,h),Ho=!1);var S=s.anchor,A=S.getNode();if(C=kr(i._window),C===null)return;let J=S.offset;(S=y&&!s.isCollapsed()&&ht(A)&&C.anchorNode!==null)&&(A=A.getTextContent().slice(0,J)+h+A.getTextContent().slice(J+s.focus.offset),C=C.anchorNode,S=A===(C.nodeType===3?C.nodeValue:null)),S||ot(i,d,h),h=h.length,m&&1<h&&l.inputType==="insertCompositionText"&&!i.isComposing()&&(s.anchor.offset-=h),M||Z||se||!i.isComposing()||($o=0,bt(null))}else nt(!1,i,h!==null?h:void 0),Ho&&(Cl(i,h||void 0),Ho=!1);Jn(),s=ln(),Oe(s)}),ao=null}function Mc(l,i){sr(i,()=>{let s=Vt();if(wt(s)&&!i.isComposing()){let h=s.anchor,C=s.anchor.getNode();bt(h.key),(l.timeStamp<$o+30||h.type==="element"||!s.isCollapsed()||C.getFormat()!==s.format||C.getStyle()!==s.style)&&ot(i,d,be)}})}function Cl(l,i){var s=l._compositionKey;if(bt(null),s!==null&&i!=null){if(i===""){i=It(s),l=St(l.getElementByKey(s)),l!==null&&l.nodeValue!==null&&ht(i)&&Nt(i,l.nodeValue,null,null,!0);return}if(i[i.length-1]===`
57
+ `&&(s=Vt(),wt(s))){i=s.focus,s.anchor.set(i.key,i.offset,i.type),ot(l,B,null);return}}nt(!0,l,i)}function Rc(l,i){m?Ho=!0:sr(i,()=>{Cl(i,l.data)})}function bc(l,i){if($o=l.timeStamp,ua=l.keyCode,!i.isComposing()){var{keyCode:s,shiftKey:h,ctrlKey:C,metaKey:S,altKey:A}=l;if(!ot(i,R,l)){if(s!==39||C||S||A)if(s!==39||A||h||!C&&!S)if(s!==37||C||S||A)if(s!==37||A||h||!C&&!S)if(s!==38||C||S)if(s!==40||C||S)if(s===13&&h)Bo=!0,ot(i,B,l);else if(s===32)ot(i,z,l);else if(k&&C&&s===79)l.preventDefault(),Bo=!0,ot(i,r,!0);else if(s!==13||h){var J=k?A||S?!1:s===8||s===72&&C:C||A||S?!1:s===8;J?s===8?ot(i,X,l):(l.preventDefault(),ot(i,n,!0)):s===27?ot(i,ee,l):(J=k?h||A||S?!1:s===46||s===68&&C:C||A||S?!1:s===46,J?s===46?ot(i,le,l):(l.preventDefault(),ot(i,n,!1)):s===8&&(k?A:C)?(l.preventDefault(),ot(i,N,!0)):s===46&&(k?A:C)?(l.preventDefault(),ot(i,N,!1)):k&&S&&s===8?(l.preventDefault(),ot(i,v,!0)):k&&S&&s===46?(l.preventDefault(),ot(i,v,!1)):s===66&&!A&&(k?S:C)?(l.preventDefault(),ot(i,T,"bold")):s===85&&!A&&(k?S:C)?(l.preventDefault(),ot(i,T,"underline")):s===73&&!A&&(k?S:C)?(l.preventDefault(),ot(i,T,"italic")):s!==9||A||C||S?s===90&&!h&&(k?S:C)?(l.preventDefault(),ot(i,O,void 0)):(J=k?s===90&&S&&h:s===89&&C||s===90&&C&&h,J?(l.preventDefault(),ot(i,b,void 0)):Go(i._editorState._selection)?(J=h?!1:s===67?k?S:C:!1,J?(l.preventDefault(),ot(i,pe,l)):(J=h?!1:s===88?k?S:C:!1,J?(l.preventDefault(),ot(i,ue,l)):s===65&&(k?S:C)&&(l.preventDefault(),ot(i,K,l)))):!m&&s===65&&(k?S:C)&&(l.preventDefault(),ot(i,K,l))):ot(i,j,l))}else Bo=!1,ot(i,B,l);else ot(i,W,l);else ot(i,$,l);else ot(i,H,l);else ot(i,P,l);else ot(i,w,l);else ot(i,x,l);(C||h||A||S)&&ot(i,ne,l)}}}function Na(l){let i=l.__lexicalEventHandles;return i===void 0&&(i=[],l.__lexicalEventHandles=i),i}let co=new Map;function Ca(l){l=l.target;let i=kr(l==null?null:l.nodeType===9?l.defaultView:l.ownerDocument.defaultView);if(i!==null){var s=_t(i.anchorNode);if(s!==null){Nl&&(Nl=!1,sr(s,()=>{var A=Ui(),J=i.anchorNode;J!==null&&(J=J.nodeType,J===1||J===3)&&(A=Hn(A,i,s),gr(A))})),l=ye(s),l=l[l.length-1];var h=l._key,C=co.get(h),S=C||l;S!==s&&pa(i,S,!1),pa(i,s,!0),s!==l?co.set(h,s):C&&co.delete(h)}}}function Lc(l,i){Fo===0&&l.ownerDocument.addEventListener("selectionchange",Ca),Fo++,l.__lexicalEditor=i;let s=Na(l);for(let h=0;h<_l.length;h++){let[C,S]=_l[h],A=typeof S=="function"?J=>{J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()&&S(J,i))}:J=>{if(J._lexicalHandled!==!0&&(J._lexicalHandled=!0,i.isEditable()))switch(C){case"cut":return ot(i,ue,J);case"copy":return ot(i,pe,J);case"paste":return ot(i,g,J);case"dragstart":return ot(i,q,J);case"dragover":return ot(i,me,J);case"dragend":return ot(i,_e,J);case"focus":return ot(i,D,J);case"blur":return ot(i,V,J);case"drop":return ot(i,U,J)}};l.addEventListener(C,A),s.push(()=>{l.removeEventListener(C,A)})}}function El(l,i,s){Jn();var h=l.__key;let C=l.getParent();if(C!==null){var S=Vt();if(wt(S)&&Ze(l)){var{anchor:A,focus:J}=S,ge=A.getNode(),Se=J.getNode();mi(ge,l)&&A.set(l.__key,0,"element"),mi(Se,l)&&J.set(l.__key,0,"element")}if(ge=S,Se=!1,wt(ge)&&i){S=ge.anchor;let Fe=ge.focus;S.key===h&&(po(S,l,C,l.getPreviousSibling(),l.getNextSibling()),Se=!0),Fe.key===h&&(po(Fe,l,C,l.getPreviousSibling(),l.getNextSibling()),Se=!0)}else Go(ge)&&i&&l.isSelected()&&l.selectPrevious();wt(ge)&&i&&!Se?(h=l.getIndexWithinParent(),xt(l),go(ge,C,h,-1)):xt(l),s||Xr(C)||C.canBeEmpty()||!C.isEmpty()||El(C,i),i&&tr(C)&&C.isEmpty()&&C.selectEnd()}}class ni{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,At(this,i)}getType(){return this.__type}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=It(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let s=i.getNodes().some(h=>h.__key===this.__key);return ht(this)?s:wt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:s}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let s=0;for(;i!==null;){if(this.is(i))return s;s++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:It(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let s=i.getParent();if(Xr(s))return i;i=s}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],s=this.getParent();for(;s!==null;)i.push(s),s=s.getParent();return i}getParentKeys(){let i=[],s=this.getParent();for(;s!==null;)i.push(s.__key),s=s.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:It(i)}getPreviousSiblings(){let i=[];var s=this.getParent();if(s===null)return i;for(s=s.getFirstChild();s!==null&&!s.is(this);)i.push(s),s=s.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:It(i)}getNextSiblings(){let i=[],s=this.getNextSibling();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getCommonAncestor(i){let s=this.getParents();var h=i.getParents();Ze(this)&&s.unshift(this),Ze(i)&&h.unshift(i),i=s.length;var C=h.length;if(i===0||C===0||s[i-1]!==h[C-1])return null;for(h=new Set(h),C=0;C<i;C++){let S=s[C];if(h.has(S))return S}return null}is(i){return i==null?!1:this.__key===i.__key}isBefore(i){if(this===i)return!1;if(i.isParentOf(this))return!0;if(this.isParentOf(i))return!1;var s=this.getCommonAncestor(i);let h=this;for(;;){var C=h.getParentOrThrow();if(C===s){C=h.getIndexWithinParent();break}h=C}for(h=i;;){if(i=h.getParentOrThrow(),i===s){s=h.getIndexWithinParent();break}h=i}return C<s}isParentOf(i){let s=this.__key;if(s===i.__key)return!1;for(;i!==null;){if(i.__key===s)return!0;i=i.getParent()}return!1}getNodesBetween(i){let s=this.isBefore(i),h=[],C=new Set;for(var S=this;;){var A=S.__key;if(C.has(A)||(C.add(A),h.push(S)),S===i)break;if(A=Ze(S)?s?S.getFirstChild():S.getLastChild():null,A!==null)S=A;else if(A=s?S.getNextSibling():S.getPreviousSibling(),A!==null)S=A;else{if(S=S.getParentOrThrow(),C.has(S.__key)||h.push(S),S===i)break;A=S;do A===null&&Y(68),S=s?A.getNextSibling():A.getPreviousSibling(),A=A.getParent(),A!==null&&(S!==null||C.has(A.__key)||h.push(A));while(S===null)}}return s||h.reverse(),h}isDirty(){let i=ln()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=It(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=yr(),s=ln();i=i._nodeMap;let h=this.__key,C=this.getLatest(),S=C.__parent;s=s._cloneNotNeeded;var A=Vt();return wl(A)&&A.setCachedNodes(null),s.has(h)?(Qt(C),C):(A=C.constructor.clone(C),A.__parent=S,A.__next=C.__next,A.__prev=C.__prev,Ze(C)&&Ze(A)?(A.__first=C.__first,A.__last=C.__last,A.__size=C.__size,A.__indent=C.__indent,A.__format=C.__format,A.__dir=C.__dir):ht(C)&&ht(A)&&(A.__format=C.__format,A.__style=C.__style,A.__mode=C.__mode,A.__detail=C.__detail),s.add(h),A.__key=h,Qt(A),i.set(h,A),A)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){El(this,!0,i)}replace(i,s){Jn();var h=Vt();h!==null&&(h=h.clone()),ys(this,i);let C=this.getLatest(),S=this.__key,A=i.__key,J=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;xt(J);let Se=C.getPreviousSibling(),Fe=C.getNextSibling(),Ke=C.__prev,ke=C.__next,Ae=C.__parent;return El(C,!1,!0),Se===null?i.__first=A:Se.getWritable().__next=A,J.__prev=Ke,Fe===null?i.__last=A:Fe.getWritable().__prev=A,J.__next=ke,J.__parent=Ae,i.__size=ge,s&&this.getChildren().forEach(Xe=>{J.append(Xe)}),wt(h)&&(gr(h),s=h.anchor,h=h.focus,s.key===S&&vl(s,J),h.key===S&&vl(h,J)),Ut()===S&&bt(A),J}insertAfter(i,s=!0){Jn(),ys(this,i);var h=this.getWritable();let C=i.getWritable();var S=C.getParent();let A=Vt();var J=!1,ge=!1;if(S!==null){var Se=i.getIndexWithinParent();xt(C),wt(A)&&(ge=S.__key,J=A.anchor,S=A.focus,J=J.type==="element"&&J.key===ge&&J.offset===Se+1,ge=S.type==="element"&&S.key===ge&&S.offset===Se+1)}S=this.getNextSibling(),Se=this.getParentOrThrow().getWritable();let Fe=C.__key,Ke=h.__next;return S===null?Se.__last=Fe:S.getWritable().__prev=Fe,Se.__size++,h.__next=Fe,C.__next=Ke,C.__prev=h.__key,C.__parent=h.__parent,s&&wt(A)&&(s=this.getIndexWithinParent(),go(A,Se,s+1),h=Se.__key,J&&A.anchor.set(h,s+2,"element"),ge&&A.focus.set(h,s+2,"element")),i}insertBefore(i,s=!0){Jn(),ys(this,i);var h=this.getWritable();let C=i.getWritable(),S=C.__key;xt(C);let A=this.getPreviousSibling(),J=this.getParentOrThrow().getWritable(),ge=h.__prev,Se=this.getIndexWithinParent();return A===null?J.__first=S:A.getWritable().__next=S,J.__size++,h.__prev=S,C.__prev=ge,C.__next=h.__key,C.__parent=h.__parent,h=Vt(),s&&wt(h)&&(s=this.getParentOrThrow(),go(h,s,Se)),i}isParentRequired(){return!1}createParentElementNode(){return lr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,s){Jn();let h=this.getPreviousSibling(),C=this.getParentOrThrow();return h===null?C.select(0,0):Ze(h)?h.select():ht(h)?h.select(i,s):(i=h.getIndexWithinParent()+1,C.select(i,i))}selectNext(i,s){Jn();let h=this.getNextSibling(),C=this.getParentOrThrow();return h===null?C.select():Ze(h)?h.select(0,0):ht(h)?h.select(i,s):(i=h.getIndexWithinParent(),C.select(i,i))}markDirty(){this.getWritable()}}function Ea(l,i,s){s=s||i.getParentOrThrow().getLastChild();let h=i;for(i=[i];h!==s;){if(!h.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");h=h.getNextSibling(),i.push(h)}for(let C of i)l=l.insertAfter(C)}class Pr extends ni{static getType(){return"linebreak"}static clone(i){return new Pr(i.__key)}constructor(i){super(i)}getTextContent(){return`
58
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let s=i.parentElement,h,C;return s!==null&&((h=s.firstChild)===i||h.nextSibling===i&&h.nodeType===3&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((C=s.lastChild)===i||C.previousSibling===i&&C.nodeType===3&&(C.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:kc,priority:0}}}}static importJSON(){return $r()}exportJSON(){return{type:"linebreak",version:1}}}function kc(){return{node:$r()}}function $r(){return Bi(new Pr)}function Ei(l){return l instanceof Pr}function Tl(l,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function Hi(l,i){return i&1?"strong":i&2?"em":"span"}function Wo(l,i,s,h,C){l=h.classList,h=Kt(C,"base"),h!==void 0&&l.add(...h),h=Kt(C,"underlineStrikethrough");let S=!1,A=i&8&&i&4;var J=s&8&&s&4;h!==void 0&&(J?(S=!0,A||l.add(...h)):A&&l.remove(...h));for(let ge in te)J=te[ge],h=Kt(C,ge),h!==void 0&&(s&J?!S||ge!=="underline"&&ge!=="strikethrough"?(!(i&J)||A&&ge==="underline"||ge==="strikethrough")&&l.add(...h):i&J&&l.remove(...h):i&J&&l.remove(...h))}function xl(l,i,s){let h=i.firstChild;if(s=s.isComposing(),l+=s?Te:"",h==null)i.textContent=l;else if(i=h.nodeValue,i!==l)if(s||m){s=i.length;let C=l.length,S=0,A=0;for(;S<s&&S<C&&i[S]===l[S];)S++;for(;A+S<s&&A+S<C&&i[s-A-1]===l[C-A-1];)A++;l=[S,s-S-A,l.slice(S,C-A)];let[J,ge,Se]=l;ge!==0&&h.deleteData(J,ge),h.insertData(J,Se)}else h.nodeValue=l}function Ko(l,i){return i=document.createElement(i),i.appendChild(l),i}class ri extends ni{static getType(){return"text"}static clone(i){return new ri(i.__text,i.__key)}constructor(i,s){super(s),this.__text=i,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let i=this.getLatest();return Ye[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Ut()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(this.getLatest().__detail&1)!==0}isUnmergeable(){return(this.getLatest().__detail&2)!==0}hasFormat(i){return i=te[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,s){let h=this.getLatest().__format;return Ot(h,i,s)}createDOM(i){var s=this.__format,h=Tl(this,s);let C=Hi(this,s),S=document.createElement(h===null?C:h),A=S;return this.hasFormat("code")&&S.setAttribute("spellcheck","false"),h!==null&&(A=document.createElement(C),S.appendChild(A)),h=A,xl(this.__text,h,this),i=i.theme.text,i!==void 0&&Wo(C,0,s,h,i),s=this.__style,s!==""&&(S.style.cssText=s),S}updateDOM(i,s,h){let C=this.__text;var S=i.__format,A=this.__format,J=Tl(this,S);let ge=Tl(this,A);var Se=Hi(this,S);let Fe=Hi(this,A);return(J===null?Se:J)!==(ge===null?Fe:ge)?!0:J===ge&&Se!==Fe?(S=s.firstChild,S==null&&Y(48),i=J=document.createElement(Fe),xl(C,i,this),h=h.theme.text,h!==void 0&&Wo(Fe,0,A,i,h),s.replaceChild(J,S),!1):(Se=s,ge!==null&&J!==null&&(Se=s.firstChild,Se==null&&Y(49)),xl(C,Se,this),h=h.theme.text,h!==void 0&&S!==A&&Wo(Fe,S,A,Se,h),A=this.__style,i.__style!==A&&(s.style.cssText=A),!1)}static importDOM(){return{"#text":()=>({conversion:ws,priority:0}),b:()=>({conversion:st,priority:0}),code:()=>({conversion:Ti,priority:0}),em:()=>({conversion:Ti,priority:0}),i:()=>({conversion:Ti,priority:0}),s:()=>({conversion:Ti,priority:0}),span:()=>({conversion:Ta,priority:0}),strong:()=>({conversion:Ti,priority:0}),sub:()=>({conversion:Ti,priority:0}),sup:()=>({conversion:Ti,priority:0}),u:()=>({conversion:Ti,priority:0})}}static importJSON(i){let s=Bn(i.text);return s.setFormat(i.format),s.setDetail(i.detail),s.setMode(i.mode),s.setStyle(i.style),s}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&io(i)||Y(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=Ko(i,"b")),this.hasFormat("italic")&&(i=Ko(i,"i")),this.hasFormat("strikethrough")&&(i=Ko(i,"s")),this.hasFormat("underline")&&(i=Ko(i,"u")),{element:i}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(i){let s=this.getWritable();return s.__format=typeof i=="string"?te[i]:i,s}setDetail(i){let s=this.getWritable();return s.__detail=typeof i=="string"?ce[i]:i,s}setStyle(i){let s=this.getWritable();return s.__style=i,s}toggleFormat(i){let s=this.getFormat();return i=Ot(s,i,null),this.setFormat(i)}toggleDirectionless(){let i=this.getWritable();return i.__detail^=1,i}toggleUnmergeable(){let i=this.getWritable();return i.__detail^=2,i}setMode(i){if(i=Be[i],this.__mode===i)return this;let s=this.getWritable();return s.__mode=i,s}setTextContent(i){if(this.__text===i)return this;let s=this.getWritable();return s.__text=i,s}select(i,s){Jn();let h=Vt();var C=this.getTextContent();let S=this.__key;if(typeof C=="string"?(C=C.length,i===void 0&&(i=C),s===void 0&&(s=C)):s=i=0,wt(h))C=Ut(),C!==h.anchor.key&&C!==h.focus.key||bt(S),h.setTextNodeRange(this,i,this,s);else return Gn(S,i,S,s,"text","text");return h}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,s,h,C){let S=this.getWritable(),A=S.__text,J=h.length,ge=i;0>ge&&(ge=J+ge,0>ge&&(ge=0));let Se=Vt();return C&&wt(Se)&&(i+=J,Se.setTextNodeRange(S,i,S,i)),s=A.slice(0,ge)+h+A.slice(ge+s),S.__text=s,S}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Jn();var s=this.getLatest(),h=s.getTextContent(),C=s.__key,S=Ut(),A=new Set(i);i=[];for(var J=h.length,ge="",Se=0;Se<J;Se++)ge!==""&&A.has(Se)&&(i.push(ge),ge=""),ge+=h[Se];if(ge!==""&&i.push(ge),A=i.length,A===0)return[];if(i[0]===h)return[s];var Fe=i[0];h=s.getParentOrThrow(),Se=s.getFormat();let Ke=s.getStyle(),ke=s.__detail;J=!1,s.isSegmented()?(ge=Bn(Fe),ge.__format=Se,ge.__style=Ke,ge.__detail=ke,J=!0):(ge=s.getWritable(),ge.__text=Fe),s=Vt(),ge=[ge],Fe=Fe.length;for(let ut=1;ut<A;ut++){var Ae=i[ut],Xe=Ae.length;Ae=Bn(Ae).getWritable(),Ae.__format=Se,Ae.__style=Ke,Ae.__detail=ke;let Tt=Ae.__key;if(Xe=Fe+Xe,wt(s)){let Mt=s.anchor,hn=s.focus;Mt.key===C&&Mt.type==="text"&&Mt.offset>Fe&&Mt.offset<=Xe&&(Mt.key=Tt,Mt.offset-=Fe,s.dirty=!0),hn.key===C&&hn.type==="text"&&hn.offset>Fe&&hn.offset<=Xe&&(hn.key=Tt,hn.offset-=Fe,s.dirty=!0)}S===C&&bt(Tt),Fe=Xe,ge.push(Ae)}return C=this.getPreviousSibling(),S=this.getNextSibling(),C!==null&&Qt(C),S!==null&&Qt(S),C=h.getWritable(),S=this.getIndexWithinParent(),J?(C.splice(S,0,ge),this.remove()):C.splice(S,1,ge),wt(s)&&go(s,h,S,A-1),ge}mergeWithSibling(i){var s=i===this.getPreviousSibling();s||i===this.getNextSibling()||Y(50);var h=this.__key;let C=i.__key,S=this.__text,A=S.length;Ut()===C&&bt(h);let J=Vt();if(wt(J)){let ge=J.anchor,Se=J.focus;ge!==null&&ge.key===C&&(Rs(ge,s,h,i,A),J.dirty=!0),Se!==null&&Se.key===C&&(Rs(Se,s,h,i,A),J.dirty=!0)}return h=i.__text,this.setTextContent(s?h+S:S+h),s=this.getWritable(),i.remove(),s}isTextEntity(){return!1}}function Ta(l){let i=l.style.fontWeight==="700",s=l.style.textDecoration==="line-through",h=l.style.fontStyle==="italic",C=l.style.textDecoration==="underline",S=l.style.verticalAlign;return{forChild:A=>(ht(A)&&(i&&A.toggleFormat("bold"),s&&A.toggleFormat("strikethrough"),h&&A.toggleFormat("italic"),C&&A.toggleFormat("underline"),S==="sub"&&A.toggleFormat("subscript"),S==="super"&&A.toggleFormat("superscript")),A),node:null}}function st(l){let i=l.style.fontWeight==="normal";return{forChild:s=>(ht(s)&&!i&&s.toggleFormat("bold"),s),node:null}}let zo=new WeakMap;function ws(l){l.parentElement===null&&Y(129);for(var i=l.textContent||"",s,h=l.parentNode,C=[l];h!==null&&(s=zo.get(h))===void 0&&!(h.nodeName==="PRE"||h.nodeType===1&&h.style!==void 0&&h.style.whiteSpace!==void 0&&h.style.whiteSpace.startsWith("pre"));)C.push(h),h=h.parentNode;for(s=s===void 0?h:s,h=0;h<C.length;h++)zo.set(C[h],s);if(s!==null){for(i=i.split(/(\r?\n|\t)/),l=[],C=i.length,s=0;s<C;s++)h=i[s],h===`
59
59
  `||h===`\r
60
- `?l.push($r()):h===" "?l.push(Wi()):h!==""&&l.push(Bn(h));return{node:l}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(N=l,s=!0;N!==null&&(N=xa(N,!1))!==null;)if(h=N.textContent||"",0<h.length){/[ \t\n]$/.test(h)&&(i=i.slice(1)),s=!1;break}s&&(i=i.slice(1))}if(i[i.length-1]===" "){for(N=!0;l!==null&&(l=xa(l,!0))!==null;)if(0<(l.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){N=!1;break}N&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Bn(i)}}let Os=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/,"i");function xa(l,i){for(;;){for(var s=void 0;(s=i?l.nextSibling:l.previousSibling)===null;)if(l=l.parentElement,l===null)return null;if(l=s,l.nodeType===1&&(s=l.style.display,s===""&&l.nodeName.match(Os)===null||s!==""&&!s.startsWith("inline")))return null;for(;(s=i?l.firstChild:l.lastChild)!==null;)l=s;if(l.nodeType===3)return l;if(l.nodeName==="BR")return null}}let Ic={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ti(l){let i=Ic[l.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:s=>(ht(s)&&!s.hasFormat(i)&&s.toggleFormat(i),s),node:null}}function Bn(l=""){return Bi(new ri(l))}function ht(l){return l instanceof ri}class uo extends ri{static getType(){return"tab"}static clone(i){let s=new uo(i.__key);return s.__text=i.__text,s.__format=i.__format,s.__style=i.__style,s}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let s=Wi();return s.setFormat(i.format),s.setStyle(i.style),s}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){Y(126)}setDetail(){Y(127)}setMode(){Y(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Wi(){return Bi(new uo)}function va(l){return l instanceof uo}class Dr{constructor(i,s,h){this._selection=null,this.key=i,this.offset=s,this.type=h}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let s=this.getNode(),h=i.getNode(),N=this.offset;if(i=i.offset,Ze(s)){var S=s.getDescendantByIndex(N);s=S??s}return Ze(h)&&(S=h.getDescendantByIndex(i),h=S??h),s===h?N<i:s.isBefore(h)}getNode(){let i=It(this.key);return i===null&&Y(20),i}set(i,s,h){let N=this._selection,S=this.key;this.key=i,this.offset=s,this.type=h,oi()||(Ut()===S&&bt(i),N!==null&&(N.setCachedNodes(null),N.dirty=!0))}}function Fr(l,i){let s=i.__key,h=l.offset,N="element";if(ht(i))N="text",i=i.getTextContentSize(),h>i&&(h=i);else if(!Ze(i)){var S=i.getNextSibling();ht(S)?(s=S.__key,h=0,N="text"):(S=i.getParent())&&(s=S.__key,h=i.getIndexWithinParent()+1)}l.set(s,h,N)}function vl(l,i){if(Ze(i)){let s=i.getLastDescendant();Ze(s)||ht(s)?Fr(l,s):Fr(l,i)}else Fr(l,i)}function fo(l,i,s,h){let N=l.getNode(),S=N.getChildAtIndex(l.offset),A=Bn(),J=tr(N)?lr().append(A):A;A.setFormat(s),A.setStyle(h),S===null?N.append(J):S.insertBefore(J),l.is(i)&&i.set(A.__key,0,"text"),l.set(A.__key,0,"text")}function Br(l,i,s,h){l.key=i,l.offset=s,l.type=h}class Sl{constructor(i,s){this.anchor=i,this.focus=s,i._selection=this,s._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return wl(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return zi(this)}}class ho{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!Go(i))return!1;let s=this._nodes,h=i._nodes;return s.size===h.size&&Array.from(s).every(N=>h.has(N))}add(i){this.dirty=!0,this._nodes.add(i),this._cachedNodes=null}delete(i){this.dirty=!0,this._nodes.delete(i),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(i){return this._nodes.has(i)}clone(){return new ho(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.getNodes(),h=s.length;var N=s[h-1];if(ht(N))N=N.select();else{let S=N.getIndexWithinParent()+1;N=N.getParentOrThrow().select(S,S)}for(N.insertNodes(i),i=0;i<h;i++)s[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var s=this._nodes;i=[];for(let h of s)s=It(h),s!==null&&i.push(s);return oi()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function wt(l){return l instanceof Ki}function wl(l){return l instanceof Sl}function _r(l){let[i,,s]=ii(l);l=s.getChildren();let h=l.length;var N=l[0].getChildren().length;let S=Array(h);for(var A=0;A<h;A++)S[A]=Array(N);for(N=0;N<h;N++){A=l[N].getChildren();let J=0;for(let ge=0;ge<A.length;ge++){for(;S[N][J];)J++;let Se=A[ge],Fe=Se.__rowSpan||1,Ke=Se.__colSpan||1;for(let ke=0;ke<Fe;ke++)for(let Ae=0;Ae<Ke;Ae++)S[N+ke][J+Ae]=Se;if(i===Se)return{colSpan:Ke,columnIndex:J,rowIndex:N,rowSpan:Fe};J+=Ke}}return null}class Ds extends Sl{constructor(i,s,h){super(s,h),this.gridKey=i}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Uo(i)?this.gridKey===i.gridKey&&this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}set(i,s,h){this.dirty=!0,this.gridKey=i,this.anchor.key=s,this.focus.key=h,this._cachedNodes=null}clone(){return new Ds(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.focus.getNode();Qe(s.select(0,s.getChildrenSize())).insertNodes(i)}getShape(){var i=It(this.anchor.key);if(Nr(i)||Y(103),i=_r(i),i===null)throw Error("getCellRect: expected to find AnchorNode");var s=It(this.focus.key);Nr(s)||Y(104);let h=_r(s);if(h===null)throw Error("getCellRect: expected to find focusCellNode");s=Math.min(i.columnIndex,h.columnIndex);let N=Math.max(i.columnIndex,h.columnIndex),S=Math.min(i.rowIndex,h.rowIndex);return i=Math.max(i.rowIndex,h.rowIndex),{fromX:Math.min(s,N),fromY:Math.min(S,i),toX:Math.max(s,N),toY:Math.max(S,i)}}getNodes(){function i(Tt){let{cell:Mt,startColumn:hn,startRow:ar}=Tt;Se=Math.min(Se,hn),Fe=Math.min(Fe,ar),Ke=Math.max(Ke,hn+Mt.__colSpan-1),ke=Math.max(ke,ar+Mt.__rowSpan-1)}var s=this._cachedNodes;if(s!==null)return s;var h=this.anchor.getNode();s=this.focus.getNode();var N=Ns(h,Nr);h=Ns(s,Nr),Nr(N)||Y(103),Nr(h)||Y(104),s=N.getParent(),Jo(s)||Y(105),s=s.getParent(),Is(s)||Y(106);var S=h.getParents()[1];if(S!==s){if(s.isParentOf(h)){if(s=S.getParent(),s==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,h.getKey(),s.getKey())}else{if(s=s.getParent(),s==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,s.getKey(),h.getKey())}return this.getNodes()}let[A,J,ge]=vi(s,N,h),Se=Math.min(J.startColumn,ge.startColumn),Fe=Math.min(J.startRow,ge.startRow),Ke=Math.max(J.startColumn+J.cell.__colSpan-1,ge.startColumn+ge.cell.__colSpan-1),ke=Math.max(J.startRow+J.cell.__rowSpan-1,ge.startRow+ge.cell.__rowSpan-1);h=Se,N=Fe,S=Se;for(var Ae=Fe;Se<h||Fe<N||Ke>S||ke>Ae;){if(Se<h){var Xe=Ae-N;--h;for(var ut=0;ut<=Xe;ut++)i(A[N+ut][h])}if(Fe<N)for(Xe=S-h,--N,ut=0;ut<=Xe;ut++)i(A[N][h+ut]);if(Ke>S)for(Xe=Ae-N,S+=1,ut=0;ut<=Xe;ut++)i(A[N+ut][S]);if(ke>Ae)for(Xe=S-h,Ae+=1,ut=0;ut<=Xe;ut++)i(A[Ae][h+ut])}for(s=[s],h=null,N=Fe;N<=ke;N++)for(S=Se;S<=Ke;S++)({cell:Ae}=A[N][S]),Xe=Ae.getParent(),Jo(Xe)||Y(107),Xe!==h&&s.push(Xe),s.push(Ae,...wc(Ae)),h=Xe;return oi()||(this._cachedNodes=s),s}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function Uo(l){return l instanceof Ds}class Ki extends Sl{constructor(i,s,h,N){super(i,s),this.format=h,this.style=N}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return wt(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus)&&this.format===i.format&&this.style===i.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var i=this._cachedNodes;if(i!==null)return i;i=this.anchor;var s=this.focus,h=i.isBefore(s),N=h?i:s;h=h?s:i,i=N.getNode(),s=h.getNode();let S=N.offset;return N=h.offset,Ze(i)&&(h=i.getDescendantByIndex(S),i=h??i),Ze(s)&&(h=s.getDescendantByIndex(N),h!==null&&h!==i&&s.getChildAtIndex(N)===h&&(h=h.getPreviousSibling()),s=h??s),i=i.is(s)?Ze(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(s),oi()||(this._cachedNodes=i),i}setTextNodeRange(i,s,h,N){Br(this.anchor,i.__key,s,"text"),Br(this.focus,h.__key,N,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let s=i[0],h=i[i.length-1],N=this.anchor,S=this.focus,A=N.isBefore(S),[J,ge]=zi(this),Se="",Fe=!0;for(let Ke=0;Ke<i.length;Ke++){let ke=i[Ke];if(Ze(ke)&&!ke.isInline())Fe||(Se+=`
61
- `),Fe=!ke.isEmpty();else if(Fe=!1,ht(ke)){let Ae=ke.getTextContent();ke===s?ke===h?(N.type!=="element"||S.type!=="element"||S.offset===N.offset)&&(Ae=J<ge?Ae.slice(J,ge):Ae.slice(ge,J)):Ae=A?Ae.slice(J):Ae.slice(ge):ke===h&&(Ae=A?Ae.slice(0,ge):Ae.slice(0,J)),Se+=Ae}else!an(ke)&&!Ei(ke)||ke===h&&this.isCollapsed()||(Se+=ke.getTextContent())}return Se}applyDOMRange(i){let s=ln(),h=s.getEditorState()._selection;if(i=Tn(i.startContainer,i.startOffset,i.endContainer,i.endOffset,s,h),i!==null){var[N,S]=i;Br(this.anchor,N.key,N.offset,N.type),Br(this.focus,S.key,S.offset,S.type),this._cachedNodes=null}}clone(){let i=this.anchor,s=this.focus;return new Ki(new Dr(i.key,i.offset,i.type),new Dr(s.key,s.offset,s.type),this.format,this.style)}toggleFormat(i){this.format=Ot(this.format,i,null),this.dirty=!0}setStyle(i){this.style=i,this.dirty=!0}hasFormat(i){return(this.format&te[i])!==0}insertRawText(i){i=i.split(/(\r?\n|\t)/);let s=[],h=i.length;for(let N=0;N<h;N++){let S=i[N];S===`
60
+ `?l.push($r()):h===" "?l.push(Wi()):h!==""&&l.push(Bn(h));return{node:l}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(C=l,s=!0;C!==null&&(C=xa(C,!1))!==null;)if(h=C.textContent||"",0<h.length){/[ \t\n]$/.test(h)&&(i=i.slice(1)),s=!1;break}s&&(i=i.slice(1))}if(i[i.length-1]===" "){for(C=!0;l!==null&&(l=xa(l,!0))!==null;)if(0<(l.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){C=!1;break}C&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Bn(i)}}let Os=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/,"i");function xa(l,i){for(;;){for(var s=void 0;(s=i?l.nextSibling:l.previousSibling)===null;)if(l=l.parentElement,l===null)return null;if(l=s,l.nodeType===1&&(s=l.style.display,s===""&&l.nodeName.match(Os)===null||s!==""&&!s.startsWith("inline")))return null;for(;(s=i?l.firstChild:l.lastChild)!==null;)l=s;if(l.nodeType===3)return l;if(l.nodeName==="BR")return null}}let Ic={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Ti(l){let i=Ic[l.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:s=>(ht(s)&&!s.hasFormat(i)&&s.toggleFormat(i),s),node:null}}function Bn(l=""){return Bi(new ri(l))}function ht(l){return l instanceof ri}class uo extends ri{static getType(){return"tab"}static clone(i){let s=new uo(i.__key);return s.__text=i.__text,s.__format=i.__format,s.__style=i.__style,s}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let s=Wi();return s.setFormat(i.format),s.setStyle(i.style),s}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){Y(126)}setDetail(){Y(127)}setMode(){Y(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Wi(){return Bi(new uo)}function va(l){return l instanceof uo}class Dr{constructor(i,s,h){this._selection=null,this.key=i,this.offset=s,this.type=h}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let s=this.getNode(),h=i.getNode(),C=this.offset;if(i=i.offset,Ze(s)){var S=s.getDescendantByIndex(C);s=S??s}return Ze(h)&&(S=h.getDescendantByIndex(i),h=S??h),s===h?C<i:s.isBefore(h)}getNode(){let i=It(this.key);return i===null&&Y(20),i}set(i,s,h){let C=this._selection,S=this.key;this.key=i,this.offset=s,this.type=h,oi()||(Ut()===S&&bt(i),C!==null&&(C.setCachedNodes(null),C.dirty=!0))}}function Fr(l,i){let s=i.__key,h=l.offset,C="element";if(ht(i))C="text",i=i.getTextContentSize(),h>i&&(h=i);else if(!Ze(i)){var S=i.getNextSibling();ht(S)?(s=S.__key,h=0,C="text"):(S=i.getParent())&&(s=S.__key,h=i.getIndexWithinParent()+1)}l.set(s,h,C)}function vl(l,i){if(Ze(i)){let s=i.getLastDescendant();Ze(s)||ht(s)?Fr(l,s):Fr(l,i)}else Fr(l,i)}function fo(l,i,s,h){let C=l.getNode(),S=C.getChildAtIndex(l.offset),A=Bn(),J=tr(C)?lr().append(A):A;A.setFormat(s),A.setStyle(h),S===null?C.append(J):S.insertBefore(J),l.is(i)&&i.set(A.__key,0,"text"),l.set(A.__key,0,"text")}function Br(l,i,s,h){l.key=i,l.offset=s,l.type=h}class Sl{constructor(i,s){this.anchor=i,this.focus=s,i._selection=this,s._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return wl(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return zi(this)}}class ho{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!Go(i))return!1;let s=this._nodes,h=i._nodes;return s.size===h.size&&Array.from(s).every(C=>h.has(C))}add(i){this.dirty=!0,this._nodes.add(i),this._cachedNodes=null}delete(i){this.dirty=!0,this._nodes.delete(i),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(i){return this._nodes.has(i)}clone(){return new ho(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.getNodes(),h=s.length;var C=s[h-1];if(ht(C))C=C.select();else{let S=C.getIndexWithinParent()+1;C=C.getParentOrThrow().select(S,S)}for(C.insertNodes(i),i=0;i<h;i++)s[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var s=this._nodes;i=[];for(let h of s)s=It(h),s!==null&&i.push(s);return oi()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function wt(l){return l instanceof Ki}function wl(l){return l instanceof Sl}function _r(l){let[i,,s]=ii(l);l=s.getChildren();let h=l.length;var C=l[0].getChildren().length;let S=Array(h);for(var A=0;A<h;A++)S[A]=Array(C);for(C=0;C<h;C++){A=l[C].getChildren();let J=0;for(let ge=0;ge<A.length;ge++){for(;S[C][J];)J++;let Se=A[ge],Fe=Se.__rowSpan||1,Ke=Se.__colSpan||1;for(let ke=0;ke<Fe;ke++)for(let Ae=0;Ae<Ke;Ae++)S[C+ke][J+Ae]=Se;if(i===Se)return{colSpan:Ke,columnIndex:J,rowIndex:C,rowSpan:Fe};J+=Ke}}return null}class Ds extends Sl{constructor(i,s,h){super(s,h),this.gridKey=i}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Uo(i)?this.gridKey===i.gridKey&&this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}set(i,s,h){this.dirty=!0,this.gridKey=i,this.anchor.key=s,this.focus.key=h,this._cachedNodes=null}clone(){return new Ds(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let s=this.focus.getNode();Qe(s.select(0,s.getChildrenSize())).insertNodes(i)}getShape(){var i=It(this.anchor.key);if(Nr(i)||Y(103),i=_r(i),i===null)throw Error("getCellRect: expected to find AnchorNode");var s=It(this.focus.key);Nr(s)||Y(104);let h=_r(s);if(h===null)throw Error("getCellRect: expected to find focusCellNode");s=Math.min(i.columnIndex,h.columnIndex);let C=Math.max(i.columnIndex,h.columnIndex),S=Math.min(i.rowIndex,h.rowIndex);return i=Math.max(i.rowIndex,h.rowIndex),{fromX:Math.min(s,C),fromY:Math.min(S,i),toX:Math.max(s,C),toY:Math.max(S,i)}}getNodes(){function i(Tt){let{cell:Mt,startColumn:hn,startRow:ar}=Tt;Se=Math.min(Se,hn),Fe=Math.min(Fe,ar),Ke=Math.max(Ke,hn+Mt.__colSpan-1),ke=Math.max(ke,ar+Mt.__rowSpan-1)}var s=this._cachedNodes;if(s!==null)return s;var h=this.anchor.getNode();s=this.focus.getNode();var C=Ns(h,Nr);h=Ns(s,Nr),Nr(C)||Y(103),Nr(h)||Y(104),s=C.getParent(),Jo(s)||Y(105),s=s.getParent(),Is(s)||Y(106);var S=h.getParents()[1];if(S!==s){if(s.isParentOf(h)){if(s=S.getParent(),s==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,h.getKey(),s.getKey())}else{if(s=s.getParent(),s==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,s.getKey(),h.getKey())}return this.getNodes()}let[A,J,ge]=vi(s,C,h),Se=Math.min(J.startColumn,ge.startColumn),Fe=Math.min(J.startRow,ge.startRow),Ke=Math.max(J.startColumn+J.cell.__colSpan-1,ge.startColumn+ge.cell.__colSpan-1),ke=Math.max(J.startRow+J.cell.__rowSpan-1,ge.startRow+ge.cell.__rowSpan-1);h=Se,C=Fe,S=Se;for(var Ae=Fe;Se<h||Fe<C||Ke>S||ke>Ae;){if(Se<h){var Xe=Ae-C;--h;for(var ut=0;ut<=Xe;ut++)i(A[C+ut][h])}if(Fe<C)for(Xe=S-h,--C,ut=0;ut<=Xe;ut++)i(A[C][h+ut]);if(Ke>S)for(Xe=Ae-C,S+=1,ut=0;ut<=Xe;ut++)i(A[C+ut][S]);if(ke>Ae)for(Xe=S-h,Ae+=1,ut=0;ut<=Xe;ut++)i(A[Ae][h+ut])}for(s=[s],h=null,C=Fe;C<=ke;C++)for(S=Se;S<=Ke;S++)({cell:Ae}=A[C][S]),Xe=Ae.getParent(),Jo(Xe)||Y(107),Xe!==h&&s.push(Xe),s.push(Ae,...wc(Ae)),h=Xe;return oi()||(this._cachedNodes=s),s}getTextContent(){let i=this.getNodes(),s="";for(let h=0;h<i.length;h++)s+=i[h].getTextContent();return s}}function Uo(l){return l instanceof Ds}class Ki extends Sl{constructor(i,s,h,C){super(i,s),this.format=h,this.style=C}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return wt(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus)&&this.format===i.format&&this.style===i.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var i=this._cachedNodes;if(i!==null)return i;i=this.anchor;var s=this.focus,h=i.isBefore(s),C=h?i:s;h=h?s:i,i=C.getNode(),s=h.getNode();let S=C.offset;return C=h.offset,Ze(i)&&(h=i.getDescendantByIndex(S),i=h??i),Ze(s)&&(h=s.getDescendantByIndex(C),h!==null&&h!==i&&s.getChildAtIndex(C)===h&&(h=h.getPreviousSibling()),s=h??s),i=i.is(s)?Ze(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(s),oi()||(this._cachedNodes=i),i}setTextNodeRange(i,s,h,C){Br(this.anchor,i.__key,s,"text"),Br(this.focus,h.__key,C,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let s=i[0],h=i[i.length-1],C=this.anchor,S=this.focus,A=C.isBefore(S),[J,ge]=zi(this),Se="",Fe=!0;for(let Ke=0;Ke<i.length;Ke++){let ke=i[Ke];if(Ze(ke)&&!ke.isInline())Fe||(Se+=`
61
+ `),Fe=!ke.isEmpty();else if(Fe=!1,ht(ke)){let Ae=ke.getTextContent();ke===s?ke===h?(C.type!=="element"||S.type!=="element"||S.offset===C.offset)&&(Ae=J<ge?Ae.slice(J,ge):Ae.slice(ge,J)):Ae=A?Ae.slice(J):Ae.slice(ge):ke===h&&(Ae=A?Ae.slice(0,ge):Ae.slice(0,J)),Se+=Ae}else!an(ke)&&!Ei(ke)||ke===h&&this.isCollapsed()||(Se+=ke.getTextContent())}return Se}applyDOMRange(i){let s=ln(),h=s.getEditorState()._selection;if(i=Tn(i.startContainer,i.startOffset,i.endContainer,i.endOffset,s,h),i!==null){var[C,S]=i;Br(this.anchor,C.key,C.offset,C.type),Br(this.focus,S.key,S.offset,S.type),this._cachedNodes=null}}clone(){let i=this.anchor,s=this.focus;return new Ki(new Dr(i.key,i.offset,i.type),new Dr(s.key,s.offset,s.type),this.format,this.style)}toggleFormat(i){this.format=Ot(this.format,i,null),this.dirty=!0}setStyle(i){this.style=i,this.dirty=!0}hasFormat(i){return(this.format&te[i])!==0}insertRawText(i){i=i.split(/(\r?\n|\t)/);let s=[],h=i.length;for(let C=0;C<h;C++){let S=i[C];S===`
62
62
  `||S===`\r
63
- `?s.push($r()):S===" "?s.push(Wi()):s.push(Bn(S))}this.insertNodes(s)}insertText(i){var s=this.anchor,h=this.focus,N=this.isCollapsed()||s.isBefore(h),S=this.format,A=this.style;N&&s.type==="element"?fo(s,h,S,A):N||h.type!=="element"||fo(h,s,S,A);var J=this.getNodes(),ge=J.length,Se=N?h:s;h=(N?s:h).offset;var Fe=Se.offset;s=J[0],ht(s)||Y(26),N=s.getTextContent().length;var Ke=s.getParentOrThrow(),ke=J[ge-1];if(this.isCollapsed()&&h===N&&(s.isSegmented()||s.isToken()||!s.canInsertTextAfter()||!Ke.canInsertTextAfter()&&s.getNextSibling()===null)){var Ae=s.getNextSibling();if(ht(Ae)&&Ae.canInsertTextBefore()&&!Et(Ae)||(Ae=Bn(),Ae.setFormat(S),Ke.canInsertTextAfter()?s.insertAfter(Ae):Ke.insertAfter(Ae)),Ae.select(0,0),s=Ae,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&h===0&&(s.isSegmented()||s.isToken()||!s.canInsertTextBefore()||!Ke.canInsertTextBefore()&&s.getPreviousSibling()===null)){if(Ae=s.getPreviousSibling(),(!ht(Ae)||Et(Ae))&&(Ae=Bn(),Ae.setFormat(S),Ke.canInsertTextBefore()?s.insertBefore(Ae):Ke.insertBefore(Ae)),Ae.select(),s=Ae,i!==""){this.insertText(i);return}}else if(s.isSegmented()&&h!==N)Ke=Bn(s.getTextContent()),Ke.setFormat(S),s.replace(Ke),s=Ke;else if(!(this.isCollapsed()||i===""||(Ae=ke.getParent(),Ke.canInsertTextBefore()&&Ke.canInsertTextAfter()&&(!Ze(Ae)||Ae.canInsertTextBefore()&&Ae.canInsertTextAfter())))){this.insertText(""),wa(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(s.isToken())i=Bn(i),i.select(),s.replace(i);else{if(J=s.getFormat(),ge=s.getStyle(),h===Fe&&(J!==S||ge!==A))if(s.getTextContent()==="")s.setFormat(S),s.setStyle(A);else{J=Bn(i),J.setFormat(S),J.setStyle(A),J.select(),h===0?s.insertBefore(J,!1):([ge]=s.splitText(h),ge.insertAfter(J,!1)),J.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(va(s)){i=Bn(i),i.setFormat(S),i.setStyle(A),i.select(),s.replace(i);return}s=s.spliceText(h,Fe-h,i,!0),s.getTextContent()===""?s.remove():this.anchor.type==="text"&&(s.isComposing()?this.anchor.offset-=i.length:(this.format=J,this.style=ge))}else{if(S=new Set([...s.getParentKeys(),...ke.getParentKeys()]),Ae=Ze(s)?s:s.getParentOrThrow(),A=Ze(ke)?ke:ke.getParentOrThrow(),Ke=ke,!Ae.is(A)&&A.isInline())do Ke=A,A=A.getParentOrThrow();while(A.isInline());if(Se.type==="text"&&(Fe!==0||ke.getTextContent()==="")||Se.type==="element"&&ke.getIndexWithinParent()<Fe)if(ht(ke)&&!ke.isToken()&&Fe!==ke.getTextContentSize()){if(ke.isSegmented()){var Xe=Bn(ke.getTextContent());ke.replace(Xe),ke=Xe}tr(Se.getNode())||Se.type!=="text"||(ke=ke.spliceText(0,Fe,"")),S.add(ke.__key)}else Se=ke.getParentOrThrow(),Se.canBeEmpty()||Se.getChildrenSize()!==1?ke.remove():Se.remove();else S.add(ke.__key);for(Se=A.getChildren(),Fe=new Set(J),ke=Ae.is(A),Ae=Ae.isInline()&&s.getNextSibling()===null?Ae:s,Xe=Se.length-1;0<=Xe;Xe--){let ut=Se[Xe];if(ut.is(s)||Ze(ut)&&ut.isParentOf(s))break;ut.isAttached()&&(!Fe.has(ut)||ut.is(Ke)?ke||Ae.insertAfter(ut,!1):ut.remove())}if(!ke)for(Se=A,A=null;Se!==null;)Fe=Se.getChildren(),ke=Fe.length,(ke===0||Fe[ke-1].is(A))&&(S.delete(Se.__key),A=Se),Se=Se.getParent();for(s.isToken()?h===N?s.select():(i=Bn(i),i.select(),s.replace(i)):(s=s.spliceText(h,N-h,i,!0),s.getTextContent()===""?s.remove():s.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)s=J[i],S.has(s.__key)||s.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),bt(null);else{var s=this.getNodes(),h=[];for(var N of s)ht(N)&&h.push(N);var S=h.length;if(S===0)this.toggleFormat(i),bt(null);else{N=this.anchor;var A=this.focus,J=this.isBackward();s=J?A:N,N=J?N:A;var ge=0,Se=h[0];if(A=s.type==="element"?0:s.offset,s.type==="text"&&A===Se.getTextContentSize()&&(ge=1,Se=h[1],A=0),Se!=null){J=Se.getFormatFlags(i,null);var Fe=S-1,Ke=h[Fe];if(S=N.type==="text"?N.offset:Ke.getTextContentSize(),Se.is(Ke))A!==S&&(A===0&&S===Se.getTextContentSize()?Se.setFormat(J):(i=Se.splitText(A,S),i=A===0?i[0]:i[1],i.setFormat(J),s.type==="text"&&s.set(i.__key,0,"text"),N.type==="text"&&N.set(i.__key,S-A,"text")),this.format=J);else{A!==0&&([,Se]=Se.splitText(A),A=0),Se.setFormat(J);var ke=Ke.getFormatFlags(i,J);for(0<S&&(S!==Ke.getTextContentSize()&&([Ke]=Ke.splitText(S)),Ke.setFormat(ke)),ge+=1;ge<Fe;ge++){let Ae=h[ge];if(!Ae.isToken()){let Xe=Ae.getFormatFlags(i,ke);Ae.setFormat(Xe)}}s.type==="text"&&s.set(Se.__key,A,"text"),N.type==="text"&&N.set(Ke.__key,S,"text"),this.format=J|ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var s=Vt();if(!wt(s))throw Error("Expected RangeSelection after insertParagraph");return s.insertNodes(i)}var h=Lo(this.anchor.getNode(),Qr);if(s=i[i.length-1],"__language"in h)if("__language"in i[0])this.insertText(i[0].getTextContent());else{var N=Vo(this);h.splice(N,0,i),s.selectEnd()}else if(i.some(J=>(Ze(J)||an(J))&&!J.isInline())){s=qo(i),i=s.getLastDescendant();var S=s.getChildren();s=Ze(h)&&h.isEmpty()?null:this.insertParagraph(),N=S[S.length-1];var A=S[0];(J=>Ze(J)&&Qr(J)&&!J.isEmpty()&&Ze(h)&&(!h.isEmpty()||"__value"in h&&"__checked"in h))(A)&&(h.append(...A.getChildren()),A=S[1]),A&&Ea(h,A),S=Lo(i,Qr),s&&Ze(S)&&("__value"in s&&"__checked"in s||Qr(N))&&(S.append(...s.getChildren()),s.remove()),Ze(h)&&h.isEmpty()&&h.remove(),i.selectEnd(),i=Ze(h)?h.getLastChild():null,Ei(i)&&S!==h&&i.remove()}else N=Vo(this),h.splice(N,0,i),s.selectEnd()}}insertParagraph(){if(this.anchor.key==="root"){var i=lr();return fn().splice(this.anchor.offset,0,[i]),i.select(),i}var s=Vo(this);return i=Lo(this.anchor.getNode(),Qr),s=(s=i.getChildAtIndex(s))?[s,...s.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...s),i.selectStart(),i):null}insertLineBreak(i){var s=$r();this.insertNodes([s]),i&&(i=s.getParentOrThrow(),s=s.getIndexWithinParent(),i.select(s,s))}extract(){var i=this.getNodes(),s=i.length,h=s-1,N=this.anchor;let S=this.focus;var A=i[0];let J=i[h],[ge,Se]=zi(this);return s===0?[]:s===1?ht(A)&&!this.isCollapsed()?(i=ge>Se?Se:ge,h=A.splitText(i,ge>Se?ge:Se),i=i===0?h[0]:h[1],i!=null?[i]:[]):[A]:(s=N.isBefore(S),ht(A)&&(N=s?ge:Se,N===A.getTextContentSize()?i.shift():N!==0&&([,A]=A.splitText(N),i[0]=A)),ht(J)&&(A=J.getTextContent().length,s=s?Se:ge,s===0?i.pop():s!==A&&([J]=J.splitText(s),i[h]=J)),i)}modify(i,s,h){var N=this.focus,S=this.anchor,A=i==="move",J=mn(N,s);if(an(J)&&!J.isIsolated())A&&J.isKeyboardSelectable()?(s=Ar(),s.add(J.__key),gr(s)):(i=s?J.getPreviousSibling():J.getNextSibling(),ht(i)?(J=i.__key,s=s?i.getTextContent().length:0,N.set(J,s,"text"),A&&S.set(J,s,"text")):(h=J.getParentOrThrow(),Ze(i)?(h=i.__key,J=s?i.getChildrenSize():0):(J=J.getIndexWithinParent(),h=h.__key,s||J++),N.set(h,J,"element"),A&&S.set(h,J,"element")));else if(S=ln(),N=kr(S._window)){var ge=S._blockCursorElement,Se=S._rootElement;if(Se===null||ge===null||!Ze(J)||J.isInline()||J.canBeEmpty()||hl(ge,S,Se),N.modify(i,s?"backward":"forward",h),0<N.rangeCount&&(J=N.getRangeAt(0),S=this.anchor.getNode(),S=tr(S)?S:ul(S),this.applyDOMRange(J),this.dirty=!0,!A)){for(A=this.getNodes(),i=[],h=!1,ge=0;ge<A.length;ge++)Se=A[ge],mi(Se,S)?i.push(Se):h=!0;h&&0<i.length&&(s?(s=i[0],Ze(s)?s.selectStart():s.getParentOrThrow().selectStart()):(s=i[i.length-1],Ze(s)?s.selectEnd():s.getParentOrThrow().selectEnd())),(N.anchorNode!==J.startContainer||N.anchorOffset!==J.startOffset)&&(s=this.focus,A=this.anchor,N=A.key,J=A.offset,S=A.type,Br(A,s.key,s.offset,s.type),Br(s,N,J,S),this._cachedNodes=null)}}}deleteCharacter(i){let s=this.isCollapsed();if(this.isCollapsed()){var h=this.anchor,N=this.focus,S=h.getNode();if(!i&&(h.type==="element"&&Ze(S)&&h.offset===S.getChildrenSize()||h.type==="text"&&h.offset===S.getTextContentSize())){var A=S.getParent();if(A=S.getNextSibling()||(A===null?null:A.getNextSibling()),Ze(A)&&A.isShadowRoot())return}if(A=mn(N,i),an(A)&&!A.isIsolated()){A.isKeyboardSelectable()&&Ze(S)&&S.getChildrenSize()===0?(S.remove(),i=Ar(),i.add(A.__key),gr(i)):(A.remove(),ln().dispatchCommand(t,void 0));return}if(!i&&Ze(A)&&Ze(S)&&S.isEmpty()){S.remove(),A.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(A=N.type==="text"?N.getNode():null,S=h.type==="text"?h.getNode():null,A!==null&&A.isSegmented()){if(h=N.offset,N=A.getTextContentSize(),A.is(S)||i&&h!==N||!i&&h!==0){As(A,i,h);return}}else if(S!==null&&S.isSegmented()&&(h=h.offset,N=S.getTextContentSize(),S.is(A)||i&&h!==0||!i&&h!==N)){As(S,i,h);return}if(S=this.anchor,A=this.focus,h=S.getNode(),N=A.getNode(),h===N&&S.type==="text"&&A.type==="text"){var J=S.offset,ge=A.offset;let Se=J<ge;N=Se?J:ge,ge=Se?ge:J,J=ge-1,N!==J&&(h=h.getTextContent().slice(N,ge),_s(h)||(i?A.offset=J:S.offset=J))}}}this.removeText(),i&&!s&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&tr(i.getParent())&&i.getIndexWithinParent()===0&&i.collapseAtStart(this))}deleteLine(i){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",i,"lineboundary"),(i?this.focus:this.anchor).offset===0&&this.modify("extend",i,"character")),this.removeText()}deleteWord(i){this.isCollapsed()&&this.modify("extend",i,"word"),this.removeText()}}function Go(l){return l instanceof ho}function Yo(l){let i=l.offset;return l.type==="text"?i:(l=l.getNode(),i===l.getChildrenSize()?l.getTextContent().length:0)}function zi(l){let i=l.anchor;return l=l.focus,i.type==="element"&&l.type==="element"&&i.key===l.key&&i.offset===l.offset?[0,0]:[Yo(i),Yo(l)]}function As(l,i,s){let h=l.getTextContent().split(/(?=\s)/g),N=h.length,S=0,A=0;for(let J=0;J<N;J++){let ge=h[J],Se=J===N-1;if(A=S,S+=ge.length,i&&S===s||S>s||Se){h.splice(J,1),Se&&(A=void 0);break}}i=h.join("").trim(),i===""?l.remove():(l.setTextContent(i),l.select(A,A))}function Sa(l,i,s,h){var N=i;if(l.nodeType===1){let J=!1;var S=l.childNodes,A=S.length;N===A&&(J=!0,N=A-1);let ge=S[N];if(A=!1,ge===h._blockCursorElement?(ge=S[N+1],A=!0):h._blockCursorElement!==null&&N--,h=Jr(ge),ht(h))N=J?h.getTextContentSize():0;else{if(S=Jr(l),S===null)return null;if(Ze(S)?(l=S.getChildAtIndex(N),(i=Ze(l))&&(i=l.getParent(),i=s===null||i===null||!i.canBeEmpty()||i!==s.getNode()),i&&(s=J?l.getLastDescendant():l.getFirstDescendant(),s===null?(S=l,N=0):(l=s,S=Ze(l)?l:l.getParentOrThrow())),ht(l)?(h=l,S=null,N=J?l.getTextContentSize():0):l!==S&&J&&!A&&N++):(N=S.getIndexWithinParent(),N=i===0&&an(S)&&Jr(l)===S?N:N+1,S=S.getParentOrThrow()),Ze(S))return new Dr(S.__key,N,"element")}}else h=Jr(l);return ht(h)?new Dr(h.__key,N,"text"):null}function Ol(l,i,s){var h=l.offset,N=l.getNode();h===0?(h=N.getPreviousSibling(),N=N.getParent(),i?(s||!i)&&h===null&&Ze(N)&&N.isInline()&&(i=N.getPreviousSibling(),ht(i)&&(l.key=i.__key,l.offset=i.getTextContent().length)):Ze(h)&&!s&&h.isInline()?(l.key=h.__key,l.offset=h.getChildrenSize(),l.type="element"):ht(h)&&(l.key=h.__key,l.offset=h.getTextContent().length)):h===N.getTextContent().length&&(h=N.getNextSibling(),N=N.getParent(),i&&Ze(h)&&h.isInline()?(l.key=h.__key,l.offset=0,l.type="element"):(s||i)&&h===null&&Ze(N)&&N.isInline()&&!N.canInsertTextAfter()&&(i=N.getNextSibling(),ht(i)&&(l.key=i.__key,l.offset=0)))}function wa(l,i,s){if(l.type==="text"&&i.type==="text"){var h=l.isBefore(i);let N=l.is(i);Ol(l,h,N),Ol(i,!h,N),N&&(i.key=l.key,i.offset=l.offset,i.type=l.type),h=ln(),h.isComposing()&&h._compositionKey!==l.key&&wt(s)&&(h=s.anchor,s=s.focus,Br(l,h.key,h.offset,h.type),Br(i,s.key,s.offset,s.type))}}function Tn(l,i,s,h,N,S){return l===null||s===null||!rt(N,l,s)||(i=Sa(l,i,wt(S)?S.anchor:null,N),i===null)||(h=Sa(s,h,wt(S)?S.focus:null,N),h===null||i.type==="element"&&h.type==="element"&&(l=Jr(l),s=Jr(s),an(l)&&an(s)))?null:(wa(i,h,S),[i,h])}function Gn(l,i,s,h,N,S){let A=yr();return l=new Ki(new Dr(l,i,N),new Dr(s,h,S),0,""),l.dirty=!0,A._selection=l}function Ar(){return new ho(new Set)}function xi(l){let i=l.getEditorState()._selection,s=kr(l._window);return wt(i)||i==null?Hn(i,s,l):i.clone()}function Hn(l,i,s){var h=s._window;if(h===null)return null;var N=h.event,S=N?N.type:void 0;h=S==="selectionchange",N=!ct&&(h||S==="beforeinput"||S==="compositionstart"||S==="compositionend"||S==="click"&&N&&N.detail===3||S==="drop"||S===void 0);let A;if(!wt(l)||N){if(i===null)return null;if(N=i.anchorNode,S=i.focusNode,A=i.anchorOffset,i=i.focusOffset,h&&wt(l)&&!rt(s,N,S))return l.clone()}else return l.clone();if(s=Tn(N,A,S,i,s,l),s===null)return null;let[J,ge]=s;return new Ki(J,ge,wt(l)?l.format:0,wt(l)?l.style:"")}function Vt(){return yr()._selection}function Ui(){return ln()._editorState._selection}function go(l,i,s,h=1){var N=l.anchor,S=l.focus,A=N.getNode(),J=S.getNode();if(i.is(A)||i.is(J)){if(A=i.__key,l.isCollapsed())i=N.offset,(s<=i&&0<h||s<i&&0>h)&&(s=Math.max(0,i+h),N.set(A,s,"element"),S.set(A,s,"element"),jo(l));else{let Se=l.isBackward();J=Se?S:N;var ge=J.getNode();N=Se?N:S,S=N.getNode(),i.is(ge)&&(ge=J.offset,(s<=ge&&0<h||s<ge&&0>h)&&J.set(A,Math.max(0,ge+h),"element")),i.is(S)&&(i=N.offset,(s<=i&&0<h||s<i&&0>h)&&N.set(A,Math.max(0,i+h),"element"))}jo(l)}}function jo(l){var i=l.anchor,s=i.offset;let h=l.focus;var N=h.offset,S=i.getNode(),A=h.getNode();if(l.isCollapsed())Ze(S)&&(A=S.getChildrenSize(),A=(N=s>=A)?S.getChildAtIndex(A-1):S.getChildAtIndex(s),ht(A)&&(s=0,N&&(s=A.getTextContentSize()),i.set(A.__key,s,"text"),h.set(A.__key,s,"text")));else{if(Ze(S)){let J=S.getChildrenSize();s=(l=s>=J)?S.getChildAtIndex(J-1):S.getChildAtIndex(s),ht(s)&&(S=0,l&&(S=s.getTextContentSize()),i.set(s.__key,S,"text"))}Ze(A)&&(s=A.getChildrenSize(),N=(i=N>=s)?A.getChildAtIndex(s-1):A.getChildAtIndex(N),ht(N)&&(A=0,i&&(A=N.getTextContentSize()),h.set(N.__key,A,"text")))}}function Ms(l,i){if(i=i.getEditorState()._selection,l=l._selection,wt(l)){var s=l.anchor;let h=l.focus,N;s.type==="text"&&(N=s.getNode(),N.selectionTransform(i,l)),h.type==="text"&&(s=h.getNode(),N!==s&&s.selectionTransform(i,l))}}function po(l,i,s,h,N){let S=null,A=0,J=null;h!==null?(S=h.__key,ht(h)?(A=h.getTextContentSize(),J="text"):Ze(h)&&(A=h.getChildrenSize(),J="element")):N!==null&&(S=N.__key,ht(N)?J="text":Ze(N)&&(J="element")),S!==null&&J!==null?l.set(S,A,J):(A=i.getIndexWithinParent(),A===-1&&(A=s.getChildrenSize()),l.set(s.__key,A,"element"))}function Rs(l,i,s,h,N){l.type==="text"?(l.key=s,i||(l.offset+=N)):l.offset>h.getIndexWithinParent()&&--l.offset}function vi(l,i,s){let h=[],N=null,S=null;l=l.getChildren();for(let Fe=0;Fe<l.length;Fe++){var A=l[Fe];Jo(A)||Y(108);var J=A.getChildren();A=0;for(let Ke of J){for(Nr(Ke)||Y(109);h[Fe]!==void 0&&h[Fe][A]!==void 0;)A++;J=Fe;var ge=A,Se=Ke;let ke={cell:Se,startColumn:ge,startRow:J},Ae=Se.__rowSpan,Xe=Se.__colSpan;for(let ut=0;ut<Ae;ut++){h[J+ut]===void 0&&(h[J+ut]=[]);for(let Tt=0;Tt<Xe;Tt++)h[J+ut][ge+Tt]=ke}i.is(Se)&&(N=ke),s.is(Se)&&(S=ke),A+=Ke.__colSpan}}return N===null&&Y(110),S===null&&Y(111),[h,N,S]}function ii(l){l instanceof ks||(l instanceof ni?(l=Ns(l,Nr),Nr(l)||Y(114)):(l=Ns(l.getNode(),Nr),Nr(l)||Y(114)));let i=l.getParent();Jo(i)||Y(115);let s=i.getParent();return Is(s)||Y(116),[l,i,s]}function Vo(l){l.isCollapsed()||l.removeText();var i=l.anchor,s=i.getNode();if(!ht(s))return i.offset;let h=s.getParent();return h?(s=s.splitText(i.offset),s.length===0?0:(i=i.offset===0?0:1,s=s[0].getIndexWithinParent()+i,!h.isInline()||s===0?s:((s=h.getChildAtIndex(s))&&h.insertNewAfter(l).append(s,...s.getNextSiblings()),h.getIndexWithinParent()+i))):(l=lr(),fn().append(l),l.select(),0)}function qo(l){let i=lr(),s=null;for(let h=0;h<l.length;h++){let N=l[h],S=Ei(N);if(S||an(N)&&N.isInline()||Ze(N)&&N.isInline()||ht(N)||N.isParentRequired()){if(s===null&&(s=N.createParentElementNode(),i.append(s),S))continue;s!==null&&s.append(N)}else i.append(N),s=null}return i}let yn=null,xn=null,vn=!1,Dl=!1,mo=0,Al={characterData:!0,childList:!0,subtree:!0};function oi(){return vn||yn!==null&&yn._readOnly}function Jn(){vn&&Y(13)}function yr(){return yn===null&&Y(15),yn}function ln(){return xn===null&&Y(16),xn}function Ml(l,i,s){var h=i.__type;let N=l._nodes.get(h);for(N===void 0&&Y(30,h),l=s.get(h),l===void 0&&(l=Array.from(N.transforms),s.set(h,l)),s=l.length,h=0;h<s&&(l[h](i),i.isAttached());h++);}function Oa(l,i){i=i._dirtyLeaves,l=l._nodeMap;for(let s of i)i=l.get(s),ht(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&qe(i)}function Pc(l,i){let s=i._dirtyLeaves,h=i._dirtyElements;l=l._nodeMap;let N=Ut(),S=new Map;var A=s;let J=A.size;for(var ge=h,Se=ge.size;0<J||0<Se;){if(0<J){i._dirtyLeaves=new Set;for(let Fe of A)A=l.get(Fe),ht(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&qe(A),A!==void 0&&A!==void 0&&A.__key!==N&&A.isAttached()&&Ml(i,A,S),s.add(Fe);if(A=i._dirtyLeaves,J=A.size,0<J){mo++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Fe of ge)ge=Fe[0],Se=Fe[1],(ge==="root"||Se)&&(A=l.get(ge),A!==void 0&&A!==void 0&&A.__key!==N&&A.isAttached()&&Ml(i,A,S),h.set(ge,Se));A=i._dirtyLeaves,J=A.size,ge=i._dirtyElements,Se=ge.size,mo++}i._dirtyLeaves=s,i._dirtyElements=h}function _o(l,i){var s=l.type,h=i.get(s);if(h===void 0&&Y(17,s),s=h.klass,l.type!==s.getType()&&Y(18,s.name),s=s.importJSON(l),l=l.children,Ze(s)&&Array.isArray(l))for(h=0;h<l.length;h++){let N=_o(l[h],i);s.append(N)}return s}function Da(l,i){let s=yn,h=vn,N=xn;yn=l,vn=!0,xn=null;try{return i()}finally{yn=s,vn=h,xn=N}}function Mr(l,i){let s=l._pendingEditorState,h=l._rootElement,N=l._headless||h===null;if(s!==null){var S=l._editorState,A=S._selection,J=s._selection,ge=l._dirtyType!==0,Se=yn,Fe=vn,Ke=xn,ke=l._updating,Ae=l._observer,Xe=null;if(l._pendingEditorState=null,l._editorState=s,!N&&ge&&Ae!==null){xn=l,yn=s,vn=!1,l._updating=!0;try{let rn=l._dirtyType,kn=l._dirtyElements,pt=l._dirtyLeaves;Ae.disconnect();var ut=rn,Tt=kn,Mt=pt;Ln=wr=On="",yi=ut===2,_n=null,Fn=l,_i=l._config,ko=l._nodes,Cs=Fn._listeners.mutation,Ir=Tt,En=Mt,Ni=S._nodeMap,mr=s._nodeMap,oo=s._readOnly,Es=new Map(l._keyToDOMMap);let Cr=new Map;so=Cr,lo("root",null),so=Es=_i=mr=Ni=En=Ir=ko=Fn=void 0,Xe=Cr}catch(rn){if(rn instanceof Error&&l._onError(rn),Dl)throw rn;Rl(l,null,h,s),Re(l),l._dirtyType=2,Dl=!0,Mr(l,S),Dl=!1;return}finally{Ae.observe(h,Al),l._updating=ke,yn=Se,vn=Fe,xn=Ke}}s._readOnly||(s._readOnly=!0);var hn=l._dirtyLeaves,ar=l._dirtyElements,Wr=l._normalizedNodes,si=l._updateTags,Oi=l._deferred;ge&&(l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements=new Map,l._normalizedNodes=new Set,l._updateTags=new Set);var Di=l._decorators,Eo=l._pendingDecorators||Di,bl=s._nodeMap,Ps;for(Ps in Eo)bl.has(Ps)||(Eo===Di&&(Eo=Fi(l)),delete Eo[Ps]);var Kr=N?null:kr(l._window);if(l._editable&&Kr!==null&&(ge||J===null||J.dirty)){xn=l,yn=s;try{if(Ae!==null&&Ae.disconnect(),ge||J===null||J.dirty){let rn=l._blockCursorElement;rn!==null&&hl(rn,l,h);e:{let kn=Kr.anchorNode,pt=Kr.focusNode,Cr=Kr.anchorOffset,ji=Kr.focusOffset,Qn=document.activeElement;if(!(si.has("collaboration")&&Qn!==h||Qn!==null&&Ve(Qn)))if(wt(J)){var To=J.anchor,$s=J.focus,Xo=To.key,Gi=$s.key,Pa=$n(l,Xo),$a=$n(l,Gi),Qo=To.offset,Fa=$s.offset,Ll=J.format,kl=J.style,Ba=J.isCollapsed(),xo=Pa,Fs=$a,zr=!1;if(To.type==="text"){xo=St(Pa);let cr=To.getNode();zr=cr.getFormat()!==Ll||cr.getStyle()!==kl}else wt(A)&&A.anchor.type==="text"&&(zr=!0);if($s.type==="text"&&(Fs=St($a)),xo!==null&&Fs!==null){if(Ba&&(A===null||zr||wt(A)&&(A.format!==Ll||A.style!==kl))){var Wn=performance.now();fa=[Ll,kl,Qo,Xo,Wn]}if(Cr===Qo&&ji===Fa&&kn===xo&&pt===Fs&&(Kr.type!=="Range"||!Ba)&&(Qn!==null&&h.contains(Qn)||h.focus({preventScroll:!0}),To.type!=="element"))break e;try{Kr.setBaseAndExtent(xo,Qo,Fs,Fa)}catch{}if(!si.has("skip-scroll-into-view")&&J.isCollapsed()&&h!==null&&h===document.activeElement){let cr=J instanceof Ki&&J.anchor.type==="element"?xo.childNodes[Qo]||null:0<Kr.rangeCount?Kr.getRangeAt(0):null;if(cr!==null){let In;if(cr instanceof Text){let er=document.createRange();er.selectNode(cr),In=er.getBoundingClientRect()}else In=cr.getBoundingClientRect();let Er=h.ownerDocument,Ri=Er.defaultView;if(Ri!==null)for(var{top:gt,bottom:Ai}=In,Yi,es,Mi=h;Mi!==null;){let er=Mi===Er.body;if(er)Yi=0,es=qn(l).innerHeight;else{let Bs=Mi.getBoundingClientRect();Yi=Bs.top,es=Bs.bottom}let Vi=0;if(gt<Yi?Vi=-(Yi-gt):Ai>es&&(Vi=Ai-es),Vi!==0)if(er)Ri.scrollBy(0,Vi);else{let Bs=Mi.scrollTop;Mi.scrollTop+=Vi;let Wa=Mi.scrollTop-Bs;gt-=Wa,Ai-=Wa}if(er)break;Mi=pr(Mi)}}}yl=!0}}else A!==null&&rt(l,kn,pt)&&Kr.removeAllRanges()}}e:{let rn=l._blockCursorElement;if(wt(J)&&J.isCollapsed()&&J.anchor.type==="element"&&h.contains(document.activeElement)){let kn=J.anchor,pt=kn.getNode(),Cr=kn.offset,ji=pt.getChildrenSize(),Qn=!1,cr=null;if(Cr===ji){let In=pt.getChildAtIndex(Cr-1);fl(In)&&(Qn=!0)}else{let In=pt.getChildAtIndex(Cr);if(fl(In)){let Er=In.getPreviousSibling();(Er===null||fl(Er))&&(Qn=!0,cr=l.getElementByKey(In.__key))}}if(Qn){let In=l.getElementByKey(pt.__key);if(rn===null){let Er=l._config.theme,Ri=document.createElement("div");Ri.contentEditable="false",Ri.setAttribute("data-lexical-cursor","true");let er=Er.blockCursor;if(er!==void 0){if(typeof er=="string"){let Vi=er.split(" ");er=Er.blockCursor=Vi}er!==void 0&&Ri.classList.add(...er)}l._blockCursorElement=rn=Ri}h.style.caretColor="transparent",cr===null?In.appendChild(rn):In.insertBefore(rn,cr);break e}}rn!==null&&hl(rn,l,h)}Ae!==null&&Ae.observe(h,Al)}finally{xn=Ke,yn=Se}}if(Xe!==null){var Ur=Xe;let rn=Array.from(l._listeners.mutation),kn=rn.length;for(let pt=0;pt<kn;pt++){let[Cr,ji]=rn[pt],Qn=Ur.get(ji);Qn!==void 0&&Cr(Qn,{dirtyLeaves:hn,prevEditorState:S,updateTags:si})}}wt(J)||J===null||A!==null&&A.is(J)||l.dispatchCommand(t,void 0);var ts=l._pendingDecorators;ts!==null&&(l._decorators=ts,l._pendingDecorators=null,yo("decorator",l,!0,ts));var Ha=ps(i||S),Il=ps(s);if(Ha!==Il&&yo("textcontent",l,!0,Il),yo("update",l,!0,{dirtyElements:ar,dirtyLeaves:hn,editorState:s,normalizedNodes:Wr,prevEditorState:i||S,tags:si}),l._deferred=[],Oi.length!==0){let rn=l._updating;l._updating=!0;try{for(let kn=0;kn<Oi.length;kn++)Oi[kn]()}finally{l._updating=rn}}var li=l._updates;if(li.length!==0){let rn=li.shift();if(rn){let[kn,pt]=rn;Aa(l,kn,pt)}}}}function yo(l,i,s,...h){let N=i._updating;i._updating=s;try{let S=Array.from(i._listeners[l]);for(l=0;l<S.length;l++)S[l].apply(null,h)}finally{i._updating=N}}function ot(l,i,s){if(l._updating===!1||xn!==l){let S=!1;return l.update(()=>{S=ot(l,i,s)}),S}let h=ye(l);for(let S=4;0<=S;S--)for(let A=0;A<h.length;A++){var N=h[A]._commands.get(i);if(N!==void 0&&(N=N[S],N!==void 0)){N=Array.from(N);let J=N.length;for(let ge=0;ge<J;ge++)if(N[ge](s,l)===!0)return!0}}return!1}function bs(l,i){let s=l._updates;for(i=i||!1;s.length!==0;){var h=s.shift();if(h){let[N,S]=h,A;S!==void 0&&(h=S.onUpdate,A=S.tag,S.skipTransforms&&(i=!0),h&&l._deferred.push(h),A&&l._updateTags.add(A)),N()}}return i}function Aa(l,i,s){let h=l._updateTags;var N,S=N=!1;if(s!==void 0){var A=s.onUpdate;N=s.tag,N!=null&&h.add(N),N=s.skipTransforms||!1,S=s.discrete||!1}A&&l._deferred.push(A),s=l._editorState,A=l._pendingEditorState;let J=!1;(A===null||A._readOnly)&&(A=l._pendingEditorState=new Co(new Map((A||s)._nodeMap)),J=!0),A._flushSync=S,S=yn;let ge=vn,Se=xn,Fe=l._updating;yn=A,vn=!1,l._updating=!0,xn=l;try{J&&(l._headless?s._selection!=null&&(A._selection=s._selection.clone()):A._selection=xi(l));let Ke=l._compositionKey;i(),N=bs(l,N),Ms(A,l),l._dirtyType!==0&&(N?Oa(A,l):Pc(A,l),bs(l),gl(s,A,l._dirtyLeaves,l._dirtyElements)),Ke!==l._compositionKey&&(A._flushSync=!0);let ke=A._selection;if(wt(ke)){let Ae=A._nodeMap,Xe=ke.focus.key;Ae.get(ke.anchor.key)!==void 0&&Ae.get(Xe)!==void 0||Y(19)}else Go(ke)&&ke._nodes.size===0&&(A._selection=null)}catch(Ke){Ke instanceof Error&&l._onError(Ke),l._pendingEditorState=s,l._dirtyType=2,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),Mr(l);return}finally{yn=S,vn=ge,xn=Se,l._updating=Fe,mo=0}l._dirtyType!==0||Ra(A,l)?A._flushSync?(A._flushSync=!1,Mr(l)):J&&je(()=>{Mr(l)}):(A._flushSync=!1,J&&(h.clear(),l._deferred=[],l._pendingEditorState=null))}function sr(l,i,s){l._updating?l._updates.push([i,s]):Aa(l,i,s)}class Ma extends ni{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function an(l){return l instanceof Ma}class Xn extends ni{constructor(i){super(i),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let i=this.getFormat();return Le[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getChildrenKeys(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s.__key),s=s.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=ln()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),s=this.getParentOrThrow().getLastChild();return s!==null&&s.is(i)}getAllTextNodes(){let i=[],s=this.getFirstChild();for(;s!==null;){if(ht(s)&&i.push(s),Ze(s)){let h=s.getAllTextNodes();i.push(...h)}s=s.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Ze(i)){let s=i.getFirstChild();if(s!==null){i=s;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Ze(i)){let s=i.getLastChild();if(s!==null){i=s;continue}}break}return i}getDescendantByIndex(i){let s=this.getChildren(),h=s.length;return i>=h?(i=s[h-1],Ze(i)&&i.getLastDescendant()||i||null):(i=s[i],Ze(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:It(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:It(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var s=this.getChildrenSize();let h;if(i<s/2){for(h=this.getFirstChild(),s=0;h!==null&&s<=i;){if(s===i)return h;h=h.getNextSibling(),s++}return null}for(h=this.getLastChild(),--s;h!==null&&s>=i;){if(s===i)return h;h=h.getPreviousSibling(),s--}return null}getTextContent(){let i="",s=this.getChildren(),h=s.length;for(let N=0;N<h;N++){let S=s[N];i+=S.getTextContent(),Ze(S)&&N!==h-1&&!S.isInline()&&(i+=`
63
+ `?s.push($r()):S===" "?s.push(Wi()):s.push(Bn(S))}this.insertNodes(s)}insertText(i){var s=this.anchor,h=this.focus,C=this.isCollapsed()||s.isBefore(h),S=this.format,A=this.style;C&&s.type==="element"?fo(s,h,S,A):C||h.type!=="element"||fo(h,s,S,A);var J=this.getNodes(),ge=J.length,Se=C?h:s;h=(C?s:h).offset;var Fe=Se.offset;s=J[0],ht(s)||Y(26),C=s.getTextContent().length;var Ke=s.getParentOrThrow(),ke=J[ge-1];if(this.isCollapsed()&&h===C&&(s.isSegmented()||s.isToken()||!s.canInsertTextAfter()||!Ke.canInsertTextAfter()&&s.getNextSibling()===null)){var Ae=s.getNextSibling();if(ht(Ae)&&Ae.canInsertTextBefore()&&!Et(Ae)||(Ae=Bn(),Ae.setFormat(S),Ke.canInsertTextAfter()?s.insertAfter(Ae):Ke.insertAfter(Ae)),Ae.select(0,0),s=Ae,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&h===0&&(s.isSegmented()||s.isToken()||!s.canInsertTextBefore()||!Ke.canInsertTextBefore()&&s.getPreviousSibling()===null)){if(Ae=s.getPreviousSibling(),(!ht(Ae)||Et(Ae))&&(Ae=Bn(),Ae.setFormat(S),Ke.canInsertTextBefore()?s.insertBefore(Ae):Ke.insertBefore(Ae)),Ae.select(),s=Ae,i!==""){this.insertText(i);return}}else if(s.isSegmented()&&h!==C)Ke=Bn(s.getTextContent()),Ke.setFormat(S),s.replace(Ke),s=Ke;else if(!(this.isCollapsed()||i===""||(Ae=ke.getParent(),Ke.canInsertTextBefore()&&Ke.canInsertTextAfter()&&(!Ze(Ae)||Ae.canInsertTextBefore()&&Ae.canInsertTextAfter())))){this.insertText(""),wa(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(s.isToken())i=Bn(i),i.select(),s.replace(i);else{if(J=s.getFormat(),ge=s.getStyle(),h===Fe&&(J!==S||ge!==A))if(s.getTextContent()==="")s.setFormat(S),s.setStyle(A);else{J=Bn(i),J.setFormat(S),J.setStyle(A),J.select(),h===0?s.insertBefore(J,!1):([ge]=s.splitText(h),ge.insertAfter(J,!1)),J.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(va(s)){i=Bn(i),i.setFormat(S),i.setStyle(A),i.select(),s.replace(i);return}s=s.spliceText(h,Fe-h,i,!0),s.getTextContent()===""?s.remove():this.anchor.type==="text"&&(s.isComposing()?this.anchor.offset-=i.length:(this.format=J,this.style=ge))}else{if(S=new Set([...s.getParentKeys(),...ke.getParentKeys()]),Ae=Ze(s)?s:s.getParentOrThrow(),A=Ze(ke)?ke:ke.getParentOrThrow(),Ke=ke,!Ae.is(A)&&A.isInline())do Ke=A,A=A.getParentOrThrow();while(A.isInline());if(Se.type==="text"&&(Fe!==0||ke.getTextContent()==="")||Se.type==="element"&&ke.getIndexWithinParent()<Fe)if(ht(ke)&&!ke.isToken()&&Fe!==ke.getTextContentSize()){if(ke.isSegmented()){var Xe=Bn(ke.getTextContent());ke.replace(Xe),ke=Xe}tr(Se.getNode())||Se.type!=="text"||(ke=ke.spliceText(0,Fe,"")),S.add(ke.__key)}else Se=ke.getParentOrThrow(),Se.canBeEmpty()||Se.getChildrenSize()!==1?ke.remove():Se.remove();else S.add(ke.__key);for(Se=A.getChildren(),Fe=new Set(J),ke=Ae.is(A),Ae=Ae.isInline()&&s.getNextSibling()===null?Ae:s,Xe=Se.length-1;0<=Xe;Xe--){let ut=Se[Xe];if(ut.is(s)||Ze(ut)&&ut.isParentOf(s))break;ut.isAttached()&&(!Fe.has(ut)||ut.is(Ke)?ke||Ae.insertAfter(ut,!1):ut.remove())}if(!ke)for(Se=A,A=null;Se!==null;)Fe=Se.getChildren(),ke=Fe.length,(ke===0||Fe[ke-1].is(A))&&(S.delete(Se.__key),A=Se),Se=Se.getParent();for(s.isToken()?h===C?s.select():(i=Bn(i),i.select(),s.replace(i)):(s=s.spliceText(h,C-h,i,!0),s.getTextContent()===""?s.remove():s.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)s=J[i],S.has(s.__key)||s.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),bt(null);else{var s=this.getNodes(),h=[];for(var C of s)ht(C)&&h.push(C);var S=h.length;if(S===0)this.toggleFormat(i),bt(null);else{C=this.anchor;var A=this.focus,J=this.isBackward();s=J?A:C,C=J?C:A;var ge=0,Se=h[0];if(A=s.type==="element"?0:s.offset,s.type==="text"&&A===Se.getTextContentSize()&&(ge=1,Se=h[1],A=0),Se!=null){J=Se.getFormatFlags(i,null);var Fe=S-1,Ke=h[Fe];if(S=C.type==="text"?C.offset:Ke.getTextContentSize(),Se.is(Ke))A!==S&&(A===0&&S===Se.getTextContentSize()?Se.setFormat(J):(i=Se.splitText(A,S),i=A===0?i[0]:i[1],i.setFormat(J),s.type==="text"&&s.set(i.__key,0,"text"),C.type==="text"&&C.set(i.__key,S-A,"text")),this.format=J);else{A!==0&&([,Se]=Se.splitText(A),A=0),Se.setFormat(J);var ke=Ke.getFormatFlags(i,J);for(0<S&&(S!==Ke.getTextContentSize()&&([Ke]=Ke.splitText(S)),Ke.setFormat(ke)),ge+=1;ge<Fe;ge++){let Ae=h[ge];if(!Ae.isToken()){let Xe=Ae.getFormatFlags(i,ke);Ae.setFormat(Xe)}}s.type==="text"&&s.set(Se.__key,A,"text"),C.type==="text"&&C.set(Ke.__key,S,"text"),this.format=J|ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var s=Vt();if(!wt(s))throw Error("Expected RangeSelection after insertParagraph");return s.insertNodes(i)}var h=Lo(this.anchor.getNode(),Qr);if(s=i[i.length-1],"__language"in h)if("__language"in i[0])this.insertText(i[0].getTextContent());else{var C=Vo(this);h.splice(C,0,i),s.selectEnd()}else if(i.some(J=>(Ze(J)||an(J))&&!J.isInline())){s=qo(i),i=s.getLastDescendant();var S=s.getChildren();s=Ze(h)&&h.isEmpty()?null:this.insertParagraph(),C=S[S.length-1];var A=S[0];(J=>Ze(J)&&Qr(J)&&!J.isEmpty()&&Ze(h)&&(!h.isEmpty()||"__value"in h&&"__checked"in h))(A)&&(h.append(...A.getChildren()),A=S[1]),A&&Ea(h,A),S=Lo(i,Qr),s&&Ze(S)&&("__value"in s&&"__checked"in s||Qr(C))&&(S.append(...s.getChildren()),s.remove()),Ze(h)&&h.isEmpty()&&h.remove(),i.selectEnd(),i=Ze(h)?h.getLastChild():null,Ei(i)&&S!==h&&i.remove()}else C=Vo(this),h.splice(C,0,i),s.selectEnd()}}insertParagraph(){if(this.anchor.key==="root"){var i=lr();return fn().splice(this.anchor.offset,0,[i]),i.select(),i}var s=Vo(this);return i=Lo(this.anchor.getNode(),Qr),s=(s=i.getChildAtIndex(s))?[s,...s.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...s),i.selectStart(),i):null}insertLineBreak(i){var s=$r();this.insertNodes([s]),i&&(i=s.getParentOrThrow(),s=s.getIndexWithinParent(),i.select(s,s))}extract(){var i=this.getNodes(),s=i.length,h=s-1,C=this.anchor;let S=this.focus;var A=i[0];let J=i[h],[ge,Se]=zi(this);return s===0?[]:s===1?ht(A)&&!this.isCollapsed()?(i=ge>Se?Se:ge,h=A.splitText(i,ge>Se?ge:Se),i=i===0?h[0]:h[1],i!=null?[i]:[]):[A]:(s=C.isBefore(S),ht(A)&&(C=s?ge:Se,C===A.getTextContentSize()?i.shift():C!==0&&([,A]=A.splitText(C),i[0]=A)),ht(J)&&(A=J.getTextContent().length,s=s?Se:ge,s===0?i.pop():s!==A&&([J]=J.splitText(s),i[h]=J)),i)}modify(i,s,h){var C=this.focus,S=this.anchor,A=i==="move",J=mn(C,s);if(an(J)&&!J.isIsolated())A&&J.isKeyboardSelectable()?(s=Ar(),s.add(J.__key),gr(s)):(i=s?J.getPreviousSibling():J.getNextSibling(),ht(i)?(J=i.__key,s=s?i.getTextContent().length:0,C.set(J,s,"text"),A&&S.set(J,s,"text")):(h=J.getParentOrThrow(),Ze(i)?(h=i.__key,J=s?i.getChildrenSize():0):(J=J.getIndexWithinParent(),h=h.__key,s||J++),C.set(h,J,"element"),A&&S.set(h,J,"element")));else if(S=ln(),C=kr(S._window)){var ge=S._blockCursorElement,Se=S._rootElement;if(Se===null||ge===null||!Ze(J)||J.isInline()||J.canBeEmpty()||hl(ge,S,Se),C.modify(i,s?"backward":"forward",h),0<C.rangeCount&&(J=C.getRangeAt(0),S=this.anchor.getNode(),S=tr(S)?S:ul(S),this.applyDOMRange(J),this.dirty=!0,!A)){for(A=this.getNodes(),i=[],h=!1,ge=0;ge<A.length;ge++)Se=A[ge],mi(Se,S)?i.push(Se):h=!0;h&&0<i.length&&(s?(s=i[0],Ze(s)?s.selectStart():s.getParentOrThrow().selectStart()):(s=i[i.length-1],Ze(s)?s.selectEnd():s.getParentOrThrow().selectEnd())),(C.anchorNode!==J.startContainer||C.anchorOffset!==J.startOffset)&&(s=this.focus,A=this.anchor,C=A.key,J=A.offset,S=A.type,Br(A,s.key,s.offset,s.type),Br(s,C,J,S),this._cachedNodes=null)}}}deleteCharacter(i){let s=this.isCollapsed();if(this.isCollapsed()){var h=this.anchor,C=this.focus,S=h.getNode();if(!i&&(h.type==="element"&&Ze(S)&&h.offset===S.getChildrenSize()||h.type==="text"&&h.offset===S.getTextContentSize())){var A=S.getParent();if(A=S.getNextSibling()||(A===null?null:A.getNextSibling()),Ze(A)&&A.isShadowRoot())return}if(A=mn(C,i),an(A)&&!A.isIsolated()){A.isKeyboardSelectable()&&Ze(S)&&S.getChildrenSize()===0?(S.remove(),i=Ar(),i.add(A.__key),gr(i)):(A.remove(),ln().dispatchCommand(t,void 0));return}if(!i&&Ze(A)&&Ze(S)&&S.isEmpty()){S.remove(),A.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(A=C.type==="text"?C.getNode():null,S=h.type==="text"?h.getNode():null,A!==null&&A.isSegmented()){if(h=C.offset,C=A.getTextContentSize(),A.is(S)||i&&h!==C||!i&&h!==0){As(A,i,h);return}}else if(S!==null&&S.isSegmented()&&(h=h.offset,C=S.getTextContentSize(),S.is(A)||i&&h!==0||!i&&h!==C)){As(S,i,h);return}if(S=this.anchor,A=this.focus,h=S.getNode(),C=A.getNode(),h===C&&S.type==="text"&&A.type==="text"){var J=S.offset,ge=A.offset;let Se=J<ge;C=Se?J:ge,ge=Se?ge:J,J=ge-1,C!==J&&(h=h.getTextContent().slice(C,ge),_s(h)||(i?A.offset=J:S.offset=J))}}}this.removeText(),i&&!s&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&tr(i.getParent())&&i.getIndexWithinParent()===0&&i.collapseAtStart(this))}deleteLine(i){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",i,"lineboundary"),(i?this.focus:this.anchor).offset===0&&this.modify("extend",i,"character")),this.removeText()}deleteWord(i){this.isCollapsed()&&this.modify("extend",i,"word"),this.removeText()}}function Go(l){return l instanceof ho}function Yo(l){let i=l.offset;return l.type==="text"?i:(l=l.getNode(),i===l.getChildrenSize()?l.getTextContent().length:0)}function zi(l){let i=l.anchor;return l=l.focus,i.type==="element"&&l.type==="element"&&i.key===l.key&&i.offset===l.offset?[0,0]:[Yo(i),Yo(l)]}function As(l,i,s){let h=l.getTextContent().split(/(?=\s)/g),C=h.length,S=0,A=0;for(let J=0;J<C;J++){let ge=h[J],Se=J===C-1;if(A=S,S+=ge.length,i&&S===s||S>s||Se){h.splice(J,1),Se&&(A=void 0);break}}i=h.join("").trim(),i===""?l.remove():(l.setTextContent(i),l.select(A,A))}function Sa(l,i,s,h){var C=i;if(l.nodeType===1){let J=!1;var S=l.childNodes,A=S.length;C===A&&(J=!0,C=A-1);let ge=S[C];if(A=!1,ge===h._blockCursorElement?(ge=S[C+1],A=!0):h._blockCursorElement!==null&&C--,h=Jr(ge),ht(h))C=J?h.getTextContentSize():0;else{if(S=Jr(l),S===null)return null;if(Ze(S)?(l=S.getChildAtIndex(C),(i=Ze(l))&&(i=l.getParent(),i=s===null||i===null||!i.canBeEmpty()||i!==s.getNode()),i&&(s=J?l.getLastDescendant():l.getFirstDescendant(),s===null?(S=l,C=0):(l=s,S=Ze(l)?l:l.getParentOrThrow())),ht(l)?(h=l,S=null,C=J?l.getTextContentSize():0):l!==S&&J&&!A&&C++):(C=S.getIndexWithinParent(),C=i===0&&an(S)&&Jr(l)===S?C:C+1,S=S.getParentOrThrow()),Ze(S))return new Dr(S.__key,C,"element")}}else h=Jr(l);return ht(h)?new Dr(h.__key,C,"text"):null}function Ol(l,i,s){var h=l.offset,C=l.getNode();h===0?(h=C.getPreviousSibling(),C=C.getParent(),i?(s||!i)&&h===null&&Ze(C)&&C.isInline()&&(i=C.getPreviousSibling(),ht(i)&&(l.key=i.__key,l.offset=i.getTextContent().length)):Ze(h)&&!s&&h.isInline()?(l.key=h.__key,l.offset=h.getChildrenSize(),l.type="element"):ht(h)&&(l.key=h.__key,l.offset=h.getTextContent().length)):h===C.getTextContent().length&&(h=C.getNextSibling(),C=C.getParent(),i&&Ze(h)&&h.isInline()?(l.key=h.__key,l.offset=0,l.type="element"):(s||i)&&h===null&&Ze(C)&&C.isInline()&&!C.canInsertTextAfter()&&(i=C.getNextSibling(),ht(i)&&(l.key=i.__key,l.offset=0)))}function wa(l,i,s){if(l.type==="text"&&i.type==="text"){var h=l.isBefore(i);let C=l.is(i);Ol(l,h,C),Ol(i,!h,C),C&&(i.key=l.key,i.offset=l.offset,i.type=l.type),h=ln(),h.isComposing()&&h._compositionKey!==l.key&&wt(s)&&(h=s.anchor,s=s.focus,Br(l,h.key,h.offset,h.type),Br(i,s.key,s.offset,s.type))}}function Tn(l,i,s,h,C,S){return l===null||s===null||!rt(C,l,s)||(i=Sa(l,i,wt(S)?S.anchor:null,C),i===null)||(h=Sa(s,h,wt(S)?S.focus:null,C),h===null||i.type==="element"&&h.type==="element"&&(l=Jr(l),s=Jr(s),an(l)&&an(s)))?null:(wa(i,h,S),[i,h])}function Gn(l,i,s,h,C,S){let A=yr();return l=new Ki(new Dr(l,i,C),new Dr(s,h,S),0,""),l.dirty=!0,A._selection=l}function Ar(){return new ho(new Set)}function xi(l){let i=l.getEditorState()._selection,s=kr(l._window);return wt(i)||i==null?Hn(i,s,l):i.clone()}function Hn(l,i,s){var h=s._window;if(h===null)return null;var C=h.event,S=C?C.type:void 0;h=S==="selectionchange",C=!ct&&(h||S==="beforeinput"||S==="compositionstart"||S==="compositionend"||S==="click"&&C&&C.detail===3||S==="drop"||S===void 0);let A;if(!wt(l)||C){if(i===null)return null;if(C=i.anchorNode,S=i.focusNode,A=i.anchorOffset,i=i.focusOffset,h&&wt(l)&&!rt(s,C,S))return l.clone()}else return l.clone();if(s=Tn(C,A,S,i,s,l),s===null)return null;let[J,ge]=s;return new Ki(J,ge,wt(l)?l.format:0,wt(l)?l.style:"")}function Vt(){return yr()._selection}function Ui(){return ln()._editorState._selection}function go(l,i,s,h=1){var C=l.anchor,S=l.focus,A=C.getNode(),J=S.getNode();if(i.is(A)||i.is(J)){if(A=i.__key,l.isCollapsed())i=C.offset,(s<=i&&0<h||s<i&&0>h)&&(s=Math.max(0,i+h),C.set(A,s,"element"),S.set(A,s,"element"),jo(l));else{let Se=l.isBackward();J=Se?S:C;var ge=J.getNode();C=Se?C:S,S=C.getNode(),i.is(ge)&&(ge=J.offset,(s<=ge&&0<h||s<ge&&0>h)&&J.set(A,Math.max(0,ge+h),"element")),i.is(S)&&(i=C.offset,(s<=i&&0<h||s<i&&0>h)&&C.set(A,Math.max(0,i+h),"element"))}jo(l)}}function jo(l){var i=l.anchor,s=i.offset;let h=l.focus;var C=h.offset,S=i.getNode(),A=h.getNode();if(l.isCollapsed())Ze(S)&&(A=S.getChildrenSize(),A=(C=s>=A)?S.getChildAtIndex(A-1):S.getChildAtIndex(s),ht(A)&&(s=0,C&&(s=A.getTextContentSize()),i.set(A.__key,s,"text"),h.set(A.__key,s,"text")));else{if(Ze(S)){let J=S.getChildrenSize();s=(l=s>=J)?S.getChildAtIndex(J-1):S.getChildAtIndex(s),ht(s)&&(S=0,l&&(S=s.getTextContentSize()),i.set(s.__key,S,"text"))}Ze(A)&&(s=A.getChildrenSize(),C=(i=C>=s)?A.getChildAtIndex(s-1):A.getChildAtIndex(C),ht(C)&&(A=0,i&&(A=C.getTextContentSize()),h.set(C.__key,A,"text")))}}function Ms(l,i){if(i=i.getEditorState()._selection,l=l._selection,wt(l)){var s=l.anchor;let h=l.focus,C;s.type==="text"&&(C=s.getNode(),C.selectionTransform(i,l)),h.type==="text"&&(s=h.getNode(),C!==s&&s.selectionTransform(i,l))}}function po(l,i,s,h,C){let S=null,A=0,J=null;h!==null?(S=h.__key,ht(h)?(A=h.getTextContentSize(),J="text"):Ze(h)&&(A=h.getChildrenSize(),J="element")):C!==null&&(S=C.__key,ht(C)?J="text":Ze(C)&&(J="element")),S!==null&&J!==null?l.set(S,A,J):(A=i.getIndexWithinParent(),A===-1&&(A=s.getChildrenSize()),l.set(s.__key,A,"element"))}function Rs(l,i,s,h,C){l.type==="text"?(l.key=s,i||(l.offset+=C)):l.offset>h.getIndexWithinParent()&&--l.offset}function vi(l,i,s){let h=[],C=null,S=null;l=l.getChildren();for(let Fe=0;Fe<l.length;Fe++){var A=l[Fe];Jo(A)||Y(108);var J=A.getChildren();A=0;for(let Ke of J){for(Nr(Ke)||Y(109);h[Fe]!==void 0&&h[Fe][A]!==void 0;)A++;J=Fe;var ge=A,Se=Ke;let ke={cell:Se,startColumn:ge,startRow:J},Ae=Se.__rowSpan,Xe=Se.__colSpan;for(let ut=0;ut<Ae;ut++){h[J+ut]===void 0&&(h[J+ut]=[]);for(let Tt=0;Tt<Xe;Tt++)h[J+ut][ge+Tt]=ke}i.is(Se)&&(C=ke),s.is(Se)&&(S=ke),A+=Ke.__colSpan}}return C===null&&Y(110),S===null&&Y(111),[h,C,S]}function ii(l){l instanceof ks||(l instanceof ni?(l=Ns(l,Nr),Nr(l)||Y(114)):(l=Ns(l.getNode(),Nr),Nr(l)||Y(114)));let i=l.getParent();Jo(i)||Y(115);let s=i.getParent();return Is(s)||Y(116),[l,i,s]}function Vo(l){l.isCollapsed()||l.removeText();var i=l.anchor,s=i.getNode();if(!ht(s))return i.offset;let h=s.getParent();return h?(s=s.splitText(i.offset),s.length===0?0:(i=i.offset===0?0:1,s=s[0].getIndexWithinParent()+i,!h.isInline()||s===0?s:((s=h.getChildAtIndex(s))&&h.insertNewAfter(l).append(s,...s.getNextSiblings()),h.getIndexWithinParent()+i))):(l=lr(),fn().append(l),l.select(),0)}function qo(l){let i=lr(),s=null;for(let h=0;h<l.length;h++){let C=l[h],S=Ei(C);if(S||an(C)&&C.isInline()||Ze(C)&&C.isInline()||ht(C)||C.isParentRequired()){if(s===null&&(s=C.createParentElementNode(),i.append(s),S))continue;s!==null&&s.append(C)}else i.append(C),s=null}return i}let yn=null,xn=null,vn=!1,Dl=!1,mo=0,Al={characterData:!0,childList:!0,subtree:!0};function oi(){return vn||yn!==null&&yn._readOnly}function Jn(){vn&&Y(13)}function yr(){return yn===null&&Y(15),yn}function ln(){return xn===null&&Y(16),xn}function Ml(l,i,s){var h=i.__type;let C=l._nodes.get(h);for(C===void 0&&Y(30,h),l=s.get(h),l===void 0&&(l=Array.from(C.transforms),s.set(h,l)),s=l.length,h=0;h<s&&(l[h](i),i.isAttached());h++);}function Oa(l,i){i=i._dirtyLeaves,l=l._nodeMap;for(let s of i)i=l.get(s),ht(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&qe(i)}function Pc(l,i){let s=i._dirtyLeaves,h=i._dirtyElements;l=l._nodeMap;let C=Ut(),S=new Map;var A=s;let J=A.size;for(var ge=h,Se=ge.size;0<J||0<Se;){if(0<J){i._dirtyLeaves=new Set;for(let Fe of A)A=l.get(Fe),ht(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&qe(A),A!==void 0&&A!==void 0&&A.__key!==C&&A.isAttached()&&Ml(i,A,S),s.add(Fe);if(A=i._dirtyLeaves,J=A.size,0<J){mo++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Fe of ge)ge=Fe[0],Se=Fe[1],(ge==="root"||Se)&&(A=l.get(ge),A!==void 0&&A!==void 0&&A.__key!==C&&A.isAttached()&&Ml(i,A,S),h.set(ge,Se));A=i._dirtyLeaves,J=A.size,ge=i._dirtyElements,Se=ge.size,mo++}i._dirtyLeaves=s,i._dirtyElements=h}function _o(l,i){var s=l.type,h=i.get(s);if(h===void 0&&Y(17,s),s=h.klass,l.type!==s.getType()&&Y(18,s.name),s=s.importJSON(l),l=l.children,Ze(s)&&Array.isArray(l))for(h=0;h<l.length;h++){let C=_o(l[h],i);s.append(C)}return s}function Da(l,i){let s=yn,h=vn,C=xn;yn=l,vn=!0,xn=null;try{return i()}finally{yn=s,vn=h,xn=C}}function Mr(l,i){let s=l._pendingEditorState,h=l._rootElement,C=l._headless||h===null;if(s!==null){var S=l._editorState,A=S._selection,J=s._selection,ge=l._dirtyType!==0,Se=yn,Fe=vn,Ke=xn,ke=l._updating,Ae=l._observer,Xe=null;if(l._pendingEditorState=null,l._editorState=s,!C&&ge&&Ae!==null){xn=l,yn=s,vn=!1,l._updating=!0;try{let rn=l._dirtyType,kn=l._dirtyElements,pt=l._dirtyLeaves;Ae.disconnect();var ut=rn,Tt=kn,Mt=pt;Ln=wr=On="",yi=ut===2,_n=null,Fn=l,_i=l._config,ko=l._nodes,Cs=Fn._listeners.mutation,Ir=Tt,En=Mt,Ni=S._nodeMap,mr=s._nodeMap,oo=s._readOnly,Es=new Map(l._keyToDOMMap);let Cr=new Map;so=Cr,lo("root",null),so=Es=_i=mr=Ni=En=Ir=ko=Fn=void 0,Xe=Cr}catch(rn){if(rn instanceof Error&&l._onError(rn),Dl)throw rn;Rl(l,null,h,s),Re(l),l._dirtyType=2,Dl=!0,Mr(l,S),Dl=!1;return}finally{Ae.observe(h,Al),l._updating=ke,yn=Se,vn=Fe,xn=Ke}}s._readOnly||(s._readOnly=!0);var hn=l._dirtyLeaves,ar=l._dirtyElements,Wr=l._normalizedNodes,si=l._updateTags,Oi=l._deferred;ge&&(l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements=new Map,l._normalizedNodes=new Set,l._updateTags=new Set);var Di=l._decorators,Eo=l._pendingDecorators||Di,bl=s._nodeMap,Ps;for(Ps in Eo)bl.has(Ps)||(Eo===Di&&(Eo=Fi(l)),delete Eo[Ps]);var Kr=C?null:kr(l._window);if(l._editable&&Kr!==null&&(ge||J===null||J.dirty)){xn=l,yn=s;try{if(Ae!==null&&Ae.disconnect(),ge||J===null||J.dirty){let rn=l._blockCursorElement;rn!==null&&hl(rn,l,h);e:{let kn=Kr.anchorNode,pt=Kr.focusNode,Cr=Kr.anchorOffset,ji=Kr.focusOffset,Qn=document.activeElement;if(!(si.has("collaboration")&&Qn!==h||Qn!==null&&Ve(Qn)))if(wt(J)){var To=J.anchor,$s=J.focus,Xo=To.key,Gi=$s.key,Pa=$n(l,Xo),$a=$n(l,Gi),Qo=To.offset,Fa=$s.offset,Ll=J.format,kl=J.style,Ba=J.isCollapsed(),xo=Pa,Fs=$a,zr=!1;if(To.type==="text"){xo=St(Pa);let cr=To.getNode();zr=cr.getFormat()!==Ll||cr.getStyle()!==kl}else wt(A)&&A.anchor.type==="text"&&(zr=!0);if($s.type==="text"&&(Fs=St($a)),xo!==null&&Fs!==null){if(Ba&&(A===null||zr||wt(A)&&(A.format!==Ll||A.style!==kl))){var Wn=performance.now();fa=[Ll,kl,Qo,Xo,Wn]}if(Cr===Qo&&ji===Fa&&kn===xo&&pt===Fs&&(Kr.type!=="Range"||!Ba)&&(Qn!==null&&h.contains(Qn)||h.focus({preventScroll:!0}),To.type!=="element"))break e;try{Kr.setBaseAndExtent(xo,Qo,Fs,Fa)}catch{}if(!si.has("skip-scroll-into-view")&&J.isCollapsed()&&h!==null&&h===document.activeElement){let cr=J instanceof Ki&&J.anchor.type==="element"?xo.childNodes[Qo]||null:0<Kr.rangeCount?Kr.getRangeAt(0):null;if(cr!==null){let In;if(cr instanceof Text){let er=document.createRange();er.selectNode(cr),In=er.getBoundingClientRect()}else In=cr.getBoundingClientRect();let Er=h.ownerDocument,Ri=Er.defaultView;if(Ri!==null)for(var{top:gt,bottom:Ai}=In,Yi,es,Mi=h;Mi!==null;){let er=Mi===Er.body;if(er)Yi=0,es=qn(l).innerHeight;else{let Bs=Mi.getBoundingClientRect();Yi=Bs.top,es=Bs.bottom}let Vi=0;if(gt<Yi?Vi=-(Yi-gt):Ai>es&&(Vi=Ai-es),Vi!==0)if(er)Ri.scrollBy(0,Vi);else{let Bs=Mi.scrollTop;Mi.scrollTop+=Vi;let Wa=Mi.scrollTop-Bs;gt-=Wa,Ai-=Wa}if(er)break;Mi=pr(Mi)}}}yl=!0}}else A!==null&&rt(l,kn,pt)&&Kr.removeAllRanges()}}e:{let rn=l._blockCursorElement;if(wt(J)&&J.isCollapsed()&&J.anchor.type==="element"&&h.contains(document.activeElement)){let kn=J.anchor,pt=kn.getNode(),Cr=kn.offset,ji=pt.getChildrenSize(),Qn=!1,cr=null;if(Cr===ji){let In=pt.getChildAtIndex(Cr-1);fl(In)&&(Qn=!0)}else{let In=pt.getChildAtIndex(Cr);if(fl(In)){let Er=In.getPreviousSibling();(Er===null||fl(Er))&&(Qn=!0,cr=l.getElementByKey(In.__key))}}if(Qn){let In=l.getElementByKey(pt.__key);if(rn===null){let Er=l._config.theme,Ri=document.createElement("div");Ri.contentEditable="false",Ri.setAttribute("data-lexical-cursor","true");let er=Er.blockCursor;if(er!==void 0){if(typeof er=="string"){let Vi=er.split(" ");er=Er.blockCursor=Vi}er!==void 0&&Ri.classList.add(...er)}l._blockCursorElement=rn=Ri}h.style.caretColor="transparent",cr===null?In.appendChild(rn):In.insertBefore(rn,cr);break e}}rn!==null&&hl(rn,l,h)}Ae!==null&&Ae.observe(h,Al)}finally{xn=Ke,yn=Se}}if(Xe!==null){var Ur=Xe;let rn=Array.from(l._listeners.mutation),kn=rn.length;for(let pt=0;pt<kn;pt++){let[Cr,ji]=rn[pt],Qn=Ur.get(ji);Qn!==void 0&&Cr(Qn,{dirtyLeaves:hn,prevEditorState:S,updateTags:si})}}wt(J)||J===null||A!==null&&A.is(J)||l.dispatchCommand(t,void 0);var ts=l._pendingDecorators;ts!==null&&(l._decorators=ts,l._pendingDecorators=null,yo("decorator",l,!0,ts));var Ha=ps(i||S),Il=ps(s);if(Ha!==Il&&yo("textcontent",l,!0,Il),yo("update",l,!0,{dirtyElements:ar,dirtyLeaves:hn,editorState:s,normalizedNodes:Wr,prevEditorState:i||S,tags:si}),l._deferred=[],Oi.length!==0){let rn=l._updating;l._updating=!0;try{for(let kn=0;kn<Oi.length;kn++)Oi[kn]()}finally{l._updating=rn}}var li=l._updates;if(li.length!==0){let rn=li.shift();if(rn){let[kn,pt]=rn;Aa(l,kn,pt)}}}}function yo(l,i,s,...h){let C=i._updating;i._updating=s;try{let S=Array.from(i._listeners[l]);for(l=0;l<S.length;l++)S[l].apply(null,h)}finally{i._updating=C}}function ot(l,i,s){if(l._updating===!1||xn!==l){let S=!1;return l.update(()=>{S=ot(l,i,s)}),S}let h=ye(l);for(let S=4;0<=S;S--)for(let A=0;A<h.length;A++){var C=h[A]._commands.get(i);if(C!==void 0&&(C=C[S],C!==void 0)){C=Array.from(C);let J=C.length;for(let ge=0;ge<J;ge++)if(C[ge](s,l)===!0)return!0}}return!1}function bs(l,i){let s=l._updates;for(i=i||!1;s.length!==0;){var h=s.shift();if(h){let[C,S]=h,A;S!==void 0&&(h=S.onUpdate,A=S.tag,S.skipTransforms&&(i=!0),h&&l._deferred.push(h),A&&l._updateTags.add(A)),C()}}return i}function Aa(l,i,s){let h=l._updateTags;var C,S=C=!1;if(s!==void 0){var A=s.onUpdate;C=s.tag,C!=null&&h.add(C),C=s.skipTransforms||!1,S=s.discrete||!1}A&&l._deferred.push(A),s=l._editorState,A=l._pendingEditorState;let J=!1;(A===null||A._readOnly)&&(A=l._pendingEditorState=new Co(new Map((A||s)._nodeMap)),J=!0),A._flushSync=S,S=yn;let ge=vn,Se=xn,Fe=l._updating;yn=A,vn=!1,l._updating=!0,xn=l;try{J&&(l._headless?s._selection!=null&&(A._selection=s._selection.clone()):A._selection=xi(l));let Ke=l._compositionKey;i(),C=bs(l,C),Ms(A,l),l._dirtyType!==0&&(C?Oa(A,l):Pc(A,l),bs(l),gl(s,A,l._dirtyLeaves,l._dirtyElements)),Ke!==l._compositionKey&&(A._flushSync=!0);let ke=A._selection;if(wt(ke)){let Ae=A._nodeMap,Xe=ke.focus.key;Ae.get(ke.anchor.key)!==void 0&&Ae.get(Xe)!==void 0||Y(19)}else Go(ke)&&ke._nodes.size===0&&(A._selection=null)}catch(Ke){Ke instanceof Error&&l._onError(Ke),l._pendingEditorState=s,l._dirtyType=2,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),Mr(l);return}finally{yn=S,vn=ge,xn=Se,l._updating=Fe,mo=0}l._dirtyType!==0||Ra(A,l)?A._flushSync?(A._flushSync=!1,Mr(l)):J&&je(()=>{Mr(l)}):(A._flushSync=!1,J&&(h.clear(),l._deferred=[],l._pendingEditorState=null))}function sr(l,i,s){l._updating?l._updates.push([i,s]):Aa(l,i,s)}class Ma extends ni{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function an(l){return l instanceof Ma}class Xn extends ni{constructor(i){super(i),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let i=this.getFormat();return Le[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s),s=s.getNextSibling();return i}getChildrenKeys(){let i=[],s=this.getFirstChild();for(;s!==null;)i.push(s.__key),s=s.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=ln()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),s=this.getParentOrThrow().getLastChild();return s!==null&&s.is(i)}getAllTextNodes(){let i=[],s=this.getFirstChild();for(;s!==null;){if(ht(s)&&i.push(s),Ze(s)){let h=s.getAllTextNodes();i.push(...h)}s=s.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Ze(i)){let s=i.getFirstChild();if(s!==null){i=s;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Ze(i)){let s=i.getLastChild();if(s!==null){i=s;continue}}break}return i}getDescendantByIndex(i){let s=this.getChildren(),h=s.length;return i>=h?(i=s[h-1],Ze(i)&&i.getLastDescendant()||i||null):(i=s[i],Ze(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:It(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:It(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var s=this.getChildrenSize();let h;if(i<s/2){for(h=this.getFirstChild(),s=0;h!==null&&s<=i;){if(s===i)return h;h=h.getNextSibling(),s++}return null}for(h=this.getLastChild(),--s;h!==null&&s>=i;){if(s===i)return h;h=h.getPreviousSibling(),s--}return null}getTextContent(){let i="",s=this.getChildren(),h=s.length;for(let C=0;C<h;C++){let S=s[C];i+=S.getTextContent(),Ze(S)&&C!==h-1&&!S.isInline()&&(i+=`
64
64
 
65
- `)}return i}getTextContentSize(){let i=0,s=this.getChildren(),h=s.length;for(let N=0;N<h;N++){let S=s[N];i+=S.getTextContentSize(),Ze(S)&&N!==h-1&&!S.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=we[i],(this.getFormat()&i)!==0):!1}select(i,s){Jn();let h=Vt(),N=i,S=s;var A=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&s===0){if(i=this.getFirstChild(),ht(i)||Ze(i))return i.select(0,0)}else if(!(i!==void 0&&i!==A||s!==void 0&&s!==A)&&(i=this.getLastChild(),ht(i)||Ze(i)))return i.select()}if(N===void 0&&(N=A),S===void 0&&(S=A),A=this.__key,wt(h))h.anchor.set(A,N,"element"),h.focus.set(A,S,"element"),h.dirty=!0;else return Gn(A,N,A,S,"element","element");return h}selectStart(){let i=this.getFirstDescendant();return i?i.selectStart():this.select()}selectEnd(){let i=this.getLastDescendant();return i?i.selectEnd():this.select()}clear(){let i=this.getWritable();return this.getChildren().forEach(s=>s.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let s=this.getWritable();return s.__dir=i,s}setFormat(i){return this.getWritable().__format=i!==""?we[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,s,h){let N=h.length,S=this.getChildrenSize(),A=this.getWritable(),J=A.__key;var ge=[],Se=[];let Fe=this.getChildAtIndex(i+s),Ke=null,ke=S-s+N;if(i!==0)if(i===S)Ke=this.getLastChild();else{var Ae=this.getChildAtIndex(i);Ae!==null&&(Ke=Ae.getPreviousSibling())}if(0<s){var Xe=Ke===null?this.getFirstChild():Ke.getNextSibling();for(Ae=0;Ae<s;Ae++){Xe===null&&Y(100);var ut=Xe.getNextSibling(),Tt=Xe.__key;Xe=Xe.getWritable(),xt(Xe),Se.push(Tt),Xe=ut}}for(Ae=Ke,ut=0;ut<N;ut++){Tt=h[ut],Ae!==null&&Tt.is(Ae)&&(Ke=Ae=Ae.getPreviousSibling()),Xe=Tt.getWritable(),Xe.__parent===J&&ke--,xt(Xe);let Mt=Tt.__key;Ae===null?(A.__first=Mt,Xe.__prev=null):(Ae=Ae.getWritable(),Ae.__next=Mt,Xe.__prev=Ae.__key),Tt.__key===J&&Y(76),Xe.__parent=J,ge.push(Mt),Ae=Tt}if(i+s===S?Ae!==null&&(Ae.getWritable().__next=null,A.__last=Ae.__key):Fe!==null&&(i=Fe.getWritable(),Ae!==null?(s=Ae.getWritable(),i.__prev=Ae.__key,s.__next=Fe.__key):i.__prev=null),A.__size=ke,Se.length&&(i=Vt(),wt(i))){Se=new Set(Se),ge=new Set(ge);let{anchor:Mt,focus:hn}=i;Ls(Mt,Se,ge)&&po(Mt,Mt.getNode(),this,Ke,Fe),Ls(hn,Se,ge)&&po(hn,hn.getNode(),this,Ke,Fe),ke!==0||this.canBeEmpty()||Xr(this)||this.remove()}return A}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function Ze(l){return l instanceof Xn}function Ls(l,i,s){for(l=l.getNode();l;){let h=l.__key;if(i.has(h)&&!s.has(h))return!0;l=l.getParent()}return!1}class Hr extends Xn{static getType(){return"root"}static clone(){return new Hr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!oi()&&ln()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let s=0;s<i.length;s++){let h=i[s];Ze(h)||an(h)||Y(56)}return super.append(...i)}static importJSON(i){let s=fn();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function tr(l){return l instanceof Hr}function Ra(l,i){if(i=i.getEditorState()._selection,l=l._selection,l!==null){if(l.dirty||!l.is(i))return!0}else if(i!==null)return!0;return!1}function Si(){return new Co(new Map([["root",new Hr]]))}function No(l){let i=l.exportJSON();var s=l.constructor;i.type!==s.getType()&&Y(130,s.name);let h=i.children;if(Ze(l))for(Array.isArray(h)||Y(59,s.name),l=l.getChildren(),s=0;s<l.length;s++){let N=No(l[s]);h.push(N)}return i}class Co{constructor(i,s){this._nodeMap=i,this._selection=s||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Da(this,i)}clone(i){return i=new Co(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Da(this,()=>({root:No(fn())}))}}class wi extends Xn{static getType(){return"paragraph"}static clone(i){return new wi(i.__key)}createDOM(i){let s=document.createElement("p");return i=Kt(i.theme,"paragraph"),i!==void 0&&s.classList.add(...i),s}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Zo,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&io(i)){this.isEmpty()&&i.append(document.createElement("br"));var s=this.getFormatType();i.style.textAlign=s,(s=this.getDirection())&&(i.dir=s),s=this.getIndent(),0<s&&(i.style.textIndent=`${20*s}px`)}return{element:i}}static importJSON(i){let s=lr();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,s){i=lr();let h=this.getDirection();return i.setDirection(h),this.insertAfter(i,s),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||ht(i[0])&&i[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Zo(l){let i=lr();return l.style&&(i.setFormat(l.style.textAlign),l=parseInt(l.style.textIndent,10)/20,0<l&&i.setIndent(l)),{node:i}}function lr(){return Bi(new wi)}function Rl(l,i,s,h){let N=l._keyToDOMMap;N.clear(),l._editorState=Si(),l._pendingEditorState=h,l._compositionKey=null,l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),l._normalizedNodes=new Set,l._updateTags=new Set,l._updates=[],l._blockCursorElement=null,h=l._observer,h!==null&&(h.disconnect(),l._observer=null),i!==null&&(i.textContent=""),s!==null&&(s.textContent="",N.set("root",s))}function ba(l,i){let s=new Map,h=new Set,N=S=>{Object.keys(S).forEach(A=>{let J=s.get(A);J===void 0&&(J=[],s.set(A,J)),J.push(S[A])})};return l.forEach(S=>{S=S.klass.importDOM!=null?S.klass.importDOM.bind(S.klass):null,S==null||h.has(S)||(h.add(S),S=S(),S!==null&&N(S))}),i&&N(i),s}class La{constructor(i,s,h,N,S,A,J){this._parentEditor=s,this._rootElement=null,this._editorState=i,this._compositionKey=this._pendingEditorState=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=N,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ge(),this._onError=S,this._htmlConversions=A,this._editable=J,this._headless=s!==null&&s._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let s=this._listeners.update;return s.add(i),()=>{s.delete(i)}}registerEditableListener(i){let s=this._listeners.editable;return s.add(i),()=>{s.delete(i)}}registerDecoratorListener(i){let s=this._listeners.decorator;return s.add(i),()=>{s.delete(i)}}registerTextContentListener(i){let s=this._listeners.textcontent;return s.add(i),()=>{s.delete(i)}}registerRootListener(i){let s=this._listeners.root;return i(this._rootElement,null),s.add(i),()=>{i(null,this._rootElement),s.delete(i)}}registerCommand(i,s,h){h===void 0&&Y(35);let N=this._commands;N.has(i)||N.set(i,[new Set,new Set,new Set,new Set,new Set]);let S=N.get(i);S===void 0&&Y(36,String(i));let A=S[h];return A.add(s),()=>{A.delete(s),S.every(J=>J.size===0)&&N.delete(i)}}registerMutationListener(i,s){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let h=this._listeners.mutation;return h.set(s,i),()=>{h.delete(s)}}registerNodeTransformToKlass(i,s){var h=i.getType();return h=this._nodes.get(h),h===void 0&&Y(37,i.name),h.transforms.add(s),h}registerNodeTransform(i,s){var h=this.registerNodeTransformToKlass(i,s);let N=[h];return h=h.replaceWithKlass,h!=null&&(h=this.registerNodeTransformToKlass(h,s),N.push(h)),ms(this,i.getType()),()=>{N.forEach(S=>S.transforms.delete(s))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,s){return ot(this,i,s)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let s=this._rootElement;if(i!==s){let A=Kt(this._config.theme,"root");var h=this._pendingEditorState||this._editorState;if(this._rootElement=i,Rl(this,s,i,h),s!==null){if(!this._config.disableEvents){Fo!==0&&(Fo--,Fo===0&&s.ownerDocument.removeEventListener("selectionchange",Ca));var N=s.__lexicalEditor;if(N!=null){if(N._parentEditor!==null){var S=ye(N);S=S[S.length-1]._key,co.get(S)===N&&co.delete(S)}else co.delete(N._key);s.__lexicalEditor=null}for(N=Na(s),S=0;S<N.length;S++)N[S]();s.__lexicalEventHandles=[]}A!=null&&s.classList.remove(...A)}i!==null?(h=(h=i.ownerDocument)&&h.defaultView||null,N=i.style,N.userSelect="text",N.whiteSpace="pre-wrap",N.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=h,this._dirtyType=2,Re(this),this._updateTags.add("history-merge"),Mr(this),this._config.disableEvents||Lc(i,this),A!=null&&i.classList.add(...A)):(this._editorState=h,this._window=this._pendingEditorState=null),yo("root",this,!1,i,s)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,s){i.isEmpty()&&Y(38),Oe(this);let h=this._pendingEditorState,N=this._updateTags;s=s!==void 0?s.tag:null,h===null||h.isEmpty()||(s!=null&&N.add(s),Mr(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&N.add(s),Mr(this)}parseEditorState(i,s){i=typeof i=="string"?JSON.parse(i):i;let h=Si(),N=yn,S=vn,A=xn,J=this._dirtyElements,ge=this._dirtyLeaves,Se=this._cloneNotNeeded,Fe=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,yn=h,vn=!1,xn=this;try{_o(i.root,this._nodes),s&&s(),h._readOnly=!0}catch(Ke){Ke instanceof Error&&this._onError(Ke)}finally{this._dirtyElements=J,this._dirtyLeaves=ge,this._cloneNotNeeded=Se,this._dirtyType=Fe,yn=N,vn=S,xn=A}return h}update(i,s){sr(this,i,s)}focus(i,s={}){let h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),sr(this,()=>{let N=Vt(),S=fn();N!==null?N.dirty=!0:S.getChildrenSize()!==0&&(s.defaultSelection==="rootStart"?S.selectStart():S.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=kr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,yo("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class ks extends Xn{constructor(i,s){super(s),this.__colSpan=i,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(i){return this.getWritable().__colSpan=i,this}getRowSpan(){return this.__rowSpan}setRowSpan(i){return this.getWritable().__rowSpan=i,this}}function Nr(l){return l instanceof ks}class ka extends Xn{}function Is(l){return l instanceof ka}class Ia extends Xn{}function Jo(l){return l instanceof Ia}return $e.$INTERNAL_isPointSelection=wl,$e.$addUpdateTag=function(l){Jn(),ln()._updateTags.add(l)},$e.$applyNodeReplacement=Bi,$e.$copyNode=dl,$e.$createLineBreakNode=$r,$e.$createNodeSelection=Ar,$e.$createParagraphNode=lr,$e.$createRangeSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Ki(l,i,0,"")},$e.$createTabNode=Wi,$e.$createTextNode=Bn,$e.$getAdjacentNode=mn,$e.$getNearestNodeFromDOMNode=Sr,$e.$getNearestRootOrShadowRoot=ul,$e.$getNodeByKey=It,$e.$getPreviousSelection=Ui,$e.$getRoot=fn,$e.$getSelection=Vt,$e.$getTextContent=function(){let l=Vt();return l===null?"":l.getTextContent()},$e.$hasAncestor=mi,$e.$hasUpdateTag=function(l){return ln()._updateTags.has(l)},$e.$insertNodes=function(l){let i=Vt()||Ui();i===null&&(i=fn().selectEnd()),i.insertNodes(l)},$e.$isBlockElementNode=function(l){return Ze(l)&&!l.isInline()},$e.$isDecoratorNode=an,$e.$isElementNode=Ze,$e.$isInlineElementOrDecoratorNode=function(l){return Ze(l)&&l.isInline()||an(l)&&l.isInline()},$e.$isLeafNode=function(l){return ht(l)||Ei(l)||an(l)},$e.$isLineBreakNode=Ei,$e.$isNodeSelection=Go,$e.$isParagraphNode=function(l){return l instanceof wi},$e.$isRangeSelection=wt,$e.$isRootNode=tr,$e.$isRootOrShadowRoot=Xr,$e.$isTabNode=va,$e.$isTextNode=ht,$e.$nodesOfType=function(l){var i=yr();let s=i._readOnly,h=l.getType();i=i._nodeMap;let N=[];for(let[,S]of i)S instanceof l&&S.__type===h&&(s||S.isAttached())&&N.push(S);return N},$e.$normalizeSelection__EXPERIMENTAL=Qe,$e.$parseSerializedNode=function(l){return _o(l,ln()._nodes)},$e.$selectAll=function(){var l=fn();l=l.select(0,l.getChildrenSize()),gr(Qe(l))},$e.$setCompositionKey=bt,$e.$setSelection=gr,$e.$splitNode=function(l,i){let s=l.getChildAtIndex(i);s==null&&(s=l),Xr(l)&&Y(102);let h=A=>{const J=A.getParentOrThrow(),ge=Xr(J),Se=A!==s||ge?dl(A):A;if(ge)return A.insertAfter(Se),[A,Se,Se];const[Fe,Ke,ke]=h(J);return A=A.getNextSiblings(),ke.append(Se,...A),[Fe,Ke,Se]},[N,S]=h(s);return[N,S]},$e.BLUR_COMMAND=V,$e.CAN_REDO_COMMAND={},$e.CAN_UNDO_COMMAND={},$e.CLEAR_EDITOR_COMMAND={},$e.CLEAR_HISTORY_COMMAND={},$e.CLICK_COMMAND=e,$e.COMMAND_PRIORITY_CRITICAL=4,$e.COMMAND_PRIORITY_EDITOR=0,$e.COMMAND_PRIORITY_HIGH=3,$e.COMMAND_PRIORITY_LOW=1,$e.COMMAND_PRIORITY_NORMAL=2,$e.CONTROLLED_TEXT_INSERTION_COMMAND=d,$e.COPY_COMMAND=pe,$e.CUT_COMMAND=ue,$e.DELETE_CHARACTER_COMMAND=n,$e.DELETE_LINE_COMMAND=v,$e.DELETE_WORD_COMMAND=C,$e.DEPRECATED_$computeGridMap=vi,$e.DEPRECATED_$createGridSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Ds("root",l,i)},$e.DEPRECATED_$getGridCellNodeRect=_r,$e.DEPRECATED_$getNodeTriplet=ii,$e.DEPRECATED_$isGridCellNode=Nr,$e.DEPRECATED_$isGridNode=Is,$e.DEPRECATED_$isGridRowNode=Jo,$e.DEPRECATED_$isGridSelection=Uo,$e.DEPRECATED_GridCellNode=ks,$e.DEPRECATED_GridNode=ka,$e.DEPRECATED_GridRowNode=Ia,$e.DRAGEND_COMMAND=_e,$e.DRAGOVER_COMMAND=me,$e.DRAGSTART_COMMAND=q,$e.DROP_COMMAND=U,$e.DecoratorNode=Ma,$e.ElementNode=Xn,$e.FOCUS_COMMAND=D,$e.FORMAT_ELEMENT_COMMAND={},$e.FORMAT_TEXT_COMMAND=T,$e.INDENT_CONTENT_COMMAND={},$e.INSERT_LINE_BREAK_COMMAND=r,$e.INSERT_PARAGRAPH_COMMAND=c,$e.INSERT_TAB_COMMAND={},$e.KEY_ARROW_DOWN_COMMAND=H,$e.KEY_ARROW_LEFT_COMMAND=$,$e.KEY_ARROW_RIGHT_COMMAND=x,$e.KEY_ARROW_UP_COMMAND=P,$e.KEY_BACKSPACE_COMMAND=X,$e.KEY_DELETE_COMMAND=le,$e.KEY_DOWN_COMMAND=b,$e.KEY_ENTER_COMMAND=B,$e.KEY_ESCAPE_COMMAND=ee,$e.KEY_MODIFIER_COMMAND=ne,$e.KEY_SPACE_COMMAND=z,$e.KEY_TAB_COMMAND=j,$e.LineBreakNode=Pr,$e.MOVE_TO_END=w,$e.MOVE_TO_START=W,$e.OUTDENT_CONTENT_COMMAND={},$e.PASTE_COMMAND=g,$e.ParagraphNode=wi,$e.REDO_COMMAND=R,$e.REMOVE_TEXT_COMMAND=p,$e.RootNode=Hr,$e.SELECTION_CHANGE_COMMAND=t,$e.SELECT_ALL_COMMAND=K,$e.TabNode=uo,$e.TextNode=ri,$e.UNDO_COMMAND=O,$e.createCommand=function(){return{}},$e.createEditor=function(l){var i=l||{},s=xn,h=i.theme||{};let N=l===void 0?s:i.parentEditor||null,S=i.disableEvents||!1,A=Si(),J=i.namespace||(N!==null?N._config.namespace:Ge()),ge=i.editorState,Se=[Hr,ri,Pr,uo,wi,...i.nodes||[]],{onError:Fe,html:Ke}=i;if(i=i.editable!==void 0?i.editable:!0,l===void 0&&s!==null)l=s._nodes;else for(l=new Map,s=0;s<Se.length;s++){let Ae=Se[s],Xe=null;var ke=null;typeof Ae!="function"&&(ke=Ae,Ae=ke.replace,Xe=ke.with,ke=ke.withKlass||null);let ut=Ae.getType(),Tt=Ae.transform(),Mt=new Set;Tt!==null&&Mt.add(Tt),l.set(ut,{exportDOM:Ke&&Ke.export?Ke.export.get(Ae):void 0,klass:Ae,replace:Xe,replaceWithKlass:ke,transforms:Mt})}return h=new La(A,N,l,{disableEvents:S,namespace:J,theme:h},Fe||console.error,ba(l,Ke?Ke.import:void 0),i),ge!==void 0&&(h._pendingEditorState=ge,h._dirtyType=2),h},$e.getNearestEditorFromDOMNode=_t,$e.isHTMLAnchorElement=function(l){return io(l)&&l.tagName==="A"},$e.isHTMLElement=io,$e.isSelectionCapturedInDecoratorInput=Ve,$e.isSelectionWithinEditor=rt,$e}var Jc,Lf;function Bt(){return Lf||(Lf=1,Jc=process.env.NODE_ENV==="development"?$N():FN()),Jc}var kf;function BN(){if(kf)return qc;kf=1;var t=Un(),e=Bt(),n=et;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const g={tag:"history-merge"};function p({initialConfig:v,children:T}){const O=n.useMemo(()=>{const{theme:R,namespace:b,editor__DEPRECATED:x,nodes:w,onError:$,editorState:W,html:P}=v,H=t.createLexicalComposerContext(null,R);let B=x||null;if(B===null){const z=e.createEditor({editable:v.editable,html:P,namespace:b,nodes:w,onError:X=>$(X,z),theme:R});C(z,W),B=z}return[B,H]},[]);return d(()=>{const R=v.editable,[b]=O;b.setEditable(R!==void 0?R:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:O},T)}function C(v,T){if(T!==null){if(T===void 0)v.update(()=>{const O=e.$getRoot();if(O.isEmpty()){const R=e.$createParagraphNode();O.append(R);const b=r?document.activeElement:null;(e.$getSelection()!==null||b!==null&&b===v.getRootElement())&&R.select()}},g);else if(T!==null)switch(typeof T){case"string":{const O=v.parseEditorState(T);v.setEditorState(O,g);break}case"object":{v.setEditorState(T,g);break}case"function":{v.update(()=>{e.$getRoot().isEmpty()&&T(v)},g);break}}}}return qc.LexicalComposer=p,qc}var Xc={},If;function HN(){if(If)return Xc;If=1;var t=Un(),e=Bt(),n=et;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var c=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function g(p,C){if(C!==null){if(C===void 0)p.update(()=>{var v=e.$getRoot();if(v.isEmpty()){let T=e.$createParagraphNode();v.append(T),v=r?document.activeElement:null,(e.$getSelection()!==null||v!==null&&v===p.getRootElement())&&T.select()}},d);else if(C!==null)switch(typeof C){case"string":let v=p.parseEditorState(C);p.setEditorState(v,d);break;case"object":p.setEditorState(C,d);break;case"function":p.update(()=>{e.$getRoot().isEmpty()&&C(p)},d)}}}return Xc.LexicalComposer=function({initialConfig:p,children:C}){let v=n.useMemo(()=>{const{theme:T,namespace:O,editor__DEPRECATED:R,nodes:b,onError:x,editorState:w,html:$}=p,W=t.createLexicalComposerContext(null,T);let P=R||null;if(P===null){const H=e.createEditor({editable:p.editable,html:$,namespace:O,nodes:b,onError:B=>x(B,H),theme:T});g(H,w),P=H}return[P,W]},[]);return c(()=>{let T=p.editable,[O]=v;O.setEditable(T!==void 0?T:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:v},C)},Xc}const WN=process.env.NODE_ENV==="development"?BN():HN();var KN=WN,Qc={},eu,Pf;function zN(){if(Pf)return eu;Pf=1;var t=Un(),e=et,c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function d(C){const[v]=t.useLexicalComposerContext(),T=e.useMemo(()=>C(v),[v,C]),O=e.useRef(T.initialValueFn()),[R,b]=e.useState(O.current);return c(()=>{const{initialValueFn:x,subscribe:w}=T,$=x();return O.current!==$&&(O.current=$,b($)),w(W=>{O.current=W,b(W)})},[T,C]),R}function g(C){return{initialValueFn:()=>C.isEditable(),subscribe:v=>C.registerEditableListener(v)}}function p(){return d(g)}return eu=p,eu}var tu,$f;function UN(){if($f)return tu;$f=1;var t=Un(),e=et,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function r(d){let[g]=t.useLexicalComposerContext(),p=e.useMemo(()=>d(g),[g,d]),C=e.useRef(p.initialValueFn()),[v,T]=e.useState(C.current);return n(()=>{let{initialValueFn:O,subscribe:R}=p,b=O();return C.current!==b&&(C.current=b,T(b)),R(x=>{C.current=x,T(x)})},[p,d]),v}function c(d){return{initialValueFn:()=>d.isEditable(),subscribe:g=>d.registerEditableListener(g)}}return tu=function(){return r(c)},tu}var nu,Ff;function Tp(){return Ff||(Ff=1,nu=process.env.NODE_ENV==="development"?zN():UN()),nu}var Xi={},Bf;function GN(){if(Bf)return Xi;Bf=1;var t=Bt();function e(C,v){let T=C.getFirstChild(),O=0;e:for(;T!==null;){if(t.$isElementNode(T)){const x=T.getFirstChild();if(x!==null){T=x;continue}}else if(t.$isTextNode(T)){const x=T.getTextContentSize();if(O+x>v)return{node:T,offset:v-O};O+=x}const R=T.getNextSibling();if(R!==null){T=R;continue}let b=T.getParent();for(;b!==null;){const x=b.getNextSibling();if(x!==null){T=x;continue e}b=b.getParent()}break}return null}function n(C,v=!0){if(C)return!1;let T=c();return v&&(T=T.trim()),T===""}function r(C,v){return()=>n(C,v)}function c(){return t.$getRoot().getTextContent()}function d(C){if(!n(C,!1))return!1;const T=t.$getRoot().getChildren(),O=T.length;if(O>1)return!1;for(let R=0;R<O;R++){const b=T[R];if(t.$isDecoratorNode(b))return!1;if(t.$isElementNode(b)){if(!t.$isParagraphNode(b)||b.__indent!==0)return!1;const x=b.getChildren(),w=x.length;for(let $=0;$<w;$++){const W=x[R];if(!t.$isTextNode(W))return!1}}}return!0}function g(C){return()=>d(C)}function p(C,v,T,O){const R=H=>H instanceof T,b=H=>{const B=t.$createTextNode(H.getTextContent());B.setFormat(H.getFormat()),H.replace(B)},x=H=>H.getLatest().__mode,w=H=>{if(!H.isSimpleText())return;const B=H.getPreviousSibling();let z=H.getTextContent(),X=H,ee;if(t.$isTextNode(B)){const le=B.getTextContent(),j=le+z,U=v(j);if(R(B))if(U===null||x(B)!==0){b(B);return}else{const q=U.end-le.length;if(q>0){const me=z.slice(0,q),_e=le+me;if(B.select(),B.setTextContent(_e),q===z.length)H.remove();else{const pe=z.slice(q);H.setTextContent(pe)}return}}else if(U===null||U.start<le.length)return}for(;;){ee=v(z);let le=ee===null?"":z.slice(ee.end);if(z=le,le===""){const q=X.getNextSibling();if(t.$isTextNode(q)){le=X.getTextContent()+q.getTextContent();const me=v(le);if(me===null){R(q)?b(q):q.markDirty();return}else if(me.start!==0)return}}else{const q=v(le);if(q!==null&&q.start===0)return}if(ee===null)return;if(ee.start===0&&t.$isTextNode(B)&&B.isTextEntity())continue;let j;ee.start===0?[j,X]=X.splitText(ee.end):[,j,X]=X.splitText(ee.start,ee.end);const U=O(j);if(U.setFormat(j.getFormat()),j.replace(U),X==null)return}},$=H=>{const B=H.getTextContent(),z=v(B);if(z===null||z.start!==0){b(H);return}if(B.length>z.end){H.splitText(z.end);return}const X=H.getPreviousSibling();t.$isTextNode(X)&&X.isTextEntity()&&(b(X),b(H));const ee=H.getNextSibling();t.$isTextNode(ee)&&ee.isTextEntity()&&(b(ee),R(H)&&b(H))},W=C.registerNodeTransform(t.TextNode,w),P=C.registerNodeTransform(T,$);return[W,P]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=g,Xi.$findTextIntersectionFromCharacters=e,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=c,Xi.registerLexicalTextEntity=p,Xi}var Qi={},Hf;function YN(){if(Hf)return Qi;Hf=1;var t=Bt();function e(c,d=!0){return c?!1:(c=n(),d&&(c=c.trim()),c==="")}function n(){return t.$getRoot().getTextContent()}function r(c){if(!e(c,!1))return!1;c=t.$getRoot().getChildren();let d=c.length;if(1<d)return!1;for(let p=0;p<d;p++){var g=c[p];if(t.$isDecoratorNode(g))return!1;if(t.$isElementNode(g)){if(!t.$isParagraphNode(g)||g.__indent!==0)return!1;g=g.getChildren();let C=g.length;for(let v=0;v<C;v++)if(!t.$isTextNode(g[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(c){return()=>r(c)},Qi.$findTextIntersectionFromCharacters=function(c,d){var g=c.getFirstChild();c=0;e:for(;g!==null;){if(t.$isElementNode(g)){var p=g.getFirstChild();if(p!==null){g=p;continue}}else if(t.$isTextNode(g)){if(p=g.getTextContentSize(),c+p>d)return{node:g,offset:d-c};c+=p}if(p=g.getNextSibling(),p!==null)g=p;else{for(g=g.getParent();g!==null;){if(p=g.getNextSibling(),p!==null){g=p;continue e}g=g.getParent()}break}}return null},Qi.$isRootTextContentEmpty=e,Qi.$isRootTextContentEmptyCurry=function(c,d){return()=>e(c,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(c,d,g,p){let C=T=>{const O=t.$createTextNode(T.getTextContent());O.setFormat(T.getFormat()),T.replace(O)},v=c.registerNodeTransform(t.TextNode,T=>{if(T.isSimpleText()){var O=T.getPreviousSibling(),R=T.getTextContent(),b=T;if(t.$isTextNode(O)){var x=O.getTextContent(),w=d(x+R);if(O instanceof g){if(w===null||O.getLatest().__mode!==0){C(O);return}if(w=w.end-x.length,0<w){b=R.slice(0,w),b=x+b,O.select(),O.setTextContent(b),w===R.length?T.remove():(O=R.slice(w),T.setTextContent(O));return}}else if(w===null||w.start<x.length)return}for(;;){if(T=d(R),R=w=T===null?"":R.slice(T.end),w===""){if(x=b.getNextSibling(),t.$isTextNode(x)){if(w=b.getTextContent()+x.getTextContent(),w=d(w),w===null){x instanceof g?C(x):x.markDirty();break}else if(w.start!==0)break}}else if(x=d(w),x!==null&&x.start===0)break;if(T===null)break;if(T.start===0&&t.$isTextNode(O)&&O.isTextEntity())continue;let $;if(T.start===0?[$,b]=b.splitText(T.end):[,$,b]=b.splitText(T.start,T.end),T=p($),T.setFormat($.getFormat()),$.replace(T),b==null)break}}});return c=c.registerNodeTransform(g,T=>{var O=T.getTextContent();const R=d(O);R===null||R.start!==0?C(T):O.length>R.end?T.splitText(R.end):(O=T.getPreviousSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(C(O),C(T)),O=T.getNextSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(C(O),T instanceof g&&C(T)))}),[v,c]},Qi}var ru,Wf;function xp(){return Wf||(Wf=1,ru=process.env.NODE_ENV==="development"?GN():YN()),ru}var Nn={},Kn={},Kf;function jN(){if(Kf)return Kn;Kf=1;var t=Bt();const e=new Map;function n(K){let D=K;for(;D!=null;){if(D.nodeType===Node.TEXT_NODE)return D;D=D.firstChild}return null}function r(K){const D=K.parentNode;if(D==null)throw new Error("Should never happen");return[D,Array.from(D.childNodes).indexOf(K)]}function c(K,D,V,ne,Y){const G=D.getKey(),Q=ne.getKey(),k=document.createRange();let m=K.getElementByKey(G),y=K.getElementByKey(Q),M=V,Z=Y;if(t.$isTextNode(D)&&(m=n(m)),t.$isTextNode(ne)&&(y=n(y)),D===void 0||ne===void 0||m===null||y===null)return null;m.nodeName==="BR"&&([m,M]=r(m)),y.nodeName==="BR"&&([y,Z]=r(y));const ae=m.firstChild;m===y&&ae!=null&&ae.nodeName==="BR"&&M===0&&Z===0&&(Z=1);try{k.setStart(m,M),k.setEnd(y,Z)}catch{return null}return k.collapsed&&(M!==Z||G!==Q)&&(k.setStart(y,Z),k.setEnd(m,M)),k}function d(K,D){const V=K.getRootElement();if(V===null)return[];const ne=V.getBoundingClientRect(),Y=getComputedStyle(V),G=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),Q=Array.from(D.getClientRects());let k=Q.length;Q.sort((y,M)=>{const Z=y.top-M.top;return Math.abs(Z)<=3?y.left-M.left:Z});let m;for(let y=0;y<k;y++){const M=Q[y],Z=m&&m.top<=M.top&&m.top+m.height>M.top&&m.left+m.width>M.left,ae=M.width+G===ne.width;if(Z||ae){Q.splice(y--,1),k--;continue}m=M}return Q}function g(K){const D={},V=K.split(";");for(const ne of V)if(ne!==""){const[Y,G]=ne.split(/:([^]+)/);Y&&G&&(D[Y.trim()]=G.trim())}return D}function p(K){let D=e.get(K);return D===void 0&&(D=g(K),e.set(K,D)),Object.freeze(D),D}function C(K){let D="";for(const V in K)V&&(D+=`${V}: ${K[V]};`);return D}function v(K,D){return K.__first=D.__first,K.__last=D.__last,K.__size=D.__size,K.__format=D.__format,K.__indent=D.__indent,K.__dir=D.__dir,K}function T(K,D){return K.__format=D.__format,K.__style=D.__style,K.__mode=D.__mode,K.__detail=D.__detail,K}function O(K){const V=K.constructor.clone(K);return V.__parent=K.__parent,V.__next=K.__next,V.__prev=K.__prev,t.$isElementNode(K)&&t.$isElementNode(V)?v(V,K):t.$isTextNode(K)&&t.$isTextNode(V)?T(V,K):V}function R(K,D){if(D.isSelected()&&!D.isSegmented()&&!D.isToken()&&t.$INTERNAL_isPointSelection(K)){const V=K.anchor.getNode(),ne=K.focus.getNode(),Y=D.is(V),G=D.is(ne);if(Y||G){const Q=K.isBackward(),[k,m]=K.getCharacterOffsets(),y=V.is(ne),M=D.is(Q?ne:V),Z=D.is(Q?V:ne);let ae=0,he;if(y)ae=k>m?m:k,he=k>m?k:m;else if(M)ae=Q?m:k,he=void 0;else if(Z){const se=Q?k:m;ae=0,he=se}return D.__text=D.__text.slice(ae,he),D}}return D}function b(K){return K.type==="text"?K.offset===K.getNode().getTextContentSize():K.offset===K.getNode().getChildrenSize()}function x(K,D,V){let ne=D.getNode(),Y=V;if(t.$isElementNode(ne)){const G=ne.getDescendantByIndex(D.offset);G!==null&&(ne=G)}for(;Y>0&&ne!==null;){if(t.$isElementNode(ne)){const y=ne.getLastDescendant();y!==null&&(ne=y)}let G=ne.getPreviousSibling(),Q=0;if(G===null){let y=ne.getParentOrThrow(),M=y.getPreviousSibling();for(;M===null;){if(y=y.getParent(),y===null){G=null;break}M=y.getPreviousSibling()}y!==null&&(Q=y.isInline()?0:2,G=M)}let k=ne.getTextContent();k===""&&t.$isElementNode(ne)&&!ne.isInline()&&(k=`
65
+ `)}return i}getTextContentSize(){let i=0,s=this.getChildren(),h=s.length;for(let C=0;C<h;C++){let S=s[C];i+=S.getTextContentSize(),Ze(S)&&C!==h-1&&!S.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=we[i],(this.getFormat()&i)!==0):!1}select(i,s){Jn();let h=Vt(),C=i,S=s;var A=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&s===0){if(i=this.getFirstChild(),ht(i)||Ze(i))return i.select(0,0)}else if(!(i!==void 0&&i!==A||s!==void 0&&s!==A)&&(i=this.getLastChild(),ht(i)||Ze(i)))return i.select()}if(C===void 0&&(C=A),S===void 0&&(S=A),A=this.__key,wt(h))h.anchor.set(A,C,"element"),h.focus.set(A,S,"element"),h.dirty=!0;else return Gn(A,C,A,S,"element","element");return h}selectStart(){let i=this.getFirstDescendant();return i?i.selectStart():this.select()}selectEnd(){let i=this.getLastDescendant();return i?i.selectEnd():this.select()}clear(){let i=this.getWritable();return this.getChildren().forEach(s=>s.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let s=this.getWritable();return s.__dir=i,s}setFormat(i){return this.getWritable().__format=i!==""?we[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,s,h){let C=h.length,S=this.getChildrenSize(),A=this.getWritable(),J=A.__key;var ge=[],Se=[];let Fe=this.getChildAtIndex(i+s),Ke=null,ke=S-s+C;if(i!==0)if(i===S)Ke=this.getLastChild();else{var Ae=this.getChildAtIndex(i);Ae!==null&&(Ke=Ae.getPreviousSibling())}if(0<s){var Xe=Ke===null?this.getFirstChild():Ke.getNextSibling();for(Ae=0;Ae<s;Ae++){Xe===null&&Y(100);var ut=Xe.getNextSibling(),Tt=Xe.__key;Xe=Xe.getWritable(),xt(Xe),Se.push(Tt),Xe=ut}}for(Ae=Ke,ut=0;ut<C;ut++){Tt=h[ut],Ae!==null&&Tt.is(Ae)&&(Ke=Ae=Ae.getPreviousSibling()),Xe=Tt.getWritable(),Xe.__parent===J&&ke--,xt(Xe);let Mt=Tt.__key;Ae===null?(A.__first=Mt,Xe.__prev=null):(Ae=Ae.getWritable(),Ae.__next=Mt,Xe.__prev=Ae.__key),Tt.__key===J&&Y(76),Xe.__parent=J,ge.push(Mt),Ae=Tt}if(i+s===S?Ae!==null&&(Ae.getWritable().__next=null,A.__last=Ae.__key):Fe!==null&&(i=Fe.getWritable(),Ae!==null?(s=Ae.getWritable(),i.__prev=Ae.__key,s.__next=Fe.__key):i.__prev=null),A.__size=ke,Se.length&&(i=Vt(),wt(i))){Se=new Set(Se),ge=new Set(ge);let{anchor:Mt,focus:hn}=i;Ls(Mt,Se,ge)&&po(Mt,Mt.getNode(),this,Ke,Fe),Ls(hn,Se,ge)&&po(hn,hn.getNode(),this,Ke,Fe),ke!==0||this.canBeEmpty()||Xr(this)||this.remove()}return A}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function Ze(l){return l instanceof Xn}function Ls(l,i,s){for(l=l.getNode();l;){let h=l.__key;if(i.has(h)&&!s.has(h))return!0;l=l.getParent()}return!1}class Hr extends Xn{static getType(){return"root"}static clone(){return new Hr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!oi()&&ln()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let s=0;s<i.length;s++){let h=i[s];Ze(h)||an(h)||Y(56)}return super.append(...i)}static importJSON(i){let s=fn();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function tr(l){return l instanceof Hr}function Ra(l,i){if(i=i.getEditorState()._selection,l=l._selection,l!==null){if(l.dirty||!l.is(i))return!0}else if(i!==null)return!0;return!1}function Si(){return new Co(new Map([["root",new Hr]]))}function No(l){let i=l.exportJSON();var s=l.constructor;i.type!==s.getType()&&Y(130,s.name);let h=i.children;if(Ze(l))for(Array.isArray(h)||Y(59,s.name),l=l.getChildren(),s=0;s<l.length;s++){let C=No(l[s]);h.push(C)}return i}class Co{constructor(i,s){this._nodeMap=i,this._selection=s||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Da(this,i)}clone(i){return i=new Co(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Da(this,()=>({root:No(fn())}))}}class wi extends Xn{static getType(){return"paragraph"}static clone(i){return new wi(i.__key)}createDOM(i){let s=document.createElement("p");return i=Kt(i.theme,"paragraph"),i!==void 0&&s.classList.add(...i),s}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Zo,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&io(i)){this.isEmpty()&&i.append(document.createElement("br"));var s=this.getFormatType();i.style.textAlign=s,(s=this.getDirection())&&(i.dir=s),s=this.getIndent(),0<s&&(i.style.textIndent=`${20*s}px`)}return{element:i}}static importJSON(i){let s=lr();return s.setFormat(i.format),s.setIndent(i.indent),s.setDirection(i.direction),s}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,s){i=lr();let h=this.getDirection();return i.setDirection(h),this.insertAfter(i,s),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||ht(i[0])&&i[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function Zo(l){let i=lr();return l.style&&(i.setFormat(l.style.textAlign),l=parseInt(l.style.textIndent,10)/20,0<l&&i.setIndent(l)),{node:i}}function lr(){return Bi(new wi)}function Rl(l,i,s,h){let C=l._keyToDOMMap;C.clear(),l._editorState=Si(),l._pendingEditorState=h,l._compositionKey=null,l._dirtyType=0,l._cloneNotNeeded.clear(),l._dirtyLeaves=new Set,l._dirtyElements.clear(),l._normalizedNodes=new Set,l._updateTags=new Set,l._updates=[],l._blockCursorElement=null,h=l._observer,h!==null&&(h.disconnect(),l._observer=null),i!==null&&(i.textContent=""),s!==null&&(s.textContent="",C.set("root",s))}function ba(l,i){let s=new Map,h=new Set,C=S=>{Object.keys(S).forEach(A=>{let J=s.get(A);J===void 0&&(J=[],s.set(A,J)),J.push(S[A])})};return l.forEach(S=>{S=S.klass.importDOM!=null?S.klass.importDOM.bind(S.klass):null,S==null||h.has(S)||(h.add(S),S=S(),S!==null&&C(S))}),i&&C(i),s}class La{constructor(i,s,h,C,S,A,J){this._parentEditor=s,this._rootElement=null,this._editorState=i,this._compositionKey=this._pendingEditorState=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=C,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ge(),this._onError=S,this._htmlConversions=A,this._editable=J,this._headless=s!==null&&s._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let s=this._listeners.update;return s.add(i),()=>{s.delete(i)}}registerEditableListener(i){let s=this._listeners.editable;return s.add(i),()=>{s.delete(i)}}registerDecoratorListener(i){let s=this._listeners.decorator;return s.add(i),()=>{s.delete(i)}}registerTextContentListener(i){let s=this._listeners.textcontent;return s.add(i),()=>{s.delete(i)}}registerRootListener(i){let s=this._listeners.root;return i(this._rootElement,null),s.add(i),()=>{i(null,this._rootElement),s.delete(i)}}registerCommand(i,s,h){h===void 0&&Y(35);let C=this._commands;C.has(i)||C.set(i,[new Set,new Set,new Set,new Set,new Set]);let S=C.get(i);S===void 0&&Y(36,String(i));let A=S[h];return A.add(s),()=>{A.delete(s),S.every(J=>J.size===0)&&C.delete(i)}}registerMutationListener(i,s){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let h=this._listeners.mutation;return h.set(s,i),()=>{h.delete(s)}}registerNodeTransformToKlass(i,s){var h=i.getType();return h=this._nodes.get(h),h===void 0&&Y(37,i.name),h.transforms.add(s),h}registerNodeTransform(i,s){var h=this.registerNodeTransformToKlass(i,s);let C=[h];return h=h.replaceWithKlass,h!=null&&(h=this.registerNodeTransformToKlass(h,s),C.push(h)),ms(this,i.getType()),()=>{C.forEach(S=>S.transforms.delete(s))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,s){return ot(this,i,s)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let s=this._rootElement;if(i!==s){let A=Kt(this._config.theme,"root");var h=this._pendingEditorState||this._editorState;if(this._rootElement=i,Rl(this,s,i,h),s!==null){if(!this._config.disableEvents){Fo!==0&&(Fo--,Fo===0&&s.ownerDocument.removeEventListener("selectionchange",Ca));var C=s.__lexicalEditor;if(C!=null){if(C._parentEditor!==null){var S=ye(C);S=S[S.length-1]._key,co.get(S)===C&&co.delete(S)}else co.delete(C._key);s.__lexicalEditor=null}for(C=Na(s),S=0;S<C.length;S++)C[S]();s.__lexicalEventHandles=[]}A!=null&&s.classList.remove(...A)}i!==null?(h=(h=i.ownerDocument)&&h.defaultView||null,C=i.style,C.userSelect="text",C.whiteSpace="pre-wrap",C.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=h,this._dirtyType=2,Re(this),this._updateTags.add("history-merge"),Mr(this),this._config.disableEvents||Lc(i,this),A!=null&&i.classList.add(...A)):(this._editorState=h,this._window=this._pendingEditorState=null),yo("root",this,!1,i,s)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,s){i.isEmpty()&&Y(38),Oe(this);let h=this._pendingEditorState,C=this._updateTags;s=s!==void 0?s.tag:null,h===null||h.isEmpty()||(s!=null&&C.add(s),Mr(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,s!=null&&C.add(s),Mr(this)}parseEditorState(i,s){i=typeof i=="string"?JSON.parse(i):i;let h=Si(),C=yn,S=vn,A=xn,J=this._dirtyElements,ge=this._dirtyLeaves,Se=this._cloneNotNeeded,Fe=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,yn=h,vn=!1,xn=this;try{_o(i.root,this._nodes),s&&s(),h._readOnly=!0}catch(Ke){Ke instanceof Error&&this._onError(Ke)}finally{this._dirtyElements=J,this._dirtyLeaves=ge,this._cloneNotNeeded=Se,this._dirtyType=Fe,yn=C,vn=S,xn=A}return h}update(i,s){sr(this,i,s)}focus(i,s={}){let h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),sr(this,()=>{let C=Vt(),S=fn();C!==null?C.dirty=!0:S.getChildrenSize()!==0&&(s.defaultSelection==="rootStart"?S.selectStart():S.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=kr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,yo("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class ks extends Xn{constructor(i,s){super(s),this.__colSpan=i,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(i){return this.getWritable().__colSpan=i,this}getRowSpan(){return this.__rowSpan}setRowSpan(i){return this.getWritable().__rowSpan=i,this}}function Nr(l){return l instanceof ks}class ka extends Xn{}function Is(l){return l instanceof ka}class Ia extends Xn{}function Jo(l){return l instanceof Ia}return $e.$INTERNAL_isPointSelection=wl,$e.$addUpdateTag=function(l){Jn(),ln()._updateTags.add(l)},$e.$applyNodeReplacement=Bi,$e.$copyNode=dl,$e.$createLineBreakNode=$r,$e.$createNodeSelection=Ar,$e.$createParagraphNode=lr,$e.$createRangeSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Ki(l,i,0,"")},$e.$createTabNode=Wi,$e.$createTextNode=Bn,$e.$getAdjacentNode=mn,$e.$getNearestNodeFromDOMNode=Sr,$e.$getNearestRootOrShadowRoot=ul,$e.$getNodeByKey=It,$e.$getPreviousSelection=Ui,$e.$getRoot=fn,$e.$getSelection=Vt,$e.$getTextContent=function(){let l=Vt();return l===null?"":l.getTextContent()},$e.$hasAncestor=mi,$e.$hasUpdateTag=function(l){return ln()._updateTags.has(l)},$e.$insertNodes=function(l){let i=Vt()||Ui();i===null&&(i=fn().selectEnd()),i.insertNodes(l)},$e.$isBlockElementNode=function(l){return Ze(l)&&!l.isInline()},$e.$isDecoratorNode=an,$e.$isElementNode=Ze,$e.$isInlineElementOrDecoratorNode=function(l){return Ze(l)&&l.isInline()||an(l)&&l.isInline()},$e.$isLeafNode=function(l){return ht(l)||Ei(l)||an(l)},$e.$isLineBreakNode=Ei,$e.$isNodeSelection=Go,$e.$isParagraphNode=function(l){return l instanceof wi},$e.$isRangeSelection=wt,$e.$isRootNode=tr,$e.$isRootOrShadowRoot=Xr,$e.$isTabNode=va,$e.$isTextNode=ht,$e.$nodesOfType=function(l){var i=yr();let s=i._readOnly,h=l.getType();i=i._nodeMap;let C=[];for(let[,S]of i)S instanceof l&&S.__type===h&&(s||S.isAttached())&&C.push(S);return C},$e.$normalizeSelection__EXPERIMENTAL=Qe,$e.$parseSerializedNode=function(l){return _o(l,ln()._nodes)},$e.$selectAll=function(){var l=fn();l=l.select(0,l.getChildrenSize()),gr(Qe(l))},$e.$setCompositionKey=bt,$e.$setSelection=gr,$e.$splitNode=function(l,i){let s=l.getChildAtIndex(i);s==null&&(s=l),Xr(l)&&Y(102);let h=A=>{const J=A.getParentOrThrow(),ge=Xr(J),Se=A!==s||ge?dl(A):A;if(ge)return A.insertAfter(Se),[A,Se,Se];const[Fe,Ke,ke]=h(J);return A=A.getNextSiblings(),ke.append(Se,...A),[Fe,Ke,Se]},[C,S]=h(s);return[C,S]},$e.BLUR_COMMAND=V,$e.CAN_REDO_COMMAND={},$e.CAN_UNDO_COMMAND={},$e.CLEAR_EDITOR_COMMAND={},$e.CLEAR_HISTORY_COMMAND={},$e.CLICK_COMMAND=e,$e.COMMAND_PRIORITY_CRITICAL=4,$e.COMMAND_PRIORITY_EDITOR=0,$e.COMMAND_PRIORITY_HIGH=3,$e.COMMAND_PRIORITY_LOW=1,$e.COMMAND_PRIORITY_NORMAL=2,$e.CONTROLLED_TEXT_INSERTION_COMMAND=d,$e.COPY_COMMAND=pe,$e.CUT_COMMAND=ue,$e.DELETE_CHARACTER_COMMAND=n,$e.DELETE_LINE_COMMAND=v,$e.DELETE_WORD_COMMAND=N,$e.DEPRECATED_$computeGridMap=vi,$e.DEPRECATED_$createGridSelection=function(){let l=new Dr("root",0,"element"),i=new Dr("root",0,"element");return new Ds("root",l,i)},$e.DEPRECATED_$getGridCellNodeRect=_r,$e.DEPRECATED_$getNodeTriplet=ii,$e.DEPRECATED_$isGridCellNode=Nr,$e.DEPRECATED_$isGridNode=Is,$e.DEPRECATED_$isGridRowNode=Jo,$e.DEPRECATED_$isGridSelection=Uo,$e.DEPRECATED_GridCellNode=ks,$e.DEPRECATED_GridNode=ka,$e.DEPRECATED_GridRowNode=Ia,$e.DRAGEND_COMMAND=_e,$e.DRAGOVER_COMMAND=me,$e.DRAGSTART_COMMAND=q,$e.DROP_COMMAND=U,$e.DecoratorNode=Ma,$e.ElementNode=Xn,$e.FOCUS_COMMAND=D,$e.FORMAT_ELEMENT_COMMAND={},$e.FORMAT_TEXT_COMMAND=T,$e.INDENT_CONTENT_COMMAND={},$e.INSERT_LINE_BREAK_COMMAND=r,$e.INSERT_PARAGRAPH_COMMAND=c,$e.INSERT_TAB_COMMAND={},$e.KEY_ARROW_DOWN_COMMAND=W,$e.KEY_ARROW_LEFT_COMMAND=P,$e.KEY_ARROW_RIGHT_COMMAND=x,$e.KEY_ARROW_UP_COMMAND=$,$e.KEY_BACKSPACE_COMMAND=X,$e.KEY_DELETE_COMMAND=le,$e.KEY_DOWN_COMMAND=R,$e.KEY_ENTER_COMMAND=B,$e.KEY_ESCAPE_COMMAND=ee,$e.KEY_MODIFIER_COMMAND=ne,$e.KEY_SPACE_COMMAND=z,$e.KEY_TAB_COMMAND=j,$e.LineBreakNode=Pr,$e.MOVE_TO_END=w,$e.MOVE_TO_START=H,$e.OUTDENT_CONTENT_COMMAND={},$e.PASTE_COMMAND=g,$e.ParagraphNode=wi,$e.REDO_COMMAND=b,$e.REMOVE_TEXT_COMMAND=p,$e.RootNode=Hr,$e.SELECTION_CHANGE_COMMAND=t,$e.SELECT_ALL_COMMAND=K,$e.TabNode=uo,$e.TextNode=ri,$e.UNDO_COMMAND=O,$e.createCommand=function(){return{}},$e.createEditor=function(l){var i=l||{},s=xn,h=i.theme||{};let C=l===void 0?s:i.parentEditor||null,S=i.disableEvents||!1,A=Si(),J=i.namespace||(C!==null?C._config.namespace:Ge()),ge=i.editorState,Se=[Hr,ri,Pr,uo,wi,...i.nodes||[]],{onError:Fe,html:Ke}=i;if(i=i.editable!==void 0?i.editable:!0,l===void 0&&s!==null)l=s._nodes;else for(l=new Map,s=0;s<Se.length;s++){let Ae=Se[s],Xe=null;var ke=null;typeof Ae!="function"&&(ke=Ae,Ae=ke.replace,Xe=ke.with,ke=ke.withKlass||null);let ut=Ae.getType(),Tt=Ae.transform(),Mt=new Set;Tt!==null&&Mt.add(Tt),l.set(ut,{exportDOM:Ke&&Ke.export?Ke.export.get(Ae):void 0,klass:Ae,replace:Xe,replaceWithKlass:ke,transforms:Mt})}return h=new La(A,C,l,{disableEvents:S,namespace:J,theme:h},Fe||console.error,ba(l,Ke?Ke.import:void 0),i),ge!==void 0&&(h._pendingEditorState=ge,h._dirtyType=2),h},$e.getNearestEditorFromDOMNode=_t,$e.isHTMLAnchorElement=function(l){return io(l)&&l.tagName==="A"},$e.isHTMLElement=io,$e.isSelectionCapturedInDecoratorInput=Ve,$e.isSelectionWithinEditor=rt,$e}var Jc,Lf;function Bt(){return Lf||(Lf=1,Jc=process.env.NODE_ENV==="development"?$N():FN()),Jc}var kf;function BN(){if(kf)return qc;kf=1;var t=Un(),e=Bt(),n=et;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const g={tag:"history-merge"};function p({initialConfig:v,children:T}){const O=n.useMemo(()=>{const{theme:b,namespace:R,editor__DEPRECATED:x,nodes:w,onError:P,editorState:H,html:$}=v,W=t.createLexicalComposerContext(null,b);let B=x||null;if(B===null){const z=e.createEditor({editable:v.editable,html:$,namespace:R,nodes:w,onError:X=>P(X,z),theme:b});N(z,H),B=z}return[B,W]},[]);return d(()=>{const b=v.editable,[R]=O;R.setEditable(b!==void 0?b:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:O},T)}function N(v,T){if(T!==null){if(T===void 0)v.update(()=>{const O=e.$getRoot();if(O.isEmpty()){const b=e.$createParagraphNode();O.append(b);const R=r?document.activeElement:null;(e.$getSelection()!==null||R!==null&&R===v.getRootElement())&&b.select()}},g);else if(T!==null)switch(typeof T){case"string":{const O=v.parseEditorState(T);v.setEditorState(O,g);break}case"object":{v.setEditorState(T,g);break}case"function":{v.update(()=>{e.$getRoot().isEmpty()&&T(v)},g);break}}}}return qc.LexicalComposer=p,qc}var Xc={},If;function HN(){if(If)return Xc;If=1;var t=Un(),e=Bt(),n=et;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var c=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function g(p,N){if(N!==null){if(N===void 0)p.update(()=>{var v=e.$getRoot();if(v.isEmpty()){let T=e.$createParagraphNode();v.append(T),v=r?document.activeElement:null,(e.$getSelection()!==null||v!==null&&v===p.getRootElement())&&T.select()}},d);else if(N!==null)switch(typeof N){case"string":let v=p.parseEditorState(N);p.setEditorState(v,d);break;case"object":p.setEditorState(N,d);break;case"function":p.update(()=>{e.$getRoot().isEmpty()&&N(p)},d)}}}return Xc.LexicalComposer=function({initialConfig:p,children:N}){let v=n.useMemo(()=>{const{theme:T,namespace:O,editor__DEPRECATED:b,nodes:R,onError:x,editorState:w,html:P}=p,H=t.createLexicalComposerContext(null,T);let $=b||null;if($===null){const W=e.createEditor({editable:p.editable,html:P,namespace:O,nodes:R,onError:B=>x(B,W),theme:T});g(W,w),$=W}return[$,H]},[]);return c(()=>{let T=p.editable,[O]=v;O.setEditable(T!==void 0?T:!0)},[]),n.createElement(t.LexicalComposerContext.Provider,{value:v},N)},Xc}const WN=process.env.NODE_ENV==="development"?BN():HN();var KN=WN,Qc={},eu,Pf;function zN(){if(Pf)return eu;Pf=1;var t=Un(),e=et,c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function d(N){const[v]=t.useLexicalComposerContext(),T=e.useMemo(()=>N(v),[v,N]),O=e.useRef(T.initialValueFn()),[b,R]=e.useState(O.current);return c(()=>{const{initialValueFn:x,subscribe:w}=T,P=x();return O.current!==P&&(O.current=P,R(P)),w(H=>{O.current=H,R(H)})},[T,N]),b}function g(N){return{initialValueFn:()=>N.isEditable(),subscribe:v=>N.registerEditableListener(v)}}function p(){return d(g)}return eu=p,eu}var tu,$f;function UN(){if($f)return tu;$f=1;var t=Un(),e=et,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function r(d){let[g]=t.useLexicalComposerContext(),p=e.useMemo(()=>d(g),[g,d]),N=e.useRef(p.initialValueFn()),[v,T]=e.useState(N.current);return n(()=>{let{initialValueFn:O,subscribe:b}=p,R=O();return N.current!==R&&(N.current=R,T(R)),b(x=>{N.current=x,T(x)})},[p,d]),v}function c(d){return{initialValueFn:()=>d.isEditable(),subscribe:g=>d.registerEditableListener(g)}}return tu=function(){return r(c)},tu}var nu,Ff;function Tp(){return Ff||(Ff=1,nu=process.env.NODE_ENV==="development"?zN():UN()),nu}var Xi={},Bf;function GN(){if(Bf)return Xi;Bf=1;var t=Bt();function e(N,v){let T=N.getFirstChild(),O=0;e:for(;T!==null;){if(t.$isElementNode(T)){const x=T.getFirstChild();if(x!==null){T=x;continue}}else if(t.$isTextNode(T)){const x=T.getTextContentSize();if(O+x>v)return{node:T,offset:v-O};O+=x}const b=T.getNextSibling();if(b!==null){T=b;continue}let R=T.getParent();for(;R!==null;){const x=R.getNextSibling();if(x!==null){T=x;continue e}R=R.getParent()}break}return null}function n(N,v=!0){if(N)return!1;let T=c();return v&&(T=T.trim()),T===""}function r(N,v){return()=>n(N,v)}function c(){return t.$getRoot().getTextContent()}function d(N){if(!n(N,!1))return!1;const T=t.$getRoot().getChildren(),O=T.length;if(O>1)return!1;for(let b=0;b<O;b++){const R=T[b];if(t.$isDecoratorNode(R))return!1;if(t.$isElementNode(R)){if(!t.$isParagraphNode(R)||R.__indent!==0)return!1;const x=R.getChildren(),w=x.length;for(let P=0;P<w;P++){const H=x[b];if(!t.$isTextNode(H))return!1}}}return!0}function g(N){return()=>d(N)}function p(N,v,T,O){const b=W=>W instanceof T,R=W=>{const B=t.$createTextNode(W.getTextContent());B.setFormat(W.getFormat()),W.replace(B)},x=W=>W.getLatest().__mode,w=W=>{if(!W.isSimpleText())return;const B=W.getPreviousSibling();let z=W.getTextContent(),X=W,ee;if(t.$isTextNode(B)){const le=B.getTextContent(),j=le+z,U=v(j);if(b(B))if(U===null||x(B)!==0){R(B);return}else{const q=U.end-le.length;if(q>0){const me=z.slice(0,q),_e=le+me;if(B.select(),B.setTextContent(_e),q===z.length)W.remove();else{const pe=z.slice(q);W.setTextContent(pe)}return}}else if(U===null||U.start<le.length)return}for(;;){ee=v(z);let le=ee===null?"":z.slice(ee.end);if(z=le,le===""){const q=X.getNextSibling();if(t.$isTextNode(q)){le=X.getTextContent()+q.getTextContent();const me=v(le);if(me===null){b(q)?R(q):q.markDirty();return}else if(me.start!==0)return}}else{const q=v(le);if(q!==null&&q.start===0)return}if(ee===null)return;if(ee.start===0&&t.$isTextNode(B)&&B.isTextEntity())continue;let j;ee.start===0?[j,X]=X.splitText(ee.end):[,j,X]=X.splitText(ee.start,ee.end);const U=O(j);if(U.setFormat(j.getFormat()),j.replace(U),X==null)return}},P=W=>{const B=W.getTextContent(),z=v(B);if(z===null||z.start!==0){R(W);return}if(B.length>z.end){W.splitText(z.end);return}const X=W.getPreviousSibling();t.$isTextNode(X)&&X.isTextEntity()&&(R(X),R(W));const ee=W.getNextSibling();t.$isTextNode(ee)&&ee.isTextEntity()&&(R(ee),b(W)&&R(W))},H=N.registerNodeTransform(t.TextNode,w),$=N.registerNodeTransform(T,P);return[H,$]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=g,Xi.$findTextIntersectionFromCharacters=e,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=c,Xi.registerLexicalTextEntity=p,Xi}var Qi={},Hf;function YN(){if(Hf)return Qi;Hf=1;var t=Bt();function e(c,d=!0){return c?!1:(c=n(),d&&(c=c.trim()),c==="")}function n(){return t.$getRoot().getTextContent()}function r(c){if(!e(c,!1))return!1;c=t.$getRoot().getChildren();let d=c.length;if(1<d)return!1;for(let p=0;p<d;p++){var g=c[p];if(t.$isDecoratorNode(g))return!1;if(t.$isElementNode(g)){if(!t.$isParagraphNode(g)||g.__indent!==0)return!1;g=g.getChildren();let N=g.length;for(let v=0;v<N;v++)if(!t.$isTextNode(g[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(c){return()=>r(c)},Qi.$findTextIntersectionFromCharacters=function(c,d){var g=c.getFirstChild();c=0;e:for(;g!==null;){if(t.$isElementNode(g)){var p=g.getFirstChild();if(p!==null){g=p;continue}}else if(t.$isTextNode(g)){if(p=g.getTextContentSize(),c+p>d)return{node:g,offset:d-c};c+=p}if(p=g.getNextSibling(),p!==null)g=p;else{for(g=g.getParent();g!==null;){if(p=g.getNextSibling(),p!==null){g=p;continue e}g=g.getParent()}break}}return null},Qi.$isRootTextContentEmpty=e,Qi.$isRootTextContentEmptyCurry=function(c,d){return()=>e(c,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(c,d,g,p){let N=T=>{const O=t.$createTextNode(T.getTextContent());O.setFormat(T.getFormat()),T.replace(O)},v=c.registerNodeTransform(t.TextNode,T=>{if(T.isSimpleText()){var O=T.getPreviousSibling(),b=T.getTextContent(),R=T;if(t.$isTextNode(O)){var x=O.getTextContent(),w=d(x+b);if(O instanceof g){if(w===null||O.getLatest().__mode!==0){N(O);return}if(w=w.end-x.length,0<w){R=b.slice(0,w),R=x+R,O.select(),O.setTextContent(R),w===b.length?T.remove():(O=b.slice(w),T.setTextContent(O));return}}else if(w===null||w.start<x.length)return}for(;;){if(T=d(b),b=w=T===null?"":b.slice(T.end),w===""){if(x=R.getNextSibling(),t.$isTextNode(x)){if(w=R.getTextContent()+x.getTextContent(),w=d(w),w===null){x instanceof g?N(x):x.markDirty();break}else if(w.start!==0)break}}else if(x=d(w),x!==null&&x.start===0)break;if(T===null)break;if(T.start===0&&t.$isTextNode(O)&&O.isTextEntity())continue;let P;if(T.start===0?[P,R]=R.splitText(T.end):[,P,R]=R.splitText(T.start,T.end),T=p(P),T.setFormat(P.getFormat()),P.replace(T),R==null)break}}});return c=c.registerNodeTransform(g,T=>{var O=T.getTextContent();const b=d(O);b===null||b.start!==0?N(T):O.length>b.end?T.splitText(b.end):(O=T.getPreviousSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(N(O),N(T)),O=T.getNextSibling(),t.$isTextNode(O)&&O.isTextEntity()&&(N(O),T instanceof g&&N(T)))}),[v,c]},Qi}var ru,Wf;function xp(){return Wf||(Wf=1,ru=process.env.NODE_ENV==="development"?GN():YN()),ru}var Nn={},Kn={},Kf;function jN(){if(Kf)return Kn;Kf=1;var t=Bt();const e=new Map;function n(K){let D=K;for(;D!=null;){if(D.nodeType===Node.TEXT_NODE)return D;D=D.firstChild}return null}function r(K){const D=K.parentNode;if(D==null)throw new Error("Should never happen");return[D,Array.from(D.childNodes).indexOf(K)]}function c(K,D,V,ne,Y){const G=D.getKey(),Q=ne.getKey(),k=document.createRange();let m=K.getElementByKey(G),y=K.getElementByKey(Q),M=V,Z=Y;if(t.$isTextNode(D)&&(m=n(m)),t.$isTextNode(ne)&&(y=n(y)),D===void 0||ne===void 0||m===null||y===null)return null;m.nodeName==="BR"&&([m,M]=r(m)),y.nodeName==="BR"&&([y,Z]=r(y));const ae=m.firstChild;m===y&&ae!=null&&ae.nodeName==="BR"&&M===0&&Z===0&&(Z=1);try{k.setStart(m,M),k.setEnd(y,Z)}catch{return null}return k.collapsed&&(M!==Z||G!==Q)&&(k.setStart(y,Z),k.setEnd(m,M)),k}function d(K,D){const V=K.getRootElement();if(V===null)return[];const ne=V.getBoundingClientRect(),Y=getComputedStyle(V),G=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),Q=Array.from(D.getClientRects());let k=Q.length;Q.sort((y,M)=>{const Z=y.top-M.top;return Math.abs(Z)<=3?y.left-M.left:Z});let m;for(let y=0;y<k;y++){const M=Q[y],Z=m&&m.top<=M.top&&m.top+m.height>M.top&&m.left+m.width>M.left,ae=M.width+G===ne.width;if(Z||ae){Q.splice(y--,1),k--;continue}m=M}return Q}function g(K){const D={},V=K.split(";");for(const ne of V)if(ne!==""){const[Y,G]=ne.split(/:([^]+)/);Y&&G&&(D[Y.trim()]=G.trim())}return D}function p(K){let D=e.get(K);return D===void 0&&(D=g(K),e.set(K,D)),Object.freeze(D),D}function N(K){let D="";for(const V in K)V&&(D+=`${V}: ${K[V]};`);return D}function v(K,D){return K.__first=D.__first,K.__last=D.__last,K.__size=D.__size,K.__format=D.__format,K.__indent=D.__indent,K.__dir=D.__dir,K}function T(K,D){return K.__format=D.__format,K.__style=D.__style,K.__mode=D.__mode,K.__detail=D.__detail,K}function O(K){const V=K.constructor.clone(K);return V.__parent=K.__parent,V.__next=K.__next,V.__prev=K.__prev,t.$isElementNode(K)&&t.$isElementNode(V)?v(V,K):t.$isTextNode(K)&&t.$isTextNode(V)?T(V,K):V}function b(K,D){if(D.isSelected()&&!D.isSegmented()&&!D.isToken()&&t.$INTERNAL_isPointSelection(K)){const V=K.anchor.getNode(),ne=K.focus.getNode(),Y=D.is(V),G=D.is(ne);if(Y||G){const Q=K.isBackward(),[k,m]=K.getCharacterOffsets(),y=V.is(ne),M=D.is(Q?ne:V),Z=D.is(Q?V:ne);let ae=0,he;if(y)ae=k>m?m:k,he=k>m?k:m;else if(M)ae=Q?m:k,he=void 0;else if(Z){const se=Q?k:m;ae=0,he=se}return D.__text=D.__text.slice(ae,he),D}}return D}function R(K){return K.type==="text"?K.offset===K.getNode().getTextContentSize():K.offset===K.getNode().getChildrenSize()}function x(K,D,V){let ne=D.getNode(),Y=V;if(t.$isElementNode(ne)){const G=ne.getDescendantByIndex(D.offset);G!==null&&(ne=G)}for(;Y>0&&ne!==null;){if(t.$isElementNode(ne)){const y=ne.getLastDescendant();y!==null&&(ne=y)}let G=ne.getPreviousSibling(),Q=0;if(G===null){let y=ne.getParentOrThrow(),M=y.getPreviousSibling();for(;M===null;){if(y=y.getParent(),y===null){G=null;break}M=y.getPreviousSibling()}y!==null&&(Q=y.isInline()?0:2,G=M)}let k=ne.getTextContent();k===""&&t.$isElementNode(ne)&&!ne.isInline()&&(k=`
66
66
 
67
- `);const m=k.length;if(!t.$isTextNode(ne)||Y>=m){const y=ne.getParent();ne.remove(),y!=null&&y.getChildrenSize()===0&&!t.$isRootNode(y)&&y.remove(),Y-=m+Q,ne=G}else{const y=ne.getKey(),M=K.getEditorState().read(()=>{const he=t.$getNodeByKey(y);return t.$isTextNode(he)&&he.isSimpleText()?he.getTextContent():null}),Z=m-Y,ae=k.slice(0,Z);if(M!==null&&M!==k){const he=t.$getPreviousSelection();let se=ne;if(ne.isSimpleText())ne.setTextContent(M);else{const Te=t.$createTextNode(M);ne.replace(Te),se=Te}if(t.$isRangeSelection(he)&&he.isCollapsed()){const Te=he.anchor.offset;se.select(Te,Te)}}else if(ne.isSimpleText()){const he=D.key===y;let se=D.offset;se<Y&&(se=m);const Te=he?se-Y:0,be=he?se:Z;if(he&&Te===0){const[Ue]=ne.splitText(Te,be);Ue.remove()}else{const[,Ue]=ne.splitText(Te,be);Ue.remove()}}else{const he=t.$createTextNode(ae);ne.replace(he)}Y=0}}}function w(K){const D=K.getStyle(),V=g(D);e.set(D,V)}function $(K,D){const V=p("getStyle"in K?K.getStyle():K.style),ne=Object.entries(D).reduce((G,[Q,k])=>(k===null?delete G[Q]:G[Q]=k,G),{...V}),Y=C(ne);K.setStyle(Y),e.set(Y,ne)}function W(K,D){const V=K.getNodes(),ne=V.length;if(t.DEPRECATED_$isGridSelection(K)){const te=t.$createRangeSelection(),ce=te.anchor,we=te.focus;for(let Le=0;Le<ne;Le++){const Be=V[Le];t.DEPRECATED_$isGridCellNode(Be)&&(ce.set(Be.getKey(),0,"element"),we.set(Be.getKey(),Be.getChildrenSize(),"element"),W(t.$normalizeSelection__EXPERIMENTAL(te),D))}t.$setSelection(K);return}const Y=ne-1;let G=V[0],Q=V[Y];if(K.isCollapsed()&&t.$isRangeSelection(K)){$(K,D);return}const k=K.anchor,m=K.focus,M=G.getTextContent().length,Z=m.offset;let ae=k.offset;const he=k.isBefore(m);let se=he?ae:Z,Te=he?Z:ae;const be=he?k.type:m.type,Ue=he?m.type:k.type,re=he?m.key:k.key;if(t.$isTextNode(G)&&se===M){const te=G.getNextSibling();t.$isTextNode(te)&&(ae=0,se=0,G=te)}if(V.length===1){if(t.$isTextNode(G)){if(se=be==="element"?0:ae>Z?Z:ae,Te=Ue==="element"?M:ae>Z?ae:Z,se===Te)return;if(se===0&&Te===M)$(G,D),G.select(se,Te);else{const te=G.splitText(se,Te),ce=se===0?te[0]:te[1];$(ce,D),ce.select(0,Te-se)}}}else{if(t.$isTextNode(G)&&se<G.getTextContentSize()&&(se!==0&&(G=G.splitText(se)[1],se=0,k.set(G.getKey(),se,"text")),$(G,D)),t.$isTextNode(Q)){const ce=Q.getTextContent().length;Q.__key!==re&&Te!==0&&(Te=ce),Te!==ce&&([Q]=Q.splitText(Te)),Te!==0&&$(Q,D)}for(let te=1;te<Y;te++){const ce=V[te],we=ce.getKey();t.$isTextNode(ce)&&we!==G.getKey()&&we!==Q.getKey()&&!ce.isToken()&&$(ce,D)}}}function P(K,D){if(K.anchor.key==="root"){const Y=D(),G=t.$getRoot(),Q=G.getFirstChild();Q?Q.replace(Y,!0):G.append(Y);return}const V=K.getNodes(),ne=ue(K.anchor.getNode(),pe);ne&&V.indexOf(ne)===-1&&V.push(ne);for(let Y=0;Y<V.length;Y++){const G=V[Y];if(!pe(G))continue;const Q=D();Q.setFormat(G.getFormatType()),Q.setIndent(G.getIndent()),G.replace(Q,!0)}}function H(K){return K.getNode().isAttached()}function B(K){let D=K;for(;D!==null&&!t.$isRootOrShadowRoot(D);){const V=D.getLatest(),ne=D.getParent();V.getChildrenSize()===0&&D.remove(!0),D=ne}}function z(K,D,V=null){const ne=K.getNodes(),Y=ne.length,G=K.anchor;if(Y===0||Y===1&&G.type==="element"&&G.getNode().getChildrenSize()===0){const m=G.type==="text"?G.getNode().getParentOrThrow():G.getNode(),y=m.getChildren();let M=D();M.setFormat(m.getFormatType()),M.setIndent(m.getIndent()),y.forEach(Z=>M.append(Z)),V&&(M=V.append(M)),m.replace(M);return}let Q=null,k=[];for(let m=0;m<Y;m++){const y=ne[m];t.$isRootOrShadowRoot(y)?(X(K,k,k.length,D,V),k=[],Q=y):Q===null||Q!==null&&t.$hasAncestor(y,Q)?k.push(y):(X(K,k,k.length,D,V),k=[y])}X(K,k,k.length,D,V)}function X(K,D,V,ne,Y=null){if(D.length===0)return;const G=D[0],Q=new Map,k=[];let m=t.$isElementNode(G)?G:G.getParentOrThrow();m.isInline()&&(m=m.getParentOrThrow());let y=!1;for(;m!==null;){const se=m.getPreviousSibling();if(se!==null){m=se,y=!0;break}if(m=m.getParentOrThrow(),t.$isRootOrShadowRoot(m))break}const M=new Set;for(let se=0;se<V;se++){const Te=D[se];t.$isElementNode(Te)&&Te.getChildrenSize()===0&&M.add(Te.getKey())}const Z=new Set;for(let se=0;se<V;se++){const Te=D[se];let be=Te.getParent();if(be!==null&&be.isInline()&&(be=be.getParent()),be!==null&&t.$isLeafNode(Te)&&!Z.has(Te.getKey())){const Ue=be.getKey();if(Q.get(Ue)===void 0){const re=ne();re.setFormat(be.getFormatType()),re.setIndent(be.getIndent()),k.push(re),Q.set(Ue,re),be.getChildren().forEach(te=>{re.append(te),Z.add(te.getKey()),t.$isElementNode(te)&&te.getChildrenKeys().forEach(ce=>Z.add(ce))}),B(be)}}else if(M.has(Te.getKey())){const Ue=ne();Ue.setFormat(Te.getFormatType()),Ue.setIndent(Te.getIndent()),k.push(Ue),Te.remove(!0)}}if(Y!==null)for(let se=0;se<k.length;se++){const Te=k[se];Y.append(Te)}let ae=null;if(t.$isRootOrShadowRoot(m))if(y)if(Y!==null)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te)}else{const se=m.getFirstChild();if(t.$isElementNode(se)&&(m=se),se===null)if(Y)m.append(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];m.append(be),ae=be}else if(Y!==null)se.insertBefore(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];se.insertBefore(be),ae=be}}else if(Y)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te),ae=Te}const he=t.$getPreviousSelection();t.$isRangeSelection(he)&&H(he.anchor)&&H(he.focus)?t.$setSelection(he.clone()):ae!==null?ae.selectEnd():K.dirty=!0}function ee(K,D){const V=t.$getAdjacentNode(K.focus,D);return t.$isDecoratorNode(V)&&!V.isIsolated()||t.$isElementNode(V)&&!V.isInline()&&!V.canBeEmpty()}function le(K,D,V,ne){K.modify(D?"extend":"move",V,ne)}function j(K){const D=K.anchor.getNode();return(t.$isRootNode(D)?D:D.getParentOrThrow()).getDirection()==="rtl"}function U(K,D,V){const ne=j(K);le(K,D,V?!ne:ne,"character")}function q(K){const D=K.anchor,V=K.focus,G=D.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Q=G.getFirstDescendant(),k=G.getLastDescendant(),m="element",y="element",M=0;t.$isTextNode(Q)?m="text":!t.$isElementNode(Q)&&Q!==null&&(Q=Q.getParentOrThrow()),t.$isTextNode(k)?(y="text",M=k.getTextContentSize()):!t.$isElementNode(k)&&k!==null&&(k=k.getParentOrThrow()),Q&&k&&(D.set(Q.getKey(),0,m),V.set(k.getKey(),M,y))}function me(K,D,V){const ne=K.getStyle(),Y=p(ne);return Y!==null&&Y[D]||V}function _e(K,D,V=""){let ne=null;const Y=K.getNodes(),G=K.anchor,Q=K.focus,k=K.isBackward(),m=k?Q.offset:G.offset,y=k?Q.getNode():G.getNode();if(K.isCollapsed()&&K.style!==""){const M=K.style,Z=p(M);if(Z!==null&&D in Z)return Z[D]}for(let M=0;M<Y.length;M++){const Z=Y[M];if(!(M!==0&&m===0&&Z.is(y))&&t.$isTextNode(Z)){const ae=me(Z,D,V);if(ne===null)ne=ae;else if(ne!==ae){ne="";break}}}return ne===null?V:ne}function pe(K){if(t.$isDecoratorNode(K)&&!K.isInline())return!0;if(!t.$isElementNode(K)||t.$isRootOrShadowRoot(K))return!1;const D=K.getFirstChild(),V=D===null||t.$isLineBreakNode(D)||t.$isTextNode(D)||D.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&V}function ue(K,D){let V=K;for(;V!==null&&V.getParent()!==null&&!D(V);)V=V.getParentOrThrow();return D(V)?V:null}return Kn.$addNodeStyle=w,Kn.$cloneWithProperties=O,Kn.$getSelectionStyleValueForProperty=_e,Kn.$isAtNodeEnd=b,Kn.$isParentElementRTL=j,Kn.$moveCaretSelection=le,Kn.$moveCharacter=U,Kn.$patchStyleText=W,Kn.$selectAll=q,Kn.$setBlocksType=P,Kn.$shouldOverrideDefaultCharacterSelection=ee,Kn.$sliceSelectedTextNodeContent=R,Kn.$wrapNodes=z,Kn.createDOMRange=c,Kn.createRectsFromDOMRange=d,Kn.getStyleObjectFromCSS=p,Kn.trimTextContentFromAnchor=x,Kn}var zn={},zf;function VN(){if(zf)return zn;zf=1;var t=Bt();let e=new Map;function n(x){for(;x!=null;){if(x.nodeType===Node.TEXT_NODE)return x;x=x.firstChild}return null}function r(x){let w=x.parentNode;if(w==null)throw Error("Should never happen");return[w,Array.from(w.childNodes).indexOf(x)]}function c(x){let w={};x=x.split(";");for(let $ of x)if($!==""){let[W,P]=$.split(/:([^]+)/);W&&P&&(w[W.trim()]=P.trim())}return w}function d(x){let w=e.get(x);return w===void 0&&(w=c(x),e.set(x,w)),w}function g(x){let w="";for(let $ in x)$&&(w+=`${$}: ${x[$]};`);return w}function p(x,w){var $=d("getStyle"in x?x.getStyle():x.style);w=Object.entries(w).reduce((W,[P,H])=>(H===null?delete W[P]:W[P]=H,W),{...$}),$=g(w),x.setStyle($),e.set($,w)}function C(x,w){var $=x.getNodes(),W=$.length;if(t.DEPRECATED_$isGridSelection(x)){for(var P=t.$createRangeSelection(),H=P.anchor,B=P.focus,z=0;z<W;z++){var X=$[z];t.DEPRECATED_$isGridCellNode(X)&&(H.set(X.getKey(),0,"element"),B.set(X.getKey(),X.getChildrenSize(),"element"),C(t.$normalizeSelection__EXPERIMENTAL(P),w))}t.$setSelection(x)}else if(--W,P=$[0],H=$[W],x.isCollapsed()&&t.$isRangeSelection(x))p(x,w);else{z=x.anchor;var ee=x.focus;X=P.getTextContent().length;var le=ee.offset,j=z.offset,U=z.isBefore(ee);B=U?j:le,x=U?le:j;var q=U?z.type:ee.type,me=U?ee.type:z.type;if(ee=U?ee.key:z.key,t.$isTextNode(P)&&B===X&&(U=P.getNextSibling(),t.$isTextNode(U)&&(B=j=0,P=U)),$.length===1)t.$isTextNode(P)&&(B=q==="element"?0:j>le?le:j,x=me==="element"?X:j>le?j:le,B!==x&&(B===0&&x===X?(p(P,w),P.select(B,x)):($=P.splitText(B,x),$=B===0?$[0]:$[1],p($,w),$.select(0,x-B))));else for(t.$isTextNode(P)&&B<P.getTextContentSize()&&(B!==0&&(P=P.splitText(B)[1],B=0,z.set(P.getKey(),B,"text")),p(P,w)),t.$isTextNode(H)&&(B=H.getTextContent().length,H.__key!==ee&&x!==0&&(x=B),x!==B&&([H]=H.splitText(x)),x!==0&&p(H,w)),x=1;x<W;x++)B=$[x],z=B.getKey(),t.$isTextNode(B)&&z!==P.getKey()&&z!==H.getKey()&&!B.isToken()&&p(B,w)}}function v(x){for(;x!==null&&!t.$isRootOrShadowRoot(x);){let w=x.getLatest(),$=x.getParent();w.getChildrenSize()===0&&x.remove(!0),x=$}}function T(x,w,$,W,P=null){if(w.length!==0){var H=w[0],B=new Map,z=[];H=t.$isElementNode(H)?H:H.getParentOrThrow(),H.isInline()&&(H=H.getParentOrThrow());for(var X=!1;H!==null;){var ee=H.getPreviousSibling();if(ee!==null){H=ee,X=!0;break}if(H=H.getParentOrThrow(),t.$isRootOrShadowRoot(H))break}ee=new Set;for(var le=0;le<$;le++){var j=w[le];t.$isElementNode(j)&&j.getChildrenSize()===0&&ee.add(j.getKey())}var U=new Set;for(le=0;le<$;le++){j=w[le];var q=j.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&t.$isLeafNode(j)&&!U.has(j.getKey())){if(j=q.getKey(),B.get(j)===void 0){let me=W();me.setFormat(q.getFormatType()),me.setIndent(q.getIndent()),z.push(me),B.set(j,me),q.getChildren().forEach(_e=>{me.append(_e),U.add(_e.getKey()),t.$isElementNode(_e)&&_e.getChildrenKeys().forEach(pe=>U.add(pe))}),v(q)}}else ee.has(j.getKey())&&(q=W(),q.setFormat(j.getFormatType()),q.setIndent(j.getIndent()),z.push(q),j.remove(!0))}if(P!==null)for(w=0;w<z.length;w++)P.append(z[w]);if(w=null,t.$isRootOrShadowRoot(H))if(X)if(P!==null)H.insertAfter(P);else for(P=z.length-1;0<=P;P--)H.insertAfter(z[P]);else if(X=H.getFirstChild(),t.$isElementNode(X)&&(H=X),X===null)if(P)H.append(P);else for(P=0;P<z.length;P++)X=z[P],H.append(X),w=X;else if(P!==null)X.insertBefore(P);else for(H=0;H<z.length;H++)P=z[H],X.insertBefore(P),w=P;else if(P)H.insertAfter(P);else for(P=z.length-1;0<=P;P--)X=z[P],H.insertAfter(X),w=X;z=t.$getPreviousSelection(),t.$isRangeSelection(z)&&z.anchor.getNode().isAttached()&&z.focus.getNode().isAttached()?t.$setSelection(z.clone()):w!==null?w.selectEnd():x.dirty=!0}}function O(x,w,$,W){x.modify(w?"extend":"move",$,W)}function R(x){return x=x.anchor.getNode(),(t.$isRootNode(x)?x:x.getParentOrThrow()).getDirection()==="rtl"}function b(x){if(t.$isDecoratorNode(x)&&!x.isInline())return!0;if(!t.$isElementNode(x)||t.$isRootOrShadowRoot(x))return!1;var w=x.getFirstChild();return w=w===null||t.$isLineBreakNode(w)||t.$isTextNode(w)||w.isInline(),!x.isInline()&&x.canBeEmpty()!==!1&&w}return zn.$addNodeStyle=function(x){x=x.getStyle();let w=c(x);e.set(x,w)},zn.$cloneWithProperties=function(x){let w=x.constructor.clone(x);return w.__parent=x.__parent,w.__next=x.__next,w.__prev=x.__prev,t.$isElementNode(x)&&t.$isElementNode(w)?(w.__first=x.__first,w.__last=x.__last,w.__size=x.__size,w.__format=x.__format,w.__indent=x.__indent,w.__dir=x.__dir,w):(t.$isTextNode(x)&&t.$isTextNode(w)&&(w.__format=x.__format,w.__style=x.__style,w.__mode=x.__mode,w.__detail=x.__detail),w)},zn.$getSelectionStyleValueForProperty=function(x,w,$=""){let W=null,P=x.getNodes();var H=x.anchor,B=x.focus,z=x.isBackward();let X=z?B.offset:H.offset;if(H=z?B.getNode():H.getNode(),x.isCollapsed()&&x.style!==""&&(x=d(x.style),x!==null&&w in x))return x[w];for(x=0;x<P.length;x++){var ee=P[x];if((x===0||X!==0||!ee.is(H))&&t.$isTextNode(ee)){if(B=w,z=$,ee=ee.getStyle(),ee=d(ee),B=ee!==null&&ee[B]||z,W===null)W=B;else if(W!==B){W="";break}}}return W===null?$:W},zn.$isAtNodeEnd=function(x){return x.type==="text"?x.offset===x.getNode().getTextContentSize():x.offset===x.getNode().getChildrenSize()},zn.$isParentElementRTL=R,zn.$moveCaretSelection=O,zn.$moveCharacter=function(x,w,$){let W=R(x);O(x,w,$?!W:W,"character")},zn.$patchStyleText=C,zn.$selectAll=function(x){let w=x.anchor;x=x.focus;var $=w.getNode().getTopLevelElementOrThrow().getParentOrThrow();let W=$.getFirstDescendant();$=$.getLastDescendant();let P="element",H="element",B=0;t.$isTextNode(W)?P="text":t.$isElementNode(W)||W===null||(W=W.getParentOrThrow()),t.$isTextNode($)?(H="text",B=$.getTextContentSize()):t.$isElementNode($)||$===null||($=$.getParentOrThrow()),W&&$&&(w.set(W.getKey(),0,P),x.set($.getKey(),B,H))},zn.$setBlocksType=function(x,w){if(x.anchor.key==="root"){w=w();var $=t.$getRoot();(x=$.getFirstChild())?x.replace(w,!0):$.append(w)}else{for($=x.getNodes(),x=x.anchor.getNode();x!==null&&x.getParent()!==null&&!b(x);)x=x.getParentOrThrow();for((x=b(x)?x:null)&&$.indexOf(x)===-1&&$.push(x),x=0;x<$.length;x++){let W=$[x];if(!b(W))continue;let P=w();P.setFormat(W.getFormatType()),P.setIndent(W.getIndent()),W.replace(P,!0)}}},zn.$shouldOverrideDefaultCharacterSelection=function(x,w){return x=t.$getAdjacentNode(x.focus,w),t.$isDecoratorNode(x)&&!x.isIsolated()||t.$isElementNode(x)&&!x.isInline()&&!x.canBeEmpty()},zn.$sliceSelectedTextNodeContent=function(x,w){if(w.isSelected()&&!w.isSegmented()&&!w.isToken()&&t.$INTERNAL_isPointSelection(x)){var $=x.anchor.getNode(),W=x.focus.getNode(),P=w.is($),H=w.is(W);if(P||H){P=x.isBackward();let[B,z]=x.getCharacterOffsets();x=$.is(W),H=w.is(P?W:$),W=w.is(P?$:W),$=0;let X;x?($=B>z?z:B,X=B>z?B:z):H?($=P?z:B,X=void 0):W&&(P=P?B:z,$=0,X=P),w.__text=w.__text.slice($,X)}}return w},zn.$wrapNodes=function(x,w,$=null){var W=x.getNodes();let P=W.length;var H=x.anchor;if(P===0||P===1&&H.type==="element"&&H.getNode().getChildrenSize()===0){x=H.type==="text"?H.getNode().getParentOrThrow():H.getNode(),W=x.getChildren();let z=w();z.setFormat(x.getFormatType()),z.setIndent(x.getIndent()),W.forEach(X=>z.append(X)),$&&(z=$.append(z)),x.replace(z)}else{H=null;var B=[];for(let z=0;z<P;z++){let X=W[z];t.$isRootOrShadowRoot(X)?(T(x,B,B.length,w,$),B=[],H=X):H===null||H!==null&&t.$hasAncestor(X,H)?B.push(X):(T(x,B,B.length,w,$),B=[X])}T(x,B,B.length,w,$)}},zn.createDOMRange=function(x,w,$,W,P){let H=w.getKey(),B=W.getKey(),z=document.createRange(),X=x.getElementByKey(H);if(x=x.getElementByKey(B),t.$isTextNode(w)&&(X=n(X)),t.$isTextNode(W)&&(x=n(x)),w===void 0||W===void 0||X===null||x===null)return null;X.nodeName==="BR"&&([X,$]=r(X)),x.nodeName==="BR"&&([x,P]=r(x)),w=X.firstChild,X===x&&w!=null&&w.nodeName==="BR"&&$===0&&P===0&&(P=1);try{z.setStart(X,$),z.setEnd(x,P)}catch{return null}return!z.collapsed||$===P&&H===B||(z.setStart(x,P),z.setEnd(X,$)),z},zn.createRectsFromDOMRange=function(x,w){var $=x.getRootElement();if($===null)return[];x=$.getBoundingClientRect(),$=getComputedStyle($),$=parseFloat($.paddingLeft)+parseFloat($.paddingRight),w=Array.from(w.getClientRects());let W=w.length;w.sort((H,B)=>{let z=H.top-B.top;return 3>=Math.abs(z)?H.left-B.left:z});let P;for(let H=0;H<W;H++){let B=w[H],z=B.width+$===x.width;P&&P.top<=B.top&&P.top+P.height>B.top&&P.left+P.width>B.left||z?(w.splice(H--,1),W--):P=B}return w},zn.getStyleObjectFromCSS=d,zn.trimTextContentFromAnchor=function(x,w,$){let W=w.getNode();if(t.$isElementNode(W)){var P=W.getDescendantByIndex(w.offset);P!==null&&(W=P)}for(;0<$&&W!==null;){t.$isElementNode(W)&&(P=W.getLastDescendant(),P!==null&&(W=P));var H=W.getPreviousSibling(),B=0;if(H===null){P=W.getParentOrThrow();for(var z=P.getPreviousSibling();z===null;){if(P=P.getParent(),P===null){H=null;break}z=P.getPreviousSibling()}P!==null&&(B=P.isInline()?0:2,H=z)}if(z=W.getTextContent(),z===""&&t.$isElementNode(W)&&!W.isInline()&&(z=`
67
+ `);const m=k.length;if(!t.$isTextNode(ne)||Y>=m){const y=ne.getParent();ne.remove(),y!=null&&y.getChildrenSize()===0&&!t.$isRootNode(y)&&y.remove(),Y-=m+Q,ne=G}else{const y=ne.getKey(),M=K.getEditorState().read(()=>{const he=t.$getNodeByKey(y);return t.$isTextNode(he)&&he.isSimpleText()?he.getTextContent():null}),Z=m-Y,ae=k.slice(0,Z);if(M!==null&&M!==k){const he=t.$getPreviousSelection();let se=ne;if(ne.isSimpleText())ne.setTextContent(M);else{const Te=t.$createTextNode(M);ne.replace(Te),se=Te}if(t.$isRangeSelection(he)&&he.isCollapsed()){const Te=he.anchor.offset;se.select(Te,Te)}}else if(ne.isSimpleText()){const he=D.key===y;let se=D.offset;se<Y&&(se=m);const Te=he?se-Y:0,be=he?se:Z;if(he&&Te===0){const[Ue]=ne.splitText(Te,be);Ue.remove()}else{const[,Ue]=ne.splitText(Te,be);Ue.remove()}}else{const he=t.$createTextNode(ae);ne.replace(he)}Y=0}}}function w(K){const D=K.getStyle(),V=g(D);e.set(D,V)}function P(K,D){const V=p("getStyle"in K?K.getStyle():K.style),ne=Object.entries(D).reduce((G,[Q,k])=>(k===null?delete G[Q]:G[Q]=k,G),{...V}),Y=N(ne);K.setStyle(Y),e.set(Y,ne)}function H(K,D){const V=K.getNodes(),ne=V.length;if(t.DEPRECATED_$isGridSelection(K)){const te=t.$createRangeSelection(),ce=te.anchor,we=te.focus;for(let Le=0;Le<ne;Le++){const Be=V[Le];t.DEPRECATED_$isGridCellNode(Be)&&(ce.set(Be.getKey(),0,"element"),we.set(Be.getKey(),Be.getChildrenSize(),"element"),H(t.$normalizeSelection__EXPERIMENTAL(te),D))}t.$setSelection(K);return}const Y=ne-1;let G=V[0],Q=V[Y];if(K.isCollapsed()&&t.$isRangeSelection(K)){P(K,D);return}const k=K.anchor,m=K.focus,M=G.getTextContent().length,Z=m.offset;let ae=k.offset;const he=k.isBefore(m);let se=he?ae:Z,Te=he?Z:ae;const be=he?k.type:m.type,Ue=he?m.type:k.type,re=he?m.key:k.key;if(t.$isTextNode(G)&&se===M){const te=G.getNextSibling();t.$isTextNode(te)&&(ae=0,se=0,G=te)}if(V.length===1){if(t.$isTextNode(G)){if(se=be==="element"?0:ae>Z?Z:ae,Te=Ue==="element"?M:ae>Z?ae:Z,se===Te)return;if(se===0&&Te===M)P(G,D),G.select(se,Te);else{const te=G.splitText(se,Te),ce=se===0?te[0]:te[1];P(ce,D),ce.select(0,Te-se)}}}else{if(t.$isTextNode(G)&&se<G.getTextContentSize()&&(se!==0&&(G=G.splitText(se)[1],se=0,k.set(G.getKey(),se,"text")),P(G,D)),t.$isTextNode(Q)){const ce=Q.getTextContent().length;Q.__key!==re&&Te!==0&&(Te=ce),Te!==ce&&([Q]=Q.splitText(Te)),Te!==0&&P(Q,D)}for(let te=1;te<Y;te++){const ce=V[te],we=ce.getKey();t.$isTextNode(ce)&&we!==G.getKey()&&we!==Q.getKey()&&!ce.isToken()&&P(ce,D)}}}function $(K,D){if(K.anchor.key==="root"){const Y=D(),G=t.$getRoot(),Q=G.getFirstChild();Q?Q.replace(Y,!0):G.append(Y);return}const V=K.getNodes(),ne=ue(K.anchor.getNode(),pe);ne&&V.indexOf(ne)===-1&&V.push(ne);for(let Y=0;Y<V.length;Y++){const G=V[Y];if(!pe(G))continue;const Q=D();Q.setFormat(G.getFormatType()),Q.setIndent(G.getIndent()),G.replace(Q,!0)}}function W(K){return K.getNode().isAttached()}function B(K){let D=K;for(;D!==null&&!t.$isRootOrShadowRoot(D);){const V=D.getLatest(),ne=D.getParent();V.getChildrenSize()===0&&D.remove(!0),D=ne}}function z(K,D,V=null){const ne=K.getNodes(),Y=ne.length,G=K.anchor;if(Y===0||Y===1&&G.type==="element"&&G.getNode().getChildrenSize()===0){const m=G.type==="text"?G.getNode().getParentOrThrow():G.getNode(),y=m.getChildren();let M=D();M.setFormat(m.getFormatType()),M.setIndent(m.getIndent()),y.forEach(Z=>M.append(Z)),V&&(M=V.append(M)),m.replace(M);return}let Q=null,k=[];for(let m=0;m<Y;m++){const y=ne[m];t.$isRootOrShadowRoot(y)?(X(K,k,k.length,D,V),k=[],Q=y):Q===null||Q!==null&&t.$hasAncestor(y,Q)?k.push(y):(X(K,k,k.length,D,V),k=[y])}X(K,k,k.length,D,V)}function X(K,D,V,ne,Y=null){if(D.length===0)return;const G=D[0],Q=new Map,k=[];let m=t.$isElementNode(G)?G:G.getParentOrThrow();m.isInline()&&(m=m.getParentOrThrow());let y=!1;for(;m!==null;){const se=m.getPreviousSibling();if(se!==null){m=se,y=!0;break}if(m=m.getParentOrThrow(),t.$isRootOrShadowRoot(m))break}const M=new Set;for(let se=0;se<V;se++){const Te=D[se];t.$isElementNode(Te)&&Te.getChildrenSize()===0&&M.add(Te.getKey())}const Z=new Set;for(let se=0;se<V;se++){const Te=D[se];let be=Te.getParent();if(be!==null&&be.isInline()&&(be=be.getParent()),be!==null&&t.$isLeafNode(Te)&&!Z.has(Te.getKey())){const Ue=be.getKey();if(Q.get(Ue)===void 0){const re=ne();re.setFormat(be.getFormatType()),re.setIndent(be.getIndent()),k.push(re),Q.set(Ue,re),be.getChildren().forEach(te=>{re.append(te),Z.add(te.getKey()),t.$isElementNode(te)&&te.getChildrenKeys().forEach(ce=>Z.add(ce))}),B(be)}}else if(M.has(Te.getKey())){const Ue=ne();Ue.setFormat(Te.getFormatType()),Ue.setIndent(Te.getIndent()),k.push(Ue),Te.remove(!0)}}if(Y!==null)for(let se=0;se<k.length;se++){const Te=k[se];Y.append(Te)}let ae=null;if(t.$isRootOrShadowRoot(m))if(y)if(Y!==null)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te)}else{const se=m.getFirstChild();if(t.$isElementNode(se)&&(m=se),se===null)if(Y)m.append(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];m.append(be),ae=be}else if(Y!==null)se.insertBefore(Y);else for(let Te=0;Te<k.length;Te++){const be=k[Te];se.insertBefore(be),ae=be}}else if(Y)m.insertAfter(Y);else for(let se=k.length-1;se>=0;se--){const Te=k[se];m.insertAfter(Te),ae=Te}const he=t.$getPreviousSelection();t.$isRangeSelection(he)&&W(he.anchor)&&W(he.focus)?t.$setSelection(he.clone()):ae!==null?ae.selectEnd():K.dirty=!0}function ee(K,D){const V=t.$getAdjacentNode(K.focus,D);return t.$isDecoratorNode(V)&&!V.isIsolated()||t.$isElementNode(V)&&!V.isInline()&&!V.canBeEmpty()}function le(K,D,V,ne){K.modify(D?"extend":"move",V,ne)}function j(K){const D=K.anchor.getNode();return(t.$isRootNode(D)?D:D.getParentOrThrow()).getDirection()==="rtl"}function U(K,D,V){const ne=j(K);le(K,D,V?!ne:ne,"character")}function q(K){const D=K.anchor,V=K.focus,G=D.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Q=G.getFirstDescendant(),k=G.getLastDescendant(),m="element",y="element",M=0;t.$isTextNode(Q)?m="text":!t.$isElementNode(Q)&&Q!==null&&(Q=Q.getParentOrThrow()),t.$isTextNode(k)?(y="text",M=k.getTextContentSize()):!t.$isElementNode(k)&&k!==null&&(k=k.getParentOrThrow()),Q&&k&&(D.set(Q.getKey(),0,m),V.set(k.getKey(),M,y))}function me(K,D,V){const ne=K.getStyle(),Y=p(ne);return Y!==null&&Y[D]||V}function _e(K,D,V=""){let ne=null;const Y=K.getNodes(),G=K.anchor,Q=K.focus,k=K.isBackward(),m=k?Q.offset:G.offset,y=k?Q.getNode():G.getNode();if(K.isCollapsed()&&K.style!==""){const M=K.style,Z=p(M);if(Z!==null&&D in Z)return Z[D]}for(let M=0;M<Y.length;M++){const Z=Y[M];if(!(M!==0&&m===0&&Z.is(y))&&t.$isTextNode(Z)){const ae=me(Z,D,V);if(ne===null)ne=ae;else if(ne!==ae){ne="";break}}}return ne===null?V:ne}function pe(K){if(t.$isDecoratorNode(K)&&!K.isInline())return!0;if(!t.$isElementNode(K)||t.$isRootOrShadowRoot(K))return!1;const D=K.getFirstChild(),V=D===null||t.$isLineBreakNode(D)||t.$isTextNode(D)||D.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&V}function ue(K,D){let V=K;for(;V!==null&&V.getParent()!==null&&!D(V);)V=V.getParentOrThrow();return D(V)?V:null}return Kn.$addNodeStyle=w,Kn.$cloneWithProperties=O,Kn.$getSelectionStyleValueForProperty=_e,Kn.$isAtNodeEnd=R,Kn.$isParentElementRTL=j,Kn.$moveCaretSelection=le,Kn.$moveCharacter=U,Kn.$patchStyleText=H,Kn.$selectAll=q,Kn.$setBlocksType=$,Kn.$shouldOverrideDefaultCharacterSelection=ee,Kn.$sliceSelectedTextNodeContent=b,Kn.$wrapNodes=z,Kn.createDOMRange=c,Kn.createRectsFromDOMRange=d,Kn.getStyleObjectFromCSS=p,Kn.trimTextContentFromAnchor=x,Kn}var zn={},zf;function VN(){if(zf)return zn;zf=1;var t=Bt();let e=new Map;function n(x){for(;x!=null;){if(x.nodeType===Node.TEXT_NODE)return x;x=x.firstChild}return null}function r(x){let w=x.parentNode;if(w==null)throw Error("Should never happen");return[w,Array.from(w.childNodes).indexOf(x)]}function c(x){let w={};x=x.split(";");for(let P of x)if(P!==""){let[H,$]=P.split(/:([^]+)/);H&&$&&(w[H.trim()]=$.trim())}return w}function d(x){let w=e.get(x);return w===void 0&&(w=c(x),e.set(x,w)),w}function g(x){let w="";for(let P in x)P&&(w+=`${P}: ${x[P]};`);return w}function p(x,w){var P=d("getStyle"in x?x.getStyle():x.style);w=Object.entries(w).reduce((H,[$,W])=>(W===null?delete H[$]:H[$]=W,H),{...P}),P=g(w),x.setStyle(P),e.set(P,w)}function N(x,w){var P=x.getNodes(),H=P.length;if(t.DEPRECATED_$isGridSelection(x)){for(var $=t.$createRangeSelection(),W=$.anchor,B=$.focus,z=0;z<H;z++){var X=P[z];t.DEPRECATED_$isGridCellNode(X)&&(W.set(X.getKey(),0,"element"),B.set(X.getKey(),X.getChildrenSize(),"element"),N(t.$normalizeSelection__EXPERIMENTAL($),w))}t.$setSelection(x)}else if(--H,$=P[0],W=P[H],x.isCollapsed()&&t.$isRangeSelection(x))p(x,w);else{z=x.anchor;var ee=x.focus;X=$.getTextContent().length;var le=ee.offset,j=z.offset,U=z.isBefore(ee);B=U?j:le,x=U?le:j;var q=U?z.type:ee.type,me=U?ee.type:z.type;if(ee=U?ee.key:z.key,t.$isTextNode($)&&B===X&&(U=$.getNextSibling(),t.$isTextNode(U)&&(B=j=0,$=U)),P.length===1)t.$isTextNode($)&&(B=q==="element"?0:j>le?le:j,x=me==="element"?X:j>le?j:le,B!==x&&(B===0&&x===X?(p($,w),$.select(B,x)):(P=$.splitText(B,x),P=B===0?P[0]:P[1],p(P,w),P.select(0,x-B))));else for(t.$isTextNode($)&&B<$.getTextContentSize()&&(B!==0&&($=$.splitText(B)[1],B=0,z.set($.getKey(),B,"text")),p($,w)),t.$isTextNode(W)&&(B=W.getTextContent().length,W.__key!==ee&&x!==0&&(x=B),x!==B&&([W]=W.splitText(x)),x!==0&&p(W,w)),x=1;x<H;x++)B=P[x],z=B.getKey(),t.$isTextNode(B)&&z!==$.getKey()&&z!==W.getKey()&&!B.isToken()&&p(B,w)}}function v(x){for(;x!==null&&!t.$isRootOrShadowRoot(x);){let w=x.getLatest(),P=x.getParent();w.getChildrenSize()===0&&x.remove(!0),x=P}}function T(x,w,P,H,$=null){if(w.length!==0){var W=w[0],B=new Map,z=[];W=t.$isElementNode(W)?W:W.getParentOrThrow(),W.isInline()&&(W=W.getParentOrThrow());for(var X=!1;W!==null;){var ee=W.getPreviousSibling();if(ee!==null){W=ee,X=!0;break}if(W=W.getParentOrThrow(),t.$isRootOrShadowRoot(W))break}ee=new Set;for(var le=0;le<P;le++){var j=w[le];t.$isElementNode(j)&&j.getChildrenSize()===0&&ee.add(j.getKey())}var U=new Set;for(le=0;le<P;le++){j=w[le];var q=j.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&t.$isLeafNode(j)&&!U.has(j.getKey())){if(j=q.getKey(),B.get(j)===void 0){let me=H();me.setFormat(q.getFormatType()),me.setIndent(q.getIndent()),z.push(me),B.set(j,me),q.getChildren().forEach(_e=>{me.append(_e),U.add(_e.getKey()),t.$isElementNode(_e)&&_e.getChildrenKeys().forEach(pe=>U.add(pe))}),v(q)}}else ee.has(j.getKey())&&(q=H(),q.setFormat(j.getFormatType()),q.setIndent(j.getIndent()),z.push(q),j.remove(!0))}if($!==null)for(w=0;w<z.length;w++)$.append(z[w]);if(w=null,t.$isRootOrShadowRoot(W))if(X)if($!==null)W.insertAfter($);else for($=z.length-1;0<=$;$--)W.insertAfter(z[$]);else if(X=W.getFirstChild(),t.$isElementNode(X)&&(W=X),X===null)if($)W.append($);else for($=0;$<z.length;$++)X=z[$],W.append(X),w=X;else if($!==null)X.insertBefore($);else for(W=0;W<z.length;W++)$=z[W],X.insertBefore($),w=$;else if($)W.insertAfter($);else for($=z.length-1;0<=$;$--)X=z[$],W.insertAfter(X),w=X;z=t.$getPreviousSelection(),t.$isRangeSelection(z)&&z.anchor.getNode().isAttached()&&z.focus.getNode().isAttached()?t.$setSelection(z.clone()):w!==null?w.selectEnd():x.dirty=!0}}function O(x,w,P,H){x.modify(w?"extend":"move",P,H)}function b(x){return x=x.anchor.getNode(),(t.$isRootNode(x)?x:x.getParentOrThrow()).getDirection()==="rtl"}function R(x){if(t.$isDecoratorNode(x)&&!x.isInline())return!0;if(!t.$isElementNode(x)||t.$isRootOrShadowRoot(x))return!1;var w=x.getFirstChild();return w=w===null||t.$isLineBreakNode(w)||t.$isTextNode(w)||w.isInline(),!x.isInline()&&x.canBeEmpty()!==!1&&w}return zn.$addNodeStyle=function(x){x=x.getStyle();let w=c(x);e.set(x,w)},zn.$cloneWithProperties=function(x){let w=x.constructor.clone(x);return w.__parent=x.__parent,w.__next=x.__next,w.__prev=x.__prev,t.$isElementNode(x)&&t.$isElementNode(w)?(w.__first=x.__first,w.__last=x.__last,w.__size=x.__size,w.__format=x.__format,w.__indent=x.__indent,w.__dir=x.__dir,w):(t.$isTextNode(x)&&t.$isTextNode(w)&&(w.__format=x.__format,w.__style=x.__style,w.__mode=x.__mode,w.__detail=x.__detail),w)},zn.$getSelectionStyleValueForProperty=function(x,w,P=""){let H=null,$=x.getNodes();var W=x.anchor,B=x.focus,z=x.isBackward();let X=z?B.offset:W.offset;if(W=z?B.getNode():W.getNode(),x.isCollapsed()&&x.style!==""&&(x=d(x.style),x!==null&&w in x))return x[w];for(x=0;x<$.length;x++){var ee=$[x];if((x===0||X!==0||!ee.is(W))&&t.$isTextNode(ee)){if(B=w,z=P,ee=ee.getStyle(),ee=d(ee),B=ee!==null&&ee[B]||z,H===null)H=B;else if(H!==B){H="";break}}}return H===null?P:H},zn.$isAtNodeEnd=function(x){return x.type==="text"?x.offset===x.getNode().getTextContentSize():x.offset===x.getNode().getChildrenSize()},zn.$isParentElementRTL=b,zn.$moveCaretSelection=O,zn.$moveCharacter=function(x,w,P){let H=b(x);O(x,w,P?!H:H,"character")},zn.$patchStyleText=N,zn.$selectAll=function(x){let w=x.anchor;x=x.focus;var P=w.getNode().getTopLevelElementOrThrow().getParentOrThrow();let H=P.getFirstDescendant();P=P.getLastDescendant();let $="element",W="element",B=0;t.$isTextNode(H)?$="text":t.$isElementNode(H)||H===null||(H=H.getParentOrThrow()),t.$isTextNode(P)?(W="text",B=P.getTextContentSize()):t.$isElementNode(P)||P===null||(P=P.getParentOrThrow()),H&&P&&(w.set(H.getKey(),0,$),x.set(P.getKey(),B,W))},zn.$setBlocksType=function(x,w){if(x.anchor.key==="root"){w=w();var P=t.$getRoot();(x=P.getFirstChild())?x.replace(w,!0):P.append(w)}else{for(P=x.getNodes(),x=x.anchor.getNode();x!==null&&x.getParent()!==null&&!R(x);)x=x.getParentOrThrow();for((x=R(x)?x:null)&&P.indexOf(x)===-1&&P.push(x),x=0;x<P.length;x++){let H=P[x];if(!R(H))continue;let $=w();$.setFormat(H.getFormatType()),$.setIndent(H.getIndent()),H.replace($,!0)}}},zn.$shouldOverrideDefaultCharacterSelection=function(x,w){return x=t.$getAdjacentNode(x.focus,w),t.$isDecoratorNode(x)&&!x.isIsolated()||t.$isElementNode(x)&&!x.isInline()&&!x.canBeEmpty()},zn.$sliceSelectedTextNodeContent=function(x,w){if(w.isSelected()&&!w.isSegmented()&&!w.isToken()&&t.$INTERNAL_isPointSelection(x)){var P=x.anchor.getNode(),H=x.focus.getNode(),$=w.is(P),W=w.is(H);if($||W){$=x.isBackward();let[B,z]=x.getCharacterOffsets();x=P.is(H),W=w.is($?H:P),H=w.is($?P:H),P=0;let X;x?(P=B>z?z:B,X=B>z?B:z):W?(P=$?z:B,X=void 0):H&&($=$?B:z,P=0,X=$),w.__text=w.__text.slice(P,X)}}return w},zn.$wrapNodes=function(x,w,P=null){var H=x.getNodes();let $=H.length;var W=x.anchor;if($===0||$===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){x=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),H=x.getChildren();let z=w();z.setFormat(x.getFormatType()),z.setIndent(x.getIndent()),H.forEach(X=>z.append(X)),P&&(z=P.append(z)),x.replace(z)}else{W=null;var B=[];for(let z=0;z<$;z++){let X=H[z];t.$isRootOrShadowRoot(X)?(T(x,B,B.length,w,P),B=[],W=X):W===null||W!==null&&t.$hasAncestor(X,W)?B.push(X):(T(x,B,B.length,w,P),B=[X])}T(x,B,B.length,w,P)}},zn.createDOMRange=function(x,w,P,H,$){let W=w.getKey(),B=H.getKey(),z=document.createRange(),X=x.getElementByKey(W);if(x=x.getElementByKey(B),t.$isTextNode(w)&&(X=n(X)),t.$isTextNode(H)&&(x=n(x)),w===void 0||H===void 0||X===null||x===null)return null;X.nodeName==="BR"&&([X,P]=r(X)),x.nodeName==="BR"&&([x,$]=r(x)),w=X.firstChild,X===x&&w!=null&&w.nodeName==="BR"&&P===0&&$===0&&($=1);try{z.setStart(X,P),z.setEnd(x,$)}catch{return null}return!z.collapsed||P===$&&W===B||(z.setStart(x,$),z.setEnd(X,P)),z},zn.createRectsFromDOMRange=function(x,w){var P=x.getRootElement();if(P===null)return[];x=P.getBoundingClientRect(),P=getComputedStyle(P),P=parseFloat(P.paddingLeft)+parseFloat(P.paddingRight),w=Array.from(w.getClientRects());let H=w.length;w.sort((W,B)=>{let z=W.top-B.top;return 3>=Math.abs(z)?W.left-B.left:z});let $;for(let W=0;W<H;W++){let B=w[W],z=B.width+P===x.width;$&&$.top<=B.top&&$.top+$.height>B.top&&$.left+$.width>B.left||z?(w.splice(W--,1),H--):$=B}return w},zn.getStyleObjectFromCSS=d,zn.trimTextContentFromAnchor=function(x,w,P){let H=w.getNode();if(t.$isElementNode(H)){var $=H.getDescendantByIndex(w.offset);$!==null&&(H=$)}for(;0<P&&H!==null;){t.$isElementNode(H)&&($=H.getLastDescendant(),$!==null&&(H=$));var W=H.getPreviousSibling(),B=0;if(W===null){$=H.getParentOrThrow();for(var z=$.getPreviousSibling();z===null;){if($=$.getParent(),$===null){W=null;break}z=$.getPreviousSibling()}$!==null&&(B=$.isInline()?0:2,W=z)}if(z=H.getTextContent(),z===""&&t.$isElementNode(H)&&!H.isInline()&&(z=`
68
68
 
69
- `),P=z.length,!t.$isTextNode(W)||$>=P)z=W.getParent(),W.remove(),z==null||z.getChildrenSize()!==0||t.$isRootNode(z)||z.remove(),$-=P+B,W=H;else{let X=W.getKey();B=x.getEditorState().read(()=>{const le=t.$getNodeByKey(X);return t.$isTextNode(le)&&le.isSimpleText()?le.getTextContent():null}),H=P-$;let ee=z.slice(0,H);B!==null&&B!==z?($=t.$getPreviousSelection(),P=W,W.isSimpleText()?W.setTextContent(B):(P=t.$createTextNode(B),W.replace(P)),t.$isRangeSelection($)&&$.isCollapsed()&&($=$.anchor.offset,P.select($,$))):W.isSimpleText()?(B=w.key===X,z=w.offset,z<$&&(z=P),$=B?z-$:0,P=B?z:H,B&&$===0?([$]=W.splitText($,P),$.remove()):([,$]=W.splitText($,P),$.remove())):($=t.$createTextNode(ee),W.replace($)),$=0}}},zn}var iu,Uf;function Mo(){return Uf||(Uf=1,iu=process.env.NODE_ENV==="development"?jN():VN()),iu}var Gf;function qN(){if(Gf)return Nn;Gf=1;var t=Mo(),e=Bt();function n(...ee){return()=>{ee.forEach(le=>le())}}function r(ee){return`${ee}px`}const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(ee,le,j){let U=null,q=null,me=null,_e=[];const pe=document.createElement("div");function ue(){if(U===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:ne,top:Y}=U.getBoundingClientRect(),G=q,Q=t.createRectsFromDOMRange(ee,le);pe.isConnected||G.append(pe);let k=!1;for(let m=0;m<Q.length;m++){const y=Q[m],M=_e[m]||document.createElement("div"),Z=M.style;Z.position!=="absolute"&&(Z.position="absolute",k=!0);const ae=r(y.left-ne);Z.left!==ae&&(Z.left=ae,k=!0);const he=r(y.top-Y);Z.top!==he&&(M.style.top=he,k=!0);const se=r(y.width);Z.width!==se&&(M.style.width=se,k=!0);const Te=r(y.height);Z.height!==Te&&(M.style.height=Te,k=!0),M.parentNode!==pe&&(pe.append(M),k=!0),_e[m]=M}for(;_e.length>Q.length;)_e.pop();k&&j(_e)}function K(){q=null,U=null,me!==null&&me.disconnect(),me=null,pe.remove();for(const ne of _e)ne.remove();_e=[]}function D(){const ne=ee.getRootElement();if(ne===null)return K();const Y=ne.parentElement;if(!(Y instanceof HTMLElement))return K();K(),U=ne,q=Y,me=new MutationObserver(G=>{const Q=ee.getRootElement(),k=Q&&Q.parentElement;if(Q!==U||k!==q)return D();for(const m of G)if(!pe.contains(m.target))return ue()}),me.observe(Y,c),ue()}const V=ee.registerRootListener(D);return()=>{V(),K()}}function g(ee,le){let j=null,U=null,q=null,me=null,_e=()=>{};function pe(ue){ue.read(()=>{const K=e.$getSelection();if(!e.$isRangeSelection(K)){j=null,U=null,q=null,me=null,_e(),_e=()=>{};return}const{anchor:D,focus:V}=K,ne=D.getNode(),Y=ne.getKey(),G=D.offset,Q=V.getNode(),k=Q.getKey(),m=V.offset,y=ee.getElementByKey(Y),M=ee.getElementByKey(k),Z=j===null||y===null||G!==U||Y!==j.getKey()||ne!==j&&(!(j instanceof e.TextNode)||ne.updateDOM(j,y,ee._config)),ae=q===null||M===null||m!==me||k!==q.getKey()||Q!==q&&(!(q instanceof e.TextNode)||Q.updateDOM(q,M,ee._config));if(Z||ae){const he=ee.getElementByKey(D.getNode().getKey()),se=ee.getElementByKey(V.getNode().getKey());if(he!==null&&se!==null&&he.tagName==="SPAN"&&se.tagName==="SPAN"){const Te=document.createRange();let be,Ue,re,te;V.isBefore(D)?(be=se,Ue=V.offset,re=he,te=D.offset):(be=he,Ue=D.offset,re=se,te=V.offset);const ce=be.firstChild;if(ce===null)throw Error("Expected text node to be first child of span");const we=re.firstChild;if(we===null)throw Error("Expected text node to be first child of span");Te.setStart(ce,Ue),Te.setEnd(we,te),_e(),_e=d(ee,Te,Le=>{for(const Be of Le){const Ye=Be.style;Ye.background!=="Highlight"&&(Ye.background="Highlight"),Ye.color!=="HighlightText"&&(Ye.color="HighlightText"),Ye.zIndex!=="-1"&&(Ye.zIndex="-1"),Ye.pointerEvents!=="none"&&(Ye.pointerEvents="none"),Ye.marginTop!==r(-1.5)&&(Ye.marginTop=r(-1.5)),Ye.paddingTop!==r(4)&&(Ye.paddingTop=r(4)),Ye.paddingBottom!==r(0)&&(Ye.paddingBottom=r(0))}le!==void 0&&le(Le)})}}j=ne,U=G,q=Q,me=m})}return pe(ee.getEditorState()),n(ee.registerUpdateListener(({editorState:ue})=>pe(ue)),_e,()=>{_e()})}function p(ee,...le){le.forEach(j=>{if(typeof j=="string"){const U=j.split(" ").filter(q=>q!=="");ee.classList.add(...U)}})}function C(ee,...le){le.forEach(j=>{typeof j=="string"&&ee.classList.remove(...j.split(" "))})}function v(ee,le){for(const j of le)if(ee.type.startsWith(j))return!0;return!1}function T(ee,le){const j=ee[Symbol.iterator]();return new Promise((U,q)=>{const me=[],_e=()=>{const{done:pe,value:ue}=j.next();if(pe)return U(me);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const D=K.result;typeof D=="string"&&me.push({file:ue,result:D}),_e()}),v(ue,le)?K.readAsDataURL(ue):_e()};_e()})}function O(ee,le){const j=[],U=(ee||e.$getRoot()).getLatest(),q=le||(e.$isElementNode(U)?U.getLastDescendant():U);let me=U,_e=R(me);for(;me!==null&&!me.is(q);)if(j.push({depth:_e,node:me}),e.$isElementNode(me)&&me.getChildrenSize()>0)me=me.getFirstChild(),_e++;else{let pe=null;for(;pe===null&&me!==null;)pe=me.getNextSibling(),pe===null?(me=me.getParent(),_e--):me=pe}return me!==null&&me.is(q)&&j.push({depth:_e,node:me}),j}function R(ee){let le=ee,j=0;for(;(le=le.getParent())!==null;)j++;return j}function b(ee,le){let j=ee;for(;j!=null;){if(j instanceof le)return j;j=j.getParent()}return null}function x(ee){const le=w(ee,j=>e.$isElementNode(j)&&!j.isInline());if(!e.$isElementNode(le))throw Error(`Expected node ${ee.__key} to have closest block element node.`);return le}function w(ee,le){let j=ee;for(;j!==e.$getRoot()&&j!=null;){if(le(j))return j;j=j.getParent()}return null}function $(ee,le,j,U){const q=pe=>pe instanceof le,me=pe=>{const ue=pe.getChildren();for(let V=0;V<ue.length;V++){const ne=ue[V];if(q(ne))return null}let K=pe,D=pe;for(;K!==null;)if(D=K,K=K.getParent(),q(K))return{child:D,parent:K};return null},_e=pe=>{const ue=me(pe);if(ue!==null){const{child:K,parent:D}=ue;if(K.is(pe)){U(D,pe);const V=K.getNextSiblings(),ne=V.length;if(D.insertAfter(K),ne!==0){const Y=j(D);K.insertAfter(Y);for(let G=0;G<ne;G++)Y.append(V[G])}!D.canBeEmpty()&&D.getChildrenSize()===0&&D.remove()}}};return ee.registerNodeTransform(le,_e)}function W(ee,le){const U=new Map,q=ee._pendingEditorState;for(const[_e,pe]of le._nodeMap){const ue=t.$cloneWithProperties(pe);e.$isTextNode(ue)&&(ue.__text=pe.__text),U.set(_e,ue)}q&&(q._nodeMap=U),ee._dirtyType=2;const me=le._selection;e.$setSelection(me===null?null:me.clone())}function P(ee){const le=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(le)){const{focus:j}=le,U=j.getNode(),q=j.offset;if(e.$isRootOrShadowRoot(U)){const me=U.getChildAtIndex(q);me==null?U.append(ee):me.insertBefore(ee),ee.selectNext()}else{let me,_e;e.$isTextNode(U)?(me=U.getParentOrThrow(),_e=U.getIndexWithinParent(),q>0&&(_e+=1,U.splitText(q))):(me=U,_e=q);const[,pe]=e.$splitNode(me,_e);pe.insertBefore(ee),pe.selectStart()}}else{if(le!=null){const U=le.getNodes();U[U.length-1].getTopLevelElementOrThrow().insertAfter(ee)}else e.$getRoot().append(ee);const j=e.$createParagraphNode();ee.insertAfter(j),j.select()}return ee.getLatest()}function H(ee,le){const j=le();return ee.replace(j),j.append(ee),j}function B(ee,le){return ee!==null?Object.getPrototypeOf(ee).constructor.name===le.name:!1}function z(ee,le){const j=[];for(let U=0;U<ee.length;U++){const q=le(ee[U]);q!==null&&j.push(q)}return j}function X(ee,le){const j=ee.getFirstChild();j!==null?j.insertBefore(le):ee.append(le)}return Nn.$splitNode=e.$splitNode,Nn.isHTMLAnchorElement=e.isHTMLAnchorElement,Nn.isHTMLElement=e.isHTMLElement,Nn.$dfs=O,Nn.$filter=z,Nn.$findMatchingParent=w,Nn.$getNearestBlockElementAncestorOrThrow=x,Nn.$getNearestNodeOfType=b,Nn.$insertFirst=X,Nn.$insertNodeToNearestRoot=P,Nn.$restoreEditorState=W,Nn.$wrapNodeInElement=H,Nn.addClassNamesToElement=p,Nn.isMimeType=v,Nn.markSelection=g,Nn.mediaFileReader=T,Nn.mergeRegister=n,Nn.objectKlassEquals=B,Nn.positionNodeOnRange=d,Nn.registerNestedElementResolver=$,Nn.removeClassNamesFromElement=C,Nn}var Cn={},Yf;function ZN(){if(Yf)return Cn;Yf=1;var t=Mo(),e=Bt();function n(C){let v=new URLSearchParams;v.append("code",C);for(let T=1;T<arguments.length;T++)v.append("v",arguments[T]);throw Error(`Minified Lexical error #${C}; visit https://lexical.dev/docs/error?${v} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(...C){return()=>{C.forEach(v=>v())}}let c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(C,v,T){function O(){if(x===null)throw Error("Unexpected null rootDOMNode");if(w===null)throw Error("Unexpected null parentDOMNode");let{left:B,top:z}=x.getBoundingClientRect();var X=w;let ee=t.createRectsFromDOMRange(C,v);P.isConnected||X.append(P),X=!1;for(let U=0;U<ee.length;U++){var le=ee[U];let q=W[U]||document.createElement("div"),me=q.style;me.position!=="absolute"&&(me.position="absolute",X=!0);var j=`${le.left-B}px`;me.left!==j&&(me.left=j,X=!0),j=`${le.top-z}px`,me.top!==j&&(q.style.top=j,X=!0),j=`${le.width}px`,me.width!==j&&(q.style.width=j,X=!0),le=`${le.height}px`,me.height!==le&&(q.style.height=le,X=!0),q.parentNode!==P&&(P.append(q),X=!0),W[U]=q}for(;W.length>ee.length;)W.pop();X&&T(W)}function R(){x=w=null,$!==null&&$.disconnect(),$=null,P.remove();for(let B of W)B.remove();W=[]}function b(){let B=C.getRootElement();if(B===null)return R();let z=B.parentElement;if(!(z instanceof HTMLElement))return R();R(),x=B,w=z,$=new MutationObserver(X=>{let ee=C.getRootElement(),le=ee&&ee.parentElement;if(ee!==x||le!==w)return b();for(let j of X)if(!P.contains(j.target))return O()}),$.observe(z,c),O()}let x=null,w=null,$=null,W=[],P=document.createElement("div"),H=C.registerRootListener(b);return()=>{H(),R()}}function g(C,v){for(let T of v)if(C.type.startsWith(T))return!0;return!1}function p(C,v){for(;C!==e.$getRoot()&&C!=null;){if(v(C))return C;C=C.getParent()}return null}return Cn.$splitNode=e.$splitNode,Cn.isHTMLAnchorElement=e.isHTMLAnchorElement,Cn.isHTMLElement=e.isHTMLElement,Cn.$dfs=function(C,v){let T=[];C=(C||e.$getRoot()).getLatest(),v=v||(e.$isElementNode(C)?C.getLastDescendant():C);for(var O=C,R=0;(O=O.getParent())!==null;)R++;for(O=R;C!==null&&!C.is(v);)if(T.push({depth:O,node:C}),e.$isElementNode(C)&&0<C.getChildrenSize())C=C.getFirstChild(),O++;else for(R=null;R===null&&C!==null;)R=C.getNextSibling(),R===null?(C=C.getParent(),O--):C=R;return C!==null&&C.is(v)&&T.push({depth:O,node:C}),T},Cn.$filter=function(C,v){let T=[];for(let O=0;O<C.length;O++){let R=v(C[O]);R!==null&&T.push(R)}return T},Cn.$findMatchingParent=p,Cn.$getNearestBlockElementAncestorOrThrow=function(C){let v=p(C,T=>e.$isElementNode(T)&&!T.isInline());return e.$isElementNode(v)||n(4,C.__key),v},Cn.$getNearestNodeOfType=function(C,v){for(;C!=null;){if(C instanceof v)return C;C=C.getParent()}return null},Cn.$insertFirst=function(C,v){let T=C.getFirstChild();T!==null?T.insertBefore(v):C.append(v)},Cn.$insertNodeToNearestRoot=function(C){var v=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(v)){var{focus:T}=v;if(v=T.getNode(),T=T.offset,e.$isRootOrShadowRoot(v))T=v.getChildAtIndex(T),T==null?v.append(C):T.insertBefore(C),C.selectNext();else{let O,R;e.$isTextNode(v)?(O=v.getParentOrThrow(),R=v.getIndexWithinParent(),0<T&&(R+=1,v.splitText(T))):(O=v,R=T),[,v]=e.$splitNode(O,R),v.insertBefore(C),v.selectStart()}}else v!=null?(v=v.getNodes(),v[v.length-1].getTopLevelElementOrThrow().insertAfter(C)):e.$getRoot().append(C),v=e.$createParagraphNode(),C.insertAfter(v),v.select();return C.getLatest()},Cn.$restoreEditorState=function(C,v){let T=new Map,O=C._pendingEditorState;for(let[R,b]of v._nodeMap){let x=t.$cloneWithProperties(b);e.$isTextNode(x)&&(x.__text=b.__text),T.set(R,x)}O&&(O._nodeMap=T),C._dirtyType=2,C=v._selection,e.$setSelection(C===null?null:C.clone())},Cn.$wrapNodeInElement=function(C,v){return v=v(),C.replace(v),v.append(C),v},Cn.addClassNamesToElement=function(C,...v){v.forEach(T=>{typeof T=="string"&&(T=T.split(" ").filter(O=>O!==""),C.classList.add(...T))})},Cn.isMimeType=g,Cn.markSelection=function(C,v){function T($){$.read(()=>{var W=e.$getSelection();if(e.$isRangeSelection(W)){var{anchor:P,focus:H}=W;W=P.getNode();var B=W.getKey(),z=P.offset,X=H.getNode(),ee=X.getKey(),le=H.offset,j=C.getElementByKey(B),U=C.getElementByKey(ee);if(B=O===null||j===null||z!==R||B!==O.getKey()||W!==O&&(!(O instanceof e.TextNode)||W.updateDOM(O,j,C._config)),ee=b===null||U===null||le!==x||ee!==b.getKey()||X!==b&&(!(b instanceof e.TextNode)||X.updateDOM(b,U,C._config)),B||ee){j=C.getElementByKey(P.getNode().getKey());var q=C.getElementByKey(H.getNode().getKey());if(j!==null&&q!==null&&j.tagName==="SPAN"&&q.tagName==="SPAN"){if(ee=document.createRange(),H.isBefore(P)?(B=q,U=H.offset,q=j,j=P.offset):(B=j,U=P.offset,j=H.offset),B=B.firstChild,B===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");ee.setStart(B,U),ee.setEnd(q,j),w(),w=d(C,ee,me=>{for(let _e of me){let pe=_e.style;pe.background!=="Highlight"&&(pe.background="Highlight"),pe.color!=="HighlightText"&&(pe.color="HighlightText"),pe.zIndex!=="-1"&&(pe.zIndex="-1"),pe.pointerEvents!=="none"&&(pe.pointerEvents="none"),pe.marginTop!=="-1.5px"&&(pe.marginTop="-1.5px"),pe.paddingTop!=="4px"&&(pe.paddingTop="4px"),pe.paddingBottom!=="0px"&&(pe.paddingBottom="0px")}v!==void 0&&v(me)})}}O=W,R=z,b=X,x=le}else x=b=R=O=null,w(),w=()=>{}})}let O=null,R=null,b=null,x=null,w=()=>{};return T(C.getEditorState()),r(C.registerUpdateListener(({editorState:$})=>T($)),w,()=>{w()})},Cn.mediaFileReader=function(C,v){let T=C[Symbol.iterator]();return new Promise((O,R)=>{let b=[],x=()=>{const{done:w,value:$}=T.next();if(w)return O(b);const W=new FileReader;W.addEventListener("error",R),W.addEventListener("load",()=>{const P=W.result;typeof P=="string"&&b.push({file:$,result:P}),x()}),g($,v)?W.readAsDataURL($):x()};x()})},Cn.mergeRegister=r,Cn.objectKlassEquals=function(C,v){return C!==null?Object.getPrototypeOf(C).constructor.name===v.name:!1},Cn.positionNodeOnRange=d,Cn.registerNestedElementResolver=function(C,v,T,O){return C.registerNodeTransform(v,R=>{e:{for(var b=R.getChildren(),x=0;x<b.length;x++)if(b[x]instanceof v){b=null;break e}for(b=R;b!==null;)if(x=b,b=b.getParent(),b instanceof v){b={child:x,parent:b};break e}b=null}if(b!==null){const{child:w,parent:$}=b;if(w.is(R)){if(O($,R),R=w.getNextSiblings(),b=R.length,$.insertAfter(w),b!==0){x=T($),w.insertAfter(x);for(let W=0;W<b;W++)x.append(R[W])}$.canBeEmpty()||$.getChildrenSize()!==0||$.remove()}}})},Cn.removeClassNamesFromElement=function(C,...v){v.forEach(T=>{typeof T=="string"&&C.classList.remove(...T.split(" "))})},Cn}var ou,jf;function on(){return jf||(jf=1,ou=process.env.NODE_ENV==="development"?qN():ZN()),ou}var su={},Vf;function JN(){if(Vf)return su;Vf=1;var t=Bt();function e(n){const r=window.location.origin,c=d=>{if(d.origin!==r)return;const g=n.getRootElement();if(document.activeElement!==g)return;const p=d.data;if(typeof p=="string"){let C;try{C=JSON.parse(p)}catch{return}if(C&&C.protocol==="nuanria_messaging"&&C.type==="request"){const v=C.payload;if(v&&v.functionId==="makeChanges"){const T=v.args;if(T){const[O,R,b,x,w,$]=T;n.update(()=>{const W=t.$getSelection();if(t.$isRangeSelection(W)){const P=W.anchor;let H=P.getNode(),B=0,z=0;if(t.$isTextNode(H)&&O>=0&&R>=0&&(B=O,z=O+R,W.setTextNodeRange(H,B,H,z)),(B!==z||b!=="")&&(W.insertRawText(b),H=P.getNode()),t.$isTextNode(H)){B=x,z=x+w;const X=H.getTextContentSize();B=B>X?X:B,z=z>X?X:z,W.setTextNodeRange(H,B,H,z)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",c,!0),()=>{window.removeEventListener("message",c,!0)}}return su.registerDragonSupport=e,su}var lu={},qf;function XN(){if(qf)return lu;qf=1;var t=Bt();return lu.registerDragonSupport=function(e){let n=window.location.origin,r=c=>{if(c.origin===n){var d=e.getRootElement();if(document.activeElement===d&&(d=c.data,typeof d=="string")){try{var g=JSON.parse(d)}catch{return}if(g&&g.protocol==="nuanria_messaging"&&g.type==="request"&&(g=g.payload)&&g.functionId==="makeChanges"&&(g=g.args)){const[p,C,v,T,O]=g;e.update(()=>{const R=t.$getSelection();if(t.$isRangeSelection(R)){var b=R.anchor;let x=b.getNode(),w=0,$=0;t.$isTextNode(x)&&0<=p&&0<=C&&(w=p,$=p+C,R.setTextNodeRange(x,w,x,$)),(w!==$||v!=="")&&(R.insertRawText(v),x=b.getNode()),t.$isTextNode(x)&&(w=T,$=T+O,b=x.getTextContentSize(),w=w>b?b:w,$=$>b?b:$,R.setTextNodeRange(x,w,x,$)),c.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},lu}var au,Zf;function vp(){return Zf||(Zf=1,au=process.env.NODE_ENV==="development"?JN():XN()),au}var ci={},Li={},ja={},Jf;function QN(){if(Jf)return ja;Jf=1;var t=Mo(),e=on(),n=Bt();function r(v,T){const O=T.body?T.body.childNodes:[];let R=[];for(let b=0;b<O.length;b++){const x=O[b];if(!p.has(x.nodeName)){const w=C(x,v);w!==null&&(R=R.concat(w))}}return R}function c(v,T){if(typeof document>"u"||typeof window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const O=document.createElement("div"),b=n.$getRoot().getChildren();for(let x=0;x<b.length;x++){const w=b[x];d(v,w,O,T)}return O.innerHTML}function d(v,T,O,R=null){let b=R!=null?T.isSelected(R):!0;const x=n.$isElementNode(T)&&T.excludeFromCopy("html");let w=T;if(R!==null){let X=t.$cloneWithProperties(T);X=n.$isTextNode(X)&&R!=null?t.$sliceSelectedTextNodeContent(R,X):X,w=X}const $=n.$isElementNode(w)?w.getChildren():[],W=v._nodes.get(w.getType());let P;W&&W.exportDOM!==void 0?P=W.exportDOM(v,w):P=w.exportDOM(v);const{element:H,after:B}=P;if(!H)return!1;const z=document.createDocumentFragment();for(let X=0;X<$.length;X++){const ee=$[X],le=d(v,ee,z,R);!b&&n.$isElementNode(T)&&le&&T.extractWithChild(ee,R,"html")&&(b=!0)}if(b&&!x){if(e.isHTMLElement(H)&&H.append(z),O.append(H),B){const X=B.call(w,H);X&&H.replaceWith(X)}}else O.append(z);return b}function g(v,T){const{nodeName:O}=v,R=T._htmlConversions.get(O.toLowerCase());let b=null;if(R!==void 0)for(const x of R){const w=x(v);w!==null&&(b===null||b.priority<w.priority)&&(b=w)}return b!==null?b.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function C(v,T,O=new Map,R){let b=[];if(p.has(v.nodeName))return b;let x=null;const w=g(v,T),$=w?w(v):null;let W=null;if($!==null){W=$.after;const B=$.node;if(x=Array.isArray(B)?B[B.length-1]:B,x!==null){for(const[,z]of O)if(x=z(x,R),!x)break;x&&b.push(...Array.isArray(B)?B:[x])}$.forChild!=null&&O.set(v.nodeName,$.forChild)}const P=v.childNodes;let H=[];for(let B=0;B<P.length;B++)H.push(...C(P[B],T,new Map(O),x));return W!=null&&(H=W(H)),x==null?b=b.concat(H):n.$isElementNode(x)&&x.append(...H),b}return ja.$generateHtmlFromNodes=c,ja.$generateNodesFromDOM=r,ja}var Va={},Xf;function eC(){if(Xf)return Va;Xf=1;var t=Mo(),e=on(),n=Bt();function r(g,p,C,v=null){let T=v!=null?p.isSelected(v):!0,O=n.$isElementNode(p)&&p.excludeFromCopy("html");var R=p;v!==null&&(R=t.$cloneWithProperties(p),R=n.$isTextNode(R)&&v!=null?t.$sliceSelectedTextNodeContent(v,R):R);let b=n.$isElementNode(R)?R.getChildren():[];var x=g._nodes.get(R.getType());x=x&&x.exportDOM!==void 0?x.exportDOM(g,R):R.exportDOM(g);let{element:w,after:$}=x;if(!w)return!1;x=document.createDocumentFragment();for(let W=0;W<b.length;W++){let P=b[W],H=r(g,P,x,v);!T&&n.$isElementNode(p)&&H&&p.extractWithChild(P,v,"html")&&(T=!0)}return T&&!O?(e.isHTMLElement(w)&&w.append(x),C.append(w),$&&(g=$.call(R,w))&&w.replaceWith(g)):C.append(x),T}let c=new Set(["STYLE","SCRIPT"]);function d(g,p,C=new Map,v){let T=[];if(c.has(g.nodeName))return T;let O=null;var R,{nodeName:b}=g,x=p._htmlConversions.get(b.toLowerCase());if(b=null,x!==void 0)for(R of x)x=R(g),x!==null&&(b===null||b.priority<x.priority)&&(b=x);if(b=(R=b!==null?b.conversion:null)?R(g):null,R=null,b!==null){if(R=b.after,x=b.node,O=Array.isArray(x)?x[x.length-1]:x,O!==null){for(var[,w]of C)if(O=w(O,v),!O)break;O&&T.push(...Array.isArray(x)?x:[O])}b.forChild!=null&&C.set(g.nodeName,b.forChild)}for(g=g.childNodes,v=[],w=0;w<g.length;w++)v.push(...d(g[w],p,new Map(C),O));return R!=null&&(v=R(v)),O==null?T=T.concat(v):n.$isElementNode(O)&&O.append(...v),T}return Va.$generateHtmlFromNodes=function(g,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let C=document.createElement("div"),v=n.$getRoot().getChildren();for(let T=0;T<v.length;T++)r(g,v[T],C,p);return C.innerHTML},Va.$generateNodesFromDOM=function(g,p){p=p.body?p.body.childNodes:[];let C=[];for(let T=0;T<p.length;T++){var v=p[T];c.has(v.nodeName)||(v=d(v,g),v!==null&&(C=C.concat(v)))}return C},Va}var cu,Qf;function Sp(){return Qf||(Qf=1,cu=process.env.NODE_ENV==="development"?QN():eC()),cu}var eh;function tC(){if(eh)return Li;eh=1;var t=Sp(),e=Mo(),n=on(),r=Bt();const c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=B=>c?(B||window).getSelection():null;function g(B){const z=r.$getSelection();if(z==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(z)&&z.isCollapsed()||z.getNodes().length===0?"":t.$generateHtmlFromNodes(B,z)}function p(B){const z=r.$getSelection();if(z==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(z)&&z.isCollapsed()||z.getNodes().length===0?null:JSON.stringify(x(B,z))}function C(B,z){const X=B.getData("text/plain")||B.getData("text/uri-list");X!=null&&z.insertRawText(X)}function v(B,z,X){const ee=B.getData("application/x-lexical-editor");if(ee)try{const U=JSON.parse(ee);if(U.namespace===X._config.namespace&&Array.isArray(U.nodes)){const q=w(U.nodes);return T(X,q,z)}}catch{}const le=B.getData("text/html");if(le)try{const q=new DOMParser().parseFromString(le,"text/html"),me=t.$generateNodesFromDOM(X,q);return T(X,me,z)}catch{}const j=B.getData("text/plain")||B.getData("text/uri-list");if(j!=null)if(r.$isRangeSelection(z)){const U=j.split(/(\r?\n|\t)/);U[U.length-1]===""&&U.pop();for(let q=0;q<U.length;q++){const me=U[q];me===`
69
+ `),$=z.length,!t.$isTextNode(H)||P>=$)z=H.getParent(),H.remove(),z==null||z.getChildrenSize()!==0||t.$isRootNode(z)||z.remove(),P-=$+B,H=W;else{let X=H.getKey();B=x.getEditorState().read(()=>{const le=t.$getNodeByKey(X);return t.$isTextNode(le)&&le.isSimpleText()?le.getTextContent():null}),W=$-P;let ee=z.slice(0,W);B!==null&&B!==z?(P=t.$getPreviousSelection(),$=H,H.isSimpleText()?H.setTextContent(B):($=t.$createTextNode(B),H.replace($)),t.$isRangeSelection(P)&&P.isCollapsed()&&(P=P.anchor.offset,$.select(P,P))):H.isSimpleText()?(B=w.key===X,z=w.offset,z<P&&(z=$),P=B?z-P:0,$=B?z:W,B&&P===0?([P]=H.splitText(P,$),P.remove()):([,P]=H.splitText(P,$),P.remove())):(P=t.$createTextNode(ee),H.replace(P)),P=0}}},zn}var iu,Uf;function Mo(){return Uf||(Uf=1,iu=process.env.NODE_ENV==="development"?jN():VN()),iu}var Gf;function qN(){if(Gf)return Nn;Gf=1;var t=Mo(),e=Bt();function n(...ee){return()=>{ee.forEach(le=>le())}}function r(ee){return`${ee}px`}const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(ee,le,j){let U=null,q=null,me=null,_e=[];const pe=document.createElement("div");function ue(){if(U===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:ne,top:Y}=U.getBoundingClientRect(),G=q,Q=t.createRectsFromDOMRange(ee,le);pe.isConnected||G.append(pe);let k=!1;for(let m=0;m<Q.length;m++){const y=Q[m],M=_e[m]||document.createElement("div"),Z=M.style;Z.position!=="absolute"&&(Z.position="absolute",k=!0);const ae=r(y.left-ne);Z.left!==ae&&(Z.left=ae,k=!0);const he=r(y.top-Y);Z.top!==he&&(M.style.top=he,k=!0);const se=r(y.width);Z.width!==se&&(M.style.width=se,k=!0);const Te=r(y.height);Z.height!==Te&&(M.style.height=Te,k=!0),M.parentNode!==pe&&(pe.append(M),k=!0),_e[m]=M}for(;_e.length>Q.length;)_e.pop();k&&j(_e)}function K(){q=null,U=null,me!==null&&me.disconnect(),me=null,pe.remove();for(const ne of _e)ne.remove();_e=[]}function D(){const ne=ee.getRootElement();if(ne===null)return K();const Y=ne.parentElement;if(!(Y instanceof HTMLElement))return K();K(),U=ne,q=Y,me=new MutationObserver(G=>{const Q=ee.getRootElement(),k=Q&&Q.parentElement;if(Q!==U||k!==q)return D();for(const m of G)if(!pe.contains(m.target))return ue()}),me.observe(Y,c),ue()}const V=ee.registerRootListener(D);return()=>{V(),K()}}function g(ee,le){let j=null,U=null,q=null,me=null,_e=()=>{};function pe(ue){ue.read(()=>{const K=e.$getSelection();if(!e.$isRangeSelection(K)){j=null,U=null,q=null,me=null,_e(),_e=()=>{};return}const{anchor:D,focus:V}=K,ne=D.getNode(),Y=ne.getKey(),G=D.offset,Q=V.getNode(),k=Q.getKey(),m=V.offset,y=ee.getElementByKey(Y),M=ee.getElementByKey(k),Z=j===null||y===null||G!==U||Y!==j.getKey()||ne!==j&&(!(j instanceof e.TextNode)||ne.updateDOM(j,y,ee._config)),ae=q===null||M===null||m!==me||k!==q.getKey()||Q!==q&&(!(q instanceof e.TextNode)||Q.updateDOM(q,M,ee._config));if(Z||ae){const he=ee.getElementByKey(D.getNode().getKey()),se=ee.getElementByKey(V.getNode().getKey());if(he!==null&&se!==null&&he.tagName==="SPAN"&&se.tagName==="SPAN"){const Te=document.createRange();let be,Ue,re,te;V.isBefore(D)?(be=se,Ue=V.offset,re=he,te=D.offset):(be=he,Ue=D.offset,re=se,te=V.offset);const ce=be.firstChild;if(ce===null)throw Error("Expected text node to be first child of span");const we=re.firstChild;if(we===null)throw Error("Expected text node to be first child of span");Te.setStart(ce,Ue),Te.setEnd(we,te),_e(),_e=d(ee,Te,Le=>{for(const Be of Le){const Ye=Be.style;Ye.background!=="Highlight"&&(Ye.background="Highlight"),Ye.color!=="HighlightText"&&(Ye.color="HighlightText"),Ye.zIndex!=="-1"&&(Ye.zIndex="-1"),Ye.pointerEvents!=="none"&&(Ye.pointerEvents="none"),Ye.marginTop!==r(-1.5)&&(Ye.marginTop=r(-1.5)),Ye.paddingTop!==r(4)&&(Ye.paddingTop=r(4)),Ye.paddingBottom!==r(0)&&(Ye.paddingBottom=r(0))}le!==void 0&&le(Le)})}}j=ne,U=G,q=Q,me=m})}return pe(ee.getEditorState()),n(ee.registerUpdateListener(({editorState:ue})=>pe(ue)),_e,()=>{_e()})}function p(ee,...le){le.forEach(j=>{if(typeof j=="string"){const U=j.split(" ").filter(q=>q!=="");ee.classList.add(...U)}})}function N(ee,...le){le.forEach(j=>{typeof j=="string"&&ee.classList.remove(...j.split(" "))})}function v(ee,le){for(const j of le)if(ee.type.startsWith(j))return!0;return!1}function T(ee,le){const j=ee[Symbol.iterator]();return new Promise((U,q)=>{const me=[],_e=()=>{const{done:pe,value:ue}=j.next();if(pe)return U(me);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const D=K.result;typeof D=="string"&&me.push({file:ue,result:D}),_e()}),v(ue,le)?K.readAsDataURL(ue):_e()};_e()})}function O(ee,le){const j=[],U=(ee||e.$getRoot()).getLatest(),q=le||(e.$isElementNode(U)?U.getLastDescendant():U);let me=U,_e=b(me);for(;me!==null&&!me.is(q);)if(j.push({depth:_e,node:me}),e.$isElementNode(me)&&me.getChildrenSize()>0)me=me.getFirstChild(),_e++;else{let pe=null;for(;pe===null&&me!==null;)pe=me.getNextSibling(),pe===null?(me=me.getParent(),_e--):me=pe}return me!==null&&me.is(q)&&j.push({depth:_e,node:me}),j}function b(ee){let le=ee,j=0;for(;(le=le.getParent())!==null;)j++;return j}function R(ee,le){let j=ee;for(;j!=null;){if(j instanceof le)return j;j=j.getParent()}return null}function x(ee){const le=w(ee,j=>e.$isElementNode(j)&&!j.isInline());if(!e.$isElementNode(le))throw Error(`Expected node ${ee.__key} to have closest block element node.`);return le}function w(ee,le){let j=ee;for(;j!==e.$getRoot()&&j!=null;){if(le(j))return j;j=j.getParent()}return null}function P(ee,le,j,U){const q=pe=>pe instanceof le,me=pe=>{const ue=pe.getChildren();for(let V=0;V<ue.length;V++){const ne=ue[V];if(q(ne))return null}let K=pe,D=pe;for(;K!==null;)if(D=K,K=K.getParent(),q(K))return{child:D,parent:K};return null},_e=pe=>{const ue=me(pe);if(ue!==null){const{child:K,parent:D}=ue;if(K.is(pe)){U(D,pe);const V=K.getNextSiblings(),ne=V.length;if(D.insertAfter(K),ne!==0){const Y=j(D);K.insertAfter(Y);for(let G=0;G<ne;G++)Y.append(V[G])}!D.canBeEmpty()&&D.getChildrenSize()===0&&D.remove()}}};return ee.registerNodeTransform(le,_e)}function H(ee,le){const U=new Map,q=ee._pendingEditorState;for(const[_e,pe]of le._nodeMap){const ue=t.$cloneWithProperties(pe);e.$isTextNode(ue)&&(ue.__text=pe.__text),U.set(_e,ue)}q&&(q._nodeMap=U),ee._dirtyType=2;const me=le._selection;e.$setSelection(me===null?null:me.clone())}function $(ee){const le=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(le)){const{focus:j}=le,U=j.getNode(),q=j.offset;if(e.$isRootOrShadowRoot(U)){const me=U.getChildAtIndex(q);me==null?U.append(ee):me.insertBefore(ee),ee.selectNext()}else{let me,_e;e.$isTextNode(U)?(me=U.getParentOrThrow(),_e=U.getIndexWithinParent(),q>0&&(_e+=1,U.splitText(q))):(me=U,_e=q);const[,pe]=e.$splitNode(me,_e);pe.insertBefore(ee),pe.selectStart()}}else{if(le!=null){const U=le.getNodes();U[U.length-1].getTopLevelElementOrThrow().insertAfter(ee)}else e.$getRoot().append(ee);const j=e.$createParagraphNode();ee.insertAfter(j),j.select()}return ee.getLatest()}function W(ee,le){const j=le();return ee.replace(j),j.append(ee),j}function B(ee,le){return ee!==null?Object.getPrototypeOf(ee).constructor.name===le.name:!1}function z(ee,le){const j=[];for(let U=0;U<ee.length;U++){const q=le(ee[U]);q!==null&&j.push(q)}return j}function X(ee,le){const j=ee.getFirstChild();j!==null?j.insertBefore(le):ee.append(le)}return Nn.$splitNode=e.$splitNode,Nn.isHTMLAnchorElement=e.isHTMLAnchorElement,Nn.isHTMLElement=e.isHTMLElement,Nn.$dfs=O,Nn.$filter=z,Nn.$findMatchingParent=w,Nn.$getNearestBlockElementAncestorOrThrow=x,Nn.$getNearestNodeOfType=R,Nn.$insertFirst=X,Nn.$insertNodeToNearestRoot=$,Nn.$restoreEditorState=H,Nn.$wrapNodeInElement=W,Nn.addClassNamesToElement=p,Nn.isMimeType=v,Nn.markSelection=g,Nn.mediaFileReader=T,Nn.mergeRegister=n,Nn.objectKlassEquals=B,Nn.positionNodeOnRange=d,Nn.registerNestedElementResolver=P,Nn.removeClassNamesFromElement=N,Nn}var Cn={},Yf;function ZN(){if(Yf)return Cn;Yf=1;var t=Mo(),e=Bt();function n(N){let v=new URLSearchParams;v.append("code",N);for(let T=1;T<arguments.length;T++)v.append("v",arguments[T]);throw Error(`Minified Lexical error #${N}; visit https://lexical.dev/docs/error?${v} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(...N){return()=>{N.forEach(v=>v())}}let c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(N,v,T){function O(){if(x===null)throw Error("Unexpected null rootDOMNode");if(w===null)throw Error("Unexpected null parentDOMNode");let{left:B,top:z}=x.getBoundingClientRect();var X=w;let ee=t.createRectsFromDOMRange(N,v);$.isConnected||X.append($),X=!1;for(let U=0;U<ee.length;U++){var le=ee[U];let q=H[U]||document.createElement("div"),me=q.style;me.position!=="absolute"&&(me.position="absolute",X=!0);var j=`${le.left-B}px`;me.left!==j&&(me.left=j,X=!0),j=`${le.top-z}px`,me.top!==j&&(q.style.top=j,X=!0),j=`${le.width}px`,me.width!==j&&(q.style.width=j,X=!0),le=`${le.height}px`,me.height!==le&&(q.style.height=le,X=!0),q.parentNode!==$&&($.append(q),X=!0),H[U]=q}for(;H.length>ee.length;)H.pop();X&&T(H)}function b(){x=w=null,P!==null&&P.disconnect(),P=null,$.remove();for(let B of H)B.remove();H=[]}function R(){let B=N.getRootElement();if(B===null)return b();let z=B.parentElement;if(!(z instanceof HTMLElement))return b();b(),x=B,w=z,P=new MutationObserver(X=>{let ee=N.getRootElement(),le=ee&&ee.parentElement;if(ee!==x||le!==w)return R();for(let j of X)if(!$.contains(j.target))return O()}),P.observe(z,c),O()}let x=null,w=null,P=null,H=[],$=document.createElement("div"),W=N.registerRootListener(R);return()=>{W(),b()}}function g(N,v){for(let T of v)if(N.type.startsWith(T))return!0;return!1}function p(N,v){for(;N!==e.$getRoot()&&N!=null;){if(v(N))return N;N=N.getParent()}return null}return Cn.$splitNode=e.$splitNode,Cn.isHTMLAnchorElement=e.isHTMLAnchorElement,Cn.isHTMLElement=e.isHTMLElement,Cn.$dfs=function(N,v){let T=[];N=(N||e.$getRoot()).getLatest(),v=v||(e.$isElementNode(N)?N.getLastDescendant():N);for(var O=N,b=0;(O=O.getParent())!==null;)b++;for(O=b;N!==null&&!N.is(v);)if(T.push({depth:O,node:N}),e.$isElementNode(N)&&0<N.getChildrenSize())N=N.getFirstChild(),O++;else for(b=null;b===null&&N!==null;)b=N.getNextSibling(),b===null?(N=N.getParent(),O--):N=b;return N!==null&&N.is(v)&&T.push({depth:O,node:N}),T},Cn.$filter=function(N,v){let T=[];for(let O=0;O<N.length;O++){let b=v(N[O]);b!==null&&T.push(b)}return T},Cn.$findMatchingParent=p,Cn.$getNearestBlockElementAncestorOrThrow=function(N){let v=p(N,T=>e.$isElementNode(T)&&!T.isInline());return e.$isElementNode(v)||n(4,N.__key),v},Cn.$getNearestNodeOfType=function(N,v){for(;N!=null;){if(N instanceof v)return N;N=N.getParent()}return null},Cn.$insertFirst=function(N,v){let T=N.getFirstChild();T!==null?T.insertBefore(v):N.append(v)},Cn.$insertNodeToNearestRoot=function(N){var v=e.$getSelection()||e.$getPreviousSelection();if(e.$isRangeSelection(v)){var{focus:T}=v;if(v=T.getNode(),T=T.offset,e.$isRootOrShadowRoot(v))T=v.getChildAtIndex(T),T==null?v.append(N):T.insertBefore(N),N.selectNext();else{let O,b;e.$isTextNode(v)?(O=v.getParentOrThrow(),b=v.getIndexWithinParent(),0<T&&(b+=1,v.splitText(T))):(O=v,b=T),[,v]=e.$splitNode(O,b),v.insertBefore(N),v.selectStart()}}else v!=null?(v=v.getNodes(),v[v.length-1].getTopLevelElementOrThrow().insertAfter(N)):e.$getRoot().append(N),v=e.$createParagraphNode(),N.insertAfter(v),v.select();return N.getLatest()},Cn.$restoreEditorState=function(N,v){let T=new Map,O=N._pendingEditorState;for(let[b,R]of v._nodeMap){let x=t.$cloneWithProperties(R);e.$isTextNode(x)&&(x.__text=R.__text),T.set(b,x)}O&&(O._nodeMap=T),N._dirtyType=2,N=v._selection,e.$setSelection(N===null?null:N.clone())},Cn.$wrapNodeInElement=function(N,v){return v=v(),N.replace(v),v.append(N),v},Cn.addClassNamesToElement=function(N,...v){v.forEach(T=>{typeof T=="string"&&(T=T.split(" ").filter(O=>O!==""),N.classList.add(...T))})},Cn.isMimeType=g,Cn.markSelection=function(N,v){function T(P){P.read(()=>{var H=e.$getSelection();if(e.$isRangeSelection(H)){var{anchor:$,focus:W}=H;H=$.getNode();var B=H.getKey(),z=$.offset,X=W.getNode(),ee=X.getKey(),le=W.offset,j=N.getElementByKey(B),U=N.getElementByKey(ee);if(B=O===null||j===null||z!==b||B!==O.getKey()||H!==O&&(!(O instanceof e.TextNode)||H.updateDOM(O,j,N._config)),ee=R===null||U===null||le!==x||ee!==R.getKey()||X!==R&&(!(R instanceof e.TextNode)||X.updateDOM(R,U,N._config)),B||ee){j=N.getElementByKey($.getNode().getKey());var q=N.getElementByKey(W.getNode().getKey());if(j!==null&&q!==null&&j.tagName==="SPAN"&&q.tagName==="SPAN"){if(ee=document.createRange(),W.isBefore($)?(B=q,U=W.offset,q=j,j=$.offset):(B=j,U=$.offset,j=W.offset),B=B.firstChild,B===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");ee.setStart(B,U),ee.setEnd(q,j),w(),w=d(N,ee,me=>{for(let _e of me){let pe=_e.style;pe.background!=="Highlight"&&(pe.background="Highlight"),pe.color!=="HighlightText"&&(pe.color="HighlightText"),pe.zIndex!=="-1"&&(pe.zIndex="-1"),pe.pointerEvents!=="none"&&(pe.pointerEvents="none"),pe.marginTop!=="-1.5px"&&(pe.marginTop="-1.5px"),pe.paddingTop!=="4px"&&(pe.paddingTop="4px"),pe.paddingBottom!=="0px"&&(pe.paddingBottom="0px")}v!==void 0&&v(me)})}}O=H,b=z,R=X,x=le}else x=R=b=O=null,w(),w=()=>{}})}let O=null,b=null,R=null,x=null,w=()=>{};return T(N.getEditorState()),r(N.registerUpdateListener(({editorState:P})=>T(P)),w,()=>{w()})},Cn.mediaFileReader=function(N,v){let T=N[Symbol.iterator]();return new Promise((O,b)=>{let R=[],x=()=>{const{done:w,value:P}=T.next();if(w)return O(R);const H=new FileReader;H.addEventListener("error",b),H.addEventListener("load",()=>{const $=H.result;typeof $=="string"&&R.push({file:P,result:$}),x()}),g(P,v)?H.readAsDataURL(P):x()};x()})},Cn.mergeRegister=r,Cn.objectKlassEquals=function(N,v){return N!==null?Object.getPrototypeOf(N).constructor.name===v.name:!1},Cn.positionNodeOnRange=d,Cn.registerNestedElementResolver=function(N,v,T,O){return N.registerNodeTransform(v,b=>{e:{for(var R=b.getChildren(),x=0;x<R.length;x++)if(R[x]instanceof v){R=null;break e}for(R=b;R!==null;)if(x=R,R=R.getParent(),R instanceof v){R={child:x,parent:R};break e}R=null}if(R!==null){const{child:w,parent:P}=R;if(w.is(b)){if(O(P,b),b=w.getNextSiblings(),R=b.length,P.insertAfter(w),R!==0){x=T(P),w.insertAfter(x);for(let H=0;H<R;H++)x.append(b[H])}P.canBeEmpty()||P.getChildrenSize()!==0||P.remove()}}})},Cn.removeClassNamesFromElement=function(N,...v){v.forEach(T=>{typeof T=="string"&&N.classList.remove(...T.split(" "))})},Cn}var ou,jf;function on(){return jf||(jf=1,ou=process.env.NODE_ENV==="development"?qN():ZN()),ou}var su={},Vf;function JN(){if(Vf)return su;Vf=1;var t=Bt();function e(n){const r=window.location.origin,c=d=>{if(d.origin!==r)return;const g=n.getRootElement();if(document.activeElement!==g)return;const p=d.data;if(typeof p=="string"){let N;try{N=JSON.parse(p)}catch{return}if(N&&N.protocol==="nuanria_messaging"&&N.type==="request"){const v=N.payload;if(v&&v.functionId==="makeChanges"){const T=v.args;if(T){const[O,b,R,x,w,P]=T;n.update(()=>{const H=t.$getSelection();if(t.$isRangeSelection(H)){const $=H.anchor;let W=$.getNode(),B=0,z=0;if(t.$isTextNode(W)&&O>=0&&b>=0&&(B=O,z=O+b,H.setTextNodeRange(W,B,W,z)),(B!==z||R!=="")&&(H.insertRawText(R),W=$.getNode()),t.$isTextNode(W)){B=x,z=x+w;const X=W.getTextContentSize();B=B>X?X:B,z=z>X?X:z,H.setTextNodeRange(W,B,W,z)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",c,!0),()=>{window.removeEventListener("message",c,!0)}}return su.registerDragonSupport=e,su}var lu={},qf;function XN(){if(qf)return lu;qf=1;var t=Bt();return lu.registerDragonSupport=function(e){let n=window.location.origin,r=c=>{if(c.origin===n){var d=e.getRootElement();if(document.activeElement===d&&(d=c.data,typeof d=="string")){try{var g=JSON.parse(d)}catch{return}if(g&&g.protocol==="nuanria_messaging"&&g.type==="request"&&(g=g.payload)&&g.functionId==="makeChanges"&&(g=g.args)){const[p,N,v,T,O]=g;e.update(()=>{const b=t.$getSelection();if(t.$isRangeSelection(b)){var R=b.anchor;let x=R.getNode(),w=0,P=0;t.$isTextNode(x)&&0<=p&&0<=N&&(w=p,P=p+N,b.setTextNodeRange(x,w,x,P)),(w!==P||v!=="")&&(b.insertRawText(v),x=R.getNode()),t.$isTextNode(x)&&(w=T,P=T+O,R=x.getTextContentSize(),w=w>R?R:w,P=P>R?R:P,b.setTextNodeRange(x,w,x,P)),c.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},lu}var au,Zf;function vp(){return Zf||(Zf=1,au=process.env.NODE_ENV==="development"?JN():XN()),au}var ci={},Li={},ja={},Jf;function QN(){if(Jf)return ja;Jf=1;var t=Mo(),e=on(),n=Bt();function r(v,T){const O=T.body?T.body.childNodes:[];let b=[];for(let R=0;R<O.length;R++){const x=O[R];if(!p.has(x.nodeName)){const w=N(x,v);w!==null&&(b=b.concat(w))}}return b}function c(v,T){if(typeof document>"u"||typeof window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const O=document.createElement("div"),R=n.$getRoot().getChildren();for(let x=0;x<R.length;x++){const w=R[x];d(v,w,O,T)}return O.innerHTML}function d(v,T,O,b=null){let R=b!=null?T.isSelected(b):!0;const x=n.$isElementNode(T)&&T.excludeFromCopy("html");let w=T;if(b!==null){let X=t.$cloneWithProperties(T);X=n.$isTextNode(X)&&b!=null?t.$sliceSelectedTextNodeContent(b,X):X,w=X}const P=n.$isElementNode(w)?w.getChildren():[],H=v._nodes.get(w.getType());let $;H&&H.exportDOM!==void 0?$=H.exportDOM(v,w):$=w.exportDOM(v);const{element:W,after:B}=$;if(!W)return!1;const z=document.createDocumentFragment();for(let X=0;X<P.length;X++){const ee=P[X],le=d(v,ee,z,b);!R&&n.$isElementNode(T)&&le&&T.extractWithChild(ee,b,"html")&&(R=!0)}if(R&&!x){if(e.isHTMLElement(W)&&W.append(z),O.append(W),B){const X=B.call(w,W);X&&W.replaceWith(X)}}else O.append(z);return R}function g(v,T){const{nodeName:O}=v,b=T._htmlConversions.get(O.toLowerCase());let R=null;if(b!==void 0)for(const x of b){const w=x(v);w!==null&&(R===null||R.priority<w.priority)&&(R=w)}return R!==null?R.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function N(v,T,O=new Map,b){let R=[];if(p.has(v.nodeName))return R;let x=null;const w=g(v,T),P=w?w(v):null;let H=null;if(P!==null){H=P.after;const B=P.node;if(x=Array.isArray(B)?B[B.length-1]:B,x!==null){for(const[,z]of O)if(x=z(x,b),!x)break;x&&R.push(...Array.isArray(B)?B:[x])}P.forChild!=null&&O.set(v.nodeName,P.forChild)}const $=v.childNodes;let W=[];for(let B=0;B<$.length;B++)W.push(...N($[B],T,new Map(O),x));return H!=null&&(W=H(W)),x==null?R=R.concat(W):n.$isElementNode(x)&&x.append(...W),R}return ja.$generateHtmlFromNodes=c,ja.$generateNodesFromDOM=r,ja}var Va={},Xf;function eC(){if(Xf)return Va;Xf=1;var t=Mo(),e=on(),n=Bt();function r(g,p,N,v=null){let T=v!=null?p.isSelected(v):!0,O=n.$isElementNode(p)&&p.excludeFromCopy("html");var b=p;v!==null&&(b=t.$cloneWithProperties(p),b=n.$isTextNode(b)&&v!=null?t.$sliceSelectedTextNodeContent(v,b):b);let R=n.$isElementNode(b)?b.getChildren():[];var x=g._nodes.get(b.getType());x=x&&x.exportDOM!==void 0?x.exportDOM(g,b):b.exportDOM(g);let{element:w,after:P}=x;if(!w)return!1;x=document.createDocumentFragment();for(let H=0;H<R.length;H++){let $=R[H],W=r(g,$,x,v);!T&&n.$isElementNode(p)&&W&&p.extractWithChild($,v,"html")&&(T=!0)}return T&&!O?(e.isHTMLElement(w)&&w.append(x),N.append(w),P&&(g=P.call(b,w))&&w.replaceWith(g)):N.append(x),T}let c=new Set(["STYLE","SCRIPT"]);function d(g,p,N=new Map,v){let T=[];if(c.has(g.nodeName))return T;let O=null;var b,{nodeName:R}=g,x=p._htmlConversions.get(R.toLowerCase());if(R=null,x!==void 0)for(b of x)x=b(g),x!==null&&(R===null||R.priority<x.priority)&&(R=x);if(R=(b=R!==null?R.conversion:null)?b(g):null,b=null,R!==null){if(b=R.after,x=R.node,O=Array.isArray(x)?x[x.length-1]:x,O!==null){for(var[,w]of N)if(O=w(O,v),!O)break;O&&T.push(...Array.isArray(x)?x:[O])}R.forChild!=null&&N.set(g.nodeName,R.forChild)}for(g=g.childNodes,v=[],w=0;w<g.length;w++)v.push(...d(g[w],p,new Map(N),O));return b!=null&&(v=b(v)),O==null?T=T.concat(v):n.$isElementNode(O)&&O.append(...v),T}return Va.$generateHtmlFromNodes=function(g,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let N=document.createElement("div"),v=n.$getRoot().getChildren();for(let T=0;T<v.length;T++)r(g,v[T],N,p);return N.innerHTML},Va.$generateNodesFromDOM=function(g,p){p=p.body?p.body.childNodes:[];let N=[];for(let T=0;T<p.length;T++){var v=p[T];c.has(v.nodeName)||(v=d(v,g),v!==null&&(N=N.concat(v)))}return N},Va}var cu,Qf;function Sp(){return Qf||(Qf=1,cu=process.env.NODE_ENV==="development"?QN():eC()),cu}var eh;function tC(){if(eh)return Li;eh=1;var t=Sp(),e=Mo(),n=on(),r=Bt();const c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=B=>c?(B||window).getSelection():null;function g(B){const z=r.$getSelection();if(z==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(z)&&z.isCollapsed()||z.getNodes().length===0?"":t.$generateHtmlFromNodes(B,z)}function p(B){const z=r.$getSelection();if(z==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(z)&&z.isCollapsed()||z.getNodes().length===0?null:JSON.stringify(x(B,z))}function N(B,z){const X=B.getData("text/plain")||B.getData("text/uri-list");X!=null&&z.insertRawText(X)}function v(B,z,X){const ee=B.getData("application/x-lexical-editor");if(ee)try{const U=JSON.parse(ee);if(U.namespace===X._config.namespace&&Array.isArray(U.nodes)){const q=w(U.nodes);return T(X,q,z)}}catch{}const le=B.getData("text/html");if(le)try{const q=new DOMParser().parseFromString(le,"text/html"),me=t.$generateNodesFromDOM(X,q);return T(X,me,z)}catch{}const j=B.getData("text/plain")||B.getData("text/uri-list");if(j!=null)if(r.$isRangeSelection(z)){const U=j.split(/(\r?\n|\t)/);U[U.length-1]===""&&U.pop();for(let q=0;q<U.length;q++){const me=U[q];me===`
70
70
  `||me===`\r
71
- `?z.insertParagraph():me===" "?z.insertNodes([r.$createTabNode()]):z.insertText(me)}}else z.insertRawText(j)}function T(B,z,X){const ee=r.DEPRECATED_$isGridSelection(X),le=r.$isRangeSelection(X);if((ee||le&&n.$findMatchingParent(X.anchor.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null&&n.$findMatchingParent(X.focus.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null)&&z.length===1&&r.DEPRECATED_$isGridNode(z[0])){O(z,X,!1,B);return}X.insertNodes(z)}function O(B,z,X,ee){if(B.length!==1||!r.DEPRECATED_$isGridNode(B[0]))throw Error("$mergeGridNodesStrategy: Expected Grid insertion.");const le=B[0],j=le.getChildren(),U=le.getFirstChildOrThrow().getChildrenSize(),q=le.getChildrenSize(),me=n.$findMatchingParent(z.anchor.getNode(),Z=>r.DEPRECATED_$isGridCellNode(Z)),_e=me&&n.$findMatchingParent(me,Z=>r.DEPRECATED_$isGridRowNode(Z)),pe=_e&&n.$findMatchingParent(_e,Z=>r.DEPRECATED_$isGridNode(Z));if(!r.DEPRECATED_$isGridCellNode(me)||!r.DEPRECATED_$isGridRowNode(_e)||!r.DEPRECATED_$isGridNode(pe))throw Error("$mergeGridNodesStrategy: Expected selection to be inside of a Grid.");const ue=_e.getIndexWithinParent(),K=Math.min(pe.getChildrenSize()-1,ue+q-1),D=me.getIndexWithinParent(),V=Math.min(_e.getChildrenSize()-1,D+U-1),ne=Math.min(D,V),Y=Math.min(ue,K),G=Math.max(D,V),Q=Math.max(ue,K),k=pe.getChildren();let m=0,y,M;for(let Z=Y;Z<=Q;Z++){const ae=k[Z];if(!r.DEPRECATED_$isGridRowNode(ae))throw Error("getNodes: expected to find GridRowNode");const he=j[m];if(!r.DEPRECATED_$isGridRowNode(he))throw Error("getNodes: expected to find GridRowNode");const se=ae.getChildren(),Te=he.getChildren();let be=0;for(let Ue=ne;Ue<=G;Ue++){const re=se[Ue];if(!r.DEPRECATED_$isGridCellNode(re))throw Error("getNodes: expected to find GridCellNode");const te=Te[be];if(!r.DEPRECATED_$isGridCellNode(te))throw Error("getNodes: expected to find GridCellNode");Z===Y&&Ue===ne?y=re.getKey():Z===Q&&Ue===G&&(M=re.getKey());const ce=re.getChildren();te.getChildren().forEach(we=>{r.$isTextNode(we)&&r.$createParagraphNode().append(we),re.append(we)}),ce.forEach(we=>we.remove()),be++}m++}if(y&&M){const Z=r.DEPRECATED_$createGridSelection();Z.set(pe.getKey(),y,M),r.$setSelection(Z),ee.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0)}}function R(B){const z=B.exportJSON(),X=B.constructor;if(z.type!==X.getType())throw Error(`LexicalNode: Node ${X.name} does not implement .exportJSON().`);const ee=z.children;if(r.$isElementNode(B)&&!Array.isArray(ee))throw Error(`LexicalNode: Node ${X.name} is an element but .exportJSON() does not have a children array.`);return z}function b(B,z,X,ee=[]){let le=z!=null?X.isSelected(z):!0;const j=r.$isElementNode(X)&&X.excludeFromCopy("html");let U=X;if(z!==null){let _e=e.$cloneWithProperties(X);_e=r.$isTextNode(_e)&&z!=null?e.$sliceSelectedTextNodeContent(z,_e):_e,U=_e}const q=r.$isElementNode(U)?U.getChildren():[],me=R(U);if(r.$isTextNode(U)){const _e=U.__text;_e.length>0?me.text=_e:le=!1}for(let _e=0;_e<q.length;_e++){const pe=q[_e],ue=b(B,z,pe,me.children);!le&&r.$isElementNode(X)&&ue&&X.extractWithChild(pe,z,"clone")&&(le=!0)}if(le&&!j)ee.push(me);else if(Array.isArray(me.children))for(let _e=0;_e<me.children.length;_e++){const pe=me.children[_e];ee.push(pe)}return le}function x(B,z){const X=[],le=r.$getRoot().getChildren();for(let j=0;j<le.length;j++){const U=le[j];b(B,z,U,X)}return{namespace:B._config.namespace,nodes:X}}function w(B){const z=[];for(let X=0;X<B.length;X++){const ee=B[X],le=r.$parseSerializedNode(ee);r.$isTextNode(le)&&e.$addNodeStyle(le),z.push(le)}return z}const $=50;let W=null;async function P(B,z){if(W!==null)return!1;if(z!==null)return new Promise((q,me)=>{B.update(()=>{q(H(B,z))})});const X=B.getRootElement(),ee=B._window==null?window.document:B._window.document,le=d(B._window);if(X===null||le===null)return!1;const j=ee.createElement("span");j.style.cssText="position: fixed; top: -1000px;",j.append(ee.createTextNode("#")),X.append(j);const U=new Range;return U.setStart(j,0),U.setEnd(j,1),le.removeAllRanges(),le.addRange(U),new Promise((q,me)=>{const _e=B.registerCommand(r.COPY_COMMAND,pe=>(n.objectKlassEquals(pe,ClipboardEvent)&&(_e(),W!==null&&(window.clearTimeout(W),W=null),q(H(B,pe))),!0),r.COMMAND_PRIORITY_CRITICAL);W=window.setTimeout(()=>{_e(),W=null,q(!1)},$),ee.execCommand("copy"),j.remove()})}function H(B,z){const X=d(B._window);if(!X)return!1;const ee=X.anchorNode,le=X.focusNode;if(ee!==null&&le!==null&&!r.isSelectionWithinEditor(B,ee,le))return!1;z.preventDefault();const j=z.clipboardData,U=r.$getSelection();if(j===null||U===null)return!1;const q=g(B),me=p(B);let _e="";return U!==null&&(_e=U.getTextContent()),q!==null&&j.setData("text/html",q),me!==null&&j.setData("application/x-lexical-editor",me),j.setData("text/plain",_e),!0}return Li.$generateJSONFromSelectedNodes=x,Li.$generateNodesFromSerializedNodes=w,Li.$getHtmlContent=g,Li.$getLexicalContent=p,Li.$insertDataTransferForPlainText=C,Li.$insertDataTransferForRichText=v,Li.$insertGeneratedNodes=T,Li.copyToClipboard=P,Li}var ki={},th;function nC(){if(th)return ki;th=1;var t=Sp(),e=Mo(),n=on(),r=Bt();function c(w){let $=new URLSearchParams;$.append("code",w);for(let W=1;W<arguments.length;W++)$.append("v",arguments[W]);throw Error(`Minified Lexical error #${w}; visit https://lexical.dev/docs/error?${$} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g(w){let $=r.$getSelection();if($==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection($)&&$.isCollapsed()||$.getNodes().length===0?"":t.$generateHtmlFromNodes(w,$)}function p(w){let $=r.$getSelection();if($==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection($)&&$.isCollapsed()||$.getNodes().length===0?null:JSON.stringify(O(w,$))}function C(w,$,W){let P=r.DEPRECATED_$isGridSelection(W),H=r.$isRangeSelection(W);(P||H&&n.$findMatchingParent(W.anchor.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null&&n.$findMatchingParent(W.focus.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null)&&$.length===1&&r.DEPRECATED_$isGridNode($[0])?v($,W,!1,w):W.insertNodes($)}function v(w,$,W,P){w.length===1&&r.DEPRECATED_$isGridNode(w[0])||c(42);var H=w[0];w=H.getChildren(),W=H.getFirstChildOrThrow().getChildrenSize();var B=H.getChildrenSize(),z=n.$findMatchingParent($.anchor.getNode(),me=>r.DEPRECATED_$isGridCellNode(me));$=(H=z&&n.$findMatchingParent(z,me=>r.DEPRECATED_$isGridRowNode(me)))&&n.$findMatchingParent(H,me=>r.DEPRECATED_$isGridNode(me)),r.DEPRECATED_$isGridCellNode(z)&&r.DEPRECATED_$isGridRowNode(H)&&r.DEPRECATED_$isGridNode($)||c(43);var X=H.getIndexWithinParent(),ee=Math.min($.getChildrenSize()-1,X+B-1);B=z.getIndexWithinParent(),z=Math.min(H.getChildrenSize()-1,B+W-1),W=Math.min(B,z),H=Math.min(X,ee),B=Math.max(B,z),X=Math.max(X,ee),ee=$.getChildren(),z=0;let le,j;for(let me=H;me<=X;me++){var U=ee[me];r.DEPRECATED_$isGridRowNode(U)||c(24);var q=w[z];r.DEPRECATED_$isGridRowNode(q)||c(24),U=U.getChildren(),q=q.getChildren();let _e=0;for(let pe=W;pe<=B;pe++){let ue=U[pe];r.DEPRECATED_$isGridCellNode(ue)||c(25);let K=q[_e];r.DEPRECATED_$isGridCellNode(K)||c(25),me===H&&pe===W?le=ue.getKey():me===X&&pe===B&&(j=ue.getKey());let D=ue.getChildren();K.getChildren().forEach(V=>{r.$isTextNode(V)&&r.$createParagraphNode().append(V),ue.append(V)}),D.forEach(V=>V.remove()),_e++}z++}le&&j&&(w=r.DEPRECATED_$createGridSelection(),w.set($.getKey(),le,j),r.$setSelection(w),P.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0))}function T(w,$,W,P=[]){let H=$!=null?W.isSelected($):!0,B=r.$isElementNode(W)&&W.excludeFromCopy("html");var z=W;if($!==null){var X=e.$cloneWithProperties(W);z=X=r.$isTextNode(X)&&$!=null?e.$sliceSelectedTextNodeContent($,X):X}let ee=r.$isElementNode(z)?z.getChildren():[];var le=z;X=le.exportJSON();var j=le.constructor;X.type!==j.getType()&&c(58,j.name);let U=X.children;for(r.$isElementNode(le)&&(Array.isArray(U)||c(59,j.name)),r.$isTextNode(z)&&(z=z.__text,0<z.length?X.text=z:H=!1),z=0;z<ee.length;z++)le=ee[z],j=T(w,$,le,X.children),!H&&r.$isElementNode(W)&&j&&W.extractWithChild(le,$,"clone")&&(H=!0);if(H&&!B)P.push(X);else if(Array.isArray(X.children))for(w=0;w<X.children.length;w++)P.push(X.children[w]);return H}function O(w,$){let W=[],P=r.$getRoot().getChildren();for(let H=0;H<P.length;H++)T(w,$,P[H],W);return{namespace:w._config.namespace,nodes:W}}function R(w){let $=[];for(let W=0;W<w.length;W++){let P=r.$parseSerializedNode(w[W]);r.$isTextNode(P)&&e.$addNodeStyle(P),$.push(P)}return $}let b=null;function x(w,$){var W=d?(w._window||window).getSelection():null;if(!W)return!1;var P=W.anchorNode;if(W=W.focusNode,P!==null&&W!==null&&!r.isSelectionWithinEditor(w,P,W)||($.preventDefault(),$=$.clipboardData,P=r.$getSelection(),$===null||P===null))return!1;W=g(w),w=p(w);let H="";return P!==null&&(H=P.getTextContent()),W!==null&&$.setData("text/html",W),w!==null&&$.setData("application/x-lexical-editor",w),$.setData("text/plain",H),!0}return ki.$generateJSONFromSelectedNodes=O,ki.$generateNodesFromSerializedNodes=R,ki.$getHtmlContent=g,ki.$getLexicalContent=p,ki.$insertDataTransferForPlainText=function(w,$){w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null&&$.insertRawText(w)},ki.$insertDataTransferForRichText=function(w,$,W){var P=w.getData("application/x-lexical-editor");if(P)try{let B=JSON.parse(P);if(B.namespace===W._config.namespace&&Array.isArray(B.nodes)){let z=R(B.nodes);return C(W,z,$)}}catch{}if(P=w.getData("text/html"))try{var H=new DOMParser().parseFromString(P,"text/html");let B=t.$generateNodesFromDOM(W,H);return C(W,B,$)}catch{}if(w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null)if(r.$isRangeSelection($))for(w=w.split(/(\r?\n|\t)/),w[w.length-1]===""&&w.pop(),W=0;W<w.length;W++)H=w[W],H===`
72
- `||H===`\r
73
- `?$.insertParagraph():H===" "?$.insertNodes([r.$createTabNode()]):$.insertText(H);else $.insertRawText(w)},ki.$insertGeneratedNodes=C,ki.copyToClipboard=async function(w,$){if(b!==null)return!1;if($!==null)return new Promise(z=>{w.update(()=>{z(x(w,$))})});var W=w.getRootElement();let P=w._window==null?window.document:w._window.document,H=d?(w._window||window).getSelection():null;if(W===null||H===null)return!1;let B=P.createElement("span");return B.style.cssText="position: fixed; top: -1000px;",B.append(P.createTextNode("#")),W.append(B),W=new Range,W.setStart(B,0),W.setEnd(B,1),H.removeAllRanges(),H.addRange(W),new Promise(z=>{let X=w.registerCommand(r.COPY_COMMAND,ee=>(n.objectKlassEquals(ee,ClipboardEvent)&&(X(),b!==null&&(window.clearTimeout(b),b=null),z(x(w,ee))),!0),r.COMMAND_PRIORITY_CRITICAL);b=window.setTimeout(()=>{X(),b=null,z(!1)},50),P.execCommand("copy"),B.remove()})},ki}var uu,nh;function wp(){return nh||(nh=1,uu=process.env.NODE_ENV==="development"?tC():nC()),uu}var rh;function rC(){if(rh)return ci;rh=1;var t=wp(),e=Mo(),n=on(),r=Bt();function c(_e,pe){if(typeof document.caretRangeFromPoint<"u"){const ue=document.caretRangeFromPoint(_e,pe);return ue===null?null:{node:ue.startContainer,offset:ue.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const ue=document.caretPositionFromPoint(_e,pe);return ue===null?null:{node:ue.offsetNode,offset:ue.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,C=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),v=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,R=r.createCommand("DRAG_DROP_PASTE_FILE");class b extends r.ElementNode{static getType(){return"quote"}static clone(pe){return new b(pe.__key)}constructor(pe){super(pe)}createDOM(pe){const ue=document.createElement("blockquote");return n.addClassNamesToElement(ue,pe.theme.quote),ue}updateDOM(pe,ue){return!1}static importDOM(){return{blockquote:pe=>({conversion:H,priority:0})}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const K=this.getFormatType();ue.style.textAlign=K;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=x();return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(pe,ue){const K=r.$createParagraphNode(),D=this.getDirection();return K.setDirection(D),this.insertAfter(K,ue),K}collapseAtStart(){const pe=r.$createParagraphNode();return this.getChildren().forEach(K=>pe.append(K)),this.replace(pe),!0}}function x(){return r.$applyNodeReplacement(new b)}function w(_e){return _e instanceof b}class $ extends r.ElementNode{static getType(){return"heading"}static clone(pe){return new $(pe.__tag,pe.__key)}constructor(pe,ue){super(ue),this.__tag=pe}getTag(){return this.__tag}createDOM(pe){const ue=this.__tag,K=document.createElement(ue),V=pe.theme.heading;if(V!==void 0){const ne=V[ue];n.addClassNamesToElement(K,ne)}return K}updateDOM(pe,ue){return!1}static importDOM(){return{h1:pe=>({conversion:P,priority:0}),h2:pe=>({conversion:P,priority:0}),h3:pe=>({conversion:P,priority:0}),h4:pe=>({conversion:P,priority:0}),h5:pe=>({conversion:P,priority:0}),h6:pe=>({conversion:P,priority:0}),p:pe=>{const K=pe.firstChild;return K!==null&&W(K)?{conversion:()=>({node:null}),priority:3}:null},span:pe=>W(pe)?{conversion:ue=>({node:B("h1")}),priority:3}:null}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const K=this.getFormatType();ue.style.textAlign=K;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=B(pe.tag);return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(pe,ue=!0){const K=pe?pe.anchor.offset:0,D=K===this.getTextContentSize()||!pe?r.$createParagraphNode():B(this.getTag()),V=this.getDirection();if(D.setDirection(V),this.insertAfter(D,ue),K===0&&!this.isEmpty()&&pe){const ne=r.$createParagraphNode();ne.select(),this.replace(ne,!0)}return D}collapseAtStart(){const pe=this.isEmpty()?r.$createParagraphNode():B(this.getTag());return this.getChildren().forEach(K=>pe.append(K)),this.replace(pe),!0}extractWithChild(){return!0}}function W(_e){return _e.nodeName.toLowerCase()==="span"?_e.style.fontSize==="26pt":!1}function P(_e){const pe=_e.nodeName.toLowerCase();let ue=null;return(pe==="h1"||pe==="h2"||pe==="h3"||pe==="h4"||pe==="h5"||pe==="h6")&&(ue=B(pe),_e.style!==null&&ue.setFormat(_e.style.textAlign)),{node:ue}}function H(_e){const pe=x();return _e.style!==null&&pe.setFormat(_e.style.textAlign),{node:pe}}function B(_e){return r.$applyNodeReplacement(new $(_e))}function z(_e){return _e instanceof $}function X(_e,pe){_e.preventDefault(),pe.update(()=>{const ue=r.$getSelection(),K=_e instanceof InputEvent||_e instanceof KeyboardEvent?null:_e.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(ue)&&t.$insertDataTransferForRichText(K,ue,pe)},{tag:"paste"})}async function ee(_e,pe){await t.copyToClipboard(pe,n.objectKlassEquals(_e,ClipboardEvent)?_e:null),pe.update(()=>{const ue=r.$getSelection();r.$isRangeSelection(ue)?ue.removeText():r.$isNodeSelection(ue)&&ue.getNodes().forEach(K=>K.remove())})}function le(_e){let pe=null;if(_e instanceof DragEvent?pe=_e.dataTransfer:_e instanceof ClipboardEvent&&(pe=_e.clipboardData),pe===null)return[!1,[],!1];const ue=pe.types,K=ue.includes("Files"),D=ue.includes("text/html")||ue.includes("text/plain");return[K,Array.from(pe.files),D]}function j(_e){const pe=r.$getSelection();if(!r.$isRangeSelection(pe))return!1;const ue=new Set,K=pe.getNodes();for(let D=0;D<K.length;D++){const V=K[D],ne=V.getKey();if(ue.has(ne))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(V),G=Y.getKey();Y.canIndent()&&!ue.has(G)&&(ue.add(G),_e(Y))}return ue.size>0}function U(_e){const pe=r.$getNearestNodeFromDOMNode(_e);return r.$isDecoratorNode(pe)}function q(_e){const pe=_e.focus;return pe.key==="root"&&pe.offset===r.$getRoot().getChildrenSize()}function me(_e){return n.mergeRegister(_e.registerCommand(r.CLICK_COMMAND,ue=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),_e.registerCommand(r.DELETE_CHARACTER_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_WORD_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_LINE_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,ue=>{const K=r.$getSelection();if(typeof ue=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(ue);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const D=ue.dataTransfer;if(D!=null)t.$insertDataTransferForRichText(D,K,_e);else if(r.$isRangeSelection(K)){const V=ue.data;return V&&K.insertText(V),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_TEXT_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_ELEMENT_COMMAND,ue=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const D=K.getNodes();for(const V of D){const ne=n.$findMatchingParent(V,Y=>r.$isElementNode(Y)&&!Y.isInline());ne!==null&&ne.setFormat(ue)}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_LINE_BREAK_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INDENT_CONTENT_COMMAND,()=>j(ue=>{const K=ue.getIndent();ue.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>j(ue=>{const K=ue.getIndent();K>0&&ue.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_UP_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!U(ue.target)){const D=K.getNodes();if(D.length>0)return D[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const D=r.$getAdjacentNode(K.focus,!0);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectPrevious(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_DOWN_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return D[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return ue.preventDefault(),!0;const D=r.$getAdjacentNode(K.focus,!1);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectNext(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_LEFT_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return ue.preventDefault(),D[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(e.$shouldOverrideDefaultCharacterSelection(K,!0)){const D=ue.shiftKey;return ue.preventDefault(),e.$moveCharacter(K,D,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!U(ue.target)){const V=K.getNodes();if(V.length>0)return ue.preventDefault(),V[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const D=ue.shiftKey;return e.$shouldOverrideDefaultCharacterSelection(K,!1)?(ue.preventDefault(),e.$moveCharacter(K,D,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_BACKSPACE_COMMAND,ue=>{if(U(ue.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;ue.preventDefault();const{anchor:D}=K,V=D.getNode();return K.isCollapsed()&&D.offset===0&&!r.$isRootNode(V)&&n.$getNearestBlockElementAncestorOrThrow(V).getIndent()>0?_e.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_DELETE_COMMAND,ue=>{if(U(ue.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(ue.preventDefault(),_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ENTER_COMMAND,ue=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(ue!==null){if((v||C||O)&&p)return!1;if(ue.preventDefault(),ue.shiftKey)return _e.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return _e.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(_e.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DROP_COMMAND,ue=>{const[,K]=le(ue);if(K.length>0){const V=ue.clientX,ne=ue.clientY,Y=c(V,ne);if(Y!==null){const{offset:G,node:Q}=Y,k=r.$getNearestNodeFromDOMNode(Q);if(k!==null){const m=r.$createRangeSelection();if(r.$isTextNode(k))m.anchor.set(k.getKey(),G,"text"),m.focus.set(k.getKey(),G,"text");else{const M=k.getParentOrThrow().getKey(),Z=k.getIndexWithinParent()+1;m.anchor.set(M,Z,"element"),m.focus.set(M,Z,"element")}const y=r.$normalizeSelection__EXPERIMENTAL(m);r.$setSelection(y)}_e.dispatchCommand(R,K)}return ue.preventDefault(),!0}const D=r.$getSelection();return!!r.$isRangeSelection(D)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGSTART_COMMAND,ue=>{const[K]=le(ue),D=r.$getSelection();return!(K&&!r.$isRangeSelection(D))},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGOVER_COMMAND,ue=>{const[K]=le(ue),D=r.$getSelection();if(K&&!r.$isRangeSelection(D))return!1;const V=ue.clientX,ne=ue.clientY,Y=c(V,ne);if(Y!==null){const G=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(G)&&ue.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.COPY_COMMAND,ue=>(t.copyToClipboard(_e,n.objectKlassEquals(ue,ClipboardEvent)?ue:null),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CUT_COMMAND,ue=>(ee(ue,_e),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.PASTE_COMMAND,ue=>{const[,K,D]=le(ue);if(K.length>0&&!D)return _e.dispatchCommand(R,K),!0;if(r.isSelectionCapturedInDecoratorInput(ue.target))return!1;const V=r.$getSelection();return r.$INTERNAL_isPointSelection(V)?(X(ue,_e),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ci.$createHeadingNode=B,ci.$createQuoteNode=x,ci.$isHeadingNode=z,ci.$isQuoteNode=w,ci.DRAG_DROP_PASTE=R,ci.HeadingNode=$,ci.QuoteNode=b,ci.eventFiles=le,ci.registerRichText=me,ci}var ui={},ih;function iC(){if(ih)return ui;ih=1;var t=wp(),e=Mo(),n=on(),r=Bt();function c(j,U){return typeof document.caretRangeFromPoint<"u"?(j=document.caretRangeFromPoint(j,U),j===null?null:{node:j.startContainer,offset:j.startOffset}):document.caretPositionFromPoint!=="undefined"?(j=document.caretPositionFromPoint(j,U),j===null?null:{node:j.offsetNode,offset:j.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,C=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),v=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,R=r.createCommand("DRAG_DROP_PASTE_FILE");class b extends r.ElementNode{static getType(){return"quote"}static clone(U){return new b(U.__key)}constructor(U){super(U)}createDOM(U){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,U.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:P,priority:0})}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=x();return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(U,q){U=r.$createParagraphNode();let me=this.getDirection();return U.setDirection(me),this.insertAfter(U,q),U}collapseAtStart(){let U=r.$createParagraphNode();return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}}function x(){return r.$applyNodeReplacement(new b)}class w extends r.ElementNode{static getType(){return"heading"}static clone(U){return new w(U.__tag,U.__key)}constructor(U,q){super(q),this.__tag=U}getTag(){return this.__tag}createDOM(U){let q=this.__tag,me=document.createElement(q);return U=U.theme.heading,U!==void 0&&n.addClassNamesToElement(me,U[q]),me}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:W,priority:0}),h2:()=>({conversion:W,priority:0}),h3:()=>({conversion:W,priority:0}),h4:()=>({conversion:W,priority:0}),h5:()=>({conversion:W,priority:0}),h6:()=>({conversion:W,priority:0}),p:U=>(U=U.firstChild,U!==null&&$(U)?{conversion:()=>({node:null}),priority:3}:null),span:U=>$(U)?{conversion:()=>({node:H("h1")}),priority:3}:null}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=H(U.tag);return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(U,q=!0){let me=U?U.anchor.offset:0,_e=me!==this.getTextContentSize()&&U?H(this.getTag()):r.$createParagraphNode(),pe=this.getDirection();return _e.setDirection(pe),this.insertAfter(_e,q),me===0&&!this.isEmpty()&&U&&(U=r.$createParagraphNode(),U.select(),this.replace(U,!0)),_e}collapseAtStart(){let U=this.isEmpty()?r.$createParagraphNode():H(this.getTag());return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}extractWithChild(){return!0}}function $(j){return j.nodeName.toLowerCase()==="span"?j.style.fontSize==="26pt":!1}function W(j){let U=j.nodeName.toLowerCase(),q=null;return(U==="h1"||U==="h2"||U==="h3"||U==="h4"||U==="h5"||U==="h6")&&(q=H(U),j.style!==null&&q.setFormat(j.style.textAlign)),{node:q}}function P(j){let U=x();return j.style!==null&&U.setFormat(j.style.textAlign),{node:U}}function H(j){return r.$applyNodeReplacement(new w(j))}function B(j,U){j.preventDefault(),U.update(()=>{let q=r.$getSelection(),me=j instanceof InputEvent||j instanceof KeyboardEvent?null:j.clipboardData;me!=null&&r.$INTERNAL_isPointSelection(q)&&t.$insertDataTransferForRichText(me,q,U)},{tag:"paste"})}async function z(j,U){await t.copyToClipboard(U,n.objectKlassEquals(j,ClipboardEvent)?j:null),U.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(me=>me.remove())})}function X(j){let U=null;if(j instanceof DragEvent?U=j.dataTransfer:j instanceof ClipboardEvent&&(U=j.clipboardData),U===null)return[!1,[],!1];var q=U.types;return j=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[j,Array.from(U.files),q]}function ee(j){var U=r.$getSelection();if(!r.$isRangeSelection(U))return!1;let q=new Set;U=U.getNodes();for(let pe=0;pe<U.length;pe++){var me=U[pe],_e=me.getKey();q.has(_e)||(me=n.$getNearestBlockElementAncestorOrThrow(me),_e=me.getKey(),me.canIndent()&&!q.has(_e)&&(q.add(_e),j(me)))}return 0<q.size}function le(j){return j=r.$getNearestNodeFromDOMNode(j),r.$isDecoratorNode(j)}return ui.$createHeadingNode=H,ui.$createQuoteNode=x,ui.$isHeadingNode=function(j){return j instanceof w},ui.$isQuoteNode=function(j){return j instanceof b},ui.DRAG_DROP_PASTE=R,ui.HeadingNode=w,ui.QuoteNode=b,ui.eventFiles=X,ui.registerRichText=function(j){return n.mergeRegister(j.registerCommand(r.CLICK_COMMAND,()=>{const U=r.$getSelection();return r.$isNodeSelection(U)?(U.clear(),!0):!1},0),j.registerCommand(r.DELETE_CHARACTER_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_WORD_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_LINE_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,U=>{const q=r.$getSelection();if(typeof U=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(U);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const me=U.dataTransfer;me!=null?t.$insertDataTransferForRichText(me,q,j):r.$isRangeSelection(q)&&(U=U.data)&&q.insertText(U)}return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_TEXT_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_ELEMENT_COMMAND,U=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const me of q)q=n.$findMatchingParent(me,_e=>r.$isElementNode(_e)&&!_e.isInline()),q!==null&&q.setFormat(U);return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_LINE_BREAK_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INDENT_CONTENT_COMMAND,()=>ee(U=>{const q=U.getIndent();U.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>ee(U=>{const q=U.getIndent();0<q&&U.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_UP_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){if(U=q.getNodes(),0<U.length)return U[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),U.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_DOWN_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(U=q.getNodes(),0<U.length)return U[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let me=q.focus;if(me.key==="root"&&me.offset===r.$getRoot().getChildrenSize())return U.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),U.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_LEFT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&e.$shouldOverrideDefaultCharacterSelection(q,!0)?(me=U.shiftKey,U.preventDefault(),e.$moveCharacter(q,me,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(me=U.shiftKey,e.$shouldOverrideDefaultCharacterSelection(q,!1)?(U.preventDefault(),e.$moveCharacter(q,me,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_BACKSPACE_COMMAND,U=>{if(le(U.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;U.preventDefault(),{anchor:U}=q;const me=U.getNode();return q.isCollapsed()&&U.offset===0&&!r.$isRootNode(me)&&0<n.$getNearestBlockElementAncestorOrThrow(me).getIndent()?j.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_DELETE_COMMAND,U=>{if(le(U.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(U.preventDefault(),j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ENTER_COMMAND,U=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(U!==null){if((v||C||O)&&p)return!1;if(U.preventDefault(),U.shiftKey)return j.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return j.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(j.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DROP_COMMAND,U=>{const[,q]=X(U);if(0<q.length){var me=c(U.clientX,U.clientY);if(me!==null){const{offset:pe,node:ue}=me;var _e=r.$getNearestNodeFromDOMNode(ue);if(_e!==null){if(me=r.$createRangeSelection(),r.$isTextNode(_e))me.anchor.set(_e.getKey(),pe,"text"),me.focus.set(_e.getKey(),pe,"text");else{const K=_e.getParentOrThrow().getKey();_e=_e.getIndexWithinParent()+1,me.anchor.set(K,_e,"element"),me.focus.set(K,_e,"element")}me=r.$normalizeSelection__EXPERIMENTAL(me),r.$setSelection(me)}j.dispatchCommand(R,q)}return U.preventDefault(),!0}return U=r.$getSelection(),!!r.$isRangeSelection(U)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGSTART_COMMAND,U=>{[U]=X(U);const q=r.$getSelection();return!(U&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGOVER_COMMAND,U=>{var[q]=X(U);const me=r.$getSelection();return q&&!r.$isRangeSelection(me)?!1:(q=c(U.clientX,U.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&U.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.COPY_COMMAND,U=>(t.copyToClipboard(j,n.objectKlassEquals(U,ClipboardEvent)?U:null),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CUT_COMMAND,U=>(z(U,j),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.PASTE_COMMAND,U=>{const[,q,me]=X(U);if(0<q.length&&!me)return j.dispatchCommand(R,q),!0;if(r.isSelectionCapturedInDecoratorInput(U.target))return!1;const _e=r.$getSelection();return r.$INTERNAL_isPointSelection(_e)?(B(U,j),!0):!1},r.COMMAND_PRIORITY_EDITOR))},ui}var du,oh;function md(){return oh||(oh=1,du=process.env.NODE_ENV==="development"?rC():iC()),du}var sh;function oC(){if(sh)return Qc;sh=1;var t=Un(),e=Tp(),n=et,r=xp(),c=on(),d=ld,g=vp(),p=md(),T=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function O(W){return W.getEditorState().read(r.$canShowPlaceholderCurry(W.isComposing()))}function R(W){const[P,H]=n.useState(()=>O(W));return T(()=>{function B(){const z=O(W);H(z)}return B(),c.mergeRegister(W.registerUpdateListener(()=>{B()}),W.registerEditableListener(()=>{B()}))},[W]),P}function b(W,P){const[H,B]=n.useState(()=>W.getDecorators());return T(()=>W.registerDecoratorListener(z=>{d.flushSync(()=>{B(z)})}),[W]),n.useEffect(()=>{B(W.getDecorators())},[W]),n.useMemo(()=>{const z=[],X=Object.keys(H);for(let ee=0;ee<X.length;ee++){const le=X[ee],j=n.createElement(P,{onError:q=>W._onError(q)},n.createElement(n.Suspense,{fallback:null},H[le])),U=W.getElementByKey(le);U!==null&&z.push(d.createPortal(j,U,le))}return z},[P,H,W])}function x(W){T(()=>c.mergeRegister(p.registerRichText(W),g.registerDragonSupport(W)),[W])}function w({contentEditable:W,placeholder:P,ErrorBoundary:H}){const[B]=t.useLexicalComposerContext(),z=b(B,H);return x(B),n.createElement(n.Fragment,null,W,n.createElement($,{content:P}),z)}function $({content:W}){const[P]=t.useLexicalComposerContext(),H=R(P),B=e();return H?typeof W=="function"?W(B):W:null}return Qc.RichTextPlugin=w,Qc}var fu={},lh;function sC(){if(lh)return fu;lh=1;var t=Un(),e=Tp(),n=et,r=xp(),c=on(),d=ld,g=vp(),p=md(),C=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function v(x){return x.getEditorState().read(r.$canShowPlaceholderCurry(x.isComposing()))}function T(x){let[w,$]=n.useState(()=>v(x));return C(()=>{function W(){let P=v(x);$(P)}return W(),c.mergeRegister(x.registerUpdateListener(()=>{W()}),x.registerEditableListener(()=>{W()}))},[x]),w}function O(x,w){let[$,W]=n.useState(()=>x.getDecorators());return C(()=>x.registerDecoratorListener(P=>{d.flushSync(()=>{W(P)})}),[x]),n.useEffect(()=>{W(x.getDecorators())},[x]),n.useMemo(()=>{let P=[],H=Object.keys($);for(let B=0;B<H.length;B++){let z=H[B],X=n.createElement(w,{onError:le=>x._onError(le)},n.createElement(n.Suspense,{fallback:null},$[z])),ee=x.getElementByKey(z);ee!==null&&P.push(d.createPortal(X,ee,z))}return P},[w,$,x])}function R(x){C(()=>c.mergeRegister(p.registerRichText(x),g.registerDragonSupport(x)),[x])}function b({content:x}){var[w]=t.useLexicalComposerContext();w=T(w);let $=e();return w?typeof x=="function"?x($):x:null}return fu.RichTextPlugin=function({contentEditable:x,placeholder:w,ErrorBoundary:$}){let[W]=t.useLexicalComposerContext();return $=O(W,$),R(W),n.createElement(n.Fragment,null,x,n.createElement(b,{content:w}),$)},fu}const lC=process.env.NODE_ENV==="development"?oC():sC();var aC=lC,hu={},ah;function cC(){if(ah)return hu;ah=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var C=1;C<arguments.length;C++){var v=arguments[C];for(var T in v)Object.prototype.hasOwnProperty.call(v,T)&&(p[T]=v[T])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function g({ariaActiveDescendant:p,ariaAutoComplete:C,ariaControls:v,ariaDescribedBy:T,ariaExpanded:O,ariaLabel:R,ariaLabelledBy:b,ariaMultiline:x,ariaOwns:w,ariaRequired:$,autoCapitalize:W,className:P,id:H,role:B="textbox",spellCheck:z=!0,style:X,tabIndex:ee,"data-testid":le,...j}){const[U]=t.useLexicalComposerContext(),[q,me]=e.useState(!1),_e=e.useCallback(pe=>{U.setRootElement(pe)},[U]);return d(()=>(me(U.isEditable()),U.registerEditableListener(pe=>{me(pe)})),[U]),e.createElement("div",n({},j,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?C:"none","aria-controls":q?v:void 0,"aria-describedby":T,"aria-expanded":q&&B==="combobox"?!!O:void 0,"aria-label":R,"aria-labelledby":b,"aria-multiline":x,"aria-owns":q?w:void 0,"aria-readonly":q?void 0:!0,"aria-required":$,autoCapitalize:W,className:P,contentEditable:q,"data-testid":le,id:H,ref:_e,role:B,spellCheck:z,style:X,tabIndex:ee}))}return hu.ContentEditable=g,hu}var gu={},ch;function uC(){if(ch)return gu;ch=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(c){for(var d=1;d<arguments.length;d++){var g=arguments[d],p;for(p in g)Object.prototype.hasOwnProperty.call(g,p)&&(c[p]=g[p])}return c},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;return gu.ContentEditable=function({ariaActiveDescendant:c,ariaAutoComplete:d,ariaControls:g,ariaDescribedBy:p,ariaExpanded:C,ariaLabel:v,ariaLabelledBy:T,ariaMultiline:O,ariaOwns:R,ariaRequired:b,autoCapitalize:x,className:w,id:$,role:W="textbox",spellCheck:P=!0,style:H,tabIndex:B,"data-testid":z,...X}){let[ee]=t.useLexicalComposerContext(),[le,j]=e.useState(!1),U=e.useCallback(q=>{ee.setRootElement(q)},[ee]);return r(()=>(j(ee.isEditable()),ee.registerEditableListener(q=>{j(q)})),[ee]),e.createElement("div",n({},X,{"aria-activedescendant":le?c:void 0,"aria-autocomplete":le?d:"none","aria-controls":le?g:void 0,"aria-describedby":p,"aria-expanded":le&&W==="combobox"?!!C:void 0,"aria-label":v,"aria-labelledby":T,"aria-multiline":O,"aria-owns":le?R:void 0,"aria-readonly":le?void 0:!0,"aria-required":b,autoCapitalize:x,className:w,contentEditable:le,"data-testid":z,id:$,ref:U,role:W,spellCheck:P,style:H,tabIndex:B}))},gu}const dC=process.env.NODE_ENV==="development"?cC():uC();var fC=dC,pu,uh;function hC(){if(uh)return pu;uh=1;var t=et;function e(p,C){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,O){return T.__proto__=O,T},e(p,C)}function n(p,C){p.prototype=Object.create(C.prototype),p.prototype.constructor=p,e(p,C)}var r=function(C,v){return C===void 0&&(C=[]),v===void 0&&(v=[]),C.length!==v.length||C.some(function(T,O){return!Object.is(T,v[O])})},c={error:null},d=function(p){n(C,p);function C(){for(var T,O=arguments.length,R=new Array(O),b=0;b<O;b++)R[b]=arguments[b];return T=p.call.apply(p,[this].concat(R))||this,T.state=c,T.resetErrorBoundary=function(){for(var x,w=arguments.length,$=new Array(w),W=0;W<w;W++)$[W]=arguments[W];T.props.onReset==null||(x=T.props).onReset.apply(x,$),T.reset()},T}C.getDerivedStateFromError=function(O){return{error:O}};var v=C.prototype;return v.reset=function(){this.setState(c)},v.componentDidCatch=function(O,R){var b,x;(b=(x=this.props).onError)==null||b.call(x,O,R)},v.componentDidUpdate=function(O,R){var b=this.state.error,x=this.props.resetKeys;if(b!==null&&R.error!==null&&r(O.resetKeys,x)){var w,$;(w=($=this.props).onResetKeysChange)==null||w.call($,O.resetKeys,x),this.reset()}},v.render=function(){var O=this.state.error,R=this.props,b=R.fallbackRender,x=R.FallbackComponent,w=R.fallback;if(O!==null){var $={error:O,resetErrorBoundary:this.resetErrorBoundary};if(t.isValidElement(w))return w;if(typeof b=="function")return b($);if(x)return t.createElement(x,$);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},C}(t.Component);function g({children:p,onError:C}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:C},p)}return pu=g,pu}var mu,dh;function gC(){if(dh)return mu;dh=1;var t=et;function e(g,p){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,v){return C.__proto__=v,C},e(g,p)}function n(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,e(g,p)}function r(g,p){return g===void 0&&(g=[]),p===void 0&&(p=[]),g.length!==p.length||g.some(function(C,v){return!Object.is(C,p[v])})}var c={error:null},d=function(g){function p(){for(var v,T=arguments.length,O=Array(T),R=0;R<T;R++)O[R]=arguments[R];return v=g.call.apply(g,[this].concat(O))||this,v.state=c,v.resetErrorBoundary=function(){for(var b,x=arguments.length,w=Array(x),$=0;$<x;$++)w[$]=arguments[$];v.props.onReset==null||(b=v.props).onReset.apply(b,w),v.reset()},v}n(p,g),p.getDerivedStateFromError=function(v){return{error:v}};var C=p.prototype;return C.reset=function(){this.setState(c)},C.componentDidCatch=function(v,T){var O,R;(O=(R=this.props).onError)==null||O.call(R,v,T)},C.componentDidUpdate=function(v,T){var O=this.props.resetKeys;if(this.state.error!==null&&T.error!==null&&r(v.resetKeys,O)){var R,b;(R=(b=this.props).onResetKeysChange)==null||R.call(b,v.resetKeys,O),this.reset()}},C.render=function(){var v=this.state.error,T=this.props,O=T.fallbackRender,R=T.FallbackComponent;if(T=T.fallback,v!==null){if(v={error:v,resetErrorBoundary:this.resetErrorBoundary},t.isValidElement(T))return T;if(typeof O=="function")return O(v);if(R)return t.createElement(R,v);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(t.Component);return mu=function({children:g,onError:p}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},g)},mu}const pC=process.env.NODE_ENV==="development"?hC():gC();var mC=pC;const _C=ad(mC);var _u={},rr={},fh;function yC(){if(fh)return rr;fh=1;var t=Bt(),e=on();function n(Y){let G=1,Q=Y.getParent();for(;Q!=null;){if(le(Q)){const k=Q.getParent();if(ue(k)){G++,Q=k.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return G}return G}function r(Y){let G=Y.getParent();if(!ue(G))throw Error("A ListItemNode must have a ListNode for a parent.");let Q=G;for(;Q!==null;)Q=Q.getParent(),ue(Q)&&(G=Q);return G}function c(Y){let G=[];const Q=Y.getChildren().filter(le);for(let k=0;k<Q.length;k++){const m=Q[k],y=m.getFirstChild();ue(y)?G=G.concat(c(y)):G.push(m)}return G}function d(Y){return le(Y)&&ue(Y.getFirstChild())}function g(Y){let G=Y;for(;G.getNextSibling()==null&&G.getPreviousSibling()==null;){const Q=G.getParent();if(Q==null||!(le(G)||ue(G)))break;G=Q}G.remove()}function p(Y){return ee().append(Y)}function C(Y,G){return le(Y)&&(G.length===0||G.length===1&&Y.is(G[0])&&Y.getChildrenSize()===0)}function v(Y){const G=Y.getParent();let Q=1;if(G!=null)if(ue(G))Q=G.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const k=Y.getPreviousSiblings();for(let m=0;m<k.length;m++){const y=k[m];le(y)&&!ue(y.getFirstChild())&&Q++}return Q}function T(Y,G){Y.update(()=>{const Q=t.$getSelection();if(t.$INTERNAL_isPointSelection(Q)){const k=Q.getNodes(),y=Q.anchor.getNode(),M=y.getParent();if(C(y,k)){const Z=pe(G);if(t.$isRootOrShadowRoot(M)){y.replace(Z);const ae=ee();t.$isElementNode(y)&&(ae.setFormat(y.getFormatType()),ae.setIndent(y.getIndent())),Z.append(ae)}else if(le(y)){const ae=y.getParentOrThrow();O(Z,ae.getChildren()),ae.replace(Z)}return}else{const Z=new Set;for(let ae=0;ae<k.length;ae++){const he=k[ae];if(t.$isElementNode(he)&&he.isEmpty()&&!le(he)&&!Z.has(he.getKey())){R(he,G);continue}if(t.$isLeafNode(he)){let se=he.getParent();for(;se!=null;){const Te=se.getKey();if(ue(se)){if(!Z.has(Te)){const be=pe(G);O(be,se.getChildren()),se.replace(be),w(be),Z.add(Te)}break}else{const be=se.getParent();if(t.$isRootOrShadowRoot(be)&&!Z.has(Te)){Z.add(Te),R(se,G);break}se=be}}}}}}})}function O(Y,G){Y.splice(Y.getChildrenSize(),0,G)}function R(Y,G){if(ue(Y))return Y;const Q=Y.getPreviousSibling(),k=Y.getNextSibling(),m=ee();if(m.setFormat(Y.getFormatType()),m.setIndent(Y.getIndent()),O(m,Y.getChildren()),ue(Q)&&G===Q.getListType())return Q.append(m),Y.remove(),ue(k)&&G===k.getListType()&&(O(Q,k.getChildren()),k.remove()),Q;if(ue(k)&&G===k.getListType())return k.getFirstChildOrThrow().insertBefore(m),Y.remove(),k;{const y=pe(G);return y.append(m),Y.replace(y),w(y),y}}function b(Y,G){const Q=Y.getLastChild(),k=G.getFirstChild();Q&&k&&d(Q)&&d(k)&&(b(Q.getFirstChild(),k.getFirstChild()),k.remove());const m=G.getChildren();m.length>0&&(Y.append(...m),w(Y)),G.remove()}function x(Y){Y.update(()=>{const G=t.$getSelection();if(t.$isRangeSelection(G)){const Q=new Set,k=G.getNodes(),m=G.anchor.getNode();if(C(m,k))Q.add(r(m));else for(let y=0;y<k.length;y++){const M=k[y];if(t.$isLeafNode(M)){const Z=e.$getNearestNodeOfType(M,H);Z!=null&&Q.add(r(Z))}}for(const y of Q){let M=y;const Z=c(y);for(const ae of Z){const he=t.$createParagraphNode();O(he,ae.getChildren()),M.insertAfter(he),M=he,ae.__key===G.anchor.key&&G.anchor.set(he.getKey(),0,"element"),ae.__key===G.focus.key&&G.focus.set(he.getKey(),0,"element"),ae.remove()}y.remove()}}})}function w(Y,G){const Q=G||Y.getChildren();if(Q!==void 0)for(let k=0;k<Q.length;k++){const m=Q[k];if(le(m)){const y=m.getValue(),M=v(m);y!==M&&m.setValue(M)}}}function $(Y){const G=new Set;if(d(Y)||G.has(Y.getKey()))return;const Q=Y.getParent(),k=Y.getNextSibling(),m=Y.getPreviousSibling();if(d(k)&&d(m)){const y=m.getFirstChild();if(ue(y)){y.append(Y);const M=k.getFirstChild();if(ue(M)){const Z=M.getChildren();O(y,Z),k.remove(),G.add(k.getKey())}w(y)}}else if(d(k)){const y=k.getFirstChild();if(ue(y)){const M=y.getFirstChild();M!==null&&M.insertBefore(Y),w(y)}}else if(d(m)){const y=m.getFirstChild();ue(y)&&(y.append(Y),w(y))}else if(ue(Q)){const y=ee(),M=pe(Q.getListType());y.append(M),M.append(Y),m?m.insertAfter(y):k?k.insertBefore(y):Q.append(y),w(M)}ue(Q)&&w(Q)}function W(Y){if(d(Y))return;const G=Y.getParent(),Q=G?G.getParent():void 0,k=Q?Q.getParent():void 0;if(ue(k)&&le(Q)&&ue(G)){const m=G?G.getFirstChild():void 0,y=G?G.getLastChild():void 0;if(Y.is(m))Q.insertBefore(Y),G.isEmpty()&&Q.remove();else if(Y.is(y))Q.insertAfter(Y),G.isEmpty()&&Q.remove();else{const M=G.getListType(),Z=ee(),ae=pe(M);Z.append(ae),Y.getPreviousSiblings().forEach(Te=>ae.append(Te));const he=ee(),se=pe(M);he.append(se),O(se,Y.getNextSiblings()),Q.insertBefore(Z),Q.insertAfter(he),Q.replace(Y)}w(G),w(k)}}function P(){const Y=t.$getSelection();if(!t.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const G=Y.anchor.getNode();if(!le(G)||G.getChildrenSize()!==0)return!1;const Q=r(G),k=G.getParent();if(!ue(k))throw Error("A ListItemNode must have a ListNode for a parent.");const m=k.getParent();let y;if(t.$isRootOrShadowRoot(m))y=t.$createParagraphNode(),Q.insertAfter(y);else if(le(m))y=ee(),m.insertAfter(y);else return!1;y.select();const M=G.getNextSiblings();if(M.length>0){const Z=pe(k.getListType());if(t.$isParagraphNode(y))y.insertAfter(Z);else{const ae=ee();ae.append(Z),y.insertAfter(ae)}M.forEach(ae=>{ae.remove(),Z.append(ae)})}return g(G),!0}class H extends t.ElementNode{static getType(){return"listitem"}static clone(G){return new H(G.__value,G.__checked,G.__key)}constructor(G,Q,k){super(k),this.__value=G===void 0?1:G,this.__checked=Q}createDOM(G){const Q=document.createElement("li"),k=this.getParent();return ue(k)&&k.getListType()==="check"&&z(Q,this,null),Q.value=this.__value,B(Q,G.theme,this),Q}updateDOM(G,Q,k){const m=this.getParent();return ue(m)&&m.getListType()==="check"&&z(Q,this,G),Q.value=this.__value,B(Q,k.theme,this),!1}static transform(){return G=>{const Q=G.getParent();ue(Q)&&(w(Q),Q.getListType()!=="check"&&G.getChecked()!=null&&G.setChecked(void 0))}}static importDOM(){return{li:G=>({conversion:X,priority:0})}}static importJSON(G){const Q=ee();return Q.setChecked(G.checked),Q.setValue(G.value),Q.setFormat(G.format),Q.setDirection(G.direction),Q}exportDOM(G){const Q=this.createDOM(G._config);return Q.style.textAlign=this.getFormatType(),{element:Q}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(t.$isElementNode(k)&&this.canMergeWith(k)){const m=k.getChildren();this.append(...m),k.remove()}else super.append(k)}return this}replace(G,Q){if(le(G))return super.replace(G);this.setIndent(0);const k=this.getParentOrThrow();if(!ue(k))return G;if(k.__first===this.getKey())k.insertBefore(G);else if(k.__last===this.getKey())k.insertAfter(G);else{const m=pe(k.getListType());let y=this.getNextSibling();for(;y;){const M=y;y=y.getNextSibling(),m.append(M)}k.insertAfter(G),G.insertAfter(m)}return Q&&this.getChildren().forEach(m=>{G.append(m)}),this.remove(),k.getChildrenSize()===0&&k.remove(),G}insertAfter(G,Q=!0){const k=this.getParentOrThrow();if(!ue(k))throw Error("insertAfter: list node is not parent of list item node");const m=this.getNextSiblings();if(le(G)){const y=super.insertAfter(G,Q),M=G.getParentOrThrow();return ue(M)&&w(M),y}if(ue(G)){let y=G;const M=G.getChildren();for(let Z=M.length-1;Z>=0;Z--)y=M[Z],this.insertAfter(y,Q);return y}if(k.insertAfter(G,Q),m.length!==0){const y=pe(k.getListType());m.forEach(M=>y.append(M)),G.insertAfter(y,Q)}return G}remove(G){const Q=this.getPreviousSibling(),k=this.getNextSibling();if(super.remove(G),Q&&k&&d(Q)&&d(k))b(Q.getFirstChild(),k.getFirstChild()),k.remove();else if(k){const m=k.getParent();ue(m)&&w(m)}}insertNewAfter(G,Q=!0){const k=ee(this.__checked==null?void 0:!1);return this.insertAfter(k,Q),k}collapseAtStart(G){const Q=t.$createParagraphNode();this.getChildren().forEach(Z=>Q.append(Z));const m=this.getParentOrThrow(),y=m.getParentOrThrow(),M=le(y);if(m.getChildrenSize()===1)if(M)m.remove(),y.select();else{m.insertBefore(Q),m.remove();const Z=G.anchor,ae=G.focus,he=Q.getKey();Z.type==="element"&&Z.getNode().is(this)&&Z.set(he,Z.offset,"element"),ae.type==="element"&&ae.getNode().is(this)&&ae.set(he,ae.offset,"element")}else m.insertBefore(Q),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(G){const Q=this.getWritable();Q.__value=G}getChecked(){return this.getLatest().__checked}setChecked(G){const Q=this.getWritable();Q.__checked=G}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const G=this.getParent();if(G===null)return this.getLatest().__indent;let Q=G.getParentOrThrow(),k=0;for(;le(Q);)Q=Q.getParentOrThrow().getParentOrThrow(),k++;return k}setIndent(G){if(!(typeof G=="number"&&G>-1))throw Error("Invalid indent value.");let Q=this.getIndent();for(;Q!==G;)Q<G?($(this),Q++):(W(this),Q--);return this}insertBefore(G){if(le(G)){const Q=this.getParentOrThrow();if(ue(Q)){const k=this.getNextSiblings();w(Q,k)}}return super.insertBefore(G)}canInsertAfter(G){return le(G)}canReplaceWith(G){return le(G)}canMergeWith(G){return t.$isParagraphNode(G)||le(G)}extractWithChild(G,Q){if(!t.$isRangeSelection(Q))return!1;const k=Q.anchor.getNode(),m=Q.focus.getNode();return this.isParentOf(k)&&this.isParentOf(m)&&this.getTextContent().length===Q.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return pe("bullet")}}function B(Y,G,Q){const k=[],m=[],y=G.list,M=y?y.listitem:void 0;let Z;if(y&&y.nested&&(Z=y.nested.listitem),M!==void 0){const ae=M.split(" ");k.push(...ae)}if(y){const ae=Q.getParent(),he=ue(ae)&&ae.getListType()==="check",se=Q.getChecked();(!he||se)&&m.push(y.listitemUnchecked),(!he||!se)&&m.push(y.listitemChecked),he&&k.push(se?y.listitemChecked:y.listitemUnchecked)}if(Z!==void 0){const ae=Z.split(" ");Q.getChildren().some(he=>ue(he))?k.push(...ae):m.push(...ae)}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function z(Y,G,Q,k){ue(G.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!Q||G.__checked!==Q.__checked)&&Y.setAttribute("aria-checked",G.getChecked()?"true":"false"))}function X(Y){const G=e.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:ee(G)}}function ee(Y){return t.$applyNodeReplacement(new H(void 0,Y))}function le(Y){return Y instanceof H}class j extends t.ElementNode{static getType(){return"list"}static clone(G){const Q=G.__listType||_e[G.__tag];return new j(Q,G.__start,G.__key)}constructor(G,Q,k){super(k);const m=_e[G]||G;this.__listType=m,this.__tag=m==="number"?"ol":"ul",this.__start=Q}getTag(){return this.__tag}setListType(G){const Q=this.getWritable();Q.__listType=G,Q.__tag=G==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(G,Q){const k=this.__tag,m=document.createElement(k);return this.__start!==1&&m.setAttribute("start",String(this.__start)),m.__lexicalListType=this.__listType,U(m,G.theme,this),m}updateDOM(G,Q,k){return G.__tag!==this.__tag?!0:(U(Q,k.theme,this),!1)}static importDOM(){return{ol:G=>({conversion:me,priority:0}),ul:G=>({conversion:me,priority:0})}}static importJSON(G){const Q=pe(G.listType,G.start);return Q.setFormat(G.format),Q.setIndent(G.indent),Q.setDirection(G.direction),Q}exportDOM(G){const{element:Q}=super.exportDOM(G);return Q&&e.isHTMLElement(Q)&&(this.__start!==1&&Q.setAttribute("start",String(this.__start)),this.__listType==="check"&&Q.setAttribute("__lexicalListType","check")),{element:Q}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(le(k))super.append(k);else{const m=ee();if(ue(k))m.append(k);else if(t.$isElementNode(k)){const y=t.$createTextNode(k.getTextContent());m.append(y)}else m.append(k);super.append(m)}}return w(this),this}extractWithChild(G){return le(G)}}function U(Y,G,Q){const k=[],m=[],y=G.list;if(y!==void 0){const M=y[`${Q.__tag}Depth`]||[],Z=n(Q)-1,ae=Z%M.length,he=M[ae],se=y[Q.__tag];let Te;const be=y.nested;if(be!==void 0&&be.list&&(Te=be.list),se!==void 0&&k.push(se),he!==void 0){const Ue=he.split(" ");k.push(...Ue);for(let re=0;re<M.length;re++)re!==ae&&m.push(Q.__tag+re)}if(Te!==void 0){const Ue=Te.split(" ");Z>1?k.push(...Ue):m.push(...Ue)}}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function q(Y){const G=[];for(let Q=0;Q<Y.length;Q++){const k=Y[Q];if(le(k)){G.push(k);const m=k.getChildren();m.length>1&&m.forEach(y=>{ue(y)&&G.push(p(y))})}else G.push(p(k))}return G}function me(Y){const G=Y.nodeName.toLowerCase();let Q=null;if(G==="ol"){const k=Y.start;Q=pe("number",k)}else G==="ul"&&(e.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?Q=pe("check"):Q=pe("bullet"));return{after:q,node:Q}}const _e={ol:"number",ul:"bullet"};function pe(Y,G=1){return t.$applyNodeReplacement(new j(Y,G))}function ue(Y){return Y instanceof j}const K=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),D=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),V=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ne=t.createCommand("REMOVE_LIST_COMMAND");return rr.$createListItemNode=ee,rr.$createListNode=pe,rr.$getListDepth=n,rr.$handleListInsertParagraph=P,rr.$isListItemNode=le,rr.$isListNode=ue,rr.INSERT_CHECK_LIST_COMMAND=V,rr.INSERT_ORDERED_LIST_COMMAND=D,rr.INSERT_UNORDERED_LIST_COMMAND=K,rr.ListItemNode=H,rr.ListNode=j,rr.REMOVE_LIST_COMMAND=ne,rr.insertList=T,rr.removeList=x,rr}var ir={},hh;function NC(){if(hh)return ir;hh=1;var t=Bt(),e=on();function n(K){let D=new URLSearchParams;D.append("code",K);for(let V=1;V<arguments.length;V++)D.append("v",arguments[V]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${D} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let D=1;for(K=K.getParent();K!=null;){if(B(K)){if(K=K.getParent(),q(K)){D++,K=K.getParent();continue}n(40)}break}return D}function c(K){K=K.getParent(),q(K)||n(40);let D=K;for(;D!==null;)D=D.getParent(),q(D)&&(K=D);return K}function d(K){let D=[];K=K.getChildren().filter(B);for(let V=0;V<K.length;V++){let ne=K[V],Y=ne.getFirstChild();q(Y)?D=D.concat(d(Y)):D.push(ne)}return D}function g(K){return B(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let D=K.getParent();if(D==null||!B(K)&&!q(K))break;K=D}K.remove()}function C(K){return H().append(K)}function v(K,D){return B(K)&&(D.length===0||D.length===1&&K.is(D[0])&&K.getChildrenSize()===0)}function T(K,D){K.splice(K.getChildrenSize(),0,D)}function O(K,D){if(q(K))return K;let V=K.getPreviousSibling(),ne=K.getNextSibling(),Y=H();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),T(Y,K.getChildren()),q(V)&&D===V.getListType()?(V.append(Y),K.remove(),q(ne)&&D===ne.getListType()&&(T(V,ne.getChildren()),ne.remove()),V):q(ne)&&D===ne.getListType()?(ne.getFirstChildOrThrow().insertBefore(Y),K.remove(),ne):(D=U(D),D.append(Y),K.replace(D),b(D),D)}function R(K,D){var V=K.getLastChild();let ne=D.getFirstChild();V&&ne&&g(V)&&g(ne)&&(R(V.getFirstChild(),ne.getFirstChild()),ne.remove()),V=D.getChildren(),0<V.length&&(K.append(...V),b(K)),D.remove()}function b(K,D){if(K=D||K.getChildren(),K!==void 0)for(D=0;D<K.length;D++){let G=K[D];if(B(G)){let Q=G.getValue();var V=G,ne=V.getParent(),Y=1;for(ne!=null&&(q(ne)?Y=ne.getStart():n(44)),V=V.getPreviousSiblings(),ne=0;ne<V.length;ne++){let k=V[ne];B(k)&&!q(k.getFirstChild())&&Y++}Q!==Y&&G.setValue(Y)}}}function x(K){if(!g(K)){var D=K.getParent(),V=D?D.getParent():void 0,ne=V?V.getParent():void 0;if(q(ne)&&B(V)&&q(D)){var Y=D?D.getFirstChild():void 0,G=D?D.getLastChild():void 0;if(K.is(Y))V.insertBefore(K),D.isEmpty()&&V.remove();else if(K.is(G))V.insertAfter(K),D.isEmpty()&&V.remove();else{var Q=D.getListType();Y=H();let k=U(Q);Y.append(k),K.getPreviousSiblings().forEach(m=>k.append(m)),G=H(),Q=U(Q),G.append(Q),T(Q,K.getNextSiblings()),V.insertBefore(Y),V.insertAfter(G),V.replace(K)}b(D),b(ne)}}}class w extends t.ElementNode{static getType(){return"listitem"}static clone(D){return new w(D.__value,D.__checked,D.__key)}constructor(D,V,ne){super(ne),this.__value=D===void 0?1:D,this.__checked=V}createDOM(D){let V=document.createElement("li"),ne=this.getParent();return q(ne)&&ne.getListType()==="check"&&W(V,this,null),V.value=this.__value,$(V,D.theme,this),V}updateDOM(D,V,ne){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&W(V,this,D),V.value=this.__value,$(V,ne.theme,this),!1}static transform(){return D=>{let V=D.getParent();q(V)&&(b(V),V.getListType()!=="check"&&D.getChecked()!=null&&D.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:P,priority:0})}}static importJSON(D){let V=H();return V.setChecked(D.checked),V.setValue(D.value),V.setFormat(D.format),V.setDirection(D.direction),V}exportDOM(D){return D=this.createDOM(D._config),D.style.textAlign=this.getFormatType(),{element:D}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...D){for(let V=0;V<D.length;V++){let ne=D[V];if(t.$isElementNode(ne)&&this.canMergeWith(ne)){let Y=ne.getChildren();this.append(...Y),ne.remove()}else super.append(ne)}return this}replace(D,V){if(B(D))return super.replace(D);this.setIndent(0);let ne=this.getParentOrThrow();if(!q(ne))return D;if(ne.__first===this.getKey())ne.insertBefore(D);else if(ne.__last===this.getKey())ne.insertAfter(D);else{let Y=U(ne.getListType()),G=this.getNextSibling();for(;G;){let Q=G;G=G.getNextSibling(),Y.append(Q)}ne.insertAfter(D),D.insertAfter(Y)}return V&&this.getChildren().forEach(Y=>{D.append(Y)}),this.remove(),ne.getChildrenSize()===0&&ne.remove(),D}insertAfter(D,V=!0){var ne=this.getParentOrThrow();q(ne)||n(39);var Y=this.getNextSiblings();if(B(D))return V=super.insertAfter(D,V),D=D.getParentOrThrow(),q(D)&&b(D),V;if(q(D)){for(ne=D,D=D.getChildren(),Y=D.length-1;0<=Y;Y--)ne=D[Y],this.insertAfter(ne,V);return ne}if(ne.insertAfter(D,V),Y.length!==0){let G=U(ne.getListType());Y.forEach(Q=>G.append(Q)),D.insertAfter(G,V)}return D}remove(D){let V=this.getPreviousSibling(),ne=this.getNextSibling();super.remove(D),V&&ne&&g(V)&&g(ne)?(R(V.getFirstChild(),ne.getFirstChild()),ne.remove()):ne&&(D=ne.getParent(),q(D)&&b(D))}insertNewAfter(D,V=!0){return D=H(this.__checked==null?void 0:!1),this.insertAfter(D,V),D}collapseAtStart(D){let V=t.$createParagraphNode();this.getChildren().forEach(Q=>V.append(Q));var ne=this.getParentOrThrow(),Y=ne.getParentOrThrow();let G=B(Y);return ne.getChildrenSize()===1?G?(ne.remove(),Y.select()):(ne.insertBefore(V),ne.remove(),ne=D.anchor,D=D.focus,Y=V.getKey(),ne.type==="element"&&ne.getNode().is(this)&&ne.set(Y,ne.offset,"element"),D.type==="element"&&D.getNode().is(this)&&D.set(Y,D.offset,"element")):(ne.insertBefore(V),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(D){this.getWritable().__value=D}getChecked(){return this.getLatest().__checked}setChecked(D){this.getWritable().__checked=D}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var D=this.getParent();if(D===null)return this.getLatest().__indent;D=D.getParentOrThrow();let V=0;for(;B(D);)D=D.getParentOrThrow().getParentOrThrow(),V++;return V}setIndent(D){typeof D=="number"&&-1<D||n(117);let V=this.getIndent();for(;V!==D;)if(V<D){e:{var ne=new Set;if(g(this)||ne.has(this.getKey()))break e;let k=this.getParent();var Y=this.getNextSibling(),G=this.getPreviousSibling();if(g(Y)&&g(G)){if(G=G.getFirstChild(),q(G)){G.append(this);var Q=Y.getFirstChild();q(Q)&&(Q=Q.getChildren(),T(G,Q),Y.remove(),ne.add(Y.getKey())),b(G)}}else g(Y)?(Y=Y.getFirstChild(),q(Y)&&(ne=Y.getFirstChild(),ne!==null&&ne.insertBefore(this),b(Y))):g(G)?(Y=G.getFirstChild(),q(Y)&&(Y.append(this),b(Y))):q(k)&&(ne=H(),Q=U(k.getListType()),ne.append(Q),Q.append(this),G?G.insertAfter(ne):Y?Y.insertBefore(ne):k.append(ne),b(Q));q(k)&&b(k)}V++}else x(this),V--;return this}insertBefore(D){if(B(D)){let V=this.getParentOrThrow();if(q(V)){let ne=this.getNextSiblings();b(V,ne)}}return super.insertBefore(D)}canInsertAfter(D){return B(D)}canReplaceWith(D){return B(D)}canMergeWith(D){return t.$isParagraphNode(D)||B(D)}extractWithChild(D,V){if(!t.$isRangeSelection(V))return!1;D=V.anchor.getNode();let ne=V.focus.getNode();return this.isParentOf(D)&&this.isParentOf(ne)&&this.getTextContent().length===V.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return U("bullet")}}function $(K,D,V){let ne=[],Y=[];var G=(D=D.list)?D.listitem:void 0;if(D&&D.nested)var Q=D.nested.listitem;if(G!==void 0&&(G=G.split(" "),ne.push(...G)),D){G=V.getParent(),G=q(G)&&G.getListType()==="check";let k=V.getChecked();G&&!k||Y.push(D.listitemUnchecked),G&&k||Y.push(D.listitemChecked),G&&ne.push(k?D.listitemChecked:D.listitemUnchecked)}Q!==void 0&&(Q=Q.split(" "),V.getChildren().some(k=>q(k))?ne.push(...Q):Y.push(...Q)),0<Y.length&&e.removeClassNamesFromElement(K,...Y),0<ne.length&&e.addClassNamesToElement(K,...ne)}function W(K,D,V){q(D.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),V&&D.__checked===V.__checked||K.setAttribute("aria-checked",D.getChecked()?"true":"false"))}function P(K){return K=e.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:H(K)}}function H(K){return t.$applyNodeReplacement(new w(void 0,K))}function B(K){return K instanceof w}class z extends t.ElementNode{static getType(){return"list"}static clone(D){return new z(D.__listType||j[D.__tag],D.__start,D.__key)}constructor(D,V,ne){super(ne),this.__listType=D=j[D]||D,this.__tag=D==="number"?"ol":"ul",this.__start=V}getTag(){return this.__tag}setListType(D){let V=this.getWritable();V.__listType=D,V.__tag=D==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(D){let V=document.createElement(this.__tag);return this.__start!==1&&V.setAttribute("start",String(this.__start)),V.__lexicalListType=this.__listType,X(V,D.theme,this),V}updateDOM(D,V,ne){return D.__tag!==this.__tag?!0:(X(V,ne.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:le,priority:0}),ul:()=>({conversion:le,priority:0})}}static importJSON(D){let V=U(D.listType,D.start);return V.setFormat(D.format),V.setIndent(D.indent),V.setDirection(D.direction),V}exportDOM(D){return{element:D}=super.exportDOM(D),D&&e.isHTMLElement(D)&&(this.__start!==1&&D.setAttribute("start",String(this.__start)),this.__listType==="check"&&D.setAttribute("__lexicalListType","check")),{element:D}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...D){for(let ne=0;ne<D.length;ne++){var V=D[ne];if(B(V))super.append(V);else{let Y=H();q(V)||t.$isElementNode(V)&&(V=t.$createTextNode(V.getTextContent())),Y.append(V),super.append(Y)}}return b(this),this}extractWithChild(D){return B(D)}}function X(K,D,V){let ne=[],Y=[];var G=D.list;if(G!==void 0){let k=G[`${V.__tag}Depth`]||[];D=r(V)-1;let m=D%k.length;var Q=k[m];let y=G[V.__tag],M;if(G=G.nested,G!==void 0&&G.list&&(M=G.list),y!==void 0&&ne.push(y),Q!==void 0)for(Q=Q.split(" "),ne.push(...Q),Q=0;Q<k.length;Q++)Q!==m&&Y.push(V.__tag+Q);M!==void 0&&(V=M.split(" "),1<D?ne.push(...V):Y.push(...V))}0<Y.length&&e.removeClassNamesFromElement(K,...Y),0<ne.length&&e.addClassNamesToElement(K,...ne)}function ee(K){let D=[];for(let ne=0;ne<K.length;ne++){var V=K[ne];B(V)?(D.push(V),V=V.getChildren(),1<V.length&&V.forEach(Y=>{q(Y)&&D.push(C(Y))})):D.push(C(V))}return D}function le(K){let D=K.nodeName.toLowerCase(),V=null;return D==="ol"?V=U("number",K.start):D==="ul"&&(V=e.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?U("check"):U("bullet")),{after:ee,node:V}}let j={ol:"number",ul:"bullet"};function U(K,D=1){return t.$applyNodeReplacement(new z(K,D))}function q(K){return K instanceof z}let me=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),_e=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),pe=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ue=t.createCommand("REMOVE_LIST_COMMAND");return ir.$createListItemNode=H,ir.$createListNode=U,ir.$getListDepth=r,ir.$handleListInsertParagraph=function(){var K=t.$getSelection();if(!t.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!B(K)||K.getChildrenSize()!==0))return!1;var D=c(K),V=K.getParent();q(V)||n(40);let ne=V.getParent(),Y;if(t.$isRootOrShadowRoot(ne))Y=t.$createParagraphNode(),D.insertAfter(Y);else if(B(ne))Y=H(),ne.insertAfter(Y);else return!1;if(Y.select(),D=K.getNextSiblings(),0<D.length){let G=U(V.getListType());t.$isParagraphNode(Y)?Y.insertAfter(G):(V=H(),V.append(G),Y.insertAfter(V)),D.forEach(Q=>{Q.remove(),G.append(Q)})}return p(K),!0},ir.$isListItemNode=B,ir.$isListNode=q,ir.INSERT_CHECK_LIST_COMMAND=pe,ir.INSERT_ORDERED_LIST_COMMAND=_e,ir.INSERT_UNORDERED_LIST_COMMAND=me,ir.ListItemNode=w,ir.ListNode=z,ir.REMOVE_LIST_COMMAND=ue,ir.insertList=function(K,D){K.update(()=>{var V=t.$getSelection();if(t.$INTERNAL_isPointSelection(V)){var ne=V.getNodes();V=V.anchor.getNode();var Y=V.getParent();if(v(V,ne))ne=U(D),t.$isRootOrShadowRoot(Y)?(V.replace(ne),Y=H(),t.$isElementNode(V)&&(Y.setFormat(V.getFormatType()),Y.setIndent(V.getIndent())),ne.append(Y)):B(V)&&(V=V.getParentOrThrow(),T(ne,V.getChildren()),V.replace(ne));else for(V=new Set,Y=0;Y<ne.length;Y++){var G=ne[Y];if(t.$isElementNode(G)&&G.isEmpty()&&!B(G)&&!V.has(G.getKey()))O(G,D);else if(t.$isLeafNode(G))for(G=G.getParent();G!=null;){let k=G.getKey();if(q(G)){if(!V.has(k)){var Q=U(D);T(Q,G.getChildren()),G.replace(Q),b(Q),V.add(k)}break}else{if(Q=G.getParent(),t.$isRootOrShadowRoot(Q)&&!V.has(k)){V.add(k),O(G,D);break}G=Q}}}}})},ir.removeList=function(K){K.update(()=>{let D=t.$getSelection();if(t.$isRangeSelection(D)){var V=new Set,ne=D.getNodes(),Y=D.anchor.getNode();if(v(Y,ne))V.add(c(Y));else for(Y=0;Y<ne.length;Y++){var G=ne[Y];t.$isLeafNode(G)&&(G=e.$getNearestNodeOfType(G,w),G!=null&&V.add(c(G)))}for(let Q of V){V=Q,ne=d(Q);for(let k of ne)ne=t.$createParagraphNode(),T(ne,k.getChildren()),V.insertAfter(ne),V=ne,k.__key===D.anchor.key&&D.anchor.set(ne.getKey(),0,"element"),k.__key===D.focus.key&&D.focus.set(ne.getKey(),0,"element"),k.remove();Q.remove()}}})},ir}var yu,gh;function _d(){return gh||(gh=1,yu=process.env.NODE_ENV==="development"?yC():NC()),yu}var ph;function CC(){if(ph)return _u;ph=1;var t=_d(),e=Un(),n=et,r=on(),c=Bt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(p,"number"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(p,"bullet"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(p),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[p])}function g(){const[p]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([t.ListNode,t.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return _u.ListPlugin=g,_u}var Nu={},mh;function EC(){if(mh)return Nu;mh=1;var t=_d(),e=Un(),n=et,r=on(),c=Bt();function d(g){n.useEffect(()=>r.mergeRegister(g.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(g,"number"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(g,"bullet"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(g),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[g])}return Nu.ListPlugin=function(){let[g]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!g.hasNodes([t.ListNode,t.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[g]),d(g),null},Nu}const TC=process.env.NODE_ENV==="development"?CC():EC();var xC=TC,Cu={},Ii={},_h;function vC(){if(_h)return Ii;_h=1;var t=on(),e=Bt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(x){return new r(x.__url,{rel:x.__rel,target:x.__target,title:x.__title},x.__key)}constructor(x,w={},$){super($);const{target:W=null,rel:P=null,title:H=null}=w;this.__url=x,this.__target=W,this.__rel=P,this.__title=H}createDOM(x){const w=document.createElement("a");return w.href=this.sanitizeUrl(this.__url),this.__target!==null&&(w.target=this.__target),this.__rel!==null&&(w.rel=this.__rel),this.__title!==null&&(w.title=this.__title),t.addClassNamesToElement(w,x.theme.link),w}updateDOM(x,w,$){const W=this.__url,P=this.__target,H=this.__rel,B=this.__title;return W!==x.__url&&(w.href=W),P!==x.__target&&(P?w.target=P:w.removeAttribute("target")),H!==x.__rel&&(H?w.rel=H:w.removeAttribute("rel")),B!==x.__title&&(B?w.title=B:w.removeAttribute("title")),!1}static importDOM(){return{a:x=>({conversion:c,priority:1})}}static importJSON(x){const w=d(x.url,{rel:x.rel,target:x.target,title:x.title});return w.setFormat(x.format),w.setIndent(x.indent),w.setDirection(x.direction),w}sanitizeUrl(x){try{const w=new URL(x);if(!n.has(w.protocol))return"about:blank"}catch{return x}return x}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(x){const w=this.getWritable();w.__url=x}getTarget(){return this.getLatest().__target}setTarget(x){const w=this.getWritable();w.__target=x}getRel(){return this.getLatest().__rel}setRel(x){const w=this.getWritable();w.__rel=x}getTitle(){return this.getLatest().__title}setTitle(x){const w=this.getWritable();w.__title=x}insertNewAfter(x,w=!0){const $=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter($,w),$}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(x,w,$){if(!e.$isRangeSelection(w))return!1;const W=w.anchor.getNode(),P=w.focus.getNode();return this.isParentOf(W)&&this.isParentOf(P)&&w.getTextContent().length>0}}function c(b){let x=null;if(t.isHTMLAnchorElement(b)){const w=b.textContent;(w!==null&&w!==""||b.children.length>0)&&(x=d(b.getAttribute("href")||"",{rel:b.getAttribute("rel"),target:b.getAttribute("target"),title:b.getAttribute("title")}))}return{node:x}}function d(b,x){return e.$applyNodeReplacement(new r(b,x))}function g(b){return b instanceof r}class p extends r{static getType(){return"autolink"}static clone(x){return new p(x.__url,{rel:x.__rel,target:x.__target,title:x.__title},x.__key)}static importJSON(x){const w=C(x.url,{rel:x.rel,target:x.target,title:x.title});return w.setFormat(x.format),w.setIndent(x.indent),w.setDirection(x.direction),w}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(x,w=!0){const $=this.getParentOrThrow().insertNewAfter(x,w);if(e.$isElementNode($)){const W=C(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return $.append(W),W}return null}}function C(b,x){return e.$applyNodeReplacement(new p(b,x))}function v(b){return b instanceof p}const T=e.createCommand("TOGGLE_LINK_COMMAND");function O(b,x={}){const{target:w,title:$}=x,W=x.rel===void 0?"noreferrer":x.rel,P=e.$getSelection();if(!e.$isRangeSelection(P))return;const H=P.extract();if(b===null)H.forEach(B=>{const z=B.getParent();if(g(z)){const X=z.getChildren();for(let ee=0;ee<X.length;ee++)z.insertBefore(X[ee]);z.remove()}});else{if(H.length===1){const X=H[0],ee=R(X,g);if(ee!==null){ee.setURL(b),w!==void 0&&ee.setTarget(w),W!==null&&ee.setRel(W),$!==void 0&&ee.setTitle($);return}}let B=null,z=null;H.forEach(X=>{const ee=X.getParent();if(!(ee===z||ee===null||e.$isElementNode(X)&&!X.isInline())){if(g(ee)){z=ee,ee.setURL(b),w!==void 0&&ee.setTarget(w),W!==null&&z.setRel(W),$!==void 0&&z.setTitle($);return}if(ee.is(B)||(B=ee,z=d(b,{rel:W,target:w,title:$}),g(ee)?X.getPreviousSibling()===null?ee.insertBefore(z):ee.insertAfter(z):X.insertBefore(z)),g(X)){if(X.is(z))return;if(z!==null){const le=X.getChildren();for(let j=0;j<le.length;j++)z.append(le[j])}X.remove();return}z!==null&&z.append(X)}})}}function R(b,x){let w=b;for(;w!==null&&w.getParent()!==null&&!x(w);)w=w.getParentOrThrow();return x(w)?w:null}return Ii.$createAutoLinkNode=C,Ii.$createLinkNode=d,Ii.$isAutoLinkNode=v,Ii.$isLinkNode=g,Ii.AutoLinkNode=p,Ii.LinkNode=r,Ii.TOGGLE_LINK_COMMAND=T,Ii.toggleLink=O,Ii}var Pi={},yh;function SC(){if(yh)return Pi;yh=1;var t=on(),e=Bt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(R){return new r(R.__url,{rel:R.__rel,target:R.__target,title:R.__title},R.__key)}constructor(R,b={},x){super(x);let{target:w=null,rel:$=null,title:W=null}=b;this.__url=R,this.__target=w,this.__rel=$,this.__title=W}createDOM(R){let b=document.createElement("a");return b.href=this.sanitizeUrl(this.__url),this.__target!==null&&(b.target=this.__target),this.__rel!==null&&(b.rel=this.__rel),this.__title!==null&&(b.title=this.__title),t.addClassNamesToElement(b,R.theme.link),b}updateDOM(R,b){let x=this.__url,w=this.__target,$=this.__rel,W=this.__title;return x!==R.__url&&(b.href=x),w!==R.__target&&(w?b.target=w:b.removeAttribute("target")),$!==R.__rel&&($?b.rel=$:b.removeAttribute("rel")),W!==R.__title&&(W?b.title=W:b.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:c,priority:1})}}static importJSON(R){let b=d(R.url,{rel:R.rel,target:R.target,title:R.title});return b.setFormat(R.format),b.setIndent(R.indent),b.setDirection(R.direction),b}sanitizeUrl(R){try{let b=new URL(R);if(!n.has(b.protocol))return"about:blank"}catch{}return R}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(R){this.getWritable().__url=R}getTarget(){return this.getLatest().__target}setTarget(R){this.getWritable().__target=R}getRel(){return this.getLatest().__rel}setRel(R){this.getWritable().__rel=R}getTitle(){return this.getLatest().__title}setTitle(R){this.getWritable().__title=R}insertNewAfter(R,b=!0){return R=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(R,b),R}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(R,b){if(!e.$isRangeSelection(b))return!1;R=b.anchor.getNode();let x=b.focus.getNode();return this.isParentOf(R)&&this.isParentOf(x)&&0<b.getTextContent().length}}function c(O){let R=null;if(t.isHTMLAnchorElement(O)){let b=O.textContent;(b!==null&&b!==""||0<O.children.length)&&(R=d(O.getAttribute("href")||"",{rel:O.getAttribute("rel"),target:O.getAttribute("target"),title:O.getAttribute("title")}))}return{node:R}}function d(O,R){return e.$applyNodeReplacement(new r(O,R))}function g(O){return O instanceof r}class p extends r{static getType(){return"autolink"}static clone(R){return new p(R.__url,{rel:R.__rel,target:R.__target,title:R.__title},R.__key)}static importJSON(R){let b=C(R.url,{rel:R.rel,target:R.target,title:R.title});return b.setFormat(R.format),b.setIndent(R.indent),b.setDirection(R.direction),b}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(R,b=!0){return R=this.getParentOrThrow().insertNewAfter(R,b),e.$isElementNode(R)?(b=C(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),R.append(b),b):null}}function C(O,R){return e.$applyNodeReplacement(new p(O,R))}let v=e.createCommand("TOGGLE_LINK_COMMAND");function T(O,R){for(;O!==null&&O.getParent()!==null&&!R(O);)O=O.getParentOrThrow();return R(O)?O:null}return Pi.$createAutoLinkNode=C,Pi.$createLinkNode=d,Pi.$isAutoLinkNode=function(O){return O instanceof p},Pi.$isLinkNode=g,Pi.AutoLinkNode=p,Pi.LinkNode=r,Pi.TOGGLE_LINK_COMMAND=v,Pi.toggleLink=function(O,R={}){let{target:b,title:x}=R,w=R.rel===void 0?"noreferrer":R.rel;if(R=e.$getSelection(),e.$isRangeSelection(R))if(R=R.extract(),O===null)R.forEach($=>{if($=$.getParent(),g($)){let W=$.getChildren();for(let P=0;P<W.length;P++)$.insertBefore(W[P]);$.remove()}});else{if(R.length===1){let P=T(R[0],g);if(P!==null){P.setURL(O),b!==void 0&&P.setTarget(b),w!==null&&P.setRel(w),x!==void 0&&P.setTitle(x);return}}let $=null,W=null;R.forEach(P=>{var H=P.getParent();if(H!==W&&H!==null&&(!e.$isElementNode(P)||P.isInline()))if(g(H))W=H,H.setURL(O),b!==void 0&&H.setTarget(b),w!==null&&W.setRel(w),x!==void 0&&W.setTitle(x);else if(H.is($)||($=H,W=d(O,{rel:w,target:b,title:x}),g(H)?P.getPreviousSibling()===null?H.insertBefore(W):H.insertAfter(W):P.insertBefore(W)),g(P)){if(!P.is(W)){if(W!==null){H=P.getChildren();for(let B=0;B<H.length;B++)W.append(H[B])}P.remove()}}else W!==null&&W.append(P)})}},Pi}var Eu,Nh;function yd(){return Nh||(Nh=1,Eu=process.env.NODE_ENV==="development"?vC():SC()),Eu}var Ch;function wC(){if(Ch)return Cu;Ch=1;var t=yd(),e=Un(),n=on(),r=Bt(),c=et;function d({validateUrl:g}){const[p]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!p.hasNodes([t.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(t.TOGGLE_LINK_COMMAND,C=>{if(C===null)return t.toggleLink(C),!0;if(typeof C=="string")return g===void 0||g(C)?(t.toggleLink(C),!0):!1;{const{url:v,target:T,rel:O,title:R}=C;return t.toggleLink(v,{rel:O,target:T,title:R}),!0}},r.COMMAND_PRIORITY_LOW),g!==void 0?p.registerCommand(r.PASTE_COMMAND,C=>{const v=r.$getSelection();if(!r.$isRangeSelection(v)||v.isCollapsed()||!(C instanceof ClipboardEvent)||C.clipboardData==null)return!1;const T=C.clipboardData.getData("text");return g(T)?v.getNodes().some(O=>r.$isElementNode(O))?!1:(p.dispatchCommand(t.TOGGLE_LINK_COMMAND,T),C.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,g]),null}return Cu.LinkPlugin=d,Cu}var Tu={},Eh;function OC(){if(Eh)return Tu;Eh=1;var t=yd(),e=Un(),n=on(),r=Bt(),c=et;return Tu.LinkPlugin=function({validateUrl:d}){let[g]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!g.hasNodes([t.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(g.registerCommand(t.TOGGLE_LINK_COMMAND,p=>{if(p===null)return t.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(t.toggleLink(p),!0):!1;let{url:C,target:v,rel:T,title:O}=p;return t.toggleLink(C,{rel:T,target:v,title:O}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?g.registerCommand(r.PASTE_COMMAND,p=>{let C=r.$getSelection();if(!r.$isRangeSelection(C)||C.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let v=p.clipboardData.getData("text");return d(v)?C.getNodes().some(T=>r.$isElementNode(T))?!1:(g.dispatchCommand(t.TOGGLE_LINK_COMMAND,v),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[g,d]),null},Tu}const DC=process.env.NODE_ENV==="development"?wC():OC();var AC=DC,xu={},Gt={},Th;function MC(){if(Th)return Gt;Th=1;var t=Bt(),e=on();const n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const fe=new c(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return fe.__rowSpan=ie.__rowSpan,fe.__backgroundColor=ie.__backgroundColor,fe}static importDOM(){return{td:ie=>({conversion:d,priority:0}),th:ie=>({conversion:d,priority:0})}}static importJSON(ie){const fe=ie.colSpan||1,Oe=ie.rowSpan||1,Re=g(ie.headerState,fe,ie.width||void 0);return Re.__rowSpan=Oe,Re.__backgroundColor=ie.backgroundColor||null,Re}constructor(ie=r.NO_STATUS,fe=1,Oe,Re){super(fe,Re),this.__headerState=ie,this.__width=Oe,this.__backgroundColor=null}createDOM(ie){const fe=document.createElement(this.getTag());return this.__width&&(fe.style.width=`${this.__width}px`),this.__colSpan>1&&(fe.colSpan=this.__colSpan),this.__rowSpan>1&&(fe.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(fe.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(fe,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),fe}exportDOM(ie){const{element:fe}=super.exportDOM(ie);if(fe){const Oe=fe,Re=700,De=this.getParentOrThrow().getChildrenSize();Oe.style.border="1px solid black",this.__colSpan>1&&(Oe.colSpan=this.__colSpan),this.__rowSpan>1&&(Oe.rowSpan=this.__rowSpan),Oe.style.width=`${this.getWidth()||Math.max(90,Re/De)}px`,Oe.style.verticalAlign="top",Oe.style.textAlign="start";const We=this.getBackgroundColor();We!==null?Oe.style.backgroundColor=We:this.hasHeader()&&(Oe.style.backgroundColor="#f2f3f5")}return{element:fe}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const fe=this.getWritable();return fe.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const fe=this.getWritable();return fe.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const fe=this.getWritable();return(fe.__headerState&ie)===ie?fe.__headerState-=ie:fe.__headerState+=ie,fe}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(ve){const ie=ve,fe=ve.nodeName.toLowerCase();let Oe;n.test(ie.style.width)&&(Oe=parseFloat(ie.style.width));const Re=g(fe==="th"?r.ROW:r.NO_STATUS,ie.colSpan,Oe);Re.__rowSpan=ie.rowSpan;const De=ie.style.backgroundColor;return De!==""&&(Re.__backgroundColor=De),{forChild:(We,qe)=>{if(p(qe)&&!t.$isElementNode(We)){const Qe=t.$createParagraphNode();return t.$isLineBreakNode(We)&&We.getTextContent()===`
74
- `?null:(Qe.append(We),Qe)}return We},node:Re}}function g(ve,ie=1,fe){return t.$applyNodeReplacement(new c(ve,ie,fe))}function p(ve){return ve instanceof c}class C extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new C(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:v,priority:0})}}static importJSON(ie){return T(ie.height)}constructor(ie,fe){super(fe),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const fe=document.createElement("tr");return this.__height&&(fe.style.height=`${this.__height}px`),e.addClassNamesToElement(fe,ie.theme.tableRow),fe}isShadowRoot(){return!0}setHeight(ie){const fe=this.getWritable();return fe.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function v(ve){const ie=ve;let fe;return n.test(ie.style.height)&&(fe=parseFloat(ie.style.height)),{node:T(fe)}}function T(ve){return t.$applyNodeReplacement(new C(ve))}function O(ve){return ve instanceof C}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",b=ve=>R?(ve||window).getSelection():null;class x{constructor(ie,fe){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=fe,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(fe=>{this.editor.update(()=>{let Oe=!1;for(let De=0;De<fe.length;De++){const Qe=fe[De].target.nodeName;if(Qe==="TABLE"||Qe==="TR"){Oe=!0;break}}if(!Oe)return;const Re=this.editor.getElementByKey(this.tableNodeKey);if(!Re)throw new Error("Expected to find TableElement in DOM");this.grid=B(Re)})});this.editor.update(()=>{const fe=this.editor.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");this.grid=B(fe),ie.observe(fe,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=ie.getElementByKey(this.tableNodeKey);if(!Oe)throw new Error("Expected to find TableElement in DOM");const Re=B(Oe);z(ie,Re,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(fe,ie._config.theme.tableSelection),fe.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.addClassNamesToElement(fe,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const fe=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),z(fe,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,fe=!1){const Oe=this.editor;Oe.update(()=>{const Re=t.$getNodeByKey(this.tableNodeKey);if(!m(Re))throw new Error("Expected TableNode.");if(!Oe.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const We=ie.x,qe=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const Qe=b(Oe._window);Qe&&Qe.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==We||this.anchorY!==qe||fe))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(We===this.focusX&&qe===this.focusY)return;if(this.focusX=We,this.focusY=qe,this.isHighlightingCells){const Qe=t.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(Qe)){const ft=Qe.getKey();this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ft,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Oe.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),z(Oe,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const fe=t.$getNearestNodeFromDOMNode(ie.elem);if(p(fe)){const Oe=fe.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=Oe}})}formatCells(ie){this.editor.update(()=>{const fe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(fe))throw Error("Expected grid selection");const Oe=t.$createRangeSelection(),Re=Oe.anchor,De=Oe.focus;fe.getNodes().forEach(We=>{p(We)&&We.getTextContentSize()!==0&&(Re.set(We.getKey(),0,"element"),De.set(We.getKey(),We.getChildrenSize(),"element"),Oe.formatText(ie))}),t.$setSelection(fe),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(Oe))throw Error("Expected grid selection");const Re=Oe.getNodes().filter(p);if(Re.length===this.grid.columns*this.grid.rows){fe.selectPrevious(),fe.remove(),t.$getRoot().selectStart();return}Re.forEach(De=>{if(t.$isElementNode(De)){const We=t.$createParagraphNode(),qe=t.$createTextNode();We.append(qe),De.append(We),De.getChildren().forEach(Qe=>{Qe!==We&&Qe.remove()})}}),z(ie,this.grid,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}}const w="__lexicalTableSelection";function $(ve,ie,fe,Oe){const Re=fe.getRootElement();if(Re===null)throw new Error("No root element.");const De=new x(fe,ve.getKey()),We=fe._window||window;W(ie,De),ie.addEventListener("mousedown",je=>{setTimeout(()=>{if(je.button!==0||!We)return;const Ve=H(je.target);Ve!==null&&(ne(je),De.setAnchorCellForSelection(Ve));const rt=()=>{We.removeEventListener("mouseup",rt),We.removeEventListener("mousemove",_t)},_t=Et=>{const St=H(Et.target);St!==null&&(De.anchorX!==St.x||De.anchorY!==St.y)&&(Et.preventDefault(),De.setFocusCellForSelection(St))};We.addEventListener("mouseup",rt),We.addEventListener("mousemove",_t)},0)});const qe=je=>{je.button===0&&fe.update(()=>{const Ve=t.$getSelection(),rt=je.target;t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&Re.contains(rt)&&De.clearHighlight()})};We.addEventListener("mousedown",qe),De.listenersToRemove.add(()=>We.removeEventListener("mousedown",qe)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_DOWN_COMMAND,je=>V(fe,je,"down",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_UP_COMMAND,je=>V(fe,je,"up",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_LEFT_COMMAND,je=>V(fe,je,"backward",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,je=>V(fe,je,"forward",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ESCAPE_COMMAND,je=>{const Ve=t.$getSelection();if(t.DEPRECATED_$isGridSelection(Ve)){const rt=e.$findMatchingParent(Ve.focus.getNode(),p);if(p(rt))return ne(je),rt.selectEnd(),!0}return!1},t.COMMAND_PRIORITY_HIGH));const Qe=je=>()=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>p(bt));if(!p(rt))return!1;const _t=Ve.anchor.getNode(),Et=Ve.focus.getNode(),St=ve.isParentOf(_t),Ot=ve.isParentOf(Et);if(St&&!Ot||Ot&&!St)return De.clearText(),!0;const xt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>t.$isElementNode(bt)),Qt=xt&&e.$findMatchingParent(xt,bt=>t.$isElementNode(bt)&&p(bt.getParent()));if(!t.$isElementNode(Qt)||!t.$isElementNode(xt))return!1;if(je===t.DELETE_LINE_COMMAND&&Qt.getPreviousSibling()===null)return!0;if((je===t.DELETE_CHARACTER_COMMAND||je===t.DELETE_WORD_COMMAND)&&Ve.isCollapsed()&&Ve.anchor.offset===0&&xt!==Qt){const bt=xt.getChildren(),Ut=t.$createParagraphNode();return bt.forEach(It=>Ut.append(It)),xt.replace(Ut),xt.getWritable().__parent=rt.getKey(),!0}}return!1};[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(je=>{De.listenersToRemove.add(fe.registerCommand(je,Qe(je),t.COMMAND_PRIORITY_CRITICAL))});const ft=je=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return je.preventDefault(),je.stopPropagation(),De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1};De.listenersToRemove.add(fe.registerCommand(t.KEY_BACKSPACE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.KEY_DELETE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FORMAT_TEXT_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.formatCells(je),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearHighlight(),!1;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),Oe&&De.listenersToRemove.add(fe.registerCommand(t.KEY_TAB_COMMAND,je=>{const Ve=t.$getSelection();if(!t.$isRangeSelection(Ve)||!Ve.isCollapsed()||!q(Ve,ve))return!1;const rt=K(Ve.anchor.getNode());if(rt===null)return!1;ne(je);const _t=ve.getCordsFromCellNode(rt,De.grid);return j(De,ve,_t.x,_t.y,je.shiftKey?"backward":"forward"),!0},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FOCUS_COMMAND,je=>ve.isSelected(),t.COMMAND_PRIORITY_HIGH));function kt(je){const Ve=ve.getCordsFromCellNode(je,De.grid);return ve.getCellFromCordsOrThrow(Ve.x,Ve.y,De.grid)}return De.listenersToRemove.add(fe.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{const je=t.$getSelection(),Ve=t.$getPreviousSelection();if(t.$isRangeSelection(je)){const{anchor:rt,focus:_t}=je,Et=rt.getNode(),St=_t.getNode(),Ot=K(Et),At=K(St),xt=Ot&&ve.is(D(Ot)),Qt=At&&ve.is(D(At)),bt=xt!==Qt,Ut=xt&&Qt,It=je.isBackward();if(bt){const hr=je.clone();hr.focus.set(ve.getKey(),It?0:ve.getChildrenSize(),"element"),t.$setSelection(hr),ee(fe,De)}else Ut&&(Ot.is(At)||(De.setAnchorCellForSelection(kt(Ot)),De.setFocusCellForSelection(kt(At),!0)))}return je&&!je.is(Ve)&&(t.DEPRECATED_$isGridSelection(je)||t.DEPRECATED_$isGridSelection(Ve))&&De.gridSelection&&!De.gridSelection.is(Ve)?(t.DEPRECATED_$isGridSelection(je)&&je.gridKey===De.tableNodeKey?De.updateTableGridSelection(je):!t.DEPRECATED_$isGridSelection(je)&&t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&De.updateTableGridSelection(null),!1):(De.hasHijackedSelectionStyles&&!ve.isSelected()?le(fe,De):!De.hasHijackedSelectionStyles&&ve.isSelected()&&ee(fe,De),!1)},t.COMMAND_PRIORITY_CRITICAL)),De}function W(ve,ie){ve[w]=ie}function P(ve){return ve[w]}function H(ve){let ie=ve;for(;ie!=null;){const fe=ie.nodeName;if(fe==="TD"||fe==="TH"){const Oe=ie._cell;return Oe===void 0?null:Oe}ie=ie.parentNode}return null}function B(ve){const ie=[],fe={cells:ie,columns:0,rows:0};let Oe=ve.firstChild,Re=0,De=0;for(ie.length=0;Oe!=null;){const We=Oe.nodeName;if(We==="TD"||We==="TH"){const ft=Oe,kt={elem:ft,hasBackgroundColor:ft.style.backgroundColor!=="",highlighted:!1,x:Re,y:De};Oe._cell=kt;let je=ie[De];je===void 0&&(je=ie[De]=[]),je[Re]=kt}else{const ft=Oe.firstChild;if(ft!=null){Oe=ft;continue}}const qe=Oe.nextSibling;if(qe!=null){Re++,Oe=qe;continue}const Qe=Oe.parentNode;if(Qe!=null){const ft=Qe.nextSibling;if(ft==null)break;De++,Re=0,Oe=ft}}return fe.columns=Re+1,fe.rows=De+1,fe}function z(ve,ie,fe){const Oe=new Set(fe?fe.getNodes():[]);X(ie,(Re,De)=>{const We=Re.elem;Oe.has(De)?(Re.highlighted=!0,pe(ve,Re)):(Re.highlighted=!1,ue(ve,Re),We.getAttribute("style")||We.removeAttribute("style"))})}function X(ve,ie){const{cells:fe}=ve;for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(Re)for(let De=0;De<Re.length;De++){const We=Re[De];if(!We)continue;const qe=t.$getNearestNodeFromDOMNode(We.elem);qe!==null&&ie(We,qe,{x:De,y:Oe})}}}function ee(ve,ie){ie.disableHighlightStyle(),X(ie.grid,fe=>{fe.highlighted=!0,pe(ve,fe)})}function le(ve,ie){ie.enableHighlightStyle(),X(ie.grid,fe=>{const Oe=fe.elem;fe.highlighted=!1,ue(ve,fe),Oe.getAttribute("style")||Oe.removeAttribute("style")})}const j=(ve,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?ve.grid.columns-1:0)?me(ie.getCellNodeFromCordsOrThrow(fe+(De?1:-1),Oe,ve.grid),De):Oe!==(De?ve.grid.rows-1:0)?me(ie.getCellNodeFromCordsOrThrow(De?0:ve.grid.columns-1,Oe+(De?1:-1),ve.grid),De):De?ie.selectNext():ie.selectPrevious(),!0;case"up":return Oe!==0?me(ie.getCellNodeFromCordsOrThrow(fe,Oe-1,ve.grid),!1):ie.selectPrevious(),!0;case"down":return Oe!==ve.grid.rows-1?me(ie.getCellNodeFromCordsOrThrow(fe,Oe+1,ve.grid),!0):ie.selectNext(),!0;default:return!1}},U=(ve,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?ve.grid.columns-1:0)&&ve.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe+(De?1:-1),Oe,ve.grid)),!0;case"up":return Oe!==0?(ve.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe-1,ve.grid)),!0):!1;case"down":return Oe!==ve.grid.rows-1?(ve.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe+1,ve.grid)),!0):!1;default:return!1}};function q(ve,ie){if(t.$isRangeSelection(ve)||t.DEPRECATED_$isGridSelection(ve)){const fe=ie.isParentOf(ve.anchor.getNode()),Oe=ie.isParentOf(ve.focus.getNode());return fe&&Oe}return!1}function me(ve,ie){ie?ve.selectStart():ve.selectEnd()}const _e="172,206,247";function pe(ve,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null?fe.style.setProperty("background-color",`rgb(${_e})`):fe.style.setProperty("background-image",`linear-gradient(to right, rgba(${_e},0.85), rgba(${_e},0.85))`),fe.style.setProperty("caret-color","transparent")}function ue(ve,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null&&fe.style.removeProperty("background-color"),fe.style.removeProperty("background-image"),fe.style.removeProperty("caret-color")}function K(ve){const ie=e.$findMatchingParent(ve,p);return p(ie)?ie:null}function D(ve){const ie=e.$findMatchingParent(ve,m);return m(ie)?ie:null}function V(ve,ie,fe,Oe,Re){const De=t.$getSelection();if(!q(De,Oe))return!1;if(t.$isRangeSelection(De)&&De.isCollapsed()){if(fe==="backward"||fe==="forward")return!1;const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p);if(!p(Qe)||!Qe.is(ft))return!1;const kt=D(Qe);if(kt!==Oe&&kt!=null){const At=ve.getElementByKey(kt.getKey());if(At!=null)return Re.grid=B(At),V(ve,ie,fe,kt,Re)}const je=ve.getElementByKey(Qe.__key),Ve=ve.getElementByKey(We.key);if(Ve==null||je==null)return!1;let rt;if(We.type==="element")rt=Ve.getBoundingClientRect();else{const At=window.getSelection();if(At===null||At.rangeCount===0)return!1;rt=At.getRangeAt(0).getBoundingClientRect()}const _t=fe==="up"?Qe.getFirstChild():Qe.getLastChild();if(_t==null)return!1;const Et=ve.getElementByKey(_t.__key);if(Et==null)return!1;const St=Et.getBoundingClientRect();if(fe==="up"?St.top>rt.top-rt.height:rt.bottom+rt.height>St.bottom){ne(ie);const At=Oe.getCordsFromCellNode(Qe,Re.grid);if(ie.shiftKey){const xt=Oe.getCellFromCordsOrThrow(At.x,At.y,Re.grid);Re.setAnchorCellForSelection(xt),Re.setFocusCellForSelection(xt,!0)}else return j(Re,Oe,At.x,At.y,fe);return!0}}else if(t.DEPRECATED_$isGridSelection(De)){const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p),[kt]=De.getNodes(),je=ve.getElementByKey(kt.getKey());if(!p(Qe)||!p(ft)||!m(kt)||je==null)return!1;Re.updateTableGridSelection(De);const Ve=B(je),rt=Oe.getCordsFromCellNode(Qe,Ve),_t=Oe.getCellFromCordsOrThrow(rt.x,rt.y,Ve);if(Re.setAnchorCellForSelection(_t),ne(ie),ie.shiftKey){const Et=Oe.getCordsFromCellNode(ft,Ve);return U(Re,kt,Et.x,Et.y,fe)}else ft.selectEnd();return!0}return!1}function ne(ve){ve.preventDefault(),ve.stopImmediatePropagation(),ve.stopPropagation()}class Y extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new Y(ie.__key)}static importDOM(){return{table:ie=>({conversion:Q,priority:1})}}static importJSON(ie){return k()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,fe){const Oe=document.createElement("table");return e.addClassNamesToElement(Oe,ie.theme.table),Oe}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:fe=>{if(fe){const Oe=fe.cloneNode(),Re=document.createElement("colgroup"),De=document.createElement("tbody");e.isHTMLElement(fe)&&De.append(...fe.children);const We=this.getFirstChildOrThrow();if(!O(We))throw new Error("Expected to find row node.");const qe=We.getChildrenSize();for(let Qe=0;Qe<qe;Qe++){const ft=document.createElement("col");Re.append(ft)}return Oe.replaceChildren(Re,De),Oe}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,fe){const{rows:Oe,cells:Re}=fe;for(let De=0;De<Oe;De++){const We=Re[De];if(We==null)continue;const qe=We.findIndex(Qe=>{if(!Qe)return;const{elem:ft}=Qe;return t.$getNearestNodeFromDOMNode(ft)===ie});if(qe!==-1)return{x:qe,y:De}}throw new Error("Cell not found in table.")}getCellFromCords(ie,fe,Oe){const{cells:Re}=Oe,De=Re[fe];if(De==null)return null;const We=De[ie];return We??null}getCellFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(!Re)throw new Error("Cell not found at cords.");return Re}getCellNodeFromCords(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(Re==null)return null;const De=t.$getNearestNodeFromDOMNode(Re.elem);return p(De)?De:null}getCellNodeFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellNodeFromCords(ie,fe,Oe);if(!Re)throw new Error("Node at cords not TableCellNode.");return Re}canSelectBefore(){return!0}canIndent(){return!1}}function G(ve,ie){const fe=ve.getElementByKey(ie.getKey());if(fe==null)throw new Error("Table Element Not Found");return B(fe)}function Q(ve){return{node:k()}}function k(){return t.$applyNodeReplacement(new Y)}function m(ve){return ve instanceof Y}function y(ve,ie,fe=!0){const Oe=k();for(let Re=0;Re<ve;Re++){const De=T();for(let We=0;We<ie;We++){let qe=r.NO_STATUS;typeof fe=="object"?(Re===0&&fe.rows&&(qe|=r.ROW),We===0&&fe.columns&&(qe|=r.COLUMN)):fe&&(Re===0&&(qe|=r.ROW),We===0&&(qe|=r.COLUMN));const Qe=g(qe),ft=t.$createParagraphNode();ft.append(t.$createTextNode()),Qe.append(ft),De.append(Qe)}Oe.append(De)}return Oe}function M(ve){const ie=e.$findMatchingParent(ve,fe=>p(fe));return p(ie)?ie:null}function Z(ve){const ie=e.$findMatchingParent(ve,fe=>O(fe));if(O(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ae(ve){const ie=e.$findMatchingParent(ve,fe=>m(fe));if(m(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function he(ve){const ie=Z(ve);return ae(ie).getChildren().findIndex(Oe=>Oe.is(ie))}function se(ve){return Z(ve).getChildren().findIndex(fe=>fe.is(ve))}function Te(ve,ie){const fe=ae(ve),{x:Oe,y:Re}=fe.getCordsFromCellNode(ve,ie);return{above:fe.getCellNodeFromCords(Oe,Re-1,ie),below:fe.getCellNodeFromCords(Oe,Re+1,ie),left:fe.getCellNodeFromCords(Oe-1,Re,ie),right:fe.getCellNodeFromCords(Oe+1,Re,ie)}}function be(ve,ie){const fe=ve.getChildren();if(ie>=fe.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return fe[ie].remove(),ve}function Ue(ve,ie,fe=!0,Oe,Re){const De=ve.getChildren();if(ie>=De.length||ie<0)throw new Error("Table row target index out of range");const We=De[ie];if(O(We))for(let qe=0;qe<Oe;qe++){const Qe=We.getChildren(),ft=Qe.length,kt=T();for(let je=0;je<ft;je++){const Ve=Qe[je];if(!p(Ve))throw Error("Expected table cell");const{above:rt,below:_t}=Te(Ve,Re);let Et=r.NO_STATUS;const St=rt&&rt.getWidth()||_t&&_t.getWidth()||void 0;(rt&&rt.hasHeaderState(r.COLUMN)||_t&&_t.hasHeaderState(r.COLUMN))&&(Et|=r.COLUMN);const Ot=g(Et,1,St);Ot.append(t.$createParagraphNode()),kt.append(Ot)}fe?We.insertAfter(kt):We.insertBefore(kt)}else throw new Error("Row before insertion index does not exist.");return ve}function re(ve=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const fe=ie.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,We]=t.DEPRECATED_$computeGridMap(Re,Oe,Oe),qe=De[0].length,{startRow:Qe}=We;if(ve){const ft=Qe+Oe.__rowSpan-1,kt=De[ft],je=T();for(let rt=0;rt<qe;rt++){const{cell:_t,startRow:Et}=kt[rt];Et+_t.__rowSpan-1<=ft?je.append(g(r.NO_STATUS)):_t.setRowSpan(_t.__rowSpan+1)}const Ve=Re.getChildAtIndex(ft);if(!t.DEPRECATED_$isGridRowNode(Ve))throw Error("focusEndRow is not a GridRowNode");Ve.insertAfter(je)}else{const ft=De[Qe],kt=T();for(let Ve=0;Ve<qe;Ve++){const{cell:rt,startRow:_t}=ft[Ve];_t===Qe?kt.append(g(r.NO_STATUS)):rt.setRowSpan(rt.__rowSpan+1)}const je=Re.getChildAtIndex(Qe);if(!t.DEPRECATED_$isGridRowNode(je))throw Error("focusEndRow is not a GridRowNode");je.insertBefore(kt)}}function te(ve,ie,fe=!0,Oe,Re){const De=ve.getChildren(),We=[];for(let qe=0;qe<De.length;qe++){const Qe=De[qe];if(O(Qe))for(let ft=0;ft<Oe;ft++){const kt=Qe.getChildren();if(ie>=kt.length||ie<0)throw new Error("Table column target index out of range");const je=kt[ie];if(!p(je))throw Error("Expected table cell");const{left:Ve,right:rt}=Te(je,Re);let _t=r.NO_STATUS;(Ve&&Ve.hasHeaderState(r.ROW)||rt&&rt.hasHeaderState(r.ROW))&&(_t|=r.ROW);const Et=g(_t);Et.append(t.$createParagraphNode()),We.push({newTableCell:Et,targetCell:je})}}return We.forEach(({newTableCell:qe,targetCell:Qe})=>{fe?Qe.insertAfter(qe):Qe.insertBefore(qe)}),ve}function ce(ve=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const fe=ie.anchor.getNode(),Oe=ie.focus.getNode(),[Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,,We]=t.DEPRECATED_$getNodeTriplet(Oe),[qe,Qe,ft]=t.DEPRECATED_$computeGridMap(We,De,Re),kt=qe.length,je=ve?Math.max(Qe.startColumn,ft.startColumn):Math.min(Qe.startColumn,ft.startColumn),Ve=ve?je+De.__colSpan-1:je-1,rt=We.getFirstChild();if(!t.DEPRECATED_$isGridRowNode(rt))throw Error("Expected firstTable child to be a row");let _t=null;function Et(){const Ot=g(r.NO_STATUS).append(t.$createParagraphNode());return _t===null&&(_t=Ot),Ot}let St=rt;e:for(let Ot=0;Ot<kt;Ot++){if(Ot!==0){const Ut=St.getNextSibling();if(!t.DEPRECATED_$isGridRowNode(Ut))throw Error("Expected row nextSibling to be a row");St=Ut}const At=qe[Ot];if(Ve<0){ct(St,Et());continue}const{cell:xt,startColumn:Qt,startRow:bt}=At[Ve];if(Qt+xt.__colSpan-1<=Ve){let Ut=xt,It=bt,hr=Ve;for(;It!==Ot&&Ut.__rowSpan>1;)if(hr-=xt.__colSpan,hr>=0){const{cell:Sr,startRow:Fi}=At[hr];Ut=Sr,It=Fi}else{St.append(Et());continue e}Ut.insertAfter(Et())}else xt.setColSpan(xt.__colSpan+1)}_t!==null&&Ye(_t)}function we(ve,ie){const fe=ve.getChildren();for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(O(Re)){const De=Re.getChildren();if(ie>=De.length||ie<0)throw new Error("Table column target index out of range");De[ie].remove()}}return ve}function Le(){const ve=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ve))throw Error("Expected a INTERNAL_PointSelection");const ie=ve.anchor.getNode(),fe=ve.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startRow:ft}=qe,{startRow:kt}=Qe,je=kt+De.__rowSpan-1;if(We.length===je-ft+1){Re.remove();return}const Ve=We[0].length,rt=We[je+1],_t=Re.getChildAtIndex(je+1);for(let Et=je;Et>=ft;Et--){for(let Ot=Ve-1;Ot>=0;Ot--){const{cell:At,startRow:xt,startColumn:Qt}=We[Et][Ot];if(Qt===Ot&&(Et===ft&&xt<ft&&At.setRowSpan(At.__rowSpan-(xt-ft)),xt>=ft&&xt+At.__rowSpan-1>je)){if(At.setRowSpan(At.__rowSpan-(je-xt+1)),_t===null)throw Error("Expected nextRowNode not to be null");if(Ot===0)ct(_t,At);else{const{cell:bt}=rt[Ot-1];bt.insertAfter(At)}}}const St=Re.getChildAtIndex(Et);if(!t.DEPRECATED_$isGridRowNode(St))throw Error(`Expected GridNode childAtIndex(${String(Et)}) to be RowNode`);St.remove()}if(rt!==void 0){const{cell:Et}=rt[0];Ye(Et)}else{const Et=We[ft-1],{cell:St}=Et[0];Ye(St)}}function Be(){const ve=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ve))throw Error("Expected a INTERNAL_PointSelection");const ie=ve.anchor.getNode(),fe=ve.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startColumn:ft}=qe,{startRow:kt,startColumn:je}=Qe,Ve=Math.min(ft,je),rt=Math.max(ft+Oe.__colSpan-1,je+De.__colSpan-1),_t=rt-Ve+1;if(We[0].length===rt-Ve+1){Re.selectPrevious(),Re.remove();return}const St=We.length;for(let xt=0;xt<St;xt++)for(let Qt=Ve;Qt<=rt;Qt++){const{cell:bt,startColumn:Ut}=We[xt][Qt];if(Ut<Ve){if(Qt===Ve){const It=Ve-Ut;bt.setColSpan(bt.__colSpan-Math.min(_t,bt.__colSpan-It))}}else if(Ut+bt.__colSpan-1>rt){if(Qt===rt){const It=rt-Ut+1;bt.setColSpan(bt.__colSpan-It)}}else bt.remove()}const Ot=We[kt],At=Ot[je+De.__colSpan];if(At!==void 0){const{cell:xt}=At;Ye(xt)}else{const xt=Ot[je-1],{cell:Qt}=xt;Ye(Qt)}}function Ye(ve){const ie=ve.getFirstDescendant();ie==null?ve.selectStart():ie.getParentOrThrow().selectStart()}function ct(ve,ie){const fe=ve.getFirstChild();fe!==null?fe.insertBefore(ie):ve.append(ie)}function yt(){const ve=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ve))throw Error("Expected a INTERNAL_PointSelection");const ie=ve.anchor.getNode(),[fe,Oe,Re]=t.DEPRECATED_$getNodeTriplet(ie),De=fe.__colSpan,We=fe.__rowSpan;if(De>1){for(let qe=1;qe<De;qe++)fe.insertAfter(g(r.NO_STATUS));fe.setColSpan(1)}if(We>1){const[qe,Qe]=t.DEPRECATED_$computeGridMap(Re,fe,fe),{startColumn:ft,startRow:kt}=Qe;let je;for(let Ve=1;Ve<We;Ve++){const rt=kt+Ve,_t=qe[rt];if(je=(je||Oe).getNextSibling(),!t.DEPRECATED_$isGridRowNode(je))throw Error("Expected row next sibling to be a row");let Et=null;for(let St=0;St<ft;St++){const Ot=_t[St],At=Ot.cell;Ot.startRow===rt&&(Et=At),At.__colSpan>1&&(St+=At.__colSpan-1)}if(Et===null)for(let St=0;St<De;St++)ct(je,g(r.NO_STATUS));else for(let St=0;St<De;St++)Et.insertAfter(g(r.NO_STATUS))}fe.setRowSpan(1)}}const dt=t.createCommand("INSERT_TABLE_COMMAND");return Gt.$createTableCellNode=g,Gt.$createTableNode=k,Gt.$createTableNodeWithDimensions=y,Gt.$createTableRowNode=T,Gt.$deleteTableColumn=we,Gt.$deleteTableColumn__EXPERIMENTAL=Be,Gt.$deleteTableRow__EXPERIMENTAL=Le,Gt.$getElementGridForTableNode=G,Gt.$getTableCellNodeFromLexicalNode=M,Gt.$getTableColumnIndexFromTableCellNode=se,Gt.$getTableNodeFromLexicalNodeOrThrow=ae,Gt.$getTableRowIndexFromTableCellNode=he,Gt.$getTableRowNodeFromTableCellNodeOrThrow=Z,Gt.$insertTableColumn=te,Gt.$insertTableColumn__EXPERIMENTAL=ce,Gt.$insertTableRow=Ue,Gt.$insertTableRow__EXPERIMENTAL=re,Gt.$isTableCellNode=p,Gt.$isTableNode=m,Gt.$isTableRowNode=O,Gt.$removeTableRowAtIndex=be,Gt.$unmergeCell=yt,Gt.INSERT_TABLE_COMMAND=dt,Gt.TableCellHeaderStates=r,Gt.TableCellNode=c,Gt.TableNode=Y,Gt.TableRowNode=C,Gt.TableSelection=x,Gt.applyTableHandlers=$,Gt.getCellFromTarget=H,Gt.getTableSelectionFromTableElement=P,Gt}var Yt={},xh;function RC(){if(xh)return Yt;xh=1;var t=Bt(),e=on();let n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(y){let M=new c(y.__headerState,y.__colSpan,y.__width,y.__key);return M.__rowSpan=y.__rowSpan,M.__backgroundColor=y.__backgroundColor,M}static importDOM(){return{td:()=>({conversion:d,priority:0}),th:()=>({conversion:d,priority:0})}}static importJSON(y){let M=y.rowSpan||1,Z=g(y.headerState,y.colSpan||1,y.width||void 0);return Z.__rowSpan=M,Z.__backgroundColor=y.backgroundColor||null,Z}constructor(y=r.NO_STATUS,M=1,Z,ae){super(M,ae),this.__headerState=y,this.__width=Z,this.__backgroundColor=null}createDOM(y){let M=document.createElement(this.getTag());return this.__width&&(M.style.width=`${this.__width}px`),1<this.__colSpan&&(M.colSpan=this.__colSpan),1<this.__rowSpan&&(M.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(M.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(M,y.theme.tableCell,this.hasHeader()&&y.theme.tableCellHeader),M}exportDOM(y){if({element:y}=super.exportDOM(y),y){var M=this.getParentOrThrow().getChildrenSize();y.style.border="1px solid black",1<this.__colSpan&&(y.colSpan=this.__colSpan),1<this.__rowSpan&&(y.rowSpan=this.__rowSpan),y.style.width=`${this.getWidth()||Math.max(90,700/M)}px`,y.style.verticalAlign="top",y.style.textAlign="start",M=this.getBackgroundColor(),M!==null?y.style.backgroundColor=M:this.hasHeader()&&(y.style.backgroundColor="#f2f3f5")}return{element:y}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(y){return this.getWritable().__headerState=y,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(y){return this.getWritable().__width=y,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(y){this.getWritable().__backgroundColor=y}toggleHeaderStyle(y){let M=this.getWritable();return M.__headerState=(M.__headerState&y)===y?M.__headerState-y:M.__headerState+y,M}hasHeaderState(y){return(this.getHeaderStyles()&y)===y}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(y){return y.__headerState!==this.__headerState||y.__width!==this.__width||y.__colSpan!==this.__colSpan||y.__rowSpan!==this.__rowSpan||y.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(m){var y=m.nodeName.toLowerCase();let M;return n.test(m.style.width)&&(M=parseFloat(m.style.width)),y=g(y==="th"?r.ROW:r.NO_STATUS,m.colSpan,M),y.__rowSpan=m.rowSpan,m=m.style.backgroundColor,m!==""&&(y.__backgroundColor=m),{forChild:(Z,ae)=>p(ae)&&!t.$isElementNode(Z)?(ae=t.$createParagraphNode(),t.$isLineBreakNode(Z)&&Z.getTextContent()===`
75
- `?null:(ae.append(Z),ae)):Z,node:y}}function g(m,y=1,M){return t.$applyNodeReplacement(new c(m,y,M))}function p(m){return m instanceof c}class C extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(y){return new C(y.__height,y.__key)}static importDOM(){return{tr:()=>({conversion:v,priority:0})}}static importJSON(y){return T(y.height)}constructor(y,M){super(M),this.__height=y}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(y){let M=document.createElement("tr");return this.__height&&(M.style.height=`${this.__height}px`),e.addClassNamesToElement(M,y.theme.tableRow),M}isShadowRoot(){return!0}setHeight(y){return this.getWritable().__height=y,this.__height}getHeight(){return this.getLatest().__height}updateDOM(y){return y.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function v(m){let y;return n.test(m.style.height)&&(y=parseFloat(m.style.height)),{node:T(y)}}function T(m){return t.$applyNodeReplacement(new C(m))}function O(m){return m instanceof C}function R(m){let y=new URLSearchParams;y.append("code",m);for(let M=1;M<arguments.length;M++)y.append("v",arguments[M]);throw Error(`Minified Lexical error #${m}; visit https://lexical.dev/docs/error?${y} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class x{constructor(y,M){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=M,this.editor=y,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(y=>y())}trackTableGrid(){let y=new MutationObserver(M=>{this.editor.update(()=>{var Z=!1;for(let ae=0;ae<M.length;ae++){const he=M[ae].target.nodeName;if(he==="TABLE"||he==="TR"){Z=!0;break}}if(Z){if(Z=this.editor.getElementByKey(this.tableNodeKey),!Z)throw Error("Expected to find TableElement in DOM");this.grid=$(Z)}})});this.editor.update(()=>{let M=this.editor.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");this.grid=$(M),y.observe(M,{childList:!0,subtree:!0})})}clearHighlight(){let y=this.editor;this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),y.update(()=>{var M=t.$getNodeByKey(this.tableNodeKey);if(!D(M))throw Error("Expected TableNode.");if(M=y.getElementByKey(this.tableNodeKey),!M)throw Error("Expected to find TableElement in DOM");M=$(M),W(y,M,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let y=this.editor;y.update(()=>{let M=y.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(M,y._config.theme.tableSelection),M.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let y=this.editor;y.update(()=>{let M=y.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");e.addClassNamesToElement(M,y._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(y){if(y!=null&&y.gridKey===this.tableNodeKey){let M=this.editor;this.gridSelection=y,this.isHighlightingCells=!0,this.disableHighlightStyle(),W(M,this.grid,this.gridSelection)}else y==null?this.clearHighlight():(this.tableNodeKey=y.gridKey,this.updateTableGridSelection(y))}setFocusCellForSelection(y,M=!1){let Z=this.editor;Z.update(()=>{var ae=t.$getNodeByKey(this.tableNodeKey);if(!D(ae))throw Error("Expected TableNode.");if(!Z.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ae=y.x;let he=y.y;if(this.focusCell=y,this.anchorCell!==null){let se=b?(Z._window||window).getSelection():null;se&&se.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ae||this.anchorY!==he||M))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ae===this.focusX&&he===this.focusY)return;this.focusX=ae,this.focusY=he,this.isHighlightingCells&&(ae=t.$getNearestNodeFromDOMNode(y.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(ae)&&(ae=ae.getKey(),this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ae,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Z.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),W(Z,this.grid,this.gridSelection)))})}setAnchorCellForSelection(y){this.isHighlightingCells=!1,this.anchorCell=y,this.anchorX=y.x,this.anchorY=y.y,this.editor.update(()=>{var M=t.$getNearestNodeFromDOMNode(y.elem);p(M)&&(M=M.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=M)})}formatCells(y){this.editor.update(()=>{let M=t.$getSelection();t.DEPRECATED_$isGridSelection(M)||R(11);let Z=t.$createRangeSelection(),ae=Z.anchor,he=Z.focus;M.getNodes().forEach(se=>{p(se)&&se.getTextContentSize()!==0&&(ae.set(se.getKey(),0,"element"),he.set(se.getKey(),se.getChildrenSize(),"element"),Z.formatText(y))}),t.$setSelection(M),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let y=this.editor;y.update(()=>{let M=t.$getNodeByKey(this.tableNodeKey);if(!D(M))throw Error("Expected TableNode.");var Z=t.$getSelection();t.DEPRECATED_$isGridSelection(Z)||R(11),Z=Z.getNodes().filter(p),Z.length===this.grid.columns*this.grid.rows?(M.selectPrevious(),M.remove(),t.$getRoot().selectStart()):(Z.forEach(ae=>{if(t.$isElementNode(ae)){let he=t.$createParagraphNode(),se=t.$createTextNode();he.append(se),ae.append(he),ae.getChildren().forEach(Te=>{Te!==he&&Te.remove()})}}),W(y,this.grid,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0))})}}function w(m){for(;m!=null;){let y=m.nodeName;if(y==="TD"||y==="TH"){if(m=m._cell,m===void 0)break;return m}m=m.parentNode}return null}function $(m){let y=[],M={cells:y,columns:0,rows:0};var Z=m.firstChild;let ae=m=0;for(y.length=0;Z!=null;){var he=Z.nodeName;if(he==="TD"||he==="TH"){he=Z,he={elem:he,hasBackgroundColor:he.style.backgroundColor!=="",highlighted:!1,x:m,y:ae},Z._cell=he;let se=y[ae];se===void 0&&(se=y[ae]=[]),se[m]=he}else if(he=Z.firstChild,he!=null){Z=he;continue}if(he=Z.nextSibling,he!=null)m++,Z=he;else if(he=Z.parentNode,he!=null){if(Z=he.nextSibling,Z==null)break;ae++,m=0}}return M.columns=m+1,M.rows=ae+1,M}function W(m,y,M){let Z=new Set(M?M.getNodes():[]);P(y,(ae,he)=>{let se=ae.elem;Z.has(he)?(ae.highlighted=!0,le(m,ae)):(ae.highlighted=!1,j(m,ae),se.getAttribute("style")||se.removeAttribute("style"))})}function P(m,y){({cells:m}=m);for(let M=0;M<m.length;M++){let Z=m[M];if(Z)for(let ae=0;ae<Z.length;ae++){let he=Z[ae];if(!he)continue;let se=t.$getNearestNodeFromDOMNode(he.elem);se!==null&&y(he,se,{x:ae,y:M})}}}function H(m,y){y.disableHighlightStyle(),P(y.grid,M=>{M.highlighted=!0,le(m,M)})}function B(m,y){y.enableHighlightStyle(),P(y.grid,M=>{let Z=M.elem;M.highlighted=!1,j(m,M),Z.getAttribute("style")||Z.removeAttribute("style")})}let z=(m,y,M,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return M!==(he?m.grid.columns-1:0)?(m=y.getCellNodeFromCordsOrThrow(M+(he?1:-1),Z,m.grid),he?m.selectStart():m.selectEnd()):Z!==(he?m.grid.rows-1:0)?(m=y.getCellNodeFromCordsOrThrow(he?0:m.grid.columns-1,Z+(he?1:-1),m.grid),he?m.selectStart():m.selectEnd()):he?y.selectNext():y.selectPrevious(),!0;case"up":return Z!==0?y.getCellNodeFromCordsOrThrow(M,Z-1,m.grid).selectEnd():y.selectPrevious(),!0;case"down":return Z!==m.grid.rows-1?y.getCellNodeFromCordsOrThrow(M,Z+1,m.grid).selectStart():y.selectNext(),!0;default:return!1}},X=(m,y,M,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return M!==(he?m.grid.columns-1:0)&&m.setFocusCellForSelection(y.getCellFromCordsOrThrow(M+(he?1:-1),Z,m.grid)),!0;case"up":return Z!==0?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(M,Z-1,m.grid)),!0):!1;case"down":return Z!==m.grid.rows-1?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(M,Z+1,m.grid)),!0):!1;default:return!1}};function ee(m,y){if(t.$isRangeSelection(m)||t.DEPRECATED_$isGridSelection(m)){let M=y.isParentOf(m.anchor.getNode());return m=y.isParentOf(m.focus.getNode()),M&&m}return!1}function le(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||R(131),y.getBackgroundColor()===null?m.style.setProperty("background-color","rgb(172,206,247)"):m.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),m.style.setProperty("caret-color","transparent")}function j(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||R(131),y.getBackgroundColor()===null&&m.style.removeProperty("background-color"),m.style.removeProperty("background-image"),m.style.removeProperty("caret-color")}function U(m){return m=e.$findMatchingParent(m,p),p(m)?m:null}function q(m){return m=e.$findMatchingParent(m,D),D(m)?m:null}function me(m,y,M,Z,ae){let he=t.$getSelection();if(!ee(he,Z))return!1;if(t.$isRangeSelection(he)&&he.isCollapsed()){if(M==="backward"||M==="forward")return!1;let{anchor:Ue,focus:re}=he;var se=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p);if(!p(se)||!se.is(Te))return!1;if(Te=q(se),Te!==Z&&Te!=null){var be=m.getElementByKey(Te.getKey());if(be!=null)return ae.grid=$(be),me(m,y,M,Te,ae)}if(Te=m.getElementByKey(se.__key),be=m.getElementByKey(Ue.key),be==null||Te==null)return!1;if(Ue.type==="element")Te=be.getBoundingClientRect();else{if(Te=window.getSelection(),Te===null||Te.rangeCount===0)return!1;Te=Te.getRangeAt(0).getBoundingClientRect()}if(be=M==="up"?se.getFirstChild():se.getLastChild(),be==null||(m=m.getElementByKey(be.__key),m==null))return!1;if(m=m.getBoundingClientRect(),M==="up"?m.top>Te.top-Te.height:Te.bottom+Te.height>m.bottom){if(_e(y),m=Z.getCordsFromCellNode(se,ae.grid),y.shiftKey)M=Z.getCellFromCordsOrThrow(m.x,m.y,ae.grid),ae.setAnchorCellForSelection(M),ae.setFocusCellForSelection(M,!0);else return z(ae,Z,m.x,m.y,M);return!0}}else if(t.DEPRECATED_$isGridSelection(he)){let{anchor:Ue,focus:re}=he;return be=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p),[se]=he.getNodes(),m=m.getElementByKey(se.getKey()),!p(be)||!p(Te)||!D(se)||m==null?!1:(ae.updateTableGridSelection(he),m=$(m),be=Z.getCordsFromCellNode(be,m),be=Z.getCellFromCordsOrThrow(be.x,be.y,m),ae.setAnchorCellForSelection(be),_e(y),y.shiftKey?(y=Z.getCordsFromCellNode(Te,m),X(ae,se,y.x,y.y,M)):(Te.selectEnd(),!0))}return!1}function _e(m){m.preventDefault(),m.stopImmediatePropagation(),m.stopPropagation()}class pe extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(y){return new pe(y.__key)}static importDOM(){return{table:()=>({conversion:ue,priority:1})}}static importJSON(){return K()}constructor(y){super(y)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(y){let M=document.createElement("table");return e.addClassNamesToElement(M,y.theme.table),M}updateDOM(){return!1}exportDOM(y){return{...super.exportDOM(y),after:M=>{if(M){let Z=M.cloneNode(),ae=document.createElement("colgroup"),he=document.createElement("tbody");if(e.isHTMLElement(M)&&he.append(...M.children),M=this.getFirstChildOrThrow(),!O(M))throw Error("Expected to find row node.");M=M.getChildrenSize();for(let se=0;se<M;se++){let Te=document.createElement("col");ae.append(Te)}return Z.replaceChildren(ae,he),Z}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(y,M){let{rows:Z,cells:ae}=M;for(M=0;M<Z;M++){var he=ae[M];if(he!=null&&(he=he.findIndex(se=>{if(se)return{elem:se}=se,t.$getNearestNodeFromDOMNode(se)===y}),he!==-1))return{x:he,y:M}}throw Error("Cell not found in table.")}getCellFromCords(y,M,Z){return{cells:Z}=Z,M=Z[M],M==null?null:(y=M[y],y??null)}getCellFromCordsOrThrow(y,M,Z){if(y=this.getCellFromCords(y,M,Z),!y)throw Error("Cell not found at cords.");return y}getCellNodeFromCords(y,M,Z){return y=this.getCellFromCords(y,M,Z),y==null?null:(y=t.$getNearestNodeFromDOMNode(y.elem),p(y)?y:null)}getCellNodeFromCordsOrThrow(y,M,Z){if(y=this.getCellNodeFromCords(y,M,Z),!y)throw Error("Node at cords not TableCellNode.");return y}canSelectBefore(){return!0}canIndent(){return!1}}function ue(){return{node:K()}}function K(){return t.$applyNodeReplacement(new pe)}function D(m){return m instanceof pe}function V(m){if(m=e.$findMatchingParent(m,y=>O(y)),O(m))return m;throw Error("Expected table cell to be inside of table row.")}function ne(m){if(m=e.$findMatchingParent(m,y=>D(y)),D(m))return m;throw Error("Expected table cell to be inside of table.")}function Y(m,y){let M=ne(m),{x:Z,y:ae}=M.getCordsFromCellNode(m,y);return{above:M.getCellNodeFromCords(Z,ae-1,y),below:M.getCellNodeFromCords(Z,ae+1,y),left:M.getCellNodeFromCords(Z-1,ae,y),right:M.getCellNodeFromCords(Z+1,ae,y)}}function G(m){let y=m.getFirstDescendant();y==null?m.selectStart():y.getParentOrThrow().selectStart()}function Q(m,y){let M=m.getFirstChild();M!==null?M.insertBefore(y):m.append(y)}let k=t.createCommand("INSERT_TABLE_COMMAND");return Yt.$createTableCellNode=g,Yt.$createTableNode=K,Yt.$createTableNodeWithDimensions=function(m,y,M=!0){let Z=K();for(let he=0;he<m;he++){let se=T();for(let Te=0;Te<y;Te++){var ae=r.NO_STATUS;typeof M=="object"?(he===0&&M.rows&&(ae|=r.ROW),Te===0&&M.columns&&(ae|=r.COLUMN)):M&&(he===0&&(ae|=r.ROW),Te===0&&(ae|=r.COLUMN)),ae=g(ae);let be=t.$createParagraphNode();be.append(t.$createTextNode()),ae.append(be),se.append(ae)}Z.append(se)}return Z},Yt.$createTableRowNode=T,Yt.$deleteTableColumn=function(m,y){let M=m.getChildren();for(let ae=0;ae<M.length;ae++){var Z=M[ae];if(O(Z)){if(Z=Z.getChildren(),y>=Z.length||0>y)throw Error("Table column target index out of range");Z[y].remove()}}return m},Yt.$deleteTableColumn__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[M,,Z]=t.DEPRECATED_$getNodeTriplet(y);[y]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,M,y);var{startColumn:Te}=he;let{startRow:be,startColumn:Ue}=se;m=Math.min(Te,Ue),Te=Math.max(Te+M.__colSpan-1,Ue+y.__colSpan-1);let re=Te-m+1;if(ae[0].length===Te-m+1)Z.selectPrevious(),Z.remove();else{var te=ae.length;for(let ce=0;ce<te;ce++)for(let we=m;we<=Te;we++){let{cell:Le,startColumn:Be}=ae[ce][we];Be<m?we===m&&Le.setColSpan(Le.__colSpan-Math.min(re,Le.__colSpan-(m-Be))):Be+Le.__colSpan-1>Te?we===Te&&Le.setColSpan(Le.__colSpan-(Te-Be+1)):Le.remove()}m=ae[be],y=m[Ue+y.__colSpan],y!==void 0?({cell:y}=y,G(y)):({cell:y}=m[Ue-1],G(y))}},Yt.$deleteTableRow__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[M,,Z]=t.DEPRECATED_$getNodeTriplet(y);[m]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,M,m);({startRow:y}=he);var{startRow:Te}=se;if(m=Te+m.__rowSpan-1,ae.length===m-y+1)Z.remove();else{Te=ae[0].length;var be=ae[m+1],Ue=Z.getChildAtIndex(m+1);for(let te=m;te>=y;te--){for(var re=Te-1;0<=re;re--){let{cell:ce,startRow:we,startColumn:Le}=ae[te][re];if(Le===re&&(te===y&&we<y&&ce.setRowSpan(ce.__rowSpan-(we-y)),we>=y&&we+ce.__rowSpan-1>m))if(ce.setRowSpan(ce.__rowSpan-(m-we+1)),Ue===null&&R(122),re===0)Q(Ue,ce);else{let{cell:Be}=be[re-1];Be.insertAfter(ce)}}re=Z.getChildAtIndex(te),t.DEPRECATED_$isGridRowNode(re)||R(123,String(te)),re.remove()}be!==void 0?({cell:y}=be[0],G(y)):({cell:y}=ae[y-1][0],G(y))}},Yt.$getElementGridForTableNode=function(m,y){if(m=m.getElementByKey(y.getKey()),m==null)throw Error("Table Element Not Found");return $(m)},Yt.$getTableCellNodeFromLexicalNode=function(m){return m=e.$findMatchingParent(m,y=>p(y)),p(m)?m:null},Yt.$getTableColumnIndexFromTableCellNode=function(m){return V(m).getChildren().findIndex(y=>y.is(m))},Yt.$getTableNodeFromLexicalNodeOrThrow=ne,Yt.$getTableRowIndexFromTableCellNode=function(m){let y=V(m);return ne(y).getChildren().findIndex(M=>M.is(y))},Yt.$getTableRowNodeFromTableCellNodeOrThrow=V,Yt.$insertTableColumn=function(m,y,M=!0,Z,ae){let he=m.getChildren(),se=[];for(let Ue=0;Ue<he.length;Ue++){let re=he[Ue];if(O(re))for(let te=0;te<Z;te++){var Te=re.getChildren();if(y>=Te.length||0>y)throw Error("Table column target index out of range");Te=Te[y],p(Te)||R(12);let{left:ce,right:we}=Y(Te,ae);var be=r.NO_STATUS;(ce&&ce.hasHeaderState(r.ROW)||we&&we.hasHeaderState(r.ROW))&&(be|=r.ROW),be=g(be),be.append(t.$createParagraphNode()),se.push({newTableCell:be,targetCell:Te})}}return se.forEach(({newTableCell:Ue,targetCell:re})=>{M?re.insertAfter(Ue):re.insertBefore(Ue)}),m},Yt.$insertTableColumn__EXPERIMENTAL=function(m=!0){function y(){let te=g(r.NO_STATUS).append(t.$createParagraphNode());return Ue===null&&(Ue=te),te}var M=t.$getSelection();if(!t.$INTERNAL_isPointSelection(M))throw Error("Expected a PointSeleciton");var Z=M.anchor.getNode();M=M.focus.getNode(),[Z]=t.DEPRECATED_$getNodeTriplet(Z);let[ae,,he]=t.DEPRECATED_$getNodeTriplet(M),[se,Te,be]=t.DEPRECATED_$computeGridMap(he,ae,Z);Z=se.length,M=m?Math.max(Te.startColumn,be.startColumn):Math.min(Te.startColumn,be.startColumn),m=m?M+ae.__colSpan-1:M-1,M=he.getFirstChild(),t.DEPRECATED_$isGridRowNode(M)||R(120);let Ue=null;var re=M;e:for(M=0;M<Z;M++){M!==0&&(re=re.getNextSibling(),t.DEPRECATED_$isGridRowNode(re)||R(121));let te=se[M];if(0>m){Q(re,y());continue}let{cell:ce,startColumn:we,startRow:Le}=te[m];if(we+ce.__colSpan-1<=m){let Be=ce,Ye=Le,ct=m;for(;Ye!==M&&1<Be.__rowSpan;)if(ct-=ce.__colSpan,0<=ct){let{cell:yt,startRow:dt}=te[ct];Be=yt,Ye=dt}else{re.append(y());continue e}Be.insertAfter(y())}else ce.setColSpan(ce.__colSpan+1)}Ue!==null&&G(Ue)},Yt.$insertTableRow=function(m,y,M=!0,Z,ae){var he=m.getChildren();if(y>=he.length||0>y)throw Error("Table row target index out of range");if(y=he[y],O(y))for(he=0;he<Z;he++){let Te=y.getChildren(),be=Te.length,Ue=T();for(let re=0;re<be;re++){var se=Te[re];p(se)||R(12);let{above:te,below:ce}=Y(se,ae);se=r.NO_STATUS;let we=te&&te.getWidth()||ce&&ce.getWidth()||void 0;(te&&te.hasHeaderState(r.COLUMN)||ce&&ce.hasHeaderState(r.COLUMN))&&(se|=r.COLUMN),se=g(se,1,we),se.append(t.$createParagraphNode()),Ue.append(se)}M?y.insertAfter(Ue):y.insertBefore(Ue)}else throw Error("Row before insertion index does not exist.");return m},Yt.$insertTableRow__EXPERIMENTAL=function(m=!0){var y=t.$getSelection();if(!t.$INTERNAL_isPointSelection(y))throw Error("Expected a INTERNAL_PointSelection");y=y.focus.getNode();let[M,,Z]=t.DEPRECATED_$getNodeTriplet(y),[ae,he]=t.DEPRECATED_$computeGridMap(Z,M,M);y=ae[0].length;var{startRow:se}=he;if(m){m=se+M.__rowSpan-1;var Te=ae[m];se=T();for(var be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re+Ue.__rowSpan-1<=m?se.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(m),t.DEPRECATED_$isGridRowNode(y)||R(119),y.insertAfter(se)}else{for(Te=ae[se],m=T(),be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re===se?m.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(se),t.DEPRECATED_$isGridRowNode(y)||R(119),y.insertBefore(m)}},Yt.$isTableCellNode=p,Yt.$isTableNode=D,Yt.$isTableRowNode=O,Yt.$removeTableRowAtIndex=function(m,y){let M=m.getChildren();if(y>=M.length||0>y)throw Error("Expected table cell to be inside of table row.");return M[y].remove(),m},Yt.$unmergeCell=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");m=m.anchor.getNode();let[y,M,Z]=t.DEPRECATED_$getNodeTriplet(m);m=y.__colSpan;let ae=y.__rowSpan;if(1<m){for(var he=1;he<m;he++)y.insertAfter(g(r.NO_STATUS));y.setColSpan(1)}if(1<ae){let[be,Ue]=t.DEPRECATED_$computeGridMap(Z,y,y),{startColumn:re,startRow:te}=Ue,ce;for(he=1;he<ae;he++){var se=te+he;let we=be[se];ce=(ce||M).getNextSibling(),t.DEPRECATED_$isGridRowNode(ce)||R(125);var Te=null;for(let Le=0;Le<re;Le++){let Be=we[Le],Ye=Be.cell;Be.startRow===se&&(Te=Ye),1<Ye.__colSpan&&(Le+=Ye.__colSpan-1)}if(Te===null)for(Te=0;Te<m;Te++)Q(ce,g(r.NO_STATUS));else for(se=0;se<m;se++)Te.insertAfter(g(r.NO_STATUS))}y.setRowSpan(1)}},Yt.INSERT_TABLE_COMMAND=k,Yt.TableCellHeaderStates=r,Yt.TableCellNode=c,Yt.TableNode=pe,Yt.TableRowNode=C,Yt.TableSelection=x,Yt.applyTableHandlers=function(m,y,M,Z){function ae(re){return re=m.getCordsFromCellNode(re,se.grid),m.getCellFromCordsOrThrow(re.x,re.y,se.grid)}let he=M.getRootElement();if(he===null)throw Error("No root element.");let se=new x(M,m.getKey()),Te=M._window||window;y.__lexicalTableSelection=se,y.addEventListener("mousedown",re=>{setTimeout(()=>{if(re.button===0&&Te){var te=w(re.target);te!==null&&(_e(re),se.setAnchorCellForSelection(te));var ce=()=>{Te.removeEventListener("mouseup",ce),Te.removeEventListener("mousemove",we)},we=Le=>{const Be=w(Le.target);Be===null||se.anchorX===Be.x&&se.anchorY===Be.y||(Le.preventDefault(),se.setFocusCellForSelection(Be))};Te.addEventListener("mouseup",ce),Te.addEventListener("mousemove",we)}},0)});let be=re=>{re.button===0&&M.update(()=>{const te=t.$getSelection(),ce=re.target;t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&he.contains(ce)&&se.clearHighlight()})};Te.addEventListener("mousedown",be),se.listenersToRemove.add(()=>Te.removeEventListener("mousedown",be)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_DOWN_COMMAND,re=>me(M,re,"down",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_UP_COMMAND,re=>me(M,re,"up",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_LEFT_COMMAND,re=>me(M,re,"backward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,re=>me(M,re,"forward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ESCAPE_COMMAND,re=>{var te=t.$getSelection();return t.DEPRECATED_$isGridSelection(te)&&(te=e.$findMatchingParent(te.focus.getNode(),p),p(te))?(_e(re),te.selectEnd(),!0):!1},t.COMMAND_PRIORITY_HIGH));let Ue=re=>()=>{var te=t.$getSelection();if(!ee(te,m))return!1;if(t.DEPRECATED_$isGridSelection(te))return se.clearText(),!0;if(t.$isRangeSelection(te)){const Le=e.$findMatchingParent(te.anchor.getNode(),Be=>p(Be));if(!p(Le))return!1;var ce=te.anchor.getNode(),we=te.focus.getNode();if(ce=m.isParentOf(ce),we=m.isParentOf(we),ce&&!we||we&&!ce)return se.clearText(),!0;if(ce=(we=e.$findMatchingParent(te.anchor.getNode(),Be=>t.$isElementNode(Be)))&&e.$findMatchingParent(we,Be=>t.$isElementNode(Be)&&p(Be.getParent())),!t.$isElementNode(ce)||!t.$isElementNode(we))return!1;if(re===t.DELETE_LINE_COMMAND&&ce.getPreviousSibling()===null)return!0;if((re===t.DELETE_CHARACTER_COMMAND||re===t.DELETE_WORD_COMMAND)&&te.isCollapsed()&&te.anchor.offset===0&&we!==ce){te=we.getChildren();const Be=t.$createParagraphNode();return te.forEach(Ye=>Be.append(Ye)),we.replace(Be),we.getWritable().__parent=Le.getKey(),!0}}return!1};return[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(re=>{se.listenersToRemove.add(M.registerCommand(re,Ue(re),t.COMMAND_PRIORITY_CRITICAL))}),y=re=>{const te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(re.preventDefault(),re.stopPropagation(),se.clearText(),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},se.listenersToRemove.add(M.registerCommand(t.KEY_BACKSPACE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.KEY_DELETE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.FORMAT_TEXT_COMMAND,re=>{let te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(se.formatCells(re),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var re=t.$getSelection();return ee(re,m)&&(t.DEPRECATED_$isGridSelection(re)?se.clearHighlight():t.$isRangeSelection(re)&&(re=e.$findMatchingParent(re.anchor.getNode(),te=>p(te)),p(re))),!1},t.COMMAND_PRIORITY_CRITICAL)),Z&&se.listenersToRemove.add(M.registerCommand(t.KEY_TAB_COMMAND,re=>{var te=t.$getSelection();return!t.$isRangeSelection(te)||!te.isCollapsed()||!ee(te,m)||(te=U(te.anchor.getNode()),te===null)?!1:(_e(re),te=m.getCordsFromCellNode(te,se.grid),z(se,m,te.x,te.y,re.shiftKey?"backward":"forward"),!0)},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.FOCUS_COMMAND,()=>m.isSelected(),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{let re=t.$getSelection(),te=t.$getPreviousSelection();if(t.$isRangeSelection(re)){let{anchor:Ye,focus:ct}=re;var ce=Ye.getNode(),we=ct.getNode();ce=U(ce),we=U(we);var Le=ce&&m.is(q(ce)),Be=we&&m.is(q(we));let yt=Le!==Be;Be=Le&&Be,Le=re.isBackward(),yt?(ce=re.clone(),ce.focus.set(m.getKey(),Le?0:m.getChildrenSize(),"element"),t.$setSelection(ce),H(M,se)):Be&&!ce.is(we)&&(se.setAnchorCellForSelection(ae(ce)),se.setFocusCellForSelection(ae(we),!0))}return re&&!re.is(te)&&(t.DEPRECATED_$isGridSelection(re)||t.DEPRECATED_$isGridSelection(te))&&se.gridSelection&&!se.gridSelection.is(te)?(t.DEPRECATED_$isGridSelection(re)&&re.gridKey===se.tableNodeKey?se.updateTableGridSelection(re):!t.DEPRECATED_$isGridSelection(re)&&t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&se.updateTableGridSelection(null),!1):(se.hasHijackedSelectionStyles&&!m.isSelected()?B(M,se):!se.hasHijackedSelectionStyles&&m.isSelected()&&H(M,se),!1)},t.COMMAND_PRIORITY_CRITICAL)),se},Yt.getCellFromTarget=w,Yt.getTableSelectionFromTableElement=function(m){return m.__lexicalTableSelection},Yt}var vu,vh;function Nd(){return vh||(vh=1,vu=process.env.NODE_ENV==="development"?MC():RC()),vu}var Sh;function bC(){if(Sh)return xu;Sh=1;var t=Un(),e=Nd(),n=on(),r=Bt(),c=et;function d({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:C=!0}){const[v]=t.useLexicalComposerContext();return c.useEffect(()=>{if(!v.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return v.registerCommand(e.INSERT_TABLE_COMMAND,({columns:T,rows:O,includeHeaders:R})=>{const b=e.$createTableNodeWithDimensions(Number(O),Number(T),R);n.$insertNodeToNearestRoot(b);const x=b.getFirstDescendant();return r.$isTextNode(x)&&x.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[v]),c.useEffect(()=>{const T=new Map,O=b=>{const x=b.getKey(),w=v.getElementByKey(x);if(w&&!T.has(x)){const $=e.applyTableHandlers(b,w,v,C);T.set(x,$)}};v.getEditorState().read(()=>{const b=r.$nodesOfType(e.TableNode);for(const x of b)e.$isTableNode(x)&&O(x)});const R=v.registerMutationListener(e.TableNode,b=>{for(const[x,w]of b)if(w==="created")v.getEditorState().read(()=>{const $=r.$getNodeByKey(x);e.$isTableNode($)&&O($)});else if(w==="destroyed"){const $=T.get(x);$!==void 0&&($.removeListeners(),T.delete(x))}});return()=>{R();for(const[,b]of T)b.removeListeners()}},[v,C]),c.useEffect(()=>{if(!g)return v.registerNodeTransform(e.TableCellNode,T=>{if(T.getColSpan()>1||T.getRowSpan()>1){const[,,O]=r.DEPRECATED_$getNodeTriplet(T),[R]=r.DEPRECATED_$computeGridMap(O,T,T),b=R.length,x=R[0].length;let w=O.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(w))throw Error("Expected TableNode first child to be a RowNode");const $=[];for(let W=0;W<b;W++){if(W!==0&&(w=w.getNextSibling(),!r.DEPRECATED_$isGridRowNode(w)))throw Error("Expected TableNode first child to be a RowNode");let P=null;for(let H=0;H<x;H++){const B=R[W][H],z=B.cell;if(B.startRow===W&&B.startColumn===H)P=z,$.push(z);else if(z.getColSpan()>1||z.getRowSpan()>1){const X=e.$createTableCellNode(z.__headerState);P!==null?P.insertAfter(X):n.$insertFirst(w,X)}}}for(const W of $)W.setColSpan(1),W.setRowSpan(1)}})},[v,g]),c.useEffect(()=>{if(!p)return v.registerNodeTransform(e.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[v,p,g]),null}return xu.TablePlugin=d,xu}var Su={},wh;function LC(){if(wh)return Su;wh=1;var t=Un(),e=Nd(),n=on(),r=Bt(),c=et;function d(g){let p=new URLSearchParams;p.append("code",g);for(let C=1;C<arguments.length;C++)p.append("v",arguments[C]);throw Error(`Minified Lexical error #${g}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Su.TablePlugin=function({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:C=!0}){let[v]=t.useLexicalComposerContext();return c.useEffect(()=>(v.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode])||d(10),v.registerCommand(e.INSERT_TABLE_COMMAND,({columns:T,rows:O,includeHeaders:R})=>(T=e.$createTableNodeWithDimensions(Number(O),Number(T),R),n.$insertNodeToNearestRoot(T),T=T.getFirstDescendant(),r.$isTextNode(T)&&T.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[v]),c.useEffect(()=>{let T=new Map,O=b=>{const x=b.getKey(),w=v.getElementByKey(x);w&&!T.has(x)&&(b=e.applyTableHandlers(b,w,v,C),T.set(x,b))};v.getEditorState().read(()=>{let b=r.$nodesOfType(e.TableNode);for(let x of b)e.$isTableNode(x)&&O(x)});let R=v.registerMutationListener(e.TableNode,b=>{for(const[x,w]of b)w==="created"?v.getEditorState().read(()=>{const $=r.$getNodeByKey(x);e.$isTableNode($)&&O($)}):w==="destroyed"&&(b=T.get(x),b!==void 0&&(b.removeListeners(),T.delete(x)))});return()=>{R();for(let[,b]of T)b.removeListeners()}},[v,C]),c.useEffect(()=>{if(!g)return v.registerNodeTransform(e.TableCellNode,T=>{if(1<T.getColSpan()||1<T.getRowSpan()){var[,,O]=r.DEPRECATED_$getNodeTriplet(T);[T]=r.DEPRECATED_$computeGridMap(O,T,T);let b=T.length,x=T[0].length;if(O=O.getFirstChild(),!r.DEPRECATED_$isGridRowNode(O))throw Error("Expected TableNode first child to be a RowNode");let w=[];for(let $=0;$<b;$++){if($!==0&&(O=O.getNextSibling(),!r.DEPRECATED_$isGridRowNode(O)))throw Error("Expected TableNode first child to be a RowNode");let W=null;for(let P=0;P<x;P++){var R=T[$][P];let H=R.cell;R.startRow===$&&R.startColumn===P?(W=H,w.push(H)):(1<H.getColSpan()||1<H.getRowSpan())&&(R=e.$createTableCellNode(H.__headerState),W!==null?W.insertAfter(R):n.$insertFirst(O,R))}}for(let $ of w)$.setColSpan(1),$.setRowSpan(1)}})},[v,g]),c.useEffect(()=>{if(!p)return v.registerNodeTransform(e.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[v,p,g]),null},Su}const kC=process.env.NODE_ENV==="development"?bC():LC();var IC=kC,An={},wu={exports:{}},Oh;function Op(){return Oh||(Oh=1,function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
71
+ `?z.insertParagraph():me===" "?z.insertNodes([r.$createTabNode()]):z.insertText(me)}}else z.insertRawText(j)}function T(B,z,X){const ee=r.DEPRECATED_$isGridSelection(X),le=r.$isRangeSelection(X);if((ee||le&&n.$findMatchingParent(X.anchor.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null&&n.$findMatchingParent(X.focus.getNode(),U=>r.DEPRECATED_$isGridCellNode(U))!==null)&&z.length===1&&r.DEPRECATED_$isGridNode(z[0])){O(z,X,!1,B);return}X.insertNodes(z)}function O(B,z,X,ee){if(B.length!==1||!r.DEPRECATED_$isGridNode(B[0]))throw Error("$mergeGridNodesStrategy: Expected Grid insertion.");const le=B[0],j=le.getChildren(),U=le.getFirstChildOrThrow().getChildrenSize(),q=le.getChildrenSize(),me=n.$findMatchingParent(z.anchor.getNode(),Z=>r.DEPRECATED_$isGridCellNode(Z)),_e=me&&n.$findMatchingParent(me,Z=>r.DEPRECATED_$isGridRowNode(Z)),pe=_e&&n.$findMatchingParent(_e,Z=>r.DEPRECATED_$isGridNode(Z));if(!r.DEPRECATED_$isGridCellNode(me)||!r.DEPRECATED_$isGridRowNode(_e)||!r.DEPRECATED_$isGridNode(pe))throw Error("$mergeGridNodesStrategy: Expected selection to be inside of a Grid.");const ue=_e.getIndexWithinParent(),K=Math.min(pe.getChildrenSize()-1,ue+q-1),D=me.getIndexWithinParent(),V=Math.min(_e.getChildrenSize()-1,D+U-1),ne=Math.min(D,V),Y=Math.min(ue,K),G=Math.max(D,V),Q=Math.max(ue,K),k=pe.getChildren();let m=0,y,M;for(let Z=Y;Z<=Q;Z++){const ae=k[Z];if(!r.DEPRECATED_$isGridRowNode(ae))throw Error("getNodes: expected to find GridRowNode");const he=j[m];if(!r.DEPRECATED_$isGridRowNode(he))throw Error("getNodes: expected to find GridRowNode");const se=ae.getChildren(),Te=he.getChildren();let be=0;for(let Ue=ne;Ue<=G;Ue++){const re=se[Ue];if(!r.DEPRECATED_$isGridCellNode(re))throw Error("getNodes: expected to find GridCellNode");const te=Te[be];if(!r.DEPRECATED_$isGridCellNode(te))throw Error("getNodes: expected to find GridCellNode");Z===Y&&Ue===ne?y=re.getKey():Z===Q&&Ue===G&&(M=re.getKey());const ce=re.getChildren();te.getChildren().forEach(we=>{r.$isTextNode(we)&&r.$createParagraphNode().append(we),re.append(we)}),ce.forEach(we=>we.remove()),be++}m++}if(y&&M){const Z=r.DEPRECATED_$createGridSelection();Z.set(pe.getKey(),y,M),r.$setSelection(Z),ee.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0)}}function b(B){const z=B.exportJSON(),X=B.constructor;if(z.type!==X.getType())throw Error(`LexicalNode: Node ${X.name} does not implement .exportJSON().`);const ee=z.children;if(r.$isElementNode(B)&&!Array.isArray(ee))throw Error(`LexicalNode: Node ${X.name} is an element but .exportJSON() does not have a children array.`);return z}function R(B,z,X,ee=[]){let le=z!=null?X.isSelected(z):!0;const j=r.$isElementNode(X)&&X.excludeFromCopy("html");let U=X;if(z!==null){let _e=e.$cloneWithProperties(X);_e=r.$isTextNode(_e)&&z!=null?e.$sliceSelectedTextNodeContent(z,_e):_e,U=_e}const q=r.$isElementNode(U)?U.getChildren():[],me=b(U);if(r.$isTextNode(U)){const _e=U.__text;_e.length>0?me.text=_e:le=!1}for(let _e=0;_e<q.length;_e++){const pe=q[_e],ue=R(B,z,pe,me.children);!le&&r.$isElementNode(X)&&ue&&X.extractWithChild(pe,z,"clone")&&(le=!0)}if(le&&!j)ee.push(me);else if(Array.isArray(me.children))for(let _e=0;_e<me.children.length;_e++){const pe=me.children[_e];ee.push(pe)}return le}function x(B,z){const X=[],le=r.$getRoot().getChildren();for(let j=0;j<le.length;j++){const U=le[j];R(B,z,U,X)}return{namespace:B._config.namespace,nodes:X}}function w(B){const z=[];for(let X=0;X<B.length;X++){const ee=B[X],le=r.$parseSerializedNode(ee);r.$isTextNode(le)&&e.$addNodeStyle(le),z.push(le)}return z}const P=50;let H=null;async function $(B,z){if(H!==null)return!1;if(z!==null)return new Promise((q,me)=>{B.update(()=>{q(W(B,z))})});const X=B.getRootElement(),ee=B._window==null?window.document:B._window.document,le=d(B._window);if(X===null||le===null)return!1;const j=ee.createElement("span");j.style.cssText="position: fixed; top: -1000px;",j.append(ee.createTextNode("#")),X.append(j);const U=new Range;return U.setStart(j,0),U.setEnd(j,1),le.removeAllRanges(),le.addRange(U),new Promise((q,me)=>{const _e=B.registerCommand(r.COPY_COMMAND,pe=>(n.objectKlassEquals(pe,ClipboardEvent)&&(_e(),H!==null&&(window.clearTimeout(H),H=null),q(W(B,pe))),!0),r.COMMAND_PRIORITY_CRITICAL);H=window.setTimeout(()=>{_e(),H=null,q(!1)},P),ee.execCommand("copy"),j.remove()})}function W(B,z){const X=d(B._window);if(!X)return!1;const ee=X.anchorNode,le=X.focusNode;if(ee!==null&&le!==null&&!r.isSelectionWithinEditor(B,ee,le))return!1;z.preventDefault();const j=z.clipboardData,U=r.$getSelection();if(j===null||U===null)return!1;const q=g(B),me=p(B);let _e="";return U!==null&&(_e=U.getTextContent()),q!==null&&j.setData("text/html",q),me!==null&&j.setData("application/x-lexical-editor",me),j.setData("text/plain",_e),!0}return Li.$generateJSONFromSelectedNodes=x,Li.$generateNodesFromSerializedNodes=w,Li.$getHtmlContent=g,Li.$getLexicalContent=p,Li.$insertDataTransferForPlainText=N,Li.$insertDataTransferForRichText=v,Li.$insertGeneratedNodes=T,Li.copyToClipboard=$,Li}var ki={},th;function nC(){if(th)return ki;th=1;var t=Sp(),e=Mo(),n=on(),r=Bt();function c(w){let P=new URLSearchParams;P.append("code",w);for(let H=1;H<arguments.length;H++)P.append("v",arguments[H]);throw Error(`Minified Lexical error #${w}; visit https://lexical.dev/docs/error?${P} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g(w){let P=r.$getSelection();if(P==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(P)&&P.isCollapsed()||P.getNodes().length===0?"":t.$generateHtmlFromNodes(w,P)}function p(w){let P=r.$getSelection();if(P==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(P)&&P.isCollapsed()||P.getNodes().length===0?null:JSON.stringify(O(w,P))}function N(w,P,H){let $=r.DEPRECATED_$isGridSelection(H),W=r.$isRangeSelection(H);($||W&&n.$findMatchingParent(H.anchor.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null&&n.$findMatchingParent(H.focus.getNode(),B=>r.DEPRECATED_$isGridCellNode(B))!==null)&&P.length===1&&r.DEPRECATED_$isGridNode(P[0])?v(P,H,!1,w):H.insertNodes(P)}function v(w,P,H,$){w.length===1&&r.DEPRECATED_$isGridNode(w[0])||c(42);var W=w[0];w=W.getChildren(),H=W.getFirstChildOrThrow().getChildrenSize();var B=W.getChildrenSize(),z=n.$findMatchingParent(P.anchor.getNode(),me=>r.DEPRECATED_$isGridCellNode(me));P=(W=z&&n.$findMatchingParent(z,me=>r.DEPRECATED_$isGridRowNode(me)))&&n.$findMatchingParent(W,me=>r.DEPRECATED_$isGridNode(me)),r.DEPRECATED_$isGridCellNode(z)&&r.DEPRECATED_$isGridRowNode(W)&&r.DEPRECATED_$isGridNode(P)||c(43);var X=W.getIndexWithinParent(),ee=Math.min(P.getChildrenSize()-1,X+B-1);B=z.getIndexWithinParent(),z=Math.min(W.getChildrenSize()-1,B+H-1),H=Math.min(B,z),W=Math.min(X,ee),B=Math.max(B,z),X=Math.max(X,ee),ee=P.getChildren(),z=0;let le,j;for(let me=W;me<=X;me++){var U=ee[me];r.DEPRECATED_$isGridRowNode(U)||c(24);var q=w[z];r.DEPRECATED_$isGridRowNode(q)||c(24),U=U.getChildren(),q=q.getChildren();let _e=0;for(let pe=H;pe<=B;pe++){let ue=U[pe];r.DEPRECATED_$isGridCellNode(ue)||c(25);let K=q[_e];r.DEPRECATED_$isGridCellNode(K)||c(25),me===W&&pe===H?le=ue.getKey():me===X&&pe===B&&(j=ue.getKey());let D=ue.getChildren();K.getChildren().forEach(V=>{r.$isTextNode(V)&&r.$createParagraphNode().append(V),ue.append(V)}),D.forEach(V=>V.remove()),_e++}z++}le&&j&&(w=r.DEPRECATED_$createGridSelection(),w.set(P.getKey(),le,j),r.$setSelection(w),$.dispatchCommand(r.SELECTION_CHANGE_COMMAND,void 0))}function T(w,P,H,$=[]){let W=P!=null?H.isSelected(P):!0,B=r.$isElementNode(H)&&H.excludeFromCopy("html");var z=H;if(P!==null){var X=e.$cloneWithProperties(H);z=X=r.$isTextNode(X)&&P!=null?e.$sliceSelectedTextNodeContent(P,X):X}let ee=r.$isElementNode(z)?z.getChildren():[];var le=z;X=le.exportJSON();var j=le.constructor;X.type!==j.getType()&&c(58,j.name);let U=X.children;for(r.$isElementNode(le)&&(Array.isArray(U)||c(59,j.name)),r.$isTextNode(z)&&(z=z.__text,0<z.length?X.text=z:W=!1),z=0;z<ee.length;z++)le=ee[z],j=T(w,P,le,X.children),!W&&r.$isElementNode(H)&&j&&H.extractWithChild(le,P,"clone")&&(W=!0);if(W&&!B)$.push(X);else if(Array.isArray(X.children))for(w=0;w<X.children.length;w++)$.push(X.children[w]);return W}function O(w,P){let H=[],$=r.$getRoot().getChildren();for(let W=0;W<$.length;W++)T(w,P,$[W],H);return{namespace:w._config.namespace,nodes:H}}function b(w){let P=[];for(let H=0;H<w.length;H++){let $=r.$parseSerializedNode(w[H]);r.$isTextNode($)&&e.$addNodeStyle($),P.push($)}return P}let R=null;function x(w,P){var H=d?(w._window||window).getSelection():null;if(!H)return!1;var $=H.anchorNode;if(H=H.focusNode,$!==null&&H!==null&&!r.isSelectionWithinEditor(w,$,H)||(P.preventDefault(),P=P.clipboardData,$=r.$getSelection(),P===null||$===null))return!1;H=g(w),w=p(w);let W="";return $!==null&&(W=$.getTextContent()),H!==null&&P.setData("text/html",H),w!==null&&P.setData("application/x-lexical-editor",w),P.setData("text/plain",W),!0}return ki.$generateJSONFromSelectedNodes=O,ki.$generateNodesFromSerializedNodes=b,ki.$getHtmlContent=g,ki.$getLexicalContent=p,ki.$insertDataTransferForPlainText=function(w,P){w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null&&P.insertRawText(w)},ki.$insertDataTransferForRichText=function(w,P,H){var $=w.getData("application/x-lexical-editor");if($)try{let B=JSON.parse($);if(B.namespace===H._config.namespace&&Array.isArray(B.nodes)){let z=b(B.nodes);return N(H,z,P)}}catch{}if($=w.getData("text/html"))try{var W=new DOMParser().parseFromString($,"text/html");let B=t.$generateNodesFromDOM(H,W);return N(H,B,P)}catch{}if(w=w.getData("text/plain")||w.getData("text/uri-list"),w!=null)if(r.$isRangeSelection(P))for(w=w.split(/(\r?\n|\t)/),w[w.length-1]===""&&w.pop(),H=0;H<w.length;H++)W=w[H],W===`
72
+ `||W===`\r
73
+ `?P.insertParagraph():W===" "?P.insertNodes([r.$createTabNode()]):P.insertText(W);else P.insertRawText(w)},ki.$insertGeneratedNodes=N,ki.copyToClipboard=async function(w,P){if(R!==null)return!1;if(P!==null)return new Promise(z=>{w.update(()=>{z(x(w,P))})});var H=w.getRootElement();let $=w._window==null?window.document:w._window.document,W=d?(w._window||window).getSelection():null;if(H===null||W===null)return!1;let B=$.createElement("span");return B.style.cssText="position: fixed; top: -1000px;",B.append($.createTextNode("#")),H.append(B),H=new Range,H.setStart(B,0),H.setEnd(B,1),W.removeAllRanges(),W.addRange(H),new Promise(z=>{let X=w.registerCommand(r.COPY_COMMAND,ee=>(n.objectKlassEquals(ee,ClipboardEvent)&&(X(),R!==null&&(window.clearTimeout(R),R=null),z(x(w,ee))),!0),r.COMMAND_PRIORITY_CRITICAL);R=window.setTimeout(()=>{X(),R=null,z(!1)},50),$.execCommand("copy"),B.remove()})},ki}var uu,nh;function wp(){return nh||(nh=1,uu=process.env.NODE_ENV==="development"?tC():nC()),uu}var rh;function rC(){if(rh)return ci;rh=1;var t=wp(),e=Mo(),n=on(),r=Bt();function c(_e,pe){if(typeof document.caretRangeFromPoint<"u"){const ue=document.caretRangeFromPoint(_e,pe);return ue===null?null:{node:ue.startContainer,offset:ue.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const ue=document.caretPositionFromPoint(_e,pe);return ue===null?null:{node:ue.offsetNode,offset:ue.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,N=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),v=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,b=r.createCommand("DRAG_DROP_PASTE_FILE");class R extends r.ElementNode{static getType(){return"quote"}static clone(pe){return new R(pe.__key)}constructor(pe){super(pe)}createDOM(pe){const ue=document.createElement("blockquote");return n.addClassNamesToElement(ue,pe.theme.quote),ue}updateDOM(pe,ue){return!1}static importDOM(){return{blockquote:pe=>({conversion:W,priority:0})}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const K=this.getFormatType();ue.style.textAlign=K;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=x();return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(pe,ue){const K=r.$createParagraphNode(),D=this.getDirection();return K.setDirection(D),this.insertAfter(K,ue),K}collapseAtStart(){const pe=r.$createParagraphNode();return this.getChildren().forEach(K=>pe.append(K)),this.replace(pe),!0}}function x(){return r.$applyNodeReplacement(new R)}function w(_e){return _e instanceof R}class P extends r.ElementNode{static getType(){return"heading"}static clone(pe){return new P(pe.__tag,pe.__key)}constructor(pe,ue){super(ue),this.__tag=pe}getTag(){return this.__tag}createDOM(pe){const ue=this.__tag,K=document.createElement(ue),V=pe.theme.heading;if(V!==void 0){const ne=V[ue];n.addClassNamesToElement(K,ne)}return K}updateDOM(pe,ue){return!1}static importDOM(){return{h1:pe=>({conversion:$,priority:0}),h2:pe=>({conversion:$,priority:0}),h3:pe=>({conversion:$,priority:0}),h4:pe=>({conversion:$,priority:0}),h5:pe=>({conversion:$,priority:0}),h6:pe=>({conversion:$,priority:0}),p:pe=>{const K=pe.firstChild;return K!==null&&H(K)?{conversion:()=>({node:null}),priority:3}:null},span:pe=>H(pe)?{conversion:ue=>({node:B("h1")}),priority:3}:null}}exportDOM(pe){const{element:ue}=super.exportDOM(pe);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const K=this.getFormatType();ue.style.textAlign=K;const D=this.getDirection();D&&(ue.dir=D)}return{element:ue}}static importJSON(pe){const ue=B(pe.tag);return ue.setFormat(pe.format),ue.setIndent(pe.indent),ue.setDirection(pe.direction),ue}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(pe,ue=!0){const K=pe?pe.anchor.offset:0,D=K===this.getTextContentSize()||!pe?r.$createParagraphNode():B(this.getTag()),V=this.getDirection();if(D.setDirection(V),this.insertAfter(D,ue),K===0&&!this.isEmpty()&&pe){const ne=r.$createParagraphNode();ne.select(),this.replace(ne,!0)}return D}collapseAtStart(){const pe=this.isEmpty()?r.$createParagraphNode():B(this.getTag());return this.getChildren().forEach(K=>pe.append(K)),this.replace(pe),!0}extractWithChild(){return!0}}function H(_e){return _e.nodeName.toLowerCase()==="span"?_e.style.fontSize==="26pt":!1}function $(_e){const pe=_e.nodeName.toLowerCase();let ue=null;return(pe==="h1"||pe==="h2"||pe==="h3"||pe==="h4"||pe==="h5"||pe==="h6")&&(ue=B(pe),_e.style!==null&&ue.setFormat(_e.style.textAlign)),{node:ue}}function W(_e){const pe=x();return _e.style!==null&&pe.setFormat(_e.style.textAlign),{node:pe}}function B(_e){return r.$applyNodeReplacement(new P(_e))}function z(_e){return _e instanceof P}function X(_e,pe){_e.preventDefault(),pe.update(()=>{const ue=r.$getSelection(),K=_e instanceof InputEvent||_e instanceof KeyboardEvent?null:_e.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(ue)&&t.$insertDataTransferForRichText(K,ue,pe)},{tag:"paste"})}async function ee(_e,pe){await t.copyToClipboard(pe,n.objectKlassEquals(_e,ClipboardEvent)?_e:null),pe.update(()=>{const ue=r.$getSelection();r.$isRangeSelection(ue)?ue.removeText():r.$isNodeSelection(ue)&&ue.getNodes().forEach(K=>K.remove())})}function le(_e){let pe=null;if(_e instanceof DragEvent?pe=_e.dataTransfer:_e instanceof ClipboardEvent&&(pe=_e.clipboardData),pe===null)return[!1,[],!1];const ue=pe.types,K=ue.includes("Files"),D=ue.includes("text/html")||ue.includes("text/plain");return[K,Array.from(pe.files),D]}function j(_e){const pe=r.$getSelection();if(!r.$isRangeSelection(pe))return!1;const ue=new Set,K=pe.getNodes();for(let D=0;D<K.length;D++){const V=K[D],ne=V.getKey();if(ue.has(ne))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(V),G=Y.getKey();Y.canIndent()&&!ue.has(G)&&(ue.add(G),_e(Y))}return ue.size>0}function U(_e){const pe=r.$getNearestNodeFromDOMNode(_e);return r.$isDecoratorNode(pe)}function q(_e){const pe=_e.focus;return pe.key==="root"&&pe.offset===r.$getRoot().getChildrenSize()}function me(_e){return n.mergeRegister(_e.registerCommand(r.CLICK_COMMAND,ue=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),_e.registerCommand(r.DELETE_CHARACTER_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_WORD_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DELETE_LINE_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,ue=>{const K=r.$getSelection();if(typeof ue=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(ue);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const D=ue.dataTransfer;if(D!=null)t.$insertDataTransferForRichText(D,K,_e);else if(r.$isRangeSelection(K)){const V=ue.data;return V&&K.insertText(V),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_TEXT_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.FORMAT_ELEMENT_COMMAND,ue=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const D=K.getNodes();for(const V of D){const ne=n.$findMatchingParent(V,Y=>r.$isElementNode(Y)&&!Y.isInline());ne!==null&&ne.setFormat(ue)}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_LINE_BREAK_COMMAND,ue=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.INDENT_CONTENT_COMMAND,()=>j(ue=>{const K=ue.getIndent();ue.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>j(ue=>{const K=ue.getIndent();K>0&&ue.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_UP_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!U(ue.target)){const D=K.getNodes();if(D.length>0)return D[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const D=r.$getAdjacentNode(K.focus,!0);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectPrevious(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_DOWN_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return D[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return ue.preventDefault(),!0;const D=r.$getAdjacentNode(K.focus,!1);if(!ue.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectNext(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_LEFT_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return ue.preventDefault(),D[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(e.$shouldOverrideDefaultCharacterSelection(K,!0)){const D=ue.shiftKey;return ue.preventDefault(),e.$moveCharacter(K,D,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,ue=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!U(ue.target)){const V=K.getNodes();if(V.length>0)return ue.preventDefault(),V[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const D=ue.shiftKey;return e.$shouldOverrideDefaultCharacterSelection(K,!1)?(ue.preventDefault(),e.$moveCharacter(K,D,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_BACKSPACE_COMMAND,ue=>{if(U(ue.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;ue.preventDefault();const{anchor:D}=K,V=D.getNode();return K.isCollapsed()&&D.offset===0&&!r.$isRootNode(V)&&n.$getNearestBlockElementAncestorOrThrow(V).getIndent()>0?_e.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_DELETE_COMMAND,ue=>{if(U(ue.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(ue.preventDefault(),_e.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ENTER_COMMAND,ue=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(ue!==null){if((v||N||O)&&p)return!1;if(ue.preventDefault(),ue.shiftKey)return _e.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return _e.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(_e.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DROP_COMMAND,ue=>{const[,K]=le(ue);if(K.length>0){const V=ue.clientX,ne=ue.clientY,Y=c(V,ne);if(Y!==null){const{offset:G,node:Q}=Y,k=r.$getNearestNodeFromDOMNode(Q);if(k!==null){const m=r.$createRangeSelection();if(r.$isTextNode(k))m.anchor.set(k.getKey(),G,"text"),m.focus.set(k.getKey(),G,"text");else{const M=k.getParentOrThrow().getKey(),Z=k.getIndexWithinParent()+1;m.anchor.set(M,Z,"element"),m.focus.set(M,Z,"element")}const y=r.$normalizeSelection__EXPERIMENTAL(m);r.$setSelection(y)}_e.dispatchCommand(b,K)}return ue.preventDefault(),!0}const D=r.$getSelection();return!!r.$isRangeSelection(D)},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGSTART_COMMAND,ue=>{const[K]=le(ue),D=r.$getSelection();return!(K&&!r.$isRangeSelection(D))},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.DRAGOVER_COMMAND,ue=>{const[K]=le(ue),D=r.$getSelection();if(K&&!r.$isRangeSelection(D))return!1;const V=ue.clientX,ne=ue.clientY,Y=c(V,ne);if(Y!==null){const G=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(G)&&ue.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.COPY_COMMAND,ue=>(t.copyToClipboard(_e,n.objectKlassEquals(ue,ClipboardEvent)?ue:null),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.CUT_COMMAND,ue=>(ee(ue,_e),!0),r.COMMAND_PRIORITY_EDITOR),_e.registerCommand(r.PASTE_COMMAND,ue=>{const[,K,D]=le(ue);if(K.length>0&&!D)return _e.dispatchCommand(b,K),!0;if(r.isSelectionCapturedInDecoratorInput(ue.target))return!1;const V=r.$getSelection();return r.$INTERNAL_isPointSelection(V)?(X(ue,_e),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ci.$createHeadingNode=B,ci.$createQuoteNode=x,ci.$isHeadingNode=z,ci.$isQuoteNode=w,ci.DRAG_DROP_PASTE=b,ci.HeadingNode=P,ci.QuoteNode=R,ci.eventFiles=le,ci.registerRichText=me,ci}var ui={},ih;function iC(){if(ih)return ui;ih=1;var t=wp(),e=Mo(),n=on(),r=Bt();function c(j,U){return typeof document.caretRangeFromPoint<"u"?(j=document.caretRangeFromPoint(j,U),j===null?null:{node:j.startContainer,offset:j.startOffset}):document.caretPositionFromPoint!=="undefined"?(j=document.caretPositionFromPoint(j,U),j===null?null:{node:j.offsetNode,offset:j.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,N=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),v=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),O=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,b=r.createCommand("DRAG_DROP_PASTE_FILE");class R extends r.ElementNode{static getType(){return"quote"}static clone(U){return new R(U.__key)}constructor(U){super(U)}createDOM(U){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,U.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:$,priority:0})}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=x();return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(U,q){U=r.$createParagraphNode();let me=this.getDirection();return U.setDirection(me),this.insertAfter(U,q),U}collapseAtStart(){let U=r.$createParagraphNode();return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}}function x(){return r.$applyNodeReplacement(new R)}class w extends r.ElementNode{static getType(){return"heading"}static clone(U){return new w(U.__tag,U.__key)}constructor(U,q){super(q),this.__tag=U}getTag(){return this.__tag}createDOM(U){let q=this.__tag,me=document.createElement(q);return U=U.theme.heading,U!==void 0&&n.addClassNamesToElement(me,U[q]),me}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:H,priority:0}),h2:()=>({conversion:H,priority:0}),h3:()=>({conversion:H,priority:0}),h4:()=>({conversion:H,priority:0}),h5:()=>({conversion:H,priority:0}),h6:()=>({conversion:H,priority:0}),p:U=>(U=U.firstChild,U!==null&&P(U)?{conversion:()=>({node:null}),priority:3}:null),span:U=>P(U)?{conversion:()=>({node:W("h1")}),priority:3}:null}}exportDOM(U){if({element:U}=super.exportDOM(U),U&&n.isHTMLElement(U)){this.isEmpty()&&U.append(document.createElement("br"));var q=this.getFormatType();U.style.textAlign=q,(q=this.getDirection())&&(U.dir=q)}return{element:U}}static importJSON(U){let q=W(U.tag);return q.setFormat(U.format),q.setIndent(U.indent),q.setDirection(U.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(U,q=!0){let me=U?U.anchor.offset:0,_e=me!==this.getTextContentSize()&&U?W(this.getTag()):r.$createParagraphNode(),pe=this.getDirection();return _e.setDirection(pe),this.insertAfter(_e,q),me===0&&!this.isEmpty()&&U&&(U=r.$createParagraphNode(),U.select(),this.replace(U,!0)),_e}collapseAtStart(){let U=this.isEmpty()?r.$createParagraphNode():W(this.getTag());return this.getChildren().forEach(q=>U.append(q)),this.replace(U),!0}extractWithChild(){return!0}}function P(j){return j.nodeName.toLowerCase()==="span"?j.style.fontSize==="26pt":!1}function H(j){let U=j.nodeName.toLowerCase(),q=null;return(U==="h1"||U==="h2"||U==="h3"||U==="h4"||U==="h5"||U==="h6")&&(q=W(U),j.style!==null&&q.setFormat(j.style.textAlign)),{node:q}}function $(j){let U=x();return j.style!==null&&U.setFormat(j.style.textAlign),{node:U}}function W(j){return r.$applyNodeReplacement(new w(j))}function B(j,U){j.preventDefault(),U.update(()=>{let q=r.$getSelection(),me=j instanceof InputEvent||j instanceof KeyboardEvent?null:j.clipboardData;me!=null&&r.$INTERNAL_isPointSelection(q)&&t.$insertDataTransferForRichText(me,q,U)},{tag:"paste"})}async function z(j,U){await t.copyToClipboard(U,n.objectKlassEquals(j,ClipboardEvent)?j:null),U.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(me=>me.remove())})}function X(j){let U=null;if(j instanceof DragEvent?U=j.dataTransfer:j instanceof ClipboardEvent&&(U=j.clipboardData),U===null)return[!1,[],!1];var q=U.types;return j=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[j,Array.from(U.files),q]}function ee(j){var U=r.$getSelection();if(!r.$isRangeSelection(U))return!1;let q=new Set;U=U.getNodes();for(let pe=0;pe<U.length;pe++){var me=U[pe],_e=me.getKey();q.has(_e)||(me=n.$getNearestBlockElementAncestorOrThrow(me),_e=me.getKey(),me.canIndent()&&!q.has(_e)&&(q.add(_e),j(me)))}return 0<q.size}function le(j){return j=r.$getNearestNodeFromDOMNode(j),r.$isDecoratorNode(j)}return ui.$createHeadingNode=W,ui.$createQuoteNode=x,ui.$isHeadingNode=function(j){return j instanceof w},ui.$isQuoteNode=function(j){return j instanceof R},ui.DRAG_DROP_PASTE=b,ui.HeadingNode=w,ui.QuoteNode=R,ui.eventFiles=X,ui.registerRichText=function(j){return n.mergeRegister(j.registerCommand(r.CLICK_COMMAND,()=>{const U=r.$getSelection();return r.$isNodeSelection(U)?(U.clear(),!0):!1},0),j.registerCommand(r.DELETE_CHARACTER_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_WORD_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_LINE_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,U=>{const q=r.$getSelection();if(typeof U=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(U);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const me=U.dataTransfer;me!=null?t.$insertDataTransferForRichText(me,q,j):r.$isRangeSelection(q)&&(U=U.data)&&q.insertText(U)}return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_TEXT_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_ELEMENT_COMMAND,U=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const me of q)q=n.$findMatchingParent(me,_e=>r.$isElementNode(_e)&&!_e.isInline()),q!==null&&q.setFormat(U);return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_LINE_BREAK_COMMAND,U=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(U),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(U.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INDENT_CONTENT_COMMAND,()=>ee(U=>{const q=U.getIndent();U.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>ee(U=>{const q=U.getIndent();0<q&&U.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_UP_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){if(U=q.getNodes(),0<U.length)return U[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),U.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_DOWN_COMMAND,U=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(U=q.getNodes(),0<U.length)return U[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let me=q.focus;if(me.key==="root"&&me.offset===r.$getRoot().getChildrenSize())return U.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!U.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),U.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_LEFT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&e.$shouldOverrideDefaultCharacterSelection(q,!0)?(me=U.shiftKey,U.preventDefault(),e.$moveCharacter(q,me,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,U=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!le(U.target)){var me=q.getNodes();if(0<me.length)return U.preventDefault(),me[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(me=U.shiftKey,e.$shouldOverrideDefaultCharacterSelection(q,!1)?(U.preventDefault(),e.$moveCharacter(q,me,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_BACKSPACE_COMMAND,U=>{if(le(U.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;U.preventDefault(),{anchor:U}=q;const me=U.getNode();return q.isCollapsed()&&U.offset===0&&!r.$isRootNode(me)&&0<n.$getNearestBlockElementAncestorOrThrow(me).getIndent()?j.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_DELETE_COMMAND,U=>{if(le(U.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(U.preventDefault(),j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ENTER_COMMAND,U=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(U!==null){if((v||N||O)&&p)return!1;if(U.preventDefault(),U.shiftKey)return j.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return j.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const U=r.$getSelection();return r.$isRangeSelection(U)?(j.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DROP_COMMAND,U=>{const[,q]=X(U);if(0<q.length){var me=c(U.clientX,U.clientY);if(me!==null){const{offset:pe,node:ue}=me;var _e=r.$getNearestNodeFromDOMNode(ue);if(_e!==null){if(me=r.$createRangeSelection(),r.$isTextNode(_e))me.anchor.set(_e.getKey(),pe,"text"),me.focus.set(_e.getKey(),pe,"text");else{const K=_e.getParentOrThrow().getKey();_e=_e.getIndexWithinParent()+1,me.anchor.set(K,_e,"element"),me.focus.set(K,_e,"element")}me=r.$normalizeSelection__EXPERIMENTAL(me),r.$setSelection(me)}j.dispatchCommand(b,q)}return U.preventDefault(),!0}return U=r.$getSelection(),!!r.$isRangeSelection(U)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGSTART_COMMAND,U=>{[U]=X(U);const q=r.$getSelection();return!(U&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGOVER_COMMAND,U=>{var[q]=X(U);const me=r.$getSelection();return q&&!r.$isRangeSelection(me)?!1:(q=c(U.clientX,U.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&U.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.COPY_COMMAND,U=>(t.copyToClipboard(j,n.objectKlassEquals(U,ClipboardEvent)?U:null),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CUT_COMMAND,U=>(z(U,j),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.PASTE_COMMAND,U=>{const[,q,me]=X(U);if(0<q.length&&!me)return j.dispatchCommand(b,q),!0;if(r.isSelectionCapturedInDecoratorInput(U.target))return!1;const _e=r.$getSelection();return r.$INTERNAL_isPointSelection(_e)?(B(U,j),!0):!1},r.COMMAND_PRIORITY_EDITOR))},ui}var du,oh;function md(){return oh||(oh=1,du=process.env.NODE_ENV==="development"?rC():iC()),du}var sh;function oC(){if(sh)return Qc;sh=1;var t=Un(),e=Tp(),n=et,r=xp(),c=on(),d=ld,g=vp(),p=md(),T=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function O(H){return H.getEditorState().read(r.$canShowPlaceholderCurry(H.isComposing()))}function b(H){const[$,W]=n.useState(()=>O(H));return T(()=>{function B(){const z=O(H);W(z)}return B(),c.mergeRegister(H.registerUpdateListener(()=>{B()}),H.registerEditableListener(()=>{B()}))},[H]),$}function R(H,$){const[W,B]=n.useState(()=>H.getDecorators());return T(()=>H.registerDecoratorListener(z=>{d.flushSync(()=>{B(z)})}),[H]),n.useEffect(()=>{B(H.getDecorators())},[H]),n.useMemo(()=>{const z=[],X=Object.keys(W);for(let ee=0;ee<X.length;ee++){const le=X[ee],j=n.createElement($,{onError:q=>H._onError(q)},n.createElement(n.Suspense,{fallback:null},W[le])),U=H.getElementByKey(le);U!==null&&z.push(d.createPortal(j,U,le))}return z},[$,W,H])}function x(H){T(()=>c.mergeRegister(p.registerRichText(H),g.registerDragonSupport(H)),[H])}function w({contentEditable:H,placeholder:$,ErrorBoundary:W}){const[B]=t.useLexicalComposerContext(),z=R(B,W);return x(B),n.createElement(n.Fragment,null,H,n.createElement(P,{content:$}),z)}function P({content:H}){const[$]=t.useLexicalComposerContext(),W=b($),B=e();return W?typeof H=="function"?H(B):H:null}return Qc.RichTextPlugin=w,Qc}var fu={},lh;function sC(){if(lh)return fu;lh=1;var t=Un(),e=Tp(),n=et,r=xp(),c=on(),d=ld,g=vp(),p=md(),N=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function v(x){return x.getEditorState().read(r.$canShowPlaceholderCurry(x.isComposing()))}function T(x){let[w,P]=n.useState(()=>v(x));return N(()=>{function H(){let $=v(x);P($)}return H(),c.mergeRegister(x.registerUpdateListener(()=>{H()}),x.registerEditableListener(()=>{H()}))},[x]),w}function O(x,w){let[P,H]=n.useState(()=>x.getDecorators());return N(()=>x.registerDecoratorListener($=>{d.flushSync(()=>{H($)})}),[x]),n.useEffect(()=>{H(x.getDecorators())},[x]),n.useMemo(()=>{let $=[],W=Object.keys(P);for(let B=0;B<W.length;B++){let z=W[B],X=n.createElement(w,{onError:le=>x._onError(le)},n.createElement(n.Suspense,{fallback:null},P[z])),ee=x.getElementByKey(z);ee!==null&&$.push(d.createPortal(X,ee,z))}return $},[w,P,x])}function b(x){N(()=>c.mergeRegister(p.registerRichText(x),g.registerDragonSupport(x)),[x])}function R({content:x}){var[w]=t.useLexicalComposerContext();w=T(w);let P=e();return w?typeof x=="function"?x(P):x:null}return fu.RichTextPlugin=function({contentEditable:x,placeholder:w,ErrorBoundary:P}){let[H]=t.useLexicalComposerContext();return P=O(H,P),b(H),n.createElement(n.Fragment,null,x,n.createElement(R,{content:w}),P)},fu}const lC=process.env.NODE_ENV==="development"?oC():sC();var aC=lC,hu={},ah;function cC(){if(ah)return hu;ah=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var N=1;N<arguments.length;N++){var v=arguments[N];for(var T in v)Object.prototype.hasOwnProperty.call(v,T)&&(p[T]=v[T])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;function g({ariaActiveDescendant:p,ariaAutoComplete:N,ariaControls:v,ariaDescribedBy:T,ariaExpanded:O,ariaLabel:b,ariaLabelledBy:R,ariaMultiline:x,ariaOwns:w,ariaRequired:P,autoCapitalize:H,className:$,id:W,role:B="textbox",spellCheck:z=!0,style:X,tabIndex:ee,"data-testid":le,...j}){const[U]=t.useLexicalComposerContext(),[q,me]=e.useState(!1),_e=e.useCallback(pe=>{U.setRootElement(pe)},[U]);return d(()=>(me(U.isEditable()),U.registerEditableListener(pe=>{me(pe)})),[U]),e.createElement("div",n({},j,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?N:"none","aria-controls":q?v:void 0,"aria-describedby":T,"aria-expanded":q&&B==="combobox"?!!O:void 0,"aria-label":b,"aria-labelledby":R,"aria-multiline":x,"aria-owns":q?w:void 0,"aria-readonly":q?void 0:!0,"aria-required":P,autoCapitalize:H,className:$,contentEditable:q,"data-testid":le,id:W,ref:_e,role:B,spellCheck:z,style:X,tabIndex:ee}))}return hu.ContentEditable=g,hu}var gu={},ch;function uC(){if(ch)return gu;ch=1;var t=Un(),e=et;function n(){return n=Object.assign?Object.assign.bind():function(c){for(var d=1;d<arguments.length;d++){var g=arguments[d],p;for(p in g)Object.prototype.hasOwnProperty.call(g,p)&&(c[p]=g[p])}return c},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?e.useLayoutEffect:e.useEffect;return gu.ContentEditable=function({ariaActiveDescendant:c,ariaAutoComplete:d,ariaControls:g,ariaDescribedBy:p,ariaExpanded:N,ariaLabel:v,ariaLabelledBy:T,ariaMultiline:O,ariaOwns:b,ariaRequired:R,autoCapitalize:x,className:w,id:P,role:H="textbox",spellCheck:$=!0,style:W,tabIndex:B,"data-testid":z,...X}){let[ee]=t.useLexicalComposerContext(),[le,j]=e.useState(!1),U=e.useCallback(q=>{ee.setRootElement(q)},[ee]);return r(()=>(j(ee.isEditable()),ee.registerEditableListener(q=>{j(q)})),[ee]),e.createElement("div",n({},X,{"aria-activedescendant":le?c:void 0,"aria-autocomplete":le?d:"none","aria-controls":le?g:void 0,"aria-describedby":p,"aria-expanded":le&&H==="combobox"?!!N:void 0,"aria-label":v,"aria-labelledby":T,"aria-multiline":O,"aria-owns":le?b:void 0,"aria-readonly":le?void 0:!0,"aria-required":R,autoCapitalize:x,className:w,contentEditable:le,"data-testid":z,id:P,ref:U,role:H,spellCheck:$,style:W,tabIndex:B}))},gu}const dC=process.env.NODE_ENV==="development"?cC():uC();var fC=dC,pu,uh;function hC(){if(uh)return pu;uh=1;var t=et;function e(p,N){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,O){return T.__proto__=O,T},e(p,N)}function n(p,N){p.prototype=Object.create(N.prototype),p.prototype.constructor=p,e(p,N)}var r=function(N,v){return N===void 0&&(N=[]),v===void 0&&(v=[]),N.length!==v.length||N.some(function(T,O){return!Object.is(T,v[O])})},c={error:null},d=function(p){n(N,p);function N(){for(var T,O=arguments.length,b=new Array(O),R=0;R<O;R++)b[R]=arguments[R];return T=p.call.apply(p,[this].concat(b))||this,T.state=c,T.resetErrorBoundary=function(){for(var x,w=arguments.length,P=new Array(w),H=0;H<w;H++)P[H]=arguments[H];T.props.onReset==null||(x=T.props).onReset.apply(x,P),T.reset()},T}N.getDerivedStateFromError=function(O){return{error:O}};var v=N.prototype;return v.reset=function(){this.setState(c)},v.componentDidCatch=function(O,b){var R,x;(R=(x=this.props).onError)==null||R.call(x,O,b)},v.componentDidUpdate=function(O,b){var R=this.state.error,x=this.props.resetKeys;if(R!==null&&b.error!==null&&r(O.resetKeys,x)){var w,P;(w=(P=this.props).onResetKeysChange)==null||w.call(P,O.resetKeys,x),this.reset()}},v.render=function(){var O=this.state.error,b=this.props,R=b.fallbackRender,x=b.FallbackComponent,w=b.fallback;if(O!==null){var P={error:O,resetErrorBoundary:this.resetErrorBoundary};if(t.isValidElement(w))return w;if(typeof R=="function")return R(P);if(x)return t.createElement(x,P);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},N}(t.Component);function g({children:p,onError:N}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:N},p)}return pu=g,pu}var mu,dh;function gC(){if(dh)return mu;dh=1;var t=et;function e(g,p){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,v){return N.__proto__=v,N},e(g,p)}function n(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,e(g,p)}function r(g,p){return g===void 0&&(g=[]),p===void 0&&(p=[]),g.length!==p.length||g.some(function(N,v){return!Object.is(N,p[v])})}var c={error:null},d=function(g){function p(){for(var v,T=arguments.length,O=Array(T),b=0;b<T;b++)O[b]=arguments[b];return v=g.call.apply(g,[this].concat(O))||this,v.state=c,v.resetErrorBoundary=function(){for(var R,x=arguments.length,w=Array(x),P=0;P<x;P++)w[P]=arguments[P];v.props.onReset==null||(R=v.props).onReset.apply(R,w),v.reset()},v}n(p,g),p.getDerivedStateFromError=function(v){return{error:v}};var N=p.prototype;return N.reset=function(){this.setState(c)},N.componentDidCatch=function(v,T){var O,b;(O=(b=this.props).onError)==null||O.call(b,v,T)},N.componentDidUpdate=function(v,T){var O=this.props.resetKeys;if(this.state.error!==null&&T.error!==null&&r(v.resetKeys,O)){var b,R;(b=(R=this.props).onResetKeysChange)==null||b.call(R,v.resetKeys,O),this.reset()}},N.render=function(){var v=this.state.error,T=this.props,O=T.fallbackRender,b=T.FallbackComponent;if(T=T.fallback,v!==null){if(v={error:v,resetErrorBoundary:this.resetErrorBoundary},t.isValidElement(T))return T;if(typeof O=="function")return O(v);if(b)return t.createElement(b,v);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(t.Component);return mu=function({children:g,onError:p}){return t.createElement(d,{fallback:t.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},g)},mu}const pC=process.env.NODE_ENV==="development"?hC():gC();var mC=pC;const _C=ad(mC);var _u={},rr={},fh;function yC(){if(fh)return rr;fh=1;var t=Bt(),e=on();function n(Y){let G=1,Q=Y.getParent();for(;Q!=null;){if(le(Q)){const k=Q.getParent();if(ue(k)){G++,Q=k.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return G}return G}function r(Y){let G=Y.getParent();if(!ue(G))throw Error("A ListItemNode must have a ListNode for a parent.");let Q=G;for(;Q!==null;)Q=Q.getParent(),ue(Q)&&(G=Q);return G}function c(Y){let G=[];const Q=Y.getChildren().filter(le);for(let k=0;k<Q.length;k++){const m=Q[k],y=m.getFirstChild();ue(y)?G=G.concat(c(y)):G.push(m)}return G}function d(Y){return le(Y)&&ue(Y.getFirstChild())}function g(Y){let G=Y;for(;G.getNextSibling()==null&&G.getPreviousSibling()==null;){const Q=G.getParent();if(Q==null||!(le(G)||ue(G)))break;G=Q}G.remove()}function p(Y){return ee().append(Y)}function N(Y,G){return le(Y)&&(G.length===0||G.length===1&&Y.is(G[0])&&Y.getChildrenSize()===0)}function v(Y){const G=Y.getParent();let Q=1;if(G!=null)if(ue(G))Q=G.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const k=Y.getPreviousSiblings();for(let m=0;m<k.length;m++){const y=k[m];le(y)&&!ue(y.getFirstChild())&&Q++}return Q}function T(Y,G){Y.update(()=>{const Q=t.$getSelection();if(t.$INTERNAL_isPointSelection(Q)){const k=Q.getNodes(),y=Q.anchor.getNode(),M=y.getParent();if(N(y,k)){const Z=pe(G);if(t.$isRootOrShadowRoot(M)){y.replace(Z);const ae=ee();t.$isElementNode(y)&&(ae.setFormat(y.getFormatType()),ae.setIndent(y.getIndent())),Z.append(ae)}else if(le(y)){const ae=y.getParentOrThrow();O(Z,ae.getChildren()),ae.replace(Z)}return}else{const Z=new Set;for(let ae=0;ae<k.length;ae++){const he=k[ae];if(t.$isElementNode(he)&&he.isEmpty()&&!le(he)&&!Z.has(he.getKey())){b(he,G);continue}if(t.$isLeafNode(he)){let se=he.getParent();for(;se!=null;){const Te=se.getKey();if(ue(se)){if(!Z.has(Te)){const be=pe(G);O(be,se.getChildren()),se.replace(be),w(be),Z.add(Te)}break}else{const be=se.getParent();if(t.$isRootOrShadowRoot(be)&&!Z.has(Te)){Z.add(Te),b(se,G);break}se=be}}}}}}})}function O(Y,G){Y.splice(Y.getChildrenSize(),0,G)}function b(Y,G){if(ue(Y))return Y;const Q=Y.getPreviousSibling(),k=Y.getNextSibling(),m=ee();if(m.setFormat(Y.getFormatType()),m.setIndent(Y.getIndent()),O(m,Y.getChildren()),ue(Q)&&G===Q.getListType())return Q.append(m),Y.remove(),ue(k)&&G===k.getListType()&&(O(Q,k.getChildren()),k.remove()),Q;if(ue(k)&&G===k.getListType())return k.getFirstChildOrThrow().insertBefore(m),Y.remove(),k;{const y=pe(G);return y.append(m),Y.replace(y),w(y),y}}function R(Y,G){const Q=Y.getLastChild(),k=G.getFirstChild();Q&&k&&d(Q)&&d(k)&&(R(Q.getFirstChild(),k.getFirstChild()),k.remove());const m=G.getChildren();m.length>0&&(Y.append(...m),w(Y)),G.remove()}function x(Y){Y.update(()=>{const G=t.$getSelection();if(t.$isRangeSelection(G)){const Q=new Set,k=G.getNodes(),m=G.anchor.getNode();if(N(m,k))Q.add(r(m));else for(let y=0;y<k.length;y++){const M=k[y];if(t.$isLeafNode(M)){const Z=e.$getNearestNodeOfType(M,W);Z!=null&&Q.add(r(Z))}}for(const y of Q){let M=y;const Z=c(y);for(const ae of Z){const he=t.$createParagraphNode();O(he,ae.getChildren()),M.insertAfter(he),M=he,ae.__key===G.anchor.key&&G.anchor.set(he.getKey(),0,"element"),ae.__key===G.focus.key&&G.focus.set(he.getKey(),0,"element"),ae.remove()}y.remove()}}})}function w(Y,G){const Q=G||Y.getChildren();if(Q!==void 0)for(let k=0;k<Q.length;k++){const m=Q[k];if(le(m)){const y=m.getValue(),M=v(m);y!==M&&m.setValue(M)}}}function P(Y){const G=new Set;if(d(Y)||G.has(Y.getKey()))return;const Q=Y.getParent(),k=Y.getNextSibling(),m=Y.getPreviousSibling();if(d(k)&&d(m)){const y=m.getFirstChild();if(ue(y)){y.append(Y);const M=k.getFirstChild();if(ue(M)){const Z=M.getChildren();O(y,Z),k.remove(),G.add(k.getKey())}w(y)}}else if(d(k)){const y=k.getFirstChild();if(ue(y)){const M=y.getFirstChild();M!==null&&M.insertBefore(Y),w(y)}}else if(d(m)){const y=m.getFirstChild();ue(y)&&(y.append(Y),w(y))}else if(ue(Q)){const y=ee(),M=pe(Q.getListType());y.append(M),M.append(Y),m?m.insertAfter(y):k?k.insertBefore(y):Q.append(y),w(M)}ue(Q)&&w(Q)}function H(Y){if(d(Y))return;const G=Y.getParent(),Q=G?G.getParent():void 0,k=Q?Q.getParent():void 0;if(ue(k)&&le(Q)&&ue(G)){const m=G?G.getFirstChild():void 0,y=G?G.getLastChild():void 0;if(Y.is(m))Q.insertBefore(Y),G.isEmpty()&&Q.remove();else if(Y.is(y))Q.insertAfter(Y),G.isEmpty()&&Q.remove();else{const M=G.getListType(),Z=ee(),ae=pe(M);Z.append(ae),Y.getPreviousSiblings().forEach(Te=>ae.append(Te));const he=ee(),se=pe(M);he.append(se),O(se,Y.getNextSiblings()),Q.insertBefore(Z),Q.insertAfter(he),Q.replace(Y)}w(G),w(k)}}function $(){const Y=t.$getSelection();if(!t.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const G=Y.anchor.getNode();if(!le(G)||G.getChildrenSize()!==0)return!1;const Q=r(G),k=G.getParent();if(!ue(k))throw Error("A ListItemNode must have a ListNode for a parent.");const m=k.getParent();let y;if(t.$isRootOrShadowRoot(m))y=t.$createParagraphNode(),Q.insertAfter(y);else if(le(m))y=ee(),m.insertAfter(y);else return!1;y.select();const M=G.getNextSiblings();if(M.length>0){const Z=pe(k.getListType());if(t.$isParagraphNode(y))y.insertAfter(Z);else{const ae=ee();ae.append(Z),y.insertAfter(ae)}M.forEach(ae=>{ae.remove(),Z.append(ae)})}return g(G),!0}class W extends t.ElementNode{static getType(){return"listitem"}static clone(G){return new W(G.__value,G.__checked,G.__key)}constructor(G,Q,k){super(k),this.__value=G===void 0?1:G,this.__checked=Q}createDOM(G){const Q=document.createElement("li"),k=this.getParent();return ue(k)&&k.getListType()==="check"&&z(Q,this,null),Q.value=this.__value,B(Q,G.theme,this),Q}updateDOM(G,Q,k){const m=this.getParent();return ue(m)&&m.getListType()==="check"&&z(Q,this,G),Q.value=this.__value,B(Q,k.theme,this),!1}static transform(){return G=>{const Q=G.getParent();ue(Q)&&(w(Q),Q.getListType()!=="check"&&G.getChecked()!=null&&G.setChecked(void 0))}}static importDOM(){return{li:G=>({conversion:X,priority:0})}}static importJSON(G){const Q=ee();return Q.setChecked(G.checked),Q.setValue(G.value),Q.setFormat(G.format),Q.setDirection(G.direction),Q}exportDOM(G){const Q=this.createDOM(G._config);return Q.style.textAlign=this.getFormatType(),{element:Q}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(t.$isElementNode(k)&&this.canMergeWith(k)){const m=k.getChildren();this.append(...m),k.remove()}else super.append(k)}return this}replace(G,Q){if(le(G))return super.replace(G);this.setIndent(0);const k=this.getParentOrThrow();if(!ue(k))return G;if(k.__first===this.getKey())k.insertBefore(G);else if(k.__last===this.getKey())k.insertAfter(G);else{const m=pe(k.getListType());let y=this.getNextSibling();for(;y;){const M=y;y=y.getNextSibling(),m.append(M)}k.insertAfter(G),G.insertAfter(m)}return Q&&this.getChildren().forEach(m=>{G.append(m)}),this.remove(),k.getChildrenSize()===0&&k.remove(),G}insertAfter(G,Q=!0){const k=this.getParentOrThrow();if(!ue(k))throw Error("insertAfter: list node is not parent of list item node");const m=this.getNextSiblings();if(le(G)){const y=super.insertAfter(G,Q),M=G.getParentOrThrow();return ue(M)&&w(M),y}if(ue(G)){let y=G;const M=G.getChildren();for(let Z=M.length-1;Z>=0;Z--)y=M[Z],this.insertAfter(y,Q);return y}if(k.insertAfter(G,Q),m.length!==0){const y=pe(k.getListType());m.forEach(M=>y.append(M)),G.insertAfter(y,Q)}return G}remove(G){const Q=this.getPreviousSibling(),k=this.getNextSibling();if(super.remove(G),Q&&k&&d(Q)&&d(k))R(Q.getFirstChild(),k.getFirstChild()),k.remove();else if(k){const m=k.getParent();ue(m)&&w(m)}}insertNewAfter(G,Q=!0){const k=ee(this.__checked==null?void 0:!1);return this.insertAfter(k,Q),k}collapseAtStart(G){const Q=t.$createParagraphNode();this.getChildren().forEach(Z=>Q.append(Z));const m=this.getParentOrThrow(),y=m.getParentOrThrow(),M=le(y);if(m.getChildrenSize()===1)if(M)m.remove(),y.select();else{m.insertBefore(Q),m.remove();const Z=G.anchor,ae=G.focus,he=Q.getKey();Z.type==="element"&&Z.getNode().is(this)&&Z.set(he,Z.offset,"element"),ae.type==="element"&&ae.getNode().is(this)&&ae.set(he,ae.offset,"element")}else m.insertBefore(Q),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(G){const Q=this.getWritable();Q.__value=G}getChecked(){return this.getLatest().__checked}setChecked(G){const Q=this.getWritable();Q.__checked=G}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const G=this.getParent();if(G===null)return this.getLatest().__indent;let Q=G.getParentOrThrow(),k=0;for(;le(Q);)Q=Q.getParentOrThrow().getParentOrThrow(),k++;return k}setIndent(G){if(!(typeof G=="number"&&G>-1))throw Error("Invalid indent value.");let Q=this.getIndent();for(;Q!==G;)Q<G?(P(this),Q++):(H(this),Q--);return this}insertBefore(G){if(le(G)){const Q=this.getParentOrThrow();if(ue(Q)){const k=this.getNextSiblings();w(Q,k)}}return super.insertBefore(G)}canInsertAfter(G){return le(G)}canReplaceWith(G){return le(G)}canMergeWith(G){return t.$isParagraphNode(G)||le(G)}extractWithChild(G,Q){if(!t.$isRangeSelection(Q))return!1;const k=Q.anchor.getNode(),m=Q.focus.getNode();return this.isParentOf(k)&&this.isParentOf(m)&&this.getTextContent().length===Q.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return pe("bullet")}}function B(Y,G,Q){const k=[],m=[],y=G.list,M=y?y.listitem:void 0;let Z;if(y&&y.nested&&(Z=y.nested.listitem),M!==void 0){const ae=M.split(" ");k.push(...ae)}if(y){const ae=Q.getParent(),he=ue(ae)&&ae.getListType()==="check",se=Q.getChecked();(!he||se)&&m.push(y.listitemUnchecked),(!he||!se)&&m.push(y.listitemChecked),he&&k.push(se?y.listitemChecked:y.listitemUnchecked)}if(Z!==void 0){const ae=Z.split(" ");Q.getChildren().some(he=>ue(he))?k.push(...ae):m.push(...ae)}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function z(Y,G,Q,k){ue(G.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!Q||G.__checked!==Q.__checked)&&Y.setAttribute("aria-checked",G.getChecked()?"true":"false"))}function X(Y){const G=e.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:ee(G)}}function ee(Y){return t.$applyNodeReplacement(new W(void 0,Y))}function le(Y){return Y instanceof W}class j extends t.ElementNode{static getType(){return"list"}static clone(G){const Q=G.__listType||_e[G.__tag];return new j(Q,G.__start,G.__key)}constructor(G,Q,k){super(k);const m=_e[G]||G;this.__listType=m,this.__tag=m==="number"?"ol":"ul",this.__start=Q}getTag(){return this.__tag}setListType(G){const Q=this.getWritable();Q.__listType=G,Q.__tag=G==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(G,Q){const k=this.__tag,m=document.createElement(k);return this.__start!==1&&m.setAttribute("start",String(this.__start)),m.__lexicalListType=this.__listType,U(m,G.theme,this),m}updateDOM(G,Q,k){return G.__tag!==this.__tag?!0:(U(Q,k.theme,this),!1)}static importDOM(){return{ol:G=>({conversion:me,priority:0}),ul:G=>({conversion:me,priority:0})}}static importJSON(G){const Q=pe(G.listType,G.start);return Q.setFormat(G.format),Q.setIndent(G.indent),Q.setDirection(G.direction),Q}exportDOM(G){const{element:Q}=super.exportDOM(G);return Q&&e.isHTMLElement(Q)&&(this.__start!==1&&Q.setAttribute("start",String(this.__start)),this.__listType==="check"&&Q.setAttribute("__lexicalListType","check")),{element:Q}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...G){for(let Q=0;Q<G.length;Q++){const k=G[Q];if(le(k))super.append(k);else{const m=ee();if(ue(k))m.append(k);else if(t.$isElementNode(k)){const y=t.$createTextNode(k.getTextContent());m.append(y)}else m.append(k);super.append(m)}}return w(this),this}extractWithChild(G){return le(G)}}function U(Y,G,Q){const k=[],m=[],y=G.list;if(y!==void 0){const M=y[`${Q.__tag}Depth`]||[],Z=n(Q)-1,ae=Z%M.length,he=M[ae],se=y[Q.__tag];let Te;const be=y.nested;if(be!==void 0&&be.list&&(Te=be.list),se!==void 0&&k.push(se),he!==void 0){const Ue=he.split(" ");k.push(...Ue);for(let re=0;re<M.length;re++)re!==ae&&m.push(Q.__tag+re)}if(Te!==void 0){const Ue=Te.split(" ");Z>1?k.push(...Ue):m.push(...Ue)}}m.length>0&&e.removeClassNamesFromElement(Y,...m),k.length>0&&e.addClassNamesToElement(Y,...k)}function q(Y){const G=[];for(let Q=0;Q<Y.length;Q++){const k=Y[Q];if(le(k)){G.push(k);const m=k.getChildren();m.length>1&&m.forEach(y=>{ue(y)&&G.push(p(y))})}else G.push(p(k))}return G}function me(Y){const G=Y.nodeName.toLowerCase();let Q=null;if(G==="ol"){const k=Y.start;Q=pe("number",k)}else G==="ul"&&(e.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?Q=pe("check"):Q=pe("bullet"));return{after:q,node:Q}}const _e={ol:"number",ul:"bullet"};function pe(Y,G=1){return t.$applyNodeReplacement(new j(Y,G))}function ue(Y){return Y instanceof j}const K=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),D=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),V=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ne=t.createCommand("REMOVE_LIST_COMMAND");return rr.$createListItemNode=ee,rr.$createListNode=pe,rr.$getListDepth=n,rr.$handleListInsertParagraph=$,rr.$isListItemNode=le,rr.$isListNode=ue,rr.INSERT_CHECK_LIST_COMMAND=V,rr.INSERT_ORDERED_LIST_COMMAND=D,rr.INSERT_UNORDERED_LIST_COMMAND=K,rr.ListItemNode=W,rr.ListNode=j,rr.REMOVE_LIST_COMMAND=ne,rr.insertList=T,rr.removeList=x,rr}var ir={},hh;function NC(){if(hh)return ir;hh=1;var t=Bt(),e=on();function n(K){let D=new URLSearchParams;D.append("code",K);for(let V=1;V<arguments.length;V++)D.append("v",arguments[V]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${D} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let D=1;for(K=K.getParent();K!=null;){if(B(K)){if(K=K.getParent(),q(K)){D++,K=K.getParent();continue}n(40)}break}return D}function c(K){K=K.getParent(),q(K)||n(40);let D=K;for(;D!==null;)D=D.getParent(),q(D)&&(K=D);return K}function d(K){let D=[];K=K.getChildren().filter(B);for(let V=0;V<K.length;V++){let ne=K[V],Y=ne.getFirstChild();q(Y)?D=D.concat(d(Y)):D.push(ne)}return D}function g(K){return B(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let D=K.getParent();if(D==null||!B(K)&&!q(K))break;K=D}K.remove()}function N(K){return W().append(K)}function v(K,D){return B(K)&&(D.length===0||D.length===1&&K.is(D[0])&&K.getChildrenSize()===0)}function T(K,D){K.splice(K.getChildrenSize(),0,D)}function O(K,D){if(q(K))return K;let V=K.getPreviousSibling(),ne=K.getNextSibling(),Y=W();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),T(Y,K.getChildren()),q(V)&&D===V.getListType()?(V.append(Y),K.remove(),q(ne)&&D===ne.getListType()&&(T(V,ne.getChildren()),ne.remove()),V):q(ne)&&D===ne.getListType()?(ne.getFirstChildOrThrow().insertBefore(Y),K.remove(),ne):(D=U(D),D.append(Y),K.replace(D),R(D),D)}function b(K,D){var V=K.getLastChild();let ne=D.getFirstChild();V&&ne&&g(V)&&g(ne)&&(b(V.getFirstChild(),ne.getFirstChild()),ne.remove()),V=D.getChildren(),0<V.length&&(K.append(...V),R(K)),D.remove()}function R(K,D){if(K=D||K.getChildren(),K!==void 0)for(D=0;D<K.length;D++){let G=K[D];if(B(G)){let Q=G.getValue();var V=G,ne=V.getParent(),Y=1;for(ne!=null&&(q(ne)?Y=ne.getStart():n(44)),V=V.getPreviousSiblings(),ne=0;ne<V.length;ne++){let k=V[ne];B(k)&&!q(k.getFirstChild())&&Y++}Q!==Y&&G.setValue(Y)}}}function x(K){if(!g(K)){var D=K.getParent(),V=D?D.getParent():void 0,ne=V?V.getParent():void 0;if(q(ne)&&B(V)&&q(D)){var Y=D?D.getFirstChild():void 0,G=D?D.getLastChild():void 0;if(K.is(Y))V.insertBefore(K),D.isEmpty()&&V.remove();else if(K.is(G))V.insertAfter(K),D.isEmpty()&&V.remove();else{var Q=D.getListType();Y=W();let k=U(Q);Y.append(k),K.getPreviousSiblings().forEach(m=>k.append(m)),G=W(),Q=U(Q),G.append(Q),T(Q,K.getNextSiblings()),V.insertBefore(Y),V.insertAfter(G),V.replace(K)}R(D),R(ne)}}}class w extends t.ElementNode{static getType(){return"listitem"}static clone(D){return new w(D.__value,D.__checked,D.__key)}constructor(D,V,ne){super(ne),this.__value=D===void 0?1:D,this.__checked=V}createDOM(D){let V=document.createElement("li"),ne=this.getParent();return q(ne)&&ne.getListType()==="check"&&H(V,this,null),V.value=this.__value,P(V,D.theme,this),V}updateDOM(D,V,ne){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&H(V,this,D),V.value=this.__value,P(V,ne.theme,this),!1}static transform(){return D=>{let V=D.getParent();q(V)&&(R(V),V.getListType()!=="check"&&D.getChecked()!=null&&D.setChecked(void 0))}}static importDOM(){return{li:()=>({conversion:$,priority:0})}}static importJSON(D){let V=W();return V.setChecked(D.checked),V.setValue(D.value),V.setFormat(D.format),V.setDirection(D.direction),V}exportDOM(D){return D=this.createDOM(D._config),D.style.textAlign=this.getFormatType(),{element:D}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...D){for(let V=0;V<D.length;V++){let ne=D[V];if(t.$isElementNode(ne)&&this.canMergeWith(ne)){let Y=ne.getChildren();this.append(...Y),ne.remove()}else super.append(ne)}return this}replace(D,V){if(B(D))return super.replace(D);this.setIndent(0);let ne=this.getParentOrThrow();if(!q(ne))return D;if(ne.__first===this.getKey())ne.insertBefore(D);else if(ne.__last===this.getKey())ne.insertAfter(D);else{let Y=U(ne.getListType()),G=this.getNextSibling();for(;G;){let Q=G;G=G.getNextSibling(),Y.append(Q)}ne.insertAfter(D),D.insertAfter(Y)}return V&&this.getChildren().forEach(Y=>{D.append(Y)}),this.remove(),ne.getChildrenSize()===0&&ne.remove(),D}insertAfter(D,V=!0){var ne=this.getParentOrThrow();q(ne)||n(39);var Y=this.getNextSiblings();if(B(D))return V=super.insertAfter(D,V),D=D.getParentOrThrow(),q(D)&&R(D),V;if(q(D)){for(ne=D,D=D.getChildren(),Y=D.length-1;0<=Y;Y--)ne=D[Y],this.insertAfter(ne,V);return ne}if(ne.insertAfter(D,V),Y.length!==0){let G=U(ne.getListType());Y.forEach(Q=>G.append(Q)),D.insertAfter(G,V)}return D}remove(D){let V=this.getPreviousSibling(),ne=this.getNextSibling();super.remove(D),V&&ne&&g(V)&&g(ne)?(b(V.getFirstChild(),ne.getFirstChild()),ne.remove()):ne&&(D=ne.getParent(),q(D)&&R(D))}insertNewAfter(D,V=!0){return D=W(this.__checked==null?void 0:!1),this.insertAfter(D,V),D}collapseAtStart(D){let V=t.$createParagraphNode();this.getChildren().forEach(Q=>V.append(Q));var ne=this.getParentOrThrow(),Y=ne.getParentOrThrow();let G=B(Y);return ne.getChildrenSize()===1?G?(ne.remove(),Y.select()):(ne.insertBefore(V),ne.remove(),ne=D.anchor,D=D.focus,Y=V.getKey(),ne.type==="element"&&ne.getNode().is(this)&&ne.set(Y,ne.offset,"element"),D.type==="element"&&D.getNode().is(this)&&D.set(Y,D.offset,"element")):(ne.insertBefore(V),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(D){this.getWritable().__value=D}getChecked(){return this.getLatest().__checked}setChecked(D){this.getWritable().__checked=D}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var D=this.getParent();if(D===null)return this.getLatest().__indent;D=D.getParentOrThrow();let V=0;for(;B(D);)D=D.getParentOrThrow().getParentOrThrow(),V++;return V}setIndent(D){typeof D=="number"&&-1<D||n(117);let V=this.getIndent();for(;V!==D;)if(V<D){e:{var ne=new Set;if(g(this)||ne.has(this.getKey()))break e;let k=this.getParent();var Y=this.getNextSibling(),G=this.getPreviousSibling();if(g(Y)&&g(G)){if(G=G.getFirstChild(),q(G)){G.append(this);var Q=Y.getFirstChild();q(Q)&&(Q=Q.getChildren(),T(G,Q),Y.remove(),ne.add(Y.getKey())),R(G)}}else g(Y)?(Y=Y.getFirstChild(),q(Y)&&(ne=Y.getFirstChild(),ne!==null&&ne.insertBefore(this),R(Y))):g(G)?(Y=G.getFirstChild(),q(Y)&&(Y.append(this),R(Y))):q(k)&&(ne=W(),Q=U(k.getListType()),ne.append(Q),Q.append(this),G?G.insertAfter(ne):Y?Y.insertBefore(ne):k.append(ne),R(Q));q(k)&&R(k)}V++}else x(this),V--;return this}insertBefore(D){if(B(D)){let V=this.getParentOrThrow();if(q(V)){let ne=this.getNextSiblings();R(V,ne)}}return super.insertBefore(D)}canInsertAfter(D){return B(D)}canReplaceWith(D){return B(D)}canMergeWith(D){return t.$isParagraphNode(D)||B(D)}extractWithChild(D,V){if(!t.$isRangeSelection(V))return!1;D=V.anchor.getNode();let ne=V.focus.getNode();return this.isParentOf(D)&&this.isParentOf(ne)&&this.getTextContent().length===V.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return U("bullet")}}function P(K,D,V){let ne=[],Y=[];var G=(D=D.list)?D.listitem:void 0;if(D&&D.nested)var Q=D.nested.listitem;if(G!==void 0&&(G=G.split(" "),ne.push(...G)),D){G=V.getParent(),G=q(G)&&G.getListType()==="check";let k=V.getChecked();G&&!k||Y.push(D.listitemUnchecked),G&&k||Y.push(D.listitemChecked),G&&ne.push(k?D.listitemChecked:D.listitemUnchecked)}Q!==void 0&&(Q=Q.split(" "),V.getChildren().some(k=>q(k))?ne.push(...Q):Y.push(...Q)),0<Y.length&&e.removeClassNamesFromElement(K,...Y),0<ne.length&&e.addClassNamesToElement(K,...ne)}function H(K,D,V){q(D.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),V&&D.__checked===V.__checked||K.setAttribute("aria-checked",D.getChecked()?"true":"false"))}function $(K){return K=e.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:W(K)}}function W(K){return t.$applyNodeReplacement(new w(void 0,K))}function B(K){return K instanceof w}class z extends t.ElementNode{static getType(){return"list"}static clone(D){return new z(D.__listType||j[D.__tag],D.__start,D.__key)}constructor(D,V,ne){super(ne),this.__listType=D=j[D]||D,this.__tag=D==="number"?"ol":"ul",this.__start=V}getTag(){return this.__tag}setListType(D){let V=this.getWritable();V.__listType=D,V.__tag=D==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(D){let V=document.createElement(this.__tag);return this.__start!==1&&V.setAttribute("start",String(this.__start)),V.__lexicalListType=this.__listType,X(V,D.theme,this),V}updateDOM(D,V,ne){return D.__tag!==this.__tag?!0:(X(V,ne.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:le,priority:0}),ul:()=>({conversion:le,priority:0})}}static importJSON(D){let V=U(D.listType,D.start);return V.setFormat(D.format),V.setIndent(D.indent),V.setDirection(D.direction),V}exportDOM(D){return{element:D}=super.exportDOM(D),D&&e.isHTMLElement(D)&&(this.__start!==1&&D.setAttribute("start",String(this.__start)),this.__listType==="check"&&D.setAttribute("__lexicalListType","check")),{element:D}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...D){for(let ne=0;ne<D.length;ne++){var V=D[ne];if(B(V))super.append(V);else{let Y=W();q(V)||t.$isElementNode(V)&&(V=t.$createTextNode(V.getTextContent())),Y.append(V),super.append(Y)}}return R(this),this}extractWithChild(D){return B(D)}}function X(K,D,V){let ne=[],Y=[];var G=D.list;if(G!==void 0){let k=G[`${V.__tag}Depth`]||[];D=r(V)-1;let m=D%k.length;var Q=k[m];let y=G[V.__tag],M;if(G=G.nested,G!==void 0&&G.list&&(M=G.list),y!==void 0&&ne.push(y),Q!==void 0)for(Q=Q.split(" "),ne.push(...Q),Q=0;Q<k.length;Q++)Q!==m&&Y.push(V.__tag+Q);M!==void 0&&(V=M.split(" "),1<D?ne.push(...V):Y.push(...V))}0<Y.length&&e.removeClassNamesFromElement(K,...Y),0<ne.length&&e.addClassNamesToElement(K,...ne)}function ee(K){let D=[];for(let ne=0;ne<K.length;ne++){var V=K[ne];B(V)?(D.push(V),V=V.getChildren(),1<V.length&&V.forEach(Y=>{q(Y)&&D.push(N(Y))})):D.push(N(V))}return D}function le(K){let D=K.nodeName.toLowerCase(),V=null;return D==="ol"?V=U("number",K.start):D==="ul"&&(V=e.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?U("check"):U("bullet")),{after:ee,node:V}}let j={ol:"number",ul:"bullet"};function U(K,D=1){return t.$applyNodeReplacement(new z(K,D))}function q(K){return K instanceof z}let me=t.createCommand("INSERT_UNORDERED_LIST_COMMAND"),_e=t.createCommand("INSERT_ORDERED_LIST_COMMAND"),pe=t.createCommand("INSERT_CHECK_LIST_COMMAND"),ue=t.createCommand("REMOVE_LIST_COMMAND");return ir.$createListItemNode=W,ir.$createListNode=U,ir.$getListDepth=r,ir.$handleListInsertParagraph=function(){var K=t.$getSelection();if(!t.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!B(K)||K.getChildrenSize()!==0))return!1;var D=c(K),V=K.getParent();q(V)||n(40);let ne=V.getParent(),Y;if(t.$isRootOrShadowRoot(ne))Y=t.$createParagraphNode(),D.insertAfter(Y);else if(B(ne))Y=W(),ne.insertAfter(Y);else return!1;if(Y.select(),D=K.getNextSiblings(),0<D.length){let G=U(V.getListType());t.$isParagraphNode(Y)?Y.insertAfter(G):(V=W(),V.append(G),Y.insertAfter(V)),D.forEach(Q=>{Q.remove(),G.append(Q)})}return p(K),!0},ir.$isListItemNode=B,ir.$isListNode=q,ir.INSERT_CHECK_LIST_COMMAND=pe,ir.INSERT_ORDERED_LIST_COMMAND=_e,ir.INSERT_UNORDERED_LIST_COMMAND=me,ir.ListItemNode=w,ir.ListNode=z,ir.REMOVE_LIST_COMMAND=ue,ir.insertList=function(K,D){K.update(()=>{var V=t.$getSelection();if(t.$INTERNAL_isPointSelection(V)){var ne=V.getNodes();V=V.anchor.getNode();var Y=V.getParent();if(v(V,ne))ne=U(D),t.$isRootOrShadowRoot(Y)?(V.replace(ne),Y=W(),t.$isElementNode(V)&&(Y.setFormat(V.getFormatType()),Y.setIndent(V.getIndent())),ne.append(Y)):B(V)&&(V=V.getParentOrThrow(),T(ne,V.getChildren()),V.replace(ne));else for(V=new Set,Y=0;Y<ne.length;Y++){var G=ne[Y];if(t.$isElementNode(G)&&G.isEmpty()&&!B(G)&&!V.has(G.getKey()))O(G,D);else if(t.$isLeafNode(G))for(G=G.getParent();G!=null;){let k=G.getKey();if(q(G)){if(!V.has(k)){var Q=U(D);T(Q,G.getChildren()),G.replace(Q),R(Q),V.add(k)}break}else{if(Q=G.getParent(),t.$isRootOrShadowRoot(Q)&&!V.has(k)){V.add(k),O(G,D);break}G=Q}}}}})},ir.removeList=function(K){K.update(()=>{let D=t.$getSelection();if(t.$isRangeSelection(D)){var V=new Set,ne=D.getNodes(),Y=D.anchor.getNode();if(v(Y,ne))V.add(c(Y));else for(Y=0;Y<ne.length;Y++){var G=ne[Y];t.$isLeafNode(G)&&(G=e.$getNearestNodeOfType(G,w),G!=null&&V.add(c(G)))}for(let Q of V){V=Q,ne=d(Q);for(let k of ne)ne=t.$createParagraphNode(),T(ne,k.getChildren()),V.insertAfter(ne),V=ne,k.__key===D.anchor.key&&D.anchor.set(ne.getKey(),0,"element"),k.__key===D.focus.key&&D.focus.set(ne.getKey(),0,"element"),k.remove();Q.remove()}}})},ir}var yu,gh;function _d(){return gh||(gh=1,yu=process.env.NODE_ENV==="development"?yC():NC()),yu}var ph;function CC(){if(ph)return _u;ph=1;var t=_d(),e=Un(),n=et,r=on(),c=Bt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(p,"number"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(p,"bullet"),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(p),!0),c.COMMAND_PRIORITY_LOW),p.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[p])}function g(){const[p]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([t.ListNode,t.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return _u.ListPlugin=g,_u}var Nu={},mh;function EC(){if(mh)return Nu;mh=1;var t=_d(),e=Un(),n=et,r=on(),c=Bt();function d(g){n.useEffect(()=>r.mergeRegister(g.registerCommand(t.INSERT_ORDERED_LIST_COMMAND,()=>(t.insertList(g,"number"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.INSERT_UNORDERED_LIST_COMMAND,()=>(t.insertList(g,"bullet"),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(t.REMOVE_LIST_COMMAND,()=>(t.removeList(g),!0),c.COMMAND_PRIORITY_LOW),g.registerCommand(c.INSERT_PARAGRAPH_COMMAND,()=>!!t.$handleListInsertParagraph(),c.COMMAND_PRIORITY_LOW)),[g])}return Nu.ListPlugin=function(){let[g]=e.useLexicalComposerContext();return n.useEffect(()=>{if(!g.hasNodes([t.ListNode,t.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[g]),d(g),null},Nu}const TC=process.env.NODE_ENV==="development"?CC():EC();var xC=TC,Cu={},Ii={},_h;function vC(){if(_h)return Ii;_h=1;var t=on(),e=Bt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(x){return new r(x.__url,{rel:x.__rel,target:x.__target,title:x.__title},x.__key)}constructor(x,w={},P){super(P);const{target:H=null,rel:$=null,title:W=null}=w;this.__url=x,this.__target=H,this.__rel=$,this.__title=W}createDOM(x){const w=document.createElement("a");return w.href=this.sanitizeUrl(this.__url),this.__target!==null&&(w.target=this.__target),this.__rel!==null&&(w.rel=this.__rel),this.__title!==null&&(w.title=this.__title),t.addClassNamesToElement(w,x.theme.link),w}updateDOM(x,w,P){const H=this.__url,$=this.__target,W=this.__rel,B=this.__title;return H!==x.__url&&(w.href=H),$!==x.__target&&($?w.target=$:w.removeAttribute("target")),W!==x.__rel&&(W?w.rel=W:w.removeAttribute("rel")),B!==x.__title&&(B?w.title=B:w.removeAttribute("title")),!1}static importDOM(){return{a:x=>({conversion:c,priority:1})}}static importJSON(x){const w=d(x.url,{rel:x.rel,target:x.target,title:x.title});return w.setFormat(x.format),w.setIndent(x.indent),w.setDirection(x.direction),w}sanitizeUrl(x){try{const w=new URL(x);if(!n.has(w.protocol))return"about:blank"}catch{return x}return x}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(x){const w=this.getWritable();w.__url=x}getTarget(){return this.getLatest().__target}setTarget(x){const w=this.getWritable();w.__target=x}getRel(){return this.getLatest().__rel}setRel(x){const w=this.getWritable();w.__rel=x}getTitle(){return this.getLatest().__title}setTitle(x){const w=this.getWritable();w.__title=x}insertNewAfter(x,w=!0){const P=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(P,w),P}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(x,w,P){if(!e.$isRangeSelection(w))return!1;const H=w.anchor.getNode(),$=w.focus.getNode();return this.isParentOf(H)&&this.isParentOf($)&&w.getTextContent().length>0}}function c(R){let x=null;if(t.isHTMLAnchorElement(R)){const w=R.textContent;(w!==null&&w!==""||R.children.length>0)&&(x=d(R.getAttribute("href")||"",{rel:R.getAttribute("rel"),target:R.getAttribute("target"),title:R.getAttribute("title")}))}return{node:x}}function d(R,x){return e.$applyNodeReplacement(new r(R,x))}function g(R){return R instanceof r}class p extends r{static getType(){return"autolink"}static clone(x){return new p(x.__url,{rel:x.__rel,target:x.__target,title:x.__title},x.__key)}static importJSON(x){const w=N(x.url,{rel:x.rel,target:x.target,title:x.title});return w.setFormat(x.format),w.setIndent(x.indent),w.setDirection(x.direction),w}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(x,w=!0){const P=this.getParentOrThrow().insertNewAfter(x,w);if(e.$isElementNode(P)){const H=N(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return P.append(H),H}return null}}function N(R,x){return e.$applyNodeReplacement(new p(R,x))}function v(R){return R instanceof p}const T=e.createCommand("TOGGLE_LINK_COMMAND");function O(R,x={}){const{target:w,title:P}=x,H=x.rel===void 0?"noreferrer":x.rel,$=e.$getSelection();if(!e.$isRangeSelection($))return;const W=$.extract();if(R===null)W.forEach(B=>{const z=B.getParent();if(g(z)){const X=z.getChildren();for(let ee=0;ee<X.length;ee++)z.insertBefore(X[ee]);z.remove()}});else{if(W.length===1){const X=W[0],ee=b(X,g);if(ee!==null){ee.setURL(R),w!==void 0&&ee.setTarget(w),H!==null&&ee.setRel(H),P!==void 0&&ee.setTitle(P);return}}let B=null,z=null;W.forEach(X=>{const ee=X.getParent();if(!(ee===z||ee===null||e.$isElementNode(X)&&!X.isInline())){if(g(ee)){z=ee,ee.setURL(R),w!==void 0&&ee.setTarget(w),H!==null&&z.setRel(H),P!==void 0&&z.setTitle(P);return}if(ee.is(B)||(B=ee,z=d(R,{rel:H,target:w,title:P}),g(ee)?X.getPreviousSibling()===null?ee.insertBefore(z):ee.insertAfter(z):X.insertBefore(z)),g(X)){if(X.is(z))return;if(z!==null){const le=X.getChildren();for(let j=0;j<le.length;j++)z.append(le[j])}X.remove();return}z!==null&&z.append(X)}})}}function b(R,x){let w=R;for(;w!==null&&w.getParent()!==null&&!x(w);)w=w.getParentOrThrow();return x(w)?w:null}return Ii.$createAutoLinkNode=N,Ii.$createLinkNode=d,Ii.$isAutoLinkNode=v,Ii.$isLinkNode=g,Ii.AutoLinkNode=p,Ii.LinkNode=r,Ii.TOGGLE_LINK_COMMAND=T,Ii.toggleLink=O,Ii}var Pi={},yh;function SC(){if(yh)return Pi;yh=1;var t=on(),e=Bt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends e.ElementNode{static getType(){return"link"}static clone(b){return new r(b.__url,{rel:b.__rel,target:b.__target,title:b.__title},b.__key)}constructor(b,R={},x){super(x);let{target:w=null,rel:P=null,title:H=null}=R;this.__url=b,this.__target=w,this.__rel=P,this.__title=H}createDOM(b){let R=document.createElement("a");return R.href=this.sanitizeUrl(this.__url),this.__target!==null&&(R.target=this.__target),this.__rel!==null&&(R.rel=this.__rel),this.__title!==null&&(R.title=this.__title),t.addClassNamesToElement(R,b.theme.link),R}updateDOM(b,R){let x=this.__url,w=this.__target,P=this.__rel,H=this.__title;return x!==b.__url&&(R.href=x),w!==b.__target&&(w?R.target=w:R.removeAttribute("target")),P!==b.__rel&&(P?R.rel=P:R.removeAttribute("rel")),H!==b.__title&&(H?R.title=H:R.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:c,priority:1})}}static importJSON(b){let R=d(b.url,{rel:b.rel,target:b.target,title:b.title});return R.setFormat(b.format),R.setIndent(b.indent),R.setDirection(b.direction),R}sanitizeUrl(b){try{let R=new URL(b);if(!n.has(R.protocol))return"about:blank"}catch{}return b}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(b){this.getWritable().__url=b}getTarget(){return this.getLatest().__target}setTarget(b){this.getWritable().__target=b}getRel(){return this.getLatest().__rel}setRel(b){this.getWritable().__rel=b}getTitle(){return this.getLatest().__title}setTitle(b){this.getWritable().__title=b}insertNewAfter(b,R=!0){return b=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(b,R),b}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(b,R){if(!e.$isRangeSelection(R))return!1;b=R.anchor.getNode();let x=R.focus.getNode();return this.isParentOf(b)&&this.isParentOf(x)&&0<R.getTextContent().length}}function c(O){let b=null;if(t.isHTMLAnchorElement(O)){let R=O.textContent;(R!==null&&R!==""||0<O.children.length)&&(b=d(O.getAttribute("href")||"",{rel:O.getAttribute("rel"),target:O.getAttribute("target"),title:O.getAttribute("title")}))}return{node:b}}function d(O,b){return e.$applyNodeReplacement(new r(O,b))}function g(O){return O instanceof r}class p extends r{static getType(){return"autolink"}static clone(b){return new p(b.__url,{rel:b.__rel,target:b.__target,title:b.__title},b.__key)}static importJSON(b){let R=N(b.url,{rel:b.rel,target:b.target,title:b.title});return R.setFormat(b.format),R.setIndent(b.indent),R.setDirection(b.direction),R}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(b,R=!0){return b=this.getParentOrThrow().insertNewAfter(b,R),e.$isElementNode(b)?(R=N(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),b.append(R),R):null}}function N(O,b){return e.$applyNodeReplacement(new p(O,b))}let v=e.createCommand("TOGGLE_LINK_COMMAND");function T(O,b){for(;O!==null&&O.getParent()!==null&&!b(O);)O=O.getParentOrThrow();return b(O)?O:null}return Pi.$createAutoLinkNode=N,Pi.$createLinkNode=d,Pi.$isAutoLinkNode=function(O){return O instanceof p},Pi.$isLinkNode=g,Pi.AutoLinkNode=p,Pi.LinkNode=r,Pi.TOGGLE_LINK_COMMAND=v,Pi.toggleLink=function(O,b={}){let{target:R,title:x}=b,w=b.rel===void 0?"noreferrer":b.rel;if(b=e.$getSelection(),e.$isRangeSelection(b))if(b=b.extract(),O===null)b.forEach(P=>{if(P=P.getParent(),g(P)){let H=P.getChildren();for(let $=0;$<H.length;$++)P.insertBefore(H[$]);P.remove()}});else{if(b.length===1){let $=T(b[0],g);if($!==null){$.setURL(O),R!==void 0&&$.setTarget(R),w!==null&&$.setRel(w),x!==void 0&&$.setTitle(x);return}}let P=null,H=null;b.forEach($=>{var W=$.getParent();if(W!==H&&W!==null&&(!e.$isElementNode($)||$.isInline()))if(g(W))H=W,W.setURL(O),R!==void 0&&W.setTarget(R),w!==null&&H.setRel(w),x!==void 0&&H.setTitle(x);else if(W.is(P)||(P=W,H=d(O,{rel:w,target:R,title:x}),g(W)?$.getPreviousSibling()===null?W.insertBefore(H):W.insertAfter(H):$.insertBefore(H)),g($)){if(!$.is(H)){if(H!==null){W=$.getChildren();for(let B=0;B<W.length;B++)H.append(W[B])}$.remove()}}else H!==null&&H.append($)})}},Pi}var Eu,Nh;function yd(){return Nh||(Nh=1,Eu=process.env.NODE_ENV==="development"?vC():SC()),Eu}var Ch;function wC(){if(Ch)return Cu;Ch=1;var t=yd(),e=Un(),n=on(),r=Bt(),c=et;function d({validateUrl:g}){const[p]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!p.hasNodes([t.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(t.TOGGLE_LINK_COMMAND,N=>{if(N===null)return t.toggleLink(N),!0;if(typeof N=="string")return g===void 0||g(N)?(t.toggleLink(N),!0):!1;{const{url:v,target:T,rel:O,title:b}=N;return t.toggleLink(v,{rel:O,target:T,title:b}),!0}},r.COMMAND_PRIORITY_LOW),g!==void 0?p.registerCommand(r.PASTE_COMMAND,N=>{const v=r.$getSelection();if(!r.$isRangeSelection(v)||v.isCollapsed()||!(N instanceof ClipboardEvent)||N.clipboardData==null)return!1;const T=N.clipboardData.getData("text");return g(T)?v.getNodes().some(O=>r.$isElementNode(O))?!1:(p.dispatchCommand(t.TOGGLE_LINK_COMMAND,T),N.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,g]),null}return Cu.LinkPlugin=d,Cu}var Tu={},Eh;function OC(){if(Eh)return Tu;Eh=1;var t=yd(),e=Un(),n=on(),r=Bt(),c=et;return Tu.LinkPlugin=function({validateUrl:d}){let[g]=e.useLexicalComposerContext();return c.useEffect(()=>{if(!g.hasNodes([t.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(g.registerCommand(t.TOGGLE_LINK_COMMAND,p=>{if(p===null)return t.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(t.toggleLink(p),!0):!1;let{url:N,target:v,rel:T,title:O}=p;return t.toggleLink(N,{rel:T,target:v,title:O}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?g.registerCommand(r.PASTE_COMMAND,p=>{let N=r.$getSelection();if(!r.$isRangeSelection(N)||N.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let v=p.clipboardData.getData("text");return d(v)?N.getNodes().some(T=>r.$isElementNode(T))?!1:(g.dispatchCommand(t.TOGGLE_LINK_COMMAND,v),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[g,d]),null},Tu}const DC=process.env.NODE_ENV==="development"?wC():OC();var AC=DC,xu={},Gt={},Th;function MC(){if(Th)return Gt;Th=1;var t=Bt(),e=on();const n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const fe=new c(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return fe.__rowSpan=ie.__rowSpan,fe.__backgroundColor=ie.__backgroundColor,fe}static importDOM(){return{td:ie=>({conversion:d,priority:0}),th:ie=>({conversion:d,priority:0})}}static importJSON(ie){const fe=ie.colSpan||1,Oe=ie.rowSpan||1,Re=g(ie.headerState,fe,ie.width||void 0);return Re.__rowSpan=Oe,Re.__backgroundColor=ie.backgroundColor||null,Re}constructor(ie=r.NO_STATUS,fe=1,Oe,Re){super(fe,Re),this.__headerState=ie,this.__width=Oe,this.__backgroundColor=null}createDOM(ie){const fe=document.createElement(this.getTag());return this.__width&&(fe.style.width=`${this.__width}px`),this.__colSpan>1&&(fe.colSpan=this.__colSpan),this.__rowSpan>1&&(fe.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(fe.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(fe,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),fe}exportDOM(ie){const{element:fe}=super.exportDOM(ie);if(fe){const Oe=fe,Re=700,De=this.getParentOrThrow().getChildrenSize();Oe.style.border="1px solid black",this.__colSpan>1&&(Oe.colSpan=this.__colSpan),this.__rowSpan>1&&(Oe.rowSpan=this.__rowSpan),Oe.style.width=`${this.getWidth()||Math.max(90,Re/De)}px`,Oe.style.verticalAlign="top",Oe.style.textAlign="start";const We=this.getBackgroundColor();We!==null?Oe.style.backgroundColor=We:this.hasHeader()&&(Oe.style.backgroundColor="#f2f3f5")}return{element:fe}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const fe=this.getWritable();return fe.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const fe=this.getWritable();return fe.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const fe=this.getWritable();return(fe.__headerState&ie)===ie?fe.__headerState-=ie:fe.__headerState+=ie,fe}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(ve){const ie=ve,fe=ve.nodeName.toLowerCase();let Oe;n.test(ie.style.width)&&(Oe=parseFloat(ie.style.width));const Re=g(fe==="th"?r.ROW:r.NO_STATUS,ie.colSpan,Oe);Re.__rowSpan=ie.rowSpan;const De=ie.style.backgroundColor;return De!==""&&(Re.__backgroundColor=De),{forChild:(We,qe)=>{if(p(qe)&&!t.$isElementNode(We)){const Qe=t.$createParagraphNode();return t.$isLineBreakNode(We)&&We.getTextContent()===`
74
+ `?null:(Qe.append(We),Qe)}return We},node:Re}}function g(ve,ie=1,fe){return t.$applyNodeReplacement(new c(ve,ie,fe))}function p(ve){return ve instanceof c}class N extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new N(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:v,priority:0})}}static importJSON(ie){return T(ie.height)}constructor(ie,fe){super(fe),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const fe=document.createElement("tr");return this.__height&&(fe.style.height=`${this.__height}px`),e.addClassNamesToElement(fe,ie.theme.tableRow),fe}isShadowRoot(){return!0}setHeight(ie){const fe=this.getWritable();return fe.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function v(ve){const ie=ve;let fe;return n.test(ie.style.height)&&(fe=parseFloat(ie.style.height)),{node:T(fe)}}function T(ve){return t.$applyNodeReplacement(new N(ve))}function O(ve){return ve instanceof N}const b=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",R=ve=>b?(ve||window).getSelection():null;class x{constructor(ie,fe){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=fe,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(fe=>{this.editor.update(()=>{let Oe=!1;for(let De=0;De<fe.length;De++){const Qe=fe[De].target.nodeName;if(Qe==="TABLE"||Qe==="TR"){Oe=!0;break}}if(!Oe)return;const Re=this.editor.getElementByKey(this.tableNodeKey);if(!Re)throw new Error("Expected to find TableElement in DOM");this.grid=B(Re)})});this.editor.update(()=>{const fe=this.editor.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");this.grid=B(fe),ie.observe(fe,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=ie.getElementByKey(this.tableNodeKey);if(!Oe)throw new Error("Expected to find TableElement in DOM");const Re=B(Oe);z(ie,Re,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(fe,ie._config.theme.tableSelection),fe.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const fe=ie.getElementByKey(this.tableNodeKey);if(!fe)throw new Error("Expected to find TableElement in DOM");e.addClassNamesToElement(fe,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const fe=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),z(fe,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,fe=!1){const Oe=this.editor;Oe.update(()=>{const Re=t.$getNodeByKey(this.tableNodeKey);if(!m(Re))throw new Error("Expected TableNode.");if(!Oe.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const We=ie.x,qe=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const Qe=R(Oe._window);Qe&&Qe.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==We||this.anchorY!==qe||fe))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(We===this.focusX&&qe===this.focusY)return;if(this.focusX=We,this.focusY=qe,this.isHighlightingCells){const Qe=t.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(Qe)){const ft=Qe.getKey();this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ft,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Oe.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),z(Oe,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const fe=t.$getNearestNodeFromDOMNode(ie.elem);if(p(fe)){const Oe=fe.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=Oe}})}formatCells(ie){this.editor.update(()=>{const fe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(fe))throw Error("Expected grid selection");const Oe=t.$createRangeSelection(),Re=Oe.anchor,De=Oe.focus;fe.getNodes().forEach(We=>{p(We)&&We.getTextContentSize()!==0&&(Re.set(We.getKey(),0,"element"),De.set(We.getKey(),We.getChildrenSize(),"element"),Oe.formatText(ie))}),t.$setSelection(fe),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const fe=t.$getNodeByKey(this.tableNodeKey);if(!m(fe))throw new Error("Expected TableNode.");const Oe=t.$getSelection();if(!t.DEPRECATED_$isGridSelection(Oe))throw Error("Expected grid selection");const Re=Oe.getNodes().filter(p);if(Re.length===this.grid.columns*this.grid.rows){fe.selectPrevious(),fe.remove(),t.$getRoot().selectStart();return}Re.forEach(De=>{if(t.$isElementNode(De)){const We=t.$createParagraphNode(),qe=t.$createTextNode();We.append(qe),De.append(We),De.getChildren().forEach(Qe=>{Qe!==We&&Qe.remove()})}}),z(ie,this.grid,null),t.$setSelection(null),ie.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}}const w="__lexicalTableSelection";function P(ve,ie,fe,Oe){const Re=fe.getRootElement();if(Re===null)throw new Error("No root element.");const De=new x(fe,ve.getKey()),We=fe._window||window;H(ie,De),ie.addEventListener("mousedown",je=>{setTimeout(()=>{if(je.button!==0||!We)return;const Ve=W(je.target);Ve!==null&&(ne(je),De.setAnchorCellForSelection(Ve));const rt=()=>{We.removeEventListener("mouseup",rt),We.removeEventListener("mousemove",_t)},_t=Et=>{const St=W(Et.target);St!==null&&(De.anchorX!==St.x||De.anchorY!==St.y)&&(Et.preventDefault(),De.setFocusCellForSelection(St))};We.addEventListener("mouseup",rt),We.addEventListener("mousemove",_t)},0)});const qe=je=>{je.button===0&&fe.update(()=>{const Ve=t.$getSelection(),rt=je.target;t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&Re.contains(rt)&&De.clearHighlight()})};We.addEventListener("mousedown",qe),De.listenersToRemove.add(()=>We.removeEventListener("mousedown",qe)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_DOWN_COMMAND,je=>V(fe,je,"down",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_UP_COMMAND,je=>V(fe,je,"up",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_LEFT_COMMAND,je=>V(fe,je,"backward",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,je=>V(fe,je,"forward",ve,De),t.COMMAND_PRIORITY_HIGH)),De.listenersToRemove.add(fe.registerCommand(t.KEY_ESCAPE_COMMAND,je=>{const Ve=t.$getSelection();if(t.DEPRECATED_$isGridSelection(Ve)){const rt=e.$findMatchingParent(Ve.focus.getNode(),p);if(p(rt))return ne(je),rt.selectEnd(),!0}return!1},t.COMMAND_PRIORITY_HIGH));const Qe=je=>()=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>p(bt));if(!p(rt))return!1;const _t=Ve.anchor.getNode(),Et=Ve.focus.getNode(),St=ve.isParentOf(_t),Ot=ve.isParentOf(Et);if(St&&!Ot||Ot&&!St)return De.clearText(),!0;const xt=e.$findMatchingParent(Ve.anchor.getNode(),bt=>t.$isElementNode(bt)),Qt=xt&&e.$findMatchingParent(xt,bt=>t.$isElementNode(bt)&&p(bt.getParent()));if(!t.$isElementNode(Qt)||!t.$isElementNode(xt))return!1;if(je===t.DELETE_LINE_COMMAND&&Qt.getPreviousSibling()===null)return!0;if((je===t.DELETE_CHARACTER_COMMAND||je===t.DELETE_WORD_COMMAND)&&Ve.isCollapsed()&&Ve.anchor.offset===0&&xt!==Qt){const bt=xt.getChildren(),Ut=t.$createParagraphNode();return bt.forEach(It=>Ut.append(It)),xt.replace(Ut),xt.getWritable().__parent=rt.getKey(),!0}}return!1};[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(je=>{De.listenersToRemove.add(fe.registerCommand(je,Qe(je),t.COMMAND_PRIORITY_CRITICAL))});const ft=je=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return je.preventDefault(),je.stopPropagation(),De.clearText(),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1};De.listenersToRemove.add(fe.registerCommand(t.KEY_BACKSPACE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.KEY_DELETE_COMMAND,ft,t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FORMAT_TEXT_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.formatCells(je),!0;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,je=>{const Ve=t.$getSelection();if(!q(Ve,ve))return!1;if(t.DEPRECATED_$isGridSelection(Ve))return De.clearHighlight(),!1;if(t.$isRangeSelection(Ve)){const rt=e.$findMatchingParent(Ve.anchor.getNode(),_t=>p(_t));if(!p(rt))return!1}return!1},t.COMMAND_PRIORITY_CRITICAL)),Oe&&De.listenersToRemove.add(fe.registerCommand(t.KEY_TAB_COMMAND,je=>{const Ve=t.$getSelection();if(!t.$isRangeSelection(Ve)||!Ve.isCollapsed()||!q(Ve,ve))return!1;const rt=K(Ve.anchor.getNode());if(rt===null)return!1;ne(je);const _t=ve.getCordsFromCellNode(rt,De.grid);return j(De,ve,_t.x,_t.y,je.shiftKey?"backward":"forward"),!0},t.COMMAND_PRIORITY_CRITICAL)),De.listenersToRemove.add(fe.registerCommand(t.FOCUS_COMMAND,je=>ve.isSelected(),t.COMMAND_PRIORITY_HIGH));function kt(je){const Ve=ve.getCordsFromCellNode(je,De.grid);return ve.getCellFromCordsOrThrow(Ve.x,Ve.y,De.grid)}return De.listenersToRemove.add(fe.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{const je=t.$getSelection(),Ve=t.$getPreviousSelection();if(t.$isRangeSelection(je)){const{anchor:rt,focus:_t}=je,Et=rt.getNode(),St=_t.getNode(),Ot=K(Et),At=K(St),xt=Ot&&ve.is(D(Ot)),Qt=At&&ve.is(D(At)),bt=xt!==Qt,Ut=xt&&Qt,It=je.isBackward();if(bt){const hr=je.clone();hr.focus.set(ve.getKey(),It?0:ve.getChildrenSize(),"element"),t.$setSelection(hr),ee(fe,De)}else Ut&&(Ot.is(At)||(De.setAnchorCellForSelection(kt(Ot)),De.setFocusCellForSelection(kt(At),!0)))}return je&&!je.is(Ve)&&(t.DEPRECATED_$isGridSelection(je)||t.DEPRECATED_$isGridSelection(Ve))&&De.gridSelection&&!De.gridSelection.is(Ve)?(t.DEPRECATED_$isGridSelection(je)&&je.gridKey===De.tableNodeKey?De.updateTableGridSelection(je):!t.DEPRECATED_$isGridSelection(je)&&t.DEPRECATED_$isGridSelection(Ve)&&Ve.gridKey===De.tableNodeKey&&De.updateTableGridSelection(null),!1):(De.hasHijackedSelectionStyles&&!ve.isSelected()?le(fe,De):!De.hasHijackedSelectionStyles&&ve.isSelected()&&ee(fe,De),!1)},t.COMMAND_PRIORITY_CRITICAL)),De}function H(ve,ie){ve[w]=ie}function $(ve){return ve[w]}function W(ve){let ie=ve;for(;ie!=null;){const fe=ie.nodeName;if(fe==="TD"||fe==="TH"){const Oe=ie._cell;return Oe===void 0?null:Oe}ie=ie.parentNode}return null}function B(ve){const ie=[],fe={cells:ie,columns:0,rows:0};let Oe=ve.firstChild,Re=0,De=0;for(ie.length=0;Oe!=null;){const We=Oe.nodeName;if(We==="TD"||We==="TH"){const ft=Oe,kt={elem:ft,hasBackgroundColor:ft.style.backgroundColor!=="",highlighted:!1,x:Re,y:De};Oe._cell=kt;let je=ie[De];je===void 0&&(je=ie[De]=[]),je[Re]=kt}else{const ft=Oe.firstChild;if(ft!=null){Oe=ft;continue}}const qe=Oe.nextSibling;if(qe!=null){Re++,Oe=qe;continue}const Qe=Oe.parentNode;if(Qe!=null){const ft=Qe.nextSibling;if(ft==null)break;De++,Re=0,Oe=ft}}return fe.columns=Re+1,fe.rows=De+1,fe}function z(ve,ie,fe){const Oe=new Set(fe?fe.getNodes():[]);X(ie,(Re,De)=>{const We=Re.elem;Oe.has(De)?(Re.highlighted=!0,pe(ve,Re)):(Re.highlighted=!1,ue(ve,Re),We.getAttribute("style")||We.removeAttribute("style"))})}function X(ve,ie){const{cells:fe}=ve;for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(Re)for(let De=0;De<Re.length;De++){const We=Re[De];if(!We)continue;const qe=t.$getNearestNodeFromDOMNode(We.elem);qe!==null&&ie(We,qe,{x:De,y:Oe})}}}function ee(ve,ie){ie.disableHighlightStyle(),X(ie.grid,fe=>{fe.highlighted=!0,pe(ve,fe)})}function le(ve,ie){ie.enableHighlightStyle(),X(ie.grid,fe=>{const Oe=fe.elem;fe.highlighted=!1,ue(ve,fe),Oe.getAttribute("style")||Oe.removeAttribute("style")})}const j=(ve,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?ve.grid.columns-1:0)?me(ie.getCellNodeFromCordsOrThrow(fe+(De?1:-1),Oe,ve.grid),De):Oe!==(De?ve.grid.rows-1:0)?me(ie.getCellNodeFromCordsOrThrow(De?0:ve.grid.columns-1,Oe+(De?1:-1),ve.grid),De):De?ie.selectNext():ie.selectPrevious(),!0;case"up":return Oe!==0?me(ie.getCellNodeFromCordsOrThrow(fe,Oe-1,ve.grid),!1):ie.selectPrevious(),!0;case"down":return Oe!==ve.grid.rows-1?me(ie.getCellNodeFromCordsOrThrow(fe,Oe+1,ve.grid),!0):ie.selectNext(),!0;default:return!1}},U=(ve,ie,fe,Oe,Re)=>{const De=Re==="forward";switch(Re){case"backward":case"forward":return fe!==(De?ve.grid.columns-1:0)&&ve.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe+(De?1:-1),Oe,ve.grid)),!0;case"up":return Oe!==0?(ve.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe-1,ve.grid)),!0):!1;case"down":return Oe!==ve.grid.rows-1?(ve.setFocusCellForSelection(ie.getCellFromCordsOrThrow(fe,Oe+1,ve.grid)),!0):!1;default:return!1}};function q(ve,ie){if(t.$isRangeSelection(ve)||t.DEPRECATED_$isGridSelection(ve)){const fe=ie.isParentOf(ve.anchor.getNode()),Oe=ie.isParentOf(ve.focus.getNode());return fe&&Oe}return!1}function me(ve,ie){ie?ve.selectStart():ve.selectEnd()}const _e="172,206,247";function pe(ve,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null?fe.style.setProperty("background-color",`rgb(${_e})`):fe.style.setProperty("background-image",`linear-gradient(to right, rgba(${_e},0.85), rgba(${_e},0.85))`),fe.style.setProperty("caret-color","transparent")}function ue(ve,ie){const fe=ie.elem,Oe=t.$getNearestNodeFromDOMNode(fe);if(!p(Oe))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Oe.getBackgroundColor()===null&&fe.style.removeProperty("background-color"),fe.style.removeProperty("background-image"),fe.style.removeProperty("caret-color")}function K(ve){const ie=e.$findMatchingParent(ve,p);return p(ie)?ie:null}function D(ve){const ie=e.$findMatchingParent(ve,m);return m(ie)?ie:null}function V(ve,ie,fe,Oe,Re){const De=t.$getSelection();if(!q(De,Oe))return!1;if(t.$isRangeSelection(De)&&De.isCollapsed()){if(fe==="backward"||fe==="forward")return!1;const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p);if(!p(Qe)||!Qe.is(ft))return!1;const kt=D(Qe);if(kt!==Oe&&kt!=null){const At=ve.getElementByKey(kt.getKey());if(At!=null)return Re.grid=B(At),V(ve,ie,fe,kt,Re)}const je=ve.getElementByKey(Qe.__key),Ve=ve.getElementByKey(We.key);if(Ve==null||je==null)return!1;let rt;if(We.type==="element")rt=Ve.getBoundingClientRect();else{const At=window.getSelection();if(At===null||At.rangeCount===0)return!1;rt=At.getRangeAt(0).getBoundingClientRect()}const _t=fe==="up"?Qe.getFirstChild():Qe.getLastChild();if(_t==null)return!1;const Et=ve.getElementByKey(_t.__key);if(Et==null)return!1;const St=Et.getBoundingClientRect();if(fe==="up"?St.top>rt.top-rt.height:rt.bottom+rt.height>St.bottom){ne(ie);const At=Oe.getCordsFromCellNode(Qe,Re.grid);if(ie.shiftKey){const xt=Oe.getCellFromCordsOrThrow(At.x,At.y,Re.grid);Re.setAnchorCellForSelection(xt),Re.setFocusCellForSelection(xt,!0)}else return j(Re,Oe,At.x,At.y,fe);return!0}}else if(t.DEPRECATED_$isGridSelection(De)){const{anchor:We,focus:qe}=De,Qe=e.$findMatchingParent(We.getNode(),p),ft=e.$findMatchingParent(qe.getNode(),p),[kt]=De.getNodes(),je=ve.getElementByKey(kt.getKey());if(!p(Qe)||!p(ft)||!m(kt)||je==null)return!1;Re.updateTableGridSelection(De);const Ve=B(je),rt=Oe.getCordsFromCellNode(Qe,Ve),_t=Oe.getCellFromCordsOrThrow(rt.x,rt.y,Ve);if(Re.setAnchorCellForSelection(_t),ne(ie),ie.shiftKey){const Et=Oe.getCordsFromCellNode(ft,Ve);return U(Re,kt,Et.x,Et.y,fe)}else ft.selectEnd();return!0}return!1}function ne(ve){ve.preventDefault(),ve.stopImmediatePropagation(),ve.stopPropagation()}class Y extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new Y(ie.__key)}static importDOM(){return{table:ie=>({conversion:Q,priority:1})}}static importJSON(ie){return k()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,fe){const Oe=document.createElement("table");return e.addClassNamesToElement(Oe,ie.theme.table),Oe}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:fe=>{if(fe){const Oe=fe.cloneNode(),Re=document.createElement("colgroup"),De=document.createElement("tbody");e.isHTMLElement(fe)&&De.append(...fe.children);const We=this.getFirstChildOrThrow();if(!O(We))throw new Error("Expected to find row node.");const qe=We.getChildrenSize();for(let Qe=0;Qe<qe;Qe++){const ft=document.createElement("col");Re.append(ft)}return Oe.replaceChildren(Re,De),Oe}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,fe){const{rows:Oe,cells:Re}=fe;for(let De=0;De<Oe;De++){const We=Re[De];if(We==null)continue;const qe=We.findIndex(Qe=>{if(!Qe)return;const{elem:ft}=Qe;return t.$getNearestNodeFromDOMNode(ft)===ie});if(qe!==-1)return{x:qe,y:De}}throw new Error("Cell not found in table.")}getCellFromCords(ie,fe,Oe){const{cells:Re}=Oe,De=Re[fe];if(De==null)return null;const We=De[ie];return We??null}getCellFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(!Re)throw new Error("Cell not found at cords.");return Re}getCellNodeFromCords(ie,fe,Oe){const Re=this.getCellFromCords(ie,fe,Oe);if(Re==null)return null;const De=t.$getNearestNodeFromDOMNode(Re.elem);return p(De)?De:null}getCellNodeFromCordsOrThrow(ie,fe,Oe){const Re=this.getCellNodeFromCords(ie,fe,Oe);if(!Re)throw new Error("Node at cords not TableCellNode.");return Re}canSelectBefore(){return!0}canIndent(){return!1}}function G(ve,ie){const fe=ve.getElementByKey(ie.getKey());if(fe==null)throw new Error("Table Element Not Found");return B(fe)}function Q(ve){return{node:k()}}function k(){return t.$applyNodeReplacement(new Y)}function m(ve){return ve instanceof Y}function y(ve,ie,fe=!0){const Oe=k();for(let Re=0;Re<ve;Re++){const De=T();for(let We=0;We<ie;We++){let qe=r.NO_STATUS;typeof fe=="object"?(Re===0&&fe.rows&&(qe|=r.ROW),We===0&&fe.columns&&(qe|=r.COLUMN)):fe&&(Re===0&&(qe|=r.ROW),We===0&&(qe|=r.COLUMN));const Qe=g(qe),ft=t.$createParagraphNode();ft.append(t.$createTextNode()),Qe.append(ft),De.append(Qe)}Oe.append(De)}return Oe}function M(ve){const ie=e.$findMatchingParent(ve,fe=>p(fe));return p(ie)?ie:null}function Z(ve){const ie=e.$findMatchingParent(ve,fe=>O(fe));if(O(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ae(ve){const ie=e.$findMatchingParent(ve,fe=>m(fe));if(m(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function he(ve){const ie=Z(ve);return ae(ie).getChildren().findIndex(Oe=>Oe.is(ie))}function se(ve){return Z(ve).getChildren().findIndex(fe=>fe.is(ve))}function Te(ve,ie){const fe=ae(ve),{x:Oe,y:Re}=fe.getCordsFromCellNode(ve,ie);return{above:fe.getCellNodeFromCords(Oe,Re-1,ie),below:fe.getCellNodeFromCords(Oe,Re+1,ie),left:fe.getCellNodeFromCords(Oe-1,Re,ie),right:fe.getCellNodeFromCords(Oe+1,Re,ie)}}function be(ve,ie){const fe=ve.getChildren();if(ie>=fe.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return fe[ie].remove(),ve}function Ue(ve,ie,fe=!0,Oe,Re){const De=ve.getChildren();if(ie>=De.length||ie<0)throw new Error("Table row target index out of range");const We=De[ie];if(O(We))for(let qe=0;qe<Oe;qe++){const Qe=We.getChildren(),ft=Qe.length,kt=T();for(let je=0;je<ft;je++){const Ve=Qe[je];if(!p(Ve))throw Error("Expected table cell");const{above:rt,below:_t}=Te(Ve,Re);let Et=r.NO_STATUS;const St=rt&&rt.getWidth()||_t&&_t.getWidth()||void 0;(rt&&rt.hasHeaderState(r.COLUMN)||_t&&_t.hasHeaderState(r.COLUMN))&&(Et|=r.COLUMN);const Ot=g(Et,1,St);Ot.append(t.$createParagraphNode()),kt.append(Ot)}fe?We.insertAfter(kt):We.insertBefore(kt)}else throw new Error("Row before insertion index does not exist.");return ve}function re(ve=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const fe=ie.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,We]=t.DEPRECATED_$computeGridMap(Re,Oe,Oe),qe=De[0].length,{startRow:Qe}=We;if(ve){const ft=Qe+Oe.__rowSpan-1,kt=De[ft],je=T();for(let rt=0;rt<qe;rt++){const{cell:_t,startRow:Et}=kt[rt];Et+_t.__rowSpan-1<=ft?je.append(g(r.NO_STATUS)):_t.setRowSpan(_t.__rowSpan+1)}const Ve=Re.getChildAtIndex(ft);if(!t.DEPRECATED_$isGridRowNode(Ve))throw Error("focusEndRow is not a GridRowNode");Ve.insertAfter(je)}else{const ft=De[Qe],kt=T();for(let Ve=0;Ve<qe;Ve++){const{cell:rt,startRow:_t}=ft[Ve];_t===Qe?kt.append(g(r.NO_STATUS)):rt.setRowSpan(rt.__rowSpan+1)}const je=Re.getChildAtIndex(Qe);if(!t.DEPRECATED_$isGridRowNode(je))throw Error("focusEndRow is not a GridRowNode");je.insertBefore(kt)}}function te(ve,ie,fe=!0,Oe,Re){const De=ve.getChildren(),We=[];for(let qe=0;qe<De.length;qe++){const Qe=De[qe];if(O(Qe))for(let ft=0;ft<Oe;ft++){const kt=Qe.getChildren();if(ie>=kt.length||ie<0)throw new Error("Table column target index out of range");const je=kt[ie];if(!p(je))throw Error("Expected table cell");const{left:Ve,right:rt}=Te(je,Re);let _t=r.NO_STATUS;(Ve&&Ve.hasHeaderState(r.ROW)||rt&&rt.hasHeaderState(r.ROW))&&(_t|=r.ROW);const Et=g(_t);Et.append(t.$createParagraphNode()),We.push({newTableCell:Et,targetCell:je})}}return We.forEach(({newTableCell:qe,targetCell:Qe})=>{fe?Qe.insertAfter(qe):Qe.insertBefore(qe)}),ve}function ce(ve=!0){const ie=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const fe=ie.anchor.getNode(),Oe=ie.focus.getNode(),[Re]=t.DEPRECATED_$getNodeTriplet(fe),[De,,We]=t.DEPRECATED_$getNodeTriplet(Oe),[qe,Qe,ft]=t.DEPRECATED_$computeGridMap(We,De,Re),kt=qe.length,je=ve?Math.max(Qe.startColumn,ft.startColumn):Math.min(Qe.startColumn,ft.startColumn),Ve=ve?je+De.__colSpan-1:je-1,rt=We.getFirstChild();if(!t.DEPRECATED_$isGridRowNode(rt))throw Error("Expected firstTable child to be a row");let _t=null;function Et(){const Ot=g(r.NO_STATUS).append(t.$createParagraphNode());return _t===null&&(_t=Ot),Ot}let St=rt;e:for(let Ot=0;Ot<kt;Ot++){if(Ot!==0){const Ut=St.getNextSibling();if(!t.DEPRECATED_$isGridRowNode(Ut))throw Error("Expected row nextSibling to be a row");St=Ut}const At=qe[Ot];if(Ve<0){ct(St,Et());continue}const{cell:xt,startColumn:Qt,startRow:bt}=At[Ve];if(Qt+xt.__colSpan-1<=Ve){let Ut=xt,It=bt,hr=Ve;for(;It!==Ot&&Ut.__rowSpan>1;)if(hr-=xt.__colSpan,hr>=0){const{cell:Sr,startRow:Fi}=At[hr];Ut=Sr,It=Fi}else{St.append(Et());continue e}Ut.insertAfter(Et())}else xt.setColSpan(xt.__colSpan+1)}_t!==null&&Ye(_t)}function we(ve,ie){const fe=ve.getChildren();for(let Oe=0;Oe<fe.length;Oe++){const Re=fe[Oe];if(O(Re)){const De=Re.getChildren();if(ie>=De.length||ie<0)throw new Error("Table column target index out of range");De[ie].remove()}}return ve}function Le(){const ve=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ve))throw Error("Expected a INTERNAL_PointSelection");const ie=ve.anchor.getNode(),fe=ve.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startRow:ft}=qe,{startRow:kt}=Qe,je=kt+De.__rowSpan-1;if(We.length===je-ft+1){Re.remove();return}const Ve=We[0].length,rt=We[je+1],_t=Re.getChildAtIndex(je+1);for(let Et=je;Et>=ft;Et--){for(let Ot=Ve-1;Ot>=0;Ot--){const{cell:At,startRow:xt,startColumn:Qt}=We[Et][Ot];if(Qt===Ot&&(Et===ft&&xt<ft&&At.setRowSpan(At.__rowSpan-(xt-ft)),xt>=ft&&xt+At.__rowSpan-1>je)){if(At.setRowSpan(At.__rowSpan-(je-xt+1)),_t===null)throw Error("Expected nextRowNode not to be null");if(Ot===0)ct(_t,At);else{const{cell:bt}=rt[Ot-1];bt.insertAfter(At)}}}const St=Re.getChildAtIndex(Et);if(!t.DEPRECATED_$isGridRowNode(St))throw Error(`Expected GridNode childAtIndex(${String(Et)}) to be RowNode`);St.remove()}if(rt!==void 0){const{cell:Et}=rt[0];Ye(Et)}else{const Et=We[ft-1],{cell:St}=Et[0];Ye(St)}}function Be(){const ve=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ve))throw Error("Expected a INTERNAL_PointSelection");const ie=ve.anchor.getNode(),fe=ve.focus.getNode(),[Oe,,Re]=t.DEPRECATED_$getNodeTriplet(ie),[De]=t.DEPRECATED_$getNodeTriplet(fe),[We,qe,Qe]=t.DEPRECATED_$computeGridMap(Re,Oe,De),{startColumn:ft}=qe,{startRow:kt,startColumn:je}=Qe,Ve=Math.min(ft,je),rt=Math.max(ft+Oe.__colSpan-1,je+De.__colSpan-1),_t=rt-Ve+1;if(We[0].length===rt-Ve+1){Re.selectPrevious(),Re.remove();return}const St=We.length;for(let xt=0;xt<St;xt++)for(let Qt=Ve;Qt<=rt;Qt++){const{cell:bt,startColumn:Ut}=We[xt][Qt];if(Ut<Ve){if(Qt===Ve){const It=Ve-Ut;bt.setColSpan(bt.__colSpan-Math.min(_t,bt.__colSpan-It))}}else if(Ut+bt.__colSpan-1>rt){if(Qt===rt){const It=rt-Ut+1;bt.setColSpan(bt.__colSpan-It)}}else bt.remove()}const Ot=We[kt],At=Ot[je+De.__colSpan];if(At!==void 0){const{cell:xt}=At;Ye(xt)}else{const xt=Ot[je-1],{cell:Qt}=xt;Ye(Qt)}}function Ye(ve){const ie=ve.getFirstDescendant();ie==null?ve.selectStart():ie.getParentOrThrow().selectStart()}function ct(ve,ie){const fe=ve.getFirstChild();fe!==null?fe.insertBefore(ie):ve.append(ie)}function yt(){const ve=t.$getSelection();if(!t.$INTERNAL_isPointSelection(ve))throw Error("Expected a INTERNAL_PointSelection");const ie=ve.anchor.getNode(),[fe,Oe,Re]=t.DEPRECATED_$getNodeTriplet(ie),De=fe.__colSpan,We=fe.__rowSpan;if(De>1){for(let qe=1;qe<De;qe++)fe.insertAfter(g(r.NO_STATUS));fe.setColSpan(1)}if(We>1){const[qe,Qe]=t.DEPRECATED_$computeGridMap(Re,fe,fe),{startColumn:ft,startRow:kt}=Qe;let je;for(let Ve=1;Ve<We;Ve++){const rt=kt+Ve,_t=qe[rt];if(je=(je||Oe).getNextSibling(),!t.DEPRECATED_$isGridRowNode(je))throw Error("Expected row next sibling to be a row");let Et=null;for(let St=0;St<ft;St++){const Ot=_t[St],At=Ot.cell;Ot.startRow===rt&&(Et=At),At.__colSpan>1&&(St+=At.__colSpan-1)}if(Et===null)for(let St=0;St<De;St++)ct(je,g(r.NO_STATUS));else for(let St=0;St<De;St++)Et.insertAfter(g(r.NO_STATUS))}fe.setRowSpan(1)}}const dt=t.createCommand("INSERT_TABLE_COMMAND");return Gt.$createTableCellNode=g,Gt.$createTableNode=k,Gt.$createTableNodeWithDimensions=y,Gt.$createTableRowNode=T,Gt.$deleteTableColumn=we,Gt.$deleteTableColumn__EXPERIMENTAL=Be,Gt.$deleteTableRow__EXPERIMENTAL=Le,Gt.$getElementGridForTableNode=G,Gt.$getTableCellNodeFromLexicalNode=M,Gt.$getTableColumnIndexFromTableCellNode=se,Gt.$getTableNodeFromLexicalNodeOrThrow=ae,Gt.$getTableRowIndexFromTableCellNode=he,Gt.$getTableRowNodeFromTableCellNodeOrThrow=Z,Gt.$insertTableColumn=te,Gt.$insertTableColumn__EXPERIMENTAL=ce,Gt.$insertTableRow=Ue,Gt.$insertTableRow__EXPERIMENTAL=re,Gt.$isTableCellNode=p,Gt.$isTableNode=m,Gt.$isTableRowNode=O,Gt.$removeTableRowAtIndex=be,Gt.$unmergeCell=yt,Gt.INSERT_TABLE_COMMAND=dt,Gt.TableCellHeaderStates=r,Gt.TableCellNode=c,Gt.TableNode=Y,Gt.TableRowNode=N,Gt.TableSelection=x,Gt.applyTableHandlers=P,Gt.getCellFromTarget=W,Gt.getTableSelectionFromTableElement=$,Gt}var Yt={},xh;function RC(){if(xh)return Yt;xh=1;var t=Bt(),e=on();let n=/^(\d+(?:\.\d+)?)px$/,r={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class c extends t.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(y){let M=new c(y.__headerState,y.__colSpan,y.__width,y.__key);return M.__rowSpan=y.__rowSpan,M.__backgroundColor=y.__backgroundColor,M}static importDOM(){return{td:()=>({conversion:d,priority:0}),th:()=>({conversion:d,priority:0})}}static importJSON(y){let M=y.rowSpan||1,Z=g(y.headerState,y.colSpan||1,y.width||void 0);return Z.__rowSpan=M,Z.__backgroundColor=y.backgroundColor||null,Z}constructor(y=r.NO_STATUS,M=1,Z,ae){super(M,ae),this.__headerState=y,this.__width=Z,this.__backgroundColor=null}createDOM(y){let M=document.createElement(this.getTag());return this.__width&&(M.style.width=`${this.__width}px`),1<this.__colSpan&&(M.colSpan=this.__colSpan),1<this.__rowSpan&&(M.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(M.style.backgroundColor=this.__backgroundColor),e.addClassNamesToElement(M,y.theme.tableCell,this.hasHeader()&&y.theme.tableCellHeader),M}exportDOM(y){if({element:y}=super.exportDOM(y),y){var M=this.getParentOrThrow().getChildrenSize();y.style.border="1px solid black",1<this.__colSpan&&(y.colSpan=this.__colSpan),1<this.__rowSpan&&(y.rowSpan=this.__rowSpan),y.style.width=`${this.getWidth()||Math.max(90,700/M)}px`,y.style.verticalAlign="top",y.style.textAlign="start",M=this.getBackgroundColor(),M!==null?y.style.backgroundColor=M:this.hasHeader()&&(y.style.backgroundColor="#f2f3f5")}return{element:y}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(y){return this.getWritable().__headerState=y,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(y){return this.getWritable().__width=y,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(y){this.getWritable().__backgroundColor=y}toggleHeaderStyle(y){let M=this.getWritable();return M.__headerState=(M.__headerState&y)===y?M.__headerState-y:M.__headerState+y,M}hasHeaderState(y){return(this.getHeaderStyles()&y)===y}hasHeader(){return this.getLatest().__headerState!==r.NO_STATUS}updateDOM(y){return y.__headerState!==this.__headerState||y.__width!==this.__width||y.__colSpan!==this.__colSpan||y.__rowSpan!==this.__rowSpan||y.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function d(m){var y=m.nodeName.toLowerCase();let M;return n.test(m.style.width)&&(M=parseFloat(m.style.width)),y=g(y==="th"?r.ROW:r.NO_STATUS,m.colSpan,M),y.__rowSpan=m.rowSpan,m=m.style.backgroundColor,m!==""&&(y.__backgroundColor=m),{forChild:(Z,ae)=>p(ae)&&!t.$isElementNode(Z)?(ae=t.$createParagraphNode(),t.$isLineBreakNode(Z)&&Z.getTextContent()===`
75
+ `?null:(ae.append(Z),ae)):Z,node:y}}function g(m,y=1,M){return t.$applyNodeReplacement(new c(m,y,M))}function p(m){return m instanceof c}class N extends t.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(y){return new N(y.__height,y.__key)}static importDOM(){return{tr:()=>({conversion:v,priority:0})}}static importJSON(y){return T(y.height)}constructor(y,M){super(M),this.__height=y}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(y){let M=document.createElement("tr");return this.__height&&(M.style.height=`${this.__height}px`),e.addClassNamesToElement(M,y.theme.tableRow),M}isShadowRoot(){return!0}setHeight(y){return this.getWritable().__height=y,this.__height}getHeight(){return this.getLatest().__height}updateDOM(y){return y.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function v(m){let y;return n.test(m.style.height)&&(y=parseFloat(m.style.height)),{node:T(y)}}function T(m){return t.$applyNodeReplacement(new N(m))}function O(m){return m instanceof N}function b(m){let y=new URLSearchParams;y.append("code",m);for(let M=1;M<arguments.length;M++)y.append("v",arguments[M]);throw Error(`Minified Lexical error #${m}; visit https://lexical.dev/docs/error?${y} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class x{constructor(y,M){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=M,this.editor=y,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(y=>y())}trackTableGrid(){let y=new MutationObserver(M=>{this.editor.update(()=>{var Z=!1;for(let ae=0;ae<M.length;ae++){const he=M[ae].target.nodeName;if(he==="TABLE"||he==="TR"){Z=!0;break}}if(Z){if(Z=this.editor.getElementByKey(this.tableNodeKey),!Z)throw Error("Expected to find TableElement in DOM");this.grid=P(Z)}})});this.editor.update(()=>{let M=this.editor.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");this.grid=P(M),y.observe(M,{childList:!0,subtree:!0})})}clearHighlight(){let y=this.editor;this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),y.update(()=>{var M=t.$getNodeByKey(this.tableNodeKey);if(!D(M))throw Error("Expected TableNode.");if(M=y.getElementByKey(this.tableNodeKey),!M)throw Error("Expected to find TableElement in DOM");M=P(M),H(y,M,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let y=this.editor;y.update(()=>{let M=y.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");e.removeClassNamesFromElement(M,y._config.theme.tableSelection),M.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let y=this.editor;y.update(()=>{let M=y.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");e.addClassNamesToElement(M,y._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(y){if(y!=null&&y.gridKey===this.tableNodeKey){let M=this.editor;this.gridSelection=y,this.isHighlightingCells=!0,this.disableHighlightStyle(),H(M,this.grid,this.gridSelection)}else y==null?this.clearHighlight():(this.tableNodeKey=y.gridKey,this.updateTableGridSelection(y))}setFocusCellForSelection(y,M=!1){let Z=this.editor;Z.update(()=>{var ae=t.$getNodeByKey(this.tableNodeKey);if(!D(ae))throw Error("Expected TableNode.");if(!Z.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ae=y.x;let he=y.y;if(this.focusCell=y,this.anchorCell!==null){let se=R?(Z._window||window).getSelection():null;se&&se.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ae||this.anchorY!==he||M))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ae===this.focusX&&he===this.focusY)return;this.focusX=ae,this.focusY=he,this.isHighlightingCells&&(ae=t.$getNearestNodeFromDOMNode(y.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&p(ae)&&(ae=ae.getKey(),this.gridSelection=this.gridSelection.clone()||t.DEPRECATED_$createGridSelection(),this.focusCellNodeKey=ae,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),t.$setSelection(this.gridSelection),Z.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0),H(Z,this.grid,this.gridSelection)))})}setAnchorCellForSelection(y){this.isHighlightingCells=!1,this.anchorCell=y,this.anchorX=y.x,this.anchorY=y.y,this.editor.update(()=>{var M=t.$getNearestNodeFromDOMNode(y.elem);p(M)&&(M=M.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():t.DEPRECATED_$createGridSelection(),this.anchorCellNodeKey=M)})}formatCells(y){this.editor.update(()=>{let M=t.$getSelection();t.DEPRECATED_$isGridSelection(M)||b(11);let Z=t.$createRangeSelection(),ae=Z.anchor,he=Z.focus;M.getNodes().forEach(se=>{p(se)&&se.getTextContentSize()!==0&&(ae.set(se.getKey(),0,"element"),he.set(se.getKey(),se.getChildrenSize(),"element"),Z.formatText(y))}),t.$setSelection(M),this.editor.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let y=this.editor;y.update(()=>{let M=t.$getNodeByKey(this.tableNodeKey);if(!D(M))throw Error("Expected TableNode.");var Z=t.$getSelection();t.DEPRECATED_$isGridSelection(Z)||b(11),Z=Z.getNodes().filter(p),Z.length===this.grid.columns*this.grid.rows?(M.selectPrevious(),M.remove(),t.$getRoot().selectStart()):(Z.forEach(ae=>{if(t.$isElementNode(ae)){let he=t.$createParagraphNode(),se=t.$createTextNode();he.append(se),ae.append(he),ae.getChildren().forEach(Te=>{Te!==he&&Te.remove()})}}),H(y,this.grid,null),t.$setSelection(null),y.dispatchCommand(t.SELECTION_CHANGE_COMMAND,void 0))})}}function w(m){for(;m!=null;){let y=m.nodeName;if(y==="TD"||y==="TH"){if(m=m._cell,m===void 0)break;return m}m=m.parentNode}return null}function P(m){let y=[],M={cells:y,columns:0,rows:0};var Z=m.firstChild;let ae=m=0;for(y.length=0;Z!=null;){var he=Z.nodeName;if(he==="TD"||he==="TH"){he=Z,he={elem:he,hasBackgroundColor:he.style.backgroundColor!=="",highlighted:!1,x:m,y:ae},Z._cell=he;let se=y[ae];se===void 0&&(se=y[ae]=[]),se[m]=he}else if(he=Z.firstChild,he!=null){Z=he;continue}if(he=Z.nextSibling,he!=null)m++,Z=he;else if(he=Z.parentNode,he!=null){if(Z=he.nextSibling,Z==null)break;ae++,m=0}}return M.columns=m+1,M.rows=ae+1,M}function H(m,y,M){let Z=new Set(M?M.getNodes():[]);$(y,(ae,he)=>{let se=ae.elem;Z.has(he)?(ae.highlighted=!0,le(m,ae)):(ae.highlighted=!1,j(m,ae),se.getAttribute("style")||se.removeAttribute("style"))})}function $(m,y){({cells:m}=m);for(let M=0;M<m.length;M++){let Z=m[M];if(Z)for(let ae=0;ae<Z.length;ae++){let he=Z[ae];if(!he)continue;let se=t.$getNearestNodeFromDOMNode(he.elem);se!==null&&y(he,se,{x:ae,y:M})}}}function W(m,y){y.disableHighlightStyle(),$(y.grid,M=>{M.highlighted=!0,le(m,M)})}function B(m,y){y.enableHighlightStyle(),$(y.grid,M=>{let Z=M.elem;M.highlighted=!1,j(m,M),Z.getAttribute("style")||Z.removeAttribute("style")})}let z=(m,y,M,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return M!==(he?m.grid.columns-1:0)?(m=y.getCellNodeFromCordsOrThrow(M+(he?1:-1),Z,m.grid),he?m.selectStart():m.selectEnd()):Z!==(he?m.grid.rows-1:0)?(m=y.getCellNodeFromCordsOrThrow(he?0:m.grid.columns-1,Z+(he?1:-1),m.grid),he?m.selectStart():m.selectEnd()):he?y.selectNext():y.selectPrevious(),!0;case"up":return Z!==0?y.getCellNodeFromCordsOrThrow(M,Z-1,m.grid).selectEnd():y.selectPrevious(),!0;case"down":return Z!==m.grid.rows-1?y.getCellNodeFromCordsOrThrow(M,Z+1,m.grid).selectStart():y.selectNext(),!0;default:return!1}},X=(m,y,M,Z,ae)=>{const he=ae==="forward";switch(ae){case"backward":case"forward":return M!==(he?m.grid.columns-1:0)&&m.setFocusCellForSelection(y.getCellFromCordsOrThrow(M+(he?1:-1),Z,m.grid)),!0;case"up":return Z!==0?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(M,Z-1,m.grid)),!0):!1;case"down":return Z!==m.grid.rows-1?(m.setFocusCellForSelection(y.getCellFromCordsOrThrow(M,Z+1,m.grid)),!0):!1;default:return!1}};function ee(m,y){if(t.$isRangeSelection(m)||t.DEPRECATED_$isGridSelection(m)){let M=y.isParentOf(m.anchor.getNode());return m=y.isParentOf(m.focus.getNode()),M&&m}return!1}function le(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||b(131),y.getBackgroundColor()===null?m.style.setProperty("background-color","rgb(172,206,247)"):m.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),m.style.setProperty("caret-color","transparent")}function j(m,y){m=y.elem,y=t.$getNearestNodeFromDOMNode(m),p(y)||b(131),y.getBackgroundColor()===null&&m.style.removeProperty("background-color"),m.style.removeProperty("background-image"),m.style.removeProperty("caret-color")}function U(m){return m=e.$findMatchingParent(m,p),p(m)?m:null}function q(m){return m=e.$findMatchingParent(m,D),D(m)?m:null}function me(m,y,M,Z,ae){let he=t.$getSelection();if(!ee(he,Z))return!1;if(t.$isRangeSelection(he)&&he.isCollapsed()){if(M==="backward"||M==="forward")return!1;let{anchor:Ue,focus:re}=he;var se=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p);if(!p(se)||!se.is(Te))return!1;if(Te=q(se),Te!==Z&&Te!=null){var be=m.getElementByKey(Te.getKey());if(be!=null)return ae.grid=P(be),me(m,y,M,Te,ae)}if(Te=m.getElementByKey(se.__key),be=m.getElementByKey(Ue.key),be==null||Te==null)return!1;if(Ue.type==="element")Te=be.getBoundingClientRect();else{if(Te=window.getSelection(),Te===null||Te.rangeCount===0)return!1;Te=Te.getRangeAt(0).getBoundingClientRect()}if(be=M==="up"?se.getFirstChild():se.getLastChild(),be==null||(m=m.getElementByKey(be.__key),m==null))return!1;if(m=m.getBoundingClientRect(),M==="up"?m.top>Te.top-Te.height:Te.bottom+Te.height>m.bottom){if(_e(y),m=Z.getCordsFromCellNode(se,ae.grid),y.shiftKey)M=Z.getCellFromCordsOrThrow(m.x,m.y,ae.grid),ae.setAnchorCellForSelection(M),ae.setFocusCellForSelection(M,!0);else return z(ae,Z,m.x,m.y,M);return!0}}else if(t.DEPRECATED_$isGridSelection(he)){let{anchor:Ue,focus:re}=he;return be=e.$findMatchingParent(Ue.getNode(),p),Te=e.$findMatchingParent(re.getNode(),p),[se]=he.getNodes(),m=m.getElementByKey(se.getKey()),!p(be)||!p(Te)||!D(se)||m==null?!1:(ae.updateTableGridSelection(he),m=P(m),be=Z.getCordsFromCellNode(be,m),be=Z.getCellFromCordsOrThrow(be.x,be.y,m),ae.setAnchorCellForSelection(be),_e(y),y.shiftKey?(y=Z.getCordsFromCellNode(Te,m),X(ae,se,y.x,y.y,M)):(Te.selectEnd(),!0))}return!1}function _e(m){m.preventDefault(),m.stopImmediatePropagation(),m.stopPropagation()}class pe extends t.DEPRECATED_GridNode{static getType(){return"table"}static clone(y){return new pe(y.__key)}static importDOM(){return{table:()=>({conversion:ue,priority:1})}}static importJSON(){return K()}constructor(y){super(y)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(y){let M=document.createElement("table");return e.addClassNamesToElement(M,y.theme.table),M}updateDOM(){return!1}exportDOM(y){return{...super.exportDOM(y),after:M=>{if(M){let Z=M.cloneNode(),ae=document.createElement("colgroup"),he=document.createElement("tbody");if(e.isHTMLElement(M)&&he.append(...M.children),M=this.getFirstChildOrThrow(),!O(M))throw Error("Expected to find row node.");M=M.getChildrenSize();for(let se=0;se<M;se++){let Te=document.createElement("col");ae.append(Te)}return Z.replaceChildren(ae,he),Z}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(y,M){let{rows:Z,cells:ae}=M;for(M=0;M<Z;M++){var he=ae[M];if(he!=null&&(he=he.findIndex(se=>{if(se)return{elem:se}=se,t.$getNearestNodeFromDOMNode(se)===y}),he!==-1))return{x:he,y:M}}throw Error("Cell not found in table.")}getCellFromCords(y,M,Z){return{cells:Z}=Z,M=Z[M],M==null?null:(y=M[y],y??null)}getCellFromCordsOrThrow(y,M,Z){if(y=this.getCellFromCords(y,M,Z),!y)throw Error("Cell not found at cords.");return y}getCellNodeFromCords(y,M,Z){return y=this.getCellFromCords(y,M,Z),y==null?null:(y=t.$getNearestNodeFromDOMNode(y.elem),p(y)?y:null)}getCellNodeFromCordsOrThrow(y,M,Z){if(y=this.getCellNodeFromCords(y,M,Z),!y)throw Error("Node at cords not TableCellNode.");return y}canSelectBefore(){return!0}canIndent(){return!1}}function ue(){return{node:K()}}function K(){return t.$applyNodeReplacement(new pe)}function D(m){return m instanceof pe}function V(m){if(m=e.$findMatchingParent(m,y=>O(y)),O(m))return m;throw Error("Expected table cell to be inside of table row.")}function ne(m){if(m=e.$findMatchingParent(m,y=>D(y)),D(m))return m;throw Error("Expected table cell to be inside of table.")}function Y(m,y){let M=ne(m),{x:Z,y:ae}=M.getCordsFromCellNode(m,y);return{above:M.getCellNodeFromCords(Z,ae-1,y),below:M.getCellNodeFromCords(Z,ae+1,y),left:M.getCellNodeFromCords(Z-1,ae,y),right:M.getCellNodeFromCords(Z+1,ae,y)}}function G(m){let y=m.getFirstDescendant();y==null?m.selectStart():y.getParentOrThrow().selectStart()}function Q(m,y){let M=m.getFirstChild();M!==null?M.insertBefore(y):m.append(y)}let k=t.createCommand("INSERT_TABLE_COMMAND");return Yt.$createTableCellNode=g,Yt.$createTableNode=K,Yt.$createTableNodeWithDimensions=function(m,y,M=!0){let Z=K();for(let he=0;he<m;he++){let se=T();for(let Te=0;Te<y;Te++){var ae=r.NO_STATUS;typeof M=="object"?(he===0&&M.rows&&(ae|=r.ROW),Te===0&&M.columns&&(ae|=r.COLUMN)):M&&(he===0&&(ae|=r.ROW),Te===0&&(ae|=r.COLUMN)),ae=g(ae);let be=t.$createParagraphNode();be.append(t.$createTextNode()),ae.append(be),se.append(ae)}Z.append(se)}return Z},Yt.$createTableRowNode=T,Yt.$deleteTableColumn=function(m,y){let M=m.getChildren();for(let ae=0;ae<M.length;ae++){var Z=M[ae];if(O(Z)){if(Z=Z.getChildren(),y>=Z.length||0>y)throw Error("Table column target index out of range");Z[y].remove()}}return m},Yt.$deleteTableColumn__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[M,,Z]=t.DEPRECATED_$getNodeTriplet(y);[y]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,M,y);var{startColumn:Te}=he;let{startRow:be,startColumn:Ue}=se;m=Math.min(Te,Ue),Te=Math.max(Te+M.__colSpan-1,Ue+y.__colSpan-1);let re=Te-m+1;if(ae[0].length===Te-m+1)Z.selectPrevious(),Z.remove();else{var te=ae.length;for(let ce=0;ce<te;ce++)for(let we=m;we<=Te;we++){let{cell:Le,startColumn:Be}=ae[ce][we];Be<m?we===m&&Le.setColSpan(Le.__colSpan-Math.min(re,Le.__colSpan-(m-Be))):Be+Le.__colSpan-1>Te?we===Te&&Le.setColSpan(Le.__colSpan-(Te-Be+1)):Le.remove()}m=ae[be],y=m[Ue+y.__colSpan],y!==void 0?({cell:y}=y,G(y)):({cell:y}=m[Ue-1],G(y))}},Yt.$deleteTableRow__EXPERIMENTAL=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");var y=m.anchor.getNode();m=m.focus.getNode();let[M,,Z]=t.DEPRECATED_$getNodeTriplet(y);[m]=t.DEPRECATED_$getNodeTriplet(m);let[ae,he,se]=t.DEPRECATED_$computeGridMap(Z,M,m);({startRow:y}=he);var{startRow:Te}=se;if(m=Te+m.__rowSpan-1,ae.length===m-y+1)Z.remove();else{Te=ae[0].length;var be=ae[m+1],Ue=Z.getChildAtIndex(m+1);for(let te=m;te>=y;te--){for(var re=Te-1;0<=re;re--){let{cell:ce,startRow:we,startColumn:Le}=ae[te][re];if(Le===re&&(te===y&&we<y&&ce.setRowSpan(ce.__rowSpan-(we-y)),we>=y&&we+ce.__rowSpan-1>m))if(ce.setRowSpan(ce.__rowSpan-(m-we+1)),Ue===null&&b(122),re===0)Q(Ue,ce);else{let{cell:Be}=be[re-1];Be.insertAfter(ce)}}re=Z.getChildAtIndex(te),t.DEPRECATED_$isGridRowNode(re)||b(123,String(te)),re.remove()}be!==void 0?({cell:y}=be[0],G(y)):({cell:y}=ae[y-1][0],G(y))}},Yt.$getElementGridForTableNode=function(m,y){if(m=m.getElementByKey(y.getKey()),m==null)throw Error("Table Element Not Found");return P(m)},Yt.$getTableCellNodeFromLexicalNode=function(m){return m=e.$findMatchingParent(m,y=>p(y)),p(m)?m:null},Yt.$getTableColumnIndexFromTableCellNode=function(m){return V(m).getChildren().findIndex(y=>y.is(m))},Yt.$getTableNodeFromLexicalNodeOrThrow=ne,Yt.$getTableRowIndexFromTableCellNode=function(m){let y=V(m);return ne(y).getChildren().findIndex(M=>M.is(y))},Yt.$getTableRowNodeFromTableCellNodeOrThrow=V,Yt.$insertTableColumn=function(m,y,M=!0,Z,ae){let he=m.getChildren(),se=[];for(let Ue=0;Ue<he.length;Ue++){let re=he[Ue];if(O(re))for(let te=0;te<Z;te++){var Te=re.getChildren();if(y>=Te.length||0>y)throw Error("Table column target index out of range");Te=Te[y],p(Te)||b(12);let{left:ce,right:we}=Y(Te,ae);var be=r.NO_STATUS;(ce&&ce.hasHeaderState(r.ROW)||we&&we.hasHeaderState(r.ROW))&&(be|=r.ROW),be=g(be),be.append(t.$createParagraphNode()),se.push({newTableCell:be,targetCell:Te})}}return se.forEach(({newTableCell:Ue,targetCell:re})=>{M?re.insertAfter(Ue):re.insertBefore(Ue)}),m},Yt.$insertTableColumn__EXPERIMENTAL=function(m=!0){function y(){let te=g(r.NO_STATUS).append(t.$createParagraphNode());return Ue===null&&(Ue=te),te}var M=t.$getSelection();if(!t.$INTERNAL_isPointSelection(M))throw Error("Expected a PointSeleciton");var Z=M.anchor.getNode();M=M.focus.getNode(),[Z]=t.DEPRECATED_$getNodeTriplet(Z);let[ae,,he]=t.DEPRECATED_$getNodeTriplet(M),[se,Te,be]=t.DEPRECATED_$computeGridMap(he,ae,Z);Z=se.length,M=m?Math.max(Te.startColumn,be.startColumn):Math.min(Te.startColumn,be.startColumn),m=m?M+ae.__colSpan-1:M-1,M=he.getFirstChild(),t.DEPRECATED_$isGridRowNode(M)||b(120);let Ue=null;var re=M;e:for(M=0;M<Z;M++){M!==0&&(re=re.getNextSibling(),t.DEPRECATED_$isGridRowNode(re)||b(121));let te=se[M];if(0>m){Q(re,y());continue}let{cell:ce,startColumn:we,startRow:Le}=te[m];if(we+ce.__colSpan-1<=m){let Be=ce,Ye=Le,ct=m;for(;Ye!==M&&1<Be.__rowSpan;)if(ct-=ce.__colSpan,0<=ct){let{cell:yt,startRow:dt}=te[ct];Be=yt,Ye=dt}else{re.append(y());continue e}Be.insertAfter(y())}else ce.setColSpan(ce.__colSpan+1)}Ue!==null&&G(Ue)},Yt.$insertTableRow=function(m,y,M=!0,Z,ae){var he=m.getChildren();if(y>=he.length||0>y)throw Error("Table row target index out of range");if(y=he[y],O(y))for(he=0;he<Z;he++){let Te=y.getChildren(),be=Te.length,Ue=T();for(let re=0;re<be;re++){var se=Te[re];p(se)||b(12);let{above:te,below:ce}=Y(se,ae);se=r.NO_STATUS;let we=te&&te.getWidth()||ce&&ce.getWidth()||void 0;(te&&te.hasHeaderState(r.COLUMN)||ce&&ce.hasHeaderState(r.COLUMN))&&(se|=r.COLUMN),se=g(se,1,we),se.append(t.$createParagraphNode()),Ue.append(se)}M?y.insertAfter(Ue):y.insertBefore(Ue)}else throw Error("Row before insertion index does not exist.");return m},Yt.$insertTableRow__EXPERIMENTAL=function(m=!0){var y=t.$getSelection();if(!t.$INTERNAL_isPointSelection(y))throw Error("Expected a INTERNAL_PointSelection");y=y.focus.getNode();let[M,,Z]=t.DEPRECATED_$getNodeTriplet(y),[ae,he]=t.DEPRECATED_$computeGridMap(Z,M,M);y=ae[0].length;var{startRow:se}=he;if(m){m=se+M.__rowSpan-1;var Te=ae[m];se=T();for(var be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re+Ue.__rowSpan-1<=m?se.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(m),t.DEPRECATED_$isGridRowNode(y)||b(119),y.insertAfter(se)}else{for(Te=ae[se],m=T(),be=0;be<y;be++){let{cell:Ue,startRow:re}=Te[be];re===se?m.append(g(r.NO_STATUS)):Ue.setRowSpan(Ue.__rowSpan+1)}y=Z.getChildAtIndex(se),t.DEPRECATED_$isGridRowNode(y)||b(119),y.insertBefore(m)}},Yt.$isTableCellNode=p,Yt.$isTableNode=D,Yt.$isTableRowNode=O,Yt.$removeTableRowAtIndex=function(m,y){let M=m.getChildren();if(y>=M.length||0>y)throw Error("Expected table cell to be inside of table row.");return M[y].remove(),m},Yt.$unmergeCell=function(){var m=t.$getSelection();if(!t.$INTERNAL_isPointSelection(m))throw Error("Expected a INTERNAL_PointSelection");m=m.anchor.getNode();let[y,M,Z]=t.DEPRECATED_$getNodeTriplet(m);m=y.__colSpan;let ae=y.__rowSpan;if(1<m){for(var he=1;he<m;he++)y.insertAfter(g(r.NO_STATUS));y.setColSpan(1)}if(1<ae){let[be,Ue]=t.DEPRECATED_$computeGridMap(Z,y,y),{startColumn:re,startRow:te}=Ue,ce;for(he=1;he<ae;he++){var se=te+he;let we=be[se];ce=(ce||M).getNextSibling(),t.DEPRECATED_$isGridRowNode(ce)||b(125);var Te=null;for(let Le=0;Le<re;Le++){let Be=we[Le],Ye=Be.cell;Be.startRow===se&&(Te=Ye),1<Ye.__colSpan&&(Le+=Ye.__colSpan-1)}if(Te===null)for(Te=0;Te<m;Te++)Q(ce,g(r.NO_STATUS));else for(se=0;se<m;se++)Te.insertAfter(g(r.NO_STATUS))}y.setRowSpan(1)}},Yt.INSERT_TABLE_COMMAND=k,Yt.TableCellHeaderStates=r,Yt.TableCellNode=c,Yt.TableNode=pe,Yt.TableRowNode=N,Yt.TableSelection=x,Yt.applyTableHandlers=function(m,y,M,Z){function ae(re){return re=m.getCordsFromCellNode(re,se.grid),m.getCellFromCordsOrThrow(re.x,re.y,se.grid)}let he=M.getRootElement();if(he===null)throw Error("No root element.");let se=new x(M,m.getKey()),Te=M._window||window;y.__lexicalTableSelection=se,y.addEventListener("mousedown",re=>{setTimeout(()=>{if(re.button===0&&Te){var te=w(re.target);te!==null&&(_e(re),se.setAnchorCellForSelection(te));var ce=()=>{Te.removeEventListener("mouseup",ce),Te.removeEventListener("mousemove",we)},we=Le=>{const Be=w(Le.target);Be===null||se.anchorX===Be.x&&se.anchorY===Be.y||(Le.preventDefault(),se.setFocusCellForSelection(Be))};Te.addEventListener("mouseup",ce),Te.addEventListener("mousemove",we)}},0)});let be=re=>{re.button===0&&M.update(()=>{const te=t.$getSelection(),ce=re.target;t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&he.contains(ce)&&se.clearHighlight()})};Te.addEventListener("mousedown",be),se.listenersToRemove.add(()=>Te.removeEventListener("mousedown",be)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_DOWN_COMMAND,re=>me(M,re,"down",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_UP_COMMAND,re=>me(M,re,"up",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_LEFT_COMMAND,re=>me(M,re,"backward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ARROW_RIGHT_COMMAND,re=>me(M,re,"forward",m,se),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.KEY_ESCAPE_COMMAND,re=>{var te=t.$getSelection();return t.DEPRECATED_$isGridSelection(te)&&(te=e.$findMatchingParent(te.focus.getNode(),p),p(te))?(_e(re),te.selectEnd(),!0):!1},t.COMMAND_PRIORITY_HIGH));let Ue=re=>()=>{var te=t.$getSelection();if(!ee(te,m))return!1;if(t.DEPRECATED_$isGridSelection(te))return se.clearText(),!0;if(t.$isRangeSelection(te)){const Le=e.$findMatchingParent(te.anchor.getNode(),Be=>p(Be));if(!p(Le))return!1;var ce=te.anchor.getNode(),we=te.focus.getNode();if(ce=m.isParentOf(ce),we=m.isParentOf(we),ce&&!we||we&&!ce)return se.clearText(),!0;if(ce=(we=e.$findMatchingParent(te.anchor.getNode(),Be=>t.$isElementNode(Be)))&&e.$findMatchingParent(we,Be=>t.$isElementNode(Be)&&p(Be.getParent())),!t.$isElementNode(ce)||!t.$isElementNode(we))return!1;if(re===t.DELETE_LINE_COMMAND&&ce.getPreviousSibling()===null)return!0;if((re===t.DELETE_CHARACTER_COMMAND||re===t.DELETE_WORD_COMMAND)&&te.isCollapsed()&&te.anchor.offset===0&&we!==ce){te=we.getChildren();const Be=t.$createParagraphNode();return te.forEach(Ye=>Be.append(Ye)),we.replace(Be),we.getWritable().__parent=Le.getKey(),!0}}return!1};return[t.DELETE_WORD_COMMAND,t.DELETE_LINE_COMMAND,t.DELETE_CHARACTER_COMMAND].forEach(re=>{se.listenersToRemove.add(M.registerCommand(re,Ue(re),t.COMMAND_PRIORITY_CRITICAL))}),y=re=>{const te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(re.preventDefault(),re.stopPropagation(),se.clearText(),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},se.listenersToRemove.add(M.registerCommand(t.KEY_BACKSPACE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.KEY_DELETE_COMMAND,y,t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.FORMAT_TEXT_COMMAND,re=>{let te=t.$getSelection();return ee(te,m)?t.DEPRECATED_$isGridSelection(te)?(se.formatCells(re),!0):(t.$isRangeSelection(te)&&(re=e.$findMatchingParent(te.anchor.getNode(),ce=>p(ce)),p(re)),!1):!1},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var re=t.$getSelection();return ee(re,m)&&(t.DEPRECATED_$isGridSelection(re)?se.clearHighlight():t.$isRangeSelection(re)&&(re=e.$findMatchingParent(re.anchor.getNode(),te=>p(te)),p(re))),!1},t.COMMAND_PRIORITY_CRITICAL)),Z&&se.listenersToRemove.add(M.registerCommand(t.KEY_TAB_COMMAND,re=>{var te=t.$getSelection();return!t.$isRangeSelection(te)||!te.isCollapsed()||!ee(te,m)||(te=U(te.anchor.getNode()),te===null)?!1:(_e(re),te=m.getCordsFromCellNode(te,se.grid),z(se,m,te.x,te.y,re.shiftKey?"backward":"forward"),!0)},t.COMMAND_PRIORITY_CRITICAL)),se.listenersToRemove.add(M.registerCommand(t.FOCUS_COMMAND,()=>m.isSelected(),t.COMMAND_PRIORITY_HIGH)),se.listenersToRemove.add(M.registerCommand(t.SELECTION_CHANGE_COMMAND,()=>{let re=t.$getSelection(),te=t.$getPreviousSelection();if(t.$isRangeSelection(re)){let{anchor:Ye,focus:ct}=re;var ce=Ye.getNode(),we=ct.getNode();ce=U(ce),we=U(we);var Le=ce&&m.is(q(ce)),Be=we&&m.is(q(we));let yt=Le!==Be;Be=Le&&Be,Le=re.isBackward(),yt?(ce=re.clone(),ce.focus.set(m.getKey(),Le?0:m.getChildrenSize(),"element"),t.$setSelection(ce),W(M,se)):Be&&!ce.is(we)&&(se.setAnchorCellForSelection(ae(ce)),se.setFocusCellForSelection(ae(we),!0))}return re&&!re.is(te)&&(t.DEPRECATED_$isGridSelection(re)||t.DEPRECATED_$isGridSelection(te))&&se.gridSelection&&!se.gridSelection.is(te)?(t.DEPRECATED_$isGridSelection(re)&&re.gridKey===se.tableNodeKey?se.updateTableGridSelection(re):!t.DEPRECATED_$isGridSelection(re)&&t.DEPRECATED_$isGridSelection(te)&&te.gridKey===se.tableNodeKey&&se.updateTableGridSelection(null),!1):(se.hasHijackedSelectionStyles&&!m.isSelected()?B(M,se):!se.hasHijackedSelectionStyles&&m.isSelected()&&W(M,se),!1)},t.COMMAND_PRIORITY_CRITICAL)),se},Yt.getCellFromTarget=w,Yt.getTableSelectionFromTableElement=function(m){return m.__lexicalTableSelection},Yt}var vu,vh;function Nd(){return vh||(vh=1,vu=process.env.NODE_ENV==="development"?MC():RC()),vu}var Sh;function bC(){if(Sh)return xu;Sh=1;var t=Un(),e=Nd(),n=on(),r=Bt(),c=et;function d({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:N=!0}){const[v]=t.useLexicalComposerContext();return c.useEffect(()=>{if(!v.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return v.registerCommand(e.INSERT_TABLE_COMMAND,({columns:T,rows:O,includeHeaders:b})=>{const R=e.$createTableNodeWithDimensions(Number(O),Number(T),b);n.$insertNodeToNearestRoot(R);const x=R.getFirstDescendant();return r.$isTextNode(x)&&x.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[v]),c.useEffect(()=>{const T=new Map,O=R=>{const x=R.getKey(),w=v.getElementByKey(x);if(w&&!T.has(x)){const P=e.applyTableHandlers(R,w,v,N);T.set(x,P)}};v.getEditorState().read(()=>{const R=r.$nodesOfType(e.TableNode);for(const x of R)e.$isTableNode(x)&&O(x)});const b=v.registerMutationListener(e.TableNode,R=>{for(const[x,w]of R)if(w==="created")v.getEditorState().read(()=>{const P=r.$getNodeByKey(x);e.$isTableNode(P)&&O(P)});else if(w==="destroyed"){const P=T.get(x);P!==void 0&&(P.removeListeners(),T.delete(x))}});return()=>{b();for(const[,R]of T)R.removeListeners()}},[v,N]),c.useEffect(()=>{if(!g)return v.registerNodeTransform(e.TableCellNode,T=>{if(T.getColSpan()>1||T.getRowSpan()>1){const[,,O]=r.DEPRECATED_$getNodeTriplet(T),[b]=r.DEPRECATED_$computeGridMap(O,T,T),R=b.length,x=b[0].length;let w=O.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(w))throw Error("Expected TableNode first child to be a RowNode");const P=[];for(let H=0;H<R;H++){if(H!==0&&(w=w.getNextSibling(),!r.DEPRECATED_$isGridRowNode(w)))throw Error("Expected TableNode first child to be a RowNode");let $=null;for(let W=0;W<x;W++){const B=b[H][W],z=B.cell;if(B.startRow===H&&B.startColumn===W)$=z,P.push(z);else if(z.getColSpan()>1||z.getRowSpan()>1){const X=e.$createTableCellNode(z.__headerState);$!==null?$.insertAfter(X):n.$insertFirst(w,X)}}}for(const H of P)H.setColSpan(1),H.setRowSpan(1)}})},[v,g]),c.useEffect(()=>{if(!p)return v.registerNodeTransform(e.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[v,p,g]),null}return xu.TablePlugin=d,xu}var Su={},wh;function LC(){if(wh)return Su;wh=1;var t=Un(),e=Nd(),n=on(),r=Bt(),c=et;function d(g){let p=new URLSearchParams;p.append("code",g);for(let N=1;N<arguments.length;N++)p.append("v",arguments[N]);throw Error(`Minified Lexical error #${g}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Su.TablePlugin=function({hasCellMerge:g=!0,hasCellBackgroundColor:p=!0,hasTabHandler:N=!0}){let[v]=t.useLexicalComposerContext();return c.useEffect(()=>(v.hasNodes([e.TableNode,e.TableCellNode,e.TableRowNode])||d(10),v.registerCommand(e.INSERT_TABLE_COMMAND,({columns:T,rows:O,includeHeaders:b})=>(T=e.$createTableNodeWithDimensions(Number(O),Number(T),b),n.$insertNodeToNearestRoot(T),T=T.getFirstDescendant(),r.$isTextNode(T)&&T.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[v]),c.useEffect(()=>{let T=new Map,O=R=>{const x=R.getKey(),w=v.getElementByKey(x);w&&!T.has(x)&&(R=e.applyTableHandlers(R,w,v,N),T.set(x,R))};v.getEditorState().read(()=>{let R=r.$nodesOfType(e.TableNode);for(let x of R)e.$isTableNode(x)&&O(x)});let b=v.registerMutationListener(e.TableNode,R=>{for(const[x,w]of R)w==="created"?v.getEditorState().read(()=>{const P=r.$getNodeByKey(x);e.$isTableNode(P)&&O(P)}):w==="destroyed"&&(R=T.get(x),R!==void 0&&(R.removeListeners(),T.delete(x)))});return()=>{b();for(let[,R]of T)R.removeListeners()}},[v,N]),c.useEffect(()=>{if(!g)return v.registerNodeTransform(e.TableCellNode,T=>{if(1<T.getColSpan()||1<T.getRowSpan()){var[,,O]=r.DEPRECATED_$getNodeTriplet(T);[T]=r.DEPRECATED_$computeGridMap(O,T,T);let R=T.length,x=T[0].length;if(O=O.getFirstChild(),!r.DEPRECATED_$isGridRowNode(O))throw Error("Expected TableNode first child to be a RowNode");let w=[];for(let P=0;P<R;P++){if(P!==0&&(O=O.getNextSibling(),!r.DEPRECATED_$isGridRowNode(O)))throw Error("Expected TableNode first child to be a RowNode");let H=null;for(let $=0;$<x;$++){var b=T[P][$];let W=b.cell;b.startRow===P&&b.startColumn===$?(H=W,w.push(W)):(1<W.getColSpan()||1<W.getRowSpan())&&(b=e.$createTableCellNode(W.__headerState),H!==null?H.insertAfter(b):n.$insertFirst(O,b))}}for(let P of w)P.setColSpan(1),P.setRowSpan(1)}})},[v,g]),c.useEffect(()=>{if(!p)return v.registerNodeTransform(e.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[v,p,g]),null},Su}const kC=process.env.NODE_ENV==="development"?bC():LC();var IC=kC,An={},wu={exports:{}},Oh;function Op(){return Oh||(Oh=1,function(t){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
76
76
  * Prism: Lightweight, robust, elegant syntax highlighting
77
77
  *
78
78
  * @license MIT <https://opensource.org/licenses/MIT>
79
79
  * @author Lea Verou <https://lea.verou.me>
80
80
  * @namespace
81
81
  * @public
82
- */var n=function(r){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,g={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function P(H){return H instanceof C?new C(H.type,P(H.content),H.alias):Array.isArray(H)?H.map(P):H.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(P){return Object.prototype.toString.call(P).slice(8,-1)},objId:function(P){return P.__id||Object.defineProperty(P,"__id",{value:++d}),P.__id},clone:function P(H,B){B=B||{};var z,X;switch(p.util.type(H)){case"Object":if(X=p.util.objId(H),B[X])return B[X];z={},B[X]=z;for(var ee in H)H.hasOwnProperty(ee)&&(z[ee]=P(H[ee],B));return z;case"Array":return X=p.util.objId(H),B[X]?B[X]:(z=[],B[X]=z,H.forEach(function(le,j){z[j]=P(le,B)}),z);default:return H}},getLanguage:function(P){for(;P;){var H=c.exec(P.className);if(H)return H[1].toLowerCase();P=P.parentElement}return"none"},setLanguage:function(P,H){P.className=P.className.replace(RegExp(c,"gi"),""),P.classList.add("language-"+H)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(z){var P=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(z.stack)||[])[1];if(P){var H=document.getElementsByTagName("script");for(var B in H)if(H[B].src==P)return H[B]}return null}},isActive:function(P,H,B){for(var z="no-"+H;P;){var X=P.classList;if(X.contains(H))return!0;if(X.contains(z))return!1;P=P.parentElement}return!!B}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function(P,H){var B=p.util.clone(p.languages[P]);for(var z in H)B[z]=H[z];return B},insertBefore:function(P,H,B,z){z=z||p.languages;var X=z[P],ee={};for(var le in X)if(X.hasOwnProperty(le)){if(le==H)for(var j in B)B.hasOwnProperty(j)&&(ee[j]=B[j]);B.hasOwnProperty(le)||(ee[le]=X[le])}var U=z[P];return z[P]=ee,p.languages.DFS(p.languages,function(q,me){me===U&&q!=P&&(this[q]=ee)}),ee},DFS:function P(H,B,z,X){X=X||{};var ee=p.util.objId;for(var le in H)if(H.hasOwnProperty(le)){B.call(H,le,H[le],z||le);var j=H[le],U=p.util.type(j);U==="Object"&&!X[ee(j)]?(X[ee(j)]=!0,P(j,B,null,X)):U==="Array"&&!X[ee(j)]&&(X[ee(j)]=!0,P(j,B,le,X))}}},plugins:{},highlightAll:function(P,H){p.highlightAllUnder(document,P,H)},highlightAllUnder:function(P,H,B){var z={callback:B,container:P,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",z),z.elements=Array.prototype.slice.apply(z.container.querySelectorAll(z.selector)),p.hooks.run("before-all-elements-highlight",z);for(var X=0,ee;ee=z.elements[X++];)p.highlightElement(ee,H===!0,z.callback)},highlightElement:function(P,H,B){var z=p.util.getLanguage(P),X=p.languages[z];p.util.setLanguage(P,z);var ee=P.parentElement;ee&&ee.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(ee,z);var le=P.textContent,j={element:P,language:z,grammar:X,code:le};function U(me){j.highlightedCode=me,p.hooks.run("before-insert",j),j.element.innerHTML=j.highlightedCode,p.hooks.run("after-highlight",j),p.hooks.run("complete",j),B&&B.call(j.element)}if(p.hooks.run("before-sanity-check",j),ee=j.element.parentElement,ee&&ee.nodeName.toLowerCase()==="pre"&&!ee.hasAttribute("tabindex")&&ee.setAttribute("tabindex","0"),!j.code){p.hooks.run("complete",j),B&&B.call(j.element);return}if(p.hooks.run("before-highlight",j),!j.grammar){U(p.util.encode(j.code));return}if(H&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(me){U(me.data)},q.postMessage(JSON.stringify({language:j.language,code:j.code,immediateClose:!0}))}else U(p.highlight(j.code,j.grammar,j.language))},highlight:function(P,H,B){var z={code:P,grammar:H,language:B};if(p.hooks.run("before-tokenize",z),!z.grammar)throw new Error('The language "'+z.language+'" has no grammar.');return z.tokens=p.tokenize(z.code,z.grammar),p.hooks.run("after-tokenize",z),C.stringify(p.util.encode(z.tokens),z.language)},tokenize:function(P,H){var B=H.rest;if(B){for(var z in B)H[z]=B[z];delete H.rest}var X=new O;return R(X,X.head,P),T(P,X,H,X.head,0),x(X)},hooks:{all:{},add:function(P,H){var B=p.hooks.all;B[P]=B[P]||[],B[P].push(H)},run:function(P,H){var B=p.hooks.all[P];if(!(!B||!B.length))for(var z=0,X;X=B[z++];)X(H)}},Token:C};r.Prism=p;function C(P,H,B,z){this.type=P,this.content=H,this.alias=B,this.length=(z||"").length|0}C.stringify=function P(H,B){if(typeof H=="string")return H;if(Array.isArray(H)){var z="";return H.forEach(function(U){z+=P(U,B)}),z}var X={type:H.type,content:P(H.content,B),tag:"span",classes:["token",H.type],attributes:{},language:B},ee=H.alias;ee&&(Array.isArray(ee)?Array.prototype.push.apply(X.classes,ee):X.classes.push(ee)),p.hooks.run("wrap",X);var le="";for(var j in X.attributes)le+=" "+j+'="'+(X.attributes[j]||"").replace(/"/g,"&quot;")+'"';return"<"+X.tag+' class="'+X.classes.join(" ")+'"'+le+">"+X.content+"</"+X.tag+">"};function v(P,H,B,z){P.lastIndex=H;var X=P.exec(B);if(X&&z&&X[1]){var ee=X[1].length;X.index+=ee,X[0]=X[0].slice(ee)}return X}function T(P,H,B,z,X,ee){for(var le in B)if(!(!B.hasOwnProperty(le)||!B[le])){var j=B[le];j=Array.isArray(j)?j:[j];for(var U=0;U<j.length;++U){if(ee&&ee.cause==le+","+U)return;var q=j[U],me=q.inside,_e=!!q.lookbehind,pe=!!q.greedy,ue=q.alias;if(pe&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var D=q.pattern||q,V=z.next,ne=X;V!==H.tail&&!(ee&&ne>=ee.reach);ne+=V.value.length,V=V.next){var Y=V.value;if(H.length>P.length)return;if(!(Y instanceof C)){var G=1,Q;if(pe){if(Q=v(D,ne,P,_e),!Q||Q.index>=P.length)break;var M=Q.index,k=Q.index+Q[0].length,m=ne;for(m+=V.value.length;M>=m;)V=V.next,m+=V.value.length;if(m-=V.value.length,ne=m,V.value instanceof C)continue;for(var y=V;y!==H.tail&&(m<k||typeof y.value=="string");y=y.next)G++,m+=y.value.length;G--,Y=P.slice(ne,m),Q.index-=ne}else if(Q=v(D,0,Y,_e),!Q)continue;var M=Q.index,Z=Q[0],ae=Y.slice(0,M),he=Y.slice(M+Z.length),se=ne+Y.length;ee&&se>ee.reach&&(ee.reach=se);var Te=V.prev;ae&&(Te=R(H,Te,ae),ne+=ae.length),b(H,Te,G);var be=new C(le,me?p.tokenize(Z,me):Z,ue,Z);if(V=R(H,Te,be),he&&R(H,V,he),G>1){var Ue={cause:le+","+U,reach:se};T(P,H,B,V.prev,ne,Ue),ee&&Ue.reach>ee.reach&&(ee.reach=Ue.reach)}}}}}}function O(){var P={value:null,prev:null,next:null},H={value:null,prev:P,next:null};P.next=H,this.head=P,this.tail=H,this.length=0}function R(P,H,B){var z=H.next,X={value:B,prev:H,next:z};return H.next=X,z.prev=X,P.length++,X}function b(P,H,B){for(var z=H.next,X=0;X<B&&z!==P.tail;X++)z=z.next;H.next=z,z.prev=H,P.length-=X}function x(P){for(var H=[],B=P.head.next;B!==P.tail;)H.push(B.value),B=B.next;return H}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(P){var H=JSON.parse(P.data),B=H.language,z=H.code,X=H.immediateClose;r.postMessage(p.highlight(z,p.languages[B],B)),X&&r.close()},!1)),p;var w=p.util.currentScript();w&&(p.filename=w.src,w.hasAttribute("data-manual")&&(p.manual=!0));function $(){p.manual||p.highlightAll()}if(!p.manual){var W=document.readyState;W==="loading"||W==="interactive"&&w&&w.defer?document.addEventListener("DOMContentLoaded",$):window.requestAnimationFrame?window.requestAnimationFrame($):window.setTimeout($,16)}return p}(e);t.exports&&(t.exports=n),typeof ff<"u"&&(ff.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(c,d){var g={};g["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},g.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var C={};C[c]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return c}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",C)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,c){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[c,"language-"+c],inside:n.languages[c]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var c=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+c.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+c.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+c.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+c.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:c,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var d=r.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",c=function(w,$){return"✖ Error "+w+" while fetching file: "+$},d="✖ Error: File does not exist or is empty",g={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",C="loading",v="loaded",T="failed",O="pre[data-src]:not(["+p+'="'+v+'"]):not(['+p+'="'+C+'"])';function R(w,$,W){var P=new XMLHttpRequest;P.open("GET",w,!0),P.onreadystatechange=function(){P.readyState==4&&(P.status<400&&P.responseText?$(P.responseText):P.status>=400?W(c(P.status,P.statusText)):W(d))},P.send(null)}function b(w){var $=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(w||"");if($){var W=Number($[1]),P=$[2],H=$[3];return P?H?[W,Number(H)]:[W,void 0]:[W,W]}}n.hooks.add("before-highlightall",function(w){w.selector+=", "+O}),n.hooks.add("before-sanity-check",function(w){var $=w.element;if($.matches(O)){w.code="",$.setAttribute(p,C);var W=$.appendChild(document.createElement("CODE"));W.textContent=r;var P=$.getAttribute("data-src"),H=w.language;if(H==="none"){var B=(/\.(\w+)$/.exec(P)||[,"none"])[1];H=g[B]||B}n.util.setLanguage(W,H),n.util.setLanguage($,H);var z=n.plugins.autoloader;z&&z.loadLanguages(H),R(P,function(X){$.setAttribute(p,v);var ee=b($.getAttribute("data-range"));if(ee){var le=X.split(/\r\n?|\n/g),j=ee[0],U=ee[1]==null?le.length:ee[1];j<0&&(j+=le.length),j=Math.max(0,Math.min(j-1,le.length)),U<0&&(U+=le.length),U=Math.max(0,Math.min(U,le.length)),X=le.slice(j,U).join(`
83
- `),$.hasAttribute("data-start")||$.setAttribute("data-start",String(j+1))}W.textContent=X,n.highlightElement(W)},function(X){$.setAttribute(p,T),W.textContent=X})}}),n.plugins.fileHighlight={highlight:function($){for(var W=($||document).querySelectorAll(O),P=0,H;H=W[P++];)n.highlightElement(H)}};var x=!1;n.fileHighlight=function(){x||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),x=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(wu)),wu.exports}var Dh={},Ah;function Dp(){return Ah||(Ah=1,Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}),Dh}var Mh={},Rh;function Ap(){return Rh||(Rh=1,Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript),Mh}var bh={},Lh;function Mp(){return Lh||(Lh=1,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var c={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};c["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var d={};d[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:c},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml),bh}var kh={},Ih;function Rp(){return Ih||(Ih=1,function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(T){return T=T.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+T+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,c=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+c+d+"(?:"+c+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+c+d+")(?:"+c+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+c+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+c+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(T){["url","bold","italic","strike","code-snippet"].forEach(function(O){T!==O&&(t.languages.markdown[T].inside.content.inside[O]=t.languages.markdown[O])})}),t.hooks.add("after-tokenize",function(T){if(T.language!=="markdown"&&T.language!=="md")return;function O(R){if(!(!R||typeof R=="string"))for(var b=0,x=R.length;b<x;b++){var w=R[b];if(w.type!=="code"){O(w.content);continue}var $=w.content[1],W=w.content[3];if($&&W&&$.type==="code-language"&&W.type==="code-block"&&typeof $.content=="string"){var P=$.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");P=(/[a-z][\w-]*/i.exec(P)||[""])[0].toLowerCase();var H="language-"+P;W.alias?typeof W.alias=="string"?W.alias=[W.alias,H]:W.alias.push(H):W.alias=[H]}}}O(T.tokens)}),t.hooks.add("wrap",function(T){if(T.type==="code-block"){for(var O="",R=0,b=T.classes.length;R<b;R++){var x=T.classes[R],w=/language-(.+)/.exec(x);if(w){O=w[1];break}}var $=t.languages[O];if($)T.content=t.highlight(v(T.content),$,O);else if(O&&O!=="none"&&t.plugins.autoloader){var W="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);T.attributes.id=W,t.plugins.autoloader.loadLanguages(O,function(){var P=document.getElementById(W);P&&(P.innerHTML=t.highlight(P.textContent,t.languages[O],O))})}}});var g=RegExp(t.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},C=String.fromCodePoint||String.fromCharCode;function v(T){var O=T.replace(g,"");return O=O.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(R,b){if(b=b.toLowerCase(),b[0]==="#"){var x;return b[1]==="x"?x=parseInt(b.slice(2),16):x=Number(b.slice(1)),C(x)}else{var w=p[b];return w||R}}),O}t.languages.md=t.languages.markdown}(Prism)),kh}var Ph={},$h;function bp(){return $h||($h=1,Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean),Ph}var Fh={},Bh;function Lp(){return Bh||(Bh=1,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),Fh}var Hh={},Wh;function kp(){return Wh||(Wh=1,Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec),Hh}var Kh={},zh;function Ip(){return zh||(zh=1,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}),Kh}var Uh={},Gh;function Pp(){return Gh||(Gh=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Uh}var Yh={},jh;function $p(){return jh||(jh=1,function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(Prism)),Yh}var Vh={},qh;function Fp(){return qh||(qh=1,Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=Prism.languages.swift})),Vh}var Zh={},Jh;function Bp(){return Jh||(Jh=1,function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript}(Prism)),Zh}var Xh={},Qh;function Hp(){return Qh||(Qh=1,function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),Xh}var eg={},tg;function Wp(){return tg||(tg=1,function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(Prism)),eg}var ng;function PC(){if(ng)return An;ng=1;var t=Op();Dp(),Ap(),Mp(),Rp(),bp(),Lp(),kp(),Ip(),Pp(),$p(),Fp(),Bp(),Hp(),Wp();var e=on(),n=Bt();const r=re=>re!=null&&t.languages.hasOwnProperty(re)?re:void 0;function c(re,te){for(const ce of re.childNodes){if(e.isHTMLElement(ce)&&ce.tagName===te)return!0;c(ce,te)}return!1}const d="data-highlight-language";class g extends n.ElementNode{static getType(){return"code"}static clone(te){return new g(te.__language,te.__key)}constructor(te,ce){super(ce),this.__language=r(te)}createDOM(te){const ce=document.createElement("code");e.addClassNamesToElement(ce,te.theme.code),ce.setAttribute("spellcheck","false");const we=this.getLanguage();return we&&ce.setAttribute(d,we),ce}updateDOM(te,ce,we){const Le=this.__language,Be=te.__language;return Le?Le!==Be&&ce.setAttribute(d,Le):Be&&ce.removeAttribute(d),!1}exportDOM(){const te=document.createElement("pre");te.setAttribute("spellcheck","false");const ce=this.getLanguage();return ce&&te.setAttribute(d,ce),{element:te}}static importDOM(){return{code:te=>te.textContent!=null&&(/\r?\n/.test(te.textContent)||c(te,"BR"))?{conversion:v,priority:1}:null,div:te=>({conversion:T,priority:1}),pre:te=>({conversion:v,priority:0}),table:te=>W(te)?{conversion:O,priority:3}:null,td:te=>{const ce=te,we=ce.closest("table");return $(ce)?{conversion:b,priority:3}:we&&W(we)?{conversion:R,priority:3}:null},tr:te=>{const we=te.closest("table");return we&&W(we)?{conversion:R,priority:3}:null}}}static importJSON(te){const ce=p(te.language);return ce.setFormat(te.format),ce.setIndent(te.indent),ce.setDirection(te.direction),ce}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(te,ce=!0){const we=this.getChildren(),Le=we.length;if(Le>=2&&we[Le-1].getTextContent()===`
82
+ */var n=function(r){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,g={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function $(W){return W instanceof N?new N(W.type,$(W.content),W.alias):Array.isArray(W)?W.map($):W.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++d}),$.__id},clone:function $(W,B){B=B||{};var z,X;switch(p.util.type(W)){case"Object":if(X=p.util.objId(W),B[X])return B[X];z={},B[X]=z;for(var ee in W)W.hasOwnProperty(ee)&&(z[ee]=$(W[ee],B));return z;case"Array":return X=p.util.objId(W),B[X]?B[X]:(z=[],B[X]=z,W.forEach(function(le,j){z[j]=$(le,B)}),z);default:return W}},getLanguage:function($){for(;$;){var W=c.exec($.className);if(W)return W[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,W){$.className=$.className.replace(RegExp(c,"gi"),""),$.classList.add("language-"+W)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(z){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(z.stack)||[])[1];if($){var W=document.getElementsByTagName("script");for(var B in W)if(W[B].src==$)return W[B]}return null}},isActive:function($,W,B){for(var z="no-"+W;$;){var X=$.classList;if(X.contains(W))return!0;if(X.contains(z))return!1;$=$.parentElement}return!!B}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function($,W){var B=p.util.clone(p.languages[$]);for(var z in W)B[z]=W[z];return B},insertBefore:function($,W,B,z){z=z||p.languages;var X=z[$],ee={};for(var le in X)if(X.hasOwnProperty(le)){if(le==W)for(var j in B)B.hasOwnProperty(j)&&(ee[j]=B[j]);B.hasOwnProperty(le)||(ee[le]=X[le])}var U=z[$];return z[$]=ee,p.languages.DFS(p.languages,function(q,me){me===U&&q!=$&&(this[q]=ee)}),ee},DFS:function $(W,B,z,X){X=X||{};var ee=p.util.objId;for(var le in W)if(W.hasOwnProperty(le)){B.call(W,le,W[le],z||le);var j=W[le],U=p.util.type(j);U==="Object"&&!X[ee(j)]?(X[ee(j)]=!0,$(j,B,null,X)):U==="Array"&&!X[ee(j)]&&(X[ee(j)]=!0,$(j,B,le,X))}}},plugins:{},highlightAll:function($,W){p.highlightAllUnder(document,$,W)},highlightAllUnder:function($,W,B){var z={callback:B,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",z),z.elements=Array.prototype.slice.apply(z.container.querySelectorAll(z.selector)),p.hooks.run("before-all-elements-highlight",z);for(var X=0,ee;ee=z.elements[X++];)p.highlightElement(ee,W===!0,z.callback)},highlightElement:function($,W,B){var z=p.util.getLanguage($),X=p.languages[z];p.util.setLanguage($,z);var ee=$.parentElement;ee&&ee.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(ee,z);var le=$.textContent,j={element:$,language:z,grammar:X,code:le};function U(me){j.highlightedCode=me,p.hooks.run("before-insert",j),j.element.innerHTML=j.highlightedCode,p.hooks.run("after-highlight",j),p.hooks.run("complete",j),B&&B.call(j.element)}if(p.hooks.run("before-sanity-check",j),ee=j.element.parentElement,ee&&ee.nodeName.toLowerCase()==="pre"&&!ee.hasAttribute("tabindex")&&ee.setAttribute("tabindex","0"),!j.code){p.hooks.run("complete",j),B&&B.call(j.element);return}if(p.hooks.run("before-highlight",j),!j.grammar){U(p.util.encode(j.code));return}if(W&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(me){U(me.data)},q.postMessage(JSON.stringify({language:j.language,code:j.code,immediateClose:!0}))}else U(p.highlight(j.code,j.grammar,j.language))},highlight:function($,W,B){var z={code:$,grammar:W,language:B};if(p.hooks.run("before-tokenize",z),!z.grammar)throw new Error('The language "'+z.language+'" has no grammar.');return z.tokens=p.tokenize(z.code,z.grammar),p.hooks.run("after-tokenize",z),N.stringify(p.util.encode(z.tokens),z.language)},tokenize:function($,W){var B=W.rest;if(B){for(var z in B)W[z]=B[z];delete W.rest}var X=new O;return b(X,X.head,$),T($,X,W,X.head,0),x(X)},hooks:{all:{},add:function($,W){var B=p.hooks.all;B[$]=B[$]||[],B[$].push(W)},run:function($,W){var B=p.hooks.all[$];if(!(!B||!B.length))for(var z=0,X;X=B[z++];)X(W)}},Token:N};r.Prism=p;function N($,W,B,z){this.type=$,this.content=W,this.alias=B,this.length=(z||"").length|0}N.stringify=function $(W,B){if(typeof W=="string")return W;if(Array.isArray(W)){var z="";return W.forEach(function(U){z+=$(U,B)}),z}var X={type:W.type,content:$(W.content,B),tag:"span",classes:["token",W.type],attributes:{},language:B},ee=W.alias;ee&&(Array.isArray(ee)?Array.prototype.push.apply(X.classes,ee):X.classes.push(ee)),p.hooks.run("wrap",X);var le="";for(var j in X.attributes)le+=" "+j+'="'+(X.attributes[j]||"").replace(/"/g,"&quot;")+'"';return"<"+X.tag+' class="'+X.classes.join(" ")+'"'+le+">"+X.content+"</"+X.tag+">"};function v($,W,B,z){$.lastIndex=W;var X=$.exec(B);if(X&&z&&X[1]){var ee=X[1].length;X.index+=ee,X[0]=X[0].slice(ee)}return X}function T($,W,B,z,X,ee){for(var le in B)if(!(!B.hasOwnProperty(le)||!B[le])){var j=B[le];j=Array.isArray(j)?j:[j];for(var U=0;U<j.length;++U){if(ee&&ee.cause==le+","+U)return;var q=j[U],me=q.inside,_e=!!q.lookbehind,pe=!!q.greedy,ue=q.alias;if(pe&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var D=q.pattern||q,V=z.next,ne=X;V!==W.tail&&!(ee&&ne>=ee.reach);ne+=V.value.length,V=V.next){var Y=V.value;if(W.length>$.length)return;if(!(Y instanceof N)){var G=1,Q;if(pe){if(Q=v(D,ne,$,_e),!Q||Q.index>=$.length)break;var M=Q.index,k=Q.index+Q[0].length,m=ne;for(m+=V.value.length;M>=m;)V=V.next,m+=V.value.length;if(m-=V.value.length,ne=m,V.value instanceof N)continue;for(var y=V;y!==W.tail&&(m<k||typeof y.value=="string");y=y.next)G++,m+=y.value.length;G--,Y=$.slice(ne,m),Q.index-=ne}else if(Q=v(D,0,Y,_e),!Q)continue;var M=Q.index,Z=Q[0],ae=Y.slice(0,M),he=Y.slice(M+Z.length),se=ne+Y.length;ee&&se>ee.reach&&(ee.reach=se);var Te=V.prev;ae&&(Te=b(W,Te,ae),ne+=ae.length),R(W,Te,G);var be=new N(le,me?p.tokenize(Z,me):Z,ue,Z);if(V=b(W,Te,be),he&&b(W,V,he),G>1){var Ue={cause:le+","+U,reach:se};T($,W,B,V.prev,ne,Ue),ee&&Ue.reach>ee.reach&&(ee.reach=Ue.reach)}}}}}}function O(){var $={value:null,prev:null,next:null},W={value:null,prev:$,next:null};$.next=W,this.head=$,this.tail=W,this.length=0}function b($,W,B){var z=W.next,X={value:B,prev:W,next:z};return W.next=X,z.prev=X,$.length++,X}function R($,W,B){for(var z=W.next,X=0;X<B&&z!==$.tail;X++)z=z.next;W.next=z,z.prev=W,$.length-=X}function x($){for(var W=[],B=$.head.next;B!==$.tail;)W.push(B.value),B=B.next;return W}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function($){var W=JSON.parse($.data),B=W.language,z=W.code,X=W.immediateClose;r.postMessage(p.highlight(z,p.languages[B],B)),X&&r.close()},!1)),p;var w=p.util.currentScript();w&&(p.filename=w.src,w.hasAttribute("data-manual")&&(p.manual=!0));function P(){p.manual||p.highlightAll()}if(!p.manual){var H=document.readyState;H==="loading"||H==="interactive"&&w&&w.defer?document.addEventListener("DOMContentLoaded",P):window.requestAnimationFrame?window.requestAnimationFrame(P):window.setTimeout(P,16)}return p}(e);t.exports&&(t.exports=n),typeof ff<"u"&&(ff.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&amp;/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(c,d){var g={};g["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},g.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var N={};N[c]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return c}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",N)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,c){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[c,"language-"+c],inside:n.languages[c]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var c=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+c.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+c.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+c.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+c.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:c,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var d=r.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",c=function(w,P){return"✖ Error "+w+" while fetching file: "+P},d="✖ Error: File does not exist or is empty",g={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",N="loading",v="loaded",T="failed",O="pre[data-src]:not(["+p+'="'+v+'"]):not(['+p+'="'+N+'"])';function b(w,P,H){var $=new XMLHttpRequest;$.open("GET",w,!0),$.onreadystatechange=function(){$.readyState==4&&($.status<400&&$.responseText?P($.responseText):$.status>=400?H(c($.status,$.statusText)):H(d))},$.send(null)}function R(w){var P=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(w||"");if(P){var H=Number(P[1]),$=P[2],W=P[3];return $?W?[H,Number(W)]:[H,void 0]:[H,H]}}n.hooks.add("before-highlightall",function(w){w.selector+=", "+O}),n.hooks.add("before-sanity-check",function(w){var P=w.element;if(P.matches(O)){w.code="",P.setAttribute(p,N);var H=P.appendChild(document.createElement("CODE"));H.textContent=r;var $=P.getAttribute("data-src"),W=w.language;if(W==="none"){var B=(/\.(\w+)$/.exec($)||[,"none"])[1];W=g[B]||B}n.util.setLanguage(H,W),n.util.setLanguage(P,W);var z=n.plugins.autoloader;z&&z.loadLanguages(W),b($,function(X){P.setAttribute(p,v);var ee=R(P.getAttribute("data-range"));if(ee){var le=X.split(/\r\n?|\n/g),j=ee[0],U=ee[1]==null?le.length:ee[1];j<0&&(j+=le.length),j=Math.max(0,Math.min(j-1,le.length)),U<0&&(U+=le.length),U=Math.max(0,Math.min(U,le.length)),X=le.slice(j,U).join(`
83
+ `),P.hasAttribute("data-start")||P.setAttribute("data-start",String(j+1))}H.textContent=X,n.highlightElement(H)},function(X){P.setAttribute(p,T),H.textContent=X})}}),n.plugins.fileHighlight={highlight:function(P){for(var H=(P||document).querySelectorAll(O),$=0,W;W=H[$++];)n.highlightElement(W)}};var x=!1;n.fileHighlight=function(){x||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),x=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(wu)),wu.exports}var Dh={},Ah;function Dp(){return Ah||(Ah=1,Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}),Dh}var Mh={},Rh;function Ap(){return Rh||(Rh=1,Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript),Mh}var bh={},Lh;function Mp(){return Lh||(Lh=1,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var c={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};c["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var d={};d[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:c},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml),bh}var kh={},Ih;function Rp(){return Ih||(Ih=1,function(t){var e=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(T){return T=T.replace(/<inner>/g,function(){return e}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+T+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,c=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+c+d+"(?:"+c+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+c+d+")(?:"+c+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+c+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+c+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(T){["url","bold","italic","strike","code-snippet"].forEach(function(O){T!==O&&(t.languages.markdown[T].inside.content.inside[O]=t.languages.markdown[O])})}),t.hooks.add("after-tokenize",function(T){if(T.language!=="markdown"&&T.language!=="md")return;function O(b){if(!(!b||typeof b=="string"))for(var R=0,x=b.length;R<x;R++){var w=b[R];if(w.type!=="code"){O(w.content);continue}var P=w.content[1],H=w.content[3];if(P&&H&&P.type==="code-language"&&H.type==="code-block"&&typeof P.content=="string"){var $=P.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");$=(/[a-z][\w-]*/i.exec($)||[""])[0].toLowerCase();var W="language-"+$;H.alias?typeof H.alias=="string"?H.alias=[H.alias,W]:H.alias.push(W):H.alias=[W]}}}O(T.tokens)}),t.hooks.add("wrap",function(T){if(T.type==="code-block"){for(var O="",b=0,R=T.classes.length;b<R;b++){var x=T.classes[b],w=/language-(.+)/.exec(x);if(w){O=w[1];break}}var P=t.languages[O];if(P)T.content=t.highlight(v(T.content),P,O);else if(O&&O!=="none"&&t.plugins.autoloader){var H="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);T.attributes.id=H,t.plugins.autoloader.loadLanguages(O,function(){var $=document.getElementById(H);$&&($.innerHTML=t.highlight($.textContent,t.languages[O],O))})}}});var g=RegExp(t.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},N=String.fromCodePoint||String.fromCharCode;function v(T){var O=T.replace(g,"");return O=O.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(b,R){if(R=R.toLowerCase(),R[0]==="#"){var x;return R[1]==="x"?x=parseInt(R.slice(2),16):x=Number(R.slice(1)),N(x)}else{var w=p[R];return w||b}}),O}t.languages.md=t.languages.markdown}(Prism)),kh}var Ph={},$h;function bp(){return $h||($h=1,Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean),Ph}var Fh={},Bh;function Lp(){return Bh||(Bh=1,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var n=t.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),Fh}var Hh={},Wh;function kp(){return Wh||(Wh=1,Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec),Hh}var Kh={},zh;function Ip(){return zh||(zh=1,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}),Kh}var Uh={},Gh;function Pp(){return Gh||(Gh=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Uh}var Yh={},jh;function $p(){return jh||(jh=1,function(t){for(var e=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)e=e.replace(/<self>/g,function(){return e});e=e.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+e),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string}(Prism)),Yh}var Vh={},qh;function Fp(){return qh||(qh=1,Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=Prism.languages.swift})),Vh}var Zh={},Jh;function Bp(){return Jh||(Jh=1,function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript}(Prism)),Zh}var Xh={},Qh;function Hp(){return Qh||(Qh=1,function(t){var e=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:e,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),Xh}var eg={},tg;function Wp(){return tg||(tg=1,function(t){var e=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return e.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return e.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:e,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])}(Prism)),eg}var ng;function PC(){if(ng)return An;ng=1;var t=Op();Dp(),Ap(),Mp(),Rp(),bp(),Lp(),kp(),Ip(),Pp(),$p(),Fp(),Bp(),Hp(),Wp();var e=on(),n=Bt();const r=re=>re!=null&&t.languages.hasOwnProperty(re)?re:void 0;function c(re,te){for(const ce of re.childNodes){if(e.isHTMLElement(ce)&&ce.tagName===te)return!0;c(ce,te)}return!1}const d="data-highlight-language";class g extends n.ElementNode{static getType(){return"code"}static clone(te){return new g(te.__language,te.__key)}constructor(te,ce){super(ce),this.__language=r(te)}createDOM(te){const ce=document.createElement("code");e.addClassNamesToElement(ce,te.theme.code),ce.setAttribute("spellcheck","false");const we=this.getLanguage();return we&&ce.setAttribute(d,we),ce}updateDOM(te,ce,we){const Le=this.__language,Be=te.__language;return Le?Le!==Be&&ce.setAttribute(d,Le):Be&&ce.removeAttribute(d),!1}exportDOM(){const te=document.createElement("pre");te.setAttribute("spellcheck","false");const ce=this.getLanguage();return ce&&te.setAttribute(d,ce),{element:te}}static importDOM(){return{code:te=>te.textContent!=null&&(/\r?\n/.test(te.textContent)||c(te,"BR"))?{conversion:v,priority:1}:null,div:te=>({conversion:T,priority:1}),pre:te=>({conversion:v,priority:0}),table:te=>H(te)?{conversion:O,priority:3}:null,td:te=>{const ce=te,we=ce.closest("table");return P(ce)?{conversion:R,priority:3}:we&&H(we)?{conversion:b,priority:3}:null},tr:te=>{const we=te.closest("table");return we&&H(we)?{conversion:b,priority:3}:null}}}static importJSON(te){const ce=p(te.language);return ce.setFormat(te.format),ce.setIndent(te.indent),ce.setDirection(te.direction),ce}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(te,ce=!0){const we=this.getChildren(),Le=we.length;if(Le>=2&&we[Le-1].getTextContent()===`
84
84
  `&&we[Le-2].getTextContent()===`
85
- `&&te.isCollapsed()&&te.anchor.key===this.__key&&te.anchor.offset===Le){we[Le-1].remove(),we[Le-2].remove();const dt=n.$createParagraphNode();return this.insertAfter(dt,ce),dt}const{anchor:Be,focus:Ye}=te,yt=(Be.isBefore(Ye)?Be:Ye).getNode();if(n.$isTextNode(yt)){let dt=_e(yt);const ve=[];for(;;)if(n.$isTabNode(dt))ve.push(n.$createTabNode()),dt=dt.getNextSibling();else if(me(dt)){let qe=0;const Qe=dt.getTextContent(),ft=dt.getTextContentSize();for(;qe<ft&&Qe[qe]===" ";qe++);if(qe!==0&&ve.push(q(" ".repeat(qe))),qe!==ft)break;dt=dt.getNextSibling()}else break;const ie=yt.splitText(Be.offset)[0],fe=Be.offset===0?0:1,Oe=ie.getIndexWithinParent()+fe,Re=yt.getParentOrThrow(),De=[n.$createLineBreakNode(),...ve];Re.splice(Oe,0,De);const We=ve[ve.length-1];We?We.select():Be.offset===0?ie.selectPrevious():ie.getNextSibling().selectNext(0,0)}if(C(yt)){const{offset:dt}=te.anchor;yt.splice(dt,0,[n.$createLineBreakNode()]),yt.select(dt+1,dt+1)}return null}canIndent(){return!1}collapseAtStart(){const te=n.$createParagraphNode();return this.getChildren().forEach(we=>te.append(we)),this.replace(te),!0}setLanguage(te){const ce=this.getWritable();ce.__language=r(te)}getLanguage(){return this.getLatest().__language}}function p(re){return n.$applyNodeReplacement(new g(re))}function C(re){return re instanceof g}function v(re){let te;return e.isHTMLElement(re)&&(te=re.getAttribute(d)),{node:p(te)}}function T(re){const te=re,ce=x(te);return!ce&&!w(te)?{node:null}:{after:we=>{const Le=re.parentNode;return Le!=null&&re!==Le.lastChild&&we.push(n.$createLineBreakNode()),we},node:ce?p():null}}function O(){return{node:p()}}function R(){return{node:null}}function b(re){const te=re;return{after:ce=>(te.parentNode&&te.parentNode.nextSibling&&ce.push(n.$createLineBreakNode()),ce),node:null}}function x(re){return re.style.fontFamily.match("monospace")!==null}function w(re){let te=re.parentElement;for(;te!==null;){if(x(te))return!0;te=te.parentElement}return!1}function $(re){return re.classList.contains("js-file-line")}function W(re){return re.classList.contains("js-file-line-container")}const P="javascript",H={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},B={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function z(re){return B[re]||re}function X(re){const te=z(re);return H[te]||te}const ee=()=>P,le=()=>Object.keys(t.languages).filter(re=>typeof t.languages[re]!="function").sort();class j extends n.TextNode{constructor(te,ce,we){super(te,we),this.__highlightType=ce}static getType(){return"code-highlight"}static clone(te){return new j(te.__text,te.__highlightType||void 0,te.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(te){const ce=super.createDOM(te),we=U(te.theme,this.__highlightType);return e.addClassNamesToElement(ce,we),ce}updateDOM(te,ce,we){const Le=super.updateDOM(te,ce,we),Be=U(we.theme,te.__highlightType),Ye=U(we.theme,this.__highlightType);return Be!==Ye&&(Be&&e.removeClassNamesFromElement(ce,Be),Ye&&e.addClassNamesToElement(ce,Ye)),Le}static importJSON(te){const ce=q(te.text,te.highlightType);return ce.setFormat(te.format),ce.setDetail(te.detail),ce.setMode(te.mode),ce.setStyle(te.style),ce}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(te){return this}isParentRequired(){return!0}createParentElementNode(){return p()}}function U(re,te){return te&&re&&re.codeHighlight&&re.codeHighlight[te]}function q(re,te){return n.$applyNodeReplacement(new j(re,te))}function me(re){return re instanceof j}function _e(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getPreviousSibling();return te}function pe(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getNextSibling();return te}const ue={defaultLanguage:P,tokenize(re,te){return t.tokenize(re,t.languages[te||""]||t.languages[this.defaultLanguage])}};function K(re,te){let ce=null,we=null,Le=re,Be=te,Ye=re.getTextContent();for(;;){if(Be===0){if(Le=Le.getPreviousSibling(),Le===null)break;if(!(me(Le)||n.$isTabNode(Le)||n.$isLineBreakNode(Le)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Le)){ce={node:Le,offset:1};break}Be=Math.max(0,Le.getTextContentSize()-1),Ye=Le.getTextContent()}else Be--;const yt=Ye[Be];me(Le)&&yt!==" "&&(we={node:Le,offset:Be})}if(we!==null)return we;let ct=null;if(te<re.getTextContentSize())me(re)&&(ct=re.getTextContent()[te]);else{const yt=re.getNextSibling();me(yt)&&(ct=yt.getTextContent()[0])}if(ct!==null&&ct!==" ")return ce;{const yt=D(re,te);return yt!==null?yt:ce}}function D(re,te){let ce=re,we=te,Le=re.getTextContent(),Be=re.getTextContentSize();for(;;){if(!me(ce)||we===Be){if(ce=ce.getNextSibling(),ce===null||n.$isLineBreakNode(ce))return null;me(ce)&&(we=0,Le=ce.getTextContent(),Be=ce.getTextContentSize())}if(me(ce)){if(Le[we]!==" ")return{node:ce,offset:we};we++}}}function V(re){const te=pe(re);if(n.$isLineBreakNode(te))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return te}function ne(re,te,ce){const we=re.getParent();C(we)?Q(we,te,ce):me(re)&&re.replace(n.$createTextNode(re.__text))}function Y(re,te){const ce=te.getElementByKey(re.getKey());if(ce===null)return;const we=re.getChildren(),Le=we.length;if(Le===ce.__cachedChildrenLength)return;ce.__cachedChildrenLength=Le;let Be="1",Ye=1;for(let ct=0;ct<Le;ct++)n.$isLineBreakNode(we[ct])&&(Be+=`
86
- `+ ++Ye);ce.setAttribute("data-gutter",Be)}const G=new Set;function Q(re,te,ce){const we=re.getKey();G.has(we)||(G.add(we),re.getLanguage()===void 0&&re.setLanguage(ce.defaultLanguage),te.update(()=>{m(we,()=>{const Le=n.$getNodeByKey(we);if(!C(Le)||!Le.isAttached())return!1;const Be=Le.getTextContent(),Ye=ce.tokenize(Be,Le.getLanguage()||ce.defaultLanguage),ct=k(Ye),yt=y(Le.getChildren(),ct),{from:dt,to:ve,nodesForReplacement:ie}=yt;return dt!==ve||ie.length?(re.splice(dt,ve-dt,ie),!0):!1})},{onUpdate:()=>{G.delete(we)},skipTransforms:!0}))}function k(re,te){const ce=[];for(const we of re)if(typeof we=="string"){const Le=we.split(/(\n|\t)/),Be=Le.length;for(let Ye=0;Ye<Be;Ye++){const ct=Le[Ye];ct===`
85
+ `&&te.isCollapsed()&&te.anchor.key===this.__key&&te.anchor.offset===Le){we[Le-1].remove(),we[Le-2].remove();const dt=n.$createParagraphNode();return this.insertAfter(dt,ce),dt}const{anchor:Be,focus:Ye}=te,yt=(Be.isBefore(Ye)?Be:Ye).getNode();if(n.$isTextNode(yt)){let dt=_e(yt);const ve=[];for(;;)if(n.$isTabNode(dt))ve.push(n.$createTabNode()),dt=dt.getNextSibling();else if(me(dt)){let qe=0;const Qe=dt.getTextContent(),ft=dt.getTextContentSize();for(;qe<ft&&Qe[qe]===" ";qe++);if(qe!==0&&ve.push(q(" ".repeat(qe))),qe!==ft)break;dt=dt.getNextSibling()}else break;const ie=yt.splitText(Be.offset)[0],fe=Be.offset===0?0:1,Oe=ie.getIndexWithinParent()+fe,Re=yt.getParentOrThrow(),De=[n.$createLineBreakNode(),...ve];Re.splice(Oe,0,De);const We=ve[ve.length-1];We?We.select():Be.offset===0?ie.selectPrevious():ie.getNextSibling().selectNext(0,0)}if(N(yt)){const{offset:dt}=te.anchor;yt.splice(dt,0,[n.$createLineBreakNode()]),yt.select(dt+1,dt+1)}return null}canIndent(){return!1}collapseAtStart(){const te=n.$createParagraphNode();return this.getChildren().forEach(we=>te.append(we)),this.replace(te),!0}setLanguage(te){const ce=this.getWritable();ce.__language=r(te)}getLanguage(){return this.getLatest().__language}}function p(re){return n.$applyNodeReplacement(new g(re))}function N(re){return re instanceof g}function v(re){let te;return e.isHTMLElement(re)&&(te=re.getAttribute(d)),{node:p(te)}}function T(re){const te=re,ce=x(te);return!ce&&!w(te)?{node:null}:{after:we=>{const Le=re.parentNode;return Le!=null&&re!==Le.lastChild&&we.push(n.$createLineBreakNode()),we},node:ce?p():null}}function O(){return{node:p()}}function b(){return{node:null}}function R(re){const te=re;return{after:ce=>(te.parentNode&&te.parentNode.nextSibling&&ce.push(n.$createLineBreakNode()),ce),node:null}}function x(re){return re.style.fontFamily.match("monospace")!==null}function w(re){let te=re.parentElement;for(;te!==null;){if(x(te))return!0;te=te.parentElement}return!1}function P(re){return re.classList.contains("js-file-line")}function H(re){return re.classList.contains("js-file-line-container")}const $="javascript",W={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},B={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function z(re){return B[re]||re}function X(re){const te=z(re);return W[te]||te}const ee=()=>$,le=()=>Object.keys(t.languages).filter(re=>typeof t.languages[re]!="function").sort();class j extends n.TextNode{constructor(te,ce,we){super(te,we),this.__highlightType=ce}static getType(){return"code-highlight"}static clone(te){return new j(te.__text,te.__highlightType||void 0,te.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(te){const ce=super.createDOM(te),we=U(te.theme,this.__highlightType);return e.addClassNamesToElement(ce,we),ce}updateDOM(te,ce,we){const Le=super.updateDOM(te,ce,we),Be=U(we.theme,te.__highlightType),Ye=U(we.theme,this.__highlightType);return Be!==Ye&&(Be&&e.removeClassNamesFromElement(ce,Be),Ye&&e.addClassNamesToElement(ce,Ye)),Le}static importJSON(te){const ce=q(te.text,te.highlightType);return ce.setFormat(te.format),ce.setDetail(te.detail),ce.setMode(te.mode),ce.setStyle(te.style),ce}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(te){return this}isParentRequired(){return!0}createParentElementNode(){return p()}}function U(re,te){return te&&re&&re.codeHighlight&&re.codeHighlight[te]}function q(re,te){return n.$applyNodeReplacement(new j(re,te))}function me(re){return re instanceof j}function _e(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getPreviousSibling();return te}function pe(re){let te=re,ce=re;for(;me(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getNextSibling();return te}const ue={defaultLanguage:$,tokenize(re,te){return t.tokenize(re,t.languages[te||""]||t.languages[this.defaultLanguage])}};function K(re,te){let ce=null,we=null,Le=re,Be=te,Ye=re.getTextContent();for(;;){if(Be===0){if(Le=Le.getPreviousSibling(),Le===null)break;if(!(me(Le)||n.$isTabNode(Le)||n.$isLineBreakNode(Le)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Le)){ce={node:Le,offset:1};break}Be=Math.max(0,Le.getTextContentSize()-1),Ye=Le.getTextContent()}else Be--;const yt=Ye[Be];me(Le)&&yt!==" "&&(we={node:Le,offset:Be})}if(we!==null)return we;let ct=null;if(te<re.getTextContentSize())me(re)&&(ct=re.getTextContent()[te]);else{const yt=re.getNextSibling();me(yt)&&(ct=yt.getTextContent()[0])}if(ct!==null&&ct!==" ")return ce;{const yt=D(re,te);return yt!==null?yt:ce}}function D(re,te){let ce=re,we=te,Le=re.getTextContent(),Be=re.getTextContentSize();for(;;){if(!me(ce)||we===Be){if(ce=ce.getNextSibling(),ce===null||n.$isLineBreakNode(ce))return null;me(ce)&&(we=0,Le=ce.getTextContent(),Be=ce.getTextContentSize())}if(me(ce)){if(Le[we]!==" ")return{node:ce,offset:we};we++}}}function V(re){const te=pe(re);if(n.$isLineBreakNode(te))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return te}function ne(re,te,ce){const we=re.getParent();N(we)?Q(we,te,ce):me(re)&&re.replace(n.$createTextNode(re.__text))}function Y(re,te){const ce=te.getElementByKey(re.getKey());if(ce===null)return;const we=re.getChildren(),Le=we.length;if(Le===ce.__cachedChildrenLength)return;ce.__cachedChildrenLength=Le;let Be="1",Ye=1;for(let ct=0;ct<Le;ct++)n.$isLineBreakNode(we[ct])&&(Be+=`
86
+ `+ ++Ye);ce.setAttribute("data-gutter",Be)}const G=new Set;function Q(re,te,ce){const we=re.getKey();G.has(we)||(G.add(we),re.getLanguage()===void 0&&re.setLanguage(ce.defaultLanguage),te.update(()=>{m(we,()=>{const Le=n.$getNodeByKey(we);if(!N(Le)||!Le.isAttached())return!1;const Be=Le.getTextContent(),Ye=ce.tokenize(Be,Le.getLanguage()||ce.defaultLanguage),ct=k(Ye),yt=y(Le.getChildren(),ct),{from:dt,to:ve,nodesForReplacement:ie}=yt;return dt!==ve||ie.length?(re.splice(dt,ve-dt,ie),!0):!1})},{onUpdate:()=>{G.delete(we)},skipTransforms:!0}))}function k(re,te){const ce=[];for(const we of re)if(typeof we=="string"){const Le=we.split(/(\n|\t)/),Be=Le.length;for(let Ye=0;Ye<Be;Ye++){const ct=Le[Ye];ct===`
87
87
  `||ct===`\r
88
- `?ce.push(n.$createLineBreakNode()):ct===" "?ce.push(n.$createTabNode()):ct.length>0&&ce.push(q(ct,te))}}else{const{content:Le}=we;typeof Le=="string"?ce.push(...k([Le],we.type)):Array.isArray(Le)&&ce.push(...k(Le,we.type))}return ce}function m(re,te){const ce=n.$getNodeByKey(re);if(!C(ce)||!ce.isAttached())return;const we=n.$getSelection();if(!n.$isRangeSelection(we)){te();return}const Le=we.anchor,Be=Le.offset,Ye=Le.type==="element"&&n.$isLineBreakNode(ce.getChildAtIndex(Le.offset-1));let ct=0;if(!Ye){const dt=Le.getNode();ct=Be+dt.getPreviousSiblings().reduce((ve,ie)=>ve+ie.getTextContentSize(),0)}if(te()){if(Ye){Le.getNode().select(Be,Be);return}ce.getChildren().some(dt=>{const ve=n.$isTextNode(dt);if(ve||n.$isLineBreakNode(dt)){const ie=dt.getTextContentSize();if(ve&&ie>=ct)return dt.select(ct,ct),!0;ct-=ie}return!1})}}function y(re,te){let ce=0;for(;ce<re.length&&M(re[ce],te[ce]);)ce++;const we=re.length,Le=te.length,Be=Math.min(we,Le)-ce;let Ye=0;for(;Ye<Be;)if(Ye++,!M(re[we-Ye],te[Le-Ye])){Ye--;break}const ct=ce,yt=we-Ye,dt=te.slice(ce,Le-Ye);return{from:ct,nodesForReplacement:dt,to:yt}}function M(re,te){return me(re)&&me(te)&&re.__text===te.__text&&re.__highlightType===te.__highlightType||n.$isTabNode(re)&&n.$isTabNode(te)||n.$isLineBreakNode(re)&&n.$isLineBreakNode(te)}function Z(re){if(!n.$isRangeSelection(re))return!1;const te=re.anchor.getNode(),ce=re.focus.getNode();if(te.is(ce)&&C(te))return!0;const we=te.getParent();return C(we)&&we.is(ce.getParent())}function ae(re){const te=re.getNodes(),ce=[[]];if(te.length===1&&C(te[0]))return ce;let we=ce[0];for(let Le=0;Le<te.length;Le++){const Be=te[Le];if(!(me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Be)?Le!==0&&we.length>0&&(we=[],ce.push(we)):we.push(Be)}return ce}function he(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return null;const ce=re?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,we=re?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(ae(te).length>1)return ce;const Ye=te.getNodes()[0];if(!(C(Ye)||me(Ye)||n.$isTabNode(Ye)||n.$isLineBreakNode(Ye)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(C(Ye))return ce;const ct=_e(Ye),yt=pe(Ye),dt=te.anchor,ve=te.focus;let ie,fe;return ve.isBefore(dt)?(ie=ve,fe=dt):(ie=dt,fe=ve),ct!==null&&yt!==null&&ie.key===ct.getKey()&&ie.offset===0&&fe.key===yt.getKey()&&fe.offset===yt.getTextContentSize()?ce:we}function se(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return!1;const ce=ae(te),we=ce.length;if(ce.length>1){for(let ct=0;ct<we;ct++){const yt=ce[ct];if(yt.length>0){let dt=yt[0];ct===0&&(dt=_e(dt)),dt!==null&&(re===n.INDENT_CONTENT_COMMAND?dt.insertBefore(n.$createTabNode()):n.$isTabNode(dt)&&dt.remove())}}return!0}const Be=te.getNodes()[0];if(!(C(Be)||me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(C(Be))return re===n.INDENT_CONTENT_COMMAND&&te.insertNodes([n.$createTabNode()]),!0;const Ye=_e(Be);if(Ye===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return re===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(Ye)?Ye.insertAfter(n.$createTabNode()):Ye.insertBefore(n.$createTabNode()):n.$isTabNode(Ye)&&Ye.remove(),!0}function Te(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.offset,Ye=Le.offset,ct=we.getNode(),yt=Le.getNode(),dt=re===n.KEY_ARROW_UP_COMMAND;if(!Z(ce)||!(me(ct)||n.$isTabNode(ct))||!(me(yt)||n.$isTabNode(yt)))return!1;if(!te.altKey){if(ce.isCollapsed()){const qe=ct.getParentOrThrow();if(dt&&Be===0&&ct.getPreviousSibling()===null){if(qe.getPreviousSibling()===null)return qe.selectPrevious(),te.preventDefault(),!0}else if(!dt&&Be===ct.getTextContentSize()&&ct.getNextSibling()===null&&qe.getNextSibling()===null)return qe.selectNext(),te.preventDefault(),!0}return!1}let ve,ie;if(ct.isBefore(yt)?(ve=_e(ct),ie=pe(yt)):(ve=_e(yt),ie=pe(ct)),ve==null||ie==null)return!1;const fe=ve.getNodesBetween(ie);for(let qe=0;qe<fe.length;qe++){const Qe=fe[qe];if(!me(Qe)&&!n.$isTabNode(Qe)&&!n.$isLineBreakNode(Qe))return!1}te.preventDefault(),te.stopPropagation();const Oe=dt?ve.getPreviousSibling():ie.getNextSibling();if(!n.$isLineBreakNode(Oe))return!0;const Re=dt?Oe.getPreviousSibling():Oe.getNextSibling();if(Re==null)return!0;const De=me(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)?dt?_e(Re):pe(Re):null;let We=De??Re;return Oe.remove(),fe.forEach(qe=>qe.remove()),re===n.KEY_ARROW_UP_COMMAND?(fe.forEach(qe=>We.insertBefore(qe)),We.insertBefore(Oe)):(We.insertAfter(Oe),We=Oe,fe.forEach(qe=>{We.insertAfter(qe),We=qe})),ce.setTextNodeRange(ct,Be,yt,Ye),!0}function be(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.getNode(),Ye=Le.getNode(),ct=re===n.MOVE_TO_START;if(!(me(Be)||n.$isTabNode(Be))||!(me(Ye)||n.$isTabNode(Ye)))return!1;if(ct){const yt=K(Ye,Le.offset);if(yt!==null){const{node:dt,offset:ve}=yt;n.$isLineBreakNode(dt)?dt.selectNext(0,0):ce.setTextNodeRange(dt,ve,dt,ve)}else Ye.getParentOrThrow().selectStart()}else V(Ye).select();return te.preventDefault(),te.stopPropagation(),!0}function Ue(re,te){if(!re.hasNodes([g,j]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return te==null&&(te=ue),e.mergeRegister(re.registerMutationListener(g,ce=>{re.update(()=>{for(const[we,Le]of ce)if(Le!=="destroyed"){const Be=n.$getNodeByKey(we);Be!==null&&Y(Be,re)}})}),re.registerNodeTransform(g,ce=>Q(ce,re,te)),re.registerNodeTransform(n.TextNode,ce=>ne(ce,re,te)),re.registerNodeTransform(j,ce=>ne(ce,re,te)),re.registerCommand(n.KEY_TAB_COMMAND,ce=>{const we=he(ce.shiftKey);return we===null?!1:(ce.preventDefault(),re.dispatchCommand(we,void 0),!0)},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ce=n.$getSelection();return Z(ce)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INDENT_CONTENT_COMMAND,ce=>se(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>se(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>Te(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>Te(n.KEY_ARROW_DOWN_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_END,ce=>be(n.MOVE_TO_END,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_START,ce=>be(n.MOVE_TO_START,ce),n.COMMAND_PRIORITY_LOW))}return An.$createCodeHighlightNode=q,An.$createCodeNode=p,An.$isCodeHighlightNode=me,An.$isCodeNode=C,An.CODE_LANGUAGE_FRIENDLY_NAME_MAP=H,An.CODE_LANGUAGE_MAP=B,An.CodeHighlightNode=j,An.CodeNode=g,An.DEFAULT_CODE_LANGUAGE=P,An.PrismTokenizer=ue,An.getCodeLanguages=le,An.getDefaultCodeLanguage=ee,An.getEndOfCodeInLine=V,An.getFirstCodeNodeOfLine=_e,An.getLanguageFriendlyName=X,An.getLastCodeNodeOfLine=pe,An.getStartOfCodeInLine=K,An.normalizeCodeLang=z,An.registerCodeHighlighting=Ue,An}var Mn={},rg;function $C(){if(rg)return Mn;rg=1;var t=Op();Dp(),Ap(),Mp(),Rp(),bp(),Lp(),kp(),Ip(),Pp(),$p(),Fp(),Bp(),Hp(),Wp();var e=on(),n=Bt();let r=k=>k!=null&&t.languages.hasOwnProperty(k)?k:void 0;function c(k,m){for(let y of k.childNodes){if(e.isHTMLElement(y)&&y.tagName===m)return!0;c(y,m)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(m){return new d(m.__language,m.__key)}constructor(m,y){super(y),this.__language=r(m)}createDOM(m){let y=document.createElement("code");return e.addClassNamesToElement(y,m.theme.code),y.setAttribute("spellcheck","false"),(m=this.getLanguage())&&y.setAttribute("data-highlight-language",m),y}updateDOM(m,y){let M=this.__language;return m=m.__language,M?M!==m&&y.setAttribute("data-highlight-language",M):m&&y.removeAttribute("data-highlight-language"),!1}exportDOM(){let m=document.createElement("pre");m.setAttribute("spellcheck","false");let y=this.getLanguage();return y&&m.setAttribute("data-highlight-language",y),{element:m}}static importDOM(){return{code:m=>m.textContent!=null&&(/\r?\n/.test(m.textContent)||c(m,"BR"))?{conversion:C,priority:1}:null,div:()=>({conversion:v,priority:1}),pre:()=>({conversion:C,priority:0}),table:m=>x(m)?{conversion:T,priority:3}:null,td:m=>{let y=m.closest("table");return m.classList.contains("js-file-line")?{conversion:R,priority:3}:y&&x(y)?{conversion:O,priority:3}:null},tr:m=>(m=m.closest("table"))&&x(m)?{conversion:O,priority:3}:null}}static importJSON(m){let y=g(m.language);return y.setFormat(m.format),y.setIndent(m.indent),y.setDirection(m.direction),y}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(m,y=!0){var M=this.getChildren(),Z=M.length;if(2<=Z&&M[Z-1].getTextContent()===`
88
+ `?ce.push(n.$createLineBreakNode()):ct===" "?ce.push(n.$createTabNode()):ct.length>0&&ce.push(q(ct,te))}}else{const{content:Le}=we;typeof Le=="string"?ce.push(...k([Le],we.type)):Array.isArray(Le)&&ce.push(...k(Le,we.type))}return ce}function m(re,te){const ce=n.$getNodeByKey(re);if(!N(ce)||!ce.isAttached())return;const we=n.$getSelection();if(!n.$isRangeSelection(we)){te();return}const Le=we.anchor,Be=Le.offset,Ye=Le.type==="element"&&n.$isLineBreakNode(ce.getChildAtIndex(Le.offset-1));let ct=0;if(!Ye){const dt=Le.getNode();ct=Be+dt.getPreviousSiblings().reduce((ve,ie)=>ve+ie.getTextContentSize(),0)}if(te()){if(Ye){Le.getNode().select(Be,Be);return}ce.getChildren().some(dt=>{const ve=n.$isTextNode(dt);if(ve||n.$isLineBreakNode(dt)){const ie=dt.getTextContentSize();if(ve&&ie>=ct)return dt.select(ct,ct),!0;ct-=ie}return!1})}}function y(re,te){let ce=0;for(;ce<re.length&&M(re[ce],te[ce]);)ce++;const we=re.length,Le=te.length,Be=Math.min(we,Le)-ce;let Ye=0;for(;Ye<Be;)if(Ye++,!M(re[we-Ye],te[Le-Ye])){Ye--;break}const ct=ce,yt=we-Ye,dt=te.slice(ce,Le-Ye);return{from:ct,nodesForReplacement:dt,to:yt}}function M(re,te){return me(re)&&me(te)&&re.__text===te.__text&&re.__highlightType===te.__highlightType||n.$isTabNode(re)&&n.$isTabNode(te)||n.$isLineBreakNode(re)&&n.$isLineBreakNode(te)}function Z(re){if(!n.$isRangeSelection(re))return!1;const te=re.anchor.getNode(),ce=re.focus.getNode();if(te.is(ce)&&N(te))return!0;const we=te.getParent();return N(we)&&we.is(ce.getParent())}function ae(re){const te=re.getNodes(),ce=[[]];if(te.length===1&&N(te[0]))return ce;let we=ce[0];for(let Le=0;Le<te.length;Le++){const Be=te[Le];if(!(me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Be)?Le!==0&&we.length>0&&(we=[],ce.push(we)):we.push(Be)}return ce}function he(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return null;const ce=re?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,we=re?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(ae(te).length>1)return ce;const Ye=te.getNodes()[0];if(!(N(Ye)||me(Ye)||n.$isTabNode(Ye)||n.$isLineBreakNode(Ye)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(N(Ye))return ce;const ct=_e(Ye),yt=pe(Ye),dt=te.anchor,ve=te.focus;let ie,fe;return ve.isBefore(dt)?(ie=ve,fe=dt):(ie=dt,fe=ve),ct!==null&&yt!==null&&ie.key===ct.getKey()&&ie.offset===0&&fe.key===yt.getKey()&&fe.offset===yt.getTextContentSize()?ce:we}function se(re){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!Z(te))return!1;const ce=ae(te),we=ce.length;if(ce.length>1){for(let ct=0;ct<we;ct++){const yt=ce[ct];if(yt.length>0){let dt=yt[0];ct===0&&(dt=_e(dt)),dt!==null&&(re===n.INDENT_CONTENT_COMMAND?dt.insertBefore(n.$createTabNode()):n.$isTabNode(dt)&&dt.remove())}}return!0}const Be=te.getNodes()[0];if(!(N(Be)||me(Be)||n.$isTabNode(Be)||n.$isLineBreakNode(Be)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(N(Be))return re===n.INDENT_CONTENT_COMMAND&&te.insertNodes([n.$createTabNode()]),!0;const Ye=_e(Be);if(Ye===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return re===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(Ye)?Ye.insertAfter(n.$createTabNode()):Ye.insertBefore(n.$createTabNode()):n.$isTabNode(Ye)&&Ye.remove(),!0}function Te(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.offset,Ye=Le.offset,ct=we.getNode(),yt=Le.getNode(),dt=re===n.KEY_ARROW_UP_COMMAND;if(!Z(ce)||!(me(ct)||n.$isTabNode(ct))||!(me(yt)||n.$isTabNode(yt)))return!1;if(!te.altKey){if(ce.isCollapsed()){const qe=ct.getParentOrThrow();if(dt&&Be===0&&ct.getPreviousSibling()===null){if(qe.getPreviousSibling()===null)return qe.selectPrevious(),te.preventDefault(),!0}else if(!dt&&Be===ct.getTextContentSize()&&ct.getNextSibling()===null&&qe.getNextSibling()===null)return qe.selectNext(),te.preventDefault(),!0}return!1}let ve,ie;if(ct.isBefore(yt)?(ve=_e(ct),ie=pe(yt)):(ve=_e(yt),ie=pe(ct)),ve==null||ie==null)return!1;const fe=ve.getNodesBetween(ie);for(let qe=0;qe<fe.length;qe++){const Qe=fe[qe];if(!me(Qe)&&!n.$isTabNode(Qe)&&!n.$isLineBreakNode(Qe))return!1}te.preventDefault(),te.stopPropagation();const Oe=dt?ve.getPreviousSibling():ie.getNextSibling();if(!n.$isLineBreakNode(Oe))return!0;const Re=dt?Oe.getPreviousSibling():Oe.getNextSibling();if(Re==null)return!0;const De=me(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)?dt?_e(Re):pe(Re):null;let We=De??Re;return Oe.remove(),fe.forEach(qe=>qe.remove()),re===n.KEY_ARROW_UP_COMMAND?(fe.forEach(qe=>We.insertBefore(qe)),We.insertBefore(Oe)):(We.insertAfter(Oe),We=Oe,fe.forEach(qe=>{We.insertAfter(qe),We=qe})),ce.setTextNodeRange(ct,Be,yt,Ye),!0}function be(re,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:we,focus:Le}=ce,Be=we.getNode(),Ye=Le.getNode(),ct=re===n.MOVE_TO_START;if(!(me(Be)||n.$isTabNode(Be))||!(me(Ye)||n.$isTabNode(Ye)))return!1;if(ct){const yt=K(Ye,Le.offset);if(yt!==null){const{node:dt,offset:ve}=yt;n.$isLineBreakNode(dt)?dt.selectNext(0,0):ce.setTextNodeRange(dt,ve,dt,ve)}else Ye.getParentOrThrow().selectStart()}else V(Ye).select();return te.preventDefault(),te.stopPropagation(),!0}function Ue(re,te){if(!re.hasNodes([g,j]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return te==null&&(te=ue),e.mergeRegister(re.registerMutationListener(g,ce=>{re.update(()=>{for(const[we,Le]of ce)if(Le!=="destroyed"){const Be=n.$getNodeByKey(we);Be!==null&&Y(Be,re)}})}),re.registerNodeTransform(g,ce=>Q(ce,re,te)),re.registerNodeTransform(n.TextNode,ce=>ne(ce,re,te)),re.registerNodeTransform(j,ce=>ne(ce,re,te)),re.registerCommand(n.KEY_TAB_COMMAND,ce=>{const we=he(ce.shiftKey);return we===null?!1:(ce.preventDefault(),re.dispatchCommand(we,void 0),!0)},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ce=n.$getSelection();return Z(ce)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),re.registerCommand(n.INDENT_CONTENT_COMMAND,ce=>se(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>se(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>Te(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>Te(n.KEY_ARROW_DOWN_COMMAND,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_END,ce=>be(n.MOVE_TO_END,ce),n.COMMAND_PRIORITY_LOW),re.registerCommand(n.MOVE_TO_START,ce=>be(n.MOVE_TO_START,ce),n.COMMAND_PRIORITY_LOW))}return An.$createCodeHighlightNode=q,An.$createCodeNode=p,An.$isCodeHighlightNode=me,An.$isCodeNode=N,An.CODE_LANGUAGE_FRIENDLY_NAME_MAP=W,An.CODE_LANGUAGE_MAP=B,An.CodeHighlightNode=j,An.CodeNode=g,An.DEFAULT_CODE_LANGUAGE=$,An.PrismTokenizer=ue,An.getCodeLanguages=le,An.getDefaultCodeLanguage=ee,An.getEndOfCodeInLine=V,An.getFirstCodeNodeOfLine=_e,An.getLanguageFriendlyName=X,An.getLastCodeNodeOfLine=pe,An.getStartOfCodeInLine=K,An.normalizeCodeLang=z,An.registerCodeHighlighting=Ue,An}var Mn={},rg;function $C(){if(rg)return Mn;rg=1;var t=Op();Dp(),Ap(),Mp(),Rp(),bp(),Lp(),kp(),Ip(),Pp(),$p(),Fp(),Bp(),Hp(),Wp();var e=on(),n=Bt();let r=k=>k!=null&&t.languages.hasOwnProperty(k)?k:void 0;function c(k,m){for(let y of k.childNodes){if(e.isHTMLElement(y)&&y.tagName===m)return!0;c(y,m)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(m){return new d(m.__language,m.__key)}constructor(m,y){super(y),this.__language=r(m)}createDOM(m){let y=document.createElement("code");return e.addClassNamesToElement(y,m.theme.code),y.setAttribute("spellcheck","false"),(m=this.getLanguage())&&y.setAttribute("data-highlight-language",m),y}updateDOM(m,y){let M=this.__language;return m=m.__language,M?M!==m&&y.setAttribute("data-highlight-language",M):m&&y.removeAttribute("data-highlight-language"),!1}exportDOM(){let m=document.createElement("pre");m.setAttribute("spellcheck","false");let y=this.getLanguage();return y&&m.setAttribute("data-highlight-language",y),{element:m}}static importDOM(){return{code:m=>m.textContent!=null&&(/\r?\n/.test(m.textContent)||c(m,"BR"))?{conversion:N,priority:1}:null,div:()=>({conversion:v,priority:1}),pre:()=>({conversion:N,priority:0}),table:m=>x(m)?{conversion:T,priority:3}:null,td:m=>{let y=m.closest("table");return m.classList.contains("js-file-line")?{conversion:b,priority:3}:y&&x(y)?{conversion:O,priority:3}:null},tr:m=>(m=m.closest("table"))&&x(m)?{conversion:O,priority:3}:null}}static importJSON(m){let y=g(m.language);return y.setFormat(m.format),y.setIndent(m.indent),y.setDirection(m.direction),y}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(m,y=!0){var M=this.getChildren(),Z=M.length;if(2<=Z&&M[Z-1].getTextContent()===`
89
89
  `&&M[Z-2].getTextContent()===`
90
- `&&m.isCollapsed()&&m.anchor.key===this.__key&&m.anchor.offset===Z)return M[Z-1].remove(),M[Z-2].remove(),m=n.$createParagraphNode(),this.insertAfter(m,y),m;let{anchor:ae,focus:he}=m;if(y=(ae.isBefore(he)?ae:he).getNode(),n.$isTextNode(y)){for(Z=X(y),M=[];;)if(n.$isTabNode(Z))M.push(n.$createTabNode()),Z=Z.getNextSibling();else if(z(Z)){for(var se=0,Te=Z.getTextContent(),be=Z.getTextContentSize();se<be&&Te[se]===" ";se++);if(se!==0&&M.push(B(" ".repeat(se))),se!==be)break;Z=Z.getNextSibling()}else break;Z=y.splitText(ae.offset)[0],se=ae.offset===0?0:1,se=Z.getIndexWithinParent()+se,Te=y.getParentOrThrow(),be=[n.$createLineBreakNode(),...M],Te.splice(se,0,be),(M=M[M.length-1])?M.select():ae.offset===0?Z.selectPrevious():Z.getNextSibling().selectNext(0,0)}return p(y)&&({offset:m}=m.anchor,y.splice(m,0,[n.$createLineBreakNode()]),y.select(m+1,m+1)),null}canIndent(){return!1}collapseAtStart(){let m=n.$createParagraphNode();return this.getChildren().forEach(y=>m.append(y)),this.replace(m),!0}setLanguage(m){this.getWritable().__language=r(m)}getLanguage(){return this.getLatest().__language}}function g(k){return n.$applyNodeReplacement(new d(k))}function p(k){return k instanceof d}function C(k){let m;return e.isHTMLElement(k)&&(m=k.getAttribute("data-highlight-language")),{node:g(m)}}function v(k){let m=k.style.fontFamily.match("monospace")!==null;return m||b(k)?{after:y=>{let M=k.parentNode;return M!=null&&k!==M.lastChild&&y.push(n.$createLineBreakNode()),y},node:m?g():null}:{node:null}}function T(){return{node:g()}}function O(){return{node:null}}function R(k){return{after:m=>(k.parentNode&&k.parentNode.nextSibling&&m.push(n.$createLineBreakNode()),m),node:null}}function b(k){for(k=k.parentElement;k!==null;){if(k.style.fontFamily.match("monospace")!==null)return!0;k=k.parentElement}return!1}function x(k){return k.classList.contains("js-file-line-container")}let w={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},$={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function W(k){return $[k]||k}class P extends n.TextNode{constructor(m,y,M){super(m,M),this.__highlightType=y}static getType(){return"code-highlight"}static clone(m){return new P(m.__text,m.__highlightType||void 0,m.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(m){let y=super.createDOM(m);return m=H(m.theme,this.__highlightType),e.addClassNamesToElement(y,m),y}updateDOM(m,y,M){let Z=super.updateDOM(m,y,M);return m=H(M.theme,m.__highlightType),M=H(M.theme,this.__highlightType),m!==M&&(m&&e.removeClassNamesFromElement(y,m),M&&e.addClassNamesToElement(y,M)),Z}static importJSON(m){let y=B(m.text,m.highlightType);return y.setFormat(m.format),y.setDetail(m.detail),y.setMode(m.mode),y.setStyle(m.style),y}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return g()}}function H(k,m){return m&&k&&k.codeHighlight&&k.codeHighlight[m]}function B(k,m){return n.$applyNodeReplacement(new P(k,m))}function z(k){return k instanceof P}function X(k){let m=k;for(;z(k)||n.$isTabNode(k);)m=k,k=k.getPreviousSibling();return m}function ee(k){let m=k;for(;z(k)||n.$isTabNode(k);)m=k,k=k.getNextSibling();return m}let le={defaultLanguage:"javascript",tokenize(k,m){return t.tokenize(k,t.languages[m||""]||t.languages[this.defaultLanguage])}};function j(k,m){let y=null;var M=null,Z=k;let ae=m,he=k.getTextContent();for(;;){if(ae===0){if(Z=Z.getPreviousSibling(),Z===null)break;if(!(z(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Z)){y={node:Z,offset:1};break}ae=Math.max(0,Z.getTextContentSize()-1),he=Z.getTextContent()}else ae--;let se=he[ae];z(Z)&&se!==" "&&(M={node:Z,offset:ae})}if(M!==null)return M;if(M=null,m<k.getTextContentSize()?z(k)&&(M=k.getTextContent()[m]):(Z=k.getNextSibling(),z(Z)&&(M=Z.getTextContent()[0])),M!==null&&M!==" ")return y;e:for(M=k,Z=k.getTextContent(),k=k.getTextContentSize();;){if(!z(M)||m===k){if(M=M.getNextSibling(),M===null||n.$isLineBreakNode(M)){k=null;break e}z(M)&&(m=0,Z=M.getTextContent(),k=M.getTextContentSize())}if(z(M)){if(Z[m]!==" "){k={node:M,offset:m};break e}m++}}return k!==null?k:y}function U(k){if(k=ee(k),n.$isLineBreakNode(k))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return k}function q(k,m,y){let M=k.getParent();p(M)?_e(M,m,y):z(k)&&k.replace(n.$createTextNode(k.__text))}let me=new Set;function _e(k,m,y){let M=k.getKey();me.has(M)||(me.add(M),k.getLanguage()===void 0&&k.setLanguage(y.defaultLanguage),m.update(()=>{ue(M,()=>{var Z=n.$getNodeByKey(M);if(!p(Z)||!Z.isAttached())return!1;var ae=Z.getTextContent();ae=y.tokenize(ae,Z.getLanguage()||y.defaultLanguage),ae=pe(ae);var he=Z.getChildren();for(Z=0;Z<he.length&&K(he[Z],ae[Z]);)Z++;var se=he.length;let Te=ae.length,be=Math.min(se,Te)-Z,Ue=0;for(;Ue<be;)if(Ue++,!K(he[se-Ue],ae[Te-Ue])){Ue--;break}he=Z,se-=Ue,ae=ae.slice(Z,Te-Ue);let{from:re,to:te,nodesForReplacement:ce}={from:he,nodesForReplacement:ae,to:se};return re!==te||ce.length?(k.splice(re,te-re,ce),!0):!1})},{onUpdate:()=>{me.delete(M)},skipTransforms:!0}))}function pe(k,m){let y=[];for(let M of k)if(typeof M=="string"){k=M.split(/(\n|\t)/);let Z=k.length;for(let ae=0;ae<Z;ae++){let he=k[ae];he===`
90
+ `&&m.isCollapsed()&&m.anchor.key===this.__key&&m.anchor.offset===Z)return M[Z-1].remove(),M[Z-2].remove(),m=n.$createParagraphNode(),this.insertAfter(m,y),m;let{anchor:ae,focus:he}=m;if(y=(ae.isBefore(he)?ae:he).getNode(),n.$isTextNode(y)){for(Z=X(y),M=[];;)if(n.$isTabNode(Z))M.push(n.$createTabNode()),Z=Z.getNextSibling();else if(z(Z)){for(var se=0,Te=Z.getTextContent(),be=Z.getTextContentSize();se<be&&Te[se]===" ";se++);if(se!==0&&M.push(B(" ".repeat(se))),se!==be)break;Z=Z.getNextSibling()}else break;Z=y.splitText(ae.offset)[0],se=ae.offset===0?0:1,se=Z.getIndexWithinParent()+se,Te=y.getParentOrThrow(),be=[n.$createLineBreakNode(),...M],Te.splice(se,0,be),(M=M[M.length-1])?M.select():ae.offset===0?Z.selectPrevious():Z.getNextSibling().selectNext(0,0)}return p(y)&&({offset:m}=m.anchor,y.splice(m,0,[n.$createLineBreakNode()]),y.select(m+1,m+1)),null}canIndent(){return!1}collapseAtStart(){let m=n.$createParagraphNode();return this.getChildren().forEach(y=>m.append(y)),this.replace(m),!0}setLanguage(m){this.getWritable().__language=r(m)}getLanguage(){return this.getLatest().__language}}function g(k){return n.$applyNodeReplacement(new d(k))}function p(k){return k instanceof d}function N(k){let m;return e.isHTMLElement(k)&&(m=k.getAttribute("data-highlight-language")),{node:g(m)}}function v(k){let m=k.style.fontFamily.match("monospace")!==null;return m||R(k)?{after:y=>{let M=k.parentNode;return M!=null&&k!==M.lastChild&&y.push(n.$createLineBreakNode()),y},node:m?g():null}:{node:null}}function T(){return{node:g()}}function O(){return{node:null}}function b(k){return{after:m=>(k.parentNode&&k.parentNode.nextSibling&&m.push(n.$createLineBreakNode()),m),node:null}}function R(k){for(k=k.parentElement;k!==null;){if(k.style.fontFamily.match("monospace")!==null)return!0;k=k.parentElement}return!1}function x(k){return k.classList.contains("js-file-line-container")}let w={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},P={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function H(k){return P[k]||k}class $ extends n.TextNode{constructor(m,y,M){super(m,M),this.__highlightType=y}static getType(){return"code-highlight"}static clone(m){return new $(m.__text,m.__highlightType||void 0,m.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(m){let y=super.createDOM(m);return m=W(m.theme,this.__highlightType),e.addClassNamesToElement(y,m),y}updateDOM(m,y,M){let Z=super.updateDOM(m,y,M);return m=W(M.theme,m.__highlightType),M=W(M.theme,this.__highlightType),m!==M&&(m&&e.removeClassNamesFromElement(y,m),M&&e.addClassNamesToElement(y,M)),Z}static importJSON(m){let y=B(m.text,m.highlightType);return y.setFormat(m.format),y.setDetail(m.detail),y.setMode(m.mode),y.setStyle(m.style),y}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return g()}}function W(k,m){return m&&k&&k.codeHighlight&&k.codeHighlight[m]}function B(k,m){return n.$applyNodeReplacement(new $(k,m))}function z(k){return k instanceof $}function X(k){let m=k;for(;z(k)||n.$isTabNode(k);)m=k,k=k.getPreviousSibling();return m}function ee(k){let m=k;for(;z(k)||n.$isTabNode(k);)m=k,k=k.getNextSibling();return m}let le={defaultLanguage:"javascript",tokenize(k,m){return t.tokenize(k,t.languages[m||""]||t.languages[this.defaultLanguage])}};function j(k,m){let y=null;var M=null,Z=k;let ae=m,he=k.getTextContent();for(;;){if(ae===0){if(Z=Z.getPreviousSibling(),Z===null)break;if(!(z(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Z)){y={node:Z,offset:1};break}ae=Math.max(0,Z.getTextContentSize()-1),he=Z.getTextContent()}else ae--;let se=he[ae];z(Z)&&se!==" "&&(M={node:Z,offset:ae})}if(M!==null)return M;if(M=null,m<k.getTextContentSize()?z(k)&&(M=k.getTextContent()[m]):(Z=k.getNextSibling(),z(Z)&&(M=Z.getTextContent()[0])),M!==null&&M!==" ")return y;e:for(M=k,Z=k.getTextContent(),k=k.getTextContentSize();;){if(!z(M)||m===k){if(M=M.getNextSibling(),M===null||n.$isLineBreakNode(M)){k=null;break e}z(M)&&(m=0,Z=M.getTextContent(),k=M.getTextContentSize())}if(z(M)){if(Z[m]!==" "){k={node:M,offset:m};break e}m++}}return k!==null?k:y}function U(k){if(k=ee(k),n.$isLineBreakNode(k))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return k}function q(k,m,y){let M=k.getParent();p(M)?_e(M,m,y):z(k)&&k.replace(n.$createTextNode(k.__text))}let me=new Set;function _e(k,m,y){let M=k.getKey();me.has(M)||(me.add(M),k.getLanguage()===void 0&&k.setLanguage(y.defaultLanguage),m.update(()=>{ue(M,()=>{var Z=n.$getNodeByKey(M);if(!p(Z)||!Z.isAttached())return!1;var ae=Z.getTextContent();ae=y.tokenize(ae,Z.getLanguage()||y.defaultLanguage),ae=pe(ae);var he=Z.getChildren();for(Z=0;Z<he.length&&K(he[Z],ae[Z]);)Z++;var se=he.length;let Te=ae.length,be=Math.min(se,Te)-Z,Ue=0;for(;Ue<be;)if(Ue++,!K(he[se-Ue],ae[Te-Ue])){Ue--;break}he=Z,se-=Ue,ae=ae.slice(Z,Te-Ue);let{from:re,to:te,nodesForReplacement:ce}={from:he,nodesForReplacement:ae,to:se};return re!==te||ce.length?(k.splice(re,te-re,ce),!0):!1})},{onUpdate:()=>{me.delete(M)},skipTransforms:!0}))}function pe(k,m){let y=[];for(let M of k)if(typeof M=="string"){k=M.split(/(\n|\t)/);let Z=k.length;for(let ae=0;ae<Z;ae++){let he=k[ae];he===`
91
91
  `||he===`\r
92
- `?y.push(n.$createLineBreakNode()):he===" "?y.push(n.$createTabNode()):0<he.length&&y.push(B(he,m))}}else({content:k}=M),typeof k=="string"?y.push(...pe([k],M.type)):Array.isArray(k)&&y.push(...pe(k,M.type));return y}function ue(k,m){if(k=n.$getNodeByKey(k),p(k)&&k.isAttached()){var y=n.$getSelection();if(n.$isRangeSelection(y)){y=y.anchor;var M=y.offset,Z=y.type==="element"&&n.$isLineBreakNode(k.getChildAtIndex(y.offset-1)),ae=0;if(!Z){let he=y.getNode();ae=M+he.getPreviousSiblings().reduce((se,Te)=>se+Te.getTextContentSize(),0)}m()&&(Z?y.getNode().select(M,M):k.getChildren().some(he=>{let se=n.$isTextNode(he);if(se||n.$isLineBreakNode(he)){let Te=he.getTextContentSize();if(se&&Te>=ae)return he.select(ae,ae),!0;ae-=Te}return!1}))}else m()}}function K(k,m){return z(k)&&z(m)&&k.__text===m.__text&&k.__highlightType===m.__highlightType||n.$isTabNode(k)&&n.$isTabNode(m)||n.$isLineBreakNode(k)&&n.$isLineBreakNode(m)}function D(k){if(!n.$isRangeSelection(k))return!1;var m=k.anchor.getNode();return k=k.focus.getNode(),m.is(k)&&p(m)?!0:(m=m.getParent(),p(m)&&m.is(k.getParent()))}function V(k){k=k.getNodes();let m=[[]];if(k.length===1&&p(k[0]))return m;let y=m[0];for(let M=0;M<k.length;M++){let Z=k[M];if(!(z(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Z)?M!==0&&0<y.length&&(y=[],m.push(y)):y.push(Z)}return m}function ne(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return null;let y=k?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(k=k?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<V(m).length)return y;var M=m.getNodes()[0];if(!(p(M)||z(M)||n.$isTabNode(M)||n.$isLineBreakNode(M)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(p(M))return y;let Z=X(M);M=ee(M);var ae=m.anchor;let he=m.focus;return he.isBefore(ae)?m=he:(m=ae,ae=he),Z!==null&&M!==null&&m.key===Z.getKey()&&m.offset===0&&ae.key===M.getKey()&&ae.offset===M.getTextContentSize()?y:k}function Y(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return!1;var y=V(m);let M=y.length;if(1<y.length){for(m=0;m<M;m++){var Z=y[m];0<Z.length&&(Z=Z[0],m===0&&(Z=X(Z)),Z!==null&&(k===n.INDENT_CONTENT_COMMAND?Z.insertBefore(n.$createTabNode()):n.$isTabNode(Z)&&Z.remove()))}return!0}if(y=m.getNodes()[0],!(p(y)||z(y)||n.$isTabNode(y)||n.$isLineBreakNode(y)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(p(y))return k===n.INDENT_CONTENT_COMMAND&&m.insertNodes([n.$createTabNode()]),!0;if(y=X(y),y===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return k===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(y)?y.insertAfter(n.$createTabNode()):y.insertBefore(n.$createTabNode()):n.$isTabNode(y)&&y.remove(),!0}function G(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:M,focus:Z}=y,ae=M.offset,he=Z.offset,se=M.getNode(),Te=Z.getNode();var be=k===n.KEY_ARROW_UP_COMMAND;if(!D(y)||!z(se)&&!n.$isTabNode(se)||!z(Te)&&!n.$isTabNode(Te))return!1;if(!m.altKey){if(y.isCollapsed()){if(k=se.getParentOrThrow(),be&&ae===0&&se.getPreviousSibling()===null){if(k.getPreviousSibling()===null)return k.selectPrevious(),m.preventDefault(),!0}else if(!be&&ae===se.getTextContentSize()&&se.getNextSibling()===null&&k.getNextSibling()===null)return k.selectNext(),m.preventDefault(),!0}return!1}let Ue;if(se.isBefore(Te)){var re=X(se);Ue=ee(Te)}else re=X(Te),Ue=ee(se);if(re==null||Ue==null)return!1;let te=re.getNodesBetween(Ue);for(let we=0;we<te.length;we++){let Le=te[we];if(!z(Le)&&!n.$isTabNode(Le)&&!n.$isLineBreakNode(Le))return!1}if(m.preventDefault(),m.stopPropagation(),m=be?re.getPreviousSibling():Ue.getNextSibling(),!n.$isLineBreakNode(m)||(re=be?m.getPreviousSibling():m.getNextSibling(),re==null))return!0;be=z(re)||n.$isTabNode(re)||n.$isLineBreakNode(re)?be?X(re):ee(re):null;let ce=be??re;return m.remove(),te.forEach(we=>we.remove()),k===n.KEY_ARROW_UP_COMMAND?(te.forEach(we=>ce.insertBefore(we)),ce.insertBefore(m)):(ce.insertAfter(m),ce=m,te.forEach(we=>{ce.insertAfter(we),ce=we})),y.setTextNodeRange(se,ae,Te,he),!0}function Q(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:M,focus:Z}=y;var ae=M.getNode();let he=Z.getNode();if(k=k===n.MOVE_TO_START,!z(ae)&&!n.$isTabNode(ae)||!z(he)&&!n.$isTabNode(he))return!1;if(k)if(ae=j(he,Z.offset),ae!==null){let{node:se,offset:Te}=ae;n.$isLineBreakNode(se)?se.selectNext(0,0):y.setTextNodeRange(se,Te,se,Te)}else he.getParentOrThrow().selectStart();else U(he).select();return m.preventDefault(),m.stopPropagation(),!0}return Mn.$createCodeHighlightNode=B,Mn.$createCodeNode=g,Mn.$isCodeHighlightNode=z,Mn.$isCodeNode=p,Mn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=w,Mn.CODE_LANGUAGE_MAP=$,Mn.CodeHighlightNode=P,Mn.CodeNode=d,Mn.DEFAULT_CODE_LANGUAGE="javascript",Mn.PrismTokenizer=le,Mn.getCodeLanguages=()=>Object.keys(t.languages).filter(k=>typeof t.languages[k]!="function").sort(),Mn.getDefaultCodeLanguage=()=>"javascript",Mn.getEndOfCodeInLine=U,Mn.getFirstCodeNodeOfLine=X,Mn.getLanguageFriendlyName=function(k){return k=W(k),w[k]||k},Mn.getLastCodeNodeOfLine=ee,Mn.getStartOfCodeInLine=j,Mn.normalizeCodeLang=W,Mn.registerCodeHighlighting=function(k,m){if(!k.hasNodes([d,P]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return m==null&&(m=le),e.mergeRegister(k.registerMutationListener(d,y=>{k.update(()=>{for(let[ae,he]of y)if(he!=="destroyed"){var M=n.$getNodeByKey(ae);if(M!==null)e:{var Z=M;if(M=k.getElementByKey(Z.getKey()),M===null)break e;Z=Z.getChildren();let se=Z.length;if(se===M.__cachedChildrenLength)break e;M.__cachedChildrenLength=se;let Te="1",be=1;for(let Ue=0;Ue<se;Ue++)n.$isLineBreakNode(Z[Ue])&&(Te+=`
93
- `+ ++be);M.setAttribute("data-gutter",Te)}}})}),k.registerNodeTransform(d,y=>_e(y,k,m)),k.registerNodeTransform(n.TextNode,y=>q(y,k,m)),k.registerNodeTransform(P,y=>q(y,k,m)),k.registerCommand(n.KEY_TAB_COMMAND,y=>{let M=ne(y.shiftKey);return M===null?!1:(y.preventDefault(),k.dispatchCommand(M,void 0),!0)},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INSERT_TAB_COMMAND,()=>{let y=n.$getSelection();return D(y)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_UP_COMMAND,y=>G(n.KEY_ARROW_UP_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_DOWN_COMMAND,y=>G(n.KEY_ARROW_DOWN_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_END,y=>Q(n.MOVE_TO_END,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_START,y=>Q(n.MOVE_TO_START,y),n.COMMAND_PRIORITY_LOW))},Mn}const FC=process.env.NODE_ENV==="development"?PC():$C();var ju=FC,Cd=Un();function BC(){const[t]=Cd.useLexicalComposerContext();return et.useEffect(()=>ju.registerCodeHighlighting(t),[t]),null}var ig=on(),Rn=Bt();function HC({src:t,altText:e,width:n,height:r,maxWidth:c}){const d=et.useMemo(()=>({height:r,width:n,maxWidth:c}),[r,n,c]);return at.jsx("img",{src:t,alt:e,style:d})}function Kp({altText:t,height:e,maxWidth:n=500,src:r,width:c,key:d}){return Rn.$applyNodeReplacement(new il(r,t,n,c,e,d))}function WC(t){return t instanceof il}class il extends Rn.DecoratorNode{constructor(n,r,c,d,g,p){super(p);Vn(this,"__src");Vn(this,"__altText");Vn(this,"__width");Vn(this,"__height");Vn(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=c,this.__width=d||"inherit",this.__height=g||"inherit"}static getType(){return"image"}static clone(n){return new il(n.__src,n.__altText,n.__maxWidth,n.__width,n.__height,n.__key)}getSrc(){return this.getLatest().__src}getAltText(){return this.getLatest().__altText}exportJSON(){return{altText:this.getAltText(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,src:this.getSrc(),type:"image",version:1,width:this.__width==="inherit"?0:this.__width}}static importJSON(n){return Kp(n)}createDOM(n){const r=document.createElement("span"),c=n.theme.image;return c&&(r.className=c),r}updateDOM(){return!1}decorate(){return at.jsx(HC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const KC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zC=t=>KC?(t||window).getSelection():null,zp=Rn.createCommand("INSERT_IMAGE_COMMAND");function UC(){const[t]=Cd.useLexicalComposerContext();return et.useEffect(()=>{if(!t.hasNodes([il]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ig.mergeRegister(t.registerCommand(zp,e=>{const n=Kp(e);return Rn.$insertNodes([n]),Rn.$isRootOrShadowRoot(n.getParentOrThrow())&&ig.$wrapNodeInElement(n,Rn.$createParagraphNode).selectEnd(),!0},Rn.COMMAND_PRIORITY_EDITOR),t.registerCommand(Rn.DRAGSTART_COMMAND,e=>GC(e),Rn.COMMAND_PRIORITY_HIGH),t.registerCommand(Rn.DRAGOVER_COMMAND,e=>YC(e),Rn.COMMAND_PRIORITY_LOW),t.registerCommand(Rn.DROP_COMMAND,e=>jC(e,t),Rn.COMMAND_PRIORITY_HIGH))},[t]),null}function GC(t){const e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=e;const r=Ed();if(!r)return!1;const c=t.dataTransfer;return c?(c.setData("text/plain","_"),c.setDragImage(n,0,0),c.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function YC(t){return Ed()?(Up(t)||t.preventDefault(),!0):!1}function jC(t,e){const n=Ed();if(!n)return!1;const r=VC(t);if(!r)return!1;if(t.preventDefault(),Up(t)){const c=qC(t);n.remove();const d=Rn.$createRangeSelection();c!=null&&d.applyDOMRange(c),Rn.$setSelection(d),e.dispatchCommand(zp,r)}return!0}function Ed(){const t=Rn.$getSelection();if(!Rn.$isNodeSelection(t))return null;const n=t.getNodes()[0];return WC(n)?n:null}function VC(t){var c;const e=(c=t.dataTransfer)==null?void 0:c.getData("application/x-lexical-drag");if(!e)return null;const{type:n,data:r}=JSON.parse(e);return n!=="image"?null:r}function Up(t){const e=t.target;return!!(e&&e instanceof HTMLElement&&!e.closest("code, span.yext-default-richtextv2-theme__image")&&e.parentElement)}function qC(t){let e;const n=t.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,c=zC(r);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&c!==null)c.collapse(t.rangeParent,t.rangeOffset||0),e=c.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var as=_d();function ZC(t){const e=t.getNodes();return e.length===0?new Set([t.anchor.getNode().getParentOrThrow(),t.focus.getNode().getParentOrThrow()]):new Set(e.map(n=>Rn.$isElementNode(n)?n:n.getParentOrThrow()))}const JC=3;function XC(t){const e=Rn.$getSelection();if(!Rn.$isRangeSelection(e))return!1;const n=ZC(e);let r=0;for(const c of n)if(as.$isListNode(c))r=Math.max(as.$getListDepth(c)+1,r);else if(as.$isListItemNode(c)){const d=c.getParent();if(!as.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(as.$getListDepth(d)+1,r)}return r<=t}function QC({maxDepth:t}){const[e]=Cd.useLexicalComposerContext();return et.useEffect(()=>e.registerCommand(Rn.INDENT_CONTENT_COMMAND,()=>!XC(t||7),JC),[e,t]),null}var Ou=Nd(),og=yd(),sg=md(),Kl={},lg;function eE(){if(lg)return Kl;lg=1;var t=on(),e=Bt();class n extends e.TextNode{static getType(){return"hashtag"}static clone(g){return new n(g.__text,g.__key)}constructor(g,p){super(g,p)}createDOM(g){const p=super.createDOM(g);return t.addClassNamesToElement(p,g.theme.hashtag),p}static importJSON(g){const p=r(g.text);return p.setFormat(g.format),p.setDetail(g.detail),p.setMode(g.mode),p.setStyle(g.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return e.$applyNodeReplacement(new n(d))}function c(d){return d instanceof n}return Kl.$createHashtagNode=r,Kl.$isHashtagNode=c,Kl.HashtagNode=n,Kl}var zl={},ag;function tE(){if(ag)return zl;ag=1;var t=on(),e=Bt();class n extends e.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,g){super(d,g)}createDOM(d){let g=super.createDOM(d);return t.addClassNamesToElement(g,d.theme.hashtag),g}static importJSON(d){let g=r(d.text);return g.setFormat(d.format),g.setDetail(d.detail),g.setMode(d.mode),g.setStyle(d.style),g}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(c=""){return e.$applyNodeReplacement(new n(c))}return zl.$createHashtagNode=r,zl.$isHashtagNode=function(c){return c instanceof n},zl.HashtagNode=n,zl}const nE=process.env.NODE_ENV==="development"?eE():tE();var rE=nE;const iE="_rtl_13v3w_295",oE="_selected_13v3w_370",lt={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__ul":"_yext-default-richtextv2-theme__ul_13v3w_17","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271",rtl:iE,"yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366",selected:oE,"yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},sE={characterLimit:lt["yext-default-richtextv2-theme__characterLimit"],code:lt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:lt["yext-default-richtextv2-theme__tokenAttr"],attr:lt["yext-default-richtextv2-theme__tokenAttr"],boolean:lt["yext-default-richtextv2-theme__tokenProperty"],builtin:lt["yext-default-richtextv2-theme__tokenSelector"],cdata:lt["yext-default-richtextv2-theme__tokenComment"],char:lt["yext-default-richtextv2-theme__tokenSelector"],class:lt["yext-default-richtextv2-theme__tokenFunction"],"class-name":lt["yext-default-richtextv2-theme__tokenFunction"],comment:lt["yext-default-richtextv2-theme__tokenComment"],constant:lt["yext-default-richtextv2-theme__tokenProperty"],deleted:lt["yext-default-richtextv2-theme__tokenProperty"],doctype:lt["yext-default-richtextv2-theme__tokenComment"],entity:lt["yext-default-richtextv2-theme__tokenOperator"],function:lt["yext-default-richtextv2-theme__tokenFunction"],important:lt["yext-default-richtextv2-theme__tokenVariable"],inserted:lt["yext-default-richtextv2-theme__tokenSelector"],keyword:lt["yext-default-richtextv2-theme__tokenAttr"],namespace:lt["yext-default-richtextv2-theme__tokenVariable"],number:lt["yext-default-richtextv2-theme__tokenProperty"],operator:lt["yext-default-richtextv2-theme__tokenOperator"],prolog:lt["yext-default-richtextv2-theme__tokenComment"],property:lt["yext-default-richtextv2-theme__tokenProperty"],punctuation:lt["yext-default-richtextv2-theme__tokenPunctuation"],regex:lt["yext-default-richtextv2-theme__tokenVariable"],selector:lt["yext-default-richtextv2-theme__tokenSelector"],string:lt["yext-default-richtextv2-theme__tokenSelector"],symbol:lt["yext-default-richtextv2-theme__tokenProperty"],tag:lt["yext-default-richtextv2-theme__tokenProperty"],url:lt["yext-default-richtextv2-theme__tokenOperator"],variable:lt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:lt["yext-default-richtextv2-theme__embedBlock"],focus:lt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:lt["yext-default-richtextv2-theme__hashtag"],heading:{h1:lt["yext-default-richtextv2-theme__h1"],h2:lt["yext-default-richtextv2-theme__h2"],h3:lt["yext-default-richtextv2-theme__h3"],h4:lt["yext-default-richtextv2-theme__h4"],h5:lt["yext-default-richtextv2-theme__h5"],h6:lt["yext-default-richtextv2-theme__h6"]},image:lt["yext-default-richtextv2-theme__image"],link:lt["yext-default-richtextv2-theme__link"],list:{listitem:lt["yext-default-richtextv2-theme__listItem"],listitemChecked:lt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:lt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:lt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[lt["yext-default-richtextv2-theme__ol1"],lt["yext-default-richtextv2-theme__ol2"],lt["yext-default-richtextv2-theme__ol3"],lt["yext-default-richtextv2-theme__ol4"],lt["yext-default-richtextv2-theme__ol5"]],ulDepth:[lt["yext-default-richtextv2-theme__ul1"],lt["yext-default-richtextv2-theme__ul2"],lt["yext-default-richtextv2-theme__ul3"]]},ltr:lt["yext-default-richtextv2-theme__ltr"],mark:lt["yext-default-richtextv2-theme__mark"],markOverlap:lt["yext-default-richtextv2-theme__markOverlap"],paragraph:lt["yext-default-richtextv2-theme__paragraph"],quote:lt["yext-default-richtextv2-theme__quote"],rtl:lt["yext-default-richtextv2-theme__rtl"],table:lt["yext-default-richtextv2-theme__table"],tableCell:lt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:lt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:lt["yext-default-richtextv2-theme__textBold"],code:lt["yext-default-richtextv2-theme__textCode"],italic:lt["yext-default-richtextv2-theme__textItalic"],strikethrough:lt["yext-default-richtextv2-theme__textStrikethrough"],subscript:lt["yext-default-richtextv2-theme__textSubscript"],superscript:lt["yext-default-richtextv2-theme__textSuperscript"],underline:lt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:lt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Us={},Du={},cg;function lE(){if(cg)return Du;cg=1;var t=Un(),e=Bt(),n=et;function r(d,g){return d.getEditorState().read(()=>{const p=e.$getNodeByKey(g);return p===null?!1:p.isSelected()})}function c(d){const[g]=t.useLexicalComposerContext(),[p,C]=n.useState(()=>r(g,d));n.useEffect(()=>{let O=!0;const R=g.registerUpdateListener(()=>{O&&C(r(g,d))});return()=>{O=!1,R()}},[g,d]);const v=n.useCallback(O=>{g.update(()=>{let R=e.$getSelection();e.$isNodeSelection(R)||(R=e.$createNodeSelection(),e.$setSelection(R)),e.$isNodeSelection(R)&&(O?R.add(d):R.delete(d))})},[g,d]),T=n.useCallback(()=>{g.update(()=>{const O=e.$getSelection();e.$isNodeSelection(O)&&O.clear()})},[g]);return[p,v,T]}return Du.useLexicalNodeSelection=c,Du}var Au={},ug;function aE(){if(ug)return Au;ug=1;var t=Un(),e=Bt(),n=et;function r(c,d){return c.getEditorState().read(()=>{let g=e.$getNodeByKey(d);return g===null?!1:g.isSelected()})}return Au.useLexicalNodeSelection=function(c){let[d]=t.useLexicalComposerContext(),[g,p]=n.useState(()=>r(d,c));n.useEffect(()=>{let T=!0,O=d.registerUpdateListener(()=>{T&&p(r(d,c))});return()=>{T=!1,O()}},[d,c]);let C=n.useCallback(T=>{d.update(()=>{let O=e.$getSelection();e.$isNodeSelection(O)||(O=e.$createNodeSelection(),e.$setSelection(O)),e.$isNodeSelection(O)&&(T?O.add(c):O.delete(c))})},[d,c]),v=n.useCallback(()=>{d.update(()=>{const T=e.$getSelection();e.$isNodeSelection(T)&&T.clear()})},[d]);return[g,C,v]},Au}var Mu,dg;function Gp(){return dg||(dg=1,Mu=process.env.NODE_ENV==="development"?lE():aE()),Mu}var fg;function cE(){if(fg)return Us;fg=1;var t=Un(),e=Gp(),n=on(),r=Bt(),c=et;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){const[R]=t.useLexicalComposerContext(),[b,x,w]=e.useLexicalNodeSelection(O),$=c.useCallback(W=>{if(b&&r.$isNodeSelection(r.$getSelection())){W.preventDefault();const P=r.$getNodeByKey(O);T(P)&&P.remove()}return!1},[b,O]);return c.useEffect(()=>n.mergeRegister(R.registerCommand(r.CLICK_COMMAND,W=>{const P=R.getElementByKey(O);return W.target===P?(W.shiftKey||w(),x(!b),!0):!1},r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_DELETE_COMMAND,$,r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_BACKSPACE_COMMAND,$,r.COMMAND_PRIORITY_LOW)),[w,R,b,O,$,x]),c.useEffect(()=>{const W=R.getElementByKey(O);W!==null&&(W.className=b?"selected":"")},[R,b,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(R){return new p(R.__key)}static importJSON(R){return v()}static importDOM(){return{hr:()=>({conversion:C,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
94
- `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function C(){return{node:v()}}function v(){return r.$applyNodeReplacement(new p)}function T(O){return O instanceof p}return Us.$createHorizontalRuleNode=v,Us.$isHorizontalRuleNode=T,Us.HorizontalRuleNode=p,Us.INSERT_HORIZONTAL_RULE_COMMAND=d,Us}var Gs={},hg;function uE(){if(hg)return Gs;hg=1;var t=Un(),e=Gp(),n=on(),r=Bt(),c=et;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){let[R]=t.useLexicalComposerContext(),[b,x,w]=e.useLexicalNodeSelection(O),$=c.useCallback(W=>(b&&r.$isNodeSelection(r.$getSelection())&&(W.preventDefault(),W=r.$getNodeByKey(O),T(W)&&W.remove()),!1),[b,O]);return c.useEffect(()=>n.mergeRegister(R.registerCommand(r.CLICK_COMMAND,W=>{let P=R.getElementByKey(O);return W.target===P?(W.shiftKey||w(),x(!b),!0):!1},r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_DELETE_COMMAND,$,r.COMMAND_PRIORITY_LOW),R.registerCommand(r.KEY_BACKSPACE_COMMAND,$,r.COMMAND_PRIORITY_LOW)),[w,R,b,O,$,x]),c.useEffect(()=>{let W=R.getElementByKey(O);W!==null&&(W.className=b?"selected":"")},[R,b,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(R){return new p(R.__key)}static importJSON(){return v()}static importDOM(){return{hr:()=>({conversion:C,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
95
- `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function C(){return{node:v()}}function v(){return r.$applyNodeReplacement(new p)}function T(O){return O instanceof p}return Gs.$createHorizontalRuleNode=v,Gs.$isHorizontalRuleNode=T,Gs.HorizontalRuleNode=p,Gs.INSERT_HORIZONTAL_RULE_COMMAND=d,Gs}const dE=process.env.NODE_ENV==="development"?cE():uE();var fE=dE;function hE(t,e){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:t,theme:e??sE,nodes:[sg.HeadingNode,rE.HashtagNode,il,as.ListNode,as.ListItemNode,sg.QuoteNode,ju.CodeNode,ju.CodeHighlightNode,Ou.TableNode,Ou.TableCellNode,Ou.TableRowNode,og.AutoLinkNode,og.LinkNode,fE.HorizontalRuleNode]}}const Ru={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function gE({serializedAST:t,nodeClassNames:e}){return at.jsx(KN.LexicalComposer,{initialConfig:hE(t,e),children:at.jsx("div",{className:`${Ru["editor-inner"]} ${Ru["no-border"]}`,children:at.jsxs("div",{className:Ru["editor-inner"],children:[at.jsx(aC.RichTextPlugin,{contentEditable:at.jsx(fC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:_C,placeholder:at.jsx("div",{})}),at.jsx(BC,{}),at.jsx(xC.ListPlugin,{}),at.jsx(AC.LinkPlugin,{}),at.jsx(IC.TablePlugin,{}),at.jsx(UC,{}),at.jsx(QC,{maxDepth:7})]})})})}function mc(t,e,n,r){const c=t.length;let d=0,g;if(e<0?e=-e>c?0:c+e:e=e>c?c:e,n=n>0?n:0,r.length<1e4)g=Array.from(r),g.unshift(e,n),[].splice.apply(t,g);else for(n&&[].splice.apply(t,[e,n]);d<r.length;)g=r.slice(d,d+1e4),g.unshift(e,0),[].splice.apply(t,g),d+=1e4,e+=1e4}function Vs(t,e){return t.length>0?(mc(t,t.length,0,e),t):e}const gg={}.hasOwnProperty;function Yp(t){const e={};let n=-1;for(;++n<t.length;)pE(e,t[n]);return e}function pE(t,e){let n;for(n in e){const c=(gg.call(t,n)?t[n]:void 0)||(t[n]={}),d=e[n];let g;for(g in d){gg.call(c,g)||(c[g]=[]);const p=d[g];mE(c[g],Array.isArray(p)?p:p?[p]:[])}}}function mE(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);mc(t,0,0,r)}const eo={plusSign:43,caret:94,tilde:126};var pg=Object.prototype.hasOwnProperty;function mg(t,e,n){for(n of t.keys())if(Zl(n,e))return n}function Zl(t,e){var n,r,c;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Zl(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(c=r,c&&typeof c=="object"&&(c=mg(e,c),!c)||!e.has(c))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(c=r[0],c&&typeof c=="object"&&(c=mg(e,c),!c)||!Zl(r[1],e.get(c)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(pg.call(t,n)&&++r&&!pg.call(e,n)||!(n in e)||!Zl(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}let Vu,jp,Vp,qp,Zp=!0;typeof process<"u"&&({FORCE_COLOR:Vu,NODE_DISABLE_COLORS:jp,NO_COLOR:Vp,TERM:qp}=process.env||{},Zp=process.stdout&&process.stdout.isTTY);const zt={enabled:!jp&&Vp==null&&qp!=="dumb"&&(Vu!=null&&Vu!=="0"||Zp),reset:un(0,0),bold:un(1,22),dim:un(2,22),italic:un(3,23),underline:un(4,24),inverse:un(7,27),hidden:un(8,28),strikethrough:un(9,29),black:un(30,39),red:un(31,39),green:un(32,39),yellow:un(33,39),blue:un(34,39),magenta:un(35,39),cyan:un(36,39),white:un(37,39),gray:un(90,39),grey:un(90,39),bgBlack:un(40,49),bgRed:un(41,49),bgGreen:un(42,49),bgYellow:un(43,49),bgBlue:un(44,49),bgMagenta:un(45,49),bgCyan:un(46,49),bgWhite:un(47,49)};function _g(t,e){let n=0,r,c="",d="";for(;n<t.length;n++)r=t[n],c+=r.open,d+=r.close,~e.indexOf(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return c+e+d}function _E(t,e){let n={has:t,keys:e};return n.reset=zt.reset.bind(n),n.bold=zt.bold.bind(n),n.dim=zt.dim.bind(n),n.italic=zt.italic.bind(n),n.underline=zt.underline.bind(n),n.inverse=zt.inverse.bind(n),n.hidden=zt.hidden.bind(n),n.strikethrough=zt.strikethrough.bind(n),n.black=zt.black.bind(n),n.red=zt.red.bind(n),n.green=zt.green.bind(n),n.yellow=zt.yellow.bind(n),n.blue=zt.blue.bind(n),n.magenta=zt.magenta.bind(n),n.cyan=zt.cyan.bind(n),n.white=zt.white.bind(n),n.gray=zt.gray.bind(n),n.grey=zt.grey.bind(n),n.bgBlack=zt.bgBlack.bind(n),n.bgRed=zt.bgRed.bind(n),n.bgGreen=zt.bgGreen.bind(n),n.bgYellow=zt.bgYellow.bind(n),n.bgBlue=zt.bgBlue.bind(n),n.bgMagenta=zt.bgMagenta.bind(n),n.bgCyan=zt.bgCyan.bind(n),n.bgWhite=zt.bgWhite.bind(n),n}function un(t,e){let n={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(n)),r===void 0?this:zt.enabled?_g(this.keys,r+""):r+""):r===void 0?_E([t],[n]):zt.enabled?_g([n],r+""):r+""}}function Ro(){}Ro.prototype={diff:function(e,n){var r,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=c.callback;typeof c=="function"&&(d=c,c={}),this.options=c;var g=this;function p(B){return d?(setTimeout(function(){d(void 0,B)},0),!0):B}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var C=n.length,v=e.length,T=1,O=C+v;c.maxEditLength&&(O=Math.min(O,c.maxEditLength));var R=(r=c.timeout)!==null&&r!==void 0?r:1/0,b=Date.now()+R,x=[{oldPos:-1,lastComponent:void 0}],w=this.extractCommon(x[0],n,e,0);if(x[0].oldPos+1>=v&&w+1>=C)return p([{value:this.join(n),count:n.length}]);var $=-1/0,W=1/0;function P(){for(var B=Math.max($,-T);B<=Math.min(W,T);B+=2){var z=void 0,X=x[B-1],ee=x[B+1];X&&(x[B-1]=void 0);var le=!1;if(ee){var j=ee.oldPos-B;le=ee&&0<=j&&j<C}var U=X&&X.oldPos+1<v;if(!le&&!U){x[B]=void 0;continue}if(!U||le&&X.oldPos+1<ee.oldPos?z=g.addToPath(ee,!0,void 0,0):z=g.addToPath(X,void 0,!0,1),w=g.extractCommon(z,n,e,B),z.oldPos+1>=v&&w+1>=C)return p(yE(g,z.lastComponent,n,e,g.useLongestToken));x[B]=z,z.oldPos+1>=v&&(W=Math.min(W,B-1)),w+1>=C&&($=Math.max($,B+1))}T++}if(d)(function B(){setTimeout(function(){if(T>O||Date.now()>b)return d();P()||B()},0)})();else for(;T<=O&&Date.now()<=b;){var H=P();if(H)return H}},addToPath:function(e,n,r,c){var d=e.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:e.oldPos+c,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:e.oldPos+c,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(e,n,r,c){for(var d=n.length,g=r.length,p=e.oldPos,C=p-c,v=0;C+1<d&&p+1<g&&this.equals(n[C+1],r[p+1]);)C++,p++,v++;return v&&(e.lastComponent={count:v,previousComponent:e.lastComponent}),e.oldPos=p,C},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function yE(t,e,n,r,c){for(var d=[],g;e;)d.push(e),g=e.previousComponent,delete e.previousComponent,e=g;d.reverse();for(var p=0,C=d.length,v=0,T=0;p<C;p++){var O=d[p];if(O.removed){if(O.value=t.join(r.slice(T,T+O.count)),T+=O.count,p&&d[p-1].added){var b=d[p-1];d[p-1]=d[p],d[p]=b}}else{if(!O.added&&c){var R=n.slice(v,v+O.count);R=R.map(function(w,$){var W=r[T+$];return W.length>w.length?W:w}),O.value=t.join(R)}else O.value=t.join(n.slice(v,v+O.count));v+=O.count,O.added||(T+=O.count)}}var x=d[C-1];return C>1&&typeof x.value=="string"&&(x.added||x.removed)&&t.equals("",x.value)&&(d[C-2].value+=x.value,d.pop()),d}var yg=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Ng=/\S/,Jp=new Ro;Jp.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!Ng.test(t)&&!Ng.test(e)};Jp.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&yg.test(e[n])&&yg.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var Xp=new Ro;Xp.tokenize=function(t){this.options.stripTrailingCr&&(t=t.replace(/\r\n/g,`
96
- `));var e=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var c=n[r];r%2&&!this.options.newlineIsToken?e[e.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),e.push(c))}return e};var NE=new Ro;NE.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var CE=new Ro;CE.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};function rc(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rc=function(e){return typeof e}:rc=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rc(t)}var EE=Object.prototype.toString,Xl=new Ro;Xl.useLongestToken=!0;Xl.tokenize=Xp.tokenize;Xl.castInput=function(t){var e=this.options,n=e.undefinedReplacement,r=e.stringifyReplacer,c=r===void 0?function(d,g){return typeof g>"u"?n:g}:r;return typeof t=="string"?t:JSON.stringify(qu(t,null,null,c),c," ")};Xl.equals=function(t,e){return Ro.prototype.equals.call(Xl,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function qu(t,e,n,r,c){e=e||[],n=n||[],r&&(t=r(c,t));var d;for(d=0;d<e.length;d+=1)if(e[d]===t)return n[d];var g;if(EE.call(t)==="[object Array]"){for(e.push(t),g=new Array(t.length),n.push(g),d=0;d<t.length;d+=1)g[d]=qu(t[d],e,n,r,c);return e.pop(),n.pop(),g}if(t&&t.toJSON&&(t=t.toJSON()),rc(t)==="object"&&t!==null){e.push(t),g={},n.push(g);var p=[],C;for(C in t)t.hasOwnProperty(C)&&p.push(C);for(p.sort(),d=0;d<p.length;d+=1)C=p[d],g[C]=qu(t[C],e,n,r,C);e.pop(),n.pop()}else g=t;return g}var Zu=new Ro;Zu.tokenize=function(t){return t.slice()};Zu.join=Zu.removeEmpty=function(t){return t};zt.red,zt.grey,zt.green;zt.dim().italic;zt.dim("→");zt.dim("·");zt.dim("↵");function lc(t){t=t.replace(/\r?\n/g,`
97
- `);let e=t.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,c=(e||[]).length;for(;n<c;n++)r=Math.min(r,e[n].length);return c&&r?t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):t}class TE extends Error{constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}}function Zr(t,e,n,r,c,d,g){if(t)return;let p=g||d;if(g instanceof Error)throw g;let C=c;throw new TE({actual:e,expects:n,operator:r,message:p,details:C,generated:!g})}function _c(t,e){Zr(!!t,!1,!0,"ok",!1,"Expected value to be truthy",e)}function to(t,e){Zr(!t,!0,!1,"not",!1,"Expected value to be falsey",e)}to.ok=to;to.equal=function(t,e,n){Zr(!Zl(t,e),t,e,"not.equal",!1,"Expected values not to be deeply equal",n)};to.type=function(t,e,n){let r=typeof t;Zr(r!==e,r,e,"not.type",!1,`Expected "${r}" not to be "${e}"`,n)};to.instance=function(t,e,n){let r="`"+(e.name||e.constructor.name)+"`";Zr(!(t instanceof e),t,e,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};to.snapshot=function(t,e,n){t=lc(t),e=lc(e),Zr(t!==e,t,e,"not.snapshot",!1,"Expected value not to match snapshot",n)};to.fixture=function(t,e,n){t=lc(t),e=lc(e),Zr(t!==e,t,e,"not.fixture",!1,"Expected value not to match fixture",n)};to.match=function(t,e,n){typeof e=="string"?Zr(!t.includes(e),t,e,"not.match",!1,`Expected value not to include "${e}" substring`,n):Zr(!e.test(t),t,e,"not.match",!1,`Expected value not to match \`${String(e)}\` pattern`,n)};to.throws=function(t,e,n){!n&&typeof e=="string"&&(n=e,e=null);try{t()}catch(r){typeof e=="function"?Zr(!e(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):e instanceof RegExp?Zr(!e.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(e)}\` pattern`,n):e||Zr(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const xE=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,vE=bo(/[A-Za-z]/),Ju=bo(/[\dA-Za-z]/),SE=bo(/[#-'*+\--9=?A-Z^-~]/);function wE(t){return t!==null&&(t<32||t===127)}const OE=bo(/\d/),DE=bo(/[\dA-Fa-f]/),AE=bo(/[!-/:-@[-`{-~]/);function ME(t){return t!==null&&t<-2}function Qp(t){return t!==null&&(t<0||t===32)}function RE(t){return t===-2||t===-1||t===32}const bE=bo(xE),LE=bo(/\s/);function bo(t){return e;function e(n){return n!==null&&t.test(String.fromCharCode(n))}}function Ql(t){if(t===null||Qp(t)||LE(t))return 1;if(bE(t))return 2}const ac={characterGroupPunctuation:2};function kE(t,e){const n=this.previous,r=Ql(n);return c;function c(g){return _c(g===eo.tilde,"expected `~`"),t.enter("tildeSequenceTemporary"),d(g)}function d(g){if(g===eo.tilde)return t.consume(g),d;const p=t.exit("tildeSequenceTemporary"),C=Ql(g);return p._open=!C||C===ac.characterGroupPunctuation&&!!r,p._close=!r||r===ac.characterGroupPunctuation&&!!C,e(g)}}function em(t,e,n){const r=[];let c=-1;for(;++c<t.length;){const d=t[c].resolveAll;d&&!r.includes(d)&&(e=d(e,n),r.push(d))}return e}const IE={data:"data"};function Td(t,e){return!!(t[0]==="enter"&&t[1].type===`${e}SequenceTemporary`&&t[1]._close)}function xd(t,e){return!!(t[0]==="exit"&&t[1].type===`${e}SequenceTemporary`&&t[1]._open)}function vd(t,e,n,r,c,d){const[g,p,C,v]=PE(t[e],t[n],c,d);t[e][1].end=Object.assign({},g.start),t[n][1].start=Object.assign({},p.end);let T=[];t[e][1].end.offset-t[e][1].start.offset&&(T=Vs(T,[["enter",t[e][1],r],["exit",t[e][1],r]])),T=Vs(T,[["enter",v,r],["enter",g,r],["exit",g,r],["enter",C,r]]),T=Vs(T,em(r.parser.constructs.insideSpan.null,t.slice(e+1,n),r)),T=Vs(T,[["exit",C,r],["enter",p,r],["exit",p,r],["exit",v,r]]);let O=0;return t[n][1].end.offset-t[n][1].start.offset&&(O=2,T=Vs(T,[["enter",t[n][1],r],["exit",t[n][1],r]])),mc(t,e-1,n-e+3,T),e+T.length-O-2}function PE(t,e,n,r){const c=Object.assign({},t[1].end),d=Object.assign({},e[1].start);Cg(c,-r),Cg(d,r);const g={type:`${n}Sequence`,start:c,end:Object.assign({},t[1].end)},p={type:`${n}Sequence`,start:Object.assign({},e[1].start),end:d},C={type:`${n}Text`,start:Object.assign({},t[1].end),end:Object.assign({},e[1].start)},v={type:`${n}`,start:Object.assign({},g.start),end:Object.assign({},p.end)};return[g,p,C,v]}function Cg(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}function Sd(t,e){t.forEach(n=>{n[1].type===`${e}SequenceTemporary`&&(n[1].type=IE.data)})}function $E(t,e){let n=-1;for(;++n<t.length;)if(Td(t[n],"tilde")){let r=n;for(;r--;)if(xd(t[r],"tilde")){const c=FE(t[r],t[n]);n=vd(t,r,n,e,c===1?"subscript":"strikethrough",c);break}}return Sd(t,"tilde"),t}function FE(t,e){const n=t[1].end.offset-t[1].start.offset,r=e[1].end.offset-e[1].start.offset;return n<3||r<3?r<n?r:n:r%2===0?2:1}function BE(){const t={tokenize:kE,resolveAll:$E};return{text:{[eo.tilde]:t},insideSpan:{null:[t]}}}function HE(t,e){let n=-1;for(;++n<t.length;)if(Td(t[n],"superscript")){let r=n;for(;r--;)if(xd(t[r],"superscript")){n=vd(t,r,n,e,"superscript",1);break}}return Sd(t,"superscript"),t}function WE(t,e){return n;function n(c){return _c(c===eo.caret,"expected `^`"),t.enter("superscriptSequenceTemporary"),r(c)}function r(c){if(c===eo.caret)return t.consume(c),r;const d=t.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,e(c)}}function KE(){const t={tokenize:WE,resolveAll:HE};return{text:{[eo.caret]:t},insideSpan:{null:[t]}}}function zE(t,e,n){const r=this.previous,c=Ql(r);let d=0;return g;function g(C){return _c(C===eo.plusSign,"expected `+`"),t.enter("underlineSequenceTemporary"),p(C)}function p(C){if(C===eo.plusSign)return t.consume(C),d++,p;if(d<2)return n(C);const v=t.exit("underlineSequenceTemporary"),T=Ql(C);return v._open=!T||T===ac.characterGroupPunctuation&&!!c,v._close=!c||c===ac.characterGroupPunctuation&&!!T,e(C)}}function UE(t,e){let n=-1;for(;++n<t.length;)if(Td(t[n],"underline")&&t[n][1].end.offset-t[n][1].start.offset>1){let r=n;for(;r--;)if(xd(t[r],"underline")&&t[r][1].end.offset-t[r][1].start.offset>1){n=vd(t,r,n,e,"underline",2);break}}return Sd(t,"underline"),t}function GE(){const t={tokenize:zE,resolveAll:UE};return{text:{[eo.plusSign]:t},insideSpan:{null:[t]}}}function YE(){return Yp([GE(),KE(),BE()])}const jE={canContainEols:["strikethrough"],enter:{strikethrough:VE},exit:{strikethrough:qE}};function VE(t){this.enter({type:"strikethrough",children:[]},t)}function qE(t){this.exit(t)}const ZE={canContainEols:["subscript"],enter:{subscript:JE},exit:{subscript:XE}};function JE(t){this.enter({type:"subscript",children:[]},t)}function XE(t){this.exit(t)}const QE={canContainEols:["superscript"],enter:{superscript:eT},exit:{superscript:tT}};function eT(t){this.enter({type:"superscript",children:[]},t)}function tT(t){this.exit(t)}const nT={canContainEols:["underline"],enter:{underline:rT},exit:{underline:iT}};function rT(t){this.enter({type:"underline",children:[]},t)}function iT(t){this.exit(t)}function oT(){return[nT,jE,ZE,QE]}function sT(){const t=this.data();e("micromarkExtensions",YE()),e("fromMarkdownExtensions",oT());function e(n,r){const c=t[n];c?(_c(Array.isArray(c)),c.push(r)):t[n]=[r]}}function lT(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function aT(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
92
+ `?y.push(n.$createLineBreakNode()):he===" "?y.push(n.$createTabNode()):0<he.length&&y.push(B(he,m))}}else({content:k}=M),typeof k=="string"?y.push(...pe([k],M.type)):Array.isArray(k)&&y.push(...pe(k,M.type));return y}function ue(k,m){if(k=n.$getNodeByKey(k),p(k)&&k.isAttached()){var y=n.$getSelection();if(n.$isRangeSelection(y)){y=y.anchor;var M=y.offset,Z=y.type==="element"&&n.$isLineBreakNode(k.getChildAtIndex(y.offset-1)),ae=0;if(!Z){let he=y.getNode();ae=M+he.getPreviousSiblings().reduce((se,Te)=>se+Te.getTextContentSize(),0)}m()&&(Z?y.getNode().select(M,M):k.getChildren().some(he=>{let se=n.$isTextNode(he);if(se||n.$isLineBreakNode(he)){let Te=he.getTextContentSize();if(se&&Te>=ae)return he.select(ae,ae),!0;ae-=Te}return!1}))}else m()}}function K(k,m){return z(k)&&z(m)&&k.__text===m.__text&&k.__highlightType===m.__highlightType||n.$isTabNode(k)&&n.$isTabNode(m)||n.$isLineBreakNode(k)&&n.$isLineBreakNode(m)}function D(k){if(!n.$isRangeSelection(k))return!1;var m=k.anchor.getNode();return k=k.focus.getNode(),m.is(k)&&p(m)?!0:(m=m.getParent(),p(m)&&m.is(k.getParent()))}function V(k){k=k.getNodes();let m=[[]];if(k.length===1&&p(k[0]))return m;let y=m[0];for(let M=0;M<k.length;M++){let Z=k[M];if(!(z(Z)||n.$isTabNode(Z)||n.$isLineBreakNode(Z)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Z)?M!==0&&0<y.length&&(y=[],m.push(y)):y.push(Z)}return m}function ne(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return null;let y=k?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(k=k?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<V(m).length)return y;var M=m.getNodes()[0];if(!(p(M)||z(M)||n.$isTabNode(M)||n.$isLineBreakNode(M)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(p(M))return y;let Z=X(M);M=ee(M);var ae=m.anchor;let he=m.focus;return he.isBefore(ae)?m=he:(m=ae,ae=he),Z!==null&&M!==null&&m.key===Z.getKey()&&m.offset===0&&ae.key===M.getKey()&&ae.offset===M.getTextContentSize()?y:k}function Y(k){var m=n.$getSelection();if(!n.$isRangeSelection(m)||!D(m))return!1;var y=V(m);let M=y.length;if(1<y.length){for(m=0;m<M;m++){var Z=y[m];0<Z.length&&(Z=Z[0],m===0&&(Z=X(Z)),Z!==null&&(k===n.INDENT_CONTENT_COMMAND?Z.insertBefore(n.$createTabNode()):n.$isTabNode(Z)&&Z.remove()))}return!0}if(y=m.getNodes()[0],!(p(y)||z(y)||n.$isTabNode(y)||n.$isLineBreakNode(y)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(p(y))return k===n.INDENT_CONTENT_COMMAND&&m.insertNodes([n.$createTabNode()]),!0;if(y=X(y),y===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return k===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(y)?y.insertAfter(n.$createTabNode()):y.insertBefore(n.$createTabNode()):n.$isTabNode(y)&&y.remove(),!0}function G(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:M,focus:Z}=y,ae=M.offset,he=Z.offset,se=M.getNode(),Te=Z.getNode();var be=k===n.KEY_ARROW_UP_COMMAND;if(!D(y)||!z(se)&&!n.$isTabNode(se)||!z(Te)&&!n.$isTabNode(Te))return!1;if(!m.altKey){if(y.isCollapsed()){if(k=se.getParentOrThrow(),be&&ae===0&&se.getPreviousSibling()===null){if(k.getPreviousSibling()===null)return k.selectPrevious(),m.preventDefault(),!0}else if(!be&&ae===se.getTextContentSize()&&se.getNextSibling()===null&&k.getNextSibling()===null)return k.selectNext(),m.preventDefault(),!0}return!1}let Ue;if(se.isBefore(Te)){var re=X(se);Ue=ee(Te)}else re=X(Te),Ue=ee(se);if(re==null||Ue==null)return!1;let te=re.getNodesBetween(Ue);for(let we=0;we<te.length;we++){let Le=te[we];if(!z(Le)&&!n.$isTabNode(Le)&&!n.$isLineBreakNode(Le))return!1}if(m.preventDefault(),m.stopPropagation(),m=be?re.getPreviousSibling():Ue.getNextSibling(),!n.$isLineBreakNode(m)||(re=be?m.getPreviousSibling():m.getNextSibling(),re==null))return!0;be=z(re)||n.$isTabNode(re)||n.$isLineBreakNode(re)?be?X(re):ee(re):null;let ce=be??re;return m.remove(),te.forEach(we=>we.remove()),k===n.KEY_ARROW_UP_COMMAND?(te.forEach(we=>ce.insertBefore(we)),ce.insertBefore(m)):(ce.insertAfter(m),ce=m,te.forEach(we=>{ce.insertAfter(we),ce=we})),y.setTextNodeRange(se,ae,Te,he),!0}function Q(k,m){let y=n.$getSelection();if(!n.$isRangeSelection(y))return!1;let{anchor:M,focus:Z}=y;var ae=M.getNode();let he=Z.getNode();if(k=k===n.MOVE_TO_START,!z(ae)&&!n.$isTabNode(ae)||!z(he)&&!n.$isTabNode(he))return!1;if(k)if(ae=j(he,Z.offset),ae!==null){let{node:se,offset:Te}=ae;n.$isLineBreakNode(se)?se.selectNext(0,0):y.setTextNodeRange(se,Te,se,Te)}else he.getParentOrThrow().selectStart();else U(he).select();return m.preventDefault(),m.stopPropagation(),!0}return Mn.$createCodeHighlightNode=B,Mn.$createCodeNode=g,Mn.$isCodeHighlightNode=z,Mn.$isCodeNode=p,Mn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=w,Mn.CODE_LANGUAGE_MAP=P,Mn.CodeHighlightNode=$,Mn.CodeNode=d,Mn.DEFAULT_CODE_LANGUAGE="javascript",Mn.PrismTokenizer=le,Mn.getCodeLanguages=()=>Object.keys(t.languages).filter(k=>typeof t.languages[k]!="function").sort(),Mn.getDefaultCodeLanguage=()=>"javascript",Mn.getEndOfCodeInLine=U,Mn.getFirstCodeNodeOfLine=X,Mn.getLanguageFriendlyName=function(k){return k=H(k),w[k]||k},Mn.getLastCodeNodeOfLine=ee,Mn.getStartOfCodeInLine=j,Mn.normalizeCodeLang=H,Mn.registerCodeHighlighting=function(k,m){if(!k.hasNodes([d,$]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return m==null&&(m=le),e.mergeRegister(k.registerMutationListener(d,y=>{k.update(()=>{for(let[ae,he]of y)if(he!=="destroyed"){var M=n.$getNodeByKey(ae);if(M!==null)e:{var Z=M;if(M=k.getElementByKey(Z.getKey()),M===null)break e;Z=Z.getChildren();let se=Z.length;if(se===M.__cachedChildrenLength)break e;M.__cachedChildrenLength=se;let Te="1",be=1;for(let Ue=0;Ue<se;Ue++)n.$isLineBreakNode(Z[Ue])&&(Te+=`
93
+ `+ ++be);M.setAttribute("data-gutter",Te)}}})}),k.registerNodeTransform(d,y=>_e(y,k,m)),k.registerNodeTransform(n.TextNode,y=>q(y,k,m)),k.registerNodeTransform($,y=>q(y,k,m)),k.registerCommand(n.KEY_TAB_COMMAND,y=>{let M=ne(y.shiftKey);return M===null?!1:(y.preventDefault(),k.dispatchCommand(M,void 0),!0)},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INSERT_TAB_COMMAND,()=>{let y=n.$getSelection();return D(y)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),k.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_UP_COMMAND,y=>G(n.KEY_ARROW_UP_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.KEY_ARROW_DOWN_COMMAND,y=>G(n.KEY_ARROW_DOWN_COMMAND,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_END,y=>Q(n.MOVE_TO_END,y),n.COMMAND_PRIORITY_LOW),k.registerCommand(n.MOVE_TO_START,y=>Q(n.MOVE_TO_START,y),n.COMMAND_PRIORITY_LOW))},Mn}const FC=process.env.NODE_ENV==="development"?PC():$C();var ju=FC,Cd=Un();function BC(){const[t]=Cd.useLexicalComposerContext();return et.useEffect(()=>ju.registerCodeHighlighting(t),[t]),null}var ig=on(),Rn=Bt();function HC({src:t,altText:e,width:n,height:r,maxWidth:c}){const d=et.useMemo(()=>({height:r,width:n,maxWidth:c}),[r,n,c]);return at.jsx("img",{src:t,alt:e,style:d})}function Kp({altText:t,height:e,maxWidth:n=500,src:r,width:c,key:d}){return Rn.$applyNodeReplacement(new il(r,t,n,c,e,d))}function WC(t){return t instanceof il}class il extends Rn.DecoratorNode{constructor(n,r,c,d,g,p){super(p);Vn(this,"__src");Vn(this,"__altText");Vn(this,"__width");Vn(this,"__height");Vn(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=c,this.__width=d||"inherit",this.__height=g||"inherit"}static getType(){return"image"}static clone(n){return new il(n.__src,n.__altText,n.__maxWidth,n.__width,n.__height,n.__key)}getSrc(){return this.getLatest().__src}getAltText(){return this.getLatest().__altText}exportJSON(){return{altText:this.getAltText(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,src:this.getSrc(),type:"image",version:1,width:this.__width==="inherit"?0:this.__width}}static importJSON(n){return Kp(n)}createDOM(n){const r=document.createElement("span"),c=n.theme.image;return c&&(r.className=c),r}updateDOM(){return!1}decorate(){return at.jsx(HC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const KC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",zC=t=>KC?(t||window).getSelection():null,zp=Rn.createCommand("INSERT_IMAGE_COMMAND");function UC(){const[t]=Cd.useLexicalComposerContext();return et.useEffect(()=>{if(!t.hasNodes([il]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ig.mergeRegister(t.registerCommand(zp,e=>{const n=Kp(e);return Rn.$insertNodes([n]),Rn.$isRootOrShadowRoot(n.getParentOrThrow())&&ig.$wrapNodeInElement(n,Rn.$createParagraphNode).selectEnd(),!0},Rn.COMMAND_PRIORITY_EDITOR),t.registerCommand(Rn.DRAGSTART_COMMAND,e=>GC(e),Rn.COMMAND_PRIORITY_HIGH),t.registerCommand(Rn.DRAGOVER_COMMAND,e=>YC(e),Rn.COMMAND_PRIORITY_LOW),t.registerCommand(Rn.DROP_COMMAND,e=>jC(e,t),Rn.COMMAND_PRIORITY_HIGH))},[t]),null}function GC(t){const e="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=e;const r=Ed();if(!r)return!1;const c=t.dataTransfer;return c?(c.setData("text/plain","_"),c.setDragImage(n,0,0),c.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function YC(t){return Ed()?(Up(t)||t.preventDefault(),!0):!1}function jC(t,e){const n=Ed();if(!n)return!1;const r=VC(t);if(!r)return!1;if(t.preventDefault(),Up(t)){const c=qC(t);n.remove();const d=Rn.$createRangeSelection();c!=null&&d.applyDOMRange(c),Rn.$setSelection(d),e.dispatchCommand(zp,r)}return!0}function Ed(){const t=Rn.$getSelection();if(!Rn.$isNodeSelection(t))return null;const n=t.getNodes()[0];return WC(n)?n:null}function VC(t){var c;const e=(c=t.dataTransfer)==null?void 0:c.getData("application/x-lexical-drag");if(!e)return null;const{type:n,data:r}=JSON.parse(e);return n!=="image"?null:r}function Up(t){const e=t.target;return!!(e&&e instanceof HTMLElement&&!e.closest("code, span.yext-default-richtextv2-theme__image")&&e.parentElement)}function qC(t){let e;const n=t.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,c=zC(r);if(document.caretRangeFromPoint)e=document.caretRangeFromPoint(t.clientX,t.clientY);else if(t.rangeParent&&c!==null)c.collapse(t.rangeParent,t.rangeOffset||0),e=c.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return e}var as=_d();function ZC(t){const e=t.getNodes();return e.length===0?new Set([t.anchor.getNode().getParentOrThrow(),t.focus.getNode().getParentOrThrow()]):new Set(e.map(n=>Rn.$isElementNode(n)?n:n.getParentOrThrow()))}const JC=3;function XC(t){const e=Rn.$getSelection();if(!Rn.$isRangeSelection(e))return!1;const n=ZC(e);let r=0;for(const c of n)if(as.$isListNode(c))r=Math.max(as.$getListDepth(c)+1,r);else if(as.$isListItemNode(c)){const d=c.getParent();if(!as.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(as.$getListDepth(d)+1,r)}return r<=t}function QC({maxDepth:t}){const[e]=Cd.useLexicalComposerContext();return et.useEffect(()=>e.registerCommand(Rn.INDENT_CONTENT_COMMAND,()=>!XC(t||7),JC),[e,t]),null}var Ou=Nd(),og=yd(),sg=md(),Kl={},lg;function eE(){if(lg)return Kl;lg=1;var t=on(),e=Bt();class n extends e.TextNode{static getType(){return"hashtag"}static clone(g){return new n(g.__text,g.__key)}constructor(g,p){super(g,p)}createDOM(g){const p=super.createDOM(g);return t.addClassNamesToElement(p,g.theme.hashtag),p}static importJSON(g){const p=r(g.text);return p.setFormat(g.format),p.setDetail(g.detail),p.setMode(g.mode),p.setStyle(g.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return e.$applyNodeReplacement(new n(d))}function c(d){return d instanceof n}return Kl.$createHashtagNode=r,Kl.$isHashtagNode=c,Kl.HashtagNode=n,Kl}var zl={},ag;function tE(){if(ag)return zl;ag=1;var t=on(),e=Bt();class n extends e.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,g){super(d,g)}createDOM(d){let g=super.createDOM(d);return t.addClassNamesToElement(g,d.theme.hashtag),g}static importJSON(d){let g=r(d.text);return g.setFormat(d.format),g.setDetail(d.detail),g.setMode(d.mode),g.setStyle(d.style),g}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(c=""){return e.$applyNodeReplacement(new n(c))}return zl.$createHashtagNode=r,zl.$isHashtagNode=function(c){return c instanceof n},zl.HashtagNode=n,zl}const nE=process.env.NODE_ENV==="development"?eE():tE();var rE=nE;const iE="_rtl_13v3w_295",oE="_selected_13v3w_370",lt={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__ul":"_yext-default-richtextv2-theme__ul_13v3w_17","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271",rtl:iE,"yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366",selected:oE,"yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},sE={characterLimit:lt["yext-default-richtextv2-theme__characterLimit"],code:lt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:lt["yext-default-richtextv2-theme__tokenAttr"],attr:lt["yext-default-richtextv2-theme__tokenAttr"],boolean:lt["yext-default-richtextv2-theme__tokenProperty"],builtin:lt["yext-default-richtextv2-theme__tokenSelector"],cdata:lt["yext-default-richtextv2-theme__tokenComment"],char:lt["yext-default-richtextv2-theme__tokenSelector"],class:lt["yext-default-richtextv2-theme__tokenFunction"],"class-name":lt["yext-default-richtextv2-theme__tokenFunction"],comment:lt["yext-default-richtextv2-theme__tokenComment"],constant:lt["yext-default-richtextv2-theme__tokenProperty"],deleted:lt["yext-default-richtextv2-theme__tokenProperty"],doctype:lt["yext-default-richtextv2-theme__tokenComment"],entity:lt["yext-default-richtextv2-theme__tokenOperator"],function:lt["yext-default-richtextv2-theme__tokenFunction"],important:lt["yext-default-richtextv2-theme__tokenVariable"],inserted:lt["yext-default-richtextv2-theme__tokenSelector"],keyword:lt["yext-default-richtextv2-theme__tokenAttr"],namespace:lt["yext-default-richtextv2-theme__tokenVariable"],number:lt["yext-default-richtextv2-theme__tokenProperty"],operator:lt["yext-default-richtextv2-theme__tokenOperator"],prolog:lt["yext-default-richtextv2-theme__tokenComment"],property:lt["yext-default-richtextv2-theme__tokenProperty"],punctuation:lt["yext-default-richtextv2-theme__tokenPunctuation"],regex:lt["yext-default-richtextv2-theme__tokenVariable"],selector:lt["yext-default-richtextv2-theme__tokenSelector"],string:lt["yext-default-richtextv2-theme__tokenSelector"],symbol:lt["yext-default-richtextv2-theme__tokenProperty"],tag:lt["yext-default-richtextv2-theme__tokenProperty"],url:lt["yext-default-richtextv2-theme__tokenOperator"],variable:lt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:lt["yext-default-richtextv2-theme__embedBlock"],focus:lt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:lt["yext-default-richtextv2-theme__hashtag"],heading:{h1:lt["yext-default-richtextv2-theme__h1"],h2:lt["yext-default-richtextv2-theme__h2"],h3:lt["yext-default-richtextv2-theme__h3"],h4:lt["yext-default-richtextv2-theme__h4"],h5:lt["yext-default-richtextv2-theme__h5"],h6:lt["yext-default-richtextv2-theme__h6"]},image:lt["yext-default-richtextv2-theme__image"],link:lt["yext-default-richtextv2-theme__link"],list:{listitem:lt["yext-default-richtextv2-theme__listItem"],listitemChecked:lt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:lt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:lt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[lt["yext-default-richtextv2-theme__ol1"],lt["yext-default-richtextv2-theme__ol2"],lt["yext-default-richtextv2-theme__ol3"],lt["yext-default-richtextv2-theme__ol4"],lt["yext-default-richtextv2-theme__ol5"]],ulDepth:[lt["yext-default-richtextv2-theme__ul1"],lt["yext-default-richtextv2-theme__ul2"],lt["yext-default-richtextv2-theme__ul3"]]},ltr:lt["yext-default-richtextv2-theme__ltr"],mark:lt["yext-default-richtextv2-theme__mark"],markOverlap:lt["yext-default-richtextv2-theme__markOverlap"],paragraph:lt["yext-default-richtextv2-theme__paragraph"],quote:lt["yext-default-richtextv2-theme__quote"],rtl:lt["yext-default-richtextv2-theme__rtl"],table:lt["yext-default-richtextv2-theme__table"],tableCell:lt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:lt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:lt["yext-default-richtextv2-theme__textBold"],code:lt["yext-default-richtextv2-theme__textCode"],italic:lt["yext-default-richtextv2-theme__textItalic"],strikethrough:lt["yext-default-richtextv2-theme__textStrikethrough"],subscript:lt["yext-default-richtextv2-theme__textSubscript"],superscript:lt["yext-default-richtextv2-theme__textSuperscript"],underline:lt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:lt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Us={},Du={},cg;function lE(){if(cg)return Du;cg=1;var t=Un(),e=Bt(),n=et;function r(d,g){return d.getEditorState().read(()=>{const p=e.$getNodeByKey(g);return p===null?!1:p.isSelected()})}function c(d){const[g]=t.useLexicalComposerContext(),[p,N]=n.useState(()=>r(g,d));n.useEffect(()=>{let O=!0;const b=g.registerUpdateListener(()=>{O&&N(r(g,d))});return()=>{O=!1,b()}},[g,d]);const v=n.useCallback(O=>{g.update(()=>{let b=e.$getSelection();e.$isNodeSelection(b)||(b=e.$createNodeSelection(),e.$setSelection(b)),e.$isNodeSelection(b)&&(O?b.add(d):b.delete(d))})},[g,d]),T=n.useCallback(()=>{g.update(()=>{const O=e.$getSelection();e.$isNodeSelection(O)&&O.clear()})},[g]);return[p,v,T]}return Du.useLexicalNodeSelection=c,Du}var Au={},ug;function aE(){if(ug)return Au;ug=1;var t=Un(),e=Bt(),n=et;function r(c,d){return c.getEditorState().read(()=>{let g=e.$getNodeByKey(d);return g===null?!1:g.isSelected()})}return Au.useLexicalNodeSelection=function(c){let[d]=t.useLexicalComposerContext(),[g,p]=n.useState(()=>r(d,c));n.useEffect(()=>{let T=!0,O=d.registerUpdateListener(()=>{T&&p(r(d,c))});return()=>{T=!1,O()}},[d,c]);let N=n.useCallback(T=>{d.update(()=>{let O=e.$getSelection();e.$isNodeSelection(O)||(O=e.$createNodeSelection(),e.$setSelection(O)),e.$isNodeSelection(O)&&(T?O.add(c):O.delete(c))})},[d,c]),v=n.useCallback(()=>{d.update(()=>{const T=e.$getSelection();e.$isNodeSelection(T)&&T.clear()})},[d]);return[g,N,v]},Au}var Mu,dg;function Gp(){return dg||(dg=1,Mu=process.env.NODE_ENV==="development"?lE():aE()),Mu}var fg;function cE(){if(fg)return Us;fg=1;var t=Un(),e=Gp(),n=on(),r=Bt(),c=et;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){const[b]=t.useLexicalComposerContext(),[R,x,w]=e.useLexicalNodeSelection(O),P=c.useCallback(H=>{if(R&&r.$isNodeSelection(r.$getSelection())){H.preventDefault();const $=r.$getNodeByKey(O);T($)&&$.remove()}return!1},[R,O]);return c.useEffect(()=>n.mergeRegister(b.registerCommand(r.CLICK_COMMAND,H=>{const $=b.getElementByKey(O);return H.target===$?(H.shiftKey||w(),x(!R),!0):!1},r.COMMAND_PRIORITY_LOW),b.registerCommand(r.KEY_DELETE_COMMAND,P,r.COMMAND_PRIORITY_LOW),b.registerCommand(r.KEY_BACKSPACE_COMMAND,P,r.COMMAND_PRIORITY_LOW)),[w,b,R,O,P,x]),c.useEffect(()=>{const H=b.getElementByKey(O);H!==null&&(H.className=R?"selected":"")},[b,R,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(b){return new p(b.__key)}static importJSON(b){return v()}static importDOM(){return{hr:()=>({conversion:N,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
94
+ `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function N(){return{node:v()}}function v(){return r.$applyNodeReplacement(new p)}function T(O){return O instanceof p}return Us.$createHorizontalRuleNode=v,Us.$isHorizontalRuleNode=T,Us.HorizontalRuleNode=p,Us.INSERT_HORIZONTAL_RULE_COMMAND=d,Us}var Gs={},hg;function uE(){if(hg)return Gs;hg=1;var t=Un(),e=Gp(),n=on(),r=Bt(),c=et;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:O}){let[b]=t.useLexicalComposerContext(),[R,x,w]=e.useLexicalNodeSelection(O),P=c.useCallback(H=>(R&&r.$isNodeSelection(r.$getSelection())&&(H.preventDefault(),H=r.$getNodeByKey(O),T(H)&&H.remove()),!1),[R,O]);return c.useEffect(()=>n.mergeRegister(b.registerCommand(r.CLICK_COMMAND,H=>{let $=b.getElementByKey(O);return H.target===$?(H.shiftKey||w(),x(!R),!0):!1},r.COMMAND_PRIORITY_LOW),b.registerCommand(r.KEY_DELETE_COMMAND,P,r.COMMAND_PRIORITY_LOW),b.registerCommand(r.KEY_BACKSPACE_COMMAND,P,r.COMMAND_PRIORITY_LOW)),[w,b,R,O,P,x]),c.useEffect(()=>{let H=b.getElementByKey(O);H!==null&&(H.className=R?"selected":"")},[b,R,O]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(b){return new p(b.__key)}static importJSON(){return v()}static importDOM(){return{hr:()=>({conversion:N,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
95
+ `}isInline(){return!1}updateDOM(){return!1}decorate(){return c.createElement(g,{nodeKey:this.__key})}}function N(){return{node:v()}}function v(){return r.$applyNodeReplacement(new p)}function T(O){return O instanceof p}return Gs.$createHorizontalRuleNode=v,Gs.$isHorizontalRuleNode=T,Gs.HorizontalRuleNode=p,Gs.INSERT_HORIZONTAL_RULE_COMMAND=d,Gs}const dE=process.env.NODE_ENV==="development"?cE():uE();var fE=dE;function hE(t,e){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:t,theme:e??sE,nodes:[sg.HeadingNode,rE.HashtagNode,il,as.ListNode,as.ListItemNode,sg.QuoteNode,ju.CodeNode,ju.CodeHighlightNode,Ou.TableNode,Ou.TableCellNode,Ou.TableRowNode,og.AutoLinkNode,og.LinkNode,fE.HorizontalRuleNode]}}const Ru={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function gE({serializedAST:t,nodeClassNames:e}){return at.jsx(KN.LexicalComposer,{initialConfig:hE(t,e),children:at.jsx("div",{className:`${Ru["editor-inner"]} ${Ru["no-border"]}`,children:at.jsxs("div",{className:Ru["editor-inner"],children:[at.jsx(aC.RichTextPlugin,{contentEditable:at.jsx(fC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:_C,placeholder:at.jsx("div",{})}),at.jsx(BC,{}),at.jsx(xC.ListPlugin,{}),at.jsx(AC.LinkPlugin,{}),at.jsx(IC.TablePlugin,{}),at.jsx(UC,{}),at.jsx(QC,{maxDepth:7})]})})})}function mc(t,e,n,r){const c=t.length;let d=0,g;if(e<0?e=-e>c?0:c+e:e=e>c?c:e,n=n>0?n:0,r.length<1e4)g=Array.from(r),g.unshift(e,n),[].splice.apply(t,g);else for(n&&[].splice.apply(t,[e,n]);d<r.length;)g=r.slice(d,d+1e4),g.unshift(e,0),[].splice.apply(t,g),d+=1e4,e+=1e4}function Vs(t,e){return t.length>0?(mc(t,t.length,0,e),t):e}const gg={}.hasOwnProperty;function Yp(t){const e={};let n=-1;for(;++n<t.length;)pE(e,t[n]);return e}function pE(t,e){let n;for(n in e){const c=(gg.call(t,n)?t[n]:void 0)||(t[n]={}),d=e[n];let g;for(g in d){gg.call(c,g)||(c[g]=[]);const p=d[g];mE(c[g],Array.isArray(p)?p:p?[p]:[])}}}function mE(t,e){let n=-1;const r=[];for(;++n<e.length;)(e[n].add==="after"?t:r).push(e[n]);mc(t,0,0,r)}const eo={plusSign:43,caret:94,tilde:126};var pg=Object.prototype.hasOwnProperty;function mg(t,e,n){for(n of t.keys())if(Zl(n,e))return n}function Zl(t,e){var n,r,c;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&Zl(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(c=r,c&&typeof c=="object"&&(c=mg(e,c),!c)||!e.has(c))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(c=r[0],c&&typeof c=="object"&&(c=mg(e,c),!c)||!Zl(r[1],e.get(c)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(pg.call(t,n)&&++r&&!pg.call(e,n)||!(n in e)||!Zl(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}let Vu,jp,Vp,qp,Zp=!0;typeof process<"u"&&({FORCE_COLOR:Vu,NODE_DISABLE_COLORS:jp,NO_COLOR:Vp,TERM:qp}=process.env||{},Zp=process.stdout&&process.stdout.isTTY);const zt={enabled:!jp&&Vp==null&&qp!=="dumb"&&(Vu!=null&&Vu!=="0"||Zp),reset:un(0,0),bold:un(1,22),dim:un(2,22),italic:un(3,23),underline:un(4,24),inverse:un(7,27),hidden:un(8,28),strikethrough:un(9,29),black:un(30,39),red:un(31,39),green:un(32,39),yellow:un(33,39),blue:un(34,39),magenta:un(35,39),cyan:un(36,39),white:un(37,39),gray:un(90,39),grey:un(90,39),bgBlack:un(40,49),bgRed:un(41,49),bgGreen:un(42,49),bgYellow:un(43,49),bgBlue:un(44,49),bgMagenta:un(45,49),bgCyan:un(46,49),bgWhite:un(47,49)};function _g(t,e){let n=0,r,c="",d="";for(;n<t.length;n++)r=t[n],c+=r.open,d+=r.close,~e.indexOf(r.close)&&(e=e.replace(r.rgx,r.close+r.open));return c+e+d}function _E(t,e){let n={has:t,keys:e};return n.reset=zt.reset.bind(n),n.bold=zt.bold.bind(n),n.dim=zt.dim.bind(n),n.italic=zt.italic.bind(n),n.underline=zt.underline.bind(n),n.inverse=zt.inverse.bind(n),n.hidden=zt.hidden.bind(n),n.strikethrough=zt.strikethrough.bind(n),n.black=zt.black.bind(n),n.red=zt.red.bind(n),n.green=zt.green.bind(n),n.yellow=zt.yellow.bind(n),n.blue=zt.blue.bind(n),n.magenta=zt.magenta.bind(n),n.cyan=zt.cyan.bind(n),n.white=zt.white.bind(n),n.gray=zt.gray.bind(n),n.grey=zt.grey.bind(n),n.bgBlack=zt.bgBlack.bind(n),n.bgRed=zt.bgRed.bind(n),n.bgGreen=zt.bgGreen.bind(n),n.bgYellow=zt.bgYellow.bind(n),n.bgBlue=zt.bgBlue.bind(n),n.bgMagenta=zt.bgMagenta.bind(n),n.bgCyan=zt.bgCyan.bind(n),n.bgWhite=zt.bgWhite.bind(n),n}function un(t,e){let n={open:`\x1B[${t}m`,close:`\x1B[${e}m`,rgx:new RegExp(`\\x1b\\[${e}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(t)||(this.has.push(t),this.keys.push(n)),r===void 0?this:zt.enabled?_g(this.keys,r+""):r+""):r===void 0?_E([t],[n]):zt.enabled?_g([n],r+""):r+""}}function Ro(){}Ro.prototype={diff:function(e,n){var r,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=c.callback;typeof c=="function"&&(d=c,c={}),this.options=c;var g=this;function p(B){return d?(setTimeout(function(){d(void 0,B)},0),!0):B}e=this.castInput(e),n=this.castInput(n),e=this.removeEmpty(this.tokenize(e)),n=this.removeEmpty(this.tokenize(n));var N=n.length,v=e.length,T=1,O=N+v;c.maxEditLength&&(O=Math.min(O,c.maxEditLength));var b=(r=c.timeout)!==null&&r!==void 0?r:1/0,R=Date.now()+b,x=[{oldPos:-1,lastComponent:void 0}],w=this.extractCommon(x[0],n,e,0);if(x[0].oldPos+1>=v&&w+1>=N)return p([{value:this.join(n),count:n.length}]);var P=-1/0,H=1/0;function $(){for(var B=Math.max(P,-T);B<=Math.min(H,T);B+=2){var z=void 0,X=x[B-1],ee=x[B+1];X&&(x[B-1]=void 0);var le=!1;if(ee){var j=ee.oldPos-B;le=ee&&0<=j&&j<N}var U=X&&X.oldPos+1<v;if(!le&&!U){x[B]=void 0;continue}if(!U||le&&X.oldPos+1<ee.oldPos?z=g.addToPath(ee,!0,void 0,0):z=g.addToPath(X,void 0,!0,1),w=g.extractCommon(z,n,e,B),z.oldPos+1>=v&&w+1>=N)return p(yE(g,z.lastComponent,n,e,g.useLongestToken));x[B]=z,z.oldPos+1>=v&&(H=Math.min(H,B-1)),w+1>=N&&(P=Math.max(P,B+1))}T++}if(d)(function B(){setTimeout(function(){if(T>O||Date.now()>R)return d();$()||B()},0)})();else for(;T<=O&&Date.now()<=R;){var W=$();if(W)return W}},addToPath:function(e,n,r,c){var d=e.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:e.oldPos+c,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:e.oldPos+c,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(e,n,r,c){for(var d=n.length,g=r.length,p=e.oldPos,N=p-c,v=0;N+1<d&&p+1<g&&this.equals(n[N+1],r[p+1]);)N++,p++,v++;return v&&(e.lastComponent={count:v,previousComponent:e.lastComponent}),e.oldPos=p,N},equals:function(e,n){return this.options.comparator?this.options.comparator(e,n):e===n||this.options.ignoreCase&&e.toLowerCase()===n.toLowerCase()},removeEmpty:function(e){for(var n=[],r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function yE(t,e,n,r,c){for(var d=[],g;e;)d.push(e),g=e.previousComponent,delete e.previousComponent,e=g;d.reverse();for(var p=0,N=d.length,v=0,T=0;p<N;p++){var O=d[p];if(O.removed){if(O.value=t.join(r.slice(T,T+O.count)),T+=O.count,p&&d[p-1].added){var R=d[p-1];d[p-1]=d[p],d[p]=R}}else{if(!O.added&&c){var b=n.slice(v,v+O.count);b=b.map(function(w,P){var H=r[T+P];return H.length>w.length?H:w}),O.value=t.join(b)}else O.value=t.join(n.slice(v,v+O.count));v+=O.count,O.added||(T+=O.count)}}var x=d[N-1];return N>1&&typeof x.value=="string"&&(x.added||x.removed)&&t.equals("",x.value)&&(d[N-2].value+=x.value,d.pop()),d}var yg=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Ng=/\S/,Jp=new Ro;Jp.equals=function(t,e){return this.options.ignoreCase&&(t=t.toLowerCase(),e=e.toLowerCase()),t===e||this.options.ignoreWhitespace&&!Ng.test(t)&&!Ng.test(e)};Jp.tokenize=function(t){for(var e=t.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<e.length-1;n++)!e[n+1]&&e[n+2]&&yg.test(e[n])&&yg.test(e[n+2])&&(e[n]+=e[n+2],e.splice(n+1,2),n--);return e};var Xp=new Ro;Xp.tokenize=function(t){this.options.stripTrailingCr&&(t=t.replace(/\r\n/g,`
96
+ `));var e=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var c=n[r];r%2&&!this.options.newlineIsToken?e[e.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),e.push(c))}return e};var NE=new Ro;NE.tokenize=function(t){return t.split(/(\S.+?[.!?])(?=\s+|$)/)};var CE=new Ro;CE.tokenize=function(t){return t.split(/([{}:;,]|\s+)/)};function rc(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rc=function(e){return typeof e}:rc=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rc(t)}var EE=Object.prototype.toString,Xl=new Ro;Xl.useLongestToken=!0;Xl.tokenize=Xp.tokenize;Xl.castInput=function(t){var e=this.options,n=e.undefinedReplacement,r=e.stringifyReplacer,c=r===void 0?function(d,g){return typeof g>"u"?n:g}:r;return typeof t=="string"?t:JSON.stringify(qu(t,null,null,c),c," ")};Xl.equals=function(t,e){return Ro.prototype.equals.call(Xl,t.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function qu(t,e,n,r,c){e=e||[],n=n||[],r&&(t=r(c,t));var d;for(d=0;d<e.length;d+=1)if(e[d]===t)return n[d];var g;if(EE.call(t)==="[object Array]"){for(e.push(t),g=new Array(t.length),n.push(g),d=0;d<t.length;d+=1)g[d]=qu(t[d],e,n,r,c);return e.pop(),n.pop(),g}if(t&&t.toJSON&&(t=t.toJSON()),rc(t)==="object"&&t!==null){e.push(t),g={},n.push(g);var p=[],N;for(N in t)t.hasOwnProperty(N)&&p.push(N);for(p.sort(),d=0;d<p.length;d+=1)N=p[d],g[N]=qu(t[N],e,n,r,N);e.pop(),n.pop()}else g=t;return g}var Zu=new Ro;Zu.tokenize=function(t){return t.slice()};Zu.join=Zu.removeEmpty=function(t){return t};zt.red,zt.grey,zt.green;zt.dim().italic;zt.dim("→");zt.dim("·");zt.dim("↵");function lc(t){t=t.replace(/\r?\n/g,`
97
+ `);let e=t.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,c=(e||[]).length;for(;n<c;n++)r=Math.min(r,e[n].length);return c&&r?t.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):t}class TE extends Error{constructor(e={}){super(e.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=e.details||!1,this.generated=!!e.generated,this.operator=e.operator,this.expects=e.expects,this.actual=e.actual}}function Zr(t,e,n,r,c,d,g){if(t)return;let p=g||d;if(g instanceof Error)throw g;let N=c;throw new TE({actual:e,expects:n,operator:r,message:p,details:N,generated:!g})}function _c(t,e){Zr(!!t,!1,!0,"ok",!1,"Expected value to be truthy",e)}function to(t,e){Zr(!t,!0,!1,"not",!1,"Expected value to be falsey",e)}to.ok=to;to.equal=function(t,e,n){Zr(!Zl(t,e),t,e,"not.equal",!1,"Expected values not to be deeply equal",n)};to.type=function(t,e,n){let r=typeof t;Zr(r!==e,r,e,"not.type",!1,`Expected "${r}" not to be "${e}"`,n)};to.instance=function(t,e,n){let r="`"+(e.name||e.constructor.name)+"`";Zr(!(t instanceof e),t,e,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};to.snapshot=function(t,e,n){t=lc(t),e=lc(e),Zr(t!==e,t,e,"not.snapshot",!1,"Expected value not to match snapshot",n)};to.fixture=function(t,e,n){t=lc(t),e=lc(e),Zr(t!==e,t,e,"not.fixture",!1,"Expected value not to match fixture",n)};to.match=function(t,e,n){typeof e=="string"?Zr(!t.includes(e),t,e,"not.match",!1,`Expected value not to include "${e}" substring`,n):Zr(!e.test(t),t,e,"not.match",!1,`Expected value not to match \`${String(e)}\` pattern`,n)};to.throws=function(t,e,n){!n&&typeof e=="string"&&(n=e,e=null);try{t()}catch(r){typeof e=="function"?Zr(!e(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):e instanceof RegExp?Zr(!e.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(e)}\` pattern`,n):e||Zr(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const xE=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,vE=bo(/[A-Za-z]/),Ju=bo(/[\dA-Za-z]/),SE=bo(/[#-'*+\--9=?A-Z^-~]/);function wE(t){return t!==null&&(t<32||t===127)}const OE=bo(/\d/),DE=bo(/[\dA-Fa-f]/),AE=bo(/[!-/:-@[-`{-~]/);function ME(t){return t!==null&&t<-2}function Qp(t){return t!==null&&(t<0||t===32)}function RE(t){return t===-2||t===-1||t===32}const bE=bo(xE),LE=bo(/\s/);function bo(t){return e;function e(n){return n!==null&&t.test(String.fromCharCode(n))}}function Ql(t){if(t===null||Qp(t)||LE(t))return 1;if(bE(t))return 2}const ac={characterGroupPunctuation:2};function kE(t,e){const n=this.previous,r=Ql(n);return c;function c(g){return _c(g===eo.tilde,"expected `~`"),t.enter("tildeSequenceTemporary"),d(g)}function d(g){if(g===eo.tilde)return t.consume(g),d;const p=t.exit("tildeSequenceTemporary"),N=Ql(g);return p._open=!N||N===ac.characterGroupPunctuation&&!!r,p._close=!r||r===ac.characterGroupPunctuation&&!!N,e(g)}}function em(t,e,n){const r=[];let c=-1;for(;++c<t.length;){const d=t[c].resolveAll;d&&!r.includes(d)&&(e=d(e,n),r.push(d))}return e}const IE={data:"data"};function Td(t,e){return!!(t[0]==="enter"&&t[1].type===`${e}SequenceTemporary`&&t[1]._close)}function xd(t,e){return!!(t[0]==="exit"&&t[1].type===`${e}SequenceTemporary`&&t[1]._open)}function vd(t,e,n,r,c,d){const[g,p,N,v]=PE(t[e],t[n],c,d);t[e][1].end=Object.assign({},g.start),t[n][1].start=Object.assign({},p.end);let T=[];t[e][1].end.offset-t[e][1].start.offset&&(T=Vs(T,[["enter",t[e][1],r],["exit",t[e][1],r]])),T=Vs(T,[["enter",v,r],["enter",g,r],["exit",g,r],["enter",N,r]]),T=Vs(T,em(r.parser.constructs.insideSpan.null,t.slice(e+1,n),r)),T=Vs(T,[["exit",N,r],["enter",p,r],["exit",p,r],["exit",v,r]]);let O=0;return t[n][1].end.offset-t[n][1].start.offset&&(O=2,T=Vs(T,[["enter",t[n][1],r],["exit",t[n][1],r]])),mc(t,e-1,n-e+3,T),e+T.length-O-2}function PE(t,e,n,r){const c=Object.assign({},t[1].end),d=Object.assign({},e[1].start);Cg(c,-r),Cg(d,r);const g={type:`${n}Sequence`,start:c,end:Object.assign({},t[1].end)},p={type:`${n}Sequence`,start:Object.assign({},e[1].start),end:d},N={type:`${n}Text`,start:Object.assign({},t[1].end),end:Object.assign({},e[1].start)},v={type:`${n}`,start:Object.assign({},g.start),end:Object.assign({},p.end)};return[g,p,N,v]}function Cg(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}function Sd(t,e){t.forEach(n=>{n[1].type===`${e}SequenceTemporary`&&(n[1].type=IE.data)})}function $E(t,e){let n=-1;for(;++n<t.length;)if(Td(t[n],"tilde")){let r=n;for(;r--;)if(xd(t[r],"tilde")){const c=FE(t[r],t[n]);n=vd(t,r,n,e,c===1?"subscript":"strikethrough",c);break}}return Sd(t,"tilde"),t}function FE(t,e){const n=t[1].end.offset-t[1].start.offset,r=e[1].end.offset-e[1].start.offset;return n<3||r<3?r<n?r:n:r%2===0?2:1}function BE(){const t={tokenize:kE,resolveAll:$E};return{text:{[eo.tilde]:t},insideSpan:{null:[t]}}}function HE(t,e){let n=-1;for(;++n<t.length;)if(Td(t[n],"superscript")){let r=n;for(;r--;)if(xd(t[r],"superscript")){n=vd(t,r,n,e,"superscript",1);break}}return Sd(t,"superscript"),t}function WE(t,e){return n;function n(c){return _c(c===eo.caret,"expected `^`"),t.enter("superscriptSequenceTemporary"),r(c)}function r(c){if(c===eo.caret)return t.consume(c),r;const d=t.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,e(c)}}function KE(){const t={tokenize:WE,resolveAll:HE};return{text:{[eo.caret]:t},insideSpan:{null:[t]}}}function zE(t,e,n){const r=this.previous,c=Ql(r);let d=0;return g;function g(N){return _c(N===eo.plusSign,"expected `+`"),t.enter("underlineSequenceTemporary"),p(N)}function p(N){if(N===eo.plusSign)return t.consume(N),d++,p;if(d<2)return n(N);const v=t.exit("underlineSequenceTemporary"),T=Ql(N);return v._open=!T||T===ac.characterGroupPunctuation&&!!c,v._close=!c||c===ac.characterGroupPunctuation&&!!T,e(N)}}function UE(t,e){let n=-1;for(;++n<t.length;)if(Td(t[n],"underline")&&t[n][1].end.offset-t[n][1].start.offset>1){let r=n;for(;r--;)if(xd(t[r],"underline")&&t[r][1].end.offset-t[r][1].start.offset>1){n=vd(t,r,n,e,"underline",2);break}}return Sd(t,"underline"),t}function GE(){const t={tokenize:zE,resolveAll:UE};return{text:{[eo.plusSign]:t},insideSpan:{null:[t]}}}function YE(){return Yp([GE(),KE(),BE()])}const jE={canContainEols:["strikethrough"],enter:{strikethrough:VE},exit:{strikethrough:qE}};function VE(t){this.enter({type:"strikethrough",children:[]},t)}function qE(t){this.exit(t)}const ZE={canContainEols:["subscript"],enter:{subscript:JE},exit:{subscript:XE}};function JE(t){this.enter({type:"subscript",children:[]},t)}function XE(t){this.exit(t)}const QE={canContainEols:["superscript"],enter:{superscript:eT},exit:{superscript:tT}};function eT(t){this.enter({type:"superscript",children:[]},t)}function tT(t){this.exit(t)}const nT={canContainEols:["underline"],enter:{underline:rT},exit:{underline:iT}};function rT(t){this.enter({type:"underline",children:[]},t)}function iT(t){this.exit(t)}function oT(){return[nT,jE,ZE,QE]}function sT(){const t=this.data();e("micromarkExtensions",YE()),e("fromMarkdownExtensions",oT());function e(n,r){const c=t[n];c?(_c(Array.isArray(c)),c.push(r)):t[n]=[r]}}function lT(t,e){const n={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,n),t.applyData(e,n)}function aT(t,e){const n={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,n),[t.applyData(e,n),{type:"text",value:`
98
98
  `}]}function cT(t,e){const n=e.value?e.value+`
99
- `:"",r=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,c={};r&&(c.className=["language-"+r]);let d={type:"element",tagName:"code",properties:c,children:[{type:"text",value:n}]};return e.meta&&(d.data={meta:e.meta}),t.patch(e,d),d=t.applyData(e,d),d={type:"element",tagName:"pre",properties:{},children:[d]},t.patch(e,d),d}function uT(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function dT(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function ol(t){const e=[];let n=-1,r=0,c=0;for(;++n<t.length;){const d=t.charCodeAt(n);let g="";if(d===37&&Ju(t.charCodeAt(n+1))&&Ju(t.charCodeAt(n+2)))c=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(g=String.fromCharCode(d));else if(d>55295&&d<57344){const p=t.charCodeAt(n+1);d<56320&&p>56319&&p<57344?(g=String.fromCharCode(d,p),c=1):g="�"}else g=String.fromCharCode(d);g&&(e.push(t.slice(r,n),encodeURIComponent(g)),r=n+c+1,g=""),c&&(n+=c,c=0)}return e.join("")+t.slice(r)}function tm(t,e){const n=String(e.identifier).toUpperCase(),r=ol(n.toLowerCase()),c=t.footnoteOrder.indexOf(n);let d;c===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,d=t.footnoteOrder.length):(t.footnoteCounts[n]++,d=c+1);const g=t.footnoteCounts[n],p={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(g>1?"-"+g:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};t.patch(e,p);const C={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(e,C),t.applyData(e,C)}function fT(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const c=String(r);return n[c]={type:"footnoteDefinition",identifier:c,children:[{type:"paragraph",children:e.children}],position:e.position},tm(t,{type:"footnoteReference",identifier:c,position:e.position})}function hT(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function gT(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function nm(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const c=t.all(e),d=c[0];d&&d.type==="text"?d.value="["+d.value:c.unshift({type:"text",value:"["});const g=c[c.length-1];return g&&g.type==="text"?g.value+=r:c.push({type:"text",value:r}),c}function pT(t,e){const n=t.definition(e.identifier);if(!n)return nm(t,e);const r={src:ol(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,c),t.applyData(e,c)}function mT(t,e){const n={src:ol(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function _T(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function yT(t,e){const n=t.definition(e.identifier);if(!n)return nm(t,e);const r={href:ol(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,c),t.applyData(e,c)}function NT(t,e){const n={href:ol(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function CT(t,e,n){const r=t.all(e),c=n?ET(n):rm(e),d={},g=[];if(typeof e.checked=="boolean"){const T=r[0];let O;T&&T.type==="element"&&T.tagName==="p"?O=T:(O={type:"element",tagName:"p",properties:{},children:[]},r.unshift(O)),O.children.length>0&&O.children.unshift({type:"text",value:" "}),O.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const T=r[p];(c||p!==0||T.type!=="element"||T.tagName!=="p")&&g.push({type:"text",value:`
100
- `}),T.type==="element"&&T.tagName==="p"&&!c?g.push(...T.children):g.push(T)}const C=r[r.length-1];C&&(c||C.type!=="element"||C.tagName!=="p")&&g.push({type:"text",value:`
101
- `});const v={type:"element",tagName:"li",properties:d,children:g};return t.patch(e,v),t.applyData(e,v)}function ET(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=rm(n[r])}return e}function rm(t){const e=t.spread;return e??t.children.length>1}function TT(t,e){const n={},r=t.all(e);let c=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++c<r.length;){const g=r[c];if(g.type==="element"&&g.tagName==="li"&&g.properties&&Array.isArray(g.properties.className)&&g.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const d={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,d),t.applyData(e,d)}function xT(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function vT(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function ST(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const wd=im("start"),Od=im("end");function wT(t){return{start:wd(t),end:Od(t)}}function im(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function OT(t,e){const n=t.all(e),r=n.shift(),c=[];if(r){const g={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],g),c.push(g)}if(n.length>0){const g={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},p=wd(e.children[1]),C=Od(e.children[e.children.length-1]);p.line&&C.line&&(g.position={start:p,end:C}),c.push(g)}const d={type:"element",tagName:"table",properties:{},children:t.wrap(c,!0)};return t.patch(e,d),t.applyData(e,d)}function DT(t,e,n){const r=n?n.children:void 0,d=(r?r.indexOf(e):1)===0?"th":"td",g=n&&n.type==="table"?n.align:void 0,p=g?g.length:e.children.length;let C=-1;const v=[];for(;++C<p;){const O=e.children[C],R={},b=g?g[C]:void 0;b&&(R.align=b);let x={type:"element",tagName:d,properties:R,children:[]};O&&(x.children=t.all(O),t.patch(O,x),x=t.applyData(e,x)),v.push(x)}const T={type:"element",tagName:"tr",properties:{},children:t.wrap(v,!0)};return t.patch(e,T),t.applyData(e,T)}function AT(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Eg=9,Tg=32;function MT(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),c=0;const d=[];for(;r;)d.push(xg(e.slice(c,r.index),c>0,!0),r[0]),c=r.index+r[0].length,r=n.exec(e);return d.push(xg(e.slice(c),c>0,!1)),d.join("")}function xg(t,e,n){let r=0,c=t.length;if(e){let d=t.codePointAt(r);for(;d===Eg||d===Tg;)r++,d=t.codePointAt(r)}if(n){let d=t.codePointAt(c-1);for(;d===Eg||d===Tg;)c--,d=t.codePointAt(c-1)}return c>r?t.slice(r,c):""}function RT(t,e){const n={type:"text",value:MT(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function bT(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const LT={blockquote:lT,break:aT,code:cT,delete:uT,emphasis:dT,footnoteReference:tm,footnote:fT,heading:hT,html:gT,imageReference:pT,image:mT,inlineCode:_T,linkReference:yT,link:NT,listItem:CT,list:TT,paragraph:xT,root:vT,strong:ST,table:OT,tableCell:AT,tableRow:DT,text:RT,thematicBreak:bT,toml:qa,yaml:qa,definition:qa,footnoteDefinition:qa};function qa(){return null}const om=function(t){if(t==null)return $T;if(typeof t=="string")return PT(t);if(typeof t=="object")return Array.isArray(t)?kT(t):IT(t);if(typeof t=="function")return yc(t);throw new Error("Expected function, string, or object as test")};function kT(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=om(t[n]);return yc(r);function r(...c){let d=-1;for(;++d<e.length;)if(e[d].call(this,...c))return!0;return!1}}function IT(t){return yc(e);function e(n){let r;for(r in t)if(n[r]!==t[r])return!1;return!0}}function PT(t){return yc(e);function e(n){return n&&n.type===t}}function yc(t){return e;function e(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...r))}}function $T(){return!0}const FT=!0,vg=!1,BT="skip",HT=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null);const c=om(e),d=r?-1:1;g(t,void 0,[])();function g(p,C,v){const T=p&&typeof p=="object"?p:{};if(typeof T.type=="string"){const R=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(O,"name",{value:"node ("+(p.type+(R?"<"+R+">":""))+")"})}return O;function O(){let R=[],b,x,w;if((!e||c(p,C,v[v.length-1]||null))&&(R=WT(n(p,v)),R[0]===vg))return R;if(p.children&&R[0]!==BT)for(x=(r?p.children.length:-1)+d,w=v.concat(p);x>-1&&x<p.children.length;){if(b=g(p.children[x],x,w)(),b[0]===vg)return b;x=typeof b[1]=="number"?b[1]:x+d}return R}}};function WT(t){return Array.isArray(t)?t:typeof t=="number"?[FT,t]:[t]}const Dd=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null),HT(t,e,c,r);function c(d,g){const p=g[g.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function KT(t){return!t||!t.position||!t.position.start||!t.position.start.line||!t.position.start.column||!t.position.end||!t.position.end.line||!t.position.end.column}const Sg={}.hasOwnProperty;function zT(t){const e=Object.create(null);if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return Dd(t,"definition",r=>{const c=wg(r.identifier);c&&!Sg.call(e,c)&&(e[c]=r)}),n;function n(r){const c=wg(r);return c&&Sg.call(e,c)?e[c]:null}}function wg(t){return String(t||"").toUpperCase()}const cc={}.hasOwnProperty;function UT(t,e){const n=e||{},r=n.allowDangerousHtml||!1,c={};return g.dangerous=r,g.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,g.footnoteLabel=n.footnoteLabel||"Footnotes",g.footnoteLabelTagName=n.footnoteLabelTagName||"h2",g.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},g.footnoteBackLabel=n.footnoteBackLabel||"Back to content",g.unknownHandler=n.unknownHandler,g.passThrough=n.passThrough,g.handlers={...LT,...n.handlers},g.definition=zT(t),g.footnoteById=c,g.footnoteOrder=[],g.footnoteCounts={},g.patch=GT,g.applyData=YT,g.one=p,g.all=C,g.wrap=VT,g.augment=d,Dd(t,"footnoteDefinition",v=>{const T=String(v.identifier).toUpperCase();cc.call(c,T)||(c[T]=v)}),g;function d(v,T){if(v&&"data"in v&&v.data){const O=v.data;O.hName&&(T.type!=="element"&&(T={type:"element",tagName:"",properties:{},children:[]}),T.tagName=O.hName),T.type==="element"&&O.hProperties&&(T.properties={...T.properties,...O.hProperties}),"children"in T&&T.children&&O.hChildren&&(T.children=O.hChildren)}if(v){const O="type"in v?v:{position:v};KT(O)||(T.position={start:wd(O),end:Od(O)})}return T}function g(v,T,O,R){return Array.isArray(O)&&(R=O,O={}),d(v,{type:"element",tagName:T,properties:O||{},children:R||[]})}function p(v,T){return sm(g,v,T)}function C(v){return ro(g,v)}}function GT(t,e){t.position&&(e.position=wT(t))}function YT(t,e){let n=e;if(t&&t.data){const r=t.data.hName,c=t.data.hChildren,d=t.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&d&&(n.properties={...n.properties,...d}),"children"in n&&n.children&&c!==null&&c!==void 0&&(n.children=c)}return n}function sm(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return cc.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:ro(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):jT(t,e)}function ro(t,e){const n=[];if("children"in e){const r=e.children;let c=-1;for(;++c<r.length;){const d=sm(t,r[c],e);if(d){if(c&&r[c-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=d.value.replace(/^\s+/,"")),!Array.isArray(d)&&d.type==="element")){const g=d.children[0];g&&g.type==="text"&&(g.value=g.value.replace(/^\s+/,""))}Array.isArray(d)?n.push(...d):n.push(d)}}}return n}function jT(t,e){const n=e.data||{},r="value"in e&&!(cc.call(n,"hProperties")||cc.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:ro(t,e)};return t.patch(e,r),t.applyData(e,r)}function VT(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
99
+ `:"",r=e.lang?e.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,c={};r&&(c.className=["language-"+r]);let d={type:"element",tagName:"code",properties:c,children:[{type:"text",value:n}]};return e.meta&&(d.data={meta:e.meta}),t.patch(e,d),d=t.applyData(e,d),d={type:"element",tagName:"pre",properties:{},children:[d]},t.patch(e,d),d}function uT(t,e){const n={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function dT(t,e){const n={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function ol(t){const e=[];let n=-1,r=0,c=0;for(;++n<t.length;){const d=t.charCodeAt(n);let g="";if(d===37&&Ju(t.charCodeAt(n+1))&&Ju(t.charCodeAt(n+2)))c=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(g=String.fromCharCode(d));else if(d>55295&&d<57344){const p=t.charCodeAt(n+1);d<56320&&p>56319&&p<57344?(g=String.fromCharCode(d,p),c=1):g="�"}else g=String.fromCharCode(d);g&&(e.push(t.slice(r,n),encodeURIComponent(g)),r=n+c+1,g=""),c&&(n+=c,c=0)}return e.join("")+t.slice(r)}function tm(t,e){const n=String(e.identifier).toUpperCase(),r=ol(n.toLowerCase()),c=t.footnoteOrder.indexOf(n);let d;c===-1?(t.footnoteOrder.push(n),t.footnoteCounts[n]=1,d=t.footnoteOrder.length):(t.footnoteCounts[n]++,d=c+1);const g=t.footnoteCounts[n],p={type:"element",tagName:"a",properties:{href:"#"+t.clobberPrefix+"fn-"+r,id:t.clobberPrefix+"fnref-"+r+(g>1?"-"+g:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};t.patch(e,p);const N={type:"element",tagName:"sup",properties:{},children:[p]};return t.patch(e,N),t.applyData(e,N)}function fT(t,e){const n=t.footnoteById;let r=1;for(;r in n;)r++;const c=String(r);return n[c]={type:"footnoteDefinition",identifier:c,children:[{type:"paragraph",children:e.children}],position:e.position},tm(t,{type:"footnoteReference",identifier:c,position:e.position})}function hT(t,e){const n={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function gT(t,e){if(t.dangerous){const n={type:"raw",value:e.value};return t.patch(e,n),t.applyData(e,n)}return null}function nm(t,e){const n=e.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return{type:"text",value:"!["+e.alt+r};const c=t.all(e),d=c[0];d&&d.type==="text"?d.value="["+d.value:c.unshift({type:"text",value:"["});const g=c[c.length-1];return g&&g.type==="text"?g.value+=r:c.push({type:"text",value:r}),c}function pT(t,e){const n=t.definition(e.identifier);if(!n)return nm(t,e);const r={src:ol(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,c),t.applyData(e,c)}function mT(t,e){const n={src:ol(e.url)};e.alt!==null&&e.alt!==void 0&&(n.alt=e.alt),e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"img",properties:n,children:[]};return t.patch(e,r),t.applyData(e,r)}function _T(t,e){const n={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return t.patch(e,r),t.applyData(e,r)}function yT(t,e){const n=t.definition(e.identifier);if(!n)return nm(t,e);const r={href:ol(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,c),t.applyData(e,c)}function NT(t,e){const n={href:ol(e.url)};e.title!==null&&e.title!==void 0&&(n.title=e.title);const r={type:"element",tagName:"a",properties:n,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function CT(t,e,n){const r=t.all(e),c=n?ET(n):rm(e),d={},g=[];if(typeof e.checked=="boolean"){const T=r[0];let O;T&&T.type==="element"&&T.tagName==="p"?O=T:(O={type:"element",tagName:"p",properties:{},children:[]},r.unshift(O)),O.children.length>0&&O.children.unshift({type:"text",value:" "}),O.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const T=r[p];(c||p!==0||T.type!=="element"||T.tagName!=="p")&&g.push({type:"text",value:`
100
+ `}),T.type==="element"&&T.tagName==="p"&&!c?g.push(...T.children):g.push(T)}const N=r[r.length-1];N&&(c||N.type!=="element"||N.tagName!=="p")&&g.push({type:"text",value:`
101
+ `});const v={type:"element",tagName:"li",properties:d,children:g};return t.patch(e,v),t.applyData(e,v)}function ET(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const n=t.children;let r=-1;for(;!e&&++r<n.length;)e=rm(n[r])}return e}function rm(t){const e=t.spread;return e??t.children.length>1}function TT(t,e){const n={},r=t.all(e);let c=-1;for(typeof e.start=="number"&&e.start!==1&&(n.start=e.start);++c<r.length;){const g=r[c];if(g.type==="element"&&g.tagName==="li"&&g.properties&&Array.isArray(g.properties.className)&&g.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const d={type:"element",tagName:e.ordered?"ol":"ul",properties:n,children:t.wrap(r,!0)};return t.patch(e,d),t.applyData(e,d)}function xT(t,e){const n={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function vT(t,e){const n={type:"root",children:t.wrap(t.all(e))};return t.patch(e,n),t.applyData(e,n)}function ST(t,e){const n={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const wd=im("start"),Od=im("end");function wT(t){return{start:wd(t),end:Od(t)}}function im(t){return e;function e(n){const r=n&&n.position&&n.position[t]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function OT(t,e){const n=t.all(e),r=n.shift(),c=[];if(r){const g={type:"element",tagName:"thead",properties:{},children:t.wrap([r],!0)};t.patch(e.children[0],g),c.push(g)}if(n.length>0){const g={type:"element",tagName:"tbody",properties:{},children:t.wrap(n,!0)},p=wd(e.children[1]),N=Od(e.children[e.children.length-1]);p.line&&N.line&&(g.position={start:p,end:N}),c.push(g)}const d={type:"element",tagName:"table",properties:{},children:t.wrap(c,!0)};return t.patch(e,d),t.applyData(e,d)}function DT(t,e,n){const r=n?n.children:void 0,d=(r?r.indexOf(e):1)===0?"th":"td",g=n&&n.type==="table"?n.align:void 0,p=g?g.length:e.children.length;let N=-1;const v=[];for(;++N<p;){const O=e.children[N],b={},R=g?g[N]:void 0;R&&(b.align=R);let x={type:"element",tagName:d,properties:b,children:[]};O&&(x.children=t.all(O),t.patch(O,x),x=t.applyData(e,x)),v.push(x)}const T={type:"element",tagName:"tr",properties:{},children:t.wrap(v,!0)};return t.patch(e,T),t.applyData(e,T)}function AT(t,e){const n={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}const Eg=9,Tg=32;function MT(t){const e=String(t),n=/\r?\n|\r/g;let r=n.exec(e),c=0;const d=[];for(;r;)d.push(xg(e.slice(c,r.index),c>0,!0),r[0]),c=r.index+r[0].length,r=n.exec(e);return d.push(xg(e.slice(c),c>0,!1)),d.join("")}function xg(t,e,n){let r=0,c=t.length;if(e){let d=t.codePointAt(r);for(;d===Eg||d===Tg;)r++,d=t.codePointAt(r)}if(n){let d=t.codePointAt(c-1);for(;d===Eg||d===Tg;)c--,d=t.codePointAt(c-1)}return c>r?t.slice(r,c):""}function RT(t,e){const n={type:"text",value:MT(String(e.value))};return t.patch(e,n),t.applyData(e,n)}function bT(t,e){const n={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,n),t.applyData(e,n)}const LT={blockquote:lT,break:aT,code:cT,delete:uT,emphasis:dT,footnoteReference:tm,footnote:fT,heading:hT,html:gT,imageReference:pT,image:mT,inlineCode:_T,linkReference:yT,link:NT,listItem:CT,list:TT,paragraph:xT,root:vT,strong:ST,table:OT,tableCell:AT,tableRow:DT,text:RT,thematicBreak:bT,toml:qa,yaml:qa,definition:qa,footnoteDefinition:qa};function qa(){return null}const om=function(t){if(t==null)return $T;if(typeof t=="string")return PT(t);if(typeof t=="object")return Array.isArray(t)?kT(t):IT(t);if(typeof t=="function")return yc(t);throw new Error("Expected function, string, or object as test")};function kT(t){const e=[];let n=-1;for(;++n<t.length;)e[n]=om(t[n]);return yc(r);function r(...c){let d=-1;for(;++d<e.length;)if(e[d].call(this,...c))return!0;return!1}}function IT(t){return yc(e);function e(n){let r;for(r in t)if(n[r]!==t[r])return!1;return!0}}function PT(t){return yc(e);function e(n){return n&&n.type===t}}function yc(t){return e;function e(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&t.call(this,n,...r))}}function $T(){return!0}const FT=!0,vg=!1,BT="skip",HT=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null);const c=om(e),d=r?-1:1;g(t,void 0,[])();function g(p,N,v){const T=p&&typeof p=="object"?p:{};if(typeof T.type=="string"){const b=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(O,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return O;function O(){let b=[],R,x,w;if((!e||c(p,N,v[v.length-1]||null))&&(b=WT(n(p,v)),b[0]===vg))return b;if(p.children&&b[0]!==BT)for(x=(r?p.children.length:-1)+d,w=v.concat(p);x>-1&&x<p.children.length;){if(R=g(p.children[x],x,w)(),R[0]===vg)return R;x=typeof R[1]=="number"?R[1]:x+d}return b}}};function WT(t){return Array.isArray(t)?t:typeof t=="number"?[FT,t]:[t]}const Dd=function(t,e,n,r){typeof e=="function"&&typeof n!="function"&&(r=n,n=e,e=null),HT(t,e,c,r);function c(d,g){const p=g[g.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function KT(t){return!t||!t.position||!t.position.start||!t.position.start.line||!t.position.start.column||!t.position.end||!t.position.end.line||!t.position.end.column}const Sg={}.hasOwnProperty;function zT(t){const e=Object.create(null);if(!t||!t.type)throw new Error("mdast-util-definitions expected node");return Dd(t,"definition",r=>{const c=wg(r.identifier);c&&!Sg.call(e,c)&&(e[c]=r)}),n;function n(r){const c=wg(r);return c&&Sg.call(e,c)?e[c]:null}}function wg(t){return String(t||"").toUpperCase()}const cc={}.hasOwnProperty;function UT(t,e){const n=e||{},r=n.allowDangerousHtml||!1,c={};return g.dangerous=r,g.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,g.footnoteLabel=n.footnoteLabel||"Footnotes",g.footnoteLabelTagName=n.footnoteLabelTagName||"h2",g.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},g.footnoteBackLabel=n.footnoteBackLabel||"Back to content",g.unknownHandler=n.unknownHandler,g.passThrough=n.passThrough,g.handlers={...LT,...n.handlers},g.definition=zT(t),g.footnoteById=c,g.footnoteOrder=[],g.footnoteCounts={},g.patch=GT,g.applyData=YT,g.one=p,g.all=N,g.wrap=VT,g.augment=d,Dd(t,"footnoteDefinition",v=>{const T=String(v.identifier).toUpperCase();cc.call(c,T)||(c[T]=v)}),g;function d(v,T){if(v&&"data"in v&&v.data){const O=v.data;O.hName&&(T.type!=="element"&&(T={type:"element",tagName:"",properties:{},children:[]}),T.tagName=O.hName),T.type==="element"&&O.hProperties&&(T.properties={...T.properties,...O.hProperties}),"children"in T&&T.children&&O.hChildren&&(T.children=O.hChildren)}if(v){const O="type"in v?v:{position:v};KT(O)||(T.position={start:wd(O),end:Od(O)})}return T}function g(v,T,O,b){return Array.isArray(O)&&(b=O,O={}),d(v,{type:"element",tagName:T,properties:O||{},children:b||[]})}function p(v,T){return sm(g,v,T)}function N(v){return ro(g,v)}}function GT(t,e){t.position&&(e.position=wT(t))}function YT(t,e){let n=e;if(t&&t.data){const r=t.data.hName,c=t.data.hChildren,d=t.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&d&&(n.properties={...n.properties,...d}),"children"in n&&n.children&&c!==null&&c!==void 0&&(n.children=c)}return n}function sm(t,e,n){const r=e&&e.type;if(!r)throw new Error("Expected node, got `"+e+"`");return cc.call(t.handlers,r)?t.handlers[r](t,e,n):t.passThrough&&t.passThrough.includes(r)?"children"in e?{...e,children:ro(t,e)}:e:t.unknownHandler?t.unknownHandler(t,e,n):jT(t,e)}function ro(t,e){const n=[];if("children"in e){const r=e.children;let c=-1;for(;++c<r.length;){const d=sm(t,r[c],e);if(d){if(c&&r[c-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=d.value.replace(/^\s+/,"")),!Array.isArray(d)&&d.type==="element")){const g=d.children[0];g&&g.type==="text"&&(g.value=g.value.replace(/^\s+/,""))}Array.isArray(d)?n.push(...d):n.push(d)}}}return n}function jT(t,e){const n=e.data||{},r="value"in e&&!(cc.call(n,"hProperties")||cc.call(n,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:ro(t,e)};return t.patch(e,r),t.applyData(e,r)}function VT(t,e){const n=[];let r=-1;for(e&&n.push({type:"text",value:`
102
102
  `});++r<t.length;)r&&n.push({type:"text",value:`
103
103
  `}),n.push(t[r]);return e&&t.length>0&&n.push({type:"text",value:`
104
- `}),n}const qT=(t,e)=>t(e,"i",ro(t,e)),ZT=(t,e)=>t(e,"b",ro(t,e)),JT=(t,e)=>t(e,"u",ro(t,e)),XT=(t,e)=>t(e,"s",ro(t,e)),QT=(t,e)=>t(e,"sub",ro(t,e)),ex=(t,e)=>t(e,"sup",ro(t,e)),tx={emphasis:qT,strong:ZT,underline:JT,strikethrough:XT,subscript:QT,superscript:ex},nx=t=>{const[e,n]=et.useState();let r;return et.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-Hfn6D19v.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:t.markdown,remarkPlugins:[sT],remarkRehypeOptions:{handlers:tx}});n(d)})()},[t.markdown]),e||null};class gs extends Error{}class rx extends gs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ix extends gs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ox extends gs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class qs extends gs{}class lm extends gs{constructor(e){super(`Invalid unit ${e}`)}}class xr extends gs{}class So extends gs{constructor(){super("Zone is an abstract class")}}const it="numeric",pi="short",Lr="long",uc={year:it,month:it,day:it},am={year:it,month:pi,day:it},sx={year:it,month:pi,day:it,weekday:pi},cm={year:it,month:Lr,day:it},um={year:it,month:Lr,day:it,weekday:Lr},dm={hour:it,minute:it},fm={hour:it,minute:it,second:it},hm={hour:it,minute:it,second:it,timeZoneName:pi},gm={hour:it,minute:it,second:it,timeZoneName:Lr},pm={hour:it,minute:it,hourCycle:"h23"},mm={hour:it,minute:it,second:it,hourCycle:"h23"},_m={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:pi},ym={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:Lr},Nm={year:it,month:it,day:it,hour:it,minute:it},Cm={year:it,month:it,day:it,hour:it,minute:it,second:it},Em={year:it,month:pi,day:it,hour:it,minute:it},Tm={year:it,month:pi,day:it,hour:it,minute:it,second:it},lx={year:it,month:pi,day:it,weekday:pi,hour:it,minute:it},xm={year:it,month:Lr,day:it,hour:it,minute:it,timeZoneName:pi},vm={year:it,month:Lr,day:it,hour:it,minute:it,second:it,timeZoneName:pi},Sm={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,timeZoneName:Lr},wm={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,second:it,timeZoneName:Lr};class ta{get type(){throw new So}get name(){throw new So}get ianaName(){return this.name}get isUniversal(){throw new So}offsetName(e,n){throw new So}formatOffset(e,n){throw new So}offset(e){throw new So}equals(e){throw new So}get isValid(){throw new So}}let bu=null;class Nc extends ta{static get instance(){return bu===null&&(bu=new Nc),bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return Im(e,n,r)}formatOffset(e,n){return Jl(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ic={};function ax(t){return ic[t]||(ic[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ic[t]}const cx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ux(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,c,d,g,p,C,v,T]=r;return[g,c,d,p,C,v,T]}function dx(t,e){const n=t.formatToParts(e),r=[];for(let c=0;c<n.length;c++){const{type:d,value:g}=n[c],p=cx[d];d==="era"?r[p]=g:Lt(p)||(r[p]=parseInt(g,10))}return r}let Za={};class no extends ta{static create(e){return Za[e]||(Za[e]=new no(e)),Za[e]}static resetCache(){Za={},ic={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=no.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return Im(e,n,r,this.name)}formatOffset(e,n){return Jl(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const r=ax(this.name);let[c,d,g,p,C,v,T]=r.formatToParts?dx(r,n):ux(r,n);p==="BC"&&(c=-Math.abs(c)+1);const R=Ec({year:c,month:d,day:g,hour:C===24?0:C,minute:v,second:T,millisecond:0});let b=+n;const x=b%1e3;return b-=x>=0?x:1e3+x,(R-b)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Og={};function fx(t,e={}){const n=JSON.stringify([t,e]);let r=Og[n];return r||(r=new Intl.ListFormat(t,e),Og[n]=r),r}let Xu={};function Qu(t,e={}){const n=JSON.stringify([t,e]);let r=Xu[n];return r||(r=new Intl.DateTimeFormat(t,e),Xu[n]=r),r}let ed={};function hx(t,e={}){const n=JSON.stringify([t,e]);let r=ed[n];return r||(r=new Intl.NumberFormat(t,e),ed[n]=r),r}let td={};function gx(t,e={}){const{base:n,...r}=e,c=JSON.stringify([t,r]);let d=td[c];return d||(d=new Intl.RelativeTimeFormat(t,e),td[c]=d),d}let Vl=null;function px(){return Vl||(Vl=new Intl.DateTimeFormat().resolvedOptions().locale,Vl)}let Dg={};function mx(t){let e=Dg[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Dg[t]=e}return e}function _x(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let r,c;try{r=Qu(t).resolvedOptions(),c=t}catch{const C=t.substring(0,n);r=Qu(C).resolvedOptions(),c=C}const{numberingSystem:d,calendar:g}=r;return[c,d,g]}}function yx(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function Nx(t){const e=[];for(let n=1;n<=12;n++){const r=Dt.utc(2009,n,1);e.push(t(r))}return e}function Cx(t){const e=[];for(let n=1;n<=7;n++){const r=Dt.utc(2016,11,13+n);e.push(t(r))}return e}function Ja(t,e,n,r){const c=t.listingMode();return c==="error"?null:c==="en"?n(e):r(e)}function Ex(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class Tx{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:c,floor:d,...g}=r;if(!n||Object.keys(g).length>0){const p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=hx(e,p)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):bd(e,3);return Pn(n,this.padTo)}}}class xx{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let c;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const g=-1*(e.offset/60),p=g>=0?`Etc/GMT+${g}`:`Etc/GMT${g}`;e.offset!==0&&no.create(p).valid?(c=p,this.dt=e):(c="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,c=e.zone.name):(c="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const d={...this.opts};d.timeZone=d.timeZone||c,this.dtf=Qu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class vx{constructor(e,n,r){this.opts={style:"long",...r},!n&&Lm()&&(this.rtf=gx(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):Ux(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const Sx={firstDay:1,minimalDays:4,weekend:[6,7]};class en{static fromOpts(e){return en.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,c,d=!1){const g=e||bn.defaultLocale,p=g||(d?"en-US":px()),C=n||bn.defaultNumberingSystem,v=r||bn.defaultOutputCalendar,T=nd(c)||bn.defaultWeekSettings;return new en(p,C,v,T,g)}static resetCache(){Vl=null,Xu={},ed={},td={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:c}={}){return en.create(e,n,r,c)}constructor(e,n,r,c,d){const[g,p,C]=_x(e);this.locale=g,this.numberingSystem=n||p||null,this.outputCalendar=r||C||null,this.weekSettings=c,this.intl=yx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ex(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:en.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,nd(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Ja(this,e,Fm,()=>{const r=n?{month:e,day:"numeric"}:{month:e},c=n?"format":"standalone";return this.monthsCache[c][e]||(this.monthsCache[c][e]=Nx(d=>this.extract(d,r,"month"))),this.monthsCache[c][e]})}weekdays(e,n=!1){return Ja(this,e,Wm,()=>{const r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},c=n?"format":"standalone";return this.weekdaysCache[c][e]||(this.weekdaysCache[c][e]=Cx(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[c][e]})}meridiems(){return Ja(this,void 0,()=>Km,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Dt.utc(2016,11,13,9),Dt.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ja(this,e,zm,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[Dt.utc(-40,1,1),Dt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){const c=this.dtFormatter(e,n),d=c.formatToParts(),g=d.find(p=>p.type.toLowerCase()===r);return g?g.value:null}numberFormatter(e={}){return new Tx(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new xx(e,this.intl,n)}relFormatter(e={}){return new vx(this.intl,this.isEnglish(),e)}listFormatter(e={}){return fx(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:km()?mx(this.locale):Sx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let Lu=null;class ur extends ta{static get utcInstance(){return Lu===null&&(Lu=new ur(0)),Lu}static instance(e){return e===0?ur.utcInstance:new ur(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ur(Tc(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Jl(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class wx extends ta{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Do(t,e){if(Lt(t)||t===null)return e;if(t instanceof ta)return t;if(Ax(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?Nc.instance:n==="utc"||n==="gmt"?ur.utcInstance:ur.parseSpecifier(n)||no.create(t)}else return ds(t)?ur.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new wx(t)}let Ag=()=>Date.now(),Mg="system",Rg=null,bg=null,Lg=null,kg=60,Ig,Pg=null;class bn{static get now(){return Ag}static set now(e){Ag=e}static set defaultZone(e){Mg=e}static get defaultZone(){return Do(Mg,Nc.instance)}static get defaultLocale(){return Rg}static set defaultLocale(e){Rg=e}static get defaultNumberingSystem(){return bg}static set defaultNumberingSystem(e){bg=e}static get defaultOutputCalendar(){return Lg}static set defaultOutputCalendar(e){Lg=e}static get defaultWeekSettings(){return Pg}static set defaultWeekSettings(e){Pg=nd(e)}static get twoDigitCutoffYear(){return kg}static set twoDigitCutoffYear(e){kg=e%100}static get throwOnInvalid(){return Ig}static set throwOnInvalid(e){Ig=e}static resetCaches(){en.resetCache(),no.resetCache()}}class gi{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Om=[0,31,59,90,120,151,181,212,243,273,304,334],Dm=[0,31,60,91,121,152,182,213,244,274,305,335];function Vr(t,e){return new gi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Ad(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const c=r.getUTCDay();return c===0?7:c}function Am(t,e,n){return n+(na(t)?Dm:Om)[e-1]}function Mm(t,e){const n=na(t)?Dm:Om,r=n.findIndex(d=>d<e),c=e-n[r];return{month:r+1,day:c}}function Md(t,e){return(t-e+7)%7+1}function dc(t,e=4,n=1){const{year:r,month:c,day:d}=t,g=Am(r,c,d),p=Md(Ad(r,c,d),n);let C=Math.floor((g-p+14-e)/7),v;return C<1?(v=r-1,C=ea(v,e,n)):C>ea(r,e,n)?(v=r+1,C=1):v=r,{weekYear:v,weekNumber:C,weekday:p,...xc(t)}}function $g(t,e=4,n=1){const{weekYear:r,weekNumber:c,weekday:d}=t,g=Md(Ad(r,1,e),n),p=Zs(r);let C=c*7+d-g-7+e,v;C<1?(v=r-1,C+=Zs(v)):C>p?(v=r+1,C-=Zs(r)):v=r;const{month:T,day:O}=Mm(v,C);return{year:v,month:T,day:O,...xc(t)}}function ku(t){const{year:e,month:n,day:r}=t,c=Am(e,n,r);return{year:e,ordinal:c,...xc(t)}}function Fg(t){const{year:e,ordinal:n}=t,{month:r,day:c}=Mm(e,n);return{year:e,month:r,day:c,...xc(t)}}function Bg(t,e){if(!Lt(t.localWeekday)||!Lt(t.localWeekNumber)||!Lt(t.localWeekYear)){if(!Lt(t.weekday)||!Lt(t.weekNumber)||!Lt(t.weekYear))throw new qs("Cannot mix locale-based week fields with ISO-based week fields");return Lt(t.localWeekday)||(t.weekday=t.localWeekday),Lt(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Lt(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Ox(t,e=4,n=1){const r=Cc(t.weekYear),c=qr(t.weekNumber,1,ea(t.weekYear,e,n)),d=qr(t.weekday,1,7);return r?c?d?!1:Vr("weekday",t.weekday):Vr("week",t.weekNumber):Vr("weekYear",t.weekYear)}function Dx(t){const e=Cc(t.year),n=qr(t.ordinal,1,Zs(t.year));return e?n?!1:Vr("ordinal",t.ordinal):Vr("year",t.year)}function Rm(t){const e=Cc(t.year),n=qr(t.month,1,12),r=qr(t.day,1,fc(t.year,t.month));return e?n?r?!1:Vr("day",t.day):Vr("month",t.month):Vr("year",t.year)}function bm(t){const{hour:e,minute:n,second:r,millisecond:c}=t,d=qr(e,0,23)||e===24&&n===0&&r===0&&c===0,g=qr(n,0,59),p=qr(r,0,59),C=qr(c,0,999);return d?g?p?C?!1:Vr("millisecond",c):Vr("second",r):Vr("minute",n):Vr("hour",e)}function Lt(t){return typeof t>"u"}function ds(t){return typeof t=="number"}function Cc(t){return typeof t=="number"&&t%1===0}function Ax(t){return typeof t=="string"}function Mx(t){return Object.prototype.toString.call(t)==="[object Date]"}function Lm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function km(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Rx(t){return Array.isArray(t)?t:[t]}function Hg(t,e,n){if(t.length!==0)return t.reduce((r,c)=>{const d=[e(c),c];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function bx(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function el(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function nd(t){if(t==null)return null;if(typeof t!="object")throw new xr("Week settings must be an object");if(!qr(t.firstDay,1,7)||!qr(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!qr(e,1,7)))throw new xr("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function qr(t,e,n){return Cc(t)&&t>=e&&t<=n}function Lx(t,e){return t-e*Math.floor(t/e)}function Pn(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Oo(t){if(!(Lt(t)||t===null||t===""))return parseInt(t,10)}function is(t){if(!(Lt(t)||t===null||t===""))return parseFloat(t)}function Rd(t){if(!(Lt(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function bd(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function na(t){return t%4===0&&(t%100!==0||t%400===0)}function Zs(t){return na(t)?366:365}function fc(t,e){const n=Lx(e-1,12)+1,r=t+(e-n)/12;return n===2?na(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Ec(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Wg(t,e,n){return-Md(Ad(t,1,e),n)+e-1}function ea(t,e=4,n=1){const r=Wg(t,e,n),c=Wg(t+1,e,n);return(Zs(t)-r+c)/7}function rd(t){return t>99?t:t>bn.twoDigitCutoffYear?1900+t:2e3+t}function Im(t,e,n,r=null){const c=new Date(t),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const g={timeZoneName:e,...d},p=new Intl.DateTimeFormat(n,g).formatToParts(c).find(C=>C.type.toLowerCase()==="timezonename");return p?p.value:null}function Tc(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,c=n<0||Object.is(n,-0)?-r:r;return n*60+c}function Pm(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new xr(`Invalid unit value ${t}`);return e}function hc(t,e){const n={};for(const r in t)if(el(t,r)){const c=t[r];if(c==null)continue;n[e(r)]=Pm(c)}return n}function Jl(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),c=t>=0?"+":"-";switch(e){case"short":return`${c}${Pn(n,2)}:${Pn(r,2)}`;case"narrow":return`${c}${n}${r>0?`:${r}`:""}`;case"techie":return`${c}${Pn(n,2)}${Pn(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function xc(t){return bx(t,["hour","minute","second","millisecond"])}const kx=["January","February","March","April","May","June","July","August","September","October","November","December"],$m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ix=["J","F","M","A","M","J","J","A","S","O","N","D"];function Fm(t){switch(t){case"narrow":return[...Ix];case"short":return[...$m];case"long":return[...kx];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Bm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Hm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Px=["M","T","W","T","F","S","S"];function Wm(t){switch(t){case"narrow":return[...Px];case"short":return[...Hm];case"long":return[...Bm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Km=["AM","PM"],$x=["Before Christ","Anno Domini"],Fx=["BC","AD"],Bx=["B","A"];function zm(t){switch(t){case"narrow":return[...Bx];case"short":return[...Fx];case"long":return[...$x];default:return null}}function Hx(t){return Km[t.hour<12?0:1]}function Wx(t,e){return Wm(e)[t.weekday-1]}function Kx(t,e){return Fm(e)[t.month-1]}function zx(t,e){return zm(e)[t.year<0?0:1]}function Ux(t,e,n="always",r=!1){const c={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},d=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&d){const O=t==="days";switch(e){case 1:return O?"tomorrow":`next ${c[t][0]}`;case-1:return O?"yesterday":`last ${c[t][0]}`;case 0:return O?"today":`this ${c[t][0]}`}}const g=Object.is(e,-0)||e<0,p=Math.abs(e),C=p===1,v=c[t],T=r?C?v[1]:v[2]||v[1]:C?c[t][0]:t;return g?`${p} ${T} ago`:`in ${p} ${T}`}function Kg(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const Gx={D:uc,DD:am,DDD:cm,DDDD:um,t:dm,tt:fm,ttt:hm,tttt:gm,T:pm,TT:mm,TTT:_m,TTTT:ym,f:Nm,ff:Em,fff:xm,ffff:Sm,F:Cm,FF:Tm,FFF:vm,FFFF:wm};class or{static create(e,n={}){return new or(e,n)}static parseFormat(e){let n=null,r="",c=!1;const d=[];for(let g=0;g<e.length;g++){const p=e.charAt(g);p==="'"?(r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),n=null,r="",c=!c):c||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(e){return Gx[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return Pn(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(b,x)=>this.loc.extract(e,b,x),g=b=>e.isOffsetFixed&&e.offset===0&&b.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,b.format):"",p=()=>r?Hx(e):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),C=(b,x)=>r?Kx(e,b):d(x?{month:b}:{month:b,day:"numeric"},"month"),v=(b,x)=>r?Wx(e,b):d(x?{weekday:b}:{weekday:b,month:"long",day:"numeric"},"weekday"),T=b=>{const x=or.macroTokenToFormatOpts(b);return x?this.formatWithSystemDefault(e,x):b},O=b=>r?zx(e,b):d({era:b},"era"),R=b=>{switch(b){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return g({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return g({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return g({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return p();case"d":return c?d({day:"numeric"},"day"):this.num(e.day);case"dd":return c?d({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return v("short",!0);case"cccc":return v("long",!0);case"ccccc":return v("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return v("short",!1);case"EEEE":return v("long",!1);case"EEEEE":return v("narrow",!1);case"L":return c?d({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return c?d({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return C("short",!0);case"LLLL":return C("long",!0);case"LLLLL":return C("narrow",!0);case"M":return c?d({month:"numeric"},"month"):this.num(e.month);case"MM":return c?d({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return C("short",!1);case"MMMM":return C("long",!1);case"MMMMM":return C("narrow",!1);case"y":return c?d({year:"numeric"},"year"):this.num(e.year);case"yy":return c?d({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return c?d({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return c?d({year:"numeric"},"year"):this.num(e.year,6);case"G":return O("short");case"GG":return O("long");case"GGGGG":return O("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return T(b)}};return Kg(or.parseFormat(n),R)}formatDurationFromString(e,n){const r=C=>{switch(C[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=C=>v=>{const T=r(v);return T?this.num(C.get(T),v.length):v},d=or.parseFormat(n),g=d.reduce((C,{literal:v,val:T})=>v?C:C.concat(T),[]),p=e.shiftTo(...g.map(r).filter(C=>C));return Kg(d,c(p))}}const Um=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function sl(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function ll(...t){return e=>t.reduce(([n,r,c],d)=>{const[g,p,C]=d(e,c);return[{...n,...g},p||r,C]},[{},null,1]).slice(0,2)}function al(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const c=n.exec(t);if(c)return r(c)}return[null,null]}function Gm(...t){return(e,n)=>{const r={};let c;for(c=0;c<t.length;c++)r[t[c]]=Oo(e[n+c]);return[r,null,n+c]}}const Ym=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Yx=`(?:${Ym.source}?(?:\\[(${Um.source})\\])?)?`,Ld=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jm=RegExp(`${Ld.source}${Yx}`),kd=RegExp(`(?:T${jm.source})?`),jx=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Vx=/(\d{4})-?W(\d\d)(?:-?(\d))?/,qx=/(\d{4})-?(\d{3})/,Zx=Gm("weekYear","weekNumber","weekDay"),Jx=Gm("year","ordinal"),Xx=/(\d{4})-(\d\d)-(\d\d)/,Vm=RegExp(`${Ld.source} ?(?:${Ym.source}|(${Um.source}))?`),Qx=RegExp(`(?: ${Vm.source})?`);function Js(t,e,n){const r=t[e];return Lt(r)?n:Oo(r)}function ev(t,e){return[{year:Js(t,e),month:Js(t,e+1,1),day:Js(t,e+2,1)},null,e+3]}function cl(t,e){return[{hours:Js(t,e,0),minutes:Js(t,e+1,0),seconds:Js(t,e+2,0),milliseconds:Rd(t[e+3])},null,e+4]}function ra(t,e){const n=!t[e]&&!t[e+1],r=Tc(t[e+1],t[e+2]),c=n?null:ur.instance(r);return[{},c,e+3]}function ia(t,e){const n=t[e]?no.create(t[e]):null;return[{},n,e+1]}const tv=RegExp(`^T?${Ld.source}$`),nv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function rv(t){const[e,n,r,c,d,g,p,C,v]=t,T=e[0]==="-",O=C&&C[0]==="-",R=(b,x=!1)=>b!==void 0&&(x||b&&T)?-b:b;return[{years:R(is(n)),months:R(is(r)),weeks:R(is(c)),days:R(is(d)),hours:R(is(g)),minutes:R(is(p)),seconds:R(is(C),C==="-0"),milliseconds:R(Rd(v),O)}]}const iv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Id(t,e,n,r,c,d,g){const p={year:e.length===2?rd(Oo(e)):Oo(e),month:$m.indexOf(n)+1,day:Oo(r),hour:Oo(c),minute:Oo(d)};return g&&(p.second=Oo(g)),t&&(p.weekday=t.length>3?Bm.indexOf(t)+1:Hm.indexOf(t)+1),p}const ov=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function sv(t){const[,e,n,r,c,d,g,p,C,v,T,O]=t,R=Id(e,c,r,n,d,g,p);let b;return C?b=iv[C]:v?b=0:b=Tc(T,O),[R,new ur(b)]}function lv(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const av=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,uv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function zg(t){const[,e,n,r,c,d,g,p]=t;return[Id(e,c,r,n,d,g,p),ur.utcInstance]}function dv(t){const[,e,n,r,c,d,g,p]=t;return[Id(e,p,n,r,c,d,g),ur.utcInstance]}const fv=sl(jx,kd),hv=sl(Vx,kd),gv=sl(qx,kd),pv=sl(jm),qm=ll(ev,cl,ra,ia),mv=ll(Zx,cl,ra,ia),_v=ll(Jx,cl,ra,ia),yv=ll(cl,ra,ia);function Nv(t){return al(t,[fv,qm],[hv,mv],[gv,_v],[pv,yv])}function Cv(t){return al(lv(t),[ov,sv])}function Ev(t){return al(t,[av,zg],[cv,zg],[uv,dv])}function Tv(t){return al(t,[nv,rv])}const xv=ll(cl);function vv(t){return al(t,[tv,xv])}const Sv=sl(Xx,Qx),wv=sl(Vm),Ov=ll(cl,ra,ia);function Dv(t){return al(t,[Sv,qm],[wv,Ov])}const Ug="Invalid Duration",Zm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Av={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Zm},Yr=146097/400,Ys=146097/4800,Mv={years:{quarters:4,months:12,weeks:Yr/7,days:Yr,hours:Yr*24,minutes:Yr*24*60,seconds:Yr*24*60*60,milliseconds:Yr*24*60*60*1e3},quarters:{months:3,weeks:Yr/28,days:Yr/4,hours:Yr*24/4,minutes:Yr*24*60/4,seconds:Yr*24*60*60/4,milliseconds:Yr*24*60*60*1e3/4},months:{weeks:Ys/7,days:Ys,hours:Ys*24,minutes:Ys*24*60,seconds:Ys*24*60*60,milliseconds:Ys*24*60*60*1e3},...Zm},us=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Rv=us.slice(0).reverse();function wo(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new jt(r)}function Jm(t,e){let n=e.milliseconds??0;for(const r of Rv.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function Gg(t,e){const n=Jm(t,e)<0?-1:1;us.reduceRight((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]*n,g=t[c][r],p=Math.floor(d/g);e[c]+=p*n,e[r]-=p*g*n}return c},null),us.reduce((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]%1;e[r]-=d,e[c]+=d*t[r][c]}return c},null)}function bv(t){const e={};for(const[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}class jt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?Mv:Av;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||en.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return jt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new xr(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new jt({values:hc(e,jt.normalizeUnit),loc:en.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(ds(e))return jt.fromMillis(e);if(jt.isDuration(e))return e;if(typeof e=="object")return jt.fromObject(e);throw new xr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=Tv(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=vv(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Duration is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new ox(r);return new jt({invalid:r})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new lm(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?or.create(this.loc,r).formatDurationFromString(this,e):Ug}toHuman(e={}){if(!this.isValid)return Ug;const n=us.map(r=>{const c=this.values[r];return Lt(c)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(c)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=bd(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Dt.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Jm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e),r={};for(const c of us)(el(n.values,c)||el(this.values,c))&&(r[c]=n.get(c)+this.get(c));return wo(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Pm(e(this.values[r],r));return wo(this,{values:n},!0)}get(e){return this[jt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...hc(e,jt.normalizeUnit)};return wo(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:c}={}){const g={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:c,conversionAccuracy:r};return wo(this,g)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Gg(this.matrix,e),wo(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=bv(this.normalize().shiftToAll().toObject());return wo(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(g=>jt.normalizeUnit(g));const n={},r={},c=this.toObject();let d;for(const g of us)if(e.indexOf(g)>=0){d=g;let p=0;for(const v in r)p+=this.matrix[v][g]*r[v],r[v]=0;ds(c[g])&&(p+=c[g]);const C=Math.trunc(p);n[g]=C,r[g]=(p*1e3-C*1e3)/1e3}else ds(c[g])&&(r[g]=c[g]);for(const g in r)r[g]!==0&&(n[d]+=g===d?r[g]:r[g]/this.matrix[d][g]);return Gg(this.matrix,n),wo(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return wo(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,c){return r===void 0||r===0?c===void 0||c===0:r===c}for(const r of us)if(!n(this.values[r],e.values[r]))return!1;return!0}}const js="Invalid Interval";function Lv(t,e){return!t||!t.isValid?wn.invalid("missing or invalid start"):!e||!e.isValid?wn.invalid("missing or invalid end"):e<t?wn.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class wn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Interval is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new ix(r);return new wn({invalid:r})}static fromDateTimes(e,n){const r=Gl(e),c=Gl(n),d=Lv(r,c);return d??new wn({start:r,end:c})}static after(e,n){const r=jt.fromDurationLike(n),c=Gl(e);return wn.fromDateTimes(c,c.plus(r))}static before(e,n){const r=jt.fromDurationLike(n),c=Gl(e);return wn.fromDateTimes(c.minus(r),c)}static fromISO(e,n){const[r,c]=(e||"").split("/",2);if(r&&c){let d,g;try{d=Dt.fromISO(r,n),g=d.isValid}catch{g=!1}let p,C;try{p=Dt.fromISO(c,n),C=p.isValid}catch{C=!1}if(g&&C)return wn.fromDateTimes(d,p);if(g){const v=jt.fromISO(c,n);if(v.isValid)return wn.after(d,v)}else if(C){const v=jt.fromISO(r,n);if(v.isValid)return wn.before(p,v)}}return wn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(e,n);let c;return n!=null&&n.useLocaleWeeks?c=this.end.reconfigure({locale:r.locale}):c=this.end,c=c.startOf(e,n),Math.floor(c.diff(r,e).get(e))+(c.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?wn.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Gl).filter(g=>this.contains(g)).sort((g,p)=>g.toMillis()-p.toMillis()),r=[];let{s:c}=this,d=0;for(;c<this.e;){const g=n[d]||this.e,p=+g>+this.e?this.e:g;r.push(wn.fromDateTimes(c,p)),c=p,d+=1}return r}splitBy(e){const n=jt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,c=1,d;const g=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(C=>C*c));d=+p>+this.e?this.e:p,g.push(wn.fromDateTimes(r,d)),r=d,c+=1}return g}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:wn.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return wn.fromDateTimes(n,r)}static merge(e){const[n,r]=e.sort((c,d)=>c.s-d.s).reduce(([c,d],g)=>d?d.overlaps(g)||d.abutsStart(g)?[c,d.union(g)]:[c.concat([d]),g]:[c,g],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0;const c=[],d=e.map(C=>[{time:C.s,type:"s"},{time:C.e,type:"e"}]),g=Array.prototype.concat(...d),p=g.sort((C,v)=>C.time-v.time);for(const C of p)r+=C.type==="s"?1:-1,r===1?n=C.time:(n&&+n!=+C.time&&c.push(wn.fromDateTimes(n,C.time)),n=null);return wn.merge(c)}difference(...e){return wn.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:js}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=uc,n={}){return this.isValid?or.create(this.s.loc.clone(n),e).formatInterval(this):js}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:js}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:js}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:js}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:js}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):jt.invalid(this.invalidReason)}mapEndpoints(e){return wn.fromDateTimes(e(this.s),e(this.e))}}class Xa{static hasDST(e=bn.defaultZone){const n=Dt.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return no.isValidZone(e)}static normalizeZone(e){return Do(e,bn.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return en.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return en.create(n,null,"gregory").eras(e)}static features(){return{relative:Lm(),localeWeek:km()}}}function Yg(t,e){const n=c=>c.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(jt.fromMillis(r).as("days"))}function kv(t,e,n){const r=[["years",(C,v)=>v.year-C.year],["quarters",(C,v)=>v.quarter-C.quarter+(v.year-C.year)*4],["months",(C,v)=>v.month-C.month+(v.year-C.year)*12],["weeks",(C,v)=>{const T=Yg(C,v);return(T-T%7)/7}],["days",Yg]],c={},d=t;let g,p;for(const[C,v]of r)n.indexOf(C)>=0&&(g=C,c[C]=v(t,e),p=d.plus(c),p>e?(c[C]--,t=d.plus(c),t>e&&(p=t,c[C]--,t=d.plus(c))):t=p);return[t,c,p,g]}function Iv(t,e,n,r){let[c,d,g,p]=kv(t,e,n);const C=e-c,v=n.filter(O=>["hours","minutes","seconds","milliseconds"].indexOf(O)>=0);v.length===0&&(g<e&&(g=c.plus({[p]:1})),g!==c&&(d[p]=(d[p]||0)+C/(g-c)));const T=jt.fromObject(d,r);return v.length>0?jt.fromMillis(C,r).shiftTo(...v).plus(T):T}const Pd={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},jg={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Pv=Pd.hanidec.replace(/[\[|\]]/g,"").split("");function $v(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(t[n].search(Pd.hanidec)!==-1)e+=Pv.indexOf(t[n]);else for(const c in jg){const[d,g]=jg[c];r>=d&&r<=g&&(e+=r-d)}}return parseInt(e,10)}else return e}function di({numberingSystem:t},e=""){return new RegExp(`${Pd[t||"latn"]}${e}`)}const Fv="missing Intl.DateTimeFormat.formatToParts support";function Jt(t,e=n=>n){return{regex:t,deser:([n])=>e($v(n))}}const Bv=" ",Xm=`[ ${Bv}]`,Qm=new RegExp(Xm,"g");function Hv(t){return t.replace(/\./g,"\\.?").replace(Qm,Xm)}function Vg(t){return t.replace(/\./g,"").replace(Qm," ").toLowerCase()}function fi(t,e){return t===null?null:{regex:RegExp(t.map(Hv).join("|")),deser:([n])=>t.findIndex(r=>Vg(n)===Vg(r))+e}}function qg(t,e){return{regex:t,deser:([,n,r])=>Tc(n,r),groups:e}}function Qa(t){return{regex:t,deser:([e])=>e}}function Wv(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Kv(t,e){const n=di(e),r=di(e,"{2}"),c=di(e,"{3}"),d=di(e,"{4}"),g=di(e,"{6}"),p=di(e,"{1,2}"),C=di(e,"{1,3}"),v=di(e,"{1,6}"),T=di(e,"{1,9}"),O=di(e,"{2,4}"),R=di(e,"{4,6}"),b=$=>({regex:RegExp(Wv($.val)),deser:([W])=>W,literal:!0}),w=($=>{if(t.literal)return b($);switch($.val){case"G":return fi(e.eras("short"),0);case"GG":return fi(e.eras("long"),0);case"y":return Jt(v);case"yy":return Jt(O,rd);case"yyyy":return Jt(d);case"yyyyy":return Jt(R);case"yyyyyy":return Jt(g);case"M":return Jt(p);case"MM":return Jt(r);case"MMM":return fi(e.months("short",!0),1);case"MMMM":return fi(e.months("long",!0),1);case"L":return Jt(p);case"LL":return Jt(r);case"LLL":return fi(e.months("short",!1),1);case"LLLL":return fi(e.months("long",!1),1);case"d":return Jt(p);case"dd":return Jt(r);case"o":return Jt(C);case"ooo":return Jt(c);case"HH":return Jt(r);case"H":return Jt(p);case"hh":return Jt(r);case"h":return Jt(p);case"mm":return Jt(r);case"m":return Jt(p);case"q":return Jt(p);case"qq":return Jt(r);case"s":return Jt(p);case"ss":return Jt(r);case"S":return Jt(C);case"SSS":return Jt(c);case"u":return Qa(T);case"uu":return Qa(p);case"uuu":return Jt(n);case"a":return fi(e.meridiems(),0);case"kkkk":return Jt(d);case"kk":return Jt(O,rd);case"W":return Jt(p);case"WW":return Jt(r);case"E":case"c":return Jt(n);case"EEE":return fi(e.weekdays("short",!1),1);case"EEEE":return fi(e.weekdays("long",!1),1);case"ccc":return fi(e.weekdays("short",!0),1);case"cccc":return fi(e.weekdays("long",!0),1);case"Z":case"ZZ":return qg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return qg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return Qa(/[a-z_+-/]{1,256}?/i);case" ":return Qa(/[^\S\n\r]/);default:return b($)}})(t)||{invalidReason:Fv};return w.token=t,w}const zv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Uv(t,e,n){const{type:r,value:c}=t;if(r==="literal"){const C=/^\s+$/.test(c);return{literal:!C,val:C?" ":c}}const d=e[r];let g=r;r==="hour"&&(e.hour12!=null?g=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?g="hour12":g="hour24":g=n.hour12?"hour12":"hour24");let p=zv[g];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Gv(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function Yv(t,e,n){const r=t.match(e);if(r){const c={};let d=1;for(const g in n)if(el(n,g)){const p=n[g],C=p.groups?p.groups+1:1;!p.literal&&p.token&&(c[p.token.val[0]]=p.deser(r.slice(d,d+C))),d+=C}return[r,c]}else return[r,{}]}function jv(t){const e=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(t.z)||(n=no.create(t.z)),Lt(t.Z)||(n||(n=new ur(t.Z)),r=t.Z),Lt(t.q)||(t.M=(t.q-1)*3+1),Lt(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Lt(t.u)||(t.S=Rd(t.u)),[Object.keys(t).reduce((d,g)=>{const p=e(g);return p&&(d[p]=t[g]),d},{}),n,r]}let Iu=null;function Vv(){return Iu||(Iu=Dt.fromMillis(1555555555555)),Iu}function qv(t,e){if(t.literal)return t;const n=or.macroTokenToFormatOpts(t.val),r=n_(n,e);return r==null||r.includes(void 0)?t:r}function e_(t,e){return Array.prototype.concat(...t.map(n=>qv(n,e)))}function t_(t,e,n){const r=e_(or.parseFormat(n),t),c=r.map(g=>Kv(g,t)),d=c.find(g=>g.invalidReason);if(d)return{input:e,tokens:r,invalidReason:d.invalidReason};{const[g,p]=Gv(c),C=RegExp(g,"i"),[v,T]=Yv(e,C,p),[O,R,b]=T?jv(T):[null,null,void 0];if(el(T,"a")&&el(T,"H"))throw new qs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:C,rawMatches:v,matches:T,result:O,zone:R,specificOffset:b}}}function Zv(t,e,n){const{result:r,zone:c,specificOffset:d,invalidReason:g}=t_(t,e,n);return[r,c,d,g]}function n_(t,e){if(!t)return null;const r=or.create(e,t).dtFormatter(Vv()),c=r.formatToParts(),d=r.resolvedOptions();return c.map(g=>Uv(g,t,d))}const Pu="Invalid DateTime",Zg=864e13;function ec(t){return new gi("unsupported zone",`the zone "${t.name}" is not supported`)}function $u(t){return t.weekData===null&&(t.weekData=dc(t.c)),t.weekData}function Fu(t){return t.localWeekData===null&&(t.localWeekData=dc(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function os(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Dt({...n,...e,old:n})}function r_(t,e,n){let r=t-e*60*1e3;const c=n.offset(r);if(e===c)return[r,e];r-=(c-e)*60*1e3;const d=n.offset(r);return c===d?[r,c]:[t-Math.min(c,d)*60*1e3,Math.max(c,d)]}function tc(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function oc(t,e,n){return r_(Ec(t),e,n)}function Jg(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),c=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,d={...t.c,year:r,month:c,day:Math.min(t.c.day,fc(r,c))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},g=jt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),p=Ec(d);let[C,v]=r_(p,n,t.zone);return g!==0&&(C+=g,v=t.zone.offset(C)),{ts:C,o:v}}function Ul(t,e,n,r,c,d){const{setZone:g,zone:p}=n;if(t&&Object.keys(t).length!==0||e){const C=e||p,v=Dt.fromObject(t,{...n,zone:C,specificOffset:d});return g?v:v.setZone(p)}else return Dt.invalid(new gi("unparsable",`the input "${c}" can't be parsed as ${r}`))}function nc(t,e,n=!0){return t.isValid?or.create(en.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Bu(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=Pn(t.c.year,n?6:4),e?(r+="-",r+=Pn(t.c.month),r+="-",r+=Pn(t.c.day)):(r+=Pn(t.c.month),r+=Pn(t.c.day)),r}function Xg(t,e,n,r,c,d){let g=Pn(t.c.hour);return e?(g+=":",g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=":")):g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=Pn(t.c.second),(t.c.millisecond!==0||!r)&&(g+=".",g+=Pn(t.c.millisecond,3))),c&&(t.isOffsetFixed&&t.offset===0&&!d?g+="Z":t.o<0?(g+="-",g+=Pn(Math.trunc(-t.o/60)),g+=":",g+=Pn(Math.trunc(-t.o%60))):(g+="+",g+=Pn(Math.trunc(t.o/60)),g+=":",g+=Pn(Math.trunc(t.o%60)))),d&&(g+="["+t.zone.ianaName+"]"),g}const i_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Jv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Xv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},o_=["year","month","day","hour","minute","second","millisecond"],Qv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],eS=["year","ordinal","hour","minute","second","millisecond"];function tS(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new lm(t);return e}function Qg(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return tS(t)}}function ep(t,e){const n=Do(e.zone,bn.defaultZone),r=en.fromObject(e),c=bn.now();let d,g;if(Lt(t.year))d=c;else{for(const v of o_)Lt(t[v])&&(t[v]=i_[v]);const p=Rm(t)||bm(t);if(p)return Dt.invalid(p);const C=n.offset(c);[d,g]=oc(t,C,n)}return new Dt({ts:d,zone:n,loc:r,o:g})}function tp(t,e,n){const r=Lt(n.round)?!0:n.round,c=(g,p)=>(g=bd(g,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(g,p)),d=g=>n.calendary?e.hasSame(t,g)?0:e.startOf(g).diff(t.startOf(g),g).get(g):e.diff(t,g).get(g);if(n.unit)return c(d(n.unit),n.unit);for(const g of n.units){const p=d(g);if(Math.abs(p)>=1)return c(p,g)}return c(t>e?-0:0,n.units[n.units.length-1])}function np(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class Dt{constructor(e){const n=e.zone||bn.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new gi("invalid input"):null)||(n.isValid?null:ec(n));this.ts=Lt(e.ts)?bn.now():e.ts;let c=null,d=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[c,d]=[e.old.c,e.old.o];else{const p=n.offset(this.ts);c=tc(this.ts,p),r=Number.isNaN(c.year)?new gi("invalid input"):null,c=r?null:c,d=r?null:p}this._zone=n,this.loc=e.loc||en.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=c,this.o=d,this.isLuxonDateTime=!0}static now(){return new Dt({})}static local(){const[e,n]=np(arguments),[r,c,d,g,p,C,v]=n;return ep({year:r,month:c,day:d,hour:g,minute:p,second:C,millisecond:v},e)}static utc(){const[e,n]=np(arguments),[r,c,d,g,p,C,v]=n;return e.zone=ur.utcInstance,ep({year:r,month:c,day:d,hour:g,minute:p,second:C,millisecond:v},e)}static fromJSDate(e,n={}){const r=Mx(e)?e.valueOf():NaN;if(Number.isNaN(r))return Dt.invalid("invalid input");const c=Do(n.zone,bn.defaultZone);return c.isValid?new Dt({ts:r,zone:c,loc:en.fromObject(n)}):Dt.invalid(ec(c))}static fromMillis(e,n={}){if(ds(e))return e<-Zg||e>Zg?Dt.invalid("Timestamp out of range"):new Dt({ts:e,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(ds(e))return new Dt({ts:e*1e3,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=Do(n.zone,bn.defaultZone);if(!r.isValid)return Dt.invalid(ec(r));const c=en.fromObject(n),d=hc(e,Qg),{minDaysInFirstWeek:g,startOfWeek:p}=Bg(d,c),C=bn.now(),v=Lt(n.specificOffset)?r.offset(C):n.specificOffset,T=!Lt(d.ordinal),O=!Lt(d.year),R=!Lt(d.month)||!Lt(d.day),b=O||R,x=d.weekYear||d.weekNumber;if((b||T)&&x)throw new qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(R&&T)throw new qs("Can't mix ordinal dates with month/day");const w=x||d.weekday&&!b;let $,W,P=tc(C,v);w?($=Qv,W=Jv,P=dc(P,g,p)):T?($=eS,W=Xv,P=ku(P)):($=o_,W=i_);let H=!1;for(const U of $){const q=d[U];Lt(q)?H?d[U]=W[U]:d[U]=P[U]:H=!0}const B=w?Ox(d,g,p):T?Dx(d):Rm(d),z=B||bm(d);if(z)return Dt.invalid(z);const X=w?$g(d,g,p):T?Fg(d):d,[ee,le]=oc(X,v,r),j=new Dt({ts:ee,zone:r,o:le,loc:c});return d.weekday&&b&&e.weekday!==j.weekday?Dt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${j.toISO()}`):j}static fromISO(e,n={}){const[r,c]=Nv(e);return Ul(r,c,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,c]=Cv(e);return Ul(r,c,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,c]=Ev(e);return Ul(r,c,n,"HTTP",n)}static fromFormat(e,n,r={}){if(Lt(e)||Lt(n))throw new xr("fromFormat requires an input string and a format");const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0}),[p,C,v,T]=Zv(g,e,n);return T?Dt.invalid(T):Ul(p,C,r,`format ${n}`,e,v)}static fromString(e,n,r={}){return Dt.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,c]=Dv(e);return Ul(r,c,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the DateTime is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new rx(r);return new Dt({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=n_(e,en.fromObject(n));return r?r.map(c=>c?c.val:null).join(""):null}static expandFormat(e,n={}){return e_(or.parseFormat(e),en.fromObject(n)).map(c=>c.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?$u(this).weekYear:NaN}get weekNumber(){return this.isValid?$u(this).weekNumber:NaN}get weekday(){return this.isValid?$u(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Fu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Fu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Fu(this).weekYear:NaN}get ordinal(){return this.isValid?ku(this.c).ordinal:NaN}get monthShort(){return this.isValid?Xa.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Xa.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Xa.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Xa.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,r=Ec(this.c),c=this.zone.offset(r-e),d=this.zone.offset(r+e),g=this.zone.offset(r-c*n),p=this.zone.offset(r-d*n);if(g===p)return[this];const C=r-g*n,v=r-p*n,T=tc(C,g),O=tc(v,p);return T.hour===O.hour&&T.minute===O.minute&&T.second===O.second&&T.millisecond===O.millisecond?[os(this,{ts:C}),os(this,{ts:v})]:[this]}get isInLeapYear(){return na(this.year)}get daysInMonth(){return fc(this.year,this.month)}get daysInYear(){return this.isValid?Zs(this.year):NaN}get weeksInWeekYear(){return this.isValid?ea(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ea(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:c}=or.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:c}}toUTC(e=0,n={}){return this.setZone(ur.instance(e),n)}toLocal(){return this.setZone(bn.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=Do(e,bn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let c=this.ts;if(n||r){const d=e.offset(this.ts),g=this.toObject();[c]=oc(g,d,e)}return os(this,{ts:c,zone:e})}else return Dt.invalid(ec(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const c=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return os(this,{loc:c})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=hc(e,Qg),{minDaysInFirstWeek:r,startOfWeek:c}=Bg(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),g=!Lt(n.ordinal),p=!Lt(n.year),C=!Lt(n.month)||!Lt(n.day),v=p||C,T=n.weekYear||n.weekNumber;if((v||g)&&T)throw new qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(C&&g)throw new qs("Can't mix ordinal dates with month/day");let O;d?O=$g({...dc(this.c,r,c),...n},r,c):Lt(n.ordinal)?(O={...this.toObject(),...n},Lt(n.day)&&(O.day=Math.min(fc(O.year,O.month),O.day))):O=Fg({...ku(this.c),...n});const[R,b]=oc(O,this.o,this.zone);return os(this,{ts:R,o:b})}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return os(this,Jg(this,n))}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e).negate();return os(this,Jg(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},c=jt.normalizeUnit(e);switch(c){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(c==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:g}=this;g<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(c==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?or.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):Pu}toLocaleString(e=uc,n={}){return this.isValid?or.create(this.loc.clone(n),e).formatDateTime(this):Pu}toLocaleParts(e={}){return this.isValid?or.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:c=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const g=e==="extended";let p=Bu(this,g);return p+="T",p+=Xg(this,g,n,r,c,d),p}toISODate({format:e="extended"}={}){return this.isValid?Bu(this,e==="extended"):null}toISOWeekDate(){return nc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:c=!1,extendedZone:d=!1,format:g="extended"}={}){return this.isValid?(c?"T":"")+Xg(this,g==="extended",n,e,r,d):null}toRFC2822(){return nc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return nc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Bu(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let c="HH:mm:ss.SSS";return(n||e)&&(r&&(c+=" "),n?c+="z":e&&(c+="ZZ")),nc(this,c,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Pu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return jt.invalid("created by diffing an invalid DateTime");const c={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Rx(n).map(jt.normalizeUnit),g=e.valueOf()>this.valueOf(),p=g?this:e,C=g?e:this,v=Iv(p,C,d,c);return g?v.negate():v}diffNow(e="milliseconds",n={}){return this.diff(Dt.now(),e,n)}until(e){return this.isValid?wn.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;const c=e.valueOf(),d=this.setZone(e.zone,{keepLocalTime:!0});return d.startOf(n,r)<=c&&c<=d.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||Dt.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0;let c=["years","months","days","hours","minutes","seconds"],d=e.unit;return Array.isArray(e.unit)&&(c=e.unit,d=void 0),tp(n,this.plus(r),{...e,numeric:"always",units:c,unit:d})}toRelativeCalendar(e={}){return this.isValid?tp(e.base||Dt.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Dt.isDateTime))throw new xr("min requires all arguments be DateTimes");return Hg(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(Dt.isDateTime))throw new xr("max requires all arguments be DateTimes");return Hg(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});return t_(g,e,n)}static fromStringExplain(e,n,r={}){return Dt.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return uc}static get DATE_MED(){return am}static get DATE_MED_WITH_WEEKDAY(){return sx}static get DATE_FULL(){return cm}static get DATE_HUGE(){return um}static get TIME_SIMPLE(){return dm}static get TIME_WITH_SECONDS(){return fm}static get TIME_WITH_SHORT_OFFSET(){return hm}static get TIME_WITH_LONG_OFFSET(){return gm}static get TIME_24_SIMPLE(){return pm}static get TIME_24_WITH_SECONDS(){return mm}static get TIME_24_WITH_SHORT_OFFSET(){return _m}static get TIME_24_WITH_LONG_OFFSET(){return ym}static get DATETIME_SHORT(){return Nm}static get DATETIME_SHORT_WITH_SECONDS(){return Cm}static get DATETIME_MED(){return Em}static get DATETIME_MED_WITH_SECONDS(){return Tm}static get DATETIME_MED_WITH_WEEKDAY(){return lx}static get DATETIME_FULL(){return xm}static get DATETIME_FULL_WITH_SECONDS(){return vm}static get DATETIME_HUGE(){return Sm}static get DATETIME_HUGE_WITH_SECONDS(){return wm}}function Gl(t){if(Dt.isDateTime(t))return t;if(t&&t.valueOf&&ds(t.valueOf()))return Dt.fromJSDate(t);if(t&&typeof t=="object")return Dt.fromObject(t);throw new xr(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var Xt=(t=>(t.Monday="MONDAY",t.Tuesday="TUESDAY",t.Wednesday="WEDNESDAY",t.Thursday="THURSDAY",t.Friday="FRIDAY",t.Saturday="SATURDAY",t.Sunday="SUNDAY",t))(Xt||{});function $d(t){const e={1:Xt.Monday,2:Xt.Tuesday,3:Xt.Wednesday,4:Xt.Thursday,5:Xt.Friday,6:Xt.Saturday,7:Xt.Sunday};if(t.weekday in e)return e[t.weekday];throw new Error(`Invalid DateTime.weekday property: ${t}, ${t.weekday}`)}function $i(t){return{[Xt.Monday]:"Monday",[Xt.Tuesday]:"Tuesday",[Xt.Wednesday]:"Wednesday",[Xt.Thursday]:"Thursday",[Xt.Friday]:"Friday",[Xt.Saturday]:"Saturday",[Xt.Sunday]:"Sunday"}[t]}class rp{constructor(e,n,r){Vn(this,"end");Vn(this,"start");this.end=e.setZone(r),this.start=e.setZone(r),[n.start,n.end].forEach(C=>{if(C.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[c,d]=n.start.split(":"),[g,p]=n.end.split(":");this.end=this.end.set({hour:Number(g),minute:Number(p)}),this.start=this.start.set({hour:Number(c),minute:Number(d)}),this.end<this.start&&(this.end=this.end.plus({days:1})),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(e){return this.start<=e&&e<this.end}getStartTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(e||"en-US").toLocaleString(r)}getEndTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(e||"en-US").toLocaleString(r)}timeIsEqualTo(e){const n=this.getStartTime()===e.getStartTime(),r=this.getEndTime()===e.getEndTime();return n&&r}is24h(){const e=this.start.minute===0&&this.start.hour===0,n=this.end.minute===0&&this.end.hour===0,r=this.end.day-this.start.day===1||this.end.day===1;return e&&n&&r}}class s_{constructor(e,n){Vn(this,"holidayHoursByDate");Vn(this,"hours");Vn(this,"timezone");this.holidayHoursByDate=Object.fromEntries((e.holidayHours||[]).map(r=>[r.date,r])),this.hours=e,this.timezone=n}getInterval(e){if(this.isTemporarilyClosedAt(e))return null;let n=e;n=n.minus({days:1});for(const r of[n,e]){const c=this.getHours(r);if(c&&!c.isClosed)for(const d of c.openIntervals||[]){const g=new rp(r,d,this.timezone);if(g.contains(e))return g}}return null}getCurrentInterval(){return this.getInterval(Dt.now())}getIntervalAfter(e){const n=this.getIntervalsForNDays(8,e),r=(d,g)=>d.start===g.start?0:d.start>g.start?1:-1,c=n.sort(r);for(const[d,g]of c.entries())if(g.contains(e)&&c.length>d+1)return c[d+1];for(const d of c)if(d.start>e)return d;return null}getIntervalsForNDays(e,n){const r=[];for(let c=0;c<e;c++){let d=n;d=d.plus({days:c});const g=this.getHours(d);g&&!g.isClosed&&r.push(...g.openIntervals.map(p=>new rp(d,p,this.timezone)))}return r}getHolidayHours(e){return this.isTemporarilyClosedAt(e)?null:this.holidayHoursByDate[(e.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(e){if(this.isTemporarilyClosedAt(e))return null;const n=$i($d(e)).toLowerCase();return this.hours[n]}getHours(e){const n=this.getHolidayHours(e);return!n||n.isRegularHours?this.getNormalHours(e):n}getNextInterval(){return this.getIntervalAfter(Dt.now())}isHoliday(e){return!!this.getHolidayHours(e)}isTemporarilyClosedAt(e){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,c,d]=n,g=Dt.fromObject({year:Number(r),month:Number(c),day:Number(d)},{zone:this.timezone});if(e<g)return!0}return!1}isOpenAt(e){return this.isTemporarilyClosedAt(e)?!1:!!this.getInterval(e)}isOpenNow(){return this.isOpenAt(Dt.now())}}function nS(t,e){const n=[...t];return e=e%n.length,n.concat(n.splice(0,n.length-e))}function rS(t,e){if(t.length!==e.length)return!1;for(const[n,r]of t.entries())if(!r.timeIsEqualTo(e[n]))return!1;return!0}function oa(t){var e,n;return((n=(e=t==null?void 0:t.currentInterval)==null?void 0:e.is24h)==null?void 0:n.call(e))||!1}function sa(t){return!t.futureInterval}function iS(t){return oa(t)?at.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):sa(t)?at.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):at.jsx("span",{className:"HoursStatus-current",children:t.isOpen?"Open Now":"Closed"})}function oS(t){return oa(t)||sa(t)?null:at.jsx("span",{className:"HoursStatus-separator",children:" • "})}function sS(t){return oa(t)||sa(t)?null:at.jsx("span",{className:"HoursStatus-future",children:t.isOpen?"Closes at":"Opens at"})}function lS(t){if(oa(t)||sa(t))return null;let e="";if(t.isOpen){const n=t.currentInterval;e+=n?n.getEndTime("en-US",t.timeOptions):""}else{const n=t.futureInterval;e+=n?n.getStartTime("en-US",t.timeOptions):""}return at.jsxs("span",{className:"HoursStatus-time",children:[" ",e]})}function aS(t){var r,c;if(oa(t)||sa(t))return null;const e={weekday:"long",...t.dayOptions??{}};let n="";if(t.isOpen){const d=t.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(e))||""}else{const d=t.futureInterval;n+=((c=d==null?void 0:d.start)==null?void 0:c.setLocale("en-US").toLocaleString(e))||""}return at.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function cS(t,e){const n=t.currentTemplate||iS,r=t.separatorTemplate||oS,c=t.futureTemplate||sS,d=t.timeTemplate||lS,g=t.dayOfWeekTemplate||aS;return at.jsxs("div",{className:Qs("HoursStatus",(e==null?void 0:e.className)||""),children:[n(t),r(t),c(t),d(t),g(t)]})}const uS=t=>{const[e,n]=et.useState(!1),[r,c]=et.useState(!1);et.useEffect(()=>{c(!0)},[]);const d=t.statusTemplate||cS,g=new s_(t.hours,t.timezone),p=g.isOpenNow(),C=g.getCurrentInterval(),v=g.getNextInterval(),T=(C==null?void 0:C.end)||(v==null?void 0:v.start);if(T&&!e){n(!0);const R=T.toMillis()-Dt.now().toMillis();setTimeout(()=>n(!1),R)}const O={isOpen:p,currentInterval:C,futureInterval:v,...t};return at.jsx(at.Fragment,{children:r&&d(O,t)})};function dS(t,e){const n=[];return t.forEach(r=>{const c=n[n.length-1];c?rS(c.intervals,r.intervals)?(c.endDay=r.endDay,c.isToday=c.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const c=e&&$i(r.startDay)in e?e[$i(r.startDay)]||"":$i(r.startDay),d=e&&$i(r.endDay)in e?e[$i(r.endDay)]||"":$i(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${c}`:`${c} - ${d}`}})}function fS(t,e){const n=[],r=t.intervals.length>0&&t.intervals[0].is24h();return t.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):t.intervals.forEach(c=>{const d=c.getStartTime("en-US",e),g=c.getEndTime("en-US",e);n.push(`${d} - ${g}`)}),n}function hS(t,e,n){const r=[];for(let c=1;c<=7;c++){const d=Dt.fromObject({weekday:c}),g=$d(d);r.push({startDay:g,endDay:g,dayName:n&&$i(g).toLowerCase()in n?n[$i(g).toLowerCase()]||"":$i(g),intervals:t.filter(p=>p.start.weekday===c),isToday:e.weekday===c})}return r}const gS=t=>{const[e,n]=et.useState(!1);et.useEffect(()=>{n(!0)},[]);const r=new s_(t.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),c=Dt.now(),d=r.getIntervalsForNDays(7,c);let g=hS(d,c,t.dayOfWeekNames);function p(T){return T?{today:$d(c),monday:Xt.Monday,tuesday:Xt.Tuesday,wednesday:Xt.Wednesday,thursday:Xt.Thursday,friday:Xt.Friday,saturday:Xt.Saturday,sunday:Xt.Sunday}[T]:Xt.Sunday}let C=[Xt.Sunday,Xt.Monday,Xt.Tuesday,Xt.Wednesday,Xt.Thursday,Xt.Friday,Xt.Saturday];const v=C.indexOf(p(t.startOfWeek));return C=nS(C,7-v),g.sort((T,O)=>C.indexOf(T.startDay)-C.indexOf(O.startDay)),t.collapseDays&&(g=dS(g,t.dayOfWeekNames)),at.jsx(at.Fragment,{children:e&&at.jsx("div",{className:Qs("HoursTable",t.className),children:g.map(T=>{const R=(t.intervalStringsBuilderFn||fS)(T,t.timeOptions);return at.jsxs("div",{className:Qs("HoursTable-row",{"is-today":T.isToday}),children:[at.jsx("span",{className:"HoursTable-day",children:T.dayName}),at.jsx("span",{className:"HoursTable-intervals",children:R.map((b,x)=>at.jsx("span",{className:"HoursTable-interval",children:b},x))})]},T.dayName)})})})},pS=t=>`<script type="application/ld+json">
104
+ `}),n}const qT=(t,e)=>t(e,"i",ro(t,e)),ZT=(t,e)=>t(e,"b",ro(t,e)),JT=(t,e)=>t(e,"u",ro(t,e)),XT=(t,e)=>t(e,"s",ro(t,e)),QT=(t,e)=>t(e,"sub",ro(t,e)),ex=(t,e)=>t(e,"sup",ro(t,e)),tx={emphasis:qT,strong:ZT,underline:JT,strikethrough:XT,subscript:QT,superscript:ex},nx=t=>{const[e,n]=et.useState();let r;return et.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-DmZ5N0Hz.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:t.markdown,remarkPlugins:[sT],remarkRehypeOptions:{handlers:tx}});n(d)})()},[t.markdown]),e||null};class gs extends Error{}class rx extends gs{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class ix extends gs{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ox extends gs{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class qs extends gs{}class lm extends gs{constructor(e){super(`Invalid unit ${e}`)}}class xr extends gs{}class So extends gs{constructor(){super("Zone is an abstract class")}}const it="numeric",pi="short",Lr="long",uc={year:it,month:it,day:it},am={year:it,month:pi,day:it},sx={year:it,month:pi,day:it,weekday:pi},cm={year:it,month:Lr,day:it},um={year:it,month:Lr,day:it,weekday:Lr},dm={hour:it,minute:it},fm={hour:it,minute:it,second:it},hm={hour:it,minute:it,second:it,timeZoneName:pi},gm={hour:it,minute:it,second:it,timeZoneName:Lr},pm={hour:it,minute:it,hourCycle:"h23"},mm={hour:it,minute:it,second:it,hourCycle:"h23"},_m={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:pi},ym={hour:it,minute:it,second:it,hourCycle:"h23",timeZoneName:Lr},Nm={year:it,month:it,day:it,hour:it,minute:it},Cm={year:it,month:it,day:it,hour:it,minute:it,second:it},Em={year:it,month:pi,day:it,hour:it,minute:it},Tm={year:it,month:pi,day:it,hour:it,minute:it,second:it},lx={year:it,month:pi,day:it,weekday:pi,hour:it,minute:it},xm={year:it,month:Lr,day:it,hour:it,minute:it,timeZoneName:pi},vm={year:it,month:Lr,day:it,hour:it,minute:it,second:it,timeZoneName:pi},Sm={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,timeZoneName:Lr},wm={year:it,month:Lr,day:it,weekday:Lr,hour:it,minute:it,second:it,timeZoneName:Lr};class ta{get type(){throw new So}get name(){throw new So}get ianaName(){return this.name}get isUniversal(){throw new So}offsetName(e,n){throw new So}formatOffset(e,n){throw new So}offset(e){throw new So}equals(e){throw new So}get isValid(){throw new So}}let bu=null;class Nc extends ta{static get instance(){return bu===null&&(bu=new Nc),bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return Im(e,n,r)}formatOffset(e,n){return Jl(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let ic={};function ax(t){return ic[t]||(ic[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ic[t]}const cx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ux(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,c,d,g,p,N,v,T]=r;return[g,c,d,p,N,v,T]}function dx(t,e){const n=t.formatToParts(e),r=[];for(let c=0;c<n.length;c++){const{type:d,value:g}=n[c],p=cx[d];d==="era"?r[p]=g:Lt(p)||(r[p]=parseInt(g,10))}return r}let Za={};class no extends ta{static create(e){return Za[e]||(Za[e]=new no(e)),Za[e]}static resetCache(){Za={},ic={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=no.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return Im(e,n,r,this.name)}formatOffset(e,n){return Jl(this.offset(e),n)}offset(e){const n=new Date(e);if(isNaN(n))return NaN;const r=ax(this.name);let[c,d,g,p,N,v,T]=r.formatToParts?dx(r,n):ux(r,n);p==="BC"&&(c=-Math.abs(c)+1);const b=Ec({year:c,month:d,day:g,hour:N===24?0:N,minute:v,second:T,millisecond:0});let R=+n;const x=R%1e3;return R-=x>=0?x:1e3+x,(b-R)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Og={};function fx(t,e={}){const n=JSON.stringify([t,e]);let r=Og[n];return r||(r=new Intl.ListFormat(t,e),Og[n]=r),r}let Xu={};function Qu(t,e={}){const n=JSON.stringify([t,e]);let r=Xu[n];return r||(r=new Intl.DateTimeFormat(t,e),Xu[n]=r),r}let ed={};function hx(t,e={}){const n=JSON.stringify([t,e]);let r=ed[n];return r||(r=new Intl.NumberFormat(t,e),ed[n]=r),r}let td={};function gx(t,e={}){const{base:n,...r}=e,c=JSON.stringify([t,r]);let d=td[c];return d||(d=new Intl.RelativeTimeFormat(t,e),td[c]=d),d}let Vl=null;function px(){return Vl||(Vl=new Intl.DateTimeFormat().resolvedOptions().locale,Vl)}let Dg={};function mx(t){let e=Dg[t];if(!e){const n=new Intl.Locale(t);e="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Dg[t]=e}return e}function _x(t){const e=t.indexOf("-x-");e!==-1&&(t=t.substring(0,e));const n=t.indexOf("-u-");if(n===-1)return[t];{let r,c;try{r=Qu(t).resolvedOptions(),c=t}catch{const N=t.substring(0,n);r=Qu(N).resolvedOptions(),c=N}const{numberingSystem:d,calendar:g}=r;return[c,d,g]}}function yx(t,e,n){return(n||e)&&(t.includes("-u-")||(t+="-u"),n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function Nx(t){const e=[];for(let n=1;n<=12;n++){const r=Dt.utc(2009,n,1);e.push(t(r))}return e}function Cx(t){const e=[];for(let n=1;n<=7;n++){const r=Dt.utc(2016,11,13+n);e.push(t(r))}return e}function Ja(t,e,n,r){const c=t.listingMode();return c==="error"?null:c==="en"?n(e):r(e)}function Ex(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class Tx{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:c,floor:d,...g}=r;if(!n||Object.keys(g).length>0){const p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=hx(e,p)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):bd(e,3);return Pn(n,this.padTo)}}}class xx{constructor(e,n,r){this.opts=r,this.originalZone=void 0;let c;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const g=-1*(e.offset/60),p=g>=0?`Etc/GMT+${g}`:`Etc/GMT${g}`;e.offset!==0&&no.create(p).valid?(c=p,this.dt=e):(c="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,c=e.zone.name):(c="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const d={...this.opts};d.timeZone=d.timeZone||c,this.dtf=Qu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class vx{constructor(e,n,r){this.opts={style:"long",...r},!n&&Lm()&&(this.rtf=gx(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):Ux(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}const Sx={firstDay:1,minimalDays:4,weekend:[6,7]};class en{static fromOpts(e){return en.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,n,r,c,d=!1){const g=e||bn.defaultLocale,p=g||(d?"en-US":px()),N=n||bn.defaultNumberingSystem,v=r||bn.defaultOutputCalendar,T=nd(c)||bn.defaultWeekSettings;return new en(p,N,v,T,g)}static resetCache(){Vl=null,Xu={},ed={},td={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r,weekSettings:c}={}){return en.create(e,n,r,c)}constructor(e,n,r,c,d){const[g,p,N]=_x(e);this.locale=g,this.numberingSystem=n||p||null,this.outputCalendar=r||N||null,this.weekSettings=c,this.intl=yx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ex(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:en.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,nd(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1){return Ja(this,e,Fm,()=>{const r=n?{month:e,day:"numeric"}:{month:e},c=n?"format":"standalone";return this.monthsCache[c][e]||(this.monthsCache[c][e]=Nx(d=>this.extract(d,r,"month"))),this.monthsCache[c][e]})}weekdays(e,n=!1){return Ja(this,e,Wm,()=>{const r=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},c=n?"format":"standalone";return this.weekdaysCache[c][e]||(this.weekdaysCache[c][e]=Cx(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[c][e]})}meridiems(){return Ja(this,void 0,()=>Km,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Dt.utc(2016,11,13,9),Dt.utc(2016,11,13,19)].map(n=>this.extract(n,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ja(this,e,zm,()=>{const n={era:e};return this.eraCache[e]||(this.eraCache[e]=[Dt.utc(-40,1,1),Dt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[e]})}extract(e,n,r){const c=this.dtFormatter(e,n),d=c.formatToParts(),g=d.find(p=>p.type.toLowerCase()===r);return g?g.value:null}numberFormatter(e={}){return new Tx(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new xx(e,this.intl,n)}relFormatter(e={}){return new vx(this.intl,this.isEnglish(),e)}listFormatter(e={}){return fx(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:km()?mx(this.locale):Sx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let Lu=null;class ur extends ta{static get utcInstance(){return Lu===null&&(Lu=new ur(0)),Lu}static instance(e){return e===0?ur.utcInstance:new ur(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ur(Tc(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return Jl(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class wx extends ta{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Do(t,e){if(Lt(t)||t===null)return e;if(t instanceof ta)return t;if(Ax(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?Nc.instance:n==="utc"||n==="gmt"?ur.utcInstance:ur.parseSpecifier(n)||no.create(t)}else return ds(t)?ur.instance(t):typeof t=="object"&&"offset"in t&&typeof t.offset=="function"?t:new wx(t)}let Ag=()=>Date.now(),Mg="system",Rg=null,bg=null,Lg=null,kg=60,Ig,Pg=null;class bn{static get now(){return Ag}static set now(e){Ag=e}static set defaultZone(e){Mg=e}static get defaultZone(){return Do(Mg,Nc.instance)}static get defaultLocale(){return Rg}static set defaultLocale(e){Rg=e}static get defaultNumberingSystem(){return bg}static set defaultNumberingSystem(e){bg=e}static get defaultOutputCalendar(){return Lg}static set defaultOutputCalendar(e){Lg=e}static get defaultWeekSettings(){return Pg}static set defaultWeekSettings(e){Pg=nd(e)}static get twoDigitCutoffYear(){return kg}static set twoDigitCutoffYear(e){kg=e%100}static get throwOnInvalid(){return Ig}static set throwOnInvalid(e){Ig=e}static resetCaches(){en.resetCache(),no.resetCache()}}class gi{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Om=[0,31,59,90,120,151,181,212,243,273,304,334],Dm=[0,31,60,91,121,152,182,213,244,274,305,335];function Vr(t,e){return new gi("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Ad(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const c=r.getUTCDay();return c===0?7:c}function Am(t,e,n){return n+(na(t)?Dm:Om)[e-1]}function Mm(t,e){const n=na(t)?Dm:Om,r=n.findIndex(d=>d<e),c=e-n[r];return{month:r+1,day:c}}function Md(t,e){return(t-e+7)%7+1}function dc(t,e=4,n=1){const{year:r,month:c,day:d}=t,g=Am(r,c,d),p=Md(Ad(r,c,d),n);let N=Math.floor((g-p+14-e)/7),v;return N<1?(v=r-1,N=ea(v,e,n)):N>ea(r,e,n)?(v=r+1,N=1):v=r,{weekYear:v,weekNumber:N,weekday:p,...xc(t)}}function $g(t,e=4,n=1){const{weekYear:r,weekNumber:c,weekday:d}=t,g=Md(Ad(r,1,e),n),p=Zs(r);let N=c*7+d-g-7+e,v;N<1?(v=r-1,N+=Zs(v)):N>p?(v=r+1,N-=Zs(r)):v=r;const{month:T,day:O}=Mm(v,N);return{year:v,month:T,day:O,...xc(t)}}function ku(t){const{year:e,month:n,day:r}=t,c=Am(e,n,r);return{year:e,ordinal:c,...xc(t)}}function Fg(t){const{year:e,ordinal:n}=t,{month:r,day:c}=Mm(e,n);return{year:e,month:r,day:c,...xc(t)}}function Bg(t,e){if(!Lt(t.localWeekday)||!Lt(t.localWeekNumber)||!Lt(t.localWeekYear)){if(!Lt(t.weekday)||!Lt(t.weekNumber)||!Lt(t.weekYear))throw new qs("Cannot mix locale-based week fields with ISO-based week fields");return Lt(t.localWeekday)||(t.weekday=t.localWeekday),Lt(t.localWeekNumber)||(t.weekNumber=t.localWeekNumber),Lt(t.localWeekYear)||(t.weekYear=t.localWeekYear),delete t.localWeekday,delete t.localWeekNumber,delete t.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Ox(t,e=4,n=1){const r=Cc(t.weekYear),c=qr(t.weekNumber,1,ea(t.weekYear,e,n)),d=qr(t.weekday,1,7);return r?c?d?!1:Vr("weekday",t.weekday):Vr("week",t.weekNumber):Vr("weekYear",t.weekYear)}function Dx(t){const e=Cc(t.year),n=qr(t.ordinal,1,Zs(t.year));return e?n?!1:Vr("ordinal",t.ordinal):Vr("year",t.year)}function Rm(t){const e=Cc(t.year),n=qr(t.month,1,12),r=qr(t.day,1,fc(t.year,t.month));return e?n?r?!1:Vr("day",t.day):Vr("month",t.month):Vr("year",t.year)}function bm(t){const{hour:e,minute:n,second:r,millisecond:c}=t,d=qr(e,0,23)||e===24&&n===0&&r===0&&c===0,g=qr(n,0,59),p=qr(r,0,59),N=qr(c,0,999);return d?g?p?N?!1:Vr("millisecond",c):Vr("second",r):Vr("minute",n):Vr("hour",e)}function Lt(t){return typeof t>"u"}function ds(t){return typeof t=="number"}function Cc(t){return typeof t=="number"&&t%1===0}function Ax(t){return typeof t=="string"}function Mx(t){return Object.prototype.toString.call(t)==="[object Date]"}function Lm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function km(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Rx(t){return Array.isArray(t)?t:[t]}function Hg(t,e,n){if(t.length!==0)return t.reduce((r,c)=>{const d=[e(c),c];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function bx(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function el(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function nd(t){if(t==null)return null;if(typeof t!="object")throw new xr("Week settings must be an object");if(!qr(t.firstDay,1,7)||!qr(t.minimalDays,1,7)||!Array.isArray(t.weekend)||t.weekend.some(e=>!qr(e,1,7)))throw new xr("Invalid week settings");return{firstDay:t.firstDay,minimalDays:t.minimalDays,weekend:Array.from(t.weekend)}}function qr(t,e,n){return Cc(t)&&t>=e&&t<=n}function Lx(t,e){return t-e*Math.floor(t/e)}function Pn(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function Oo(t){if(!(Lt(t)||t===null||t===""))return parseInt(t,10)}function is(t){if(!(Lt(t)||t===null||t===""))return parseFloat(t)}function Rd(t){if(!(Lt(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function bd(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function na(t){return t%4===0&&(t%100!==0||t%400===0)}function Zs(t){return na(t)?366:365}function fc(t,e){const n=Lx(e-1,12)+1,r=t+(e-n)/12;return n===2?na(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Ec(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(t.year,t.month-1,t.day)),+e}function Wg(t,e,n){return-Md(Ad(t,1,e),n)+e-1}function ea(t,e=4,n=1){const r=Wg(t,e,n),c=Wg(t+1,e,n);return(Zs(t)-r+c)/7}function rd(t){return t>99?t:t>bn.twoDigitCutoffYear?1900+t:2e3+t}function Im(t,e,n,r=null){const c=new Date(t),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const g={timeZoneName:e,...d},p=new Intl.DateTimeFormat(n,g).formatToParts(c).find(N=>N.type.toLowerCase()==="timezonename");return p?p.value:null}function Tc(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,c=n<0||Object.is(n,-0)?-r:r;return n*60+c}function Pm(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new xr(`Invalid unit value ${t}`);return e}function hc(t,e){const n={};for(const r in t)if(el(t,r)){const c=t[r];if(c==null)continue;n[e(r)]=Pm(c)}return n}function Jl(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),c=t>=0?"+":"-";switch(e){case"short":return`${c}${Pn(n,2)}:${Pn(r,2)}`;case"narrow":return`${c}${n}${r>0?`:${r}`:""}`;case"techie":return`${c}${Pn(n,2)}${Pn(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function xc(t){return bx(t,["hour","minute","second","millisecond"])}const kx=["January","February","March","April","May","June","July","August","September","October","November","December"],$m=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ix=["J","F","M","A","M","J","J","A","S","O","N","D"];function Fm(t){switch(t){case"narrow":return[...Ix];case"short":return[...$m];case"long":return[...kx];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Bm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Hm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Px=["M","T","W","T","F","S","S"];function Wm(t){switch(t){case"narrow":return[...Px];case"short":return[...Hm];case"long":return[...Bm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Km=["AM","PM"],$x=["Before Christ","Anno Domini"],Fx=["BC","AD"],Bx=["B","A"];function zm(t){switch(t){case"narrow":return[...Bx];case"short":return[...Fx];case"long":return[...$x];default:return null}}function Hx(t){return Km[t.hour<12?0:1]}function Wx(t,e){return Wm(e)[t.weekday-1]}function Kx(t,e){return Fm(e)[t.month-1]}function zx(t,e){return zm(e)[t.year<0?0:1]}function Ux(t,e,n="always",r=!1){const c={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},d=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&d){const O=t==="days";switch(e){case 1:return O?"tomorrow":`next ${c[t][0]}`;case-1:return O?"yesterday":`last ${c[t][0]}`;case 0:return O?"today":`this ${c[t][0]}`}}const g=Object.is(e,-0)||e<0,p=Math.abs(e),N=p===1,v=c[t],T=r?N?v[1]:v[2]||v[1]:N?c[t][0]:t;return g?`${p} ${T} ago`:`in ${p} ${T}`}function Kg(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const Gx={D:uc,DD:am,DDD:cm,DDDD:um,t:dm,tt:fm,ttt:hm,tttt:gm,T:pm,TT:mm,TTT:_m,TTTT:ym,f:Nm,ff:Em,fff:xm,ffff:Sm,F:Cm,FF:Tm,FFF:vm,FFFF:wm};class or{static create(e,n={}){return new or(e,n)}static parseFormat(e){let n=null,r="",c=!1;const d=[];for(let g=0;g<e.length;g++){const p=e.charAt(g);p==="'"?(r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),n=null,r="",c=!c):c||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(e){return Gx[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}dtFormatter(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n})}formatDateTime(e,n){return this.dtFormatter(e,n).format()}formatDateTimeParts(e,n){return this.dtFormatter(e,n).formatToParts()}formatInterval(e,n){return this.dtFormatter(e.start,n).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,n){return this.dtFormatter(e,n).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return Pn(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(R,x)=>this.loc.extract(e,R,x),g=R=>e.isOffsetFixed&&e.offset===0&&R.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,R.format):"",p=()=>r?Hx(e):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),N=(R,x)=>r?Kx(e,R):d(x?{month:R}:{month:R,day:"numeric"},"month"),v=(R,x)=>r?Wx(e,R):d(x?{weekday:R}:{weekday:R,month:"long",day:"numeric"},"weekday"),T=R=>{const x=or.macroTokenToFormatOpts(R);return x?this.formatWithSystemDefault(e,x):R},O=R=>r?zx(e,R):d({era:R},"era"),b=R=>{switch(R){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return g({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return g({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return g({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return p();case"d":return c?d({day:"numeric"},"day"):this.num(e.day);case"dd":return c?d({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return v("short",!0);case"cccc":return v("long",!0);case"ccccc":return v("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return v("short",!1);case"EEEE":return v("long",!1);case"EEEEE":return v("narrow",!1);case"L":return c?d({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return c?d({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return N("short",!0);case"LLLL":return N("long",!0);case"LLLLL":return N("narrow",!0);case"M":return c?d({month:"numeric"},"month"):this.num(e.month);case"MM":return c?d({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return N("short",!1);case"MMMM":return N("long",!1);case"MMMMM":return N("narrow",!1);case"y":return c?d({year:"numeric"},"year"):this.num(e.year);case"yy":return c?d({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return c?d({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return c?d({year:"numeric"},"year"):this.num(e.year,6);case"G":return O("short");case"GG":return O("long");case"GGGGG":return O("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return T(R)}};return Kg(or.parseFormat(n),b)}formatDurationFromString(e,n){const r=N=>{switch(N[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=N=>v=>{const T=r(v);return T?this.num(N.get(T),v.length):v},d=or.parseFormat(n),g=d.reduce((N,{literal:v,val:T})=>v?N:N.concat(T),[]),p=e.shiftTo(...g.map(r).filter(N=>N));return Kg(d,c(p))}}const Um=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function sl(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function ll(...t){return e=>t.reduce(([n,r,c],d)=>{const[g,p,N]=d(e,c);return[{...n,...g},p||r,N]},[{},null,1]).slice(0,2)}function al(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const c=n.exec(t);if(c)return r(c)}return[null,null]}function Gm(...t){return(e,n)=>{const r={};let c;for(c=0;c<t.length;c++)r[t[c]]=Oo(e[n+c]);return[r,null,n+c]}}const Ym=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Yx=`(?:${Ym.source}?(?:\\[(${Um.source})\\])?)?`,Ld=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jm=RegExp(`${Ld.source}${Yx}`),kd=RegExp(`(?:T${jm.source})?`),jx=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Vx=/(\d{4})-?W(\d\d)(?:-?(\d))?/,qx=/(\d{4})-?(\d{3})/,Zx=Gm("weekYear","weekNumber","weekDay"),Jx=Gm("year","ordinal"),Xx=/(\d{4})-(\d\d)-(\d\d)/,Vm=RegExp(`${Ld.source} ?(?:${Ym.source}|(${Um.source}))?`),Qx=RegExp(`(?: ${Vm.source})?`);function Js(t,e,n){const r=t[e];return Lt(r)?n:Oo(r)}function ev(t,e){return[{year:Js(t,e),month:Js(t,e+1,1),day:Js(t,e+2,1)},null,e+3]}function cl(t,e){return[{hours:Js(t,e,0),minutes:Js(t,e+1,0),seconds:Js(t,e+2,0),milliseconds:Rd(t[e+3])},null,e+4]}function ra(t,e){const n=!t[e]&&!t[e+1],r=Tc(t[e+1],t[e+2]),c=n?null:ur.instance(r);return[{},c,e+3]}function ia(t,e){const n=t[e]?no.create(t[e]):null;return[{},n,e+1]}const tv=RegExp(`^T?${Ld.source}$`),nv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function rv(t){const[e,n,r,c,d,g,p,N,v]=t,T=e[0]==="-",O=N&&N[0]==="-",b=(R,x=!1)=>R!==void 0&&(x||R&&T)?-R:R;return[{years:b(is(n)),months:b(is(r)),weeks:b(is(c)),days:b(is(d)),hours:b(is(g)),minutes:b(is(p)),seconds:b(is(N),N==="-0"),milliseconds:b(Rd(v),O)}]}const iv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Id(t,e,n,r,c,d,g){const p={year:e.length===2?rd(Oo(e)):Oo(e),month:$m.indexOf(n)+1,day:Oo(r),hour:Oo(c),minute:Oo(d)};return g&&(p.second=Oo(g)),t&&(p.weekday=t.length>3?Bm.indexOf(t)+1:Hm.indexOf(t)+1),p}const ov=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function sv(t){const[,e,n,r,c,d,g,p,N,v,T,O]=t,b=Id(e,c,r,n,d,g,p);let R;return N?R=iv[N]:v?R=0:R=Tc(T,O),[b,new ur(R)]}function lv(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const av=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,uv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function zg(t){const[,e,n,r,c,d,g,p]=t;return[Id(e,c,r,n,d,g,p),ur.utcInstance]}function dv(t){const[,e,n,r,c,d,g,p]=t;return[Id(e,p,n,r,c,d,g),ur.utcInstance]}const fv=sl(jx,kd),hv=sl(Vx,kd),gv=sl(qx,kd),pv=sl(jm),qm=ll(ev,cl,ra,ia),mv=ll(Zx,cl,ra,ia),_v=ll(Jx,cl,ra,ia),yv=ll(cl,ra,ia);function Nv(t){return al(t,[fv,qm],[hv,mv],[gv,_v],[pv,yv])}function Cv(t){return al(lv(t),[ov,sv])}function Ev(t){return al(t,[av,zg],[cv,zg],[uv,dv])}function Tv(t){return al(t,[nv,rv])}const xv=ll(cl);function vv(t){return al(t,[tv,xv])}const Sv=sl(Xx,Qx),wv=sl(Vm),Ov=ll(cl,ra,ia);function Dv(t){return al(t,[Sv,qm],[wv,Ov])}const Ug="Invalid Duration",Zm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Av={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Zm},Yr=146097/400,Ys=146097/4800,Mv={years:{quarters:4,months:12,weeks:Yr/7,days:Yr,hours:Yr*24,minutes:Yr*24*60,seconds:Yr*24*60*60,milliseconds:Yr*24*60*60*1e3},quarters:{months:3,weeks:Yr/28,days:Yr/4,hours:Yr*24/4,minutes:Yr*24*60/4,seconds:Yr*24*60*60/4,milliseconds:Yr*24*60*60*1e3/4},months:{weeks:Ys/7,days:Ys,hours:Ys*24,minutes:Ys*24*60,seconds:Ys*24*60*60,milliseconds:Ys*24*60*60*1e3},...Zm},us=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Rv=us.slice(0).reverse();function wo(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new jt(r)}function Jm(t,e){let n=e.milliseconds??0;for(const r of Rv.slice(1))e[r]&&(n+=e[r]*t[r].milliseconds);return n}function Gg(t,e){const n=Jm(t,e)<0?-1:1;us.reduceRight((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]*n,g=t[c][r],p=Math.floor(d/g);e[c]+=p*n,e[r]-=p*g*n}return c},null),us.reduce((r,c)=>{if(Lt(e[c]))return r;if(r){const d=e[r]%1;e[r]-=d,e[c]+=d*t[r][c]}return c},null)}function bv(t){const e={};for(const[n,r]of Object.entries(t))r!==0&&(e[n]=r);return e}class jt{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?Mv:Av;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||en.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return jt.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new xr(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new jt({values:hc(e,jt.normalizeUnit),loc:en.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(ds(e))return jt.fromMillis(e);if(jt.isDuration(e))return e;if(typeof e=="object")return jt.fromObject(e);throw new xr(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=Tv(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=vv(e);return r?jt.fromObject(r,n):jt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Duration is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new ox(r);return new jt({invalid:r})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new lm(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?or.create(this.loc,r).formatDurationFromString(this,e):Ug}toHuman(e={}){if(!this.isValid)return Ug;const n=us.map(r=>{const c=this.values[r];return Lt(c)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(c)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=bd(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},Dt.fromMillis(n,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Jm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e),r={};for(const c of us)(el(n.values,c)||el(this.values,c))&&(r[c]=n.get(c)+this.get(c));return wo(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Pm(e(this.values[r],r));return wo(this,{values:n},!0)}get(e){return this[jt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...hc(e,jt.normalizeUnit)};return wo(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:c}={}){const g={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:c,conversionAccuracy:r};return wo(this,g)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Gg(this.matrix,e),wo(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=bv(this.normalize().shiftToAll().toObject());return wo(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(g=>jt.normalizeUnit(g));const n={},r={},c=this.toObject();let d;for(const g of us)if(e.indexOf(g)>=0){d=g;let p=0;for(const v in r)p+=this.matrix[v][g]*r[v],r[v]=0;ds(c[g])&&(p+=c[g]);const N=Math.trunc(p);n[g]=N,r[g]=(p*1e3-N*1e3)/1e3}else ds(c[g])&&(r[g]=c[g]);for(const g in r)r[g]!==0&&(n[d]+=g===d?r[g]:r[g]/this.matrix[d][g]);return Gg(this.matrix,n),wo(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return wo(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,c){return r===void 0||r===0?c===void 0||c===0:r===c}for(const r of us)if(!n(this.values[r],e.values[r]))return!1;return!0}}const js="Invalid Interval";function Lv(t,e){return!t||!t.isValid?wn.invalid("missing or invalid start"):!e||!e.isValid?wn.invalid("missing or invalid end"):e<t?wn.invalid("end before start",`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`):null}class wn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the Interval is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new ix(r);return new wn({invalid:r})}static fromDateTimes(e,n){const r=Gl(e),c=Gl(n),d=Lv(r,c);return d??new wn({start:r,end:c})}static after(e,n){const r=jt.fromDurationLike(n),c=Gl(e);return wn.fromDateTimes(c,c.plus(r))}static before(e,n){const r=jt.fromDurationLike(n),c=Gl(e);return wn.fromDateTimes(c.minus(r),c)}static fromISO(e,n){const[r,c]=(e||"").split("/",2);if(r&&c){let d,g;try{d=Dt.fromISO(r,n),g=d.isValid}catch{g=!1}let p,N;try{p=Dt.fromISO(c,n),N=p.isValid}catch{N=!1}if(g&&N)return wn.fromDateTimes(d,p);if(g){const v=jt.fromISO(c,n);if(v.isValid)return wn.after(d,v)}else if(N){const v=jt.fromISO(r,n);if(v.isValid)return wn.before(p,v)}}return wn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(e,n);let c;return n!=null&&n.useLocaleWeeks?c=this.end.reconfigure({locale:r.locale}):c=this.end,c=c.startOf(e,n),Math.floor(c.diff(r,e).get(e))+(c.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?wn.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Gl).filter(g=>this.contains(g)).sort((g,p)=>g.toMillis()-p.toMillis()),r=[];let{s:c}=this,d=0;for(;c<this.e;){const g=n[d]||this.e,p=+g>+this.e?this.e:g;r.push(wn.fromDateTimes(c,p)),c=p,d+=1}return r}splitBy(e){const n=jt.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,c=1,d;const g=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(N=>N*c));d=+p>+this.e?this.e:p,g.push(wn.fromDateTimes(r,d)),r=d,c+=1}return g}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return n>=r?null:wn.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return wn.fromDateTimes(n,r)}static merge(e){const[n,r]=e.sort((c,d)=>c.s-d.s).reduce(([c,d],g)=>d?d.overlaps(g)||d.abutsStart(g)?[c,d.union(g)]:[c.concat([d]),g]:[c,g],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0;const c=[],d=e.map(N=>[{time:N.s,type:"s"},{time:N.e,type:"e"}]),g=Array.prototype.concat(...d),p=g.sort((N,v)=>N.time-v.time);for(const N of p)r+=N.type==="s"?1:-1,r===1?n=N.time:(n&&+n!=+N.time&&c.push(wn.fromDateTimes(n,N.time)),n=null);return wn.merge(c)}difference(...e){return wn.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:js}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=uc,n={}){return this.isValid?or.create(this.s.loc.clone(n),e).formatInterval(this):js}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:js}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:js}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:js}toFormat(e,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:js}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):jt.invalid(this.invalidReason)}mapEndpoints(e){return wn.fromDateTimes(e(this.s),e(this.e))}}class Xa{static hasDST(e=bn.defaultZone){const n=Dt.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return no.isValidZone(e)}static normalizeZone(e){return Do(e,bn.defaultZone)}static getStartOfWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:n=null}={}){return(n||en.create(e)).getWeekendDays().slice()}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||en.create(n,r,d)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||en.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return en.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return en.create(n,null,"gregory").eras(e)}static features(){return{relative:Lm(),localeWeek:km()}}}function Yg(t,e){const n=c=>c.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(jt.fromMillis(r).as("days"))}function kv(t,e,n){const r=[["years",(N,v)=>v.year-N.year],["quarters",(N,v)=>v.quarter-N.quarter+(v.year-N.year)*4],["months",(N,v)=>v.month-N.month+(v.year-N.year)*12],["weeks",(N,v)=>{const T=Yg(N,v);return(T-T%7)/7}],["days",Yg]],c={},d=t;let g,p;for(const[N,v]of r)n.indexOf(N)>=0&&(g=N,c[N]=v(t,e),p=d.plus(c),p>e?(c[N]--,t=d.plus(c),t>e&&(p=t,c[N]--,t=d.plus(c))):t=p);return[t,c,p,g]}function Iv(t,e,n,r){let[c,d,g,p]=kv(t,e,n);const N=e-c,v=n.filter(O=>["hours","minutes","seconds","milliseconds"].indexOf(O)>=0);v.length===0&&(g<e&&(g=c.plus({[p]:1})),g!==c&&(d[p]=(d[p]||0)+N/(g-c)));const T=jt.fromObject(d,r);return v.length>0?jt.fromMillis(N,r).shiftTo(...v).plus(T):T}const Pd={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},jg={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Pv=Pd.hanidec.replace(/[\[|\]]/g,"").split("");function $v(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);if(t[n].search(Pd.hanidec)!==-1)e+=Pv.indexOf(t[n]);else for(const c in jg){const[d,g]=jg[c];r>=d&&r<=g&&(e+=r-d)}}return parseInt(e,10)}else return e}function di({numberingSystem:t},e=""){return new RegExp(`${Pd[t||"latn"]}${e}`)}const Fv="missing Intl.DateTimeFormat.formatToParts support";function Jt(t,e=n=>n){return{regex:t,deser:([n])=>e($v(n))}}const Bv=" ",Xm=`[ ${Bv}]`,Qm=new RegExp(Xm,"g");function Hv(t){return t.replace(/\./g,"\\.?").replace(Qm,Xm)}function Vg(t){return t.replace(/\./g,"").replace(Qm," ").toLowerCase()}function fi(t,e){return t===null?null:{regex:RegExp(t.map(Hv).join("|")),deser:([n])=>t.findIndex(r=>Vg(n)===Vg(r))+e}}function qg(t,e){return{regex:t,deser:([,n,r])=>Tc(n,r),groups:e}}function Qa(t){return{regex:t,deser:([e])=>e}}function Wv(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Kv(t,e){const n=di(e),r=di(e,"{2}"),c=di(e,"{3}"),d=di(e,"{4}"),g=di(e,"{6}"),p=di(e,"{1,2}"),N=di(e,"{1,3}"),v=di(e,"{1,6}"),T=di(e,"{1,9}"),O=di(e,"{2,4}"),b=di(e,"{4,6}"),R=P=>({regex:RegExp(Wv(P.val)),deser:([H])=>H,literal:!0}),w=(P=>{if(t.literal)return R(P);switch(P.val){case"G":return fi(e.eras("short"),0);case"GG":return fi(e.eras("long"),0);case"y":return Jt(v);case"yy":return Jt(O,rd);case"yyyy":return Jt(d);case"yyyyy":return Jt(b);case"yyyyyy":return Jt(g);case"M":return Jt(p);case"MM":return Jt(r);case"MMM":return fi(e.months("short",!0),1);case"MMMM":return fi(e.months("long",!0),1);case"L":return Jt(p);case"LL":return Jt(r);case"LLL":return fi(e.months("short",!1),1);case"LLLL":return fi(e.months("long",!1),1);case"d":return Jt(p);case"dd":return Jt(r);case"o":return Jt(N);case"ooo":return Jt(c);case"HH":return Jt(r);case"H":return Jt(p);case"hh":return Jt(r);case"h":return Jt(p);case"mm":return Jt(r);case"m":return Jt(p);case"q":return Jt(p);case"qq":return Jt(r);case"s":return Jt(p);case"ss":return Jt(r);case"S":return Jt(N);case"SSS":return Jt(c);case"u":return Qa(T);case"uu":return Qa(p);case"uuu":return Jt(n);case"a":return fi(e.meridiems(),0);case"kkkk":return Jt(d);case"kk":return Jt(O,rd);case"W":return Jt(p);case"WW":return Jt(r);case"E":case"c":return Jt(n);case"EEE":return fi(e.weekdays("short",!1),1);case"EEEE":return fi(e.weekdays("long",!1),1);case"ccc":return fi(e.weekdays("short",!0),1);case"cccc":return fi(e.weekdays("long",!0),1);case"Z":case"ZZ":return qg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return qg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return Qa(/[a-z_+-/]{1,256}?/i);case" ":return Qa(/[^\S\n\r]/);default:return R(P)}})(t)||{invalidReason:Fv};return w.token=t,w}const zv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Uv(t,e,n){const{type:r,value:c}=t;if(r==="literal"){const N=/^\s+$/.test(c);return{literal:!N,val:N?" ":c}}const d=e[r];let g=r;r==="hour"&&(e.hour12!=null?g=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?g="hour12":g="hour24":g=n.hour12?"hour12":"hour24");let p=zv[g];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Gv(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function Yv(t,e,n){const r=t.match(e);if(r){const c={};let d=1;for(const g in n)if(el(n,g)){const p=n[g],N=p.groups?p.groups+1:1;!p.literal&&p.token&&(c[p.token.val[0]]=p.deser(r.slice(d,d+N))),d+=N}return[r,c]}else return[r,{}]}function jv(t){const e=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(t.z)||(n=no.create(t.z)),Lt(t.Z)||(n||(n=new ur(t.Z)),r=t.Z),Lt(t.q)||(t.M=(t.q-1)*3+1),Lt(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),Lt(t.u)||(t.S=Rd(t.u)),[Object.keys(t).reduce((d,g)=>{const p=e(g);return p&&(d[p]=t[g]),d},{}),n,r]}let Iu=null;function Vv(){return Iu||(Iu=Dt.fromMillis(1555555555555)),Iu}function qv(t,e){if(t.literal)return t;const n=or.macroTokenToFormatOpts(t.val),r=n_(n,e);return r==null||r.includes(void 0)?t:r}function e_(t,e){return Array.prototype.concat(...t.map(n=>qv(n,e)))}function t_(t,e,n){const r=e_(or.parseFormat(n),t),c=r.map(g=>Kv(g,t)),d=c.find(g=>g.invalidReason);if(d)return{input:e,tokens:r,invalidReason:d.invalidReason};{const[g,p]=Gv(c),N=RegExp(g,"i"),[v,T]=Yv(e,N,p),[O,b,R]=T?jv(T):[null,null,void 0];if(el(T,"a")&&el(T,"H"))throw new qs("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:N,rawMatches:v,matches:T,result:O,zone:b,specificOffset:R}}}function Zv(t,e,n){const{result:r,zone:c,specificOffset:d,invalidReason:g}=t_(t,e,n);return[r,c,d,g]}function n_(t,e){if(!t)return null;const r=or.create(e,t).dtFormatter(Vv()),c=r.formatToParts(),d=r.resolvedOptions();return c.map(g=>Uv(g,t,d))}const Pu="Invalid DateTime",Zg=864e13;function ec(t){return new gi("unsupported zone",`the zone "${t.name}" is not supported`)}function $u(t){return t.weekData===null&&(t.weekData=dc(t.c)),t.weekData}function Fu(t){return t.localWeekData===null&&(t.localWeekData=dc(t.c,t.loc.getMinDaysInFirstWeek(),t.loc.getStartOfWeek())),t.localWeekData}function os(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new Dt({...n,...e,old:n})}function r_(t,e,n){let r=t-e*60*1e3;const c=n.offset(r);if(e===c)return[r,e];r-=(c-e)*60*1e3;const d=n.offset(r);return c===d?[r,c]:[t-Math.min(c,d)*60*1e3,Math.max(c,d)]}function tc(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function oc(t,e,n){return r_(Ec(t),e,n)}function Jg(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),c=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,d={...t.c,year:r,month:c,day:Math.min(t.c.day,fc(r,c))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},g=jt.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),p=Ec(d);let[N,v]=r_(p,n,t.zone);return g!==0&&(N+=g,v=t.zone.offset(N)),{ts:N,o:v}}function Ul(t,e,n,r,c,d){const{setZone:g,zone:p}=n;if(t&&Object.keys(t).length!==0||e){const N=e||p,v=Dt.fromObject(t,{...n,zone:N,specificOffset:d});return g?v:v.setZone(p)}else return Dt.invalid(new gi("unparsable",`the input "${c}" can't be parsed as ${r}`))}function nc(t,e,n=!0){return t.isValid?or.create(en.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Bu(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=Pn(t.c.year,n?6:4),e?(r+="-",r+=Pn(t.c.month),r+="-",r+=Pn(t.c.day)):(r+=Pn(t.c.month),r+=Pn(t.c.day)),r}function Xg(t,e,n,r,c,d){let g=Pn(t.c.hour);return e?(g+=":",g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=":")):g+=Pn(t.c.minute),(t.c.millisecond!==0||t.c.second!==0||!n)&&(g+=Pn(t.c.second),(t.c.millisecond!==0||!r)&&(g+=".",g+=Pn(t.c.millisecond,3))),c&&(t.isOffsetFixed&&t.offset===0&&!d?g+="Z":t.o<0?(g+="-",g+=Pn(Math.trunc(-t.o/60)),g+=":",g+=Pn(Math.trunc(-t.o%60))):(g+="+",g+=Pn(Math.trunc(t.o/60)),g+=":",g+=Pn(Math.trunc(t.o%60)))),d&&(g+="["+t.zone.ianaName+"]"),g}const i_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Jv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Xv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},o_=["year","month","day","hour","minute","second","millisecond"],Qv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],eS=["year","ordinal","hour","minute","second","millisecond"];function tS(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new lm(t);return e}function Qg(t){switch(t.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return tS(t)}}function ep(t,e){const n=Do(e.zone,bn.defaultZone),r=en.fromObject(e),c=bn.now();let d,g;if(Lt(t.year))d=c;else{for(const v of o_)Lt(t[v])&&(t[v]=i_[v]);const p=Rm(t)||bm(t);if(p)return Dt.invalid(p);const N=n.offset(c);[d,g]=oc(t,N,n)}return new Dt({ts:d,zone:n,loc:r,o:g})}function tp(t,e,n){const r=Lt(n.round)?!0:n.round,c=(g,p)=>(g=bd(g,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(g,p)),d=g=>n.calendary?e.hasSame(t,g)?0:e.startOf(g).diff(t.startOf(g),g).get(g):e.diff(t,g).get(g);if(n.unit)return c(d(n.unit),n.unit);for(const g of n.units){const p=d(g);if(Math.abs(p)>=1)return c(p,g)}return c(t>e?-0:0,n.units[n.units.length-1])}function np(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class Dt{constructor(e){const n=e.zone||bn.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new gi("invalid input"):null)||(n.isValid?null:ec(n));this.ts=Lt(e.ts)?bn.now():e.ts;let c=null,d=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[c,d]=[e.old.c,e.old.o];else{const p=n.offset(this.ts);c=tc(this.ts,p),r=Number.isNaN(c.year)?new gi("invalid input"):null,c=r?null:c,d=r?null:p}this._zone=n,this.loc=e.loc||en.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=c,this.o=d,this.isLuxonDateTime=!0}static now(){return new Dt({})}static local(){const[e,n]=np(arguments),[r,c,d,g,p,N,v]=n;return ep({year:r,month:c,day:d,hour:g,minute:p,second:N,millisecond:v},e)}static utc(){const[e,n]=np(arguments),[r,c,d,g,p,N,v]=n;return e.zone=ur.utcInstance,ep({year:r,month:c,day:d,hour:g,minute:p,second:N,millisecond:v},e)}static fromJSDate(e,n={}){const r=Mx(e)?e.valueOf():NaN;if(Number.isNaN(r))return Dt.invalid("invalid input");const c=Do(n.zone,bn.defaultZone);return c.isValid?new Dt({ts:r,zone:c,loc:en.fromObject(n)}):Dt.invalid(ec(c))}static fromMillis(e,n={}){if(ds(e))return e<-Zg||e>Zg?Dt.invalid("Timestamp out of range"):new Dt({ts:e,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(ds(e))return new Dt({ts:e*1e3,zone:Do(n.zone,bn.defaultZone),loc:en.fromObject(n)});throw new xr("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=Do(n.zone,bn.defaultZone);if(!r.isValid)return Dt.invalid(ec(r));const c=en.fromObject(n),d=hc(e,Qg),{minDaysInFirstWeek:g,startOfWeek:p}=Bg(d,c),N=bn.now(),v=Lt(n.specificOffset)?r.offset(N):n.specificOffset,T=!Lt(d.ordinal),O=!Lt(d.year),b=!Lt(d.month)||!Lt(d.day),R=O||b,x=d.weekYear||d.weekNumber;if((R||T)&&x)throw new qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(b&&T)throw new qs("Can't mix ordinal dates with month/day");const w=x||d.weekday&&!R;let P,H,$=tc(N,v);w?(P=Qv,H=Jv,$=dc($,g,p)):T?(P=eS,H=Xv,$=ku($)):(P=o_,H=i_);let W=!1;for(const U of P){const q=d[U];Lt(q)?W?d[U]=H[U]:d[U]=$[U]:W=!0}const B=w?Ox(d,g,p):T?Dx(d):Rm(d),z=B||bm(d);if(z)return Dt.invalid(z);const X=w?$g(d,g,p):T?Fg(d):d,[ee,le]=oc(X,v,r),j=new Dt({ts:ee,zone:r,o:le,loc:c});return d.weekday&&R&&e.weekday!==j.weekday?Dt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${j.toISO()}`):j}static fromISO(e,n={}){const[r,c]=Nv(e);return Ul(r,c,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,c]=Cv(e);return Ul(r,c,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,c]=Ev(e);return Ul(r,c,n,"HTTP",n)}static fromFormat(e,n,r={}){if(Lt(e)||Lt(n))throw new xr("fromFormat requires an input string and a format");const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0}),[p,N,v,T]=Zv(g,e,n);return T?Dt.invalid(T):Ul(p,N,r,`format ${n}`,e,v)}static fromString(e,n,r={}){return Dt.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,c]=Dv(e);return Ul(r,c,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new xr("need to specify a reason the DateTime is invalid");const r=e instanceof gi?e:new gi(e,n);if(bn.throwOnInvalid)throw new rx(r);return new Dt({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=n_(e,en.fromObject(n));return r?r.map(c=>c?c.val:null).join(""):null}static expandFormat(e,n={}){return e_(or.parseFormat(e),en.fromObject(n)).map(c=>c.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?$u(this).weekYear:NaN}get weekNumber(){return this.isValid?$u(this).weekNumber:NaN}get weekday(){return this.isValid?$u(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Fu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Fu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Fu(this).weekYear:NaN}get ordinal(){return this.isValid?ku(this.c).ordinal:NaN}get monthShort(){return this.isValid?Xa.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Xa.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Xa.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Xa.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,n=6e4,r=Ec(this.c),c=this.zone.offset(r-e),d=this.zone.offset(r+e),g=this.zone.offset(r-c*n),p=this.zone.offset(r-d*n);if(g===p)return[this];const N=r-g*n,v=r-p*n,T=tc(N,g),O=tc(v,p);return T.hour===O.hour&&T.minute===O.minute&&T.second===O.second&&T.millisecond===O.millisecond?[os(this,{ts:N}),os(this,{ts:v})]:[this]}get isInLeapYear(){return na(this.year)}get daysInMonth(){return fc(this.year,this.month)}get daysInYear(){return this.isValid?Zs(this.year):NaN}get weeksInWeekYear(){return this.isValid?ea(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ea(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:c}=or.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:c}}toUTC(e=0,n={}){return this.setZone(ur.instance(e),n)}toLocal(){return this.setZone(bn.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=Do(e,bn.defaultZone),e.equals(this.zone))return this;if(e.isValid){let c=this.ts;if(n||r){const d=e.offset(this.ts),g=this.toObject();[c]=oc(g,d,e)}return os(this,{ts:c,zone:e})}else return Dt.invalid(ec(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const c=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return os(this,{loc:c})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=hc(e,Qg),{minDaysInFirstWeek:r,startOfWeek:c}=Bg(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),g=!Lt(n.ordinal),p=!Lt(n.year),N=!Lt(n.month)||!Lt(n.day),v=p||N,T=n.weekYear||n.weekNumber;if((v||g)&&T)throw new qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(N&&g)throw new qs("Can't mix ordinal dates with month/day");let O;d?O=$g({...dc(this.c,r,c),...n},r,c):Lt(n.ordinal)?(O={...this.toObject(),...n},Lt(n.day)&&(O.day=Math.min(fc(O.year,O.month),O.day))):O=Fg({...ku(this.c),...n});const[b,R]=oc(O,this.o,this.zone);return os(this,{ts:b,o:R})}plus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e);return os(this,Jg(this,n))}minus(e){if(!this.isValid)return this;const n=jt.fromDurationLike(e).negate();return os(this,Jg(this,n))}startOf(e,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},c=jt.normalizeUnit(e);switch(c){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(c==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:g}=this;g<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(c==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(e,n){return this.isValid?this.plus({[e]:1}).startOf(e,n).minus(1):this}toFormat(e,n={}){return this.isValid?or.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):Pu}toLocaleString(e=uc,n={}){return this.isValid?or.create(this.loc.clone(n),e).formatDateTime(this):Pu}toLocaleParts(e={}){return this.isValid?or.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:c=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const g=e==="extended";let p=Bu(this,g);return p+="T",p+=Xg(this,g,n,r,c,d),p}toISODate({format:e="extended"}={}){return this.isValid?Bu(this,e==="extended"):null}toISOWeekDate(){return nc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:c=!1,extendedZone:d=!1,format:g="extended"}={}){return this.isValid?(c?"T":"")+Xg(this,g==="extended",n,e,r,d):null}toRFC2822(){return nc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return nc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Bu(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let c="HH:mm:ss.SSS";return(n||e)&&(r&&(c+=" "),n?c+="z":e&&(c+="ZZ")),nc(this,c,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Pu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return jt.invalid("created by diffing an invalid DateTime");const c={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Rx(n).map(jt.normalizeUnit),g=e.valueOf()>this.valueOf(),p=g?this:e,N=g?e:this,v=Iv(p,N,d,c);return g?v.negate():v}diffNow(e="milliseconds",n={}){return this.diff(Dt.now(),e,n)}until(e){return this.isValid?wn.fromDateTimes(this,e):this}hasSame(e,n,r){if(!this.isValid)return!1;const c=e.valueOf(),d=this.setZone(e.zone,{keepLocalTime:!0});return d.startOf(n,r)<=c&&c<=d.endOf(n,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||Dt.fromObject({},{zone:this.zone}),r=e.padding?this<n?-e.padding:e.padding:0;let c=["years","months","days","hours","minutes","seconds"],d=e.unit;return Array.isArray(e.unit)&&(c=e.unit,d=void 0),tp(n,this.plus(r),{...e,numeric:"always",units:c,unit:d})}toRelativeCalendar(e={}){return this.isValid?tp(e.base||Dt.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Dt.isDateTime))throw new xr("min requires all arguments be DateTimes");return Hg(e,n=>n.valueOf(),Math.min)}static max(...e){if(!e.every(Dt.isDateTime))throw new xr("max requires all arguments be DateTimes");return Hg(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:c=null,numberingSystem:d=null}=r,g=en.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});return t_(g,e,n)}static fromStringExplain(e,n,r={}){return Dt.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return uc}static get DATE_MED(){return am}static get DATE_MED_WITH_WEEKDAY(){return sx}static get DATE_FULL(){return cm}static get DATE_HUGE(){return um}static get TIME_SIMPLE(){return dm}static get TIME_WITH_SECONDS(){return fm}static get TIME_WITH_SHORT_OFFSET(){return hm}static get TIME_WITH_LONG_OFFSET(){return gm}static get TIME_24_SIMPLE(){return pm}static get TIME_24_WITH_SECONDS(){return mm}static get TIME_24_WITH_SHORT_OFFSET(){return _m}static get TIME_24_WITH_LONG_OFFSET(){return ym}static get DATETIME_SHORT(){return Nm}static get DATETIME_SHORT_WITH_SECONDS(){return Cm}static get DATETIME_MED(){return Em}static get DATETIME_MED_WITH_SECONDS(){return Tm}static get DATETIME_MED_WITH_WEEKDAY(){return lx}static get DATETIME_FULL(){return xm}static get DATETIME_FULL_WITH_SECONDS(){return vm}static get DATETIME_HUGE(){return Sm}static get DATETIME_HUGE_WITH_SECONDS(){return wm}}function Gl(t){if(Dt.isDateTime(t))return t;if(t&&t.valueOf&&ds(t.valueOf()))return Dt.fromJSDate(t);if(t&&typeof t=="object")return Dt.fromObject(t);throw new xr(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var Xt=(t=>(t.Monday="MONDAY",t.Tuesday="TUESDAY",t.Wednesday="WEDNESDAY",t.Thursday="THURSDAY",t.Friday="FRIDAY",t.Saturday="SATURDAY",t.Sunday="SUNDAY",t))(Xt||{});function $d(t){const e={1:Xt.Monday,2:Xt.Tuesday,3:Xt.Wednesday,4:Xt.Thursday,5:Xt.Friday,6:Xt.Saturday,7:Xt.Sunday};if(t.weekday in e)return e[t.weekday];throw new Error(`Invalid DateTime.weekday property: ${t}, ${t.weekday}`)}function $i(t){return{[Xt.Monday]:"Monday",[Xt.Tuesday]:"Tuesday",[Xt.Wednesday]:"Wednesday",[Xt.Thursday]:"Thursday",[Xt.Friday]:"Friday",[Xt.Saturday]:"Saturday",[Xt.Sunday]:"Sunday"}[t]}class rp{constructor(e,n,r){Vn(this,"end");Vn(this,"start");this.end=e.setZone(r),this.start=e.setZone(r),[n.start,n.end].forEach(N=>{if(N.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[c,d]=n.start.split(":"),[g,p]=n.end.split(":");this.end=this.end.set({hour:Number(g),minute:Number(p)}),this.start=this.start.set({hour:Number(c),minute:Number(d)}),this.end<this.start&&(this.end=this.end.plus({days:1})),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(e){return this.start<=e&&e<this.end}getStartTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(e||"en-US").toLocaleString(r)}getEndTime(e,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(e||"en-US").toLocaleString(r)}timeIsEqualTo(e){const n=this.getStartTime()===e.getStartTime(),r=this.getEndTime()===e.getEndTime();return n&&r}is24h(){const e=this.start.minute===0&&this.start.hour===0,n=this.end.minute===0&&this.end.hour===0,r=this.end.day-this.start.day===1||this.end.day===1;return e&&n&&r}}class s_{constructor(e,n){Vn(this,"holidayHoursByDate");Vn(this,"hours");Vn(this,"timezone");this.holidayHoursByDate=Object.fromEntries((e.holidayHours||[]).map(r=>[r.date,r])),this.hours=e,this.timezone=n}getInterval(e){if(this.isTemporarilyClosedAt(e))return null;let n=e;n=n.minus({days:1});for(const r of[n,e]){const c=this.getHours(r);if(c&&!c.isClosed)for(const d of c.openIntervals||[]){const g=new rp(r,d,this.timezone);if(g.contains(e))return g}}return null}getCurrentInterval(){return this.getInterval(Dt.now())}getIntervalAfter(e){const n=this.getIntervalsForNDays(8,e),r=(d,g)=>d.start===g.start?0:d.start>g.start?1:-1,c=n.sort(r);for(const[d,g]of c.entries())if(g.contains(e)&&c.length>d+1)return c[d+1];for(const d of c)if(d.start>e)return d;return null}getIntervalsForNDays(e,n){const r=[];for(let c=0;c<e;c++){let d=n;d=d.plus({days:c});const g=this.getHours(d);g&&!g.isClosed&&r.push(...g.openIntervals.map(p=>new rp(d,p,this.timezone)))}return r}getHolidayHours(e){return this.isTemporarilyClosedAt(e)?null:this.holidayHoursByDate[(e.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(e){if(this.isTemporarilyClosedAt(e))return null;const n=$i($d(e)).toLowerCase();return this.hours[n]}getHours(e){const n=this.getHolidayHours(e);return!n||n.isRegularHours?this.getNormalHours(e):n}getNextInterval(){return this.getIntervalAfter(Dt.now())}isHoliday(e){return!!this.getHolidayHours(e)}isTemporarilyClosedAt(e){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,c,d]=n,g=Dt.fromObject({year:Number(r),month:Number(c),day:Number(d)},{zone:this.timezone});if(e<g)return!0}return!1}isOpenAt(e){return this.isTemporarilyClosedAt(e)?!1:!!this.getInterval(e)}isOpenNow(){return this.isOpenAt(Dt.now())}}function nS(t,e){const n=[...t];return e=e%n.length,n.concat(n.splice(0,n.length-e))}function rS(t,e){if(t.length!==e.length)return!1;for(const[n,r]of t.entries())if(!r.timeIsEqualTo(e[n]))return!1;return!0}function oa(t){var e,n;return((n=(e=t==null?void 0:t.currentInterval)==null?void 0:e.is24h)==null?void 0:n.call(e))||!1}function sa(t){return!t.futureInterval}function iS(t){return oa(t)?at.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):sa(t)?at.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):at.jsx("span",{className:"HoursStatus-current",children:t.isOpen?"Open Now":"Closed"})}function oS(t){return oa(t)||sa(t)?null:at.jsx("span",{className:"HoursStatus-separator",children:" • "})}function sS(t){return oa(t)||sa(t)?null:at.jsx("span",{className:"HoursStatus-future",children:t.isOpen?"Closes at":"Opens at"})}function lS(t){if(oa(t)||sa(t))return null;let e="";if(t.isOpen){const n=t.currentInterval;e+=n?n.getEndTime("en-US",t.timeOptions):""}else{const n=t.futureInterval;e+=n?n.getStartTime("en-US",t.timeOptions):""}return at.jsxs("span",{className:"HoursStatus-time",children:[" ",e]})}function aS(t){var r,c;if(oa(t)||sa(t))return null;const e={weekday:"long",...t.dayOptions??{}};let n="";if(t.isOpen){const d=t.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(e))||""}else{const d=t.futureInterval;n+=((c=d==null?void 0:d.start)==null?void 0:c.setLocale("en-US").toLocaleString(e))||""}return at.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function cS(t,e){const n=t.currentTemplate||iS,r=t.separatorTemplate||oS,c=t.futureTemplate||sS,d=t.timeTemplate||lS,g=t.dayOfWeekTemplate||aS;return at.jsxs("div",{className:Qs("HoursStatus",(e==null?void 0:e.className)||""),children:[n(t),r(t),c(t),d(t),g(t)]})}const uS=t=>{const[e,n]=et.useState(!1),[r,c]=et.useState(!1);et.useEffect(()=>{c(!0)},[]);const d=t.statusTemplate||cS,g=new s_(t.hours,t.timezone),p=g.isOpenNow(),N=g.getCurrentInterval(),v=g.getNextInterval(),T=(N==null?void 0:N.end)||(v==null?void 0:v.start);if(T&&!e){n(!0);const b=T.toMillis()-Dt.now().toMillis();setTimeout(()=>n(!1),b)}const O={isOpen:p,currentInterval:N,futureInterval:v,...t};return at.jsx(at.Fragment,{children:r&&d(O,t)})};function dS(t,e){const n=[];return t.forEach(r=>{const c=n[n.length-1];c?rS(c.intervals,r.intervals)?(c.endDay=r.endDay,c.isToday=c.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const c=e&&$i(r.startDay)in e?e[$i(r.startDay)]||"":$i(r.startDay),d=e&&$i(r.endDay)in e?e[$i(r.endDay)]||"":$i(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${c}`:`${c} - ${d}`}})}function fS(t,e){const n=[],r=t.intervals.length>0&&t.intervals[0].is24h();return t.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):t.intervals.forEach(c=>{const d=c.getStartTime("en-US",e),g=c.getEndTime("en-US",e);n.push(`${d} - ${g}`)}),n}function hS(t,e,n){const r=[];for(let c=1;c<=7;c++){const d=Dt.fromObject({weekday:c}),g=$d(d);r.push({startDay:g,endDay:g,dayName:n&&$i(g).toLowerCase()in n?n[$i(g).toLowerCase()]||"":$i(g),intervals:t.filter(p=>p.start.weekday===c),isToday:e.weekday===c})}return r}const gS=t=>{const[e,n]=et.useState(!1);et.useEffect(()=>{n(!0)},[]);const r=new s_(t.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),c=Dt.now(),d=r.getIntervalsForNDays(7,c);let g=hS(d,c,t.dayOfWeekNames);function p(T){return T?{today:$d(c),monday:Xt.Monday,tuesday:Xt.Tuesday,wednesday:Xt.Wednesday,thursday:Xt.Thursday,friday:Xt.Friday,saturday:Xt.Saturday,sunday:Xt.Sunday}[T]:Xt.Sunday}let N=[Xt.Sunday,Xt.Monday,Xt.Tuesday,Xt.Wednesday,Xt.Thursday,Xt.Friday,Xt.Saturday];const v=N.indexOf(p(t.startOfWeek));return N=nS(N,7-v),g.sort((T,O)=>N.indexOf(T.startDay)-N.indexOf(O.startDay)),t.collapseDays&&(g=dS(g,t.dayOfWeekNames)),at.jsx(at.Fragment,{children:e&&at.jsx("div",{className:Qs("HoursTable",t.className),children:g.map(T=>{const b=(t.intervalStringsBuilderFn||fS)(T,t.timeOptions);return at.jsxs("div",{className:Qs("HoursTable-row",{"is-today":T.isToday}),children:[at.jsx("span",{className:"HoursTable-day",children:T.dayName}),at.jsx("span",{className:"HoursTable-intervals",children:b.map((R,x)=>at.jsx("span",{className:"HoursTable-interval",children:R},x))})]},T.dayName)})})})},pS=t=>`<script type="application/ld+json">
105
105
  ${JSON.stringify(t)}
106
- <\/script>`,vc=(t,e)=>({"@context":"https://schema.org","@type":e,name:t.name}),Fd=t=>t&&{address:{"@type":"PostalAddress",streetAddress:t.line1,addressLocality:t.city,addressRegion:t.region,postalCode:t.postalCode,addressCountry:t.countryCode}},l_=t=>t&&{"@type":"Place",name:t.name,...Fd(t.address)},Sc=t=>{if(!t)return{};const e=new Array;for(const n of t)e.push(n.image.url);return{image:e}},mS=t=>t&&{image:t.image.url},a_=t=>t&&{performer:{"@type":"PerformingGroup",name:t.join(" and ")}},c_=t=>t&&{organizer:{"@type":"Organization",name:t.name,url:t.url}},Bd=t=>t&&{offers:{"@type":"Offer",url:t.url,priceCurrency:t.priceCurrency,price:t.price,priceValidUntil:t.priceValidUntil,itemCondition:t.itemCondition,availability:t.availability}},_S=(t,e)=>({...vc(t,e??"Event"),...Sc(t.photoGallery),...l_({name:t.geomodifier,address:t.address}),startDate:t.c_startDate,endDate:t.c_endDate,description:t.description,eventAttendanceMode:t.attendance,eventStatus:t.eventStatus,...a_(t.performers),...c_({name:t.organizerName}),...Bd({url:"",priceCurrency:t.c_currency,price:t.price,priceValidUntil:t.expirationDate,itemCondition:t.stockStatus,availability:t.availabilityDate})}),u_=t=>{if(!(t!=null&&t.monday))return{};let e=new Map;e=ss(t.monday,e,"Mo"),e=ss(t.tuesday,e,"Tu"),e=ss(t.wednesday,e,"We"),e=ss(t.thursday,e,"Th"),e=ss(t.friday,e,"Fr"),e=ss(t.saturday,e,"Sa"),e=ss(t.sunday,e,"Su");const n=new Array;for(const[r,c]of e){const d=c.join(",");n.push(d+" "+r)}return{openingHours:n}},ss=(t,e,n)=>{if(!t||t.isClosed){const r="00:00-00:00",c=e.get(r)??[];return c.push(n),e.set(r,c),e}for(let r=0;r<t.openIntervals.length;r++){const c=t.openIntervals[r].start+"-"+t.openIntervals[r].end,d=e.get(c)??[];d.push(n),e.set(c,d)}return e},yS=(t,e)=>({...vc(t,e??"LocalBusiness"),...Fd(t.address),...u_(t.hours),...Sc(t.photoGallery),description:t.description,telephone:t.mainPhone,email:t.email}),d_=t=>t&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:t.ratingValue,bestRating:t.bestRating},author:{"@type":"Person",name:t.author}}},f_=t=>t&&{aggregateRating:{"@type":"AggregateRating",ratingValue:t.ratingValue,reviewCount:t.reviewCount}},NS=(t,e)=>({...vc(t,e??"Product"),...Sc(t.photoGallery),...d_(t.c_reviews),...f_(t.c_aggregateRating),...Bd({url:"",priceCurrency:t.c_currency,price:t.price,priceValidUntil:t.expirationDate,itemCondition:t.stockStatus,availability:t.availabilityDate}),description:t.description,sku:t.sku,mpn:t.mpn,brand:{"@type":"Brand",name:t.brand}});function id(t,e){for(const n in t)if(typeof t[n]=="object")if(Array.isArray(t[n]))for(let r=0;r<t[n].length;r++)id(t[n][r],e);else id(t[n],e);else n==="text"&&e.push(t[n])}function CS(t){if(t.json){const e=[];return id(t.json,e),e.join("")}return""}const ES=t=>({"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:"answer"in e?e.answer:CS(e.answerV2)}}))}),od=Math.log2(1.6745627884839434),TS=4,xS=19,sd="js-baidu-neg-lng-fix";let h_;const vS=new Promise(t=>h_=t),SS="https://api.map.baidu.com/geoconv/v1/";let Yl=[];const wS="gcj02ToBD09Callback_b872c21c";let OS=0,ip;async function g_(t){return await new Promise((e,n)=>{Yl.push({coordinates:t,resolve:e,reject:n}),Yl.length===1&&(ip=setTimeout(r,100)),Yl.length>40&&(clearTimeout(ip),r());function r(){const c=Yl;Yl=[];const d=[].concat(...c.map(C=>C.coordinates)),g=wS+"_"+OS++,p=document.createElement("script");window[g]=C=>{if(C.status){const O=new Error(`Unable to convert coordinates to BD-09: Received status code ${C.status}${C.message?": "+C.message:""}`);c.forEach(R=>R.reject(O))}const v=C.result.map(O=>new tn(O.y,O.x));let T=0;c.forEach(O=>{O.resolve(v.slice(T,T+=O.coordinates.length))}),delete window[g],p.parentNode.removeChild(p)},vS.then(C=>{const v={ak:C,callback:g,coords:d.map(T=>`${T.longitude},${T.latitude}`).join(";"),from:3,to:5};p.src=SS+"?"+Object.entries(v).map(([T,O])=>T+"="+O).join("&"),document.head.appendChild(p)})}})}class DS extends rl{constructor(e){super(e);const n=!!(window.MSInputMethodContext&&document.documentMode);this._wrapper=e.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:e.controlEnabled,maxZoom:n?14:18,...e.providerOptions}),e.controlEnabled?(this.map.enableScrollWheelZoom(),this.map.addControl(new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_ZOOM}))):(this.map.disableDragging(),this.map.disableDoubleClickZoom(),this.map.disablePinchToZoom()),this.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper.dataset.baiduZoom=this.map.getZoom(),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()-od}setCenter(e,n){this._centerReady=g_([e]).then(([r])=>{const c=new BMap.Point(r.longitude,r.latitude);this.map.panTo(c,{noAnimation:!n})})}setZoom(e,n){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(e+od)},{enableAnimation:n})})}}class AS extends gc{constructor(e){super(e),this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;const n=this;class r extends BMap.Marker{initialize(g){return n._wrapper=super.initialize(g),n._wrapper&&(n._wrapper.style.zIndex=n._zIndex,n._originalWrapperClass=n._wrapper.getAttribute("class"),n._wrapper.setAttribute("class",n._getClass()),n._wrapper.appendChild(n._element),n.addListeners()),n._wrapper}draw(){if(n._wrapper){const g=n._wrapper.style.zIndex;super.draw(),n._wrapper.style.height="",n._wrapper.style.width="",n._wrapper.style.pointerEvents="none",n._wrapper.style.zIndex=g}else super.draw()}}this.pin=new r(new BMap.Point(0,0));const c=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(c),this.pin.setShadow(c)}addListeners(){super.addListeners(),this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(e){this._coordinateReady=g_([e]).then(([n])=>{this._negativeLngFix=n.longitude<0,this.pin.setPosition(new BMap.Point(n.longitude+(this._negativeLngFix?180:0),n.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](sd)})}setMap(e,n){this._coordinateReady.then(()=>{n&&n.getProviderMap().map.removeOverlay(this.pin),e&&e.getProviderMap().map.addOverlay(this.pin)})}setProperties(e){super.setProperties(e),this._wrapperClass=e.getClass(),this._element=e.getElement()||this._pinEl,this._zIndex=e.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?sd:""} ${this._wrapperClass}`}}const MS="https://api.map.baidu.com/getscript";function RS(t,e,n,{params:r={},version:c="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,g={ak:d,v:c,...r};h_(d);const p=document.createElement("script");p.src=MS+"?"+Object.entries(g).map(([T,O])=>T+"="+O).join("&"),p.onload=()=>t(),document.head.appendChild(p);let C="";for(let T=TS;T<=xS;T++){const O=2**(T-od+7);C+=`[data-baidu-zoom="${T}"] .${sd}{transform:translateX(-${O}px);}`}const v=document.createElement("style");v.appendChild(document.createTextNode(C)),document.head.appendChild(v)}const bS=new fs().withLoadFunction(RS).withMapClass(DS).withPinClass(AS).withProviderName("Baidu").build();let p_;function LS(){class t extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1}),this._container=document.createElement("div"),this._map=null,this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(n){this._pins.add(n),n._wrapper.style.position="absolute",this._container.appendChild(n._wrapper),this._map&&this.updatePinPosition(n)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(n){this._pins.delete(n),this._container.removeChild(n._wrapper)}updatePinPosition(n){if(!this._map)return;const r=this._map.tryLocationToPixel(n._location,Microsoft.Maps.PixelReference.control);n._wrapper.style.left=r.x+"px",n._wrapper.style.top=r.y+"px"}updatePinPositions(){this._pins.forEach(n=>this.updatePinPosition(n))}}p_=t}class kS extends rl{constructor(e){super(e),this.wrapper=e.wrapper,this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!e.controlEnabled,disableZooming:!e.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...e.providerOptions}),this.pinOverlay=new p_(this.map),this.map.layers.insert(this.pinOverlay),Microsoft.Maps.Events.addHandler(this.map,"viewchangestart",()=>this._panStartHandler()),Microsoft.Maps.Events.addHandler(this.map,"viewchangeend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new Microsoft.Maps.Location(e.latitude,e.longitude);this.map.setView({center:r}),this.pinOverlay.updatePinPositions()}setZoom(e,n){this.map.setView({zoom:Math.floor(e)}),this.pinOverlay.updatePinPositions()}}class IS extends gc{static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}constructor(e){super(e),this._map=null,this._location=new Microsoft.Maps.Location(0,0)}setCoordinate(e){this._location=new Microsoft.Maps.Location(e.latitude,e.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(e,n){n&&n.getProviderMap().pinOverlay.removePin(this),e&&e.getProviderMap().pinOverlay.addPin(this),this._map=e}}const op="BingMapsCallback_593d7d33",PS="https://www.bing.com/api/maps/mapcontrol";function $S(t,e,n,{params:r={}}={}){window[op]=()=>{LS(),t()};const c={callback:op,key:n,...r};pp(PS+"?"+Object.entries(c).map(([d,g])=>d+"="+g).join("&"))}const FS=new fs().withLoadFunction($S).withMapClass(kS).withPinClass(IS).withProviderName("Bing").build();class BS extends rl{constructor(e){if(super(e),this.map=new mapboxgl.Map({container:e.wrapper,interactive:e.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...e.providerOptions}),e.controlEnabled){const n=new mapboxgl.NavigationControl({showCompass:!1});this.map.addControl(n)}this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()+1}setCenter(e,n){const r=new mapboxgl.LngLat(e.longitude,e.latitude);this.map[n?"panTo":"setCenter"](r)}setZoom(e,n){this.map[n?"zoomTo":"setZoom"](e-1)}setZoomCenter(e,n,r){const c=new mapboxgl.LngLat(n.longitude,n.latitude);this.map[r?"easeTo":"jumpTo"]({center:c,zoom:e-1})}}class HS extends gc{constructor(e){super(e),this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper})}setCoordinate(e){this.pin.setLngLat(new mapboxgl.LngLat(e.longitude,e.latitude))}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}}function WS(t,e,n,{version:r="v1.13.0"}={}){const c=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{mapboxgl.accessToken=n,t()},document.head.appendChild(d),document.head.appendChild(g)}const KS=new fs().withLoadFunction(WS).withMapClass(BS).withPinClass(HS).withProviderName("Mapbox").build();let m_=class extends rl{constructor(e){super(e),this._initMap(e),e.controlEnabled&&this.map.zoomControl.setPosition("topright"),this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new L.latLng(e.latitude,e.longitude);this.map.panTo(r,{animate:n})}setZoom(e,n){this.map.setZoom(e,{animate:n})}setZoomCenter(e,n,r){const c=new L.latLng(n.latitude,n.longitude);this.map.setView(c,e,{animate:r})}_initMap(e){this.map=new L.map(e.wrapper,{boxZoom:e.controlEnabled,doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions});const n=e.providerOptions,r=n.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",c=n.tileLayerOptions||{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',id:"mapbox/streets-v11"};c.accessToken=this.constructor.apiKey,L.tileLayer(r,c).addTo(this.map)}},zS=class extends fd{constructor(e){super(e),this.pin=new L.marker,this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(e){const n=new L.latLng(e.latitude,e.longitude);this.pin.setLatLng(n)}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}setProperties(e){const n=e.getWidth(),r=e.getHeight(),c=e.getAnchorX(),d=e.getAnchorY();this.pin.setIcon(new L.icon({iconUrl:this._icons[e.getIcon()],iconSize:[n,r],iconAnchor:[c*n,d*r],className:e.getClass()})),this.pin.setZIndexOffset(e.getZIndex())}};function US(t,e,n,{version:r="1.7.1"}={}){const c=`https://unpkg.com/leaflet@${r}/dist/leaflet`;m_.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>t(),document.head.appendChild(d),document.head.appendChild(g)}const Hd=new fs().withLoadFunction(US).withMapClass(m_).withPinClass(zS).withProviderName("Leaflet").build(),GS=Hd.getMapClass(),YS=Hd.getPinClass();class jS extends GS{_initMap(e){this.map=L.mapquest.map(e.wrapper,{boxZoom:e.controlEnabled,center:new L.latLng(0,0),doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions})}}class VS extends YS{}function qS(t,e,n,{version:r="v1.3.2"}={}){const c=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{L.mapquest.key=n,t()},document.head.appendChild(d),document.head.appendChild(g)}const ZS=new fs().withLoadFunction(qS).withMapClass(jS).withPinClass(VS).withProviderName("MapQuest").build();exports.Address=oy;exports.AddressSchema=Fd;exports.AggregateRatingSchema=f_;exports.Analytics=up;exports.AnalyticsContext=ud;exports.AnalyticsProvider=eN;exports.AnalyticsScopeProvider=tN;exports.BaiduMaps=bS;exports.BaseSchema=vc;exports.BingMaps=FS;exports.Clusterer=RN;exports.Coordinate=tn;exports.Day=Xt;exports.Event=_S;exports.FAQPage=ES;exports.GoogleMaps=yp;exports.HoursStatus=uS;exports.HoursTable=gS;exports.Image=cN;exports.ImageLayoutOption=Ao;exports.LeafletMaps=Hd;exports.LegacyRichText=nx;exports.LexicalRichText=gE;exports.Link=gp;exports.LinkTypes=pN;exports.ListingPublisherOption=sp;exports.LocalBusiness=yS;exports.LocationMap=kN;exports.LocationSchema=l_;exports.Map=Ep;exports.MapProviderOption=Wu;exports.MapQuestMaps=ZS;exports.MapboxMaps=KS;exports.Marker=pd;exports.OfferSchema=Bd;exports.OpeningHoursSchema=u_;exports.OrganizationSchema=c_;exports.PerformerSchema=a_;exports.PhotoGallerySchema=Sc;exports.PhotoSchema=mS;exports.Product=NS;exports.ReviewSchema=d_;exports.SchemaWrapper=pS;exports.asciiAlpha=vE;exports.asciiAlphanumeric=Ju;exports.asciiAtext=SE;exports.asciiControl=wE;exports.asciiDigit=OE;exports.asciiHexDigit=DE;exports.asciiPunctuation=AE;exports.c=Qs;exports.classifyCharacter=Ql;exports.combineExtensions=Yp;exports.createState=UT;exports.debuggingParamDetected=sc;exports.getDefaultExportFromCjs=ad;exports.getDirections=ry;exports.getRuntime=Xs;exports.jsxRuntimeExports=at;exports.markdownLineEnding=ME;exports.markdownLineEndingOrSpace=Qp;exports.markdownSpace=RE;exports.normalizeUri=ol;exports.push=Vs;exports.resolveAll=em;exports.splice=mc;exports.useAnalytics=nl;exports.useClusterContext=MN;exports.useIdentify=iN;exports.useMapContext=DN;exports.usePageView=rN;exports.useScope=dd;exports.useTrack=nN;exports.visit=Dd;
106
+ <\/script>`,vc=(t,e)=>({"@context":"https://schema.org","@type":e,name:t.name}),Fd=t=>t&&{address:{"@type":"PostalAddress",streetAddress:t.line1,addressLocality:t.city,addressRegion:t.region,postalCode:t.postalCode,addressCountry:t.countryCode}},l_=t=>t&&{"@type":"Place",name:t.name,...Fd(t.address)},Sc=t=>{if(!t)return{};const e=new Array;for(const n of t)e.push(n.image.url);return{image:e}},mS=t=>t&&{image:t.image.url},a_=t=>t&&{performer:{"@type":"PerformingGroup",name:t.join(" and ")}},c_=t=>t&&{organizer:{"@type":"Organization",name:t.name,url:t.url}},Bd=t=>t&&{offers:{"@type":"Offer",url:t.url,priceCurrency:t.priceCurrency,price:t.price,priceValidUntil:t.priceValidUntil,itemCondition:t.itemCondition,availability:t.availability}},_S=(t,e)=>({...vc(t,e??"Event"),...Sc(t.photoGallery),...l_({name:t.geomodifier,address:t.address}),startDate:t.c_startDate,endDate:t.c_endDate,description:t.description,eventAttendanceMode:t.attendance,eventStatus:t.eventStatus,...a_(t.performers),...c_({name:t.organizerName}),...Bd({url:"",priceCurrency:t.c_currency,price:t.price,priceValidUntil:t.expirationDate,itemCondition:t.stockStatus,availability:t.availabilityDate})}),u_=t=>{if(!(t!=null&&t.monday))return{};let e=new Map;e=ss(t.monday,e,"Mo"),e=ss(t.tuesday,e,"Tu"),e=ss(t.wednesday,e,"We"),e=ss(t.thursday,e,"Th"),e=ss(t.friday,e,"Fr"),e=ss(t.saturday,e,"Sa"),e=ss(t.sunday,e,"Su");const n=new Array;for(const[r,c]of e){const d=c.join(",");n.push(d+" "+r)}return{openingHours:n}},ss=(t,e,n)=>{if(!t||t.isClosed){const r="00:00-00:00",c=e.get(r)??[];return c.push(n),e.set(r,c),e}for(let r=0;r<t.openIntervals.length;r++){const c=t.openIntervals[r].start+"-"+t.openIntervals[r].end,d=e.get(c)??[];d.push(n),e.set(c,d)}return e},yS=(t,e)=>({...vc(t,e??"LocalBusiness"),...Fd(t.address),...u_(t.hours),...Sc(t.photoGallery),description:t.description,telephone:t.mainPhone,email:t.email}),d_=t=>t&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:t.ratingValue,bestRating:t.bestRating},author:{"@type":"Person",name:t.author}}},f_=t=>t&&{aggregateRating:{"@type":"AggregateRating",ratingValue:t.ratingValue,reviewCount:t.reviewCount}},NS=(t,e)=>({...vc(t,e??"Product"),...Sc(t.photoGallery),...d_(t.c_reviews),...f_(t.c_aggregateRating),...Bd({url:"",priceCurrency:t.c_currency,price:t.price,priceValidUntil:t.expirationDate,itemCondition:t.stockStatus,availability:t.availabilityDate}),description:t.description,sku:t.sku,mpn:t.mpn,brand:{"@type":"Brand",name:t.brand}});function id(t,e){for(const n in t)if(typeof t[n]=="object")if(Array.isArray(t[n]))for(let r=0;r<t[n].length;r++)id(t[n][r],e);else id(t[n],e);else n==="text"&&e.push(t[n])}function CS(t){if(t.json){const e=[];return id(t.json,e),e.join("")}return""}const ES=t=>({"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:"answer"in e?e.answer:CS(e.answerV2)}}))}),od=Math.log2(1.6745627884839434),TS=4,xS=19,sd="js-baidu-neg-lng-fix";let h_;const vS=new Promise(t=>h_=t),SS="https://api.map.baidu.com/geoconv/v1/";let Yl=[];const wS="gcj02ToBD09Callback_b872c21c";let OS=0,ip;async function g_(t){return await new Promise((e,n)=>{Yl.push({coordinates:t,resolve:e,reject:n}),Yl.length===1&&(ip=setTimeout(r,100)),Yl.length>40&&(clearTimeout(ip),r());function r(){const c=Yl;Yl=[];const d=[].concat(...c.map(N=>N.coordinates)),g=wS+"_"+OS++,p=document.createElement("script");window[g]=N=>{if(N.status){const O=new Error(`Unable to convert coordinates to BD-09: Received status code ${N.status}${N.message?": "+N.message:""}`);c.forEach(b=>b.reject(O))}const v=N.result.map(O=>new tn(O.y,O.x));let T=0;c.forEach(O=>{O.resolve(v.slice(T,T+=O.coordinates.length))}),delete window[g],p.parentNode.removeChild(p)},vS.then(N=>{const v={ak:N,callback:g,coords:d.map(T=>`${T.longitude},${T.latitude}`).join(";"),from:3,to:5};p.src=SS+"?"+Object.entries(v).map(([T,O])=>T+"="+O).join("&"),document.head.appendChild(p)})}})}class DS extends rl{constructor(e){super(e);const n=!!(window.MSInputMethodContext&&document.documentMode);this._wrapper=e.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:e.controlEnabled,maxZoom:n?14:18,...e.providerOptions}),e.controlEnabled?(this.map.enableScrollWheelZoom(),this.map.addControl(new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_ZOOM}))):(this.map.disableDragging(),this.map.disableDoubleClickZoom(),this.map.disablePinchToZoom()),this.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper.dataset.baiduZoom=this.map.getZoom(),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()-od}setCenter(e,n){this._centerReady=g_([e]).then(([r])=>{const c=new BMap.Point(r.longitude,r.latitude);this.map.panTo(c,{noAnimation:!n})})}setZoom(e,n){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(e+od)},{enableAnimation:n})})}}class AS extends gc{constructor(e){super(e),this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;const n=this;class r extends BMap.Marker{initialize(g){return n._wrapper=super.initialize(g),n._wrapper&&(n._wrapper.style.zIndex=n._zIndex,n._originalWrapperClass=n._wrapper.getAttribute("class"),n._wrapper.setAttribute("class",n._getClass()),n._wrapper.appendChild(n._element),n.addListeners()),n._wrapper}draw(){if(n._wrapper){const g=n._wrapper.style.zIndex;super.draw(),n._wrapper.style.height="",n._wrapper.style.width="",n._wrapper.style.pointerEvents="none",n._wrapper.style.zIndex=g}else super.draw()}}this.pin=new r(new BMap.Point(0,0));const c=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(c),this.pin.setShadow(c)}addListeners(){super.addListeners(),this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(e){this._coordinateReady=g_([e]).then(([n])=>{this._negativeLngFix=n.longitude<0,this.pin.setPosition(new BMap.Point(n.longitude+(this._negativeLngFix?180:0),n.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](sd)})}setMap(e,n){this._coordinateReady.then(()=>{n&&n.getProviderMap().map.removeOverlay(this.pin),e&&e.getProviderMap().map.addOverlay(this.pin)})}setProperties(e){super.setProperties(e),this._wrapperClass=e.getClass(),this._element=e.getElement()||this._pinEl,this._zIndex=e.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?sd:""} ${this._wrapperClass}`}}const MS="https://api.map.baidu.com/getscript";function RS(t,e,n,{params:r={},version:c="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,g={ak:d,v:c,...r};h_(d);const p=document.createElement("script");p.src=MS+"?"+Object.entries(g).map(([T,O])=>T+"="+O).join("&"),p.onload=()=>t(),document.head.appendChild(p);let N="";for(let T=TS;T<=xS;T++){const O=2**(T-od+7);N+=`[data-baidu-zoom="${T}"] .${sd}{transform:translateX(-${O}px);}`}const v=document.createElement("style");v.appendChild(document.createTextNode(N)),document.head.appendChild(v)}const bS=new fs().withLoadFunction(RS).withMapClass(DS).withPinClass(AS).withProviderName("Baidu").build();let p_;function LS(){class t extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1}),this._container=document.createElement("div"),this._map=null,this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(n){this._pins.add(n),n._wrapper.style.position="absolute",this._container.appendChild(n._wrapper),this._map&&this.updatePinPosition(n)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(n){this._pins.delete(n),this._container.removeChild(n._wrapper)}updatePinPosition(n){if(!this._map)return;const r=this._map.tryLocationToPixel(n._location,Microsoft.Maps.PixelReference.control);n._wrapper.style.left=r.x+"px",n._wrapper.style.top=r.y+"px"}updatePinPositions(){this._pins.forEach(n=>this.updatePinPosition(n))}}p_=t}class kS extends rl{constructor(e){super(e),this.wrapper=e.wrapper,this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!e.controlEnabled,disableZooming:!e.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...e.providerOptions}),this.pinOverlay=new p_(this.map),this.map.layers.insert(this.pinOverlay),Microsoft.Maps.Events.addHandler(this.map,"viewchangestart",()=>this._panStartHandler()),Microsoft.Maps.Events.addHandler(this.map,"viewchangeend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new Microsoft.Maps.Location(e.latitude,e.longitude);this.map.setView({center:r}),this.pinOverlay.updatePinPositions()}setZoom(e,n){this.map.setView({zoom:Math.floor(e)}),this.pinOverlay.updatePinPositions()}}class IS extends gc{static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}constructor(e){super(e),this._map=null,this._location=new Microsoft.Maps.Location(0,0)}setCoordinate(e){this._location=new Microsoft.Maps.Location(e.latitude,e.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(e,n){n&&n.getProviderMap().pinOverlay.removePin(this),e&&e.getProviderMap().pinOverlay.addPin(this),this._map=e}}const op="BingMapsCallback_593d7d33",PS="https://www.bing.com/api/maps/mapcontrol";function $S(t,e,n,{params:r={}}={}){window[op]=()=>{LS(),t()};const c={callback:op,key:n,...r};pp(PS+"?"+Object.entries(c).map(([d,g])=>d+"="+g).join("&"))}const FS=new fs().withLoadFunction($S).withMapClass(kS).withPinClass(IS).withProviderName("Bing").build();class BS extends rl{constructor(e){if(super(e),this.map=new mapboxgl.Map({container:e.wrapper,interactive:e.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...e.providerOptions}),e.controlEnabled){const n=new mapboxgl.NavigationControl({showCompass:!1});this.map.addControl(n)}this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()+1}setCenter(e,n){const r=new mapboxgl.LngLat(e.longitude,e.latitude);this.map[n?"panTo":"setCenter"](r)}setZoom(e,n){this.map[n?"zoomTo":"setZoom"](e-1)}setZoomCenter(e,n,r){const c=new mapboxgl.LngLat(n.longitude,n.latitude);this.map[r?"easeTo":"jumpTo"]({center:c,zoom:e-1})}}class HS extends gc{constructor(e){super(e),this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper})}setCoordinate(e){this.pin.setLngLat(new mapboxgl.LngLat(e.longitude,e.latitude))}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}}function WS(t,e,n,{version:r="v1.13.0"}={}){const c=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{mapboxgl.accessToken=n,t()},document.head.appendChild(d),document.head.appendChild(g)}const KS=new fs().withLoadFunction(WS).withMapClass(BS).withPinClass(HS).withProviderName("Mapbox").build();let m_=class extends rl{constructor(e){super(e),this._initMap(e),e.controlEnabled&&this.map.zoomControl.setPosition("topright"),this.map.on("movestart",()=>this._panStartHandler()),this.map.on("moveend",()=>this._panHandler())}getCenter(){return new tn(this.map.getCenter())}getZoom(){return this.map.getZoom()}setCenter(e,n){const r=new L.latLng(e.latitude,e.longitude);this.map.panTo(r,{animate:n})}setZoom(e,n){this.map.setZoom(e,{animate:n})}setZoomCenter(e,n,r){const c=new L.latLng(n.latitude,n.longitude);this.map.setView(c,e,{animate:r})}_initMap(e){this.map=new L.map(e.wrapper,{boxZoom:e.controlEnabled,doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions});const n=e.providerOptions,r=n.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",c=n.tileLayerOptions||{attribution:'Map data &copy; <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',id:"mapbox/streets-v11"};c.accessToken=this.constructor.apiKey,L.tileLayer(r,c).addTo(this.map)}},zS=class extends fd{constructor(e){super(e),this.pin=new L.marker,this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(e){const n=new L.latLng(e.latitude,e.longitude);this.pin.setLatLng(n)}setMap(e,n){e?this.pin.addTo(e.getProviderMap().map):this.pin.remove()}setProperties(e){const n=e.getWidth(),r=e.getHeight(),c=e.getAnchorX(),d=e.getAnchorY();this.pin.setIcon(new L.icon({iconUrl:this._icons[e.getIcon()],iconSize:[n,r],iconAnchor:[c*n,d*r],className:e.getClass()})),this.pin.setZIndexOffset(e.getZIndex())}};function US(t,e,n,{version:r="1.7.1"}={}){const c=`https://unpkg.com/leaflet@${r}/dist/leaflet`;m_.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>t(),document.head.appendChild(d),document.head.appendChild(g)}const Hd=new fs().withLoadFunction(US).withMapClass(m_).withPinClass(zS).withProviderName("Leaflet").build(),GS=Hd.getMapClass(),YS=Hd.getPinClass();class jS extends GS{_initMap(e){this.map=L.mapquest.map(e.wrapper,{boxZoom:e.controlEnabled,center:new L.latLng(0,0),doubleClickZoom:e.controlEnabled,dragging:e.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:e.controlEnabled,zoomSnap:0,...e.providerOptions})}}class VS extends YS{}function qS(t,e,n,{version:r="v1.3.2"}={}){const c=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{L.mapquest.key=n,t()},document.head.appendChild(d),document.head.appendChild(g)}const ZS=new fs().withLoadFunction(qS).withMapClass(jS).withPinClass(VS).withProviderName("MapQuest").build();exports.Address=oy;exports.AddressSchema=Fd;exports.AggregateRatingSchema=f_;exports.Analytics=up;exports.AnalyticsContext=ud;exports.AnalyticsProvider=eN;exports.AnalyticsScopeProvider=tN;exports.BaiduMaps=bS;exports.BaseSchema=vc;exports.BingMaps=FS;exports.Clusterer=RN;exports.Coordinate=tn;exports.Day=Xt;exports.Event=_S;exports.FAQPage=ES;exports.GoogleMaps=yp;exports.HoursStatus=uS;exports.HoursTable=gS;exports.Image=cN;exports.ImageLayoutOption=Ao;exports.LeafletMaps=Hd;exports.LegacyRichText=nx;exports.LexicalRichText=gE;exports.Link=gp;exports.LinkTypes=pN;exports.ListingPublisherOption=sp;exports.LocalBusiness=yS;exports.LocationMap=kN;exports.LocationSchema=l_;exports.Map=Ep;exports.MapProviderOption=Wu;exports.MapQuestMaps=ZS;exports.MapboxMaps=KS;exports.Marker=pd;exports.OfferSchema=Bd;exports.OpeningHoursSchema=u_;exports.OrganizationSchema=c_;exports.PerformerSchema=a_;exports.PhotoGallerySchema=Sc;exports.PhotoSchema=mS;exports.Product=NS;exports.ReviewSchema=d_;exports.SchemaWrapper=pS;exports.asciiAlpha=vE;exports.asciiAlphanumeric=Ju;exports.asciiAtext=SE;exports.asciiControl=wE;exports.asciiDigit=OE;exports.asciiHexDigit=DE;exports.asciiPunctuation=AE;exports.c=Qs;exports.classifyCharacter=Ql;exports.combineExtensions=Yp;exports.createState=UT;exports.debuggingParamDetected=sc;exports.getDefaultExportFromCjs=ad;exports.getDirections=ry;exports.getRuntime=Xs;exports.jsxRuntimeExports=at;exports.markdownLineEnding=ME;exports.markdownLineEndingOrSpace=Qp;exports.markdownSpace=RE;exports.normalizeUri=ol;exports.push=Vs;exports.resolveAll=em;exports.splice=mc;exports.useAnalytics=nl;exports.useClusterContext=MN;exports.useIdentify=iN;exports.useMapContext=DN;exports.usePageView=rN;exports.useScope=dd;exports.useTrack=nN;exports.visit=Dd;