@yext/pages-components 1.0.3 → 1.0.5

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.
@@ -0,0 +1,111 @@
1
+ "use strict";var Q_=Object.defineProperty;var ey=(e,t,n)=>t in e?Q_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ie=(e,t,n)=>ey(e,typeof t!="symbol"?t+"":t,n);const rt=require("react"),ld=require("react-dom");function ty(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ny=ty(rt);var ff=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ad(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Hu={exports:{}},Yl={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var hf;function ry(){if(hf)return Yl;hf=1;var e=rt,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function f(p,_,T){var E,S={},w=null,M=null;T!==void 0&&(w=""+T),_.key!==void 0&&(w=""+_.key),_.ref!==void 0&&(M=_.ref);for(E in _)r.call(_,E)&&!d.hasOwnProperty(E)&&(S[E]=_[E]);if(p&&p.defaultProps)for(E in _=p.defaultProps,_)S[E]===void 0&&(S[E]=_[E]);return{$$typeof:t,type:p,key:w,ref:M,props:S,_owner:l.current}}return Yl.Fragment=n,Yl.jsx=f,Yl.jsxs=f,Yl}var jl={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var gf;function iy(){return gf||(gf=1,process.env.NODE_ENV!=="production"&&function(){var e=rt,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function k(pe){if(pe===null||typeof pe!="object")return null;var Ze=m&&pe[m]||pe[v];return typeof Ze=="function"?Ze:null}var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function I(pe){{for(var Ze=arguments.length,nt=new Array(Ze>1?Ze-1:0),St=1;St<Ze;St++)nt[St-1]=arguments[St];P("error",pe,nt)}}function P(pe,Ze,nt){{var St=G.ReactDebugCurrentFrame,Pt=St.getStackAddendum();Pt!==""&&(Ze+="%s",nt=nt.concat([Pt]));var Ut=nt.map(function($t){return String($t)});Ut.unshift("Warning: "+Ze),Function.prototype.apply.call(console[pe],console,Ut)}}var H=!1,j=!1,re=!1,te=!1,ce=!1,V;V=Symbol.for("react.module.reference");function z(pe){return!!(typeof pe=="string"||typeof pe=="function"||pe===r||pe===d||ce||pe===l||pe===T||pe===E||te||pe===M||H||j||re||typeof pe=="object"&&pe!==null&&(pe.$$typeof===w||pe.$$typeof===S||pe.$$typeof===f||pe.$$typeof===p||pe.$$typeof===_||pe.$$typeof===V||pe.getModuleId!==void 0))}function q(pe,Ze,nt){var St=pe.displayName;if(St)return St;var Pt=Ze.displayName||Ze.name||"";return Pt!==""?nt+"("+Pt+")":nt}function Te(pe){return pe.displayName||"Context"}function Se(pe){if(pe==null)return null;if(typeof pe.tag=="number"&&I("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof pe=="function")return pe.displayName||pe.name||null;if(typeof pe=="string")return pe;switch(pe){case r:return"Fragment";case n:return"Portal";case d:return"Profiler";case l:return"StrictMode";case T:return"Suspense";case E:return"SuspenseList"}if(typeof pe=="object")switch(pe.$$typeof){case p:var Ze=pe;return Te(Ze)+".Consumer";case f:var nt=pe;return Te(nt._context)+".Provider";case _:return q(pe,pe.render,"ForwardRef");case S:var St=pe.displayName||null;return St!==null?St:Se(pe.type)||"Memo";case w:{var Pt=pe,Ut=Pt._payload,$t=Pt._init;try{return Se($t(Ut))}catch{return null}}}return null}var Ee=Object.assign,de=0,K,O,Z,se,Y,W,J;function R(){}R.__reactDisabledLog=!0;function U(){{if(de===0){K=console.log,O=console.info,Z=console.warn,se=console.error,Y=console.group,W=console.groupCollapsed,J=console.groupEnd;var pe={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:pe,log:pe,warn:pe,error:pe,group:pe,groupCollapsed:pe,groupEnd:pe})}de++}}function X(){{if(de--,de===0){var pe={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ee({},pe,{value:K}),info:Ee({},pe,{value:O}),warn:Ee({},pe,{value:Z}),error:Ee({},pe,{value:se}),group:Ee({},pe,{value:Y}),groupCollapsed:Ee({},pe,{value:W}),groupEnd:Ee({},pe,{value:J})})}de<0&&I("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=G.ReactCurrentDispatcher,_e;function B(pe,Ze,nt){{if(_e===void 0)try{throw Error()}catch(Pt){var St=Pt.stack.trim().match(/\n( *(at )?)/);_e=St&&St[1]||""}return`
18
+ `+_e+pe}}var A=!1,F;{var oe=typeof WeakMap=="function"?WeakMap:Map;F=new oe}function ye(pe,Ze){if(!pe||A)return"";{var nt=F.get(pe);if(nt!==void 0)return nt}var St;A=!0;var Pt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ut;Ut=fe.current,fe.current=null,U();try{if(Ze){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(fn){St=fn}Reflect.construct(pe,[],$t)}else{try{$t.call()}catch(fn){St=fn}pe.call($t.prototype)}}else{try{throw Error()}catch(fn){St=fn}pe()}}catch(fn){if(fn&&St&&typeof fn.stack=="string"){for(var Et=fn.stack.split(`
19
+ `),Nn=St.stack.split(`
20
+ `),rn=Et.length-1,cn=Nn.length-1;rn>=1&&cn>=0&&Et[rn]!==Nn[cn];)cn--;for(;rn>=1&&cn>=0;rn--,cn--)if(Et[rn]!==Nn[cn]){if(rn!==1||cn!==1)do if(rn--,cn--,cn<0||Et[rn]!==Nn[cn]){var bn=`
21
+ `+Et[rn].replace(" at new "," at ");return pe.displayName&&bn.includes("<anonymous>")&&(bn=bn.replace("<anonymous>",pe.displayName)),typeof pe=="function"&&F.set(pe,bn),bn}while(rn>=1&&cn>=0);break}}}finally{A=!1,fe.current=Ut,X(),Error.prepareStackTrace=Pt}var nr=pe?pe.displayName||pe.name:"",Ln=nr?B(nr):"";return typeof pe=="function"&&F.set(pe,Ln),Ln}function De(pe,Ze,nt){return ye(pe,!1)}function ee(pe){var Ze=pe.prototype;return!!(Ze&&Ze.isReactComponent)}function ne(pe,Ze,nt){if(pe==null)return"";if(typeof pe=="function")return ye(pe,ee(pe));if(typeof pe=="string")return B(pe);switch(pe){case T:return B("Suspense");case E:return B("SuspenseList")}if(typeof pe=="object")switch(pe.$$typeof){case _:return De(pe.render);case S:return ne(pe.type,Ze,nt);case w:{var St=pe,Pt=St._payload,Ut=St._init;try{return ne(Ut(Pt),Ze,nt)}catch{}}}return""}var ue=Object.prototype.hasOwnProperty,be={},Ne=G.ReactDebugCurrentFrame;function Re(pe){if(pe){var Ze=pe._owner,nt=ne(pe.type,pe._source,Ze?Ze.type:null);Ne.setExtraStackFrame(nt)}else Ne.setExtraStackFrame(null)}function ke(pe,Ze,nt,St,Pt){{var Ut=Function.call.bind(ue);for(var $t in pe)if(Ut(pe,$t)){var Et=void 0;try{if(typeof pe[$t]!="function"){var Nn=Error((St||"React class")+": "+nt+" type `"+$t+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof pe[$t]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Nn.name="Invariant Violation",Nn}Et=pe[$t](Ze,$t,St,nt,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(rn){Et=rn}Et&&!(Et instanceof Error)&&(Re(Pt),I("%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).",St||"React class",nt,$t,typeof Et),Re(null)),Et instanceof Error&&!(Et.message in be)&&(be[Et.message]=!0,Re(Pt),I("Failed %s type: %s",nt,Et.message),Re(null))}}}var Fe=Array.isArray;function qe(pe){return Fe(pe)}function Be(pe){{var Ze=typeof Symbol=="function"&&Symbol.toStringTag,nt=Ze&&pe[Symbol.toStringTag]||pe.constructor.name||"Object";return nt}}function ct(pe){try{return Mt(pe),!1}catch{return!0}}function Mt(pe){return""+pe}function zt(pe){if(ct(pe))return I("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Be(pe)),Mt(pe)}var Vt=G.ReactCurrentOwner,Oe={key:!0,ref:!0,__self:!0,__source:!0},ie,le,ve;ve={};function Le(pe){if(ue.call(pe,"ref")){var Ze=Object.getOwnPropertyDescriptor(pe,"ref").get;if(Ze&&Ze.isReactWarning)return!1}return pe.ref!==void 0}function Me(pe){if(ue.call(pe,"key")){var Ze=Object.getOwnPropertyDescriptor(pe,"key").get;if(Ze&&Ze.isReactWarning)return!1}return pe.key!==void 0}function je(pe,Ze){if(typeof pe.ref=="string"&&Vt.current&&Ze&&Vt.current.stateNode!==Ze){var nt=Se(Vt.current.type);ve[nt]||(I('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',Se(Vt.current.type),pe.ref),ve[nt]=!0)}}function it(pe,Ze){{var nt=function(){ie||(ie=!0,I("%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)",Ze))};nt.isReactWarning=!0,Object.defineProperty(pe,"key",{get:nt,configurable:!0})}}function ot(pe,Ze){{var nt=function(){le||(le=!0,I("%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)",Ze))};nt.isReactWarning=!0,Object.defineProperty(pe,"ref",{get:nt,configurable:!0})}}var st=function(pe,Ze,nt,St,Pt,Ut,$t){var Et={$$typeof:t,type:pe,key:Ze,ref:nt,props:$t,_owner:Ut};return Et._store={},Object.defineProperty(Et._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Et,"_self",{configurable:!1,enumerable:!1,writable:!1,value:St}),Object.defineProperty(Et,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Pt}),Object.freeze&&(Object.freeze(Et.props),Object.freeze(Et)),Et};function wt(pe,Ze,nt,St,Pt){{var Ut,$t={},Et=null,Nn=null;nt!==void 0&&(zt(nt),Et=""+nt),Me(Ze)&&(zt(Ze.key),Et=""+Ze.key),Le(Ze)&&(Nn=Ze.ref,je(Ze,Pt));for(Ut in Ze)ue.call(Ze,Ut)&&!Oe.hasOwnProperty(Ut)&&($t[Ut]=Ze[Ut]);if(pe&&pe.defaultProps){var rn=pe.defaultProps;for(Ut in rn)$t[Ut]===void 0&&($t[Ut]=rn[Ut])}if(Et||Nn){var cn=typeof pe=="function"?pe.displayName||pe.name||"Unknown":pe;Et&&it($t,cn),Nn&&ot($t,cn)}return st(pe,Et,Nn,Pt,St,Vt.current,$t)}}var Ue=G.ReactCurrentOwner,Ge=G.ReactDebugCurrentFrame;function tt(pe){if(pe){var Ze=pe._owner,nt=ne(pe.type,pe._source,Ze?Ze.type:null);Ge.setExtraStackFrame(nt)}else Ge.setExtraStackFrame(null)}var yt;yt=!1;function Nt(pe){return typeof pe=="object"&&pe!==null&&pe.$$typeof===t}function Tt(){{if(Ue.current){var pe=Se(Ue.current.type);if(pe)return`
22
+
23
+ Check the render method of \``+pe+"`."}return""}}function gt(pe){return""}var xt={};function mt(pe){{var Ze=Tt();if(!Ze){var nt=typeof pe=="string"?pe:pe.displayName||pe.name;nt&&(Ze=`
24
+
25
+ Check the top-level render call using <`+nt+">.")}return Ze}}function Ft(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var nt=mt(Ze);if(xt[nt])return;xt[nt]=!0;var St="";pe&&pe._owner&&pe._owner!==Ue.current&&(St=" It was passed a child from "+Se(pe._owner.type)+"."),tt(pe),I('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',nt,St),tt(null)}}function Ht(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var nt=0;nt<pe.length;nt++){var St=pe[nt];Nt(St)&&Ft(St,Ze)}else if(Nt(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Pt=k(pe);if(typeof Pt=="function"&&Pt!==pe.entries)for(var Ut=Pt.call(pe),$t;!($t=Ut.next()).done;)Nt($t.value)&&Ft($t.value,Ze)}}}function tn(pe){{var Ze=pe.type;if(Ze==null||typeof Ze=="string")return;var nt;if(typeof Ze=="function")nt=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===_||Ze.$$typeof===S))nt=Ze.propTypes;else return;if(nt){var St=Se(Ze);ke(nt,pe.props,"prop",St,pe)}else if(Ze.PropTypes!==void 0&&!yt){yt=!0;var Pt=Se(Ze);I("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Pt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&I("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function kt(pe){{for(var Ze=Object.keys(pe.props),nt=0;nt<Ze.length;nt++){var St=Ze[nt];if(St!=="children"&&St!=="key"){tt(pe),I("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",St),tt(null);break}}pe.ref!==null&&(tt(pe),I("Invalid attribute `ref` supplied to `React.Fragment`."),tt(null))}}var Yt={};function bt(pe,Ze,nt,St,Pt,Ut){{var $t=z(pe);if(!$t){var Et="";(pe===void 0||typeof pe=="object"&&pe!==null&&Object.keys(pe).length===0)&&(Et+=" 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 Nn=gt();Nn?Et+=Nn:Et+=Tt();var rn;pe===null?rn="null":qe(pe)?rn="array":pe!==void 0&&pe.$$typeof===t?(rn="<"+(Se(pe.type)||"Unknown")+" />",Et=" Did you accidentally export a JSX literal instead of a component?"):rn=typeof pe,I("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",rn,Et)}var cn=wt(pe,Ze,nt,Pt,Ut);if(cn==null)return cn;if($t){var bn=Ze.children;if(bn!==void 0)if(St)if(qe(bn)){for(var nr=0;nr<bn.length;nr++)Ht(bn[nr],pe);Object.freeze&&Object.freeze(bn)}else I("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 Ht(bn,pe)}if(ue.call(Ze,"key")){var Ln=Se(pe),fn=Object.keys(Ze).filter(function(rr){return rr!=="key"}),Jn=fn.length>0?"{key: someKey, "+fn.join(": ..., ")+": ...}":"{key: someKey}";if(!Yt[Ln+Jn]){var Mi=fn.length>0?"{"+fn.join(": ..., ")+": ...}":"{}";I(`A props object containing a "key" prop is being spread into JSX:
26
+ let props = %s;
27
+ <%s {...props} />
28
+ React keys must be passed directly to JSX without using spread:
29
+ let props = %s;
30
+ <%s key={someKey} {...props} />`,Jn,Ln,Mi,Ln),Yt[Ln+Jn]=!0}}return pe===r?kt(cn):tn(cn),cn}}function Qt(pe,Ze,nt){return bt(pe,Ze,nt,!0)}function wr(pe,Ze,nt){return bt(pe,Ze,nt,!1)}var mi=wr,_i=Qt;jl.Fragment=r,jl.jsx=mi,jl.jsxs=_i}()),jl}process.env.NODE_ENV==="production"?Hu.exports=ry():Hu.exports=iy();var ft=Hu.exports;function oy(e){switch(e){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 op={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Wu={APPLE:"apple",BING:"bing"},sy=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},ly=(e,t=[],n,r={route:!1},l)=>{const d="Failed to construct query for maps service.";let f=e&&yf([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case Wu.APPLE:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return pf(`${l.latitude},${l.longitude}`,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return pf(f,r.route)}case Wu.BING:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return mf(`${l.latitude},${l.longitude}`,r.route);if(f=e&&yf([e.line1,e.city,e.region,e.postalCode]),!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return mf(f,r.route)}default:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return _f(`${l.latitude},${l.longitude}`,r.route);const p=t.find(_=>{var T;return((T=_==null?void 0:_.publisher)==null?void 0:T.toUpperCase())===op.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return ay(n,f,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return _f(f,r.route)}}},pf=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,mf=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,ay=(e,t,n)=>{const r=t?`&query=${t}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${e}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${e}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${e}&destination=direct`},_f=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,yf=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},cy=({address:e,lines:t,separator:n=",",...r})=>{const l=(t||oy(e.countryCode)).map(d=>ft.jsx(uy,{address:e,line:d,separator:n},d.toString()));return rt.createElement("div",{...r,key:e.toString()},l)},uy=({address:e,line:t,separator:n})=>{const r=[];for(const l of t){if(l===","){r.push(ft.jsx("span",{children:n},l));continue}const d=e[l];if(!d)continue;const f=sy(l,e);if(f){r.push(ft.jsxs(ny.Fragment,{children:[" ",ft.jsx("abbr",{title:f,children:d})]},l));continue}r.push(ft.jsx("span",{children:" "+d},l))}return ft.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fy=typeof window<"u"&&typeof window.document<"u",hy=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,gy=(typeof self>"u"?"undefined":dy(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",py=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),my=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Nf=tl.isBrowser=fy;tl.isWebWorker=gy;var _y=tl.isNode=hy;tl.isJsDom=py;var yy=tl.isDeno=my;class Ny{constructor(){Ie(this,"name");Ie(this,"isServerSide");Ie(this,"version");var t;yy?(this.name="deno",this.version="",Nf&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):_y?(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 Ny,Cy=(...e)=>typeof window<"u"&&window.IS_PRODUCTION||!1;function Yc(e){if(!cd(e))throw new Error("Parameter was not an error")}function cd(e){return!!e&&typeof e=="object"&&Ey(e)==="[object Error]"||e instanceof Error}function Ey(e){return Object.prototype.toString.call(e)}const Ty="Layerr";let xy=Ty;function vy(){return xy}function Sy(e){let t,n="";if(e.length===0)t={};else if(cd(e[0]))t={cause:e[0]},n=e.slice(1).join(" ")||"";else if(e[0]&&typeof e[0]=="object")t=Object.assign({},e[0]),n=e.slice(1).join(" ")||"";else if(typeof e[0]=="string")t={},n=n=e.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:t,shortMessage:n}}class Ai extends Error{constructor(t,n){const r=[...arguments],{options:l,shortMessage:d}=Sy(r);let f=d;if(l.cause&&(f=`${f}: ${l.cause.message}`),super(f),this.message=f,l.name&&typeof l.name=="string"?this.name=l.name:this.name=vy(),l.cause&&Object.defineProperty(this,"_cause",{value:l.cause}),Object.defineProperty(this,"_info",{value:{}}),l.info&&typeof l.info=="object"&&Object.assign(this._info,l.info),Error.captureStackTrace){const p=l.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(t){return Yc(t),t._cause&&cd(t._cause)?t._cause:null}static fullStack(t){Yc(t);const n=Ai.cause(t);return n?`${t.stack}
31
+ caused by: ${Ai.fullStack(n)}`:t.stack??""}static info(t){Yc(t);const n={},r=Ai.cause(t);return r&&Object.assign(n,Ai.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}const sp="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ra=32,Cf=0xffffffffffff,wy=10,Oy=16,ea=Object.freeze({source:"ulid"});function Dy(e){const t=Ay(),n=t&&(t.crypto||t.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 Ai({info:{code:"PRNG_DETECT",...ea}},"Failed to find a reliable PRNG")}function Ay(){return by()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function My(e,t){let n="";for(;e>0;e--)n=Ly(t)+n;return n}function Ry(e,t){if(isNaN(e))throw new Ai({info:{code:"ENC_TIME_NAN",...ea}},`Time must be a number: ${e}`);if(e>Cf)throw new Ai({info:{code:"ENC_TIME_SIZE_EXCEED",...ea}},`Cannot encode a time larger than ${Cf}: ${e}`);if(e<0)throw new Ai({info:{code:"ENC_TIME_NEG",...ea}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Ai({info:{code:"ENC_TIME_TYPE",...ea}},`Time must be an integer: ${e}`);let n,r="";for(let l=t;l>0;l--)n=e%ra,r=sp.charAt(n)+r,e=(e-n)/ra;return r}function by(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Ly(e){let t=Math.floor(e()*ra);return t===ra&&(t=ra-1),sp.charAt(t)}function Iy(e,t){const n=Dy(),r=isNaN(e)?Date.now():e;return Ry(r,wy)+My(Oy,n)}var Ef="yext_analytics_session_id";function ky(){if(typeof window>"u")return null;try{var e=window.sessionStorage.getItem(Ef);return e||(e=Iy(),window.sessionStorage.setItem(Ef,e)),e}catch(t){return console.warn(`Unable to use browser sessionStorage for sessionId.
32
+ `,t),null}}const Py="@yext/analytics",$y="1.0.0-beta.5",Fy="An analytics library for Yext",By="fusion@yext.com",Hy="BSD-3-Clause",Wy="./lib/commonjs/src/index.js",Ky="./lib/esm/src/index.js",zy="./lib/analytics.d.ts",Uy=["analytics","report","events","yext"],Gy=["src","lib","THIRD-PARTY-NOTICES"],Yy={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"},jy={"@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"},Vy={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},qy={ulidx:"^2.0.0"},Tf={name:Py,version:$y,description:Fy,author:By,license:Hy,main:Wy,module:Ky,types:zy,keywords:Uy,files:Gy,scripts:Yy,devDependencies:jy,jest:Vy,dependencies:qy};function Zy(e,t,n){return n.debug?(lp(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function Jy(e,t,n){return n.debug?(lp(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Xy(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function lp(e,t,n){var r=e?"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,":"),t)}var Ku=function(){return Ku=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},Ku.apply(this,arguments)},zu=function(e,t){if(!t||Object.keys(t).length===0)return e;if(!e||Object.keys(e).length===0)return t;var n=JSON.parse(JSON.stringify(e));for(var r in t)if(t.hasOwnProperty(r)){var l=t[r];l==null?delete n[r]:typeof l!="object"?n[r]=l:n[r]=zu(n[r],l)}return Ku({},n)},Qy="yextevents.com/accounts/me/events";function eN(e,t){var n=e==="SANDBOX",r=t==null?void 0:t.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+Qy}var tN=function(e,t,n,r){function l(d){return d instanceof n?d:new n(function(f){f(d)})}return new(n||(n=Promise))(function(d,f){function p(E){try{T(r.next(E))}catch(S){f(S)}}function _(E){try{T(r.throw(E))}catch(S){f(S)}}function T(E){E.done?d(E.value):l(E.value).then(p,_)}T((r=r.apply(e,t||[])).next())})},nN=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,l,d,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(T){return function(E){return _([T,E])}}function _(T){if(r)throw new TypeError("Generator is already executing.");for(;f&&(f=0,T[0]&&(n=0)),n;)try{if(r=1,l&&(d=T[0]&2?l.return:T[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,T[1])).done)return d;switch(l=0,d&&(T=[T[0]&2,d.value]),T[0]){case 0:case 1:d=T;break;case 4:return n.label++,{value:T[1],done:!1};case 5:n.label++,l=T[1],T=[0];continue;case 7:T=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){n=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){n.label=T[1];break}if(T[0]===6&&n.label<d[1]){n.label=d[1],d=T;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(T);break}d[2]&&n.ops.pop(),n.trys.pop();continue}T=t.call(e,n)}catch(E){T=[6,E],l=0}finally{r=d=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},rN=function(){function e(t,n){if(t.authorizationType!=="apiKey"&&t.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!t.authorization)throw new Error("Authorization must be provided.");this.config=t,this.payload=n}return e.prototype.with=function(t){var n=this.payload===void 0?t:zu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return tN(this,void 0,void 0,function(){var r,l,d,f,p=this;return nN(this,function(_){return r=zu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=ky()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Tf.version:r.clientSdk=(f={},f.ANALYTICS=Tf.version,f),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,l=Xy(r,this.config.forceFetch),d=eN(this.config.env,this.config.region),l?[2,new Promise(function(T,E){Zy(d,r,p.config)?T(""):E("Failed Beacon Call")})]:[2,Jy(d,r,this.config).then(function(T){return T}).catch(function(T){return T})]})})},e}();function iN(e){return new rN(e)}function Uu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function ap(e,t){return[e,t].filter(n=>!!n).map(n=>Uu(n)).join("_")}const oN=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},ud=rt.createContext(null),sN=rt.lazy(()=>Promise.resolve().then(()=>require("./debugger-DRWb3azj.cjs")));function lN(e){const{children:t,apiKey:n,currency:r,templateData:l,requireOptIn:d,disableSessionTracking:f,enableDebugging:p}=e,_=rt.useRef(null),[T,E]=rt.useState(!1);rt.useEffect(()=>{E(!0)},[]),_.current===null&&(_.current=new cp(n,r,l,d,f,p??cc()));const S=_.current;return ft.jsxs(ft.Fragment,{children:[ft.jsx(ud.Provider,{value:S,children:t}),T&&(p||cc())&&Xs().name==="browser"?ft.jsx(rt.Suspense,{fallback:ft.jsx(ft.Fragment,{}),children:ft.jsx(sN,{})}):null]})}function cc(){return Xs().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class cp{constructor(t,n,r,l,d,f=!1){Ie(this,"_optedIn");Ie(this,"_sessionTrackingEnabled");Ie(this,"_analyticsEventService");Ie(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.enableDebugging=f,this._optedIn=!l,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Xs().name!=="browser"||!this._optedIn)return;if(!Cy()&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=oN(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:t||"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=iN(n).with(r)}canTrack(){return Xs().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(t){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:t}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var t;if(!this.canTrack())return Promise.resolve(void 0);await((t=this._analyticsEventService)==null?void 0:t.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(t){var S;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:l,currency:d,amount:f,destinationUrl:p,customTags:_,customValues:T}=t;let E;f&&(E={amount:f,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:Uu(r)||void 0,originalEventName:ap(r||"",Uu(l)||"")},value:E,destinationUrl:p,customTags:_,customValues:T}))}getDebugEnabled(){return this.enableDebugging||cc()}}const Gu=rt.createContext({name:""}),dd=()=>rt.useContext(Gu).name;function aN(e){var f;const t=dd(),[n]=rt.useState({name:ap(t,e.name)}),r=(f=nl())==null?void 0:f.getDebugEnabled(),[l,d]=rt.useState(!1);return rt.useEffect(()=>{d(!0)},[]),r&&l?ft.jsx("section",{"data-ya-scope":n.name,children:ft.jsx(Gu.Provider,{value:n,children:e.children})}):ft.jsx(Gu.Provider,{value:n,children:e.children})}function nl(){const e=rt.useContext(ud);if(!e)return e;Xs().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=dd();return{getDebugEnabled(){return e.getDebugEnabled()},identify(n){return e.identify(n)},optIn(){return e.optIn()},pageView(){return e.pageView()},track(n){return e.track({...n,scope:n.scope??t})}}}const cN=()=>{var e;return(e=nl())==null?void 0:e.track},uN=()=>{var e;return(e=nl())==null?void 0:e.pageView},dN=()=>{var e;return(e=nl())==null?void 0:e.identify},xo={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},fN=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}const n=e.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${e}`);return}r="eu"}if(!e.pathname.startsWith("/f")){console.error(`Invalid path: ${e}`);return}const l=e.pathname.replace(/^\//,"").split("/");if(l.length<2||l.length>3){console.error(`Invalid path: ${e}`);return}let d;if(l[0]==="f")d="prod";else switch(l[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${e}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${e}`);return}let f;if(l.length===3&&(f=parseInt(l[1]),Number.isNaN(f))){console.error(`Invalid account id: ${e}`);return}const p=l[l.length-1].split("."),_=p.length===2?`.${p[1]}`:"",T=p[0];return{scheme:t,partition:r,env:d,accountId:f,contentHash:T,extension:_}},hN=(e,t,n)=>{const r=`https://dyn${e.partition==="us"?"":`.${e.partition}`}.mktgcdn.com`;let l="f";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}const d=e.accountId!==void 0?`${e.accountId}/`:"";return`${r}/${l}/${d}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}`},gN=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}if(e.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${e}`);return}if(!e.pathname.startsWith("/p")){console.error(`Invalid path: ${e}`);return}const n=e.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${e}`);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: ${e}`);return}}const l=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${e}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${e}`);return}}const f=n[n.length-1].split("."),p=f.length===2?`.${f[1]}`:"",_=f[0];return{scheme:t,env:r,contentHash:l,aspectRatio:d,name:_,extension:p}},pN=(e,t,n)=>{const r="https://dyn.mktgcdn.com";let l="p";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}return`${r}/${l}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}`},Yu=(e,t,n)=>{if(!up(e)){console.error(`Invalid image url: ${e}.`);return}const r=new URL(e);if(r.pathname.startsWith("/p")){const l=gN(r);if(l)return pN(l,t,n)}else if(r.pathname.startsWith("/f")){const l=fN(r);if(l)return hN(l,t,n)}return e},up=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},mN=({image:e,className:t,width:n,height:r,aspectRatio:l,layout:d=xo.INTRINSIC,placeholder:f,imgOverrides:p,style:_={},loading:T="lazy"})=>{const E=rt.useRef(null),[S,w]=rt.useState(!1),M="image"in e?e.image:e;rt.useEffect(()=>{var ce;(ce=E.current)!=null&&ce.complete&&w(!0)},[]),_N(d,M.width,M.height,n,r,l);const m=Math.abs(M.width);m||console.warn("Invalid image width.");const v=Math.abs(M.height);if(v||console.warn("Invalid image height."),!up(M.url))return console.error(`Invalid image url: ${M.url}`),ft.jsx(ft.Fragment,{children:f!=null&&f});const k=n&&n>0?n:void 0,G=r&&r>0?r:void 0,{src:I,imgStyle:P,widths:H}=yN(d,m,v,_,M.url,k,G,l),j=H.map(ce=>`${Yu(M.url,ce,v/m*ce)} ${ce}w`).join(", "),re=[640,768,1024,1280,1536],te=H.map((ce,V)=>V===H.length-1?`${ce}px`:`(max-width: ${re[V]}px) ${ce}px`).join(", ");return ft.jsxs(ft.Fragment,{children:[!S&&f!=null&&f,ft.jsx("img",{ref:E,style:P,src:I,className:t,width:k,height:G,srcSet:j,sizes:te,loading:T,alt:M.alternateText||"",...p})]})},_N=(e,t,n,r,l,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===xo.FIXED){if(!r&&!l){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}.`),l&&l<0&&console.warn(`Using fixed layout but height is invalid: ${l}.`);return}(r||l)&&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."),e===xo.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},yN=(e,t,n,r,l,d,f,p)=>{let _=[100,320,640,960,1280,1920],T=Yu(l,500,500);const E={...r};switch(E.objectFit=E.objectFit||"cover",E.objectPosition=E.objectPosition||"center",e){case xo.INTRINSIC:E.maxWidth=t,E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case xo.FIXED:{const{fixedWidth:S,fixedHeight:w,fixedWidths:M}=NN(t,n,_,d,f);E.width=S,E.height=w,_=M,T=Yu(l,S,w);break}case xo.ASPECT:E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case xo.FILL:E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:T,imgStyle:E,widths:_}},NN=(e,t,n,r,l)=>r&&l?{fixedWidth:r,fixedHeight:l,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:l?{fixedWidth:l/t*e,fixedHeight:l,fixedWidths:[l/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var dp={exports:{}};/*!
33
+ Copyright (c) 2018 Jed Watson.
34
+ Licensed under the MIT License (MIT), see
35
+ http://jedwatson.github.io/classnames
36
+ */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var d="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(d=l(d,r(p)))}return d}function r(d){if(typeof d=="string"||typeof d=="number")return d;if(typeof d!="object")return"";if(Array.isArray(d))return n.apply(null,d);if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]"))return d.toString();var f="";for(var p in d)t.call(d,p)&&d[p]&&(f=l(f,p));return f}function l(d,f){return f?d?d+" "+f:d+f:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(dp);var CN=dp.exports;const Qs=ad(CN),xf=e=>e.linkType==="Email"||!e.linkType&&fp(e.link)?e.link.startsWith("mailto:")?e.link:`mailto:${e.link}`:e.linkType==="Phone"?e.link.startsWith("tel:")?e.link:`tel:${e.link}`:e.link,fp=e=>e.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(e),EN=e=>e.cta??{link:e.href},hp=rt.forwardRef(function(t,n){const r=EN(t),{children:l,onClick:d,className:f,eventName:p,scope:_,currency:T,amount:E,cta:S,obfuscate:w,customTags:M,customValues:m,...v}=t,k=S?"CTA_CLICK":"LINK",G=p||(S?"cta":"link"),I=nl();if(!(r!=null&&r.link))throw new Error("CTA's link is undefined");const P=w||w!==!1&&fp(r.link),H=async te=>{const ce=te.currentTarget;let V="";if(P){te.preventDefault();const z=ce.href.split("/").at(-1);z&&(V=atob(z))}if(I!==null)try{await I.track({action:k,scope:t.scope,eventName:G,currency:T,amount:E,destinationUrl:V||ce.href,customTags:M,customValues:m})}catch{console.error("Failed to report click Analytics Event")}d&&d(te),V&&(window.location.href=V)},j=P?"Obfuscated, set a label or child":r.link,re={className:Qs("Link",f),href:P?btoa(xf(r)):xf(r),onClick:H,rel:t.target&&!t.rel?"noopener":void 0,ref:n};return I!=null&&I.getDebugEnabled()&&(re["data-ya-action"]=k,re["data-ya-scopeoverride"]=_,re["data-ya-eventname"]=G),ft.jsx("a",{...v,...re,suppressHydrationWarning:!0,children:l||r.label||j})}),TN={URL:"URL",Email:"Email",Phone:"Phone"};var yn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(yn||{}),Ur=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Ur||{});const jc=3959,Vc=6371,xN=["latitude","lat"],vN=["longitude","lon","lng","long"];function vf(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function Sf(e){switch(typeof e){case"string":case"number":const t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error(`'${e}' must be convertible to a Number'`);return t;default:throw new Error(`typeof '${e}' must be a number or a string that can be converted to a number, is '${typeof e}'`)}}function os(e){return e*Math.PI/180}function Ji(e){return e/Math.PI*180}function SN(e,t){const n=os(e.latitude),r=os(t.latitude),l=r-n,d=os(t.longitude-e.longitude),f=Math.pow(Math.sin(l/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))}function wN(e,t){const n=Math.tan(Math.PI/360*(e+90)),r=Math.tan(Math.PI/360*(t+90));return Math.log(r/n)}function ON(e,t){const r=Math.tan(Math.PI/360*(e+90))*Math.pow(Math.E,t);return Math.atan(r)*360/Math.PI-90}class un{constructor(t,n){Ie(this,"_lat");Ie(this,"_lon");let r=t,l=n;this._lat=0,this._lon=0,typeof t=="object"?(r=vf(t,xN)??0,l=vf(t,vN)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof l=="function"?l():l):typeof r=="number"&&typeof l=="number"&&(this.latitude=r,this.longitude=l)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(Sf(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=Sf(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=yn.DEGREE,l=Ur.SPHERICAL){if(l===Ur.MERCATOR&&(r===yn.DEGREE||r===yn.RADIAN)){const d=r===yn.DEGREE?os(t):t,f=r===yn.DEGREE?n:Ji(n);this.latitude=ON(this.latitude,d),this.longitude+=f}else switch(r){case yn.DEGREE:this.latitude+=t,this.longitude+=n;break;case yn.KILOMETER:this.latitude+=Ji(t)*Vc,this.longitude+=Ji(n)*Vc*Math.cos(os(this.latitude));break;case yn.MILE:this.latitude+=Ji(t)*jc,this.longitude+=Ji(n)*jc*Math.cos(os(this.latitude));break;case yn.RADIAN:this.latitude+=Ji(t),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=yn.MILE,r=Ur.SPHERICAL){if(r===Ur.MERCATOR&&(n===yn.DEGREE||n===yn.RADIAN)){const l=wN(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),f=os(Math.min(d,360-d)),p=Math.sqrt(Math.pow(l,2)+Math.pow(f,2));switch(n){case yn.DEGREE:return Ji(p);case yn.RADIAN:return p;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const l=SN(this,t);switch(n){case yn.DEGREE:return Ji(l);case yn.KILOMETER:return l*Vc;case yn.MILE:return l*jc;case yn.RADIAN:return l;default:throw new Error(`unit unhandled: ${String(n)}`)}}}equals(t){return t&&t.latitude===this.latitude&&t.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function gp(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var vr=(e=>(e.UNDEFINED="undefined",e.NULL="object",e.BOOLEAN="boolean",e.NUMBER="number",e.BIGINT="bigint",e.STRING="string",e.SYMBOL="symbol",e.FUNCTION="function",e.OBJECT="object",e))(vr||{});function Ir(e,t){if(typeof t!="string")throw new Error("Assertion error: 'type' must be a string");if(typeof e!==t)throw new Error(`Expected an object of type '${t}' but received '${typeof e}'`)}function Sr(e,t){let n;try{n=e instanceof t}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${t.name}' but received '${e.constructor.name}'`)}class pp{constructor(t,n){Ie(this,"providerMapClass");Ie(this,"wrapper");Ie(this,"controlEnabled");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"providerOptions");Sr(t,cs),n&&Sr(n,HTMLElement),this.providerMapClass=t.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(t){return this.controlEnabled=t,this}withPanHandler(t){return Ir(t,vr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return Ir(t,vr.FUNCTION),this.panStartHandler=t,this}withProviderOptions(t){return this.providerOptions=t,this}build(){const t=this.providerMapClass;return new t(this)}}class rl{constructor(t){Ie(this,"_panHandler");Ie(this,"_panStartHandler");Sr(t,pp),this._panHandler=t.panHandler,this._panStartHandler=t.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(t,n){throw new Error("not implemented")}setZoom(t,n){throw new Error("not implemented")}setZoomCenter(t,n,r){this.setZoom(t,r),this.setCenter(n,r)}}class mp{constructor(t){Ie(this,"providerPinClass");Ie(this,"clickHandler");Ie(this,"focusHandler");Ie(this,"hoverHandler");Ie(this,"icons");Ie(this,"hasPinUrl");Sr(t,cs),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return Ir(t,vr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return Ir(t,vr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return Ir(t,vr.FUNCTION),this.hoverHandler=t,this}withIcons(t){return this.icons=t,this}withHasPinUrl(t){return this.hasPinUrl=t,this}build(){const t=this.providerPinClass;return new t(this)}}class fd{constructor(t){Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_icons");Sr(t,mp),this._clickHandler=t.clickHandler,this._focusHandler=t.focusHandler,this._hoverHandler=t.hoverHandler,this._icons=t.icons}setCoordinate(t){throw new Error("not implemented")}setMap(t,n){throw new Error("not implemented")}setProperties(t){throw new Error("not implemented")}}const DN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class il extends fd{constructor(n){super(n);Ie(this,"_pinEl");Ie(this,"_pinAlt");Ie(this,"_wrapper");this._pinEl=n.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,il.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()}static get baseStyle(){return DN}addListeners(){this._wrapper&&(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(n){this.setElementProperties(n);const r=n.getClass(),l=n.getElement()||this._pinEl,d=n.getZIndex();l.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),l!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(l)))}setElementProperties(n){const r=n.getAnchorX(),l=n.getAnchorY(),d=n.getHeight(),f=this._icons[n.getIcon()],p=n.getSRText(),_=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:f?`url("${f}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*l}%)`,width:_+"px"}),this._pinAlt.innerText=p}}class as{constructor(){Ie(this,"loadFunction");Ie(this,"mapClass");Ie(this,"pinClass");Ie(this,"providerName");this.loadFunction=(t,n,r,l)=>t(),this.mapClass=rl,this.pinClass=fd,this.providerName=""}withLoadFunction(t){return Ir(t,vr.FUNCTION),this.loadFunction=t,this}withMapClass(t){return this.mapClass=t,this}withPinClass(t){return this.pinClass=t,this}withProviderName(t){return this.providerName=t,this}build(){return new cs(this)}}class cs{constructor(t){Ie(this,"_loadFunction");Ie(this,"_mapClass");Ie(this,"_pinClass");Ie(this,"_providerName");Ie(this,"_loadPromise");Ie(this,"_resolveLoad");Ie(this,"_rejectLoad");Ie(this,"_apiKey");Ie(this,"_loadInvoked");Ie(this,"_loaded");Ie(this,"_options");Sr(t,as),this._loadFunction=t.loadFunction,this._mapClass=t.mapClass,this._pinClass=t.pinClass,this._providerName=t.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(t=this._apiKey,n=this._options){!this._loadInvoked&&this._resolveLoad&&this._rejectLoad&&(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,t,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(t,n=null){this._loadInvoked||(this._apiKey=t,this._options=n||this._options)}}class AN extends rl{constructor(n){super(n);Ie(this,"map");Ie(this,"_moving");n.wrapper&&(this.map=new google.maps.Map(n.wrapper,{disableDefaultUI:!n.controlEnabled,fullscreenControl:!1,gestureHandling:n.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:n.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...n.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(){var n;return new un(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d,f;const l=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(l):(f=this.map)==null||f.setCenter(l)}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(Math.floor(n))}setZoomCenter(n,r,l){this.setCenter(r,l),this.setZoom(n,l)}}class MN extends il{constructor(n){super(n);Ie(this,"_latLng");Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(f){super();Ie(this,"pin");this.pin=f}draw(){var p;const f=(p=this.getProjection())==null?void 0:p.fromLatLngToDivPixel(this.pin._latLng??null);f&&this.pin._wrapper&&(this.pin._wrapper.style.left=f.x+"px",this.pin._wrapper.style.top=f.y+"px")}onAdd(){var f;this.pin._wrapper&&((f=this.getPanes())==null||f.floatPane.appendChild(this.pin._wrapper))}onRemove(){var f,p;(p=(f=this.pin._wrapper)==null?void 0:f.parentNode)==null||p.removeChild(this.pin._wrapper)}}this.pin=new r(this)}setCoordinate(n){this._latLng=new google.maps.LatLng(n.latitude,n.longitude),this.pin.draw()}setMap(n,r){var d;const l=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(l??null)}}const wf="GoogleMapsCallback_b7d77ff2",RN="https://maps.googleapis.com/maps/api/js";function bN(e,t,n,{autocomplete:r=!1,channel:l=window.location.hostname,client:d,language:f,region:p,libraries:_=[],loading:T="async",params:E={}}={}){window[wf]=e,r&&_.push("geocoder","places");const S={callback:wf,channel:l,libraries:_.join(","),...E};n&&(S.key=n),d&&(S.client=d),f&&(S.language=f),p&&(S.region=p),T&&(S.loading=T),gp(RN+"?"+Object.entries(S).map(([w,M])=>w+"="+M).join("&"))}const _p=new as().withLoadFunction(bN).withMapClass(AN).withPinClass(MN).withProviderName("Google").build();class rs{constructor(t,n){Ie(this,"_ne");Ie(this,"_sw");this._ne=new un(n),this._sw=new un(t)}static fit(t){const n=t.map(T=>T.latitude),r=Math.max(...n),l=Math.min(...n),d=t.map(T=>T.normalLon).sort((T,E)=>T-E),f=d.map((T,E)=>({distance:(E<d.length-1?d[E+1]:d[0]+360)-T,index:E})).reduce((T,E)=>E.distance>T.distance?E:T).index,p=d[f],_=d[(f+1)%d.length];return new this(new un(l,_),new un(r,p))}get ne(){return this._ne}set ne(t){this._ne=new un(t)}get sw(){return this._sw}set sw(t){this._sw=new un(t)}contains(t){const n=this._sw.latitude<=t.latitude&&t.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,l=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=t.normalLon&&t.normalLon<=this._ne.normalLon:this._sw.normalLon<=t.normalLon||t.normalLon<=this._ne.normalLon;return n&&(r||l)}extend(t){if(this._ne.latitude=Math.max(this._ne.latitude,t.latitude),this._sw.latitude=Math.min(this._sw.latitude,t.latitude),!this.contains(t)){const n=((t.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-t.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(t=Ur.SPHERICAL){const n=new un(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,yn.DEGREE,t),l=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,yn.DEGREE,t),n.longitude=l,n}}class LN{constructor(){Ie(this,"_anchorX");Ie(this,"_anchorY");Ie(this,"_height");Ie(this,"_icon");Ie(this,"_srText");Ie(this,"_width");Ie(this,"_zIndex");Ie(this,"_class");Ie(this,"_element");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(t){return this._anchorX=t,this}setAnchorY(t){return this._anchorY=t,this}setClass(t){return this._class=t,this}setElement(t){return this._element=t,this}setHeight(t){return this._height=t,this}setIcon(t){return this._icon=t,this}setSRText(t){return this._srText=t,this}setWidth(t){return this._width=t,this}setZIndex(t){return this._zIndex=t,this}}class hd{constructor(){Ie(this,"coordinate");Ie(this,"hideOffscreen");Ie(this,"icons");Ie(this,"propertiesForStatus");Ie(this,"provider");Ie(this,"type");Ie(this,"hasPinUrl");this.coordinate=new un(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new LN,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(t){return this.coordinate=new un(t),this}withHideOffscreen(t){return this.hideOffscreen=t,this}withIcon(t,n){return this.icons[t]=n,this}withPropertiesForStatus(t){return Ir(t,vr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(Sr(t,cs),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new IN(this)}}class IN{constructor(t){Ie(this,"_coordinate");Ie(this,"_hideOffscreen");Ie(this,"_icons");Ie(this,"_propertiesForStatus");Ie(this,"_type");Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_hidden");Ie(this,"_cancelHiddenUpdater");Ie(this,"_map");Ie(this,"_pin");Ie(this,"_status");var n,r;if(Sr(t,hd),t.provider&&Sr(t.provider,cs),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=t.coordinate,this._hideOffscreen=t.hideOffscreen,this._icons={...t.icons},this._propertiesForStatus=t.propertiesForStatus,this._type=t.type,this._clickHandler=()=>null,this._focusHandler=l=>this._hoverHandler(l),this._hoverHandler=l=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new mp(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(l=>this._focusHandler(l)).withHoverHandler(l=>this._hoverHandler(l)).withHasPinUrl(t.hasPinUrl).build(),this._pin.setCoordinate(t.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(t){return this._icons[t]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(t){Ir(t,vr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new un(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){Ir(t,vr.FUNCTION),this._focusHandler=t}setHoverHandler(t){Ir(t,vr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&Sr(t,Np),this._pin.setMap(t,this._hidden?null:this._map),this._map=t,this._hidden=!1,this._cancelHiddenUpdater(),t&&this._hideOffscreen)){let n=!1;const r=new Promise(l=>{this._cancelHiddenUpdater=()=>{n=!0,l()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,t.moving()]),await Promise.race([r,t.idle()])})()}}setStatus(t){Object.assign(this._status,t),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const t=this._map.getBounds().contains(this._coordinate);this._hidden&&t?this._pin.setMap(this._map,null):!this._hidden&&!t&&this._pin.setMap(null,this._map),this._hidden=!t}}}const yo=.98;function Va(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class yp{constructor(){Ie(this,"controlEnabled");Ie(this,"defaultCenter");Ie(this,"defaultZoom");Ie(this,"legendPins");Ie(this,"padding");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"provider");Ie(this,"providerOptions");Ie(this,"singlePinZoom");Ie(this,"wrapper");this.controlEnabled=!0,this.defaultCenter=new un(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(t,n)=>null,this.panStartHandler=t=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(t){return this.controlEnabled=t,this}withDefaultCenter(t){return this.defaultCenter=new un(t),this}withDefaultZoom(t){return this.defaultZoom=t,this}withLegendPins(t){return this.legendPins=Array.from(t),this}withPadding(t){return this.padding=t,this}withPanHandler(t){return Ir(t,vr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return Ir(t,vr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return Sr(t,cs),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(Sr(t,HTMLElement),this.wrapper=t,this):this}build(){return new Np(this)}}let Np=class{constructor(t){Ie(this,"_defaultCenter");Ie(this,"_defaultZoom");Ie(this,"_legendPins");Ie(this,"_padding");Ie(this,"_provider");Ie(this,"_singlePinZoom");Ie(this,"_wrapper");Ie(this,"_cachedBounds");Ie(this,"_resolveIdle");Ie(this,"_resolveMoving");Ie(this,"_idlePromise");Ie(this,"_panHandlerRunning");Ie(this,"_panStartHandlerRunning");Ie(this,"_currentBounds");Ie(this,"_movingPromise");Ie(this,"_panHandler");Ie(this,"_panStartHandler");Ie(this,"_map");var n,r,l;if(Sr(t,yp),t.provider&&Sr(t.provider,cs),t.wrapper&&Sr(t.wrapper,HTMLElement),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=t.defaultCenter,this._defaultZoom=t.defaultZoom,this._legendPins=t.legendPins,this._provider=t.provider,this._singlePinZoom=t.singlePinZoom,this._wrapper=t.wrapper,this._padding={},this.setPadding(t.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(t.panHandler),this.setPanStartHandler(t.panStartHandler);(l=this._wrapper)!=null&&l.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new pp(t.provider,this._wrapper).withControlEnabled(t.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(t.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(t,n=!1,r=this._singlePinZoom){t.length?this.setBounds(rs.fit(t),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){var t,n;if(!this._cachedBounds){const r=((t=this._wrapper)==null?void 0:t.offsetHeight)??0,l=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),f=this.getCenter(),p=360/Math.pow(2,d+8),_=l*p,T=r*p;this._cachedBounds=new rs(f,f),this._cachedBounds.ne.add(T/2,_/2,yn.DEGREE,Ur.MERCATOR),this._cachedBounds.sw.add(-T/2,-_/2,yn.DEGREE,Ur.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new rs(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 t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new rs(new un(this._currentBounds.sw),new un(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler&&this._panStartHandler(new rs(new un(this._currentBounds.sw),new un(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,l={},d=1/0){var z,q;const f=(z=this._wrapper)==null?void 0:z.offsetHeight,p=(q=this._wrapper)==null?void 0:q.offsetWidth;if(!f||!p)return;let _=Va(l.bottom,f),T=Va(l.left,p),E=Va(l.right,p),S=Va(l.top,f),w=T+E,M=_+S;w>yo&&(T*=yo/w,E*=yo/w,w=yo),M>yo&&(_*=yo/M,S*=yo/M,M=yo);const m=f*(1-M),v=p*(1-w),k=new rs(n,t),G=new un(k.ne.latitude,k.sw.longitude),I=k.sw.distanceTo(G,yn.DEGREE,Ur.MERCATOR),P=(k.ne.longitude-G.longitude+360)%360;let H=Math.max(I,P*m/v)/(1-M),j=Math.max(P,I*v/m)/(1-w),re=Math.log2(p*360/j)-8;re>d&&(re=d,j=p*360/2**(re+8),H=j*f/p);const te=k.getCenter(Ur.MERCATOR),ce=(S-_)/2*H,V=(E-T)/2*j;te.add(ce,V,yn.DEGREE,Ur.MERCATOR),this.setZoomCenter(re,te,r)}setCenter(t,n=!1){this._map.setCenter(new un(t),n)}setPadding({bottom:t=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:l=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:l},this}setPanHandler(t){Ir(t,vr.FUNCTION),this._panHandler=t}setPanStartHandler(t){Ir(t,vr.FUNCTION),this._panStartHandler=t}setZoom(t,n=!1){this._map.setZoom(t,n)}setZoomCenter(t,n,r=!1){this._map.setZoomCenter(t,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(t=>this._resolveMoving=t),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(t=>this._resolveIdle=t),this._resolveMoving()}};const _c=rt.createContext(null);function kN(){const e=rt.useContext(_c);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Cp=({apiKey:e,bounds:t,children:n,className:r,clientKey:l,controls:d=!0,defaultCenter:f={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:_,padding:T={bottom:50,left:50,right:50,top:50},panHandler:E=()=>null,panStartHandler:S=()=>null,provider:w=_p,providerOptions:M={},singleZoom:m=14})=>{const v=rt.useRef(null),[k,G]=rt.useState(new un(f)),[I,P]=rt.useState(!1),[H,j]=rt.useState(),[re,te]=rt.useState(p),ce=(V,z)=>{E(V,z),z&&G(z.getCenter())};return rt.useEffect(()=>{!I||!H||te(H.getZoom())},[k]),rt.useEffect(()=>{if(!t||!I||!H)return;const V=t.map(z=>new un(z));H.fitCoordinates(V)},[JSON.stringify(t),H]),rt.useEffect(()=>{if(!I||H)return;const V=new yp().withControlEnabled(d).withDefaultCenter(k).withDefaultZoom(re).withPadding(T).withPanHandler(ce).withPanStartHandler(S).withProvider(w).withProviderOptions(M).withSinglePinZoom(m).withWrapper(v.current).build();j(V),_&&(_.current=V)},[I]),rt.useEffect(()=>{I||H||!v.current||w.load(e,{...M,...l&&{client:l}}).then(()=>P(!0))},[]),ft.jsx("div",{className:Qs({"is-loaded":I},r),id:"map",ref:v,"data-testid":"map",children:H&&ft.jsx(_c.Provider,{value:{map:H,provider:w},children:n})})},PN=({count:e})=>ft.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:ft.jsxs("g",{fill:"none",fillRule:"evenodd",children:[ft.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),ft.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:ft.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),gd=rt.createContext(null);function $N(){const e=rt.useContext(gd);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const FN=({clusterRadius:e=50,children:t,ClusterTemplate:n=PN})=>{const{map:r}=rt.useContext(_c),[l,d]=rt.useState([]),[f,p]=rt.useState(),[_,T]=rt.useState([]),[E,S]=rt.useState([]);return rt.useEffect(()=>{p(BN(l,r.getZoom(),e))},[l,r.getZoom()]),rt.useEffect(()=>{S(()=>[]),T(()=>[]),(f==null?void 0:f.length)!==0&&(f==null||f.forEach(w=>{if(w.length===1){w[0].pin.setMap(r);return}if(w.length>1){const M=rs.fit(w.map(v=>v.pin.getCoordinate())).getCenter(Ur.MERCATOR),m=`cluster-{${M._lat},${M._lon}}`;w.forEach(v=>v.pin.setMap(null)),T(v=>[...v,m]),S(v=>[...v,ft.jsx(pd,{coordinate:M,id:m,onClick:()=>r.fitCoordinates(w.map(k=>k.pin.getCoordinate()),!0,1/0),children:ft.jsx(n,{count:w.length})},m)])}}))},[f]),ft.jsx(gd.Provider,{value:{clusters:f??[],clusterIds:_,setPinStore:d},children:ft.jsxs(ft.Fragment,{children:[E.map((w,M)=>ft.jsx(rt.Fragment,{children:w},M)),t]})})},BN=(e,t,n)=>{const r=n*Math.PI/2**(t+7),l=e.map((p,_)=>[_]),d=[];e.forEach((p,_)=>{for(let T=_;T<e.length;T++)T!==_&&new un(p.pin.getCoordinate()).distanceTo(new un(e[T].pin.getCoordinate()),yn.RADIAN,Ur.MERCATOR)<=r&&(l[_].push(T),l[T].push(_))});let f=1;for(;f;){f=0;let p;if(l.forEach((E,S)=>{E.length>f&&(f=E.length,p=S)}),!f)break;const _=l[p??0],T=[];l[p??0]=[];for(const E of _){const S=l[E];T.push(e[E]),l[E]=[],S.forEach(w=>l[w].splice(l[w].indexOf(E),1))}d.push(T)}return d},HN=ft.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ft.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:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:l=HN,onClick:d=()=>null,onFocus:f=()=>null,onHover:p=()=>null,zIndex:_,hasPinUrl:T=!1})=>{const{map:E,provider:S}=rt.useContext(_c),w=rt.useContext(gd),M=rt.useMemo(()=>new hd().withCoordinate(t).withHideOffscreen(n).withProvider(S).withHasPinUrl(T).build(),[]);rt.useEffect(()=>{if(_!==0&&!_)return;const v=M.getProviderPin().getWrapperElement();v&&(v.style.zIndex=_.toString())},[_]),rt.useEffect(()=>{M.setMap(E),M.setClickHandler(()=>d(r)),M.setFocusHandler(k=>f(k,r)),M.setHoverHandler(k=>p(k,r));const v=w==null?void 0:w.clusterIds.includes(r);return w&&!v&&w.setPinStore(k=>[...k,{pin:M,id:r}]),()=>{M.setMap(null),w&&w.setPinStore(k=>k.filter(G=>G.id!==r))}},[]);const m=e||l;if(m){const v=M.getProviderPin().getPinElement();return Object.assign(v.style,{height:"auto",width:"auto"}),ld.createPortal(m,v)}return null},WN=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:l=()=>null,onHover:d=()=>null,onFocus:f=()=>null,...p})=>{var _;return ft.jsx(Cp,{bounds:[t],...p,children:ft.jsx(pd,{coordinate:t,id:"location-map-marker",onClick:l,onHover:d,onFocus:f,hasPinUrl:((_=r||"")==null?void 0:_.length)>0,children:r?ft.jsx(hp,{href:r,target:n?"_self":"_blank",children:e}):e||void 0})})};var qc={},Vl={},Of;function KN(){if(Of)return Vl;Of=1;var e=rt;const t=e.createContext(null);function n(l,d){let f=null;l!=null&&(f=l[1]);function p(){return d??(f!=null?f.getTheme():null)}return{getTheme:p}}function r(){const l=e.useContext(t);if(l==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return l}return Vl.LexicalComposerContext=t,Vl.createLexicalComposerContext=n,Vl.useLexicalComposerContext=r,Vl}var ql={},Df;function zN(){if(Df)return ql;Df=1;var e=rt;function t(r){let l=new URLSearchParams;l.append("code",r);for(let d=1;d<arguments.length;d++)l.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${l} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return ql.LexicalComposerContext=n,ql.createLexicalComposerContext=function(r,l){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return l??(d!=null?d.getTheme():null)}}},ql.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},ql}var Zc,Af;function Zn(){return Af||(Af=1,Zc=process.env.NODE_ENV==="development"?KN():zN()),Zc}var He={},Mf;function UN(){if(Mf)return He;Mf=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),l=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),f=e("INSERT_PARAGRAPH_COMMAND"),p=e("CONTROLLED_TEXT_INSERTION_COMMAND"),_=e("PASTE_COMMAND"),T=e("REMOVE_TEXT_COMMAND"),E=e("DELETE_WORD_COMMAND"),S=e("DELETE_LINE_COMMAND"),w=e("FORMAT_TEXT_COMMAND"),M=e("UNDO_COMMAND"),m=e("REDO_COMMAND"),v=e("KEYDOWN_COMMAND"),k=e("KEY_ARROW_RIGHT_COMMAND"),G=e("MOVE_TO_END"),I=e("KEY_ARROW_LEFT_COMMAND"),P=e("MOVE_TO_START"),H=e("KEY_ARROW_UP_COMMAND"),j=e("KEY_ARROW_DOWN_COMMAND"),re=e("KEY_ENTER_COMMAND"),te=e("KEY_SPACE_COMMAND"),ce=e("KEY_BACKSPACE_COMMAND"),V=e("KEY_ESCAPE_COMMAND"),z=e("KEY_DELETE_COMMAND"),q=e("KEY_TAB_COMMAND"),Te=e("INSERT_TAB_COMMAND"),Se=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),de=e("DROP_COMMAND"),K=e("FORMAT_ELEMENT_COMMAND"),O=e("DRAGSTART_COMMAND"),Z=e("DRAGOVER_COMMAND"),se=e("DRAGEND_COMMAND"),Y=e("COPY_COMMAND"),W=e("CUT_COMMAND"),J=e("SELECT_ALL_COMMAND"),R=e("CLEAR_EDITOR_COMMAND"),U=e("CLEAR_HISTORY_COMMAND"),X=e("CAN_REDO_COMMAND"),fe=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),B=e("BLUR_COMMAND"),A=e("KEY_MODIFIER_COMMAND"),F=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",oe=F&&"documentMode"in document?document.documentMode:null,ye=F&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),De=F&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=F&&"InputEvent"in window&&!oe?"getTargetRanges"in new window.InputEvent("input"):!1,ne=F&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ue=F&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=F&&/Android/.test(navigator.userAgent),Ne=F&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=F&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,ke=1,Fe=3,qe=0,Be=1,ct=2,Mt=0,zt=1,Vt=2,Oe=1,ie=2,le=4,ve=8,Le=16,Me=32,je=64,it=128,ot=Oe|ie|le|ve|Le|Me|je|it,st=1,wt=2,Ue=1,Ge=2,tt=3,yt=4,Nt=5,Tt=6,gt=" ",mt=ne||ue||Re?gt:"​",Ft=`
37
+
38
+ `,Ht=De?gt:mt,tn="֑-߿יִ-﷽ﹰ-ﻼ",kt="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",Yt=new RegExp("^[^"+kt+"]*["+tn+"]"),bt=new RegExp("^[^"+tn+"]*["+kt+"]"),Qt={bold:Oe,code:Le,highlight:it,italic:ie,strikethrough:le,subscript:Me,superscript:je,underline:ve},wr={directionless:st,unmergeable:wt},mi={center:Ge,end:Tt,justify:yt,left:Ue,right:tt,start:Nt},_i={[Ge]:"center",[Tt]:"end",[yt]:"justify",[Ue]:"left",[tt]:"right",[Nt]:"start"},pe={normal:Mt,segmented:Vt,token:zt},Ze={[Mt]:"normal",[Vt]:"segmented",[zt]:"token"},nt=100;let St=!1,Pt=0;function Ut(){return St}function $t(u){Pt=u.timeStamp}function Et(u){Pt===0&&Ns(u).addEventListener("textInput",$t,!0)}function Nn(u,o,c){return o.__lexicalLineBreak===u||u[`__lexicalKey_${c._key}`]!==void 0}function rn(u){return u.getEditorState().read(()=>{const o=mn();return o!==null?o.clone():null})}function cn(u,o,c){const h=cr(c._window);let y=null,N=null;h!==null&&h.anchorNode===u&&(y=h.anchorOffset,N=h.focusOffset);const b=u.nodeValue;b!==null&&Pr(o,b,y,N,!1)}function bn(u,o,c){if(vt(u)){const h=u.anchor.getNode();if(h.is(c)&&u.format!==h.getFormat())return!1}return o.nodeType===Fe&&c.isAttached()}function nr(u,o,c){St=!0;const h=performance.now()-Pt>nt;try{Kr(u,()=>{const y=mn()||rn(u),N=new Map,b=u.getRootElement(),$=u._editorState,ae=u._blockCursorElement;let he=!1,me="";for(let we=0;we<o.length;we++){const Ce=o[we],Ve=Ce.type,ze=Ce.target;let $e=ri(ze,$);if(!($e===null&&ze!==b||An($e))){if(Ve==="characterData")h&&_t($e)&&bn(y,ze,$e)&&cn(ze,$e,u);else if(Ve==="childList"){he=!0;const Lt=Ce.addedNodes;for(let qt=0;qt<Lt.length;qt++){const Wt=Lt[qt],At=hs(Wt),ln=Wt.parentNode;if(ln!=null&&Wt!==ae&&At===null&&(Wt.nodeName!=="BR"||!Nn(Wt,ln,u))){if(De){const lr=Wt.innerText||Wt.nodeValue;lr&&(me+=lr)}ln.removeChild(Wt)}}const Qe=Ce.removedNodes,ht=Qe.length;if(ht>0){let qt=0;for(let Wt=0;Wt<ht;Wt++){const At=Qe[Wt];(At.nodeName==="BR"&&Nn(At,ze,u)||ae===At)&&(ze.appendChild(At),qt++)}ht!==qt&&(ze===b&&($e=ml($)),N.set(ze,$e))}}}}if(N.size>0)for(const[we,Ce]of N)if(et(Ce)){const Ve=Ce.getChildrenKeys();let ze=we.firstChild;for(let $e=0;$e<Ve.length;$e++){const Lt=Ve[$e],Qe=u.getElementByKey(Lt);Qe!==null&&(ze==null?(we.appendChild(Qe),ze=Qe):ze!==Qe&&we.replaceChild(Qe,ze),ze=ze.nextSibling)}}else _t(Ce)&&Ce.markDirty();const xe=c.takeRecords();if(xe.length>0){for(let we=0;we<xe.length;we++){const Ce=xe[we],Ve=Ce.addedNodes,ze=Ce.target;for(let $e=0;$e<Ve.length;$e++){const Lt=Ve[$e],Qe=Lt.parentNode;Qe!=null&&Lt.nodeName==="BR"&&!Nn(Lt,ze,u)&&Qe.removeChild(Lt)}}c.takeRecords()}y!==null&&(he&&(y.dirty=!0,Nr(y)),De&&Ol(u)&&y.insertRawText(me))})}finally{St=!1}}function Ln(u){const o=u._observer;if(o!==null){const c=o.takeRecords();nr(u,c,o)}}function fn(u){Et(u),u._observer=new MutationObserver((o,c)=>{nr(u,o,c)})}function Jn(u,o){const c=u.__mode,h=u.__format,y=u.__style,N=o.__mode,b=o.__format,$=o.__style;return(c===null||c===N)&&(h===null||h===b)&&(y===null||y===$)}function Mi(u,o){const c=u.mergeWithSibling(o),h=xn()._normalizedNodes;return h.add(u.__key),h.add(o.__key),c}function rr(u){let o=u;if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable()){o.remove();return}let c;for(;(c=o.getPreviousSibling())!==null&&_t(c)&&c.isSimpleText()&&!c.isUnmergeable();)if(c.__text==="")c.remove();else if(Jn(c,o)){o=Mi(c,o);break}else break;let h;for(;(h=o.getNextSibling())!==null&&_t(h)&&h.isSimpleText()&&!h.isUnmergeable();)if(h.__text==="")h.remove();else if(Jn(o,h)){o=Mi(o,h);break}else break}function Do(u){return ds(u.anchor),ds(u.focus),u}function ds(u){for(;u.type==="element";){const o=u.getNode(),c=u.offset;let h,y;if(c===o.getChildrenSize()?(h=o.getChildAtIndex(c-1),y=!0):(h=o.getChildAtIndex(c),y=!1),_t(h)){u.set(h.__key,y?h.getTextContentSize():0,"text");break}else if(!et(h))break;u.set(h.__key,y?h.getChildrenSize():0,"element")}}let dl=1;function Yr(){return""+dl++}function pa(u,o){const c=u._nodes.get(o);if(c===void 0)throw Error(`registeredNode: Type ${o} not found`);return c}const fs=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function io(u){return An(ri(u))}function Ao(u){const o=document.activeElement;if(o===null)return!1;const c=o.nodeName;return An(ri(u))&&(c==="INPUT"||c==="TEXTAREA"||o.contentEditable==="true"&&o.__lexicalEditor==null)}function oo(u,o,c){const h=u.getRootElement();try{return h!==null&&h.contains(o)&&h.contains(c)&&o!==null&&!Ao(o)&&fl(o)===u}catch{return!1}}function fl(u){let o=u;for(;o!=null;){const c=o.__lexicalEditor;if(c!=null)return c;o=ys(o)}return null}function In(u){return Yt.test(u)?"rtl":bt.test(u)?"ltr":null}function Un(u){return u.isToken()||u.isSegmented()}function ni(u){return u.nodeType===Fe}function kr(u){let o=u;for(;o!=null;){if(ni(o))return o;o=o.firstChild}return null}function Hn(u,o,c){const h=Qt[o];if(c!==null&&(u&h)===(c&h))return u;let y=u^h;return o==="subscript"?y&=~Qt.superscript:o==="superscript"&&(y&=~Qt.subscript),y}function Mo(u){return _t(u)||li(u)||An(u)}function hl(u,o){if(o!=null){u.__key=o;return}hr(),Jd();const c=xn(),h=xi(),y=Yr();h._nodeMap.set(y,u),et(u)?c._dirtyElements.set(y,!0):c._dirtyLeaves.add(y),c._cloneNotNeeded.add(y),c._dirtyType=Be,u.__key=y}function gl(u,o,c){let h=u;for(;h!==null;){if(c.has(h))return;const y=o.get(h);if(y===void 0)break;c.set(h,!1),h=y.__parent}}function jr(u){const o=u.getParent();if(o!==null){const c=u.getWritable(),h=o.getWritable(),y=u.getPreviousSibling(),N=u.getNextSibling();if(y===null)if(N!==null){const b=N.getWritable();h.__first=N.__key,b.__prev=null}else h.__first=null;else{const b=y.getWritable();if(N!==null){const $=N.getWritable();$.__prev=b.__key,b.__next=$.__key}else b.__next=null;c.__prev=null}if(N===null)if(y!==null){const b=y.getWritable();h.__last=y.__key,b.__next=null}else h.__last=null;else{const b=N.getWritable();if(y!==null){const $=y.getWritable();$.__next=b.__key,b.__prev=$.__key}else b.__prev=null;c.__next=null}h.__size--,c.__parent=null}}function Ri(u){Jd();const o=u.getLatest(),c=o.__parent,h=xi(),y=xn(),N=h._nodeMap,b=y._dirtyElements;c!==null&&gl(c,N,b);const $=o.__key;y._dirtyType=Be,et(u)?b.set($,!0):y._dirtyLeaves.add($)}function pl(u){const o=u.getPreviousSibling(),c=u.getNextSibling();o!==null&&Ri(o),c!==null&&Ri(c)}function vn(u){hr();const o=xn(),c=o._compositionKey;if(u!==c){if(o._compositionKey=u,c!==null){const h=Cn(c);h!==null&&h.getWritable()}if(u!==null){const h=Cn(u);h!==null&&h.getWritable()}}}function ar(){return Fs()?null:xn()._compositionKey}function Cn(u,o){const h=(o||xi())._nodeMap.get(u);return h===void 0?null:h}function hs(u,o){const c=xn(),h=u[`__lexicalKey_${c._key}`];return h!==void 0?Cn(h,o):null}function ri(u,o){let c=u;for(;c!=null;){const h=hs(c,o);if(h!==null)return h;c=ys(c)}return null}function Ro(u){const o=u._decorators,c=Object.assign({},o);return u._pendingDecorators=c,c}function gs(u){return u.read(()=>ir().getTextContent())}function bi(u,o){Kr(u,()=>{const c=xi();if(c.isEmpty())return;if(o==="root"){ir().markDirty();return}const h=c._nodeMap;for(const[,y]of h)y.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function ir(){return ml(xi())}function ml(u){return u._nodeMap.get("root")}function Nr(u){hr();const o=xi();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 _l(){hr();const u=xn();Ln(u)}function Li(u){const o=xn(),c=ma(u,o);if(c===null){const h=o.getRootElement();return u===h?Cn("root"):null}return Cn(c)}function yl(u,o){return o?u.getTextContentSize():0}function ma(u,o){let c=u;for(;c!=null;){const h=c[`__lexicalKey_${o._key}`];if(h!==void 0)return h;c=ys(c)}return null}function bo(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Ii(u){const o=[];let c=u;for(;c!==null;)o.push(c),c=c._parentEditor;return o}function Nl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ps(u){return u.nodeType===Fe?u.nodeValue:null}function Lo(u,o,c){const h=cr(o._window);if(h===null)return;const y=h.anchorNode;let{anchorOffset:N,focusOffset:b}=h;if(y!==null){let $=ps(y);const ae=ri(y);if($!==null&&_t(ae)){if($===mt&&c){const he=c.length;$=c,N=he,b=he}$!==null&&Pr(ae,$,N,b,u)}}}function Pr(u,o,c,h,y){let N=u;if(N.isAttached()&&(y||!N.isDirty())){const b=N.isComposing();let $=o;(b||y)&&o[o.length-1]===mt&&($=o.slice(0,-1));const ae=N.getTextContent();if(y||$!==ae){if($===""){if(vn(null),!ne&&!ue&&!Re){const ze=xn();setTimeout(()=>{ze.update(()=>{N.isAttached()&&N.remove()})},20)}else N.remove();return}const he=N.getParent(),me=$s(),xe=N.getTextContentSize(),we=ar(),Ce=N.getKey();if(N.isToken()||we!==null&&Ce===we&&!b||vt(me)&&(he!==null&&!he.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!N.canInsertTextBefore()&&!b||me.focus.key===u.__key&&me.focus.offset===xe&&!N.canInsertTextAfter()&&!b)){N.markDirty();return}const Ve=mn();if(!vt(Ve)||c===null||h===null){N.setTextContent($);return}if(Ve.setTextNodeRange(N,c,N,h),N.isSegmented()){const ze=N.getTextContent(),$e=Dn(ze);N.replace($e),N=$e}N.setTextContent($)}}}function Cl(u){const o=u.getPreviousSibling();return(_t(o)||et(o)&&o.isInline())&&!o.canInsertTextAfter()}function Io(u,o){if(o.isSegmented())return!0;if(!u.isCollapsed())return!1;const c=u.anchor.offset,h=o.getParentOrThrow(),y=o.isToken();return c===0?!o.canInsertTextBefore()||!h.canInsertTextBefore()||y||Cl(o):c===o.getTextContentSize()?!o.canInsertTextAfter()||!h.canInsertTextAfter()||y:!1}function _a(u,o,c,h){return u===9&&!o&&!c&&!h}function ya(u,o,c,h){return u===66&&!o&&Vr(c,h)}function so(u,o,c,h){return u===73&&!o&&Vr(c,h)}function ko(u,o,c,h){return u===85&&!o&&Vr(c,h)}function El(u,o){return Da(u)&&!o}function Tl(u,o){return Da(u)&&o}function Po(u,o){return ye&&o&&u===79}function $o(u,o,c){return qr(u)&&(ye?o:c)}function Na(u,o,c){return Pi(u)&&(ye?o:c)}function Ca(u,o){return ye&&o&&qr(u)}function Ea(u,o){return ye&&o&&Pi(u)}function Ta(u,o,c,h){return ye?o||c?!1:qr(u)||u===72&&h:h||o||c?!1:qr(u)}function Dc(u,o,c,h,y){return ye?c||h||y?!1:Pi(u)||u===68&&o:o||h||y?!1:Pi(u)}function Ac(u,o,c,h){return u===90&&!o&&Vr(c,h)}function xa(u,o,c,h){return ye?u===90&&c&&o:u===89&&h||u===90&&h&&o}function Mc(u,o,c,h){return o?!1:u===67?ye?c:h:!1}function Rc(u,o,c,h){return o?!1:u===88?ye?c:h:!1}function va(u){return u===37}function Sa(u){return u===39}function xl(u){return u===38}function bc(u){return u===40}function Lc(u,o,c,h){return va(u)&&!o&&!h&&!c}function wa(u,o,c,h,y){return va(u)&&!h&&!c&&(o||y)}function lo(u,o,c,h){return Sa(u)&&!o&&!h&&!c}function Oa(u,o,c,h,y){return Sa(u)&&!h&&!c&&(o||y)}function Ic(u,o,c){return xl(u)&&!o&&!c}function vl(u,o,c){return bc(u)&&!o&&!c}function Fo(u,o,c,h){return u||o||c||h}function kc(u){return u===32}function Vr(u,o){return ye?u:o}function Da(u){return u===13}function qr(u){return u===8}function ki(u){return u===27}function Pi(u){return u===46}function ms(u,o,c){return u===65&&Vr(o,c)}function Sl(){const u=ir(),o=u.select(0,u.getChildrenSize());Nr(Do(o))}function $i(u,o){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const c=u.__lexicalClassNameCache,h=c[o];if(h!==void 0)return h;const y=u[o];if(typeof y=="string"){const N=y.split(" ");return c[o]=N,N}return y}function ao(u,o,c,h,y){if(c.size===0)return;const N=h.__type,b=h.__key,$=o.get(N);if($===void 0)throw Error(`Type ${N} not in registeredNodes`);const ae=$.klass;let he=u.get(ae);he===void 0&&(he=new Map,u.set(ae,he));const me=he.get(b),xe=me==="destroyed"&&y==="created";(me===void 0||xe)&&he.set(b,xe?"updated":y)}function Fi(u){const o=xi(),c=o._readOnly,h=u.getType(),y=o._nodeMap,N=[];for(const[,b]of y)b instanceof u&&b.__type===h&&(c||b.isAttached())&&N.push(b);return N}function Aa(u,o,c){const h=u.getParent();let y=c,N=u;return h!==null&&(o&&c===0?(y=N.getIndexWithinParent(),N=h):!o&&c===N.getChildrenSize()&&(y=N.getIndexWithinParent()+1,N=h)),N.getChildAtIndex(o?y-1:y)}function wl(u,o){const c=u.offset;if(u.type==="element"){const h=u.getNode();return Aa(h,o,c)}else{const h=u.getNode();if(o&&c===0||!o&&c===h.getTextContentSize()){const y=o?h.getPreviousSibling():h.getNextSibling();return y===null?Aa(h.getParentOrThrow(),o,h.getIndexWithinParent()+(o?0:1)):y}}return null}function Ol(u){const o=Ns(u).event,c=o&&o.inputType;return c==="insertFromPaste"||c==="insertFromPasteAsQuotation"}function ut(u,o,c){return nf(u,o,c)}function _s(u){return!zr(u)&&!u.isLastChild()&&!u.isInline()}function Bo(u,o){const c=u._keyToDOMMap.get(o);if(c===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${o}`);return c}function ys(u){const o=u.assignedSlot||u.parentElement;return o!==null&&o.nodeType===11?o.host:o}function yi(u,o,c){const h=c.ownerDocument,y=h.defaultView;if(y===null)return;let{top:N,bottom:b}=o,$=0,ae=0,he=c;for(;he!==null;){const me=he===h.body;if(me)$=0,ae=Ns(u).innerHeight;else{const we=he.getBoundingClientRect();$=we.top,ae=we.bottom}let xe=0;if(N<$?xe=-($-N):b>ae&&(xe=b-ae),xe!==0)if(me)y.scrollBy(0,xe);else{const we=he.scrollTop;he.scrollTop+=xe;const Ce=he.scrollTop-we;N-=Ce,b-=Ce}if(me)break;he=ys(he)}}function Gn(u){return xn()._updateTags.has(u)}function Ct(u){hr(),xn()._updateTags.add(u)}function co(u){const o=mn();if(!vt(o)||!et(u))return o;const{anchor:c,focus:h}=o,y=c.getNode(),N=h.getNode();return Bi(y,u)&&c.set(u.__key,0,"element"),Bi(N,u)&&h.set(u.__key,0,"element"),o}function Bi(u,o){let c=u.getParent();for(;c!==null;){if(c.is(o))return!0;c=c.getParent()}return!1}function Ma(u){const o=u.ownerDocument;return o&&o.defaultView||null}function Ns(u){const o=u._window;if(o===null)throw Error("window object not found");return o}function $r(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function Cs(u){let o=u.getParentOrThrow();for(;o!==null;){if(ii(o))return o;o=o.getParentOrThrow()}return o}function ii(u){return zr(u)||et(u)&&u.isShadowRoot()}function Dl(u){const o=u.constructor.clone(u);return hl(o,null),o}function Or(u){const o=xn(),c=u.constructor.getType(),h=o._nodes.get(c);if(h===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 y=h.replace;if(y!==null){const N=y(u);if(!(N instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return N}return u}function Ho(u,o){const c=u.getParent();if(zr(c)&&!et(o)&&!An(o))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Es(u){const o=u.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let h=o.blockCursor;if(h!==void 0){if(typeof h=="string"){const y=h.split(" ");h=o.blockCursor=y}h!==void 0&&c.classList.add(...h)}return c}function Rt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function Wo(u,o,c){c.style.removeProperty("caret-color"),o._blockCursorElement=null;const h=u.parentElement;h!==null&&h.removeChild(u)}function Ni(u,o,c){let h=u._blockCursorElement;if(vt(c)&&c.isCollapsed()&&c.anchor.type==="element"&&o.contains(document.activeElement)){const y=c.anchor,N=y.getNode(),b=y.offset,$=N.getChildrenSize();let ae=!1,he=null;if(b===$){const me=N.getChildAtIndex(b-1);Rt(me)&&(ae=!0)}else{const me=N.getChildAtIndex(b);if(Rt(me)){const xe=me.getPreviousSibling();(xe===null||Rt(xe))&&(ae=!0,he=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(N.__key);h===null&&(u._blockCursorElement=h=Es(u._config)),o.style.caretColor="transparent",he===null?me.appendChild(h):me.insertBefore(h,he);return}}h!==null&&Wo(h,u,o)}function cr(u){return F?(u||window).getSelection():null}function Ra(u,o){let c=u.getChildAtIndex(o);if(c==null&&(c=u),ii(u))throw Error("Can not call $splitNode() on root element");const h=b=>{const $=b.getParentOrThrow(),ae=ii($),he=b===c&&!ae?b:Dl(b);if(ae){if(!(et(b)&&et(he)))throw Error("Children of a root must be ElementNode");return b.insertAfter(he),[b,he,he]}else{const[me,xe,we]=h($),Ce=b.getNextSiblings();return we.append(he,...Ce),[me,xe,he]}},[y,N]=h(c);return[y,N]}function Ts(u,o){let c=u;for(;c!==ir()&&c!=null;){if(o(c))return c;c=c.getParent()}return null}function ba(u){return Ko(u)&&u.tagName==="A"}function Ko(u){return u.nodeType===1}function Hi(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||ii(u))return!1;const o=u.getFirstChild(),c=o===null||li(o)||_t(o)||o.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&c}function xs(u,o){let c=u;for(;c!==null&&c.getParent()!==null&&!o(c);)c=c.getParentOrThrow();return o(c)?c:null}function La(u,o){const c=u._decorators;let y=u._pendingDecorators||c;const N=o._nodeMap;let b;for(b in y)N.has(b)||(y===c&&(y=Ro(u)),delete y[b])}function Al(u,o,c,h,y,N){let b=u.getFirstChild();for(;b!==null;){const $=b.__key;b.__parent===o&&(et(b)&&Al(b,$,c,h,y,N),c.has($)||N.delete($),y.push($)),b=b.getNextSibling()}}function Ml(u,o,c,h){const y=u._nodeMap,N=o._nodeMap,b=[];for(const[$]of h){const ae=N.get($);ae!==void 0&&(ae.isAttached()||(et(ae)&&Al(ae,$,y,N,b,h),y.has($)||h.delete($),b.push($)))}for(const $ of b)N.delete($);for(const $ of c){const ae=N.get($);ae!==void 0&&!ae.isAttached()&&(y.has($)||c.delete($),N.delete($))}}let kn="",Yn="",jt="",Cr,Wn,uo,Ia=!1,fo=!1,zo,Uo=null,Go,Rl,Wi,hn,On,Kn;function ho(u,o){const c=Wi.get(u);if(o!==null){const h=ws(u);h.parentNode===o&&o.removeChild(h)}if(hn.has(u)||Wn._keyToDOMMap.delete(u),et(c)){const h=Ei(c,Wi);Ki(h,0,h.length-1,null)}c!==void 0&&ao(Kn,uo,zo,c,"destroyed")}function Ki(u,o,c,h){let y=o;for(;y<=c;++y){const N=u[y];N!==void 0&&ho(N,h)}}function Ci(u,o){u.setProperty("text-align",o)}const go="40px";function Xn(u,o){const c=Cr.theme.indent;if(typeof c=="string"){const y=u.classList.contains(c);o>0&&!y?u.classList.add(c):o<1&&y&&u.classList.remove(c)}const h=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||go;u.style.setProperty("padding-inline-start",o===0?"":`calc(${o} * ${h})`)}function Fr(u,o){const c=u.style;o===0?Ci(c,""):o===Ue?Ci(c,"left"):o===Ge?Ci(c,"center"):o===tt?Ci(c,"right"):o===yt?Ci(c,"justify"):o===Nt?Ci(c,"start"):o===Tt&&Ci(c,"end")}function dn(u,o,c){const h=hn.get(u);if(h===void 0)throw Error("createNode: node does not exist in nodeMap");const y=h.createDOM(Cr,Wn);if(Je(u,y,Wn),_t(h)?y.setAttribute("data-lexical-text","true"):An(h)&&y.setAttribute("data-lexical-decorator","true"),et(h)){const N=h.__indent,b=h.__size;if(N!==0&&Xn(y,N),b!==0){const ae=b-1,he=Ei(h,hn);ka(he,ae,h,y)}const $=h.__format;$!==0&&Fr(y,$),h.isInline()||vs(null,h,y),_s(h)&&(kn+=Ft,jt+=Ft)}else{const N=h.getTextContent();if(An(h)){const b=h.decorate(Wn,Cr);b!==null&&Il(u,b),y.contentEditable="false"}else _t(h)&&(h.isDirectionless()||(Yn+=N));kn+=N,jt+=N}if(o!==null)if(c!=null)o.insertBefore(y,c);else{const N=o.__lexicalLineBreak;N!=null?o.insertBefore(y,N):o.appendChild(y)}return Object.freeze(h),ao(Kn,uo,zo,h,"created"),y}function ka(u,o,c,h){const y=Yn;Yn="",bl(u,c,0,o,h,null),Ll(c,h),Yn=y}function bl(u,o,c,h,y,N){const b=kn;kn="";let $=c;for(;$<=h;++$)dn(u[$],y,N);_s(o)&&(kn+=Ft),y.__lexicalTextContent=kn,kn=b+kn}function Pa(u,o){const c=o.get(u);return li(c)||An(c)&&c.isInline()}function vs(u,o,c){const h=u!==null&&(u.__size===0||Pa(u.__last,Wi)),y=o.__size===0||Pa(o.__last,hn);if(h){if(!y){const N=c.__lexicalLineBreak;N!=null&&c.removeChild(N),c.__lexicalLineBreak=null}}else if(y){const N=document.createElement("br");c.__lexicalLineBreak=N,c.appendChild(N)}}function Ll(u,o){const c=o.__lexicalDirTextContent,h=o.__lexicalDir;if(c!==Yn||h!==Uo){const y=Yn==="",N=y?Uo:In(Yn);if(N!==h){const b=o.classList,$=Cr.theme;let ae=h!==null?$[h]:void 0,he=N!==null?$[N]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=$[h]=me}b.remove(...ae)}if(N===null||y&&N==="ltr")o.removeAttribute("dir");else{if(he!==void 0){if(typeof he=="string"){const me=he.split(" ");he=$[N]=me}he!==void 0&&b.add(...he)}o.dir=N}if(!fo){const me=u.getWritable();me.__dir=N}}Uo=N,o.__lexicalDirTextContent=Yn,o.__lexicalDir=N}}function zi(u,o,c){const h=Yn;Yn="",at(u,o,c),Ll(o,c),Yn=h}function Ei(u,o){const c=[];let h=u.__first;for(;h!==null;){const y=o.get(h);if(y===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");c.push(h),h=y.__next}return c}function at(u,o,c){const h=kn,y=u.__size,N=o.__size;if(kn="",y===1&&N===1){const b=u.__first,$=o.__first;if(b===$)po(b,c);else{const ae=ws(b),he=dn($,null,null);c.replaceChild(he,ae),ho(b,null)}}else{const b=Ei(u,Wi),$=Ei(o,hn);if(y===0)N!==0&&bl($,o,0,N-1,c,null);else if(N===0){if(y!==0){const he=c.__lexicalLineBreak==null;Ki(b,0,y-1,he?null:c),he&&(c.textContent="")}}else En(o,b,$,y,N,c)}_s(o)&&(kn+=Ft),c.__lexicalTextContent=kn,kn=h+kn}function po(u,o){const c=Wi.get(u);let h=hn.get(u);if(c===void 0||h===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const y=Ia||Rl.has(u)||Go.has(u),N=Bo(Wn,u);if(c===h&&!y){if(et(c)){const b=N.__lexicalTextContent;b!==void 0&&(kn+=b,jt+=b);const $=N.__lexicalDirTextContent;$!==void 0&&(Yn+=$)}else{const b=c.getTextContent();_t(c)&&!c.isDirectionless()&&(Yn+=b),jt+=b,kn+=b}return N}if(c!==h&&y&&ao(Kn,uo,zo,h,"updated"),h.updateDOM(c,N,Cr)){const b=dn(u,null,null);if(o===null)throw Error("reconcileNode: parentDOM is null");return o.replaceChild(b,N),ho(u,null),b}if(et(c)&&et(h)){const b=h.__indent;b!==c.__indent&&Xn(N,b);const $=h.__format;$!==c.__format&&Fr(N,$),y&&(zi(c,h,N),!zr(h)&&!h.isInline()&&vs(c,h,N)),_s(h)&&(kn+=Ft,jt+=Ft)}else{const b=h.getTextContent();if(An(h)){const $=h.decorate(Wn,Cr);$!==null&&Il(u,$)}else _t(h)&&!h.isDirectionless()&&(Yn+=b);kn+=b,jt+=b}if(!fo&&zr(h)&&h.__cachedText!==jt){const b=h.getWritable();b.__cachedText=jt,h=b}return Object.freeze(h),N}function Il(u,o){let c=Wn._pendingDecorators;const h=Wn._decorators;if(c===null){if(h[u]===o)return;c=Ro(Wn)}c[u]=o}function Er(u){return u.firstChild}function Ss(u){let o=u.nextSibling;return o!==null&&o===Wn._blockCursorElement&&(o=o.nextSibling),o}function En(u,o,c,h,y,N){const b=h-1,$=y-1;let ae,he,me=Er(N),xe=0,we=0;for(;xe<=b&&we<=$;){const ze=o[xe],$e=c[we];if(ze===$e)me=Ss(po($e,N)),xe++,we++;else{ae===void 0&&(ae=new Set(o)),he===void 0&&(he=new Set(c));const Lt=he.has(ze),Qe=ae.has($e);if(!Lt)me=Ss(ws(ze)),ho(ze,N),xe++;else if(!Qe)dn($e,N,me),we++;else{const ht=Bo(Wn,$e);ht===me?me=Ss(po($e,N)):(me!=null?N.insertBefore(ht,me):N.appendChild(ht),po($e,N)),xe++,we++}}}const Ce=xe>b,Ve=we>$;if(Ce&&!Ve){const ze=c[$+1],$e=ze===void 0?null:Wn.getElementByKey(ze);bl(c,u,we,$,N,$e)}else Ve&&!Ce&&Ki(o,xe,b,N)}function Ui(u,o,c,h,y,N){kn="",jt="",Yn="",Ia=h===ct,Uo=null,Wn=c,Cr=c._config,uo=c._nodes,zo=Wn._listeners.mutation,Go=y,Rl=N,Wi=u._nodeMap,hn=o._nodeMap,fo=o._readOnly,On=new Map(c._keyToDOMMap);const b=new Map;return Kn=b,po("root",null),Wn=void 0,uo=void 0,Go=void 0,Rl=void 0,Wi=void 0,hn=void 0,Cr=void 0,On=void 0,Kn=void 0,b}function Je(u,o,c){const h=c._keyToDOMMap;o["__lexicalKey_"+c._key]=u,h.set(u,o)}function ws(u){const o=On.get(u);if(o===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return o}const ur=Object.freeze({}),or=30,kl=[["keydown",ge],["pointerdown",Bl],["compositionstart",x],["compositionend",Q],["input",C],["click",$a],["cut",ur],["copy",ur],["dragstart",ur],["dragover",ur],["dragend",ur],["paste",ur],["focus",ur],["blur",ur],["drop",ur]];ee&&kl.push(["beforeinput",(u,o)=>g(u,o)]);let Gi=0,Pl=0,Yo=0,Br=null,jo=0,Hr=!1,Os=!1,Vo=!1,qo=!1,Ds=[0,"",0,"root",0];function Yi(u,o,c,h,y){const N=u.anchor,b=u.focus,$=N.getNode(),ae=xn(),he=cr(ae._window),me=he!==null?he.anchorNode:null,xe=N.key,we=ae.getElementByKey(xe),Ce=c.length;return xe!==b.key||!_t($)||(!y&&(!ee||Yo<h+50)||$.isDirty()&&Ce<2||bo(c))&&N.offset!==b.offset&&!$.isComposing()||Un($)||$.isDirty()&&Ce>1||(y||!ee)&&we!==null&&!$.isComposing()&&me!==kr(we)||he!==null&&o!==null&&(!o.collapsed||o.startContainer!==he.anchorNode||o.startOffset!==he.anchorOffset)||$.getFormat()!==u.format||$.getStyle()!==u.style||Io(u,$)}function $l(u,o){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&o!==0&&o!==u.nodeValue.length}function Fl(u,o,c){const{anchorNode:h,anchorOffset:y,focusNode:N,focusOffset:b}=u;Hr&&(Hr=!1,$l(h,y)&&$l(N,b))||Kr(o,()=>{if(!c){Nr(null);return}if(!oo(o,h,N))return;const $=mn();if(vt($)){const ae=$.anchor,he=ae.getNode();if($.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&($.dirty=!0);const me=Ns(o).event,xe=me?me.timeStamp:performance.now(),[we,Ce,Ve,ze,$e]=Ds,Lt=ir(),Qe=o.isComposing()===!1&&Lt.getTextContent()==="";if(xe<$e+200&&ae.offset===Ve&&ae.key===ze)$.format=we,$.style=Ce;else if(ae.type==="text"){if(!_t(he))throw Error("Point.getNode() must return TextNode when type is text");$.format=he.getFormat(),$.style=he.getStyle()}else ae.type==="element"&&!Qe&&($.format=0,$.style="")}else{let me=ot,xe=!1;const we=$.getNodes(),Ce=we.length;for(let Ve=0;Ve<Ce;Ve++){const ze=we[Ve];if(_t(ze)&&(xe=!0,me&=ze.getFormat(),me===0))break}$.format=xe?me:0}}ut(o,t,void 0)})}function $a(u,o){Kr(o,()=>{const c=mn(),h=cr(o._window),y=$s();if(h){if(vt(c)){const N=c.anchor,b=N.getNode();if(N.type==="element"&&N.offset===0&&c.isCollapsed()&&!zr(b)&&ir().getChildrenSize()===1&&b.getTopLevelElementOrThrow().isEmpty()&&y!==null&&c.is(y))h.removeAllRanges(),c.dirty=!0;else if(u.detail===3&&!c.isCollapsed()){const ae=c.focus.getNode();b!==ae&&(et(b)?b.select(0):b.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const N=h.anchorNode;if(N!==null){const b=N.nodeType;if(b===ke||b===Fe){const $=Fc(y,h,o,u);Nr($)}}}}ut(o,r,u)})}function Bl(u,o){const c=u.target,h=u.pointerType;c instanceof Node&&h!=="touch"&&Kr(o,()=>{io(c)||(Os=!0)})}function s(u){if(!u.getTargetRanges)return null;const o=u.getTargetRanges();return o.length===0?null:o[0]}function i(u,o){return u!==o||et(u)||et(o)||!u.isToken()||!o.isToken()}function a(u){return Pl===229&&u<Gi+or}function g(u,o){const c=u.inputType,h=s(u);c==="deleteCompositionText"||De&&Ol(o)||c!=="insertCompositionText"&&Kr(o,()=>{const y=mn();if(c==="deleteContentBackward"){if(y===null){const me=$s();if(!vt(me))return;Nr(me.clone())}if(vt(y)){if(be&&vn(y.anchor.key),a(u.timeStamp)&&o.isComposing()&&y.anchor.key===y.focus.key){if(vn(null),Gi=0,setTimeout(()=>{Kr(o,()=>{vn(null)})},or),vt(y)){const xe=y.anchor.getNode();if(xe.markDirty(),y.format=xe.getFormat(),!_t(xe))throw Error("Anchor node must be a TextNode");y.style=xe.getStyle()}y.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),ut(o,l,!0))}else vn(null),u.preventDefault(),ut(o,l,!0);return}}if(!vt(y))return;const N=u.data;Br!==null&&Lo(!1,o,Br),(!y.dirty||Br!==null)&&y.isCollapsed()&&!zr(y.anchor.getNode())&&h!==null&&y.applyDOMRange(h),Br=null;const b=y.anchor,$=y.focus,ae=b.getNode(),he=$.getNode();if(c==="insertText"||c==="insertTranspose"){if(N===`
39
+ `)u.preventDefault(),ut(o,d,!1);else if(N===Ft)u.preventDefault(),ut(o,f,void 0);else if(N==null&&u.dataTransfer){const me=u.dataTransfer.getData("text/plain");u.preventDefault(),y.insertRawText(me)}else N!=null&&Yi(y,h,N,u.timeStamp,!0)?(u.preventDefault(),ut(o,p,N)):Br=N;Yo=u.timeStamp;return}switch(u.preventDefault(),c){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{ut(o,p,u);break}case"insertFromComposition":{vn(null),ut(o,p,u);break}case"insertLineBreak":{vn(null),ut(o,d,!1);break}case"insertParagraph":{vn(null),Vo&&!ue?(Vo=!1,ut(o,d,!1)):ut(o,f,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{ut(o,_,u);break}case"deleteByComposition":{i(ae,he)&&ut(o,T,u);break}case"deleteByDrag":case"deleteByCut":{ut(o,T,u);break}case"deleteContent":{ut(o,l,!1);break}case"deleteWordBackward":{ut(o,E,!0);break}case"deleteWordForward":{ut(o,E,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{ut(o,S,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{ut(o,S,!1);break}case"formatStrikeThrough":{ut(o,w,"strikethrough");break}case"formatBold":{ut(o,w,"bold");break}case"formatItalic":{ut(o,w,"italic");break}case"formatUnderline":{ut(o,w,"underline");break}case"historyUndo":{ut(o,M,void 0);break}case"historyRedo":{ut(o,m,void 0);break}}})}function C(u,o){u.stopPropagation(),Kr(o,()=>{const c=mn(),h=u.data,y=s(u);if(h!=null&&vt(c)&&Yi(c,y,h,u.timeStamp,!1)){qo&&(D(o,h),qo=!1);const N=c.anchor,b=N.getNode(),$=cr(o._window);if($===null)return;const ae=N.offset;(!ee||c.isCollapsed()||!_t(b)||$.anchorNode===null||b.getTextContent().slice(0,ae)+h+b.getTextContent().slice(ae+c.focus.offset)!==ps($.anchorNode))&&ut(o,p,h);const he=h.length;De&&he>1&&u.inputType==="insertCompositionText"&&!o.isComposing()&&(c.anchor.offset-=he),!ne&&!ue&&!Re&&o.isComposing()&&(Gi=0,vn(null))}else Lo(!1,o,h!==null?h:void 0),qo&&(D(o,h||void 0),qo=!1);_l()}),Br=null}function x(u,o){Kr(o,()=>{const c=mn();if(vt(c)&&!o.isComposing()){const h=c.anchor,y=c.anchor.getNode();vn(h.key),(u.timeStamp<Gi+or||h.type==="element"||!c.isCollapsed()||y.getFormat()!==c.format||_t(y)&&y.getStyle()!==c.style)&&ut(o,p,Ht)}})}function D(u,o){const c=u._compositionKey;if(vn(null),c!==null&&o!=null){if(o===""){const h=Cn(c),y=kr(u.getElementByKey(c));y!==null&&y.nodeValue!==null&&_t(h)&&Pr(h,y.nodeValue,null,null,!0);return}if(o[o.length-1]===`
40
+ `){const h=mn();if(vt(h)){const y=h.focus;h.anchor.set(y.key,y.offset,y.type),ut(u,re,null);return}}}Lo(!0,u,o)}function Q(u,o){De?qo=!0:Kr(o,()=>{D(o,u.data)})}function ge(u,o){if(Gi=u.timeStamp,Pl=u.keyCode,o.isComposing())return;const{keyCode:c,shiftKey:h,ctrlKey:y,metaKey:N,altKey:b}=u;if(!ut(o,v,u)){if(lo(c,y,b,N))ut(o,k,u);else if(Oa(c,y,h,b,N))ut(o,G,u);else if(Lc(c,y,b,N))ut(o,I,u);else if(wa(c,y,h,b,N))ut(o,P,u);else if(Ic(c,y,N))ut(o,H,u);else if(vl(c,y,N))ut(o,j,u);else if(Tl(c,h))Vo=!0,ut(o,re,u);else if(kc(c))ut(o,te,u);else if(Po(c,y))u.preventDefault(),Vo=!0,ut(o,d,!0);else if(El(c,h))Vo=!1,ut(o,re,u);else if(Ta(c,b,N,y))qr(c)?ut(o,ce,u):(u.preventDefault(),ut(o,l,!0));else if(ki(c))ut(o,V,u);else if(Dc(c,y,h,b,N))Pi(c)?ut(o,z,u):(u.preventDefault(),ut(o,l,!1));else if($o(c,b,y))u.preventDefault(),ut(o,E,!0);else if(Na(c,b,y))u.preventDefault(),ut(o,E,!1);else if(Ca(c,N))u.preventDefault(),ut(o,S,!0);else if(Ea(c,N))u.preventDefault(),ut(o,S,!1);else if(ya(c,b,N,y))u.preventDefault(),ut(o,w,"bold");else if(ko(c,b,N,y))u.preventDefault(),ut(o,w,"underline");else if(so(c,b,N,y))u.preventDefault(),ut(o,w,"italic");else if(_a(c,b,y,N))ut(o,q,u);else if(Ac(c,h,N,y))u.preventDefault(),ut(o,M,void 0);else if(xa(c,h,N,y))u.preventDefault(),ut(o,m,void 0);else{const $=o._editorState._selection;Wr($)?Mc(c,h,N,y)?(u.preventDefault(),ut(o,Y,u)):Rc(c,h,N,y)?(u.preventDefault(),ut(o,W,u)):ms(c,N,y)&&(u.preventDefault(),ut(o,J,u)):!De&&ms(c,N,y)&&(u.preventDefault(),ut(o,J,u))}Fo(y,h,b,N)&&ut(o,A,u)}}function Ae(u){let o=u.__lexicalEventHandles;return o===void 0&&(o=[],u.__lexicalEventHandles=o),o}const Ye=new Map;function Xe(u){const o=u.target,c=o==null?null:o.nodeType===9?o.defaultView:o.ownerDocument.defaultView,h=cr(c);if(h===null)return;const y=fl(h.anchorNode);if(y===null)return;Os&&(Os=!1,Kr(y,()=>{const me=$s(),xe=h.anchorNode;if(xe===null)return;const we=xe.nodeType;if(we!==ke&&we!==Fe)return;const Ce=Fc(me,h,y,u);Nr(Ce)}));const N=Ii(y),b=N[N.length-1],$=b._key,ae=Ye.get($),he=ae||b;he!==y&&Fl(h,he,!1),Fl(h,y,!0),y!==b?Ye.set($,y):ae&&Ye.delete($)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function pt(u,o){jo===0&&u.ownerDocument.addEventListener("selectionchange",Xe),jo++,u.__lexicalEditor=o;const c=Ae(u);for(let h=0;h<kl.length;h++){const[y,N]=kl[h],b=typeof N=="function"?$=>{Pe($)||(Ke($),o.isEditable()&&N($,o))}:$=>{if(!Pe($)&&(Ke($),o.isEditable()))switch(y){case"cut":return ut(o,W,$);case"copy":return ut(o,Y,$);case"paste":return ut(o,_,$);case"dragstart":return ut(o,O,$);case"dragover":return ut(o,Z,$);case"dragend":return ut(o,se,$);case"focus":return ut(o,_e,$);case"blur":return ut(o,B,$);case"drop":return ut(o,de,$)}};u.addEventListener(y,b),c.push(()=>{u.removeEventListener(y,b)})}}function Ot(u){jo!==0&&(jo--,jo===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const o=u.__lexicalEditor;o!=null&&(Bt(o),u.__lexicalEditor=null);const c=Ae(u);for(let h=0;h<c.length;h++)c[h]();u.__lexicalEventHandles=[]}function Bt(u){if(u._parentEditor!==null){const o=Ii(u),h=o[o.length-1]._key;Ye.get(h)===u&&Ye.delete(h)}else Ye.delete(u._key)}function Kt(){Hr=!0}function jn(u,o,c,h,y){Ds=[u,o,c,h,y]}function Dr(u,o,c){hr();const h=u.__key,y=u.getParent();if(y===null)return;const N=co(u);let b=!1;if(vt(N)&&o){const $=N.anchor,ae=N.focus;$.key===h&&(Ga($,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0),ae.key===h&&(Ga(ae,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0)}else Wr(N)&&o&&u.isSelected()&&u.selectPrevious();if(vt(N)&&o&&!b){const $=u.getIndexWithinParent();jr(u),Ua(N,y,$,-1)}else jr(u);!c&&!ii(y)&&!y.canBeEmpty()&&y.isEmpty()&&Dr(y,o),o&&zr(y)&&y.isEmpty()&&y.selectEnd()}class oi{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,hl(this,o),this.__type!=="root"&&(hr(),si(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let o=this.__key;for(;o!==null;){if(o==="root")return!0;const c=Cn(o);if(c===null)break;o=c.__parent}return!1}isSelected(o){const c=o||mn();if(c==null)return!1;const h=c.getNodes().some(y=>y.__key===this.__key);return _t(this)?h:vt(c)&&c.anchor.type==="element"&&c.focus.type==="element"&&c.anchor.key===c.focus.key&&c.anchor.offset===c.focus.offset?!1:h}getKey(){return this.__key}getIndexWithinParent(){const o=this.getParent();if(o===null)return-1;let c=o.getFirstChild(),h=0;for(;c!==null;){if(this.is(c))return h;h++,c=c.getNextSibling()}return-1}getParent(){const o=this.getLatest().__parent;return o===null?null:Cn(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 c=o.getParent();if(ii(c)){if(!et(o))throw Error("Children of root nodes must be elements");return o}o=c}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 c=this.getParent();for(;c!==null;)o.push(c),c=c.getParent();return o}getParentKeys(){const o=[];let c=this.getParent();for(;c!==null;)o.push(c.__key),c=c.getParent();return o}getPreviousSibling(){const c=this.getLatest().__prev;return c===null?null:Cn(c)}getPreviousSiblings(){const o=[],c=this.getParent();if(c===null)return o;let h=c.getFirstChild();for(;h!==null&&!h.is(this);)o.push(h),h=h.getNextSibling();return o}getNextSibling(){const c=this.getLatest().__next;return c===null?null:Cn(c)}getNextSiblings(){const o=[];let c=this.getNextSibling();for(;c!==null;)o.push(c),c=c.getNextSibling();return o}getCommonAncestor(o){const c=this.getParents(),h=o.getParents();et(this)&&c.unshift(this),et(o)&&h.unshift(o);const y=c.length,N=h.length;if(y===0||N===0||c[y-1]!==h[N-1])return null;const b=new Set(h);for(let $=0;$<y;$++){const ae=c[$];if(b.has(ae))return ae}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 c=this.getCommonAncestor(o);let h=0,y=0,N=this;for(;;){const b=N.getParentOrThrow();if(b===c){h=N.getIndexWithinParent();break}N=b}for(N=o;;){const b=N.getParentOrThrow();if(b===c){y=N.getIndexWithinParent();break}N=b}return h<y}isParentOf(o){const c=this.__key;if(c===o.__key)return!1;let h=o;for(;h!==null;){if(h.__key===c)return!0;h=h.getParent()}return!1}getNodesBetween(o){const c=this.isBefore(o),h=[],y=new Set;let N=this;for(;;){const b=N.__key;if(y.has(b)||(y.add(b),h.push(N)),N===o)break;const $=et(N)?c?N.getFirstChild():N.getLastChild():null;if($!==null){N=$;continue}const ae=c?N.getNextSibling():N.getPreviousSibling();if(ae!==null){N=ae;continue}const he=N.getParentOrThrow();if(y.has(he.__key)||h.push(he),he===o)break;let me=null,xe=he;do{if(xe===null)throw Error("getNodesBetween: ancestor is null");me=c?xe.getNextSibling():xe.getPreviousSibling(),xe=xe.getParent(),xe!==null&&me===null&&!y.has(xe.__key)&&h.push(xe)}while(me===null);N=me}return c||h.reverse(),h}isDirty(){const c=xn()._dirtyLeaves;return c!==null&&c.has(this.__key)}getLatest(){const o=Cn(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(){hr();const o=xi(),c=xn(),h=o._nodeMap,y=this.__key,N=this.getLatest(),b=N.__parent,$=c._cloneNotNeeded,ae=mn();if(dr(ae)&&ae.setCachedNodes(null),$.has(y))return Ri(N),N;const me=N.constructor.clone(N);return me.__parent=b,me.__next=N.__next,me.__prev=N.__prev,et(N)&&et(me)?(me.__first=N.__first,me.__last=N.__last,me.__size=N.__size,me.__indent=N.__indent,me.__format=N.__format,me.__dir=N.__dir):_t(N)&&_t(me)&&(me.__format=N.__format,me.__style=N.__style,me.__mode=N.__mode,me.__detail=N.__detail),$.add(y),me.__key=y,Ri(me),h.set(y,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(o,c){throw Error("createDOM: base method not extended")}updateDOM(o,c,h){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){Dr(this,!0,o)}replace(o,c){hr();let h=mn();h!==null&&(h=h.clone()),Ho(this,o);const y=this.getLatest(),N=this.__key,b=o.__key,$=o.getWritable(),ae=this.getParentOrThrow().getWritable(),he=ae.__size;jr($);const me=y.getPreviousSibling(),xe=y.getNextSibling(),we=y.__prev,Ce=y.__next,Ve=y.__parent;if(Dr(y,!1,!0),me===null)ae.__first=b;else{const ze=me.getWritable();ze.__next=b}if($.__prev=we,xe===null)ae.__last=b;else{const ze=xe.getWritable();ze.__prev=b}if($.__next=Ce,$.__parent=Ve,ae.__size=he,c){if(!(et(this)&&et($)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(ze=>{$.append(ze)})}if(vt(h)){Nr(h);const ze=h.anchor,$e=h.focus;ze.key===N&&pn(ze,$),$e.key===N&&pn($e,$)}return ar()===N&&vn(b),$}insertAfter(o,c=!0){hr(),Ho(this,o);const h=this.getWritable(),y=o.getWritable(),N=y.getParent(),b=mn();let $=!1,ae=!1;if(N!==null){const Ce=o.getIndexWithinParent();if(jr(y),vt(b)){const Ve=N.__key,ze=b.anchor,$e=b.focus;$=ze.type==="element"&&ze.key===Ve&&ze.offset===Ce+1,ae=$e.type==="element"&&$e.key===Ve&&$e.offset===Ce+1}}const he=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),xe=y.__key,we=h.__next;if(he===null)me.__last=xe;else{const Ce=he.getWritable();Ce.__prev=xe}if(me.__size++,h.__next=xe,y.__next=we,y.__prev=h.__key,y.__parent=h.__parent,c&&vt(b)){const Ce=this.getIndexWithinParent();Ua(b,me,Ce+1);const Ve=me.__key;$&&b.anchor.set(Ve,Ce+2,"element"),ae&&b.focus.set(Ve,Ce+2,"element")}return o}insertBefore(o,c=!0){hr(),Ho(this,o);const h=this.getWritable(),y=o.getWritable(),N=y.__key;jr(y);const b=this.getPreviousSibling(),$=this.getParentOrThrow().getWritable(),ae=h.__prev,he=this.getIndexWithinParent();if(b===null)$.__first=N;else{const xe=b.getWritable();xe.__next=N}$.__size++,h.__prev=N,y.__prev=ae,y.__next=h.__key,y.__parent=h.__parent;const me=mn();if(c&&vt(me)){const xe=this.getParentOrThrow();Ua(me,xe,he)}return o}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(o,c){hr();const h=this.getPreviousSibling(),y=this.getParentOrThrow();if(h===null)return y.select(0,0);if(et(h))return h.select();if(!_t(h)){const N=h.getIndexWithinParent()+1;return y.select(N,N)}return h.select(o,c)}selectNext(o,c){hr();const h=this.getNextSibling(),y=this.getParentOrThrow();if(h===null)return y.select();if(et(h))return h.select(0,0);if(!_t(h)){const N=h.getIndexWithinParent();return y.select(N,N)}return h.select(o,c)}markDirty(){this.getWritable()}}function si(u,o){const c=xn()._nodes.get(u);if(c===void 0)throw Error(`Create node: Attempted to create node ${o.name} that was not configured to be used on the editor.`);const h=c.klass;if(h!==o)throw Error(`Create node: Type ${u} in node ${o.name} does not match registered node ${h.name} with the same type`)}function Hl(u,o,c){const h=o.getParentOrThrow().getLastChild();let y=o;const N=[o];for(;y!==h;){if(!y.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");y=y.getNextSibling(),N.push(y)}let b=u;for(const $ of N)b=b.insertAfter($)}class ji extends oi{static getType(){return"linebreak"}static clone(o){return new ji(o.__key)}constructor(o){super(o)}getTextContent(){return`
41
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:o=>{const c=o.parentElement;let h,y;return c!==null&&((h=c.firstChild)===o||h.nextSibling===o&&h.nodeType===Fe&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((y=c.lastChild)===o||y.previousSibling===o&&y.nodeType===Fe&&(y.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:As,priority:0}}}}static importJSON(o){return mo()}exportJSON(){return{type:"linebreak",version:1}}}function As(u){return{node:mo()}}function mo(){return Or(new ji)}function li(u){return u instanceof ji}function Ar(u,o){return o&Le?"code":o&it?"mark":o&Me?"sub":o&je?"sup":null}function Vi(u,o){return o&Oe?"strong":o&ie?"em":"span"}function Ms(u,o,c,h,y){const N=h.classList;let b=$i(y,"base");b!==void 0&&N.add(...b),b=$i(y,"underlineStrikethrough");let $=!1;const ae=o&ve&&o&le,he=c&ve&&c&le;b!==void 0&&(he?($=!0,ae||N.add(...b)):ae&&N.remove(...b));for(const me in Qt){const we=Qt[me];if(b=$i(y,me),b!==void 0)if(c&we){if($&&(me==="underline"||me==="strikethrough")){o&we&&N.remove(...b);continue}(!(o&we)||ae&&me==="underline"||me==="strikethrough")&&N.add(...b)}else o&we&&N.remove(...b)}}function Fa(u,o){const c=u.length,h=o.length;let y=0,N=0;for(;y<c&&y<h&&u[y]===o[y];)y++;for(;N+y<c&&N+y<h&&u[c-N-1]===o[h-N-1];)N++;return[y,c-y-N,o.slice(y,h-N)]}function Ba(u,o,c){const h=o.firstChild,y=c.isComposing(),b=u+(y?mt:"");if(h==null)o.textContent=b;else{const $=h.nodeValue;if($!==b)if(y||De){const[ae,he,me]=Fa($,b);he!==0&&h.deleteData(ae,he),h.insertData(ae,me)}else h.nodeValue=b}}function Wl(u,o,c,h,y,N){Ba(y,u,o);const $=N.theme.text;$!==void 0&&Ms(c,0,h,u,$)}function Zo(u,o){const c=document.createElement(o);return c.appendChild(u),c}class Zr extends oi{static getType(){return"text"}static clone(o){return new Zr(o.__text,o.__key)}constructor(o,c){super(c),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 Ze[o.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===zt}isComposing(){return this.__key===ar()}isSegmented(){return this.getLatest().__mode===Vt}isDirectionless(){return(this.getLatest().__detail&st)!==0}isUnmergeable(){return(this.getLatest().__detail&wt)!==0}hasFormat(o){const c=Qt[o];return(this.getFormat()&c)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(o,c){const y=this.getLatest().__format;return Hn(y,o,c)}createDOM(o,c){const h=this.__format,y=Ar(this,h),N=Vi(this,h),b=y===null?N:y,$=document.createElement(b);let ae=$;this.hasFormat("code")&&$.setAttribute("spellcheck","false"),y!==null&&(ae=document.createElement(N),$.appendChild(ae));const he=this.__text;Wl(ae,this,N,h,he,o);const me=this.__style;return me!==""&&($.style.cssText=me),$}updateDOM(o,c,h){const y=this.__text,N=o.__format,b=this.__format,$=Ar(this,N),ae=Ar(this,b),he=Vi(this,N),me=Vi(this,b);if(($===null?he:$)!==(ae===null?me:ae))return!0;if($===ae&&he!==me){const Qe=c.firstChild;if(Qe==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const ht=document.createElement(me);return Wl(ht,this,me,b,y,h),c.replaceChild(ht,Qe),!1}let Ce=c;if(ae!==null&&$!==null&&(Ce=c.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");Ba(y,Ce,this);const ze=h.theme.text;ze!==void 0&&N!==b&&Ms(me,N,b,Ce,ze);const $e=o.__style,Lt=this.__style;return $e!==Lt&&(c.style.cssText=Lt),!1}static importDOM(){return{"#text":()=>({conversion:bs,priority:0}),b:()=>({conversion:Kl,priority:0}),code:()=>({conversion:Jr,priority:0}),em:()=>({conversion:Jr,priority:0}),i:()=>({conversion:Jr,priority:0}),s:()=>({conversion:Jr,priority:0}),span:()=>({conversion:Ha,priority:0}),strong:()=>({conversion:Jr,priority:0}),sub:()=>({conversion:Jr,priority:0}),sup:()=>({conversion:Jr,priority:0}),u:()=>({conversion:Jr,priority:0})}}static importJSON(o){const c=Dn(o.text);return c.setFormat(o.format),c.setDetail(o.detail),c.setMode(o.mode),c.setStyle(o.style),c}exportDOM(o){let{element:c}=super.exportDOM(o);if(!(c!==null&&Ko(c)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return c.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(c=Zo(c,"b")),this.hasFormat("italic")&&(c=Zo(c,"i")),this.hasFormat("strikethrough")&&(c=Zo(c,"s")),this.hasFormat("underline")&&(c=Zo(c,"u")),{element:c}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(o,c){}setFormat(o){const c=this.getWritable();return c.__format=typeof o=="string"?Qt[o]:o,c}setDetail(o){const c=this.getWritable();return c.__detail=typeof o=="string"?wr[o]:o,c}setStyle(o){const c=this.getWritable();return c.__style=o,c}toggleFormat(o){const c=this.getFormat(),h=Hn(c,o,null);return this.setFormat(h)}toggleDirectionless(){const o=this.getWritable();return o.__detail^=st,o}toggleUnmergeable(){const o=this.getWritable();return o.__detail^=wt,o}setMode(o){const c=pe[o];if(this.__mode===c)return this;const h=this.getWritable();return h.__mode=c,h}setTextContent(o){if(this.__text===o)return this;const c=this.getWritable();return c.__text=o,c}select(o,c){hr();let h=o,y=c;const N=mn(),b=this.getTextContent(),$=this.__key;if(typeof b=="string"){const ae=b.length;h===void 0&&(h=ae),y===void 0&&(y=ae)}else h=0,y=0;if(vt(N)){const ae=ar();(ae===N.anchor.key||ae===N.focus.key)&&vn($),N.setTextNodeRange(this,h,this,y)}else return Yd($,h,$,y,"text","text");return N}selectStart(){return this.select(0,0)}selectEnd(){const o=this.getTextContentSize();return this.select(o,o)}spliceText(o,c,h,y){const N=this.getWritable(),b=N.__text,$=h.length;let ae=o;ae<0&&(ae=$+ae,ae<0&&(ae=0));const he=mn();if(y&&vt(he)){const xe=o+$;he.setTextNodeRange(N,xe,N,xe)}const me=b.slice(0,ae)+h+b.slice(ae+c);return N.__text=me,N}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...o){hr();const c=this.getLatest(),h=c.getTextContent(),y=c.__key,N=ar(),b=new Set(o),$=[],ae=h.length;let he="";for(let ln=0;ln<ae;ln++)he!==""&&b.has(ln)&&($.push(he),he=""),he+=h[ln];he!==""&&$.push(he);const me=$.length;if(me===0)return[];if($[0]===h)return[c];const xe=$[0],we=c.getParentOrThrow();let Ce;const Ve=c.getFormat(),ze=c.getStyle(),$e=c.__detail;let Lt=!1;c.isSegmented()?(Ce=Dn(xe),Ce.__format=Ve,Ce.__style=ze,Ce.__detail=$e,Lt=!0):(Ce=c.getWritable(),Ce.__text=xe);const Qe=mn(),ht=[Ce];let qt=xe.length;for(let ln=1;ln<me;ln++){const lr=$[ln],_o=lr.length,gr=Dn(lr).getWritable();gr.__format=Ve,gr.__style=ze,gr.__detail=$e;const nn=gr.__key,Pn=qt+_o;if(vt(Qe)){const ci=Qe.anchor,Zi=Qe.focus;ci.key===y&&ci.type==="text"&&ci.offset>qt&&ci.offset<=Pn&&(ci.key=nn,ci.offset-=qt,Qe.dirty=!0),Zi.key===y&&Zi.type==="text"&&Zi.offset>qt&&Zi.offset<=Pn&&(Zi.key=nn,Zi.offset-=qt,Qe.dirty=!0)}N===y&&vn(nn),qt=Pn,ht.push(gr)}pl(this);const Wt=we.getWritable(),At=this.getIndexWithinParent();return Lt?(Wt.splice(At,0,ht),this.remove()):Wt.splice(At,1,ht),vt(Qe)&&Ua(Qe,we,At,me-1),ht}mergeWithSibling(o){const c=o===this.getPreviousSibling();if(!c&&o!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const h=this.__key,y=o.__key,N=this.__text,b=N.length;ar()===y&&vn(h);const ae=mn();if(vt(ae)){const we=ae.anchor,Ce=ae.focus;we!==null&&we.key===y&&(Vd(we,c,h,o,b),ae.dirty=!0),Ce!==null&&Ce.key===y&&(Vd(Ce,c,h,o,b),ae.dirty=!0)}const he=o.__text,me=c?he+N:N+he;this.setTextContent(me);const xe=this.getWritable();return o.remove(),xe}isTextEntity(){return!1}}function Ha(u){const o=u,c=o.style.fontWeight==="700",h=o.style.textDecoration==="line-through",y=o.style.fontStyle==="italic",N=o.style.textDecoration==="underline",b=o.style.verticalAlign;return{forChild:$=>(_t($)&&(c&&$.toggleFormat("bold"),h&&$.toggleFormat("strikethrough"),y&&$.toggleFormat("italic"),N&&$.toggleFormat("underline"),b==="sub"&&$.toggleFormat("subscript"),b==="super"&&$.toggleFormat("superscript")),$),node:null}}function Kl(u){const c=u.style.fontWeight==="normal";return{forChild:h=>(_t(h)&&!c&&h.toggleFormat("bold"),h),node:null}}const Rs=new WeakMap;function Wa(u){return u.nodeName==="PRE"||u.nodeType===ke&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function Jo(u){let o,c=u.parentNode;const h=[u];for(;c!==null&&(o=Rs.get(c))===void 0&&!Wa(c);)h.push(c),c=c.parentNode;const y=o===void 0?c:o;for(let N=0;N<h.length;N++)Rs.set(h[N],y);return y}function bs(u){const o=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let h=o.textContent||"";if(Jo(o)!==null){const y=h.split(/(\r?\n|\t)/),N=[],b=y.length;for(let $=0;$<b;$++){const ae=y[$];ae===`
42
+ `||ae===`\r
43
+ `?N.push(mo()):ae===" "?N.push(Ls()):ae!==""&&N.push(Dn(ae))}return{node:N}}if(h=h.replace(/\r/g,"").replace(/[ \t\n]+/g," "),h==="")return{node:null};if(h[0]===" "){let y=o,N=!0;for(;y!==null&&(y=Ka(y,!1))!==null;){const b=y.textContent||"";if(b.length>0){/[ \t\n]$/.test(b)&&(h=h.slice(1)),N=!1;break}}N&&(h=h.slice(1))}if(h[h.length-1]===" "){let y=o,N=!0;for(;y!==null&&(y=Ka(y,!0))!==null;)if((y.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){N=!1;break}N&&(h=h.slice(0,h.length-1))}return h===""?{node:null}:{node:Dn(h)}}const zl=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 Ka(u,o){let c=u;for(;;){let h;for(;(h=o?c.nextSibling:c.previousSibling)===null;){const N=c.parentElement;if(N===null)return null;c=N}if(c=h,c.nodeType===ke){const N=c.style.display;if(N===""&&c.nodeName.match(zl)===null||N!==""&&!N.startsWith("inline"))return null}let y=c;for(;(y=o?c.firstChild:c.lastChild)!==null;)c=y;if(c.nodeType===Fe)return c;if(c.nodeName==="BR")return null}}const Ul={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Jr(u){const o=Ul[u.nodeName.toLowerCase()];return o===void 0?{node:null}:{forChild:c=>(_t(c)&&!c.hasFormat(o)&&c.toggleFormat(o),c),node:null}}function Dn(u=""){return Or(new Zr(u))}function _t(u){return u instanceof Zr}class Tr extends Zr{static getType(){return"tab"}static clone(o){const c=new Tr(o.__key);return c.__text=o.__text,c.__format=o.__format,c.__style=o.__style,c}constructor(o){super(" ",o),this.__detail=wt}static importDOM(){return null}static importJSON(o){const c=Ls();return c.setFormat(o.format),c.setStyle(o.style),c}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 Ls(){return Or(new Tr)}function Is(u){return u instanceof Tr}class Pc{constructor(o,c,h){this._selection=null,this.key=o,this.offset=c,this.type=h}is(o){return this.key===o.key&&this.offset===o.offset&&this.type===o.type}isBefore(o){let c=this.getNode(),h=o.getNode();const y=this.offset,N=o.offset;if(et(c)){const b=c.getDescendantByIndex(y);c=b??c}if(et(h)){const b=h.getDescendantByIndex(N);h=b??h}return c===h?y<N:c.isBefore(h)}getNode(){const o=this.key,c=Cn(o);if(c===null)throw Error("Point.getNode: node not found");return c}set(o,c,h){const y=this._selection,N=this.key;this.key=o,this.offset=c,this.type=h,Fs()||(ar()===N&&vn(o),y!==null&&(y.setCachedNodes(null),y.dirty=!0))}}function Mr(u,o,c){return new Pc(u,o,c)}function ks(u,o){let c=o.__key,h=u.offset,y="element";if(_t(o)){y="text";const N=o.getTextContentSize();h>N&&(h=N)}else if(!et(o)){const N=o.getNextSibling();if(_t(N))c=N.__key,h=0,y="text";else{const b=o.getParent();b&&(c=b.__key,h=o.getIndexWithinParent()+1)}}u.set(c,h,y)}function pn(u,o){if(et(o)){const c=o.getLastDescendant();et(c)||_t(c)?ks(u,c):ks(u,o)}else ks(u,o)}function Qn(u,o,c,h){const y=u.getNode(),N=y.getChildAtIndex(u.offset),b=Dn(),$=zr(y)?qi().append(b):b;b.setFormat(c),b.setStyle(h),N===null?y.append($):N.insertBefore($),u.is(o)&&o.set(b.__key,0,"text"),u.set(b.__key,0,"text")}function Tn(u,o,c,h){u.key=o,u.offset=c,u.type=h}class Rr{constructor(o,c){this.anchor=o,this.focus=c,o._selection=this,c._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){return dr(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 ai(this)}}class Ti{constructor(o){this.dirty=!1,this._nodes=o,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(o){this._cachedNodes=o}is(o){if(!Wr(o))return!1;const c=this._nodes,h=o._nodes;return c.size===h.size&&Array.from(c).every(y=>h.has(y))}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 Ti(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(o){}insertText(){}insertNodes(o){const c=this.getNodes(),h=c.length,y=c[h-1];let N;if(_t(y))N=y.select();else{const b=y.getIndexWithinParent()+1;N=y.getParentOrThrow().select(b,b)}N.insertNodes(o);for(let b=0;b<h;b++)c[b].remove()}getNodes(){const o=this._cachedNodes;if(o!==null)return o;const c=this._nodes,h=[];for(const y of c){const N=Cn(y);N!==null&&h.push(N)}return Fs()||(this._cachedNodes=h),h}getTextContent(){const o=this.getNodes();let c="";for(let h=0;h<o.length;h++)c+=o[h].getTextContent();return c}}function vt(u){return u instanceof sr}function dr(u){return u instanceof Rr}function br(u){const[o,,c]=qd(u),h=c.getChildren(),y=h.length,N=h[0].getChildren().length,b=new Array(y);for(let $=0;$<y;$++)b[$]=new Array(N);for(let $=0;$<y;$++){const he=h[$].getChildren();let me=0;for(let xe=0;xe<he.length;xe++){for(;b[$][me];)me++;const we=he[xe],Ce=we.__rowSpan||1,Ve=we.__colSpan||1;for(let ze=0;ze<Ce;ze++)for(let $e=0;$e<Ve;$e++)b[$+ze][me+$e]=we;if(o===we)return{colSpan:Ve,columnIndex:me,rowIndex:$,rowSpan:Ce};me+=Ve}}return null}class sr extends Rr{constructor(o,c,h,y){super(o,c),this.format=h,this.style=y}is(o){return vt(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 c=this.anchor,h=this.focus,y=c.isBefore(h),N=y?c:h,b=y?h:c;let $=N.getNode(),ae=b.getNode();const he=N.offset,me=b.offset;if(et($)){const we=$.getDescendantByIndex(he);$=we??$}if(et(ae)){let we=ae.getDescendantByIndex(me);we!==null&&we!==$&&ae.getChildAtIndex(me)===we&&(we=we.getPreviousSibling()),ae=we??ae}let xe;return $.is(ae)?et($)&&$.getChildrenSize()>0?xe=[]:xe=[$]:xe=$.getNodesBetween(ae),Fs()||(this._cachedNodes=xe),xe}setTextNodeRange(o,c,h,y){Tn(this.anchor,o.__key,c,"text"),Tn(this.focus,h.__key,y,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const o=this.getNodes();if(o.length===0)return"";const c=o[0],h=o[o.length-1],y=this.anchor,N=this.focus,b=y.isBefore(N),[$,ae]=ai(this);let he="",me=!0;for(let xe=0;xe<o.length;xe++){const we=o[xe];if(et(we)&&!we.isInline())me||(he+=`
44
+ `),we.isEmpty()?me=!1:me=!0;else if(me=!1,_t(we)){let Ce=we.getTextContent();we===c?we===h?(y.type!=="element"||N.type!=="element"||N.offset===y.offset)&&(Ce=$<ae?Ce.slice($,ae):Ce.slice(ae,$)):Ce=b?Ce.slice($):Ce.slice(ae):we===h&&(Ce=b?Ce.slice(0,ae):Ce.slice(0,$)),he+=Ce}else(An(we)||li(we))&&(we!==h||!this.isCollapsed())&&(he+=we.getTextContent())}return he}applyDOMRange(o){const c=xn(),y=c.getEditorState()._selection,N=Gd(o.startContainer,o.startOffset,o.endContainer,o.endOffset,c,y);if(N===null)return;const[b,$]=N;Tn(this.anchor,b.key,b.offset,b.type),Tn(this.focus,$.key,$.offset,$.type),this._cachedNodes=null}clone(){const o=this.anchor,c=this.focus;return new sr(Mr(o.key,o.offset,o.type),Mr(c.key,c.offset,c.type),this.format,this.style)}toggleFormat(o){this.format=Hn(this.format,o,null),this.dirty=!0}setStyle(o){this.style=o,this.dirty=!0}hasFormat(o){const c=Qt[o];return(this.format&c)!==0}insertRawText(o){const c=o.split(/(\r?\n|\t)/),h=[],y=c.length;for(let N=0;N<y;N++){const b=c[N];b===`
45
+ `||b===`\r
46
+ `?h.push(mo()):b===" "?h.push(Ls()):h.push(Dn(b))}this.insertNodes(h)}insertText(o){const c=this.anchor,h=this.focus,y=this.isCollapsed()||c.isBefore(h),N=this.format,b=this.style;y&&c.type==="element"?Qn(c,h,N,b):!y&&h.type==="element"&&Qn(h,c,N,b);const $=this.getNodes(),ae=$.length,he=y?c:h,me=y?h:c,xe=he.offset,we=me.offset;let Ce=$[0];if(!_t(Ce))throw Error("insertText: first node is not a text node");const ze=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Lt=ae-1;let Qe=$[Lt];if(this.isCollapsed()&&xe===ze&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ht=Ce.getNextSibling();if((!_t(ht)||!ht.canInsertTextBefore()||Un(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextAfter()?Ce.insertAfter(ht):$e.insertAfter(ht)),ht.select(0,0),Ce=ht,o!==""){this.insertText(o);return}}else if(this.isCollapsed()&&xe===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ht=Ce.getPreviousSibling();if((!_t(ht)||Un(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextBefore()?Ce.insertBefore(ht):$e.insertBefore(ht)),ht.select(),Ce=ht,o!==""){this.insertText(o);return}}else if(Ce.isSegmented()&&xe!==ze){const ht=Dn(Ce.getTextContent());ht.setFormat(N),Ce.replace(ht),Ce=ht}else if(!this.isCollapsed()&&o!==""){const ht=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ht)&&(!ht.canInsertTextBefore()||!ht.canInsertTextAfter())){this.insertText(""),Ud(this.anchor,this.focus,null),this.insertText(o);return}}if(ae===1){if(Ce.isToken()){const At=Dn(o);At.select(),Ce.replace(At);return}const ht=Ce.getFormat(),qt=Ce.getStyle();if(xe===we&&(ht!==N||qt!==b))if(Ce.getTextContent()==="")Ce.setFormat(N),Ce.setStyle(b);else{const At=Dn(o);if(At.setFormat(N),At.setStyle(b),At.select(),xe===0)Ce.insertBefore(At,!1);else{const[ln]=Ce.splitText(xe);ln.insertAfter(At,!1)}At.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);return}else if(Is(Ce)){const At=Dn(o);At.setFormat(N),At.setStyle(b),At.select(),Ce.replace(At);return}const Wt=we-xe;Ce=Ce.spliceText(xe,Wt,o,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=o.length:(this.format=ht,this.style=qt))}else{const ht=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),qt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),At=Qe;if(!qt.is(Wt)&&Wt.isInline())do At=Wt,Wt=Wt.getParentOrThrow();while(Wt.isInline());if(me.type==="text"&&(we!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<we)if(_t(Qe)&&!Qe.isToken()&&we!==Qe.getTextContentSize()){if(Qe.isSegmented()){const nn=Dn(Qe.getTextContent());Qe.replace(nn),Qe=nn}!zr(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,we,"")),ht.add(Qe.__key)}else{const nn=Qe.getParentOrThrow();!nn.canBeEmpty()&&nn.getChildrenSize()===1?nn.remove():Qe.remove()}else ht.add(Qe.__key);const ln=Wt.getChildren(),lr=new Set($),_o=qt.is(Wt),gr=qt.isInline()&&Ce.getNextSibling()===null?qt:Ce;for(let nn=ln.length-1;nn>=0;nn--){const Pn=ln[nn];if(Pn.is(Ce)||et(Pn)&&Pn.isParentOf(Ce))break;Pn.isAttached()&&(!lr.has(Pn)||Pn.is(At)?_o||gr.insertAfter(Pn,!1):Pn.remove())}if(!_o){let nn=Wt,Pn=null;for(;nn!==null;){const ci=nn.getChildren(),Zi=ci.length;(Zi===0||ci[Zi-1].is(Pn))&&(ht.delete(nn.__key),Pn=nn),nn=nn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(xe,ze-xe,o,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=o.length);else if(xe===ze)Ce.select();else{const nn=Dn(o);nn.select(),Ce.replace(nn)}for(let nn=1;nn<ae;nn++){const Pn=$[nn],ci=Pn.__key;ht.has(ci)||Pn.remove()}}}removeText(){this.insertText("")}formatText(o){if(this.isCollapsed()){this.toggleFormat(o),vn(null);return}const c=this.getNodes(),h=[];for(const Qe of c)_t(Qe)&&h.push(Qe);const y=h.length;if(y===0){this.toggleFormat(o),vn(null);return}const N=this.anchor,b=this.focus,$=this.isBackward(),ae=$?b:N,he=$?N:b;let me=0,xe=h[0],we=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&we===xe.getTextContentSize()&&(me=1,xe=h[1],we=0),xe==null)return;const Ce=xe.getFormatFlags(o,null),Ve=y-1;let ze=h[Ve];const $e=he.type==="text"?he.offset:ze.getTextContentSize();if(xe.is(ze)){if(we===$e)return;if(we===0&&$e===xe.getTextContentSize())xe.setFormat(Ce);else{const Qe=xe.splitText(we,$e),ht=we===0?Qe[0]:Qe[1];ht.setFormat(Ce),ae.type==="text"&&ae.set(ht.__key,0,"text"),he.type==="text"&&he.set(ht.__key,$e-we,"text")}this.format=Ce;return}we!==0&&([,xe]=xe.splitText(we),we=0),xe.setFormat(Ce);const Lt=ze.getFormatFlags(o,Ce);$e>0&&($e!==ze.getTextContentSize()&&([ze]=ze.splitText($e)),ze.setFormat(Lt));for(let Qe=me+1;Qe<Ve;Qe++){const ht=h[Qe];if(!ht.isToken()){const qt=ht.getFormatFlags(o,Lt);ht.setFormat(qt)}}ae.type==="text"&&ae.set(xe.__key,we,"text"),he.type==="text"&&he.set(ze.__key,$e,"text"),this.format=Ce|Lt}insertNodes(o){if(o.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const $e=mn();if(!vt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(o)}const c=xs(this.anchor.getNode(),Hi),h=o[o.length-1];if("__language"in c&&et(c)){if("__language"in o[0])this.insertText(o[0].getTextContent());else{const $e=Bc(this);c.splice($e,0,o),h.selectEnd()}return}const y=$e=>(et($e)||An($e))&&!$e.isInline();if(!o.some(y)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Bc(this);c.splice($e,0,o),h.selectEnd();return}const N=M_(o),b=N.getLastDescendant(),$=N.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,he=$e=>et($e)&&Hi($e)&&!$e.isEmpty()&&et(c)&&(!c.isEmpty()||ae(c)),xe=!et(c)||!c.isEmpty()?this.insertParagraph():null,we=$[$.length-1];let Ce=$[0];if(he(Ce)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");c.append(...Ce.getChildren()),Ce=$[1]}Ce&&Hl(c,Ce);const Ve=xs(b,Hi);xe&&et(Ve)&&(ae(xe)||Hi(we))&&(Ve.append(...xe.getChildren()),xe.remove()),et(c)&&c.isEmpty()&&c.remove(),b.selectEnd();const ze=et(c)?c.getLastChild():null;li(ze)&&Ve!==c&&ze.remove()}insertParagraph(){if(this.anchor.key==="root"){const b=qi();return ir().splice(this.anchor.offset,0,[b]),b.select(),b}const o=Bc(this),c=xs(this.anchor.getNode(),Hi);if(!et(c))throw Error("Expected ancestor to be an ElementNode");const h=c.getChildAtIndex(o),y=h?[h,...h.getNextSiblings()]:[],N=c.insertNewAfter(this,!1);return N?(N.append(...y),N.selectStart(),N):null}insertLineBreak(o){const c=mo();if(this.insertNodes([c]),o){const h=c.getParentOrThrow(),y=c.getIndexWithinParent();h.select(y,y)}}extract(){const o=this.getNodes(),c=o.length,h=c-1,y=this.anchor,N=this.focus;let b=o[0],$=o[h];const[ae,he]=ai(this);if(c===0)return[];if(c===1){if(_t(b)&&!this.isCollapsed()){const xe=ae>he?he:ae,we=ae>he?ae:he,Ce=b.splitText(xe,we),Ve=xe===0?Ce[0]:Ce[1];return Ve!=null?[Ve]:[]}return[b]}const me=y.isBefore(N);if(_t(b)){const xe=me?ae:he;xe===b.getTextContentSize()?o.shift():xe!==0&&([,b]=b.splitText(xe),o[0]=b)}if(_t($)){const we=$.getTextContent().length,Ce=me?he:ae;Ce===0?o.pop():Ce!==we&&([$]=$.splitText(Ce),o[h]=$)}return o}modify(o,c,h){const y=this.focus,N=this.anchor,b=o==="move",$=wl(y,c);if(An($)&&!$.isIsolated()){if(b&&$.isKeyboardSelectable()){const Ce=$c();Ce.add($.__key),Nr(Ce);return}const we=c?$.getPreviousSibling():$.getNextSibling();if(_t(we)){const Ce=we.__key,Ve=c?we.getTextContent().length:0;y.set(Ce,Ve,"text"),b&&N.set(Ce,Ve,"text");return}else{const Ce=$.getParentOrThrow();let Ve,ze;et(we)?(ze=we.__key,Ve=c?we.getChildrenSize():0):(Ve=$.getIndexWithinParent(),ze=Ce.__key,c||Ve++),y.set(ze,Ve,"element"),b&&N.set(ze,Ve,"element");return}}const ae=xn(),he=cr(ae._window);if(!he)return;const me=ae._blockCursorElement,xe=ae._rootElement;if(xe!==null&&me!==null&&et($)&&!$.isInline()&&!$.canBeEmpty()&&Wo(me,ae,xe),za(he,o,c?"backward":"forward",h),he.rangeCount>0){const we=he.getRangeAt(0),Ce=this.anchor.getNode(),Ve=zr(Ce)?Ce:Cs(Ce);if(this.applyDOMRange(we),this.dirty=!0,!b){const ze=this.getNodes(),$e=[];let Lt=!1;for(let Qe=0;Qe<ze.length;Qe++){const ht=ze[Qe];Bi(ht,Ve)?$e.push(ht):Lt=!0}if(Lt&&$e.length>0)if(c){const Qe=$e[0];et(Qe)?Qe.selectStart():Qe.getParentOrThrow().selectStart()}else{const Qe=$e[$e.length-1];et(Qe)?Qe.selectEnd():Qe.getParentOrThrow().selectEnd()}(he.anchorNode!==we.startContainer||he.anchorOffset!==we.startOffset)&&Ps(this)}}}deleteCharacter(o){const c=this.isCollapsed();if(this.isCollapsed()){const h=this.anchor,y=this.focus;let N=h.getNode();if(!o&&(h.type==="element"&&et(N)&&h.offset===N.getChildrenSize()||h.type==="text"&&h.offset===N.getTextContentSize())){const $=N.getParent(),ae=N.getNextSibling()||($===null?null:$.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const b=wl(y,o);if(An(b)&&!b.isIsolated()){if(b.isKeyboardSelectable()&&et(N)&&N.getChildrenSize()===0){N.remove();const $=$c();$.add(b.__key),Nr($)}else b.remove(),xn().dispatchCommand(t,void 0);return}else if(!o&&et(b)&&et(N)&&N.isEmpty()){N.remove(),b.selectStart();return}if(this.modify("extend",o,"character"),this.isCollapsed()){if(o&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const $=y.type==="text"?y.getNode():null;if(N=h.type==="text"?h.getNode():null,$!==null&&$.isSegmented()){const ae=y.offset,he=$.getTextContentSize();if($.is(N)||o&&ae!==he||!o&&ae!==0){Wd($,o,ae);return}}else if(N!==null&&N.isSegmented()){const ae=h.offset,he=N.getTextContentSize();if(N.is($)||o&&ae!==0||!o&&ae!==he){Wd(N,o,ae);return}}N_(this,o)}}if(this.removeText(),o&&!c&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const h=this.anchor.getNode();h.isEmpty()&&zr(h.getParent())&&h.getIndexWithinParent()===0&&h.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 Wr(u){return u instanceof Ti}function fr(u){const o=u.offset;if(u.type==="text")return o;const c=u.getNode();return o===c.getChildrenSize()?c.getTextContent().length:0}function ai(u){const o=u.anchor,c=u.focus;return o.type==="element"&&c.type==="element"&&o.key===c.key&&o.offset===c.offset?[0,0]:[fr(o),fr(c)]}function Ps(u){const o=u.focus,c=u.anchor,h=c.key,y=c.offset,N=c.type;Tn(c,o.key,o.offset,o.type),Tn(o,h,y,N),u._cachedNodes=null}function za(u,o,c,h){u.modify(o,c,h)}function N_(u,o){const c=u.anchor,h=u.focus,y=c.getNode(),N=h.getNode();if(y===N&&c.type==="text"&&h.type==="text"){const b=c.offset,$=h.offset,ae=b<$,he=ae?b:$,me=ae?$:b,xe=me-1;if(he!==xe){const we=y.getTextContent().slice(he,me);bo(we)||(o?h.offset=xe:c.offset=xe)}}}function Wd(u,o,c){const h=u,N=h.getTextContent().split(/(?=\s)/g),b=N.length;let $=0,ae=0;for(let me=0;me<b;me++){const xe=N[me],we=me===b-1;if(ae=$,$+=xe.length,o&&$===c||$>c||we){N.splice(me,1),we&&(ae=void 0);break}}const he=N.join("").trim();he===""?h.remove():(h.setTextContent(he),h.select(ae,ae))}function C_(u,o,c){const h=u.getParent();return c===null||h===null||!h.canBeEmpty()||h!==c.getNode()}function Kd(u,o,c,h){let y=o,N;if(u.nodeType===ke){let b=!1;const $=u.childNodes,ae=$.length;y===ae&&(b=!0,y=ae-1);let he=$[y],me=!1;if(he===h._blockCursorElement?(he=$[y+1],me=!0):h._blockCursorElement!==null&&y--,N=Li(he),_t(N))y=yl(N,b);else{let xe=Li(u);if(xe===null)return null;if(et(xe)){let we=xe.getChildAtIndex(y);if(et(we)&&C_(we,y,c)){const Ce=b?we.getLastDescendant():we.getFirstDescendant();Ce===null?(xe=we,y=0):(we=Ce,xe=et(we)?we:we.getParentOrThrow())}_t(we)?(N=we,xe=null,y=yl(we,b)):we!==xe&&b&&!me&&y++}else{const we=xe.getIndexWithinParent();o===0&&An(xe)&&Li(u)===xe?y=we:y=we+1,xe=xe.getParentOrThrow()}if(et(xe))return Mr(xe.__key,y,"element")}}else N=Li(u);return _t(N)?Mr(N.__key,y,"text"):null}function zd(u,o,c){const h=u.offset,y=u.getNode();if(h===0){const N=y.getPreviousSibling(),b=y.getParent();if(!o)et(N)&&!c&&N.isInline()?(u.key=N.__key,u.offset=N.getChildrenSize(),u.type="element"):_t(N)&&(u.key=N.__key,u.offset=N.getTextContent().length);else if((c||!o)&&N===null&&et(b)&&b.isInline()){const $=b.getPreviousSibling();_t($)&&(u.key=$.__key,u.offset=$.getTextContent().length)}}else if(h===y.getTextContent().length){const N=y.getNextSibling(),b=y.getParent();if(o&&et(N)&&N.isInline())u.key=N.__key,u.offset=0,u.type="element";else if((c||o)&&N===null&&et(b)&&b.isInline()&&!b.canInsertTextAfter()){const $=b.getNextSibling();_t($)&&(u.key=$.__key,u.offset=0)}}}function Ud(u,o,c){if(u.type==="text"&&o.type==="text"){const h=u.isBefore(o),y=u.is(o);zd(u,h,y),zd(o,!h,y),y&&(o.key=u.key,o.offset=u.offset,o.type=u.type);const N=xn();if(N.isComposing()&&N._compositionKey!==u.key&&vt(c)){const b=c.anchor,$=c.focus;Tn(u,b.key,b.offset,b.type),Tn(o,$.key,$.offset,$.type)}}}function Gd(u,o,c,h,y,N){if(u===null||c===null||!oo(y,u,c))return null;const b=Kd(u,o,vt(N)?N.anchor:null,y);if(b===null)return null;const $=Kd(c,h,vt(N)?N.focus:null,y);if($===null)return null;if(b.type==="element"&&$.type==="element"){const ae=Li(u),he=Li(c);if(An(ae)&&An(he))return null}return Ud(b,$,N),[b,$]}function E_(u){return et(u)&&!u.isInline()}function Yd(u,o,c,h,y,N){const b=xi(),$=new sr(Mr(u,o,y),Mr(c,h,N),0,"");return $.dirty=!0,b._selection=$,$}function T_(){const u=Mr("root",0,"element"),o=Mr("root",0,"element");return new sr(u,o,0,"")}function $c(){return new Ti(new Set)}function x_(u){const c=u.getEditorState()._selection,h=cr(u._window);return vt(c)||c==null?Fc(c,h,u,null):c.clone()}function Fc(u,o,c,h){const y=c._window;if(y===null)return null;const N=h||y.event,b=N?N.type:void 0,$=b==="selectionchange",ae=!Ut()&&($||b==="beforeinput"||b==="compositionstart"||b==="compositionend"||b==="click"&&N&&N.detail===3||b==="drop"||b===void 0);let he,me,xe,we;if(!vt(u)||ae){if(o===null)return null;if(he=o.anchorNode,me=o.focusNode,xe=o.anchorOffset,we=o.focusOffset,$&&vt(u)&&!oo(c,he,me))return u.clone()}else return u.clone();const Ce=Gd(he,xe,me,we,c,u);if(Ce===null)return null;const[Ve,ze]=Ce;return new sr(Ve,ze,vt(u)?u.format:0,vt(u)?u.style:"")}function mn(){return xi()._selection}function $s(){return xn()._editorState._selection}function Ua(u,o,c,h=1){const y=u.anchor,N=u.focus,b=y.getNode(),$=N.getNode();if(!o.is(b)&&!o.is($))return;const ae=o.__key;if(u.isCollapsed()){const he=y.offset;if(c<=he&&h>0||c<he&&h<0){const me=Math.max(0,he+h);y.set(ae,me,"element"),N.set(ae,me,"element"),jd(u)}}else{const he=u.isBackward(),me=he?N:y,xe=me.getNode(),we=he?y:N,Ce=we.getNode();if(o.is(xe)){const Ve=me.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&me.set(ae,Math.max(0,Ve+h),"element")}if(o.is(Ce)){const Ve=we.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&we.set(ae,Math.max(0,Ve+h),"element")}}jd(u)}function jd(u){const o=u.anchor,c=o.offset,h=u.focus,y=h.offset,N=o.getNode(),b=h.getNode();if(u.isCollapsed()){if(!et(N))return;const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),o.set(he.__key,me,"text"),h.set(he.__key,me,"text")}return}if(et(N)){const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),o.set(he.__key,me,"text")}}if(et(b)){const $=b.getChildrenSize(),ae=y>=$,he=ae?b.getChildAtIndex($-1):b.getChildAtIndex(y);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),h.set(he.__key,me,"text")}}}function v_(u,o){const h=o.getEditorState()._selection,y=u._selection;if(vt(y)){const N=y.anchor,b=y.focus;let $;if(N.type==="text"&&($=N.getNode(),$.selectionTransform(h,y)),b.type==="text"){const ae=b.getNode();$!==ae&&ae.selectionTransform(h,y)}}}function Ga(u,o,c,h,y){let N=null,b=0,$=null;h!==null?(N=h.__key,_t(h)?(b=h.getTextContentSize(),$="text"):et(h)&&(b=h.getChildrenSize(),$="element")):y!==null&&(N=y.__key,_t(y)?$="text":et(y)&&($="element")),N!==null&&$!==null?u.set(N,b,$):(b=o.getIndexWithinParent(),b===-1&&(b=c.getChildrenSize()),u.set(c.__key,b,"element"))}function Vd(u,o,c,h,y){u.type==="text"?(u.key=c,o||(u.offset+=y)):u.offset>h.getIndexWithinParent()&&(u.offset-=1)}function S_(u,o,c,h,y,N,b){const $=h.anchorNode,ae=h.focusNode,he=h.anchorOffset,me=h.focusOffset,xe=document.activeElement;if(y.has("collaboration")&&xe!==N||xe!==null&&Ao(xe))return;if(!vt(o)){u!==null&&oo(c,$,ae)&&h.removeAllRanges();return}const we=o.anchor,Ce=o.focus,Ve=we.key,ze=Ce.key,$e=Bo(c,Ve),Lt=Bo(c,ze),Qe=we.offset,ht=Ce.offset,qt=o.format,Wt=o.style,At=o.isCollapsed();let ln=$e,lr=Lt,_o=!1;if(we.type==="text"){ln=kr($e);const gr=we.getNode();_o=gr.getFormat()!==qt||gr.getStyle()!==Wt}else vt(u)&&u.anchor.type==="text"&&(_o=!0);if(Ce.type==="text"&&(lr=kr(Lt)),!(ln===null||lr===null)&&(At&&(u===null||_o||vt(u)&&(u.format!==qt||u.style!==Wt))&&jn(qt,Wt,Qe,Ve,performance.now()),!(he===Qe&&me===ht&&$===ln&&ae===lr&&!(h.type==="Range"&&At)&&((xe===null||!N.contains(xe))&&N.focus({preventScroll:!0}),we.type!=="element")))){try{h.setBaseAndExtent(ln,Qe,lr,ht)}catch{}if(!y.has("skip-scroll-into-view")&&o.isCollapsed()&&N!==null&&N===document.activeElement){const gr=o instanceof sr&&o.anchor.type==="element"?ln.childNodes[Qe]||null:h.rangeCount>0?h.getRangeAt(0):null;if(gr!==null){let nn;if(gr instanceof Text){const Pn=document.createRange();Pn.selectNode(gr),nn=Pn.getBoundingClientRect()}else nn=gr.getBoundingClientRect();yi(c,nn,N)}}Kt()}}function w_(u){let o=mn()||$s();o===null&&(o=ir().selectEnd()),o.insertNodes(u)}function O_(){const u=mn();return u===null?"":u.getTextContent()}function D_(u,o,c){const h=[];let y=null,N=null;function b(he,me,xe){const we={cell:xe,startColumn:me,startRow:he},Ce=xe.__rowSpan,Ve=xe.__colSpan;for(let ze=0;ze<Ce;ze++){h[he+ze]===void 0&&(h[he+ze]=[]);for(let $e=0;$e<Ve;$e++)h[he+ze][me+$e]=we}o.is(xe)&&(y=we),c.is(xe)&&(N=we)}function $(he,me){return h[he]===void 0||h[he][me]===void 0}const ae=u.getChildren();for(let he=0;he<ae.length;he++){const me=ae[he];if(!Gc(me))throw Error("Expected GridNode children to be GridRowNode");const xe=me.getChildren();let we=0;for(const Ce of xe){if(!Ws(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!$(he,we);)we++;b(he,we,Ce),we+=Ce.__colSpan}}if(y===null)throw Error("Anchor not found in Grid");if(N===null)throw Error("Focus not found in Grid");return[h,y,N]}function qd(u){let o;if(u instanceof Uc)o=u;else if(u instanceof oi){const y=Ts(u,Ws);if(!Ws(y))throw Error("Expected to find a parent GridCellNode");o=y}else{const y=Ts(u.getNode(),Ws);if(!Ws(y))throw Error("Expected to find a parent GridCellNode");o=y}const c=o.getParent();if(!Gc(c))throw Error("Expected GridCellNode to have a parent GridRowNode");const h=c.getParent();if(!uf(h))throw Error("Expected GridRowNode to have a parent GridNode");return[o,c,h]}function Bc(u){u.isCollapsed()||u.removeText();const o=u.anchor;let c=o.getNode(),h=o.offset;for(;!Hi(c);)[c,h]=A_(c,h);return h}function A_(u,o){const c=u.getParent();if(!c){const y=qi();return ir().append(y),y.select(),[ir(),0]}if(_t(u)){const y=u.splitText(o);if(y.length===0)return[c,u.getIndexWithinParent()];const N=o===0?0:1,b=y[0].getIndexWithinParent()+N;return[c,b]}if(!et(u)||o===0)return[c,u.getIndexWithinParent()];const h=u.getChildAtIndex(o);if(h){const y=new sr(Mr(u.__key,o,"element"),Mr(u.__key,o,"element"),0,""),N=u.insertNewAfter(y);N&&N.append(h,...h.getNextSiblings())}return[c,u.getIndexWithinParent()+1]}function M_(u){const o=qi();let c=null;for(let h=0;h<u.length;h++){const y=u[h],N=li(y);if(N||An(y)&&y.isInline()||et(y)&&y.isInline()||_t(y)||y.isParentRequired()){if(c===null&&(c=y.createParentElementNode(),o.append(c),N))continue;c!==null&&c.append(y)}else o.append(y),c=null}return o}let er=null,tr=null,Lr=!1,Hc=!1,Ya=0;const Zd={characterData:!0,childList:!0,subtree:!0};function Fs(){return Lr||er!==null&&er._readOnly}function hr(){if(Lr)throw Error("Cannot use method in read-only mode.")}function Jd(){if(Ya>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 xi(){if(er===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 er}function xn(){if(tr===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return tr}function R_(){return tr}function Xd(u,o,c){const h=o.__type,y=pa(u,h);let N=c.get(h);N===void 0&&(N=Array.from(y.transforms),c.set(h,N));const b=N.length;for(let $=0;$<b&&(N[$](o),!!o.isAttached());$++);}function Qd(u,o){return u!==void 0&&u.__key!==o&&u.isAttached()}function b_(u,o){const c=o._dirtyLeaves,h=u._nodeMap;for(const y of c){const N=h.get(y);_t(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&rr(N)}}function L_(u,o){const c=o._dirtyLeaves,h=o._dirtyElements,y=u._nodeMap,N=ar(),b=new Map;let $=c,ae=$.size,he=h,me=he.size;for(;ae>0||me>0;){if(ae>0){o._dirtyLeaves=new Set;for(const xe of $){const we=y.get(xe);_t(we)&&we.isAttached()&&we.isSimpleText()&&!we.isUnmergeable()&&rr(we),we!==void 0&&Qd(we,N)&&Xd(o,we,b),c.add(xe)}if($=o._dirtyLeaves,ae=$.size,ae>0){Ya++;continue}}o._dirtyLeaves=new Set,o._dirtyElements=new Map;for(const xe of he){const we=xe[0],Ce=xe[1];if(we!=="root"&&!Ce)continue;const Ve=y.get(we);Ve!==void 0&&Qd(Ve,N)&&Xd(o,Ve,b),h.set(we,Ce)}$=o._dirtyLeaves,ae=$.size,he=o._dirtyElements,me=he.size,Ya++}o._dirtyLeaves=c,o._dirtyElements=h}function I_(u){return Wc(u,xn()._nodes)}function Wc(u,o){const c=u.type,h=o.get(c);if(h===void 0)throw Error(`parseEditorState: type "${c}" + not found`);const y=h.klass;if(u.type!==y.getType())throw Error(`LexicalNode: Node ${y.name} does not implement .importJSON().`);const N=y.importJSON(u),b=u.children;if(et(N)&&Array.isArray(b))for(let $=0;$<b.length;$++){const ae=b[$],he=Wc(ae,o);N.append(he)}return N}function k_(u,o,c){const h=zc(),y=er,N=Lr,b=tr,$=o._dirtyElements,ae=o._dirtyLeaves,he=o._cloneNotNeeded,me=o._dirtyType;o._dirtyElements=new Map,o._dirtyLeaves=new Set,o._cloneNotNeeded=new Set,o._dirtyType=0,er=h,Lr=!1,tr=o;try{const xe=o._nodes,we=u.root;Wc(we,xe),c&&c(),h._readOnly=!0,tf(h)}catch(xe){xe instanceof Error&&o._onError(xe)}finally{o._dirtyElements=$,o._dirtyLeaves=ae,o._cloneNotNeeded=he,o._dirtyType=me,er=y,Lr=N,tr=b}return h}function ef(u,o){const c=er,h=Lr,y=tr;er=u,Lr=!0,tr=null;try{return o()}finally{er=c,Lr=h,tr=y}}function tf(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 Xo(u,o){const c=u._pendingEditorState,h=u._rootElement,y=u._headless||h===null;if(c===null)return;const N=u._editorState,b=N._selection,$=c._selection,ae=u._dirtyType!==qe,he=er,me=Lr,xe=tr,we=u._updating,Ce=u._observer;let Ve=null;if(u._pendingEditorState=null,u._editorState=c,!y&&ae&&Ce!==null){tr=u,er=c,Lr=!1,u._updating=!0;try{const At=u._dirtyType,ln=u._dirtyElements,lr=u._dirtyLeaves;Ce.disconnect(),Ve=Ui(N,c,u,At,ln,lr)}catch(At){if(At instanceof Error&&u._onError(At),!Hc)af(u,null,h,c),fn(u),u._dirtyType=ct,Hc=!0,Xo(u,N),Hc=!1;else throw At;return}finally{Ce.observe(h,Zd),u._updating=we,er=he,Lr=me,tr=xe}}c._readOnly||(c._readOnly=!0,tf(c),vt($)&&(Object.freeze($.anchor),Object.freeze($.focus)),Object.freeze($));const ze=u._dirtyLeaves,$e=u._dirtyElements,Lt=u._normalizedNodes,Qe=u._updateTags,ht=u._deferred;ae&&(u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),La(u,c);const qt=y?null:cr(u._window);if(u._editable&&qt!==null&&(ae||$===null||$.dirty)){tr=u,er=c;try{if(Ce!==null&&Ce.disconnect(),ae||$===null||$.dirty){const At=u._blockCursorElement;At!==null&&Wo(At,u,h),S_(b,$,u,qt,Qe,h)}Ni(u,h,$),Ce!==null&&Ce.observe(h,Zd)}finally{tr=xe,er=he}}Ve!==null&&$_(u,Ve,Qe,ze,N),!vt($)&&$!==null&&(b===null||!b.is($))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Gl("decorator",u,!0,Wt)),P_(u,o||N,c),Gl("update",u,!0,{dirtyElements:$e,dirtyLeaves:ze,editorState:c,normalizedNodes:Lt,prevEditorState:o||N,tags:Qe}),B_(u,ht),F_(u)}function P_(u,o,c){const h=gs(o),y=gs(c);h!==y&&Gl("textcontent",u,!0,y)}function $_(u,o,c,h,y){const N=Array.from(u._listeners.mutation),b=N.length;for(let $=0;$<b;$++){const[ae,he]=N[$],me=o.get(he);me!==void 0&&ae(me,{dirtyLeaves:h,prevEditorState:y,updateTags:c})}}function Gl(u,o,c,...h){const y=o._updating;o._updating=c;try{const N=Array.from(o._listeners[u]);for(let b=0;b<N.length;b++)N[b].apply(null,h)}finally{o._updating=y}}function nf(u,o,c){if(u._updating===!1||tr!==u){let y=!1;return u.update(()=>{y=nf(u,o,c)}),y}const h=Ii(u);for(let y=4;y>=0;y--)for(let N=0;N<h.length;N++){const ae=h[N]._commands.get(o);if(ae!==void 0){const he=ae[y];if(he!==void 0){const me=Array.from(he),xe=me.length;for(let we=0;we<xe;we++)if(me[we](c,u)===!0)return!0}}}return!1}function F_(u){const o=u._updates;if(o.length!==0){const c=o.shift();if(c){const[h,y]=c;of(u,h,y)}}}function B_(u,o){if(u._deferred=[],o.length!==0){const c=u._updating;u._updating=!0;try{for(let h=0;h<o.length;h++)o[h]()}finally{u._updating=c}}}function rf(u,o){const c=u._updates;let h=o||!1;for(;c.length!==0;){const y=c.shift();if(y){const[N,b]=y;let $,ae;b!==void 0&&($=b.onUpdate,ae=b.tag,b.skipTransforms&&(h=!0),$&&u._deferred.push($),ae&&u._updateTags.add(ae)),N()}}return h}function of(u,o,c){const h=u._updateTags;let y,N,b=!1,$=!1;c!==void 0&&(y=c.onUpdate,N=c.tag,N!=null&&h.add(N),b=c.skipTransforms||!1,$=c.discrete||!1),y&&u._deferred.push(y);const ae=u._editorState;let he=u._pendingEditorState,me=!1;(he===null||he._readOnly)&&(he=u._pendingEditorState=K_(he||ae),me=!0),he._flushSync=$;const xe=er,we=Lr,Ce=tr,Ve=u._updating;er=he,Lr=!1,u._updating=!0,tr=u;try{me&&(u._headless?ae._selection!=null&&(he._selection=ae._selection.clone()):he._selection=x_(u));const $e=u._compositionKey;o(),b=rf(u,b),v_(he,u),u._dirtyType!==qe&&(b?b_(he,u):L_(he,u),rf(u),Ml(ae,he,u._dirtyLeaves,u._dirtyElements));const Lt=u._compositionKey;$e!==Lt&&(he._flushSync=!0);const Qe=he._selection;if(vt(Qe)){const ht=he._nodeMap,qt=Qe.anchor.key,Wt=Qe.focus.key;if(ht.get(qt)===void 0||ht.get(Wt)===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 Wr(Qe)&&Qe._nodes.size===0&&(he._selection=null)}catch($e){$e instanceof Error&&u._onError($e),u._pendingEditorState=ae,u._dirtyType=ct,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),Xo(u);return}finally{er=xe,Lr=we,tr=Ce,u._updating=Ve,Ya=0}u._dirtyType!==qe||W_(he,u)?he._flushSync?(he._flushSync=!1,Xo(u)):me&&fs(()=>{Xo(u)}):(he._flushSync=!1,me&&(h.clear(),u._deferred=[],u._pendingEditorState=null))}function Kr(u,o,c){u._updating?u._updates.push([o,c]):of(u,o,c)}class Kc extends oi{constructor(o){super(o)}decorate(o,c){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof Kc}class Qo extends oi{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 _i[o]||""}getIndent(){return this.getLatest().__indent}getChildren(){const o=[];let c=this.getFirstChild();for(;c!==null;)o.push(c),c=c.getNextSibling();return o}getChildrenKeys(){const o=[];let c=this.getFirstChild();for(;c!==null;)o.push(c.__key),c=c.getNextSibling();return o}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const c=xn()._dirtyElements;return c!==null&&c.has(this.__key)}isLastChild(){const o=this.getLatest(),c=this.getParentOrThrow().getLastChild();return c!==null&&c.is(o)}getAllTextNodes(){const o=[];let c=this.getFirstChild();for(;c!==null;){if(_t(c)&&o.push(c),et(c)){const h=c.getAllTextNodes();o.push(...h)}c=c.getNextSibling()}return o}getFirstDescendant(){let o=this.getFirstChild();for(;o!==null;){if(et(o)){const c=o.getFirstChild();if(c!==null){o=c;continue}}break}return o}getLastDescendant(){let o=this.getLastChild();for(;o!==null;){if(et(o)){const c=o.getLastChild();if(c!==null){o=c;continue}}break}return o}getDescendantByIndex(o){const c=this.getChildren(),h=c.length;if(o>=h){const N=c[h-1];return et(N)&&N.getLastDescendant()||N||null}const y=c[o];return et(y)&&y.getFirstDescendant()||y||null}getFirstChild(){const c=this.getLatest().__first;return c===null?null:Cn(c)}getFirstChildOrThrow(){const o=this.getFirstChild();if(o===null)throw Error(`Expected node ${this.__key} to have a first child.`);return o}getLastChild(){const c=this.getLatest().__last;return c===null?null:Cn(c)}getLastChildOrThrow(){const o=this.getLastChild();if(o===null)throw Error(`Expected node ${this.__key} to have a last child.`);return o}getChildAtIndex(o){const c=this.getChildrenSize();let h,y;if(o<c/2){for(h=this.getFirstChild(),y=0;h!==null&&y<=o;){if(y===o)return h;h=h.getNextSibling(),y++}return null}for(h=this.getLastChild(),y=c-1;h!==null&&y>=o;){if(y===o)return h;h=h.getPreviousSibling(),y--}return null}getTextContent(){let o="";const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];o+=N.getTextContent(),et(N)&&y!==h-1&&!N.isInline()&&(o+=Ft)}return o}getTextContentSize(){let o=0;const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];o+=N.getTextContentSize(),et(N)&&y!==h-1&&!N.isInline()&&(o+=Ft.length)}return o}getDirection(){return this.getLatest().__dir}hasFormat(o){if(o!==""){const c=mi[o];return(this.getFormat()&c)!==0}return!1}select(o,c){hr();const h=mn();let y=o,N=c;const b=this.getChildrenSize();if(!this.canBeEmpty()){if(o===0&&c===0){const ae=this.getFirstChild();if(_t(ae)||et(ae))return ae.select(0,0)}else if((o===void 0||o===b)&&(c===void 0||c===b)){const ae=this.getLastChild();if(_t(ae)||et(ae))return ae.select()}}y===void 0&&(y=b),N===void 0&&(N=b);const $=this.__key;if(vt(h))h.anchor.set($,y,"element"),h.focus.set($,N,"element"),h.dirty=!0;else return Yd($,y,$,N,"element","element");return h}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(h=>h.remove()),o}append(...o){return this.splice(this.getChildrenSize(),0,o)}setDirection(o){const c=this.getWritable();return c.__dir=o,c}setFormat(o){const c=this.getWritable();return c.__format=o!==""?mi[o]:0,this}setIndent(o){const c=this.getWritable();return c.__indent=o,this}splice(o,c,h){const y=h.length,N=this.getChildrenSize(),b=this.getWritable(),$=b.__key,ae=[],he=[],me=this.getChildAtIndex(o+c);let xe=null,we=N-c+y;if(o!==0)if(o===N)xe=this.getLastChild();else{const Ve=this.getChildAtIndex(o);Ve!==null&&(xe=Ve.getPreviousSibling())}if(c>0){let Ve=xe===null?this.getFirstChild():xe.getNextSibling();for(let ze=0;ze<c;ze++){if(Ve===null)throw Error("splice: sibling not found");const $e=Ve.getNextSibling(),Lt=Ve.__key,Qe=Ve.getWritable();jr(Qe),he.push(Lt),Ve=$e}}let Ce=xe;for(let Ve=0;Ve<y;Ve++){const ze=h[Ve];Ce!==null&&ze.is(Ce)&&(xe=Ce=Ce.getPreviousSibling());const $e=ze.getWritable();$e.__parent===$&&we--,jr($e);const Lt=ze.__key;if(Ce===null)b.__first=Lt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Lt,$e.__prev=Qe.__key}if(ze.__key===$)throw Error("append: attempting to append self");$e.__parent=$,ae.push(Lt),Ce=ze}if(o+c===N){if(Ce!==null){const Ve=Ce.getWritable();Ve.__next=null,b.__last=Ce.__key}}else if(me!==null){const Ve=me.getWritable();if(Ce!==null){const ze=Ce.getWritable();Ve.__prev=Ce.__key,ze.__next=me.__key}else Ve.__prev=null}if(b.__size=we,he.length){const Ve=mn();if(vt(Ve)){const ze=new Set(he),$e=new Set(ae),{anchor:Lt,focus:Qe}=Ve;sf(Lt,ze,$e)&&Ga(Lt,Lt.getNode(),this,xe,me),sf(Qe,ze,$e)&&Ga(Qe,Qe.getNode(),this,xe,me),we===0&&!this.canBeEmpty()&&!ii(this)&&this.remove()}}return b}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(o,c){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,c,h){return!1}}function et(u){return u instanceof Qo}function sf(u,o,c){let h=u.getNode();for(;h;){const y=h.__key;if(o.has(y)&&!c.has(y))return!0;h=h.getParent()}return!1}class Bs extends Qo{static getType(){return"root"}static clone(){return new Bs}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const o=this.__cachedText;return(Fs()||xn()._dirtyType===qe)&&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,c){return!1}append(...o){for(let c=0;c<o.length;c++){const h=o[c];if(!et(h)&&!An(h))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...o)}static importJSON(o){const c=ir();return c.setFormat(o.format),c.setIndent(o.indent),c.setDirection(o.direction),c}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function H_(){return new Bs}function zr(u){return u instanceof Bs}function W_(u,o){const c=o.getEditorState()._selection,h=u._selection;if(h!==null){if(h.dirty||!h.is(c))return!0}else if(c!==null)return!0;return!1}function K_(u){return new ja(new Map(u._nodeMap))}function zc(){return new ja(new Map([["root",H_()]]))}function lf(u){const o=u.exportJSON(),c=u.constructor;if(o.type!==c.getType())throw Error(`LexicalNode: Node ${c.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const h=o.children;if(!Array.isArray(h))throw Error(`LexicalNode: Node ${c.name} is an element but .exportJSON() does not have a children array.`);const y=u.getChildren();for(let N=0;N<y.length;N++){const b=y[N],$=lf(b);h.push($)}}return o}class ja{constructor(o,c){this._nodeMap=o,this._selection=c||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(o){return ef(this,o)}clone(o){const c=new ja(this._nodeMap,o===void 0?this._selection:o);return c._readOnly=!0,c}toJSON(){return ef(this,()=>({root:lf(ir())}))}}class Hs extends Qo{static getType(){return"paragraph"}static clone(o){return new Hs(o.__key)}createDOM(o){const c=document.createElement("p"),h=$i(o.theme,"paragraph");return h!==void 0&&c.classList.add(...h),c}updateDOM(o,c,h){return!1}static importDOM(){return{p:o=>({conversion:z_,priority:0})}}exportDOM(o){const{element:c}=super.exportDOM(o);if(c&&Ko(c)){this.isEmpty()&&c.append(document.createElement("br"));const h=this.getFormatType();c.style.textAlign=h;const y=this.getDirection();y&&(c.dir=y);const N=this.getIndent();N>0&&(c.style.textIndent=`${N*20}px`)}return{element:c}}static importJSON(o){const c=qi();return c.setFormat(o.format),c.setIndent(o.indent),c.setDirection(o.direction),c}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(o,c){const h=qi(),y=this.getDirection();return h.setDirection(y),this.insertAfter(h,c),h}collapseAtStart(){const o=this.getChildren();if(o.length===0||_t(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 z_(u){const o=qi();if(u.style){o.setFormat(u.style.textAlign);const c=parseInt(u.style.textIndent,10)/20;c>0&&o.setIndent(c)}return{node:o}}function qi(){return Or(new Hs)}function U_(u){return u instanceof Hs}const G_=0,Y_=1,j_=2,V_=3,q_=4;function af(u,o,c,h){const y=u._keyToDOMMap;y.clear(),u._editorState=zc(),u._pendingEditorState=h,u._compositionKey=null,u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const N=u._observer;N!==null&&(N.disconnect(),u._observer=null),o!==null&&(o.textContent=""),c!==null&&(c.textContent="",y.set("root",c))}function Z_(u,o){const c=new Map,h=new Set,y=N=>{Object.keys(N).forEach(b=>{let $=c.get(b);$===void 0&&($=[],c.set(b,$)),$.push(N[b])})};return u.forEach(N=>{const b=N.klass.importDOM!=null?N.klass.importDOM.bind(N.klass):null;if(b==null||h.has(b))return;h.add(b);const $=b();$!==null&&y($)}),o&&y(o),c}function J_(u){const o=u||{},c=R_(),h=o.theme||{},y=u===void 0?c:o.parentEditor||null,N=o.disableEvents||!1,b=zc(),$=o.namespace||(y!==null?y._config.namespace:Nl()),ae=o.editorState,he=[Bs,Zr,ji,Tr,Hs,...o.nodes||[]],{onError:me,html:xe}=o,we=o.editable!==void 0?o.editable:!0;let Ce;if(u===void 0&&c!==null)Ce=c._nodes;else{Ce=new Map;for(let ze=0;ze<he.length;ze++){let $e=he[ze],Lt=null,Qe=null;if(typeof $e!="function"){const At=$e;$e=At.replace,Lt=At.with,Qe=At.withKlass||null}{const At=$e.name;if(At!=="RootNode"){const ln=$e.prototype;["getType","clone"].forEach(lr=>{$e.hasOwnProperty(lr)||console.warn(`${At} must implement static "${lr}" method`)}),!$e.hasOwnProperty("importDOM")&&$e.hasOwnProperty("exportDOM")&&console.warn(`${At} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),ln instanceof Kc&&(ln.hasOwnProperty("decorate")||console.warn(`${ln.constructor.name} must implement "decorate" method`)),$e.hasOwnProperty("importJSON")||console.warn(`${At} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),ln.hasOwnProperty("exportJSON")||console.warn(`${At} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ht=$e.getType(),qt=$e.transform(),Wt=new Set;qt!==null&&Wt.add(qt),Ce.set(ht,{exportDOM:xe&&xe.export?xe.export.get($e):void 0,klass:$e,replace:Lt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new X_(b,y,Ce,{disableEvents:N,namespace:$,theme:h},me||console.error,Z_(Ce,xe?xe.import:void 0),we);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ct),Ve}class X_{constructor(o,c,h,y,N,b,$){this._parentEditor=c,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=y,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=qe,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=Nl(),this._onError=N,this._htmlConversions=b,this._editable=$,this._headless=c!==null&&c._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(o){const c=this._listeners.update;return c.add(o),()=>{c.delete(o)}}registerEditableListener(o){const c=this._listeners.editable;return c.add(o),()=>{c.delete(o)}}registerDecoratorListener(o){const c=this._listeners.decorator;return c.add(o),()=>{c.delete(o)}}registerTextContentListener(o){const c=this._listeners.textcontent;return c.add(o),()=>{c.delete(o)}}registerRootListener(o){const c=this._listeners.root;return o(this._rootElement,null),c.add(o),()=>{o(null,this._rootElement),c.delete(o)}}registerCommand(o,c,h){if(h===void 0)throw Error('Listener for type "command" requires a "priority".');const y=this._commands;y.has(o)||y.set(o,[new Set,new Set,new Set,new Set,new Set]);const N=y.get(o);if(N===void 0)throw Error(`registerCommand: Command ${String(o)} not found in command map`);const b=N[h];return b.add(c),()=>{b.delete(c),N.every($=>$.size===0)&&y.delete(o)}}registerMutationListener(o,c){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 y=this._listeners.mutation;return y.set(c,o),()=>{y.delete(c)}}registerNodeTransformToKlass(o,c){const h=o.getType(),y=this._nodes.get(h);if(y===void 0)throw Error(`Node ${o.name} has not been registered. Ensure node has been passed to createEditor.`);return y.transforms.add(c),y}registerNodeTransform(o,c){const h=this.registerNodeTransformToKlass(o,c),y=[h],N=h.replaceWithKlass;if(N!=null){const b=this.registerNodeTransformToKlass(N,c);y.push(b)}return bi(this,o.getType()),()=>{y.forEach(b=>b.transforms.delete(c))}}hasNode(o){return this._nodes.has(o.getType())}hasNodes(o){return o.every(this.hasNode.bind(this))}dispatchCommand(o,c){return ut(this,o,c)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(o){const c=this._rootElement;if(o!==c){const h=$i(this._config.theme,"root"),y=this._pendingEditorState||this._editorState;if(this._rootElement=o,af(this,c,o,y),c!==null&&(this._config.disableEvents||Ot(c),h!=null&&c.classList.remove(...h)),o!==null){const N=Ma(o),b=o.style;b.userSelect="text",b.whiteSpace="pre-wrap",b.wordBreak="break-word",o.setAttribute("data-lexical-editor","true"),this._window=N,this._dirtyType=ct,fn(this),this._updateTags.add("history-merge"),Xo(this),this._config.disableEvents||pt(o,this),h!=null&&o.classList.add(...h)}else this._editorState=y,this._pendingEditorState=null,this._window=null;Gl("root",this,!1,o,c)}}getElementByKey(o){return this._keyToDOMMap.get(o)||null}getEditorState(){return this._editorState}setEditorState(o,c){if(o.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");Ln(this);const h=this._pendingEditorState,y=this._updateTags,N=c!==void 0?c.tag:null;h!==null&&!h.isEmpty()&&(N!=null&&y.add(N),Xo(this)),this._pendingEditorState=o,this._dirtyType=ct,this._dirtyElements.set("root",!1),this._compositionKey=null,N!=null&&y.add(N),Xo(this)}parseEditorState(o,c){const h=typeof o=="string"?JSON.parse(o):o;return k_(h,this,c)}update(o,c){Kr(this,o,c)}focus(o,c={}){const h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),Kr(this,()=>{const y=mn(),N=ir();y!==null?y.dirty=!0:N.getChildrenSize()!==0&&(c.defaultSelection==="rootStart"?N.selectStart():N.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),o&&o()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){const o=this._rootElement;o!==null&&o.blur();const c=cr(this._window);c!==null&&c.removeAllRanges()}isEditable(){return this._editable}setEditable(o){this._editable!==o&&(this._editable=o,Gl("editable",this,!0,o))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Uc extends Qo{constructor(o,c){super(c),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 Ws(u){return u instanceof Uc}class cf extends Qo{}function uf(u){return u instanceof cf}class df extends Qo{}function Gc(u){return u instanceof df}return He.$INTERNAL_isPointSelection=dr,He.$addUpdateTag=Ct,He.$applyNodeReplacement=Or,He.$copyNode=Dl,He.$createLineBreakNode=mo,He.$createNodeSelection=$c,He.$createParagraphNode=qi,He.$createPoint=Mr,He.$createRangeSelection=T_,He.$createTabNode=Ls,He.$createTextNode=Dn,He.$getAdjacentNode=wl,He.$getNearestNodeFromDOMNode=ri,He.$getNearestRootOrShadowRoot=Cs,He.$getNodeByKey=Cn,He.$getPreviousSelection=$s,He.$getRoot=ir,He.$getSelection=mn,He.$getTextContent=O_,He.$hasAncestor=Bi,He.$hasUpdateTag=Gn,He.$insertNodes=w_,He.$isBlockElementNode=E_,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=$r,He.$isLeafNode=Mo,He.$isLineBreakNode=li,He.$isNodeSelection=Wr,He.$isParagraphNode=U_,He.$isRangeSelection=vt,He.$isRootNode=zr,He.$isRootOrShadowRoot=ii,He.$isTabNode=Is,He.$isTextNode=_t,He.$nodesOfType=Fi,He.$normalizeSelection__EXPERIMENTAL=Do,He.$parseSerializedNode=I_,He.$selectAll=Sl,He.$setCompositionKey=vn,He.$setSelection=Nr,He.$splitNode=Ra,He.BLUR_COMMAND=B,He.CAN_REDO_COMMAND=X,He.CAN_UNDO_COMMAND=fe,He.CLEAR_EDITOR_COMMAND=R,He.CLEAR_HISTORY_COMMAND=U,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=q_,He.COMMAND_PRIORITY_EDITOR=G_,He.COMMAND_PRIORITY_HIGH=V_,He.COMMAND_PRIORITY_LOW=Y_,He.COMMAND_PRIORITY_NORMAL=j_,He.CONTROLLED_TEXT_INSERTION_COMMAND=p,He.COPY_COMMAND=Y,He.CUT_COMMAND=W,He.DELETE_CHARACTER_COMMAND=l,He.DELETE_LINE_COMMAND=S,He.DELETE_WORD_COMMAND=E,He.DEPRECATED_$computeGridMap=D_,He.DEPRECATED_$getGridCellNodeRect=br,He.DEPRECATED_$getNodeTriplet=qd,He.DEPRECATED_$isGridCellNode=Ws,He.DEPRECATED_$isGridNode=uf,He.DEPRECATED_$isGridRowNode=Gc,He.DEPRECATED_GridCellNode=Uc,He.DEPRECATED_GridNode=cf,He.DEPRECATED_GridRowNode=df,He.DRAGEND_COMMAND=se,He.DRAGOVER_COMMAND=Z,He.DRAGSTART_COMMAND=O,He.DROP_COMMAND=de,He.DecoratorNode=Kc,He.ElementNode=Qo,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=K,He.FORMAT_TEXT_COMMAND=w,He.INDENT_CONTENT_COMMAND=Se,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=f,He.INSERT_TAB_COMMAND=Te,He.INTERNAL_PointSelection=Rr,He.KEY_ARROW_DOWN_COMMAND=j,He.KEY_ARROW_LEFT_COMMAND=I,He.KEY_ARROW_RIGHT_COMMAND=k,He.KEY_ARROW_UP_COMMAND=H,He.KEY_BACKSPACE_COMMAND=ce,He.KEY_DELETE_COMMAND=z,He.KEY_DOWN_COMMAND=v,He.KEY_ENTER_COMMAND=re,He.KEY_ESCAPE_COMMAND=V,He.KEY_MODIFIER_COMMAND=A,He.KEY_SPACE_COMMAND=te,He.KEY_TAB_COMMAND=q,He.LineBreakNode=ji,He.MOVE_TO_END=G,He.MOVE_TO_START=P,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=_,He.ParagraphNode=Hs,He.REDO_COMMAND=m,He.REMOVE_TEXT_COMMAND=T,He.RootNode=Bs,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=J,He.TabNode=Tr,He.TextNode=Zr,He.UNDO_COMMAND=M,He.createCommand=e,He.createEditor=J_,He.getNearestEditorFromDOMNode=fl,He.isCurrentlyReadOnlyMode=Fs,He.isHTMLAnchorElement=ba,He.isHTMLElement=Ko,He.isSelectionCapturedInDecoratorInput=Ao,He.isSelectionWithinEditor=oo,He}var We={},Rf;function GN(){if(Rf)return We;Rf=1;let e={},t={},n={},r={},l={},d={},f={},p={},_={},T={},E={},S={},w={},M={},m={},v={},k={},G={},I={},P={},H={},j={},re={},te={},ce={},V={},z={},q={},Te={},Se={},Ee={},de={},K={},O={},Z={},se={};function Y(s){let i=new URLSearchParams;i.append("code",s);for(let a=1;a<arguments.length;a++)i.append("v",arguments[a]);throw Error(`Minified Lexical error #${s}; 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 W=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J=W&&"documentMode"in document?document.documentMode:null,R=W&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),U=W&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),X=W&&"InputEvent"in window&&!J?"getTargetRanges"in new window.InputEvent("input"):!1,fe=W&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=W&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,B=W&&/Android/.test(navigator.userAgent),A=W&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F=W&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!A,oe=fe||_e||F?" ":"​",ye=U?" ":oe,De=/^[^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]/,ee=/^[^\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]/,ne={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ue={directionless:1,unmergeable:2},be={center:2,end:6,justify:4,left:1,right:3,start:5},Ne={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Re={normal:0,segmented:2,token:1},ke={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(s){qe=s.timeStamp}function ct(s,i,a){return i.__lexicalLineBreak===s||s[`__lexicalKey_${a._key}`]!==void 0}function Mt(s){return s.getEditorState().read(()=>{let i=jt();return i!==null?i.clone():null})}function zt(s,i,a){Fe=!0;let g=100<performance.now()-qe;try{Er(s,()=>{let C=jt()||Mt(s);var x=new Map,D=s.getRootElement(),Q=s._editorState,ge=s._blockCursorElement;let Ae=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,pt=Ke.target,Ot=Ht(pt,Q);if(!(Ot===null&&pt!==D||En(Ot))){if(Pe==="characterData"){if(Ke=g&&Ct(Ot))e:{Ke=C,Pe=pt;var Bt=Ot;if(Rt(Ke)){var Kt=Ke.anchor.getNode();if(Kt.is(Bt)&&Ke.format!==Kt.getFormat()){Ke=!1;break e}}Ke=Pe.nodeType===3&&Bt.isAttached()}Ke&&(Bt=Yr(s._window),Pe=Ke=null,Bt!==null&&Bt.anchorNode===pt&&(Ke=Bt.anchorOffset,Pe=Bt.focusOffset),pt=pt.nodeValue,pt!==null&&nt(Ot,pt,Ke,Pe,!1))}else if(Pe==="childList"){for(Ae=!0,Pe=Ke.addedNodes,Bt=0;Bt<Pe.length;Bt++){Kt=Pe[Bt];var jn=Ft(Kt),Dr=Kt.parentNode;Dr==null||Kt===ge||jn!==null||Kt.nodeName==="BR"&&ct(Kt,Dr,s)||(U&&(jn=Kt.innerText||Kt.nodeValue)&&(Ye+=jn),Dr.removeChild(Kt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Bt=0,Kt=0;Kt<Pe;Kt++)Dr=Ke[Kt],(Dr.nodeName==="BR"&&ct(Dr,pt,s)||ge===Dr)&&(pt.appendChild(Dr),Bt++);Pe!==Bt&&(pt===D&&(Ot=Q._nodeMap.get("root")),x.set(pt,Ot))}}}}if(0<x.size)for(let[oi,si]of x)if(Je(si))for(x=si.getChildrenKeys(),D=oi.firstChild,Q=0;Q<x.length;Q++)ge=s.getElementByKey(x[Q]),ge!==null&&(D==null?(oi.appendChild(ge),D=ge):D!==ge&&oi.replaceChild(ge,D),D=D.nextSibling);else Ct(si)&&si.markDirty();if(x=a.takeRecords(),0<x.length){for(D=0;D<x.length;D++)for(ge=x[D],Q=ge.addedNodes,ge=ge.target,Xe=0;Xe<Q.length;Xe++)Ot=Q[Xe],pt=Ot.parentNode,pt==null||Ot.nodeName!=="BR"||ct(Ot,ge,s)||pt.removeChild(Ot);a.takeRecords()}C!==null&&(Ae&&(C.dirty=!0,Qt(C)),U&&Nn(s)&&C.insertRawText(Ye))})}finally{Fe=!1}}function Vt(s){let i=s._observer;if(i!==null){let a=i.takeRecords();zt(s,a,i)}}function Oe(s){qe===0&&Ln(s).addEventListener("textInput",Be,!0),s._observer=new MutationObserver((i,a)=>{zt(s,i,a)})}function ie(s,i){let a=s.__mode,g=s.__format;s=s.__style;let C=i.__mode,x=i.__format;return i=i.__style,(a===null||a===C)&&(g===null||g===x)&&(s===null||s===i)}function le(s,i){let a=s.mergeWithSibling(i),g=dn()._normalizedNodes;return g.add(s.__key),g.add(i.__key),a}function ve(s){if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable())s.remove();else{for(var i;(i=s.getPreviousSibling())!==null&&Ct(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{ie(i,s)&&(s=le(i,s));break}for(var a;(a=s.getNextSibling())!==null&&Ct(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else{ie(s,a)&&le(s,a);break}}}function Le(s){return Me(s.anchor),Me(s.focus),s}function Me(s){for(;s.type==="element";){var i=s.getNode(),a=s.offset;if(a===i.getChildrenSize()?(i=i.getChildAtIndex(a-1),a=!0):(i=i.getChildAtIndex(a),a=!1),Ct(i)){s.set(i.__key,a?i.getTextContentSize():0,"text");break}else if(!Je(i))break;s.set(i.__key,a?i.getChildrenSize():0,"element")}}let je=1,it=typeof queueMicrotask=="function"?queueMicrotask:s=>{Promise.resolve().then(s)};function ot(s){let i=document.activeElement;if(i===null)return!1;let a=i.nodeName;return En(Ht(s))&&(a==="INPUT"||a==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function st(s,i,a){let g=s.getRootElement();try{return g!==null&&g.contains(i)&&g.contains(a)&&i!==null&&!ot(i)&&wt(i)===s}catch{return!1}}function wt(s){for(;s!=null;){let i=s.__lexicalEditor;if(i!=null)return i;s=bn(s)}return null}function Ue(s){return s.isToken()||s.isSegmented()}function Ge(s){for(;s!=null;){if(s.nodeType===3)return s;s=s.firstChild}return null}function tt(s,i,a){let g=ne[i];return a!==null&&(s&g)===(a&g)||(s^=g,i==="subscript"?s&=~ne.superscript:i==="superscript"&&(s&=~ne.subscript)),s}function yt(s,i){if(i!=null)s.__key=i;else{Xn(),99<Ki&&Y(14),i=dn();var a=Fr(),g=""+je++;a._nodeMap.set(g,s),Je(s)?i._dirtyElements.set(g,!0):i._dirtyLeaves.add(g),i._cloneNotNeeded.add(g),i._dirtyType=1,s.__key=g}}function Nt(s){var i=s.getParent();if(i!==null){let C=s.getWritable();i=i.getWritable();var a=s.getPreviousSibling();if(s=s.getNextSibling(),a===null)if(s!==null){var g=s.getWritable();i.__first=s.__key,g.__prev=null}else i.__first=null;else{if(g=a.getWritable(),s!==null){let x=s.getWritable();x.__prev=g.__key,g.__next=x.__key}else g.__next=null;C.__prev=null}s===null?a!==null?(s=a.getWritable(),i.__last=a.__key,s.__next=null):i.__last=null:(s=s.getWritable(),a!==null?(a=a.getWritable(),a.__next=s.__key,s.__prev=a.__key):s.__prev=null,C.__next=null),i.__size--,C.__parent=null}}function Tt(s){99<Ki&&Y(14);var i=s.getLatest(),a=i.__parent,g=Fr();let C=dn(),x=g._nodeMap;if(g=C._dirtyElements,a!==null)e:for(;a!==null;){if(g.has(a))break e;let D=x.get(a);if(D===void 0)break;g.set(a,!1),a=D.__parent}i=i.__key,C._dirtyType=1,Je(s)?g.set(i,!0):C._dirtyLeaves.add(i)}function gt(s){Xn();var i=dn();let a=i._compositionKey;s!==a&&(i._compositionKey=s,a!==null&&(i=mt(a),i!==null&&i.getWritable()),s!==null&&(s=mt(s),s!==null&&s.getWritable()))}function xt(){return go()?null:dn()._compositionKey}function mt(s,i){return s=(i||Fr())._nodeMap.get(s),s===void 0?null:s}function Ft(s,i){let a=dn();return s=s[`__lexicalKey_${a._key}`],s!==void 0?mt(s,i):null}function Ht(s,i){for(;s!=null;){let a=Ft(s,i);if(a!==null)return a;s=bn(s)}return null}function tn(s){let i=Object.assign({},s._decorators);return s._pendingDecorators=i}function kt(s){return s.read(()=>bt().getTextContent())}function Yt(s,i){Er(s,()=>{var a=Fr();if(!a.isEmpty())if(i==="root")bt().markDirty();else{a=a._nodeMap;for(let[,g]of a)g.markDirty()}},s._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return Fr()._nodeMap.get("root")}function Qt(s){Xn();let i=Fr();s!==null&&(s.dirty=!0,s.setCachedNodes(null)),i._selection=s}function wr(s){var i=dn(),a;e:{for(a=s;a!=null;){let g=a[`__lexicalKey_${i._key}`];if(g!==void 0){a=g;break e}a=bn(a)}a=null}return a===null?(i=i.getRootElement(),s===i?mt("root"):null):mt(a)}function mi(s){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(s)}function _i(s){let i=[];for(;s!==null;)i.push(s),s=s._parentEditor;return i}function pe(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Ze(s,i,a){if(i=Yr(i._window),i!==null){var g=i.anchorNode,{anchorOffset:C,focusOffset:x}=i;if(g!==null&&(i=g.nodeType===3?g.nodeValue:null,g=Ht(g),i!==null&&Ct(g))){if(i===oe&&a){let D=a.length;i=a,x=C=D}i!==null&&nt(g,i,C,x,s)}}}function nt(s,i,a,g,C){let x=s;if(x.isAttached()&&(C||!x.isDirty())){let Ae=x.isComposing(),Ye=i;if((Ae||C)&&i[i.length-1]===oe&&(Ye=i.slice(0,-1)),i=x.getTextContent(),C||Ye!==i)if(Ye==="")if(gt(null),fe||_e||F)x.remove();else{let Xe=dn();setTimeout(()=>{Xe.update(()=>{x.isAttached()&&x.remove()})},20)}else{C=x.getParent(),i=Cr();var D=x.getTextContentSize(),Q=xt(),ge=x.getKey();x.isToken()||Q!==null&&ge===Q&&!Ae||Rt(i)&&(C!==null&&!C.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===s.__key&&i.anchor.offset===0&&!x.canInsertTextBefore()&&!Ae||i.focus.key===s.__key&&i.focus.offset===D&&!x.canInsertTextAfter()&&!Ae)?x.markDirty():(s=jt(),Rt(s)&&a!==null&&g!==null&&(s.setTextNodeRange(x,a,x,g),x.isSegmented()&&(a=x.getTextContent(),a=Gn(a),x.replace(a),x=a)),x.setTextContent(Ye))}}}function St(s,i){if(i.isSegmented())return!0;if(!s.isCollapsed())return!1;s=s.anchor.offset;let a=i.getParentOrThrow(),g=i.isToken();return s===0?((s=!i.canInsertTextBefore()||!a.canInsertTextBefore()||g)||(i=i.getPreviousSibling(),s=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),s):s===i.getTextContentSize()?!i.canInsertTextAfter()||!a.canInsertTextAfter()||g:!1}function Pt(s,i){s.__lexicalClassNameCache===void 0&&(s.__lexicalClassNameCache={});let a=s.__lexicalClassNameCache,g=a[i];return g!==void 0?g:(s=s[i],typeof s=="string"?(s=s.split(" "),a[i]=s):s)}function Ut(s,i,a,g,C){a.size!==0&&(a=g.__type,g=g.__key,i=i.get(a),i===void 0&&Y(33,a),a=i.klass,i=s.get(a),i===void 0&&(i=new Map,s.set(a,i)),s=i.get(g),a=s==="destroyed"&&C==="created",(s===void 0||a)&&i.set(g,a?"updated":C))}function $t(s,i,a){let g=s.getParent(),C=a;return g!==null&&(i&&a===0?(C=s.getIndexWithinParent(),s=g):i||a!==s.getChildrenSize()||(C=s.getIndexWithinParent()+1,s=g)),s.getChildAtIndex(i?C-1:C)}function Et(s,i){var a=s.offset;return s.type==="element"?(s=s.getNode(),$t(s,i,a)):(s=s.getNode(),i&&a===0||!i&&a===s.getTextContentSize()?(a=i?s.getPreviousSibling():s.getNextSibling(),a===null?$t(s.getParentOrThrow(),i,s.getIndexWithinParent()+(i?0:1)):a):null)}function Nn(s){return s=(s=Ln(s).event)&&s.inputType,s==="insertFromPaste"||s==="insertFromPasteAsQuotation"}function rn(s){return!or(s)&&!s.isLastChild()&&!s.isInline()}function cn(s,i){return s=s._keyToDOMMap.get(i),s===void 0&&Y(75,i),s}function bn(s){return s=s.assignedSlot||s.parentElement,s!==null&&s.nodeType===11?s.host:s}function nr(s,i){for(s=s.getParent();s!==null;){if(s.is(i))return!0;s=s.getParent()}return!1}function Ln(s){return s=s._window,s===null&&Y(78),s}function fn(s){for(s=s.getParentOrThrow();s!==null&&!Jn(s);)s=s.getParentOrThrow();return s}function Jn(s){return or(s)||Je(s)&&s.isShadowRoot()}function Mi(s){return s=s.constructor.clone(s),yt(s,null),s}function rr(s){var i=dn();let a=s.constructor.getType();return i=i._nodes.get(a),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(s),i instanceof s.constructor||Y(98),i):s}function Do(s,i){s=s.getParent(),!or(s)||Je(i)||En(i)||Y(99)}function ds(s){return(En(s)||Je(s)&&!s.canBeEmpty())&&!s.isInline()}function dl(s,i,a){a.style.removeProperty("caret-color"),i._blockCursorElement=null,i=s.parentElement,i!==null&&i.removeChild(s)}function Yr(s){return W?(s||window).getSelection():null}function pa(s,i){for(;s!==bt()&&s!=null;){if(i(s))return s;s=s.getParent()}return null}function fs(s){return s.nodeType===1}function io(s){if(En(s)&&!s.isInline())return!0;if(!Je(s)||Jn(s))return!1;var i=s.getFirstChild();return i=i===null||ki(i)||Ct(i)||i.isInline(),!s.isInline()&&s.canBeEmpty()!==!1&&i}function Ao(s,i){for(;s!==null&&s.getParent()!==null&&!i(s);)s=s.getParentOrThrow();return i(s)?s:null}function oo(s,i,a,g,C,x){for(s=s.getFirstChild();s!==null;){let D=s.__key;s.__parent===i&&(Je(s)&&oo(s,D,a,g,C,x),a.has(D)||x.delete(D),C.push(D)),s=s.getNextSibling()}}function fl(s,i,a,g){s=s._nodeMap,i=i._nodeMap;let C=[];for(let[x]of g){let D=i.get(x);D===void 0||D.isAttached()||(Je(D)&&oo(D,x,s,i,C,g),s.has(x)||g.delete(x),C.push(x))}for(let x of C)i.delete(x);for(let x of a)g=i.get(x),g===void 0||g.isAttached()||(s.has(x)||a.delete(x),i.delete(x))}let In="",Un="",ni="",kr,Hn,Mo,hl=!1,gl=!1,jr,Ri=null,pl,vn,ar,Cn,hs,ri;function Ro(s,i){let a=ar.get(s);if(i!==null){let g=Lo(s);g.parentNode===i&&i.removeChild(g)}Cn.has(s)||Hn._keyToDOMMap.delete(s),Je(a)&&(s=bo(a,ar),gs(s,0,s.length-1,null)),a!==void 0&&Ut(ri,Mo,jr,a,"destroyed")}function gs(s,i,a,g){for(;i<=a;++i){let C=s[i];C!==void 0&&Ro(C,g)}}function bi(s,i){s.setProperty("text-align",i)}function ir(s,i){var a=kr.theme.indent;if(typeof a=="string"){let g=s.classList.contains(a);0<i&&!g?s.classList.add(a):1>i&&g&&s.classList.remove(a)}a=getComputedStyle(s).getPropertyValue("--lexical-indent-base-value")||"40px",s.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${a})`)}function ml(s,i){s=s.style,i===0?bi(s,""):i===1?bi(s,"left"):i===2?bi(s,"center"):i===3?bi(s,"right"):i===4?bi(s,"justify"):i===5?bi(s,"start"):i===6&&bi(s,"end")}function Nr(s,i,a){let g=Cn.get(s);g===void 0&&Y(60);let C=g.createDOM(kr,Hn);var x=Hn._keyToDOMMap;if(C["__lexicalKey_"+Hn._key]=s,x.set(s,C),Ct(g)?C.setAttribute("data-lexical-text","true"):En(g)&&C.setAttribute("data-lexical-decorator","true"),Je(g)){if(s=g.__indent,x=g.__size,s!==0&&ir(C,s),x!==0){--x,s=bo(g,Cn);var D=Un;Un="",_l(s,g,0,x,C,null),ma(g,C),Un=D}s=g.__format,s!==0&&ml(C,s),g.isInline()||yl(null,g,C),rn(g)&&(In+=`
47
+
48
+ `,ni+=`
49
+
50
+ `)}else x=g.getTextContent(),En(g)?(D=g.decorate(Hn,kr),D!==null&&Nl(s,D),C.contentEditable="false"):Ct(g)&&(g.isDirectionless()||(Un+=x)),In+=x,ni+=x;return i!==null&&(a!=null?i.insertBefore(C,a):(a=i.__lexicalLineBreak,a!=null?i.insertBefore(C,a):i.appendChild(C))),Ut(ri,Mo,jr,g,"created"),C}function _l(s,i,a,g,C,x){let D=In;for(In="";a<=g;++a)Nr(s[a],C,x);rn(i)&&(In+=`
51
+
52
+ `),C.__lexicalTextContent=In,In=D+In}function Li(s,i){return s=i.get(s),ki(s)||En(s)&&s.isInline()}function yl(s,i,a){s=s!==null&&(s.__size===0||Li(s.__last,ar)),i=i.__size===0||Li(i.__last,Cn),s?i||(i=a.__lexicalLineBreak,i!=null&&a.removeChild(i),a.__lexicalLineBreak=null):i&&(i=document.createElement("br"),a.__lexicalLineBreak=i,a.appendChild(i))}function ma(s,i){var a=i.__lexicalDir;if(i.__lexicalDirTextContent!==Un||a!==Ri){let x=Un==="";if(x)var g=Ri;else g=Un,g=De.test(g)?"rtl":ee.test(g)?"ltr":null;if(g!==a){let D=i.classList,Q=kr.theme;var C=a!==null?Q[a]:void 0;let ge=g!==null?Q[g]:void 0;C!==void 0&&(typeof C=="string"&&(C=C.split(" "),C=Q[a]=C),D.remove(...C)),g===null||x&&g==="ltr"?i.removeAttribute("dir"):(ge!==void 0&&(typeof ge=="string"&&(a=ge.split(" "),ge=Q[g]=a),ge!==void 0&&D.add(...ge)),i.dir=g),gl||(s.getWritable().__dir=g)}Ri=g,i.__lexicalDirTextContent=Un,i.__lexicalDir=g}}function bo(s,i){let a=[];for(s=s.__first;s!==null;){let g=i.get(s);g===void 0&&Y(101),a.push(s),s=g.__next}return a}function Ii(s,i){var a=ar.get(s),g=Cn.get(s);a!==void 0&&g!==void 0||Y(61);var C=hl||vn.has(s)||pl.has(s);let x=cn(Hn,s);if(a===g&&!C)return Je(a)?(g=x.__lexicalTextContent,g!==void 0&&(In+=g,ni+=g),g=x.__lexicalDirTextContent,g!==void 0&&(Un+=g)):(g=a.getTextContent(),Ct(a)&&!a.isDirectionless()&&(Un+=g),ni+=g,In+=g),x;if(a!==g&&C&&Ut(ri,Mo,jr,g,"updated"),g.updateDOM(a,x,kr))return g=Nr(s,null,null),i===null&&Y(62),i.replaceChild(g,x),Ro(s,null),g;if(Je(a)&&Je(g)){if(s=g.__indent,s!==a.__indent&&ir(x,s),s=g.__format,s!==a.__format&&ml(x,s),C){s=Un,Un="",C=In;var D=a.__size,Q=g.__size;if(In="",D===1&&Q===1){var ge=a.__first;if(i=g.__first,ge===i)Ii(ge,x);else{var Ae=Lo(ge);i=Nr(i,null,null),x.replaceChild(i,Ae),Ro(ge,null)}}else{i=bo(a,ar);var Ye=bo(g,Cn);if(D===0)Q!==0&&_l(Ye,g,0,Q-1,x,null);else if(Q===0)D!==0&&(ge=x.__lexicalLineBreak==null,gs(i,0,D-1,ge?null:x),ge&&(x.textContent=""));else{var Xe=i;i=Ye,Ye=D-1,D=Q-1;let Pe=x.firstChild,pt=0;for(Q=0;pt<=Ye&&Q<=D;){var Ke=Xe[pt];let Ot=i[Q];if(Ke===Ot)Pe=ps(Ii(Ot,x)),pt++,Q++;else{ge===void 0&&(ge=new Set(Xe)),Ae===void 0&&(Ae=new Set(i));let Bt=Ae.has(Ke),Kt=ge.has(Ot);Bt?(Kt?(Ke=cn(Hn,Ot),Ke===Pe?Pe=ps(Ii(Ot,x)):(Pe!=null?x.insertBefore(Ke,Pe):x.appendChild(Ke),Ii(Ot,x)),pt++):Nr(Ot,x,Pe),Q++):(Pe=ps(Lo(Ke)),Ro(Ke,x),pt++)}}ge=pt>Ye,Ae=Q>D,ge&&!Ae?(ge=i[D+1],ge=ge===void 0?null:Hn.getElementByKey(ge),_l(i,g,Q,D,x,ge)):Ae&&!ge&&gs(Xe,pt,Ye,x)}}rn(g)&&(In+=`
53
+
54
+ `),x.__lexicalTextContent=In,In=C+In,ma(g,x),Un=s,or(g)||g.isInline()||yl(a,g,x)}rn(g)&&(In+=`
55
+
56
+ `,ni+=`
57
+
58
+ `)}else a=g.getTextContent(),En(g)?(C=g.decorate(Hn,kr),C!==null&&Nl(s,C)):Ct(g)&&!g.isDirectionless()&&(Un+=a),In+=a,ni+=a;return!gl&&or(g)&&g.__cachedText!==ni&&(g.getWritable().__cachedText=ni),x}function Nl(s,i){let a=Hn._pendingDecorators,g=Hn._decorators;if(a===null){if(g[s]===i)return;a=tn(Hn)}a[s]=i}function ps(s){return s=s.nextSibling,s!==null&&s===Hn._blockCursorElement&&(s=s.nextSibling),s}function Lo(s){let i=hs.get(s);return i===void 0&&Y(75,s),i}let Pr=Object.freeze({}),Cl=[["keydown",Lc],["pointerdown",Ac],["compositionstart",Sa],["compositionend",bc],["input",va],["click",Dc],["cut",Pr],["copy",Pr],["dragstart",Pr],["dragover",Pr],["dragend",Pr],["paste",Pr],["focus",Pr],["blur",Pr],["drop",Pr]];X&&Cl.push(["beforeinput",(s,i)=>Rc(s,i)]);let Io=0,_a=0,ya=0,so=null,ko=0,El=!1,Tl=!1,Po=!1,$o=!1,Na=[0,"",0,"root",0];function Ca(s,i,a,g,C){let x=s.anchor,D=s.focus,Q=x.getNode();var ge=dn();let Ae=Yr(ge._window),Ye=Ae!==null?Ae.anchorNode:null,Xe=x.key;ge=ge.getElementByKey(Xe);let Ke=a.length;return Xe!==D.key||!Ct(Q)||(!C&&(!X||ya<g+50)||Q.isDirty()&&2>Ke||mi(a))&&x.offset!==D.offset&&!Q.isComposing()||Ue(Q)||Q.isDirty()&&1<Ke||(C||!X)&&ge!==null&&!Q.isComposing()&&Ye!==Ge(ge)||Ae!==null&&i!==null&&(!i.collapsed||i.startContainer!==Ae.anchorNode||i.startOffset!==Ae.anchorOffset)||Q.getFormat()!==s.format||Q.getStyle()!==s.style||St(s,Q)}function Ea(s,i){return s!==null&&s.nodeValue!==null&&s.nodeType===3&&i!==0&&i!==s.nodeValue.length}function Ta(s,i,a){let{anchorNode:g,anchorOffset:C,focusNode:x,focusOffset:D}=s;El&&(El=!1,Ea(g,C)&&Ea(x,D))||Er(i,()=>{if(!a)Qt(null);else if(st(i,g,x)){var Q=jt();if(Rt(Q)){var ge=Q.anchor,Ae=ge.getNode();if(Q.isCollapsed()){s.type==="Range"&&s.anchorNode===s.focusNode&&(Q.dirty=!0);var Ye=Ln(i).event;Ye=Ye?Ye.timeStamp:performance.now();let[Ke,Pe,pt,Ot,Bt]=Na;var Xe=bt();if(Xe=i.isComposing()===!1&&Xe.getTextContent()==="",Ye<Bt+200&&ge.offset===pt&&ge.key===Ot)Q.format=Ke,Q.style=Pe;else if(ge.type==="text"){if(!Ct(Ae))throw Error("Point.getNode() must return TextNode when type is text");Q.format=Ae.getFormat(),Q.style=Ae.getStyle()}else ge.type!=="element"||Xe||(Q.format=0,Q.style="")}else{ge=255,Ae=!1,Ye=Q.getNodes(),Xe=Ye.length;for(let Ke=0;Ke<Xe;Ke++){let Pe=Ye[Ke];if(Ct(Pe)&&(Ae=!0,ge&=Pe.getFormat(),ge===0))break}Q.format=Ae?ge:0}}at(i,e,void 0)}})}function Dc(s,i){Er(i,()=>{let a=jt();var g=Yr(i._window);let C=Cr();if(g)if(Rt(a)){let D=a.anchor;var x=D.getNode();D.type==="element"&&D.offset===0&&a.isCollapsed()&&!or(x)&&bt().getChildrenSize()===1&&x.getTopLevelElementOrThrow().isEmpty()&&C!==null&&a.is(C)?(g.removeAllRanges(),a.dirty=!0):s.detail!==3||a.isCollapsed()||(g=a.focus.getNode(),x!==g&&(Je(x)?x.select(0):x.getParentOrThrow().select(0)))}else s.pointerType==="touch"&&(x=g.anchorNode,x!==null&&(x=x.nodeType,x===1||x===3))&&(g=Yn(C,g,i,s),Qt(g));at(i,t,s)})}function Ac(s,i){let a=s.target;s=s.pointerType,a instanceof Node&&s!=="touch"&&Er(i,()=>{En(Ht(a))||(Tl=!0)})}function xa(s){return s.getTargetRanges?(s=s.getTargetRanges(),s.length===0?null:s[0]):null}function Mc(s,i){return s!==i||Je(s)||Je(i)||!s.isToken()||!i.isToken()}function Rc(s,i){let a=s.inputType,g=xa(s);a==="deleteCompositionText"||U&&Nn(i)||a!=="insertCompositionText"&&Er(i,()=>{let C=jt();if(a==="deleteContentBackward"){if(C===null){var x=Cr();if(!Rt(x))return;Qt(x.clone())}if(Rt(C)){if(B&&gt(C.anchor.key),_a===229&&s.timeStamp<Io+30&&i.isComposing()&&C.anchor.key===C.focus.key){if(gt(null),Io=0,setTimeout(()=>{Er(i,()=>{gt(null)})},30),Rt(C)){if(x=C.anchor.getNode(),x.markDirty(),C.format=x.getFormat(),!Ct(x))throw Error("Anchor node must be a TextNode");C.style=x.getStyle()}1>=C.anchor.getNode().getTextContent().length&&(s.preventDefault(),at(i,n,!0))}else gt(null),s.preventDefault(),at(i,n,!0);return}}if(Rt(C)){x=s.data,so!==null&&Ze(!1,i,so),C.dirty&&so===null||!C.isCollapsed()||or(C.anchor.getNode())||g===null||C.applyDOMRange(g),so=null;var D=C.focus,Q=C.anchor.getNode();if(D=D.getNode(),a==="insertText"||a==="insertTranspose")x===`
59
+ `?(s.preventDefault(),at(i,r,!1)):x===`
60
+
61
+ `?(s.preventDefault(),at(i,l,void 0)):x==null&&s.dataTransfer?(x=s.dataTransfer.getData("text/plain"),s.preventDefault(),C.insertRawText(x)):x!=null&&Ca(C,g,x,s.timeStamp,!0)?(s.preventDefault(),at(i,d,x)):so=x,ya=s.timeStamp;else switch(s.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":at(i,d,s);break;case"insertFromComposition":gt(null),at(i,d,s);break;case"insertLineBreak":gt(null),at(i,r,!1);break;case"insertParagraph":gt(null),Po&&!_e?(Po=!1,at(i,r,!1)):at(i,l,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":at(i,f,s);break;case"deleteByComposition":Mc(Q,D)&&at(i,p,s);break;case"deleteByDrag":case"deleteByCut":at(i,p,s);break;case"deleteContent":at(i,n,!1);break;case"deleteWordBackward":at(i,_,!0);break;case"deleteWordForward":at(i,_,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":at(i,T,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":at(i,T,!1);break;case"formatStrikeThrough":at(i,E,"strikethrough");break;case"formatBold":at(i,E,"bold");break;case"formatItalic":at(i,E,"italic");break;case"formatUnderline":at(i,E,"underline");break;case"historyUndo":at(i,S,void 0);break;case"historyRedo":at(i,w,void 0)}}})}function va(s,i){s.stopPropagation(),Er(i,()=>{var a=jt(),g=s.data,C=xa(s);if(g!=null&&Rt(a)&&Ca(a,C,g,s.timeStamp,!1)){$o&&(xl(i,g),$o=!1);var x=a.anchor,D=x.getNode();if(C=Yr(i._window),C===null)return;let Q=x.offset;(x=X&&!a.isCollapsed()&&Ct(D)&&C.anchorNode!==null)&&(D=D.getTextContent().slice(0,Q)+g+D.getTextContent().slice(Q+a.focus.offset),C=C.anchorNode,x=D===(C.nodeType===3?C.nodeValue:null)),x||at(i,d,g),g=g.length,U&&1<g&&s.inputType==="insertCompositionText"&&!i.isComposing()&&(a.anchor.offset-=g),fe||_e||F||!i.isComposing()||(Io=0,gt(null))}else Ze(!1,i,g!==null?g:void 0),$o&&(xl(i,g||void 0),$o=!1);Xn(),a=dn(),Vt(a)}),so=null}function Sa(s,i){Er(i,()=>{let a=jt();if(Rt(a)&&!i.isComposing()){let g=a.anchor,C=a.anchor.getNode();gt(g.key),(s.timeStamp<Io+30||g.type==="element"||!a.isCollapsed()||C.getFormat()!==a.format||Ct(C)&&C.getStyle()!==a.style)&&at(i,d,ye)}})}function xl(s,i){var a=s._compositionKey;if(gt(null),a!==null&&i!=null){if(i===""){i=mt(a),s=Ge(s.getElementByKey(a)),s!==null&&s.nodeValue!==null&&Ct(i)&&nt(i,s.nodeValue,null,null,!0);return}if(i[i.length-1]===`
62
+ `&&(a=jt(),Rt(a))){i=a.focus,a.anchor.set(i.key,i.offset,i.type),at(s,H,null);return}}Ze(!0,s,i)}function bc(s,i){U?$o=!0:Er(i,()=>{xl(i,s.data)})}function Lc(s,i){if(Io=s.timeStamp,_a=s.keyCode,!i.isComposing()){var{keyCode:a,shiftKey:g,ctrlKey:C,metaKey:x,altKey:D}=s;if(!at(i,M,s)){if(a!==39||C||x||D)if(a!==39||D||g||!C&&!x)if(a!==37||C||x||D)if(a!==37||D||g||!C&&!x)if(a!==38||C||x)if(a!==40||C||x)if(a===13&&g)Po=!0,at(i,H,s);else if(a===32)at(i,j,s);else if(R&&C&&a===79)s.preventDefault(),Po=!0,at(i,r,!0);else if(a!==13||g){var Q=R?D||x?!1:a===8||a===72&&C:C||D||x?!1:a===8;Q?a===8?at(i,re,s):(s.preventDefault(),at(i,n,!0)):a===27?at(i,te,s):(Q=R?g||D||x?!1:a===46||a===68&&C:C||D||x?!1:a===46,Q?a===46?at(i,ce,s):(s.preventDefault(),at(i,n,!1)):a===8&&(R?D:C)?(s.preventDefault(),at(i,_,!0)):a===46&&(R?D:C)?(s.preventDefault(),at(i,_,!1)):R&&x&&a===8?(s.preventDefault(),at(i,T,!0)):R&&x&&a===46?(s.preventDefault(),at(i,T,!1)):a===66&&!D&&(R?x:C)?(s.preventDefault(),at(i,E,"bold")):a===85&&!D&&(R?x:C)?(s.preventDefault(),at(i,E,"underline")):a===73&&!D&&(R?x:C)?(s.preventDefault(),at(i,E,"italic")):a!==9||D||C||x?a===90&&!g&&(R?x:C)?(s.preventDefault(),at(i,S,void 0)):(Q=R?a===90&&x&&g:a===89&&C||a===90&&C&&g,Q?(s.preventDefault(),at(i,w,void 0)):cr(i._editorState._selection)?(Q=g?!1:a===67?R?x:C:!1,Q?(s.preventDefault(),at(i,Ee,s)):(Q=g?!1:a===88?R?x:C:!1,Q?(s.preventDefault(),at(i,de,s)):a===65&&(R?x:C)&&(s.preventDefault(),at(i,K,s)))):!U&&a===65&&(R?x:C)&&(s.preventDefault(),at(i,K,s))):at(i,V,s))}else Po=!1,at(i,H,s);else at(i,P,s);else at(i,I,s);else at(i,G,s);else at(i,k,s);else at(i,v,s);else at(i,m,s);(C||g||D||x)&&at(i,se,s)}}}function wa(s){let i=s.__lexicalEventHandles;return i===void 0&&(i=[],s.__lexicalEventHandles=i),i}let lo=new Map;function Oa(s){var i=s.target;let a=Yr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(a!==null){var g=wt(a.anchorNode);if(g!==null){Tl&&(Tl=!1,Er(g,()=>{var Q=Cr(),ge=a.anchorNode;ge!==null&&(ge=ge.nodeType,ge===1||ge===3)&&(Q=Yn(Q,a,g,s),Qt(Q))})),i=_i(g),i=i[i.length-1];var C=i._key,x=lo.get(C),D=x||i;D!==g&&Ta(a,D,!1),Ta(a,g,!0),g!==i?lo.set(C,g):x&&lo.delete(C)}}}function Ic(s,i){ko===0&&s.ownerDocument.addEventListener("selectionchange",Oa),ko++,s.__lexicalEditor=i;let a=wa(s);for(let g=0;g<Cl.length;g++){let[C,x]=Cl[g],D=typeof x=="function"?Q=>{Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()&&x(Q,i))}:Q=>{if(Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()))switch(C){case"cut":return at(i,de,Q);case"copy":return at(i,Ee,Q);case"paste":return at(i,f,Q);case"dragstart":return at(i,q,Q);case"dragover":return at(i,Te,Q);case"dragend":return at(i,Se,Q);case"focus":return at(i,O,Q);case"blur":return at(i,Z,Q);case"drop":return at(i,z,Q)}};s.addEventListener(C,D),a.push(()=>{s.removeEventListener(C,D)})}}function vl(s,i,a){Xn();var g=s.__key;let C=s.getParent();if(C!==null){var x=jt();if(Rt(x)&&Je(s)){var{anchor:D,focus:Q}=x,ge=D.getNode(),Ae=Q.getNode();nr(ge,s)&&D.set(s.__key,0,"element"),nr(Ae,s)&&Q.set(s.__key,0,"element")}if(ge=x,Ae=!1,Rt(ge)&&i){x=ge.anchor;let Ye=ge.focus;x.key===g&&(fo(x,s,C,s.getPreviousSibling(),s.getNextSibling()),Ae=!0),Ye.key===g&&(fo(Ye,s,C,s.getPreviousSibling(),s.getNextSibling()),Ae=!0)}else cr(ge)&&i&&s.isSelected()&&s.selectPrevious();Rt(ge)&&i&&!Ae?(g=s.getIndexWithinParent(),Nt(s),Wn(ge,C,g,-1)):Nt(s),a||Jn(C)||C.canBeEmpty()||!C.isEmpty()||vl(C,i),i&&or(C)&&C.isEmpty()&&C.selectEnd()}}class Fo{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,yt(this,i)}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=mt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||jt(),i==null)return!1;let a=i.getNodes().some(g=>g.__key===this.__key);return Ct(this)?a:Rt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:a}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let a=0;for(;i!==null;){if(this.is(i))return a;a++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:mt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let a=i.getParent();if(Jn(a)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=a}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],a=this.getParent();for(;a!==null;)i.push(a),a=a.getParent();return i}getParentKeys(){let i=[],a=this.getParent();for(;a!==null;)i.push(a.__key),a=a.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:mt(i)}getPreviousSiblings(){let i=[];var a=this.getParent();if(a===null)return i;for(a=a.getFirstChild();a!==null&&!a.is(this);)i.push(a),a=a.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:mt(i)}getNextSiblings(){let i=[],a=this.getNextSibling();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getCommonAncestor(i){let a=this.getParents();var g=i.getParents();Je(this)&&a.unshift(this),Je(i)&&g.unshift(i),i=a.length;var C=g.length;if(i===0||C===0||a[i-1]!==g[C-1])return null;for(g=new Set(g),C=0;C<i;C++){let x=a[C];if(g.has(x))return x}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 a=this.getCommonAncestor(i);let g=this;for(;;){var C=g.getParentOrThrow();if(C===a){C=g.getIndexWithinParent();break}g=C}for(g=i;;){if(i=g.getParentOrThrow(),i===a){a=g.getIndexWithinParent();break}g=i}return C<a}isParentOf(i){let a=this.__key;if(a===i.__key)return!1;for(;i!==null;){if(i.__key===a)return!0;i=i.getParent()}return!1}getNodesBetween(i){let a=this.isBefore(i),g=[],C=new Set;for(var x=this;;){var D=x.__key;if(C.has(D)||(C.add(D),g.push(x)),x===i)break;if(D=Je(x)?a?x.getFirstChild():x.getLastChild():null,D!==null)x=D;else if(D=a?x.getNextSibling():x.getPreviousSibling(),D!==null)x=D;else{if(x=x.getParentOrThrow(),C.has(x.__key)||g.push(x),x===i)break;D=x;do D===null&&Y(68),x=a?D.getNextSibling():D.getPreviousSibling(),D=D.getParent(),D!==null&&(x!==null||C.has(D.__key)||g.push(D));while(x===null)}}return a||g.reverse(),g}isDirty(){let i=dn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=mt(this.__key);return i===null&&Y(113),i}getWritable(){Xn();var i=Fr(),a=dn();i=i._nodeMap;let g=this.__key,C=this.getLatest(),x=C.__parent;a=a._cloneNotNeeded;var D=jt();return Wo(D)&&D.setCachedNodes(null),a.has(g)?(Tt(C),C):(D=C.constructor.clone(C),D.__parent=x,D.__next=C.__next,D.__prev=C.__prev,Je(C)&&Je(D)?(D.__first=C.__first,D.__last=C.__last,D.__size=C.__size,D.__indent=C.__indent,D.__format=C.__format,D.__dir=C.__dir):Ct(C)&&Ct(D)&&(D.__format=C.__format,D.__style=C.__style,D.__mode=C.__mode,D.__detail=C.__detail),a.add(g),D.__key=g,Tt(D),i.set(g,D),D)}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){vl(this,!0,i)}replace(i,a){Xn();var g=jt();g!==null&&(g=g.clone()),Do(this,i);let C=this.getLatest(),x=this.__key,D=i.__key,Q=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;Nt(Q);let Ae=C.getPreviousSibling(),Ye=C.getNextSibling(),Xe=C.__prev,Ke=C.__next,Pe=C.__parent;if(vl(C,!1,!0),Ae===null?i.__first=D:Ae.getWritable().__next=D,Q.__prev=Xe,Ye===null?i.__last=D:Ye.getWritable().__prev=D,Q.__next=Ke,Q.__parent=Pe,i.__size=ge,a){if(!Je(this)||!Je(Q))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(pt=>{Q.append(pt)})}return Rt(g)&&(Qt(g),a=g.anchor,g=g.focus,a.key===x&&ii(a,Q),g.key===x&&ii(g,Q)),xt()===x&&gt(D),Q}insertAfter(i,a=!0){Xn(),Do(this,i);var g=this.getWritable();let C=i.getWritable();var x=C.getParent();let D=jt();var Q=!1,ge=!1;if(x!==null){var Ae=i.getIndexWithinParent();Nt(C),Rt(D)&&(ge=x.__key,Q=D.anchor,x=D.focus,Q=Q.type==="element"&&Q.key===ge&&Q.offset===Ae+1,ge=x.type==="element"&&x.key===ge&&x.offset===Ae+1)}x=this.getNextSibling(),Ae=this.getParentOrThrow().getWritable();let Ye=C.__key,Xe=g.__next;return x===null?Ae.__last=Ye:x.getWritable().__prev=Ye,Ae.__size++,g.__next=Ye,C.__next=Xe,C.__prev=g.__key,C.__parent=g.__parent,a&&Rt(D)&&(a=this.getIndexWithinParent(),Wn(D,Ae,a+1),g=Ae.__key,Q&&D.anchor.set(g,a+2,"element"),ge&&D.focus.set(g,a+2,"element")),i}insertBefore(i,a=!0){Xn(),Do(this,i);var g=this.getWritable();let C=i.getWritable(),x=C.__key;Nt(C);let D=this.getPreviousSibling(),Q=this.getParentOrThrow().getWritable(),ge=g.__prev,Ae=this.getIndexWithinParent();return D===null?Q.__first=x:D.getWritable().__next=x,Q.__size++,g.__prev=x,C.__prev=ge,C.__next=g.__key,C.__parent=g.__parent,g=jt(),a&&Rt(g)&&(a=this.getParentOrThrow(),Wn(g,a,Ae)),i}isParentRequired(){return!1}createParentElementNode(){return Hr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,a){Xn();let g=this.getPreviousSibling(),C=this.getParentOrThrow();return g===null?C.select(0,0):Je(g)?g.select():Ct(g)?g.select(i,a):(i=g.getIndexWithinParent()+1,C.select(i,i))}selectNext(i,a){Xn();let g=this.getNextSibling(),C=this.getParentOrThrow();return g===null?C.select():Je(g)?g.select(0,0):Ct(g)?g.select(i,a):(i=g.getIndexWithinParent(),C.select(i,i))}markDirty(){this.getWritable()}}function kc(s,i,a){a=a||i.getParentOrThrow().getLastChild();let g=i;for(i=[i];g!==a;){if(!g.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");g=g.getNextSibling(),i.push(g)}for(let C of i)s=s.insertAfter(C)}class Vr extends Fo{static getType(){return"linebreak"}static clone(i){return new Vr(i.__key)}constructor(i){super(i)}getTextContent(){return`
63
+ `}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let a=i.parentElement,g,C;return a!==null&&((g=a.firstChild)===i||g.nextSibling===i&&g.nodeType===3&&(g.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((C=a.lastChild)===i||C.previousSibling===i&&C.nodeType===3&&(C.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Da,priority:0}}}}static importJSON(){return qr()}exportJSON(){return{type:"linebreak",version:1}}}function Da(){return{node:qr()}}function qr(){return rr(new Vr)}function ki(s){return s instanceof Vr}function Pi(s,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function ms(s,i){return i&1?"strong":i&2?"em":"span"}function Sl(s,i,a,g,C){s=g.classList,g=Pt(C,"base"),g!==void 0&&s.add(...g),g=Pt(C,"underlineStrikethrough");let x=!1,D=i&8&&i&4;var Q=a&8&&a&4;g!==void 0&&(Q?(x=!0,D||s.add(...g)):D&&s.remove(...g));for(let ge in ne)Q=ne[ge],g=Pt(C,ge),g!==void 0&&(a&Q?!x||ge!=="underline"&&ge!=="strikethrough"?(!(i&Q)||D&&ge==="underline"||ge==="strikethrough")&&s.add(...g):i&Q&&s.remove(...g):i&Q&&s.remove(...g))}function $i(s,i,a){let g=i.firstChild;if(a=a.isComposing(),s+=a?oe:"",g==null)i.textContent=s;else if(i=g.nodeValue,i!==s)if(a||U){a=i.length;let C=s.length,x=0,D=0;for(;x<a&&x<C&&i[x]===s[x];)x++;for(;D+x<a&&D+x<C&&i[a-D-1]===s[C-D-1];)D++;s=[x,a-x-D,s.slice(x,C-D)];let[Q,ge,Ae]=s;ge!==0&&g.deleteData(Q,ge),g.insertData(Q,Ae)}else g.nodeValue=s}function ao(s,i){return i=document.createElement(i),i.appendChild(s),i}class Fi extends Fo{static getType(){return"text"}static clone(i){return new Fi(i.__text,i.__key)}constructor(i,a){super(a),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 ke[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===xt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(this.getLatest().__detail&1)!==0}isUnmergeable(){return(this.getLatest().__detail&2)!==0}hasFormat(i){return i=ne[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,a){let g=this.getLatest().__format;return tt(g,i,a)}createDOM(i){var a=this.__format,g=Pi(this,a);let C=ms(this,a),x=document.createElement(g===null?C:g),D=x;return this.hasFormat("code")&&x.setAttribute("spellcheck","false"),g!==null&&(D=document.createElement(C),x.appendChild(D)),g=D,$i(this.__text,g,this),i=i.theme.text,i!==void 0&&Sl(C,0,a,g,i),a=this.__style,a!==""&&(x.style.cssText=a),x}updateDOM(i,a,g){let C=this.__text;var x=i.__format,D=this.__format,Q=Pi(this,x);let ge=Pi(this,D);var Ae=ms(this,x);let Ye=ms(this,D);return(Q===null?Ae:Q)!==(ge===null?Ye:ge)?!0:Q===ge&&Ae!==Ye?(x=a.firstChild,x==null&&Y(48),i=Q=document.createElement(Ye),$i(C,i,this),g=g.theme.text,g!==void 0&&Sl(Ye,0,D,i,g),a.replaceChild(Q,x),!1):(Ae=a,ge!==null&&Q!==null&&(Ae=a.firstChild,Ae==null&&Y(49)),$i(C,Ae,this),g=g.theme.text,g!==void 0&&x!==D&&Sl(Ye,x,D,Ae,g),D=this.__style,i.__style!==D&&(a.style.cssText=D),!1)}static importDOM(){return{"#text":()=>({conversion:ut,priority:0}),b:()=>({conversion:wl,priority:0}),code:()=>({conversion:yi,priority:0}),em:()=>({conversion:yi,priority:0}),i:()=>({conversion:yi,priority:0}),s:()=>({conversion:yi,priority:0}),span:()=>({conversion:Aa,priority:0}),strong:()=>({conversion:yi,priority:0}),sub:()=>({conversion:yi,priority:0}),sup:()=>({conversion:yi,priority:0}),u:()=>({conversion:yi,priority:0})}}static importJSON(i){let a=Gn(i.text);return a.setFormat(i.format),a.setDetail(i.detail),a.setMode(i.mode),a.setStyle(i.style),a}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&fs(i)||Y(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=ao(i,"b")),this.hasFormat("italic")&&(i=ao(i,"i")),this.hasFormat("strikethrough")&&(i=ao(i,"s")),this.hasFormat("underline")&&(i=ao(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 a=this.getWritable();return a.__format=typeof i=="string"?ne[i]:i,a}setDetail(i){let a=this.getWritable();return a.__detail=typeof i=="string"?ue[i]:i,a}setStyle(i){let a=this.getWritable();return a.__style=i,a}toggleFormat(i){let a=this.getFormat();return i=tt(a,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=Re[i],this.__mode===i)return this;let a=this.getWritable();return a.__mode=i,a}setTextContent(i){if(this.__text===i)return this;let a=this.getWritable();return a.__text=i,a}select(i,a){Xn();let g=jt();var C=this.getTextContent();let x=this.__key;if(typeof C=="string"?(C=C.length,i===void 0&&(i=C),a===void 0&&(a=C)):a=i=0,Rt(g))C=xt(),C!==g.anchor.key&&C!==g.focus.key||gt(x),g.setTextNodeRange(this,i,this,a);else return Al(x,i,x,a,"text","text");return g}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,a,g,C){let x=this.getWritable(),D=x.__text,Q=g.length,ge=i;0>ge&&(ge=Q+ge,0>ge&&(ge=0));let Ae=jt();return C&&Rt(Ae)&&(i+=Q,Ae.setTextNodeRange(x,i,x,i)),a=D.slice(0,ge)+g+D.slice(ge+a),x.__text=a,x}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Xn();var a=this.getLatest(),g=a.getTextContent(),C=a.__key,x=xt(),D=new Set(i);i=[];for(var Q=g.length,ge="",Ae=0;Ae<Q;Ae++)ge!==""&&D.has(Ae)&&(i.push(ge),ge=""),ge+=g[Ae];if(ge!==""&&i.push(ge),D=i.length,D===0)return[];if(i[0]===g)return[a];var Ye=i[0];g=a.getParentOrThrow(),Ae=a.getFormat();let Xe=a.getStyle(),Ke=a.__detail;Q=!1,a.isSegmented()?(ge=Gn(Ye),ge.__format=Ae,ge.__style=Xe,ge.__detail=Ke,Q=!0):(ge=a.getWritable(),ge.__text=Ye),a=jt(),ge=[ge],Ye=Ye.length;for(let Ot=1;Ot<D;Ot++){var Pe=i[Ot],pt=Pe.length;Pe=Gn(Pe).getWritable(),Pe.__format=Ae,Pe.__style=Xe,Pe.__detail=Ke;let Bt=Pe.__key;if(pt=Ye+pt,Rt(a)){let Kt=a.anchor,jn=a.focus;Kt.key===C&&Kt.type==="text"&&Kt.offset>Ye&&Kt.offset<=pt&&(Kt.key=Bt,Kt.offset-=Ye,a.dirty=!0),jn.key===C&&jn.type==="text"&&jn.offset>Ye&&jn.offset<=pt&&(jn.key=Bt,jn.offset-=Ye,a.dirty=!0)}x===C&&gt(Bt),Ye=pt,ge.push(Pe)}return C=this.getPreviousSibling(),x=this.getNextSibling(),C!==null&&Tt(C),x!==null&&Tt(x),C=g.getWritable(),x=this.getIndexWithinParent(),Q?(C.splice(x,0,ge),this.remove()):C.splice(x,1,ge),Rt(a)&&Wn(a,g,x,D-1),ge}mergeWithSibling(i){var a=i===this.getPreviousSibling();a||i===this.getNextSibling()||Y(50);var g=this.__key;let C=i.__key,x=this.__text,D=x.length;xt()===C&&gt(g);let Q=jt();if(Rt(Q)){let ge=Q.anchor,Ae=Q.focus;ge!==null&&ge.key===C&&(zo(ge,a,g,i,D),Q.dirty=!0),Ae!==null&&Ae.key===C&&(zo(Ae,a,g,i,D),Q.dirty=!0)}return g=i.__text,this.setTextContent(a?g+x:x+g),a=this.getWritable(),i.remove(),a}isTextEntity(){return!1}}function Aa(s){let i=s.style.fontWeight==="700",a=s.style.textDecoration==="line-through",g=s.style.fontStyle==="italic",C=s.style.textDecoration==="underline",x=s.style.verticalAlign;return{forChild:D=>(Ct(D)&&(i&&D.toggleFormat("bold"),a&&D.toggleFormat("strikethrough"),g&&D.toggleFormat("italic"),C&&D.toggleFormat("underline"),x==="sub"&&D.toggleFormat("subscript"),x==="super"&&D.toggleFormat("superscript")),D),node:null}}function wl(s){let i=s.style.fontWeight==="normal";return{forChild:a=>(Ct(a)&&!i&&a.toggleFormat("bold"),a),node:null}}let Ol=new WeakMap;function ut(s){s.parentElement===null&&Y(129);for(var i=s.textContent||"",a,g=s.parentNode,C=[s];g!==null&&(a=Ol.get(g))===void 0&&!(g.nodeName==="PRE"||g.nodeType===1&&g.style!==void 0&&g.style.whiteSpace!==void 0&&g.style.whiteSpace.startsWith("pre"));)C.push(g),g=g.parentNode;for(a=a===void 0?g:a,g=0;g<C.length;g++)Ol.set(C[g],a);if(a!==null){for(i=i.split(/(\r?\n|\t)/),s=[],C=i.length,a=0;a<C;a++)g=i[a],g===`
64
+ `||g===`\r
65
+ `?s.push(qr()):g===" "?s.push(Bi()):g!==""&&s.push(Gn(g));return{node:s}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(C=s,a=!0;C!==null&&(C=Bo(C,!1))!==null;)if(g=C.textContent||"",0<g.length){/[ \t\n]$/.test(g)&&(i=i.slice(1)),a=!1;break}a&&(i=i.slice(1))}if(i[i.length-1]===" "){for(C=!0;s!==null&&(s=Bo(s,!0))!==null;)if(0<(s.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){C=!1;break}C&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Gn(i)}}let _s=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 Bo(s,i){for(;;){for(var a=void 0;(a=i?s.nextSibling:s.previousSibling)===null;)if(s=s.parentElement,s===null)return null;if(s=a,s.nodeType===1&&(a=s.style.display,a===""&&s.nodeName.match(_s)===null||a!==""&&!a.startsWith("inline")))return null;for(;(a=i?s.firstChild:s.lastChild)!==null;)s=a;if(s.nodeType===3)return s;if(s.nodeName==="BR")return null}}let ys={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function yi(s){let i=ys[s.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:a=>(Ct(a)&&!a.hasFormat(i)&&a.toggleFormat(i),a),node:null}}function Gn(s=""){return rr(new Fi(s))}function Ct(s){return s instanceof Fi}class co extends Fi{static getType(){return"tab"}static clone(i){let a=new co(i.__key);return a.__text=i.__text,a.__format=i.__format,a.__style=i.__style,a}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let a=Bi();return a.setFormat(i.format),a.setStyle(i.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){Y(126)}setDetail(){Y(127)}setMode(){Y(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Bi(){return rr(new co)}function Ma(s){return s instanceof co}class Ns{constructor(i,a,g){this._selection=null,this.key=i,this.offset=a,this.type=g}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let a=this.getNode(),g=i.getNode(),C=this.offset;if(i=i.offset,Je(a)){var x=a.getDescendantByIndex(C);a=x??a}return Je(g)&&(x=g.getDescendantByIndex(i),g=x??g),a===g?C<i:a.isBefore(g)}getNode(){let i=mt(this.key);return i===null&&Y(20),i}set(i,a,g){let C=this._selection,x=this.key;this.key=i,this.offset=a,this.type=g,go()||(xt()===x&&gt(i),C!==null&&(C.setCachedNodes(null),C.dirty=!0))}}function $r(s,i,a){return new Ns(s,i,a)}function Cs(s,i){let a=i.__key,g=s.offset,C="element";if(Ct(i))C="text",i=i.getTextContentSize(),g>i&&(g=i);else if(!Je(i)){var x=i.getNextSibling();Ct(x)?(a=x.__key,g=0,C="text"):(x=i.getParent())&&(a=x.__key,g=i.getIndexWithinParent()+1)}s.set(a,g,C)}function ii(s,i){if(Je(i)){let a=i.getLastDescendant();Je(a)||Ct(a)?Cs(s,a):Cs(s,i)}else Cs(s,i)}function Dl(s,i,a,g){let C=s.getNode(),x=C.getChildAtIndex(s.offset),D=Gn(),Q=or(C)?Hr().append(D):D;D.setFormat(a),D.setStyle(g),x===null?C.append(Q):x.insertBefore(Q),s.is(i)&&i.set(D.__key,0,"text"),s.set(D.__key,0,"text")}function Or(s,i,a,g){s.key=i,s.offset=a,s.type=g}class Ho{constructor(i,a){this.anchor=i,this.focus=a,i._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Wo(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 Ts(this)}}class Es{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!cr(i))return!1;let a=this._nodes,g=i._nodes;return a.size===g.size&&Array.from(a).every(C=>g.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 Es(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let a=this.getNodes(),g=a.length;var C=a[g-1];if(Ct(C))C=C.select();else{let x=C.getIndexWithinParent()+1;C=C.getParentOrThrow().select(x,x)}for(C.insertNodes(i),i=0;i<g;i++)a[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var a=this._nodes;i=[];for(let g of a)a=mt(g),a!==null&&i.push(a);return go()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),a="";for(let g=0;g<i.length;g++)a+=i[g].getTextContent();return a}}function Rt(s){return s instanceof Ni}function Wo(s){return s instanceof Ho}class Ni extends Ho{constructor(i,a,g,C){super(i,a),this.format=g,this.style=C}is(i){return Rt(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 a=this.focus,g=i.isBefore(a),C=g?i:a;g=g?a:i,i=C.getNode(),a=g.getNode();let x=C.offset;return C=g.offset,Je(i)&&(g=i.getDescendantByIndex(x),i=g??i),Je(a)&&(g=a.getDescendantByIndex(C),g!==null&&g!==i&&a.getChildAtIndex(C)===g&&(g=g.getPreviousSibling()),a=g??a),i=i.is(a)?Je(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(a),go()||(this._cachedNodes=i),i}setTextNodeRange(i,a,g,C){Or(this.anchor,i.__key,a,"text"),Or(this.focus,g.__key,C,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let a=i[0],g=i[i.length-1],C=this.anchor,x=this.focus,D=C.isBefore(x),[Q,ge]=Ts(this),Ae="",Ye=!0;for(let Xe=0;Xe<i.length;Xe++){let Ke=i[Xe];if(Je(Ke)&&!Ke.isInline())Ye||(Ae+=`
66
+ `),Ye=!Ke.isEmpty();else if(Ye=!1,Ct(Ke)){let Pe=Ke.getTextContent();Ke===a?Ke===g?(C.type!=="element"||x.type!=="element"||x.offset===C.offset)&&(Pe=Q<ge?Pe.slice(Q,ge):Pe.slice(ge,Q)):Pe=D?Pe.slice(Q):Pe.slice(ge):Ke===g&&(Pe=D?Pe.slice(0,ge):Pe.slice(0,Q)),Ae+=Pe}else!En(Ke)&&!ki(Ke)||Ke===g&&this.isCollapsed()||(Ae+=Ke.getTextContent())}return Ae}applyDOMRange(i){let a=dn(),g=a.getEditorState()._selection;if(i=La(i.startContainer,i.startOffset,i.endContainer,i.endOffset,a,g),i!==null){var[C,x]=i;Or(this.anchor,C.key,C.offset,C.type),Or(this.focus,x.key,x.offset,x.type),this._cachedNodes=null}}clone(){let i=this.anchor,a=this.focus;return new Ni($r(i.key,i.offset,i.type),$r(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(i){this.format=tt(this.format,i,null),this.dirty=!0}setStyle(i){this.style=i,this.dirty=!0}hasFormat(i){return(this.format&ne[i])!==0}insertRawText(i){i=i.split(/(\r?\n|\t)/);let a=[],g=i.length;for(let C=0;C<g;C++){let x=i[C];x===`
67
+ `||x===`\r
68
+ `?a.push(qr()):x===" "?a.push(Bi()):a.push(Gn(x))}this.insertNodes(a)}insertText(i){var a=this.anchor,g=this.focus,C=this.isCollapsed()||a.isBefore(g),x=this.format,D=this.style;C&&a.type==="element"?Dl(a,g,x,D):C||g.type!=="element"||Dl(g,a,x,D);var Q=this.getNodes(),ge=Q.length,Ae=C?g:a;g=(C?a:g).offset;var Ye=Ae.offset;a=Q[0],Ct(a)||Y(26),C=a.getTextContent().length;var Xe=a.getParentOrThrow(),Ke=Q[ge-1];if(this.isCollapsed()&&g===C&&(a.isSegmented()||a.isToken()||!a.canInsertTextAfter()||!Xe.canInsertTextAfter()&&a.getNextSibling()===null)){var Pe=a.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ue(Pe)||(Pe=Gn(),Pe.setFormat(x),Xe.canInsertTextAfter()?a.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),a=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&g===0&&(a.isSegmented()||a.isToken()||!a.canInsertTextBefore()||!Xe.canInsertTextBefore()&&a.getPreviousSibling()===null)){if(Pe=a.getPreviousSibling(),(!Ct(Pe)||Ue(Pe))&&(Pe=Gn(),Pe.setFormat(x),Xe.canInsertTextBefore()?a.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),a=Pe,i!==""){this.insertText(i);return}}else if(a.isSegmented()&&g!==C)Xe=Gn(a.getTextContent()),Xe.setFormat(x),a.replace(Xe),a=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),xs(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(a.isToken())i=Gn(i),i.select(),a.replace(i);else{if(Q=a.getFormat(),ge=a.getStyle(),g===Ye&&(Q!==x||ge!==D))if(a.getTextContent()==="")a.setFormat(x),a.setStyle(D);else{Q=Gn(i),Q.setFormat(x),Q.setStyle(D),Q.select(),g===0?a.insertBefore(Q,!1):([ge]=a.splitText(g),ge.insertAfter(Q,!1)),Q.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(Ma(a)){i=Gn(i),i.setFormat(x),i.setStyle(D),i.select(),a.replace(i);return}a=a.spliceText(g,Ye-g,i,!0),a.getTextContent()===""?a.remove():this.anchor.type==="text"&&(a.isComposing()?this.anchor.offset-=i.length:(this.format=Q,this.style=ge))}else{if(x=new Set([...a.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(a)?a:a.getParentOrThrow(),D=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(D)&&D.isInline())do Xe=D,D=D.getParentOrThrow();while(D.isInline());if(Ae.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||Ae.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var pt=Gn(Ke.getTextContent());Ke.replace(pt),Ke=pt}or(Ae.getNode())||Ae.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),x.add(Ke.__key)}else Ae=Ke.getParentOrThrow(),Ae.canBeEmpty()||Ae.getChildrenSize()!==1?Ke.remove():Ae.remove();else x.add(Ke.__key);for(Ae=D.getChildren(),Ye=new Set(Q),Ke=Pe.is(D),Pe=Pe.isInline()&&a.getNextSibling()===null?Pe:a,pt=Ae.length-1;0<=pt;pt--){let Ot=Ae[pt];if(Ot.is(a)||Je(Ot)&&Ot.isParentOf(a))break;Ot.isAttached()&&(!Ye.has(Ot)||Ot.is(Xe)?Ke||Pe.insertAfter(Ot,!1):Ot.remove())}if(!Ke)for(Ae=D,D=null;Ae!==null;)Ye=Ae.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(D))&&(x.delete(Ae.__key),D=Ae),Ae=Ae.getParent();for(a.isToken()?g===C?a.select():(i=Gn(i),i.select(),a.replace(i)):(a=a.spliceText(g,C-g,i,!0),a.getTextContent()===""?a.remove():a.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)a=Q[i],x.has(a.__key)||a.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),gt(null);else{var a=this.getNodes(),g=[];for(var C of a)Ct(C)&&g.push(C);var x=g.length;if(x===0)this.toggleFormat(i),gt(null);else{C=this.anchor;var D=this.focus,Q=this.isBackward();a=Q?D:C,C=Q?C:D;var ge=0,Ae=g[0];if(D=a.type==="element"?0:a.offset,a.type==="text"&&D===Ae.getTextContentSize()&&(ge=1,Ae=g[1],D=0),Ae!=null){Q=Ae.getFormatFlags(i,null);var Ye=x-1,Xe=g[Ye];if(x=C.type==="text"?C.offset:Xe.getTextContentSize(),Ae.is(Xe))D!==x&&(D===0&&x===Ae.getTextContentSize()?Ae.setFormat(Q):(i=Ae.splitText(D,x),i=D===0?i[0]:i[1],i.setFormat(Q),a.type==="text"&&a.set(i.__key,0,"text"),C.type==="text"&&C.set(i.__key,x-D,"text")),this.format=Q);else{D!==0&&([,Ae]=Ae.splitText(D),D=0),Ae.setFormat(Q);var Ke=Xe.getFormatFlags(i,Q);for(0<x&&(x!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(x)),Xe.setFormat(Ke)),ge+=1;ge<Ye;ge++){let Pe=g[ge];if(!Pe.isToken()){let pt=Pe.getFormatFlags(i,Ke);Pe.setFormat(pt)}}a.type==="text"&&a.set(Ae.__key,D,"text"),C.type==="text"&&C.set(Xe.__key,x,"text"),this.format=Q|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var a=jt();if(!Rt(a))throw Error("Expected RangeSelection after insertParagraph");return a.insertNodes(i)}var g=Ao(this.anchor.getNode(),io);if(a=i[i.length-1],"__language"in g&&Je(g))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var C=Go(this);g.splice(C,0,i),a.selectEnd()}else if(i.some(Q=>(Je(Q)||En(Q))&&!Q.isInline())){a=Wi(i),i=a.getLastDescendant();var x=a.getChildren();a=Je(g)&&g.isEmpty()?null:this.insertParagraph(),C=x[x.length-1];var D=x[0];if((Q=>Je(Q)&&io(Q)&&!Q.isEmpty()&&Je(g)&&(!g.isEmpty()||"__value"in g&&"__checked"in g))(D)){if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");g.append(...D.getChildren()),D=x[1]}D&&kc(g,D),x=Ao(i,io),a&&Je(x)&&("__value"in a&&"__checked"in a||io(C))&&(x.append(...a.getChildren()),a.remove()),Je(g)&&g.isEmpty()&&g.remove(),i.selectEnd(),i=Je(g)?g.getLastChild():null,ki(i)&&x!==g&&i.remove()}else{if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");C=Go(this),g.splice(C,0,i),a.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Hr();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var a=Go(this);if(i=Ao(this.anchor.getNode(),io),!Je(i))throw Error("Expected ancestor to be an ElementNode");return a=(a=i.getChildAtIndex(a))?[a,...a.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...a),i.selectStart(),i):null}insertLineBreak(i){var a=qr();this.insertNodes([a]),i&&(i=a.getParentOrThrow(),a=a.getIndexWithinParent(),i.select(a,a))}extract(){var i=this.getNodes(),a=i.length,g=a-1,C=this.anchor;let x=this.focus;var D=i[0];let Q=i[g],[ge,Ae]=Ts(this);return a===0?[]:a===1?Ct(D)&&!this.isCollapsed()?(i=ge>Ae?Ae:ge,g=D.splitText(i,ge>Ae?ge:Ae),i=i===0?g[0]:g[1],i!=null?[i]:[]):[D]:(a=C.isBefore(x),Ct(D)&&(C=a?ge:Ae,C===D.getTextContentSize()?i.shift():C!==0&&([,D]=D.splitText(C),i[0]=D)),Ct(Q)&&(D=Q.getTextContent().length,a=a?Ae:ge,a===0?i.pop():a!==D&&([Q]=Q.splitText(a),i[g]=Q)),i)}modify(i,a,g){var C=this.focus,x=this.anchor,D=i==="move",Q=Et(C,a);if(En(Q)&&!Q.isIsolated())D&&Q.isKeyboardSelectable()?(a=Ml(),a.add(Q.__key),Qt(a)):(i=a?Q.getPreviousSibling():Q.getNextSibling(),Ct(i)?(Q=i.__key,a=a?i.getTextContent().length:0,C.set(Q,a,"text"),D&&x.set(Q,a,"text")):(g=Q.getParentOrThrow(),Je(i)?(g=i.__key,Q=a?i.getChildrenSize():0):(Q=Q.getIndexWithinParent(),g=g.__key,a||Q++),C.set(g,Q,"element"),D&&x.set(g,Q,"element")));else if(x=dn(),C=Yr(x._window)){var ge=x._blockCursorElement,Ae=x._rootElement;if(Ae===null||ge===null||!Je(Q)||Q.isInline()||Q.canBeEmpty()||dl(ge,x,Ae),C.modify(i,a?"backward":"forward",g),0<C.rangeCount&&(Q=C.getRangeAt(0),x=this.anchor.getNode(),x=or(x)?x:fn(x),this.applyDOMRange(Q),this.dirty=!0,!D)){for(D=this.getNodes(),i=[],g=!1,ge=0;ge<D.length;ge++)Ae=D[ge],nr(Ae,x)?i.push(Ae):g=!0;g&&0<i.length&&(a?(a=i[0],Je(a)?a.selectStart():a.getParentOrThrow().selectStart()):(a=i[i.length-1],Je(a)?a.selectEnd():a.getParentOrThrow().selectEnd())),(C.anchorNode!==Q.startContainer||C.anchorOffset!==Q.startOffset)&&(a=this.focus,D=this.anchor,C=D.key,Q=D.offset,x=D.type,Or(D,a.key,a.offset,a.type),Or(a,C,Q,x),this._cachedNodes=null)}}}deleteCharacter(i){let a=this.isCollapsed();if(this.isCollapsed()){var g=this.anchor,C=this.focus,x=g.getNode();if(!i&&(g.type==="element"&&Je(x)&&g.offset===x.getChildrenSize()||g.type==="text"&&g.offset===x.getTextContentSize())){var D=x.getParent();if(D=x.getNextSibling()||(D===null?null:D.getNextSibling()),Je(D)&&D.isShadowRoot())return}if(D=Et(C,i),En(D)&&!D.isIsolated()){D.isKeyboardSelectable()&&Je(x)&&x.getChildrenSize()===0?(x.remove(),i=Ml(),i.add(D.__key),Qt(i)):(D.remove(),dn().dispatchCommand(e,void 0));return}if(!i&&Je(D)&&Je(x)&&x.isEmpty()){x.remove(),D.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&g.offset===0&&(g.type==="element"?g.getNode():g.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(D=C.type==="text"?C.getNode():null,x=g.type==="text"?g.getNode():null,D!==null&&D.isSegmented()){if(g=C.offset,C=D.getTextContentSize(),D.is(x)||i&&g!==C||!i&&g!==0){ba(D,i,g);return}}else if(x!==null&&x.isSegmented()&&(g=g.offset,C=x.getTextContentSize(),x.is(D)||i&&g!==0||!i&&g!==C)){ba(x,i,g);return}if(x=this.anchor,D=this.focus,g=x.getNode(),C=D.getNode(),g===C&&x.type==="text"&&D.type==="text"){var Q=x.offset,ge=D.offset;let Ae=Q<ge;C=Ae?Q:ge,ge=Ae?ge:Q,Q=ge-1,C!==Q&&(g=g.getTextContent().slice(C,ge),mi(g)||(i?D.offset=Q:x.offset=Q))}}}this.removeText(),i&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&or(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 cr(s){return s instanceof Es}function Ra(s){let i=s.offset;return s.type==="text"?i:(s=s.getNode(),i===s.getChildrenSize()?s.getTextContent().length:0)}function Ts(s){let i=s.anchor;return s=s.focus,i.type==="element"&&s.type==="element"&&i.key===s.key&&i.offset===s.offset?[0,0]:[Ra(i),Ra(s)]}function ba(s,i,a){let g=s.getTextContent().split(/(?=\s)/g),C=g.length,x=0,D=0;for(let Q=0;Q<C;Q++){let ge=g[Q],Ae=Q===C-1;if(D=x,x+=ge.length,i&&x===a||x>a||Ae){g.splice(Q,1),Ae&&(D=void 0);break}}i=g.join("").trim(),i===""?s.remove():(s.setTextContent(i),s.select(D,D))}function Ko(s,i,a,g){var C=i;if(s.nodeType===1){let Q=!1;var x=s.childNodes,D=x.length;C===D&&(Q=!0,C=D-1);let ge=x[C];if(D=!1,ge===g._blockCursorElement?(ge=x[C+1],D=!0):g._blockCursorElement!==null&&C--,g=wr(ge),Ct(g))C=Q?g.getTextContentSize():0;else{if(x=wr(s),x===null)return null;if(Je(x)?(s=x.getChildAtIndex(C),(i=Je(s))&&(i=s.getParent(),i=a===null||i===null||!i.canBeEmpty()||i!==a.getNode()),i&&(a=Q?s.getLastDescendant():s.getFirstDescendant(),a===null?(x=s,C=0):(s=a,x=Je(s)?s:s.getParentOrThrow())),Ct(s)?(g=s,x=null,C=Q?s.getTextContentSize():0):s!==x&&Q&&!D&&C++):(C=x.getIndexWithinParent(),C=i===0&&En(x)&&wr(s)===x?C:C+1,x=x.getParentOrThrow()),Je(x))return $r(x.__key,C,"element")}}else g=wr(s);return Ct(g)?$r(g.__key,C,"text"):null}function Hi(s,i,a){var g=s.offset,C=s.getNode();g===0?(g=C.getPreviousSibling(),C=C.getParent(),i?(a||!i)&&g===null&&Je(C)&&C.isInline()&&(i=C.getPreviousSibling(),Ct(i)&&(s.key=i.__key,s.offset=i.getTextContent().length)):Je(g)&&!a&&g.isInline()?(s.key=g.__key,s.offset=g.getChildrenSize(),s.type="element"):Ct(g)&&(s.key=g.__key,s.offset=g.getTextContent().length)):g===C.getTextContent().length&&(g=C.getNextSibling(),C=C.getParent(),i&&Je(g)&&g.isInline()?(s.key=g.__key,s.offset=0,s.type="element"):(a||i)&&g===null&&Je(C)&&C.isInline()&&!C.canInsertTextAfter()&&(i=C.getNextSibling(),Ct(i)&&(s.key=i.__key,s.offset=0)))}function xs(s,i,a){if(s.type==="text"&&i.type==="text"){var g=s.isBefore(i);let C=s.is(i);Hi(s,g,C),Hi(i,!g,C),C&&(i.key=s.key,i.offset=s.offset,i.type=s.type),g=dn(),g.isComposing()&&g._compositionKey!==s.key&&Rt(a)&&(g=a.anchor,a=a.focus,Or(s,g.key,g.offset,g.type),Or(i,a.key,a.offset,a.type))}}function La(s,i,a,g,C,x){return s===null||a===null||!st(C,s,a)||(i=Ko(s,i,Rt(x)?x.anchor:null,C),i===null)||(g=Ko(a,g,Rt(x)?x.focus:null,C),g===null||i.type==="element"&&g.type==="element"&&(s=wr(s),a=wr(a),En(s)&&En(a)))?null:(xs(i,g,x),[i,g])}function Al(s,i,a,g,C,x){let D=Fr();return s=new Ni($r(s,i,C),$r(a,g,x),0,""),s.dirty=!0,D._selection=s}function Ml(){return new Es(new Set)}function kn(s){let i=s.getEditorState()._selection,a=Yr(s._window);return Rt(i)||i==null?Yn(i,a,s,null):i.clone()}function Yn(s,i,a,g){var C=a._window;if(C===null)return null;var x=(C=g||C.event)?C.type:void 0;g=x==="selectionchange",C=!Fe&&(g||x==="beforeinput"||x==="compositionstart"||x==="compositionend"||x==="click"&&C&&C.detail===3||x==="drop"||x===void 0);let D;if(!Rt(s)||C){if(i===null)return null;if(C=i.anchorNode,x=i.focusNode,D=i.anchorOffset,i=i.focusOffset,g&&Rt(s)&&!st(a,C,x))return s.clone()}else return s.clone();if(a=La(C,D,x,i,a,s),a===null)return null;let[Q,ge]=a;return new Ni(Q,ge,Rt(s)?s.format:0,Rt(s)?s.style:"")}function jt(){return Fr()._selection}function Cr(){return dn()._editorState._selection}function Wn(s,i,a,g=1){var C=s.anchor,x=s.focus,D=C.getNode(),Q=x.getNode();if(i.is(D)||i.is(Q)){if(D=i.__key,s.isCollapsed())i=C.offset,(a<=i&&0<g||a<i&&0>g)&&(a=Math.max(0,i+g),C.set(D,a,"element"),x.set(D,a,"element"),uo(s));else{let Ae=s.isBackward();Q=Ae?x:C;var ge=Q.getNode();C=Ae?C:x,x=C.getNode(),i.is(ge)&&(ge=Q.offset,(a<=ge&&0<g||a<ge&&0>g)&&Q.set(D,Math.max(0,ge+g),"element")),i.is(x)&&(i=C.offset,(a<=i&&0<g||a<i&&0>g)&&C.set(D,Math.max(0,i+g),"element"))}uo(s)}}function uo(s){var i=s.anchor,a=i.offset;let g=s.focus;var C=g.offset,x=i.getNode(),D=g.getNode();if(s.isCollapsed())Je(x)&&(D=x.getChildrenSize(),D=(C=a>=D)?x.getChildAtIndex(D-1):x.getChildAtIndex(a),Ct(D)&&(a=0,C&&(a=D.getTextContentSize()),i.set(D.__key,a,"text"),g.set(D.__key,a,"text")));else{if(Je(x)){let Q=x.getChildrenSize();a=(s=a>=Q)?x.getChildAtIndex(Q-1):x.getChildAtIndex(a),Ct(a)&&(x=0,s&&(x=a.getTextContentSize()),i.set(a.__key,x,"text"))}Je(D)&&(a=D.getChildrenSize(),C=(i=C>=a)?D.getChildAtIndex(a-1):D.getChildAtIndex(C),Ct(C)&&(D=0,i&&(D=C.getTextContentSize()),g.set(C.__key,D,"text")))}}function Ia(s,i){if(i=i.getEditorState()._selection,s=s._selection,Rt(s)){var a=s.anchor;let g=s.focus,C;a.type==="text"&&(C=a.getNode(),C.selectionTransform(i,s)),g.type==="text"&&(a=g.getNode(),C!==a&&a.selectionTransform(i,s))}}function fo(s,i,a,g,C){let x=null,D=0,Q=null;g!==null?(x=g.__key,Ct(g)?(D=g.getTextContentSize(),Q="text"):Je(g)&&(D=g.getChildrenSize(),Q="element")):C!==null&&(x=C.__key,Ct(C)?Q="text":Je(C)&&(Q="element")),x!==null&&Q!==null?s.set(x,D,Q):(D=i.getIndexWithinParent(),D===-1&&(D=a.getChildrenSize()),s.set(a.__key,D,"element"))}function zo(s,i,a,g,C){s.type==="text"?(s.key=a,i||(s.offset+=C)):s.offset>g.getIndexWithinParent()&&--s.offset}function Uo(s){s instanceof Ds||(s instanceof Fo?(s=pa(s,Yi),Yi(s)||Y(114)):(s=pa(s.getNode(),Yi),Yi(s)||Y(114)));let i=s.getParent();Bl(i)||Y(115);let a=i.getParent();return Fl(a)||Y(116),[s,i,a]}function Go(s){s.isCollapsed()||s.removeText();var i=s.anchor;for(s=i.getNode(),i=i.offset;!io(s);)[s,i]=Rl(s,i);return i}function Rl(s,i){var a=s.getParent();if(!a)return a=Hr(),bt().append(a),a.select(),[bt(),0];if(Ct(s)){var g=s.splitText(i);return g.length===0?[a,s.getIndexWithinParent()]:(s=i===0?0:1,s=g[0].getIndexWithinParent()+s,[a,s])}return!Je(s)||i===0?[a,s.getIndexWithinParent()]:((g=s.getChildAtIndex(i))&&(i=new Ni($r(s.__key,i,"element"),$r(s.__key,i,"element"),0,""),(i=s.insertNewAfter(i))&&i.append(g,...g.getNextSiblings())),[a,s.getIndexWithinParent()+1])}function Wi(s){let i=Hr(),a=null;for(let g=0;g<s.length;g++){let C=s[g],x=ki(C);if(x||En(C)&&C.isInline()||Je(C)&&C.isInline()||Ct(C)||C.isParentRequired()){if(a===null&&(a=C.createParentElementNode(),i.append(a),x))continue;a!==null&&a.append(C)}else i.append(C),a=null}return i}let hn=null,On=null,Kn=!1,ho=!1,Ki=0,Ci={characterData:!0,childList:!0,subtree:!0};function go(){return Kn||hn!==null&&hn._readOnly}function Xn(){Kn&&Y(13)}function Fr(){return hn===null&&Y(15),hn}function dn(){return On===null&&Y(16),On}function ka(s,i,a){var g=i.__type;let C=s._nodes.get(g);for(C===void 0&&Y(30,g),s=a.get(g),s===void 0&&(s=Array.from(C.transforms),a.set(g,s)),a=s.length,g=0;g<a&&(s[g](i),i.isAttached());g++);}function bl(s,i){i=i._dirtyLeaves,s=s._nodeMap;for(let a of i)i=s.get(a),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&ve(i)}function Pa(s,i){let a=i._dirtyLeaves,g=i._dirtyElements;s=s._nodeMap;let C=xt(),x=new Map;var D=a;let Q=D.size;for(var ge=g,Ae=ge.size;0<Q||0<Ae;){if(0<Q){i._dirtyLeaves=new Set;for(let Ye of D)D=s.get(Ye),Ct(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&ve(D),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),a.add(Ye);if(D=i._dirtyLeaves,Q=D.size,0<Q){Ki++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of ge)ge=Ye[0],Ae=Ye[1],(ge==="root"||Ae)&&(D=s.get(ge),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),g.set(ge,Ae));D=i._dirtyLeaves,Q=D.size,ge=i._dirtyElements,Ae=ge.size,Ki++}i._dirtyLeaves=a,i._dirtyElements=g}function vs(s,i){var a=s.type,g=i.get(a);if(g===void 0&&Y(17,a),a=g.klass,s.type!==a.getType()&&Y(18,a.name),a=a.importJSON(s),s=s.children,Je(a)&&Array.isArray(s))for(g=0;g<s.length;g++){let C=vs(s[g],i);a.append(C)}return a}function Ll(s,i){let a=hn,g=Kn,C=On;hn=s,Kn=!0,On=null;try{return i()}finally{hn=a,Kn=g,On=C}}function zi(s,i){let a=s._pendingEditorState,g=s._rootElement,C=s._headless||g===null;if(a!==null){var x=s._editorState,D=x._selection,Q=a._selection,ge=s._dirtyType!==0,Ae=hn,Ye=Kn,Xe=On,Ke=s._updating,Pe=s._observer,pt=null;if(s._pendingEditorState=null,s._editorState=a,!C&&ge&&Pe!==null){On=s,hn=a,Kn=!1,s._updating=!0;try{let pn=s._dirtyType,Qn=s._dirtyElements,Tn=s._dirtyLeaves;Pe.disconnect();var Ot=pn,Bt=Qn,Kt=Tn;Un=ni=In="",hl=Ot===2,Ri=null,Hn=s,kr=s._config,Mo=s._nodes,jr=Hn._listeners.mutation,pl=Bt,vn=Kt,ar=x._nodeMap,Cn=a._nodeMap,gl=a._readOnly,hs=new Map(s._keyToDOMMap);let Rr=new Map;ri=Rr,Ii("root",null),ri=hs=kr=Cn=ar=vn=pl=Mo=Hn=void 0,pt=Rr}catch(pn){if(pn instanceof Error&&s._onError(pn),ho)throw pn;Os(s,null,g,a),Oe(s),s._dirtyType=2,ho=!0,zi(s,x),ho=!1;return}finally{Pe.observe(g,Ci),s._updating=Ke,hn=Ae,Kn=Ye,On=Xe}}a._readOnly||(a._readOnly=!0);var jn=s._dirtyLeaves,Dr=s._dirtyElements,oi=s._normalizedNodes,si=s._updateTags,Hl=s._deferred;ge&&(s._dirtyType=0,s._cloneNotNeeded.clear(),s._dirtyLeaves=new Set,s._dirtyElements=new Map,s._normalizedNodes=new Set,s._updateTags=new Set);var ji=s._decorators,As=s._pendingDecorators||ji,mo=a._nodeMap,li;for(li in As)mo.has(li)||(As===ji&&(As=tn(s)),delete As[li]);var Ar=C?null:Yr(s._window);if(s._editable&&Ar!==null&&(ge||Q===null||Q.dirty)){On=s,hn=a;try{if(Pe!==null&&Pe.disconnect(),ge||Q===null||Q.dirty){let pn=s._blockCursorElement;pn!==null&&dl(pn,s,g);e:{let Qn=Ar.anchorNode,Tn=Ar.focusNode,Rr=Ar.anchorOffset,Ti=Ar.focusOffset,vt=document.activeElement;if(!(si.has("collaboration")&&vt!==g||vt!==null&&ot(vt)))if(Rt(Q)){var Vi=Q.anchor,Ms=Q.focus,Fa=Vi.key,Ba=Ms.key,Wl=cn(s,Fa),Zo=cn(s,Ba),Zr=Vi.offset,Ha=Ms.offset,Kl=Q.format,Rs=Q.style,Wa=Q.isCollapsed(),Jo=Wl,bs=Zo,zl=!1;if(Vi.type==="text"){Jo=Ge(Wl);let dr=Vi.getNode();zl=dr.getFormat()!==Kl||dr.getStyle()!==Rs}else Rt(D)&&D.anchor.type==="text"&&(zl=!0);if(Ms.type==="text"&&(bs=Ge(Zo)),Jo!==null&&bs!==null){if(Wa&&(D===null||zl||Rt(D)&&(D.format!==Kl||D.style!==Rs))){var Ka=performance.now();Na=[Kl,Rs,Zr,Fa,Ka]}if(Rr===Zr&&Ti===Ha&&Qn===Jo&&Tn===bs&&(Ar.type!=="Range"||!Wa)&&(vt!==null&&g.contains(vt)||g.focus({preventScroll:!0}),Vi.type!=="element"))break e;try{Ar.setBaseAndExtent(Jo,Zr,bs,Ha)}catch{}if(!si.has("skip-scroll-into-view")&&Q.isCollapsed()&&g!==null&&g===document.activeElement){let dr=Q instanceof Ni&&Q.anchor.type==="element"?Jo.childNodes[Zr]||null:0<Ar.rangeCount?Ar.getRangeAt(0):null;if(dr!==null){let br;if(dr instanceof Text){let fr=document.createRange();fr.selectNode(dr),br=fr.getBoundingClientRect()}else br=dr.getBoundingClientRect();let sr=g.ownerDocument,Wr=sr.defaultView;if(Wr!==null)for(var{top:Ul,bottom:Jr}=br,Dn,_t,Tr=g;Tr!==null;){let fr=Tr===sr.body;if(fr)Dn=0,_t=Ln(s).innerHeight;else{let Ps=Tr.getBoundingClientRect();Dn=Ps.top,_t=Ps.bottom}let ai=0;if(Ul<Dn?ai=-(Dn-Ul):Jr>_t&&(ai=Jr-_t),ai!==0)if(fr)Wr.scrollBy(0,ai);else{let Ps=Tr.scrollTop;Tr.scrollTop+=ai;let za=Tr.scrollTop-Ps;Ul-=za,Jr-=za}if(fr)break;Tr=bn(Tr)}}}El=!0}}else D!==null&&st(s,Qn,Tn)&&Ar.removeAllRanges()}}e:{let pn=s._blockCursorElement;if(Rt(Q)&&Q.isCollapsed()&&Q.anchor.type==="element"&&g.contains(document.activeElement)){let Qn=Q.anchor,Tn=Qn.getNode(),Rr=Qn.offset,Ti=Tn.getChildrenSize(),vt=!1,dr=null;if(Rr===Ti){let br=Tn.getChildAtIndex(Rr-1);ds(br)&&(vt=!0)}else{let br=Tn.getChildAtIndex(Rr);if(ds(br)){let sr=br.getPreviousSibling();(sr===null||ds(sr))&&(vt=!0,dr=s.getElementByKey(br.__key))}}if(vt){let br=s.getElementByKey(Tn.__key);if(pn===null){let sr=s._config.theme,Wr=document.createElement("div");Wr.contentEditable="false",Wr.setAttribute("data-lexical-cursor","true");let fr=sr.blockCursor;if(fr!==void 0){if(typeof fr=="string"){let ai=fr.split(" ");fr=sr.blockCursor=ai}fr!==void 0&&Wr.classList.add(...fr)}s._blockCursorElement=pn=Wr}g.style.caretColor="transparent",dr===null?br.appendChild(pn):br.insertBefore(pn,dr);break e}}pn!==null&&dl(pn,s,g)}Pe!==null&&Pe.observe(g,Ci)}finally{On=Xe,hn=Ae}}if(pt!==null){var Ls=pt;let pn=Array.from(s._listeners.mutation),Qn=pn.length;for(let Tn=0;Tn<Qn;Tn++){let[Rr,Ti]=pn[Tn],vt=Ls.get(Ti);vt!==void 0&&Rr(vt,{dirtyLeaves:jn,prevEditorState:x,updateTags:si})}}Rt(Q)||Q===null||D!==null&&D.is(Q)||s.dispatchCommand(e,void 0);var Is=s._pendingDecorators;Is!==null&&(s._decorators=Is,s._pendingDecorators=null,Ei("decorator",s,!0,Is));var Pc=kt(i||x),Mr=kt(a);if(Pc!==Mr&&Ei("textcontent",s,!0,Mr),Ei("update",s,!0,{dirtyElements:Dr,dirtyLeaves:jn,editorState:a,normalizedNodes:oi,prevEditorState:i||x,tags:si}),s._deferred=[],Hl.length!==0){let pn=s._updating;s._updating=!0;try{for(let Qn=0;Qn<Hl.length;Qn++)Hl[Qn]()}finally{s._updating=pn}}var ks=s._updates;if(ks.length!==0){let pn=ks.shift();if(pn){let[Qn,Tn]=pn;Il(s,Qn,Tn)}}}}function Ei(s,i,a,...g){let C=i._updating;i._updating=a;try{let x=Array.from(i._listeners[s]);for(s=0;s<x.length;s++)x[s].apply(null,g)}finally{i._updating=C}}function at(s,i,a){if(s._updating===!1||On!==s){let x=!1;return s.update(()=>{x=at(s,i,a)}),x}let g=_i(s);for(let x=4;0<=x;x--)for(let D=0;D<g.length;D++){var C=g[D]._commands.get(i);if(C!==void 0&&(C=C[x],C!==void 0)){C=Array.from(C);let Q=C.length;for(let ge=0;ge<Q;ge++)if(C[ge](a,s)===!0)return!0}}return!1}function po(s,i){let a=s._updates;for(i=i||!1;a.length!==0;){var g=a.shift();if(g){let[C,x]=g,D;x!==void 0&&(g=x.onUpdate,D=x.tag,x.skipTransforms&&(i=!0),g&&s._deferred.push(g),D&&s._updateTags.add(D)),C()}}return i}function Il(s,i,a){let g=s._updateTags;var C,x=C=!1;if(a!==void 0){var D=a.onUpdate;C=a.tag,C!=null&&g.add(C),C=a.skipTransforms||!1,x=a.discrete||!1}D&&s._deferred.push(D),a=s._editorState,D=s._pendingEditorState;let Q=!1;(D===null||D._readOnly)&&(D=s._pendingEditorState=new Yo(new Map((D||a)._nodeMap)),Q=!0),D._flushSync=x,x=hn;let ge=Kn,Ae=On,Ye=s._updating;hn=D,Kn=!1,s._updating=!0,On=s;try{Q&&(s._headless?a._selection!=null&&(D._selection=a._selection.clone()):D._selection=kn(s));let Xe=s._compositionKey;i(),C=po(s,C),Ia(D,s),s._dirtyType!==0&&(C?bl(D,s):Pa(D,s),po(s),fl(a,D,s._dirtyLeaves,s._dirtyElements)),Xe!==s._compositionKey&&(D._flushSync=!0);let Ke=D._selection;if(Rt(Ke)){let Pe=D._nodeMap,pt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(pt)!==void 0||Y(19)}else cr(Ke)&&Ke._nodes.size===0&&(D._selection=null)}catch(Xe){Xe instanceof Error&&s._onError(Xe),s._pendingEditorState=a,s._dirtyType=2,s._cloneNotNeeded.clear(),s._dirtyLeaves=new Set,s._dirtyElements.clear(),zi(s);return}finally{hn=x,Kn=ge,On=Ae,s._updating=Ye,Ki=0}s._dirtyType!==0||kl(D,s)?D._flushSync?(D._flushSync=!1,zi(s)):Q&&it(()=>{zi(s)}):(D._flushSync=!1,Q&&(g.clear(),s._deferred=[],s._pendingEditorState=null))}function Er(s,i,a){s._updating?s._updates.push([i,a]):Il(s,i,a)}class Ss extends Fo{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function En(s){return s instanceof Ss}class Ui extends Fo{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 Ne[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getChildrenKeys(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a.__key),a=a.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=dn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(i)}getAllTextNodes(){let i=[],a=this.getFirstChild();for(;a!==null;){if(Ct(a)&&i.push(a),Je(a)){let g=a.getAllTextNodes();i.push(...g)}a=a.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let a=i.getFirstChild();if(a!==null){i=a;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let a=i.getLastChild();if(a!==null){i=a;continue}}break}return i}getDescendantByIndex(i){let a=this.getChildren(),g=a.length;return i>=g?(i=a[g-1],Je(i)&&i.getLastDescendant()||i||null):(i=a[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:mt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:mt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var a=this.getChildrenSize();let g;if(i<a/2){for(g=this.getFirstChild(),a=0;g!==null&&a<=i;){if(a===i)return g;g=g.getNextSibling(),a++}return null}for(g=this.getLastChild(),--a;g!==null&&a>=i;){if(a===i)return g;g=g.getPreviousSibling(),a--}return null}getTextContent(){let i="",a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContent(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=`
69
+
70
+ `)}return i}getTextContentSize(){let i=0,a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContentSize(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,a){Xn();let g=jt(),C=i,x=a;var D=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&a===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==D||a!==void 0&&a!==D)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(C===void 0&&(C=D),x===void 0&&(x=D),D=this.__key,Rt(g))g.anchor.set(D,C,"element"),g.focus.set(D,x,"element"),g.dirty=!0;else return Al(D,C,D,x,"element","element");return g}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(a=>a.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let a=this.getWritable();return a.__dir=i,a}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,a,g){let C=g.length,x=this.getChildrenSize(),D=this.getWritable(),Q=D.__key;var ge=[],Ae=[];let Ye=this.getChildAtIndex(i+a),Xe=null,Ke=x-a+C;if(i!==0)if(i===x)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<a){var pt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<a;Pe++){pt===null&&Y(100);var Ot=pt.getNextSibling(),Bt=pt.__key;pt=pt.getWritable(),Nt(pt),Ae.push(Bt),pt=Ot}}for(Pe=Xe,Ot=0;Ot<C;Ot++){Bt=g[Ot],Pe!==null&&Bt.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),pt=Bt.getWritable(),pt.__parent===Q&&Ke--,Nt(pt);let Kt=Bt.__key;Pe===null?(D.__first=Kt,pt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=Kt,pt.__prev=Pe.__key),Bt.__key===Q&&Y(76),pt.__parent=Q,ge.push(Kt),Pe=Bt}if(i+a===x?Pe!==null&&(Pe.getWritable().__next=null,D.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(a=Pe.getWritable(),i.__prev=Pe.__key,a.__next=Ye.__key):i.__prev=null),D.__size=Ke,Ae.length&&(i=jt(),Rt(i))){Ae=new Set(Ae),ge=new Set(ge);let{anchor:Kt,focus:jn}=i;ws(Kt,Ae,ge)&&fo(Kt,Kt.getNode(),this,Xe,Ye),ws(jn,Ae,ge)&&fo(jn,jn.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||Jn(this)||this.remove()}return D}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 Je(s){return s instanceof Ui}function ws(s,i,a){for(s=s.getNode();s;){let g=s.__key;if(i.has(g)&&!a.has(g))return!0;s=s.getParent()}return!1}class ur extends Ui{static getType(){return"root"}static clone(){return new ur}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!go()&&dn()._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 a=0;a<i.length;a++){let g=i[a];Je(g)||En(g)||Y(56)}return super.append(...i)}static importJSON(i){let a=bt();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function or(s){return s instanceof ur}function kl(s,i){if(i=i.getEditorState()._selection,s=s._selection,s!==null){if(s.dirty||!s.is(i))return!0}else if(i!==null)return!0;return!1}function Gi(){return new Yo(new Map([["root",new ur]]))}function Pl(s){let i=s.exportJSON();var a=s.constructor;if(i.type!==a.getType()&&Y(130,a.name),Je(s)){let g=i.children;for(Array.isArray(g)||Y(59,a.name),s=s.getChildren(),a=0;a<s.length;a++){let C=Pl(s[a]);g.push(C)}}return i}class Yo{constructor(i,a){this._nodeMap=i,this._selection=a||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Ll(this,i)}clone(i){return i=new Yo(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ll(this,()=>({root:Pl(bt())}))}}class Br extends Ui{static getType(){return"paragraph"}static clone(i){return new Br(i.__key)}createDOM(i){let a=document.createElement("p");return i=Pt(i.theme,"paragraph"),i!==void 0&&a.classList.add(...i),a}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:jo,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&fs(i)){this.isEmpty()&&i.append(document.createElement("br"));var a=this.getFormatType();i.style.textAlign=a,(a=this.getDirection())&&(i.dir=a),a=this.getIndent(),0<a&&(i.style.textIndent=`${20*a}px`)}return{element:i}}static importJSON(i){let a=Hr();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,a){i=Hr();let g=this.getDirection();return i.setDirection(g),this.insertAfter(i,a),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||Ct(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 jo(s){let i=Hr();return s.style&&(i.setFormat(s.style.textAlign),s=parseInt(s.style.textIndent,10)/20,0<s&&i.setIndent(s)),{node:i}}function Hr(){return rr(new Br)}function Os(s,i,a,g){let C=s._keyToDOMMap;C.clear(),s._editorState=Gi(),s._pendingEditorState=g,s._compositionKey=null,s._dirtyType=0,s._cloneNotNeeded.clear(),s._dirtyLeaves=new Set,s._dirtyElements.clear(),s._normalizedNodes=new Set,s._updateTags=new Set,s._updates=[],s._blockCursorElement=null,g=s._observer,g!==null&&(g.disconnect(),s._observer=null),i!==null&&(i.textContent=""),a!==null&&(a.textContent="",C.set("root",a))}function Vo(s,i){let a=new Map,g=new Set,C=x=>{Object.keys(x).forEach(D=>{let Q=a.get(D);Q===void 0&&(Q=[],a.set(D,Q)),Q.push(x[D])})};return s.forEach(x=>{x=x.klass.importDOM!=null?x.klass.importDOM.bind(x.klass):null,x==null||g.has(x)||(g.add(x),x=x(),x!==null&&C(x))}),i&&C(i),a}class qo{constructor(i,a,g,C,x,D,Q){this._parentEditor=a,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=g,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=pe(),this._onError=x,this._htmlConversions=D,this._editable=Q,this._headless=a!==null&&a._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let a=this._listeners.update;return a.add(i),()=>{a.delete(i)}}registerEditableListener(i){let a=this._listeners.editable;return a.add(i),()=>{a.delete(i)}}registerDecoratorListener(i){let a=this._listeners.decorator;return a.add(i),()=>{a.delete(i)}}registerTextContentListener(i){let a=this._listeners.textcontent;return a.add(i),()=>{a.delete(i)}}registerRootListener(i){let a=this._listeners.root;return i(this._rootElement,null),a.add(i),()=>{i(null,this._rootElement),a.delete(i)}}registerCommand(i,a,g){g===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 x=C.get(i);x===void 0&&Y(36,String(i));let D=x[g];return D.add(a),()=>{D.delete(a),x.every(Q=>Q.size===0)&&C.delete(i)}}registerMutationListener(i,a){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let g=this._listeners.mutation;return g.set(a,i),()=>{g.delete(a)}}registerNodeTransformToKlass(i,a){var g=i.getType();return g=this._nodes.get(g),g===void 0&&Y(37,i.name),g.transforms.add(a),g}registerNodeTransform(i,a){var g=this.registerNodeTransformToKlass(i,a);let C=[g];return g=g.replaceWithKlass,g!=null&&(g=this.registerNodeTransformToKlass(g,a),C.push(g)),Yt(this,i.getType()),()=>{C.forEach(x=>x.transforms.delete(a))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,a){return at(this,i,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let a=this._rootElement;if(i!==a){let D=Pt(this._config.theme,"root");var g=this._pendingEditorState||this._editorState;if(this._rootElement=i,Os(this,a,i,g),a!==null){if(!this._config.disableEvents){ko!==0&&(ko--,ko===0&&a.ownerDocument.removeEventListener("selectionchange",Oa));var C=a.__lexicalEditor;if(C!=null){if(C._parentEditor!==null){var x=_i(C);x=x[x.length-1]._key,lo.get(x)===C&&lo.delete(x)}else lo.delete(C._key);a.__lexicalEditor=null}for(C=wa(a),x=0;x<C.length;x++)C[x]();a.__lexicalEventHandles=[]}D!=null&&a.classList.remove(...D)}i!==null?(g=(g=i.ownerDocument)&&g.defaultView||null,C=i.style,C.userSelect="text",C.whiteSpace="pre-wrap",C.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=g,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),zi(this),this._config.disableEvents||Ic(i,this),D!=null&&i.classList.add(...D)):(this._editorState=g,this._window=this._pendingEditorState=null),Ei("root",this,!1,i,a)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,a){i.isEmpty()&&Y(38),Vt(this);let g=this._pendingEditorState,C=this._updateTags;a=a!==void 0?a.tag:null,g===null||g.isEmpty()||(a!=null&&C.add(a),zi(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,a!=null&&C.add(a),zi(this)}parseEditorState(i,a){i=typeof i=="string"?JSON.parse(i):i;let g=Gi(),C=hn,x=Kn,D=On,Q=this._dirtyElements,ge=this._dirtyLeaves,Ae=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,hn=g,Kn=!1,On=this;try{vs(i.root,this._nodes),a&&a(),g._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=Q,this._dirtyLeaves=ge,this._cloneNotNeeded=Ae,this._dirtyType=Ye,hn=C,Kn=x,On=D}return g}update(i,a){Er(this,i,a)}focus(i,a={}){let g=this._rootElement;g!==null&&(g.setAttribute("autocapitalize","off"),Er(this,()=>{let C=jt(),x=bt();C!==null?C.dirty=!0:x.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?x.selectStart():x.selectEnd())},{onUpdate:()=>{g.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&g.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=Yr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ei("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Ds extends Ui{constructor(i,a){super(a),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 Yi(s){return s instanceof Ds}class $l extends Ui{}function Fl(s){return s instanceof $l}class $a extends Ui{}function Bl(s){return s instanceof $a}return We.$INTERNAL_isPointSelection=Wo,We.$addUpdateTag=function(s){Xn(),dn()._updateTags.add(s)},We.$applyNodeReplacement=rr,We.$copyNode=Mi,We.$createLineBreakNode=qr,We.$createNodeSelection=Ml,We.$createParagraphNode=Hr,We.$createPoint=$r,We.$createRangeSelection=function(){let s=$r("root",0,"element"),i=$r("root",0,"element");return new Ni(s,i,0,"")},We.$createTabNode=Bi,We.$createTextNode=Gn,We.$getAdjacentNode=Et,We.$getNearestNodeFromDOMNode=Ht,We.$getNearestRootOrShadowRoot=fn,We.$getNodeByKey=mt,We.$getPreviousSelection=Cr,We.$getRoot=bt,We.$getSelection=jt,We.$getTextContent=function(){let s=jt();return s===null?"":s.getTextContent()},We.$hasAncestor=nr,We.$hasUpdateTag=function(s){return dn()._updateTags.has(s)},We.$insertNodes=function(s){let i=jt()||Cr();i===null&&(i=bt().selectEnd()),i.insertNodes(s)},We.$isBlockElementNode=function(s){return Je(s)&&!s.isInline()},We.$isDecoratorNode=En,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(s){return Je(s)&&s.isInline()||En(s)&&s.isInline()},We.$isLeafNode=function(s){return Ct(s)||ki(s)||En(s)},We.$isLineBreakNode=ki,We.$isNodeSelection=cr,We.$isParagraphNode=function(s){return s instanceof Br},We.$isRangeSelection=Rt,We.$isRootNode=or,We.$isRootOrShadowRoot=Jn,We.$isTabNode=Ma,We.$isTextNode=Ct,We.$nodesOfType=function(s){var i=Fr();let a=i._readOnly,g=s.getType();i=i._nodeMap;let C=[];for(let[,x]of i)x instanceof s&&x.__type===g&&(a||x.isAttached())&&C.push(x);return C},We.$normalizeSelection__EXPERIMENTAL=Le,We.$parseSerializedNode=function(s){return vs(s,dn()._nodes)},We.$selectAll=function(){var s=bt();s=s.select(0,s.getChildrenSize()),Qt(Le(s))},We.$setCompositionKey=gt,We.$setSelection=Qt,We.$splitNode=function(s,i){let a=s.getChildAtIndex(i);a==null&&(a=s),Jn(s)&&Y(102);let g=D=>{const Q=D.getParentOrThrow(),ge=Jn(Q),Ae=D!==a||ge?Mi(D):D;if(ge){if(!Je(D)||!Je(Ae))throw Error("Children of a root must be ElementNode");return D.insertAfter(Ae),[D,Ae,Ae]}const[Ye,Xe,Ke]=g(Q);return D=D.getNextSiblings(),Ke.append(Ae,...D),[Ye,Xe,Ae]},[C,x]=g(a);return[C,x]},We.BLUR_COMMAND=Z,We.CAN_REDO_COMMAND={},We.CAN_UNDO_COMMAND={},We.CLEAR_EDITOR_COMMAND={},We.CLEAR_HISTORY_COMMAND={},We.CLICK_COMMAND=t,We.COMMAND_PRIORITY_CRITICAL=4,We.COMMAND_PRIORITY_EDITOR=0,We.COMMAND_PRIORITY_HIGH=3,We.COMMAND_PRIORITY_LOW=1,We.COMMAND_PRIORITY_NORMAL=2,We.CONTROLLED_TEXT_INSERTION_COMMAND=d,We.COPY_COMMAND=Ee,We.CUT_COMMAND=de,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=T,We.DELETE_WORD_COMMAND=_,We.DEPRECATED_$computeGridMap=function(s,i,a){let g=[],C=null,x=null;s=s.getChildren();for(let Ye=0;Ye<s.length;Ye++){var D=s[Ye];Bl(D)||Y(108);var Q=D.getChildren();D=0;for(let Xe of Q){for(Yi(Xe)||Y(109);g[Ye]!==void 0&&g[Ye][D]!==void 0;)D++;Q=Ye;var ge=D,Ae=Xe;let Ke={cell:Ae,startColumn:ge,startRow:Q},Pe=Ae.__rowSpan,pt=Ae.__colSpan;for(let Ot=0;Ot<Pe;Ot++){g[Q+Ot]===void 0&&(g[Q+Ot]=[]);for(let Bt=0;Bt<pt;Bt++)g[Q+Ot][ge+Bt]=Ke}i.is(Ae)&&(C=Ke),a.is(Ae)&&(x=Ke),D+=Xe.__colSpan}}return C===null&&Y(110),x===null&&Y(111),[g,C,x]},We.DEPRECATED_$getGridCellNodeRect=function(s){let[i,,a]=Uo(s);s=a.getChildren();let g=s.length;var C=s[0].getChildren().length;let x=Array(g);for(var D=0;D<g;D++)x[D]=Array(C);for(C=0;C<g;C++){D=s[C].getChildren();let Q=0;for(let ge=0;ge<D.length;ge++){for(;x[C][Q];)Q++;let Ae=D[ge],Ye=Ae.__rowSpan||1,Xe=Ae.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)x[C+Ke][Q+Pe]=Ae;if(i===Ae)return{colSpan:Xe,columnIndex:Q,rowIndex:C,rowSpan:Ye};Q+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=Uo,We.DEPRECATED_$isGridCellNode=Yi,We.DEPRECATED_$isGridNode=Fl,We.DEPRECATED_$isGridRowNode=Bl,We.DEPRECATED_GridCellNode=Ds,We.DEPRECATED_GridNode=$l,We.DEPRECATED_GridRowNode=$a,We.DRAGEND_COMMAND=Se,We.DRAGOVER_COMMAND=Te,We.DRAGSTART_COMMAND=q,We.DROP_COMMAND=z,We.DecoratorNode=Ss,We.ElementNode=Ui,We.FOCUS_COMMAND=O,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=E,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=l,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Ho,We.KEY_ARROW_DOWN_COMMAND=P,We.KEY_ARROW_LEFT_COMMAND=k,We.KEY_ARROW_RIGHT_COMMAND=m,We.KEY_ARROW_UP_COMMAND=I,We.KEY_BACKSPACE_COMMAND=re,We.KEY_DELETE_COMMAND=ce,We.KEY_DOWN_COMMAND=M,We.KEY_ENTER_COMMAND=H,We.KEY_ESCAPE_COMMAND=te,We.KEY_MODIFIER_COMMAND=se,We.KEY_SPACE_COMMAND=j,We.KEY_TAB_COMMAND=V,We.LineBreakNode=Vr,We.MOVE_TO_END=v,We.MOVE_TO_START=G,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=f,We.ParagraphNode=Br,We.REDO_COMMAND=w,We.REMOVE_TEXT_COMMAND=p,We.RootNode=ur,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=K,We.TabNode=co,We.TextNode=Fi,We.UNDO_COMMAND=S,We.createCommand=function(){return{}},We.createEditor=function(s){var i=s||{},a=On,g=i.theme||{};let C=s===void 0?a:i.parentEditor||null,x=i.disableEvents||!1,D=Gi(),Q=i.namespace||(C!==null?C._config.namespace:pe()),ge=i.editorState,Ae=[ur,Fi,Vr,co,Br,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,s===void 0&&a!==null)s=a._nodes;else for(s=new Map,a=0;a<Ae.length;a++){let Pe=Ae[a],pt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,pt=Ke.with,Ke=Ke.withKlass||null);let Ot=Pe.getType(),Bt=Pe.transform(),Kt=new Set;Bt!==null&&Kt.add(Bt),s.set(Ot,{exportDOM:Xe&&Xe.export?Xe.export.get(Pe):void 0,klass:Pe,replace:pt,replaceWithKlass:Ke,transforms:Kt})}return g=new qo(D,C,s,{disableEvents:x,namespace:Q,theme:g},Ye||console.error,Vo(s,Xe?Xe.import:void 0),i),ge!==void 0&&(g._pendingEditorState=ge,g._dirtyType=2),g},We.getNearestEditorFromDOMNode=wt,We.isCurrentlyReadOnlyMode=go,We.isHTMLAnchorElement=function(s){return fs(s)&&s.tagName==="A"},We.isHTMLElement=fs,We.isSelectionCapturedInDecoratorInput=ot,We.isSelectionWithinEditor=st,We}var Jc,bf;function Gt(){return bf||(bf=1,Jc=process.env.NODE_ENV==="development"?UN():GN()),Jc}var Lf;function YN(){if(Lf)return qc;Lf=1;var e=Zn(),t=Gt(),n=rt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const f={tag:"history-merge"};function p({initialConfig:T,children:E}){const S=n.useMemo(()=>{const{theme:w,namespace:M,editor__DEPRECATED:m,nodes:v,onError:k,editorState:G,html:I}=T,P=e.createLexicalComposerContext(null,w);let H=m||null;if(H===null){const j=t.createEditor({editable:T.editable,html:I,namespace:M,nodes:v,onError:re=>k(re,j),theme:w});_(j,G),H=j}return[H,P]},[]);return d(()=>{const w=T.editable,[M]=S;M.setEditable(w!==void 0?w:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:S},E)}function _(T,E){if(E!==null){if(E===void 0)T.update(()=>{const S=t.$getRoot();if(S.isEmpty()){const w=t.$createParagraphNode();S.append(w);const M=r?document.activeElement:null;(t.$getSelection()!==null||M!==null&&M===T.getRootElement())&&w.select()}},f);else if(E!==null)switch(typeof E){case"string":{const S=T.parseEditorState(E);T.setEditorState(S,f);break}case"object":{T.setEditorState(E,f);break}case"function":{T.update(()=>{t.$getRoot().isEmpty()&&E(T)},f);break}}}}return qc.LexicalComposer=p,qc}var Xc={},If;function jN(){if(If)return Xc;If=1;var e=Zn(),t=Gt(),n=rt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var l=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function f(p,_){if(_!==null){if(_===void 0)p.update(()=>{var T=t.$getRoot();if(T.isEmpty()){let E=t.$createParagraphNode();T.append(E),T=r?document.activeElement:null,(t.$getSelection()!==null||T!==null&&T===p.getRootElement())&&E.select()}},d);else if(_!==null)switch(typeof _){case"string":let T=p.parseEditorState(_);p.setEditorState(T,d);break;case"object":p.setEditorState(_,d);break;case"function":p.update(()=>{t.$getRoot().isEmpty()&&_(p)},d)}}}return Xc.LexicalComposer=function({initialConfig:p,children:_}){let T=n.useMemo(()=>{const{theme:E,namespace:S,editor__DEPRECATED:w,nodes:M,onError:m,editorState:v,html:k}=p,G=e.createLexicalComposerContext(null,E);let I=w||null;if(I===null){const P=t.createEditor({editable:p.editable,html:k,namespace:S,nodes:M,onError:H=>m(H,P),theme:E});f(P,v),I=P}return[I,G]},[]);return l(()=>{let E=p.editable,[S]=T;S.setEditable(E!==void 0?E:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:T},_)},Xc}const VN=process.env.NODE_ENV==="development"?YN():jN();var qN=VN,Qc={},eu,kf;function ZN(){if(kf)return eu;kf=1;var e=Zn(),t=rt,l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function d(_){const[T]=e.useLexicalComposerContext(),E=t.useMemo(()=>_(T),[T,_]),S=t.useRef(E.initialValueFn()),[w,M]=t.useState(S.current);return l(()=>{const{initialValueFn:m,subscribe:v}=E,k=m();return S.current!==k&&(S.current=k,M(k)),v(G=>{S.current=G,M(G)})},[E,_]),w}function f(_){return{initialValueFn:()=>_.isEditable(),subscribe:T=>_.registerEditableListener(T)}}function p(){return d(f)}return eu=p,eu}var tu,Pf;function JN(){if(Pf)return tu;Pf=1;var e=Zn(),t=rt,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function r(d){let[f]=e.useLexicalComposerContext(),p=t.useMemo(()=>d(f),[f,d]),_=t.useRef(p.initialValueFn()),[T,E]=t.useState(_.current);return n(()=>{let{initialValueFn:S,subscribe:w}=p,M=S();return _.current!==M&&(_.current=M,E(M)),w(m=>{_.current=m,E(m)})},[p,d]),T}function l(d){return{initialValueFn:()=>d.isEditable(),subscribe:f=>d.registerEditableListener(f)}}return tu=function(){return r(l)},tu}var nu,$f;function Ep(){return $f||($f=1,nu=process.env.NODE_ENV==="development"?ZN():JN()),nu}var Xi={},Ff;function XN(){if(Ff)return Xi;Ff=1;var e=Gt();function t(_,T){let E=_.getFirstChild(),S=0;e:for(;E!==null;){if(e.$isElementNode(E)){const m=E.getFirstChild();if(m!==null){E=m;continue}}else if(e.$isTextNode(E)){const m=E.getTextContentSize();if(S+m>T)return{node:E,offset:T-S};S+=m}const w=E.getNextSibling();if(w!==null){E=w;continue}let M=E.getParent();for(;M!==null;){const m=M.getNextSibling();if(m!==null){E=m;continue e}M=M.getParent()}break}return null}function n(_,T=!0){if(_)return!1;let E=l();return T&&(E=E.trim()),E===""}function r(_,T){return()=>n(_,T)}function l(){return e.$getRoot().getTextContent()}function d(_){if(!n(_,!1))return!1;const E=e.$getRoot().getChildren(),S=E.length;if(S>1)return!1;for(let w=0;w<S;w++){const M=E[w];if(e.$isDecoratorNode(M))return!1;if(e.$isElementNode(M)){if(!e.$isParagraphNode(M)||M.__indent!==0)return!1;const m=M.getChildren(),v=m.length;for(let k=0;k<v;k++){const G=m[w];if(!e.$isTextNode(G))return!1}}}return!0}function f(_){return()=>d(_)}function p(_,T,E,S){const w=P=>P instanceof E,M=P=>{const H=e.$createTextNode(P.getTextContent());H.setFormat(P.getFormat()),P.replace(H)},m=P=>P.getLatest().__mode,v=P=>{if(!P.isSimpleText())return;const H=P.getPreviousSibling();let j=P.getTextContent(),re=P,te;if(e.$isTextNode(H)){const ce=H.getTextContent(),V=ce+j,z=T(V);if(w(H))if(z===null||m(H)!==0){M(H);return}else{const q=z.end-ce.length;if(q>0){const Te=j.slice(0,q),Se=ce+Te;if(H.select(),H.setTextContent(Se),q===j.length)P.remove();else{const Ee=j.slice(q);P.setTextContent(Ee)}return}}else if(z===null||z.start<ce.length)return}for(;;){te=T(j);let ce=te===null?"":j.slice(te.end);if(j=ce,ce===""){const q=re.getNextSibling();if(e.$isTextNode(q)){ce=re.getTextContent()+q.getTextContent();const Te=T(ce);if(Te===null){w(q)?M(q):q.markDirty();return}else if(Te.start!==0)return}}else{const q=T(ce);if(q!==null&&q.start===0)return}if(te===null)return;if(te.start===0&&e.$isTextNode(H)&&H.isTextEntity())continue;let V;te.start===0?[V,re]=re.splitText(te.end):[,V,re]=re.splitText(te.start,te.end);const z=S(V);if(z.setFormat(V.getFormat()),V.replace(z),re==null)return}},k=P=>{const H=P.getTextContent(),j=T(H);if(j===null||j.start!==0){M(P);return}if(H.length>j.end){P.splitText(j.end);return}const re=P.getPreviousSibling();e.$isTextNode(re)&&re.isTextEntity()&&(M(re),M(P));const te=P.getNextSibling();e.$isTextNode(te)&&te.isTextEntity()&&(M(te),w(P)&&M(P))},G=_.registerNodeTransform(e.TextNode,v),I=_.registerNodeTransform(E,k);return[G,I]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=f,Xi.$findTextIntersectionFromCharacters=t,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=l,Xi.registerLexicalTextEntity=p,Xi}var Qi={},Bf;function QN(){if(Bf)return Qi;Bf=1;var e=Gt();function t(l,d=!0){return l?!1:(l=n(),d&&(l=l.trim()),l==="")}function n(){return e.$getRoot().getTextContent()}function r(l){if(!t(l,!1))return!1;l=e.$getRoot().getChildren();let d=l.length;if(1<d)return!1;for(let p=0;p<d;p++){var f=l[p];if(e.$isDecoratorNode(f))return!1;if(e.$isElementNode(f)){if(!e.$isParagraphNode(f)||f.__indent!==0)return!1;f=f.getChildren();let _=f.length;for(let T=0;T<_;T++)if(!e.$isTextNode(f[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(l){return()=>r(l)},Qi.$findTextIntersectionFromCharacters=function(l,d){var f=l.getFirstChild();l=0;e:for(;f!==null;){if(e.$isElementNode(f)){var p=f.getFirstChild();if(p!==null){f=p;continue}}else if(e.$isTextNode(f)){if(p=f.getTextContentSize(),l+p>d)return{node:f,offset:d-l};l+=p}if(p=f.getNextSibling(),p!==null)f=p;else{for(f=f.getParent();f!==null;){if(p=f.getNextSibling(),p!==null){f=p;continue e}f=f.getParent()}break}}return null},Qi.$isRootTextContentEmpty=t,Qi.$isRootTextContentEmptyCurry=function(l,d){return()=>t(l,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(l,d,f,p){let _=E=>{const S=e.$createTextNode(E.getTextContent());S.setFormat(E.getFormat()),E.replace(S)},T=l.registerNodeTransform(e.TextNode,E=>{if(E.isSimpleText()){var S=E.getPreviousSibling(),w=E.getTextContent(),M=E;if(e.$isTextNode(S)){var m=S.getTextContent(),v=d(m+w);if(S instanceof f){if(v===null||S.getLatest().__mode!==0){_(S);return}if(v=v.end-m.length,0<v){M=w.slice(0,v),M=m+M,S.select(),S.setTextContent(M),v===w.length?E.remove():(S=w.slice(v),E.setTextContent(S));return}}else if(v===null||v.start<m.length)return}for(;;){if(E=d(w),w=v=E===null?"":w.slice(E.end),v===""){if(m=M.getNextSibling(),e.$isTextNode(m)){if(v=M.getTextContent()+m.getTextContent(),v=d(v),v===null){m instanceof f?_(m):m.markDirty();break}else if(v.start!==0)break}}else if(m=d(v),m!==null&&m.start===0)break;if(E===null)break;if(E.start===0&&e.$isTextNode(S)&&S.isTextEntity())continue;let k;if(E.start===0?[k,M]=M.splitText(E.end):[,k,M]=M.splitText(E.start,E.end),E=p(k),E.setFormat(k.getFormat()),k.replace(E),M==null)break}}});return l=l.registerNodeTransform(f,E=>{var S=E.getTextContent();const w=d(S);w===null||w.start!==0?_(E):S.length>w.end?E.splitText(w.end):(S=E.getPreviousSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),_(E)),S=E.getNextSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),E instanceof f&&_(E)))}),[T,l]},Qi}var ru,Hf;function Tp(){return Hf||(Hf=1,ru=process.env.NODE_ENV==="development"?XN():QN()),ru}var Sn={},Vn={},Wf;function eC(){if(Wf)return Vn;Wf=1;var e=Gt();const t=new Map;function n(K){let O=K;for(;O!=null;){if(O.nodeType===Node.TEXT_NODE)return O;O=O.firstChild}return null}function r(K){const O=K.parentNode;if(O==null)throw new Error("Should never happen");return[O,Array.from(O.childNodes).indexOf(K)]}function l(K,O,Z,se,Y){const W=O.getKey(),J=se.getKey(),R=document.createRange();let U=K.getElementByKey(W),X=K.getElementByKey(J),fe=Z,_e=Y;if(e.$isTextNode(O)&&(U=n(U)),e.$isTextNode(se)&&(X=n(X)),O===void 0||se===void 0||U===null||X===null)return null;U.nodeName==="BR"&&([U,fe]=r(U)),X.nodeName==="BR"&&([X,_e]=r(X));const B=U.firstChild;U===X&&B!=null&&B.nodeName==="BR"&&fe===0&&_e===0&&(_e=1);try{R.setStart(U,fe),R.setEnd(X,_e)}catch{return null}return R.collapsed&&(fe!==_e||W!==J)&&(R.setStart(X,_e),R.setEnd(U,fe)),R}function d(K,O){const Z=K.getRootElement();if(Z===null)return[];const se=Z.getBoundingClientRect(),Y=getComputedStyle(Z),W=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),J=Array.from(O.getClientRects());let R=J.length;J.sort((X,fe)=>{const _e=X.top-fe.top;return Math.abs(_e)<=3?X.left-fe.left:_e});let U;for(let X=0;X<R;X++){const fe=J[X],_e=U&&U.top<=fe.top&&U.top+U.height>fe.top&&U.left+U.width>fe.left,B=fe.width+W===se.width;if(_e||B){J.splice(X--,1),R--;continue}U=fe}return J}function f(K){const O={},Z=K.split(";");for(const se of Z)if(se!==""){const[Y,W]=se.split(/:([^]+)/);Y&&W&&(O[Y.trim()]=W.trim())}return O}function p(K){let O=t.get(K);return O===void 0&&(O=f(K),t.set(K,O)),Object.freeze(O),O}function _(K){let O="";for(const Z in K)Z&&(O+=`${Z}: ${K[Z]};`);return O}function T(K,O){return K.__first=O.__first,K.__last=O.__last,K.__size=O.__size,K.__format=O.__format,K.__indent=O.__indent,K.__dir=O.__dir,K}function E(K,O){return K.__format=O.__format,K.__style=O.__style,K.__mode=O.__mode,K.__detail=O.__detail,K}function S(K){const Z=K.constructor.clone(K);return Z.__parent=K.__parent,Z.__next=K.__next,Z.__prev=K.__prev,e.$isElementNode(K)&&e.$isElementNode(Z)?T(Z,K):e.$isTextNode(K)&&e.$isTextNode(Z)?E(Z,K):Z}function w(K,O){if(O.isSelected(K)&&!O.isSegmented()&&!O.isToken()&&e.$INTERNAL_isPointSelection(K)){const Z=K.anchor.getNode(),se=K.focus.getNode(),Y=O.is(Z),W=O.is(se);if(Y||W){const J=K.isBackward(),[R,U]=K.getCharacterOffsets(),X=Z.is(se),fe=O.is(J?se:Z),_e=O.is(J?Z:se);let B=0,A;if(X)B=R>U?U:R,A=R>U?R:U;else if(fe)B=J?U:R,A=void 0;else if(_e){const F=J?R:U;B=0,A=F}return O.__text=O.__text.slice(B,A),O}}return O}function M(K){if(K.type==="text")return K.offset===K.getNode().getTextContentSize();const O=K.getNode();if(!e.$isElementNode(O))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return K.offset===O.getChildrenSize()}function m(K,O,Z){let se=O.getNode(),Y=Z;if(e.$isElementNode(se)){const W=se.getDescendantByIndex(O.offset);W!==null&&(se=W)}for(;Y>0&&se!==null;){if(e.$isElementNode(se)){const X=se.getLastDescendant();X!==null&&(se=X)}let W=se.getPreviousSibling(),J=0;if(W===null){let X=se.getParentOrThrow(),fe=X.getPreviousSibling();for(;fe===null;){if(X=X.getParent(),X===null){W=null;break}fe=X.getPreviousSibling()}X!==null&&(J=X.isInline()?0:2,W=fe)}let R=se.getTextContent();R===""&&e.$isElementNode(se)&&!se.isInline()&&(R=`
71
+
72
+ `);const U=R.length;if(!e.$isTextNode(se)||Y>=U){const X=se.getParent();se.remove(),X!=null&&X.getChildrenSize()===0&&!e.$isRootNode(X)&&X.remove(),Y-=U+J,se=W}else{const X=se.getKey(),fe=K.getEditorState().read(()=>{const A=e.$getNodeByKey(X);return e.$isTextNode(A)&&A.isSimpleText()?A.getTextContent():null}),_e=U-Y,B=R.slice(0,_e);if(fe!==null&&fe!==R){const A=e.$getPreviousSelection();let F=se;if(se.isSimpleText())se.setTextContent(fe);else{const oe=e.$createTextNode(fe);se.replace(oe),F=oe}if(e.$isRangeSelection(A)&&A.isCollapsed()){const oe=A.anchor.offset;F.select(oe,oe)}}else if(se.isSimpleText()){const A=O.key===X;let F=O.offset;F<Y&&(F=U);const oe=A?F-Y:0,ye=A?F:_e;if(A&&oe===0){const[De]=se.splitText(oe,ye);De.remove()}else{const[,De]=se.splitText(oe,ye);De.remove()}}else{const A=e.$createTextNode(B);se.replace(A)}Y=0}}}function v(K){const O=K.getStyle(),Z=f(O);t.set(O,Z)}function k(K,O){const Z=p("getStyle"in K?K.getStyle():K.style),se=Object.entries(O).reduce((W,[J,R])=>(R===null?delete W[J]:W[J]=R,W),{...Z}),Y=_(se);K.setStyle(Y),t.set(Y,se)}function G(K,O){const Z=K.getNodes(),se=Z.length;if(!e.$isRangeSelection(K)){const ne=e.$createRangeSelection(),ue=ne.anchor,be=ne.focus;for(let Ne=0;Ne<se;Ne++){const Re=Z[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ue.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),G(e.$normalizeSelection__EXPERIMENTAL(ne),O))}e.$setSelection(K);return}const Y=se-1;let W=Z[0],J=Z[Y];if(K.isCollapsed()&&e.$isRangeSelection(K)){k(K,O);return}const R=K.anchor,U=K.focus,fe=W.getTextContent().length,_e=U.offset;let B=R.offset;const A=R.isBefore(U);let F=A?B:_e,oe=A?_e:B;const ye=A?R.type:U.type,De=A?U.type:R.type,ee=A?U.key:R.key;if(e.$isTextNode(W)&&F===fe){const ne=W.getNextSibling();e.$isTextNode(ne)&&(B=0,F=0,W=ne)}if(Z.length===1){if(e.$isTextNode(W)){if(F=ye==="element"?0:B>_e?_e:B,oe=De==="element"?fe:B>_e?B:_e,F===oe)return;if(F===0&&oe===fe)k(W,O),W.select(F,oe);else{const ne=W.splitText(F,oe),ue=F===0?ne[0]:ne[1];k(ue,O),ue.select(0,oe-F)}}}else{if(e.$isTextNode(W)&&F<W.getTextContentSize()&&(F!==0&&(W=W.splitText(F)[1],F=0,R.set(W.getKey(),F,"text")),k(W,O)),e.$isTextNode(J)){const ue=J.getTextContent().length;J.__key!==ee&&oe!==0&&(oe=ue),oe!==ue&&([J]=J.splitText(oe)),oe!==0&&k(J,O)}for(let ne=1;ne<Y;ne++){const ue=Z[ne],be=ue.getKey();e.$isTextNode(ue)&&be!==W.getKey()&&be!==J.getKey()&&!ue.isToken()&&k(ue,O)}}}function I(K,O){if(K.anchor.key==="root"){const Y=O(),W=e.$getRoot(),J=W.getFirstChild();J?J.replace(Y,!0):W.append(Y);return}const Z=K.getNodes(),se=de(K.anchor.getNode(),Ee);se&&Z.indexOf(se)===-1&&Z.push(se);for(let Y=0;Y<Z.length;Y++){const W=Z[Y];if(!Ee(W))continue;if(!e.$isElementNode(W))throw Error("Expected block node to be an ElementNode");const J=O();J.setFormat(W.getFormatType()),J.setIndent(W.getIndent()),W.replace(J,!0)}}function P(K){return K.getNode().isAttached()}function H(K){let O=K;for(;O!==null&&!e.$isRootOrShadowRoot(O);){const Z=O.getLatest(),se=O.getParent();Z.getChildrenSize()===0&&O.remove(!0),O=se}}function j(K,O,Z=null){const se=K.getNodes(),Y=se.length,W=K.anchor;if(Y===0||Y===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){const U=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),X=U.getChildren();let fe=O();fe.setFormat(U.getFormatType()),fe.setIndent(U.getIndent()),X.forEach(_e=>fe.append(_e)),Z&&(fe=Z.append(fe)),U.replace(fe);return}let J=null,R=[];for(let U=0;U<Y;U++){const X=se[U];e.$isRootOrShadowRoot(X)?(re(K,R,R.length,O,Z),R=[],J=X):J===null||J!==null&&e.$hasAncestor(X,J)?R.push(X):(re(K,R,R.length,O,Z),R=[X])}re(K,R,R.length,O,Z)}function re(K,O,Z,se,Y=null){if(O.length===0)return;const W=O[0],J=new Map,R=[];let U=e.$isElementNode(W)?W:W.getParentOrThrow();U.isInline()&&(U=U.getParentOrThrow());let X=!1;for(;U!==null;){const F=U.getPreviousSibling();if(F!==null){U=F,X=!0;break}if(U=U.getParentOrThrow(),e.$isRootOrShadowRoot(U))break}const fe=new Set;for(let F=0;F<Z;F++){const oe=O[F];e.$isElementNode(oe)&&oe.getChildrenSize()===0&&fe.add(oe.getKey())}const _e=new Set;for(let F=0;F<Z;F++){const oe=O[F];let ye=oe.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(oe)&&!_e.has(oe.getKey())){const De=ye.getKey();if(J.get(De)===void 0){const ee=se();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),R.push(ee),J.set(De,ee),ye.getChildren().forEach(ne=>{ee.append(ne),_e.add(ne.getKey()),e.$isElementNode(ne)&&ne.getChildrenKeys().forEach(ue=>_e.add(ue))}),H(ye)}}else if(fe.has(oe.getKey())){if(!e.$isElementNode(oe))throw Error("Expected node in emptyElements to be an ElementNode");const De=se();De.setFormat(oe.getFormatType()),De.setIndent(oe.getIndent()),R.push(De),oe.remove(!0)}}if(Y!==null)for(let F=0;F<R.length;F++){const oe=R[F];Y.append(oe)}let B=null;if(e.$isRootOrShadowRoot(U))if(X)if(Y!==null)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const oe=R[F];U.insertAfter(oe)}else{const F=U.getFirstChild();if(e.$isElementNode(F)&&(U=F),F===null)if(Y)U.append(Y);else for(let oe=0;oe<R.length;oe++){const ye=R[oe];U.append(ye),B=ye}else if(Y!==null)F.insertBefore(Y);else for(let oe=0;oe<R.length;oe++){const ye=R[oe];F.insertBefore(ye),B=ye}}else if(Y)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const oe=R[F];U.insertAfter(oe),B=oe}const A=e.$getPreviousSelection();e.$isRangeSelection(A)&&P(A.anchor)&&P(A.focus)?e.$setSelection(A.clone()):B!==null?B.selectEnd():K.dirty=!0}function te(K,O){const Z=e.$getAdjacentNode(K.focus,O);return e.$isDecoratorNode(Z)&&!Z.isIsolated()||e.$isElementNode(Z)&&!Z.isInline()&&!Z.canBeEmpty()}function ce(K,O,Z,se){K.modify(O?"extend":"move",Z,se)}function V(K){const O=K.anchor.getNode();return(e.$isRootNode(O)?O:O.getParentOrThrow()).getDirection()==="rtl"}function z(K,O,Z){const se=V(K);ce(K,O,Z?!se:se,"character")}function q(K){const O=K.anchor,Z=K.focus,W=O.getNode().getTopLevelElementOrThrow().getParentOrThrow();let J=W.getFirstDescendant(),R=W.getLastDescendant(),U="element",X="element",fe=0;e.$isTextNode(J)?U="text":!e.$isElementNode(J)&&J!==null&&(J=J.getParentOrThrow()),e.$isTextNode(R)?(X="text",fe=R.getTextContentSize()):!e.$isElementNode(R)&&R!==null&&(R=R.getParentOrThrow()),J&&R&&(O.set(J.getKey(),0,U),Z.set(R.getKey(),fe,X))}function Te(K,O,Z){const se=K.getStyle(),Y=p(se);return Y!==null&&Y[O]||Z}function Se(K,O,Z=""){let se=null;const Y=K.getNodes(),W=K.anchor,J=K.focus,R=K.isBackward(),U=R?J.offset:W.offset,X=R?J.getNode():W.getNode();if(K.isCollapsed()&&K.style!==""){const fe=K.style,_e=p(fe);if(_e!==null&&O in _e)return _e[O]}for(let fe=0;fe<Y.length;fe++){const _e=Y[fe];if(!(fe!==0&&U===0&&_e.is(X))&&e.$isTextNode(_e)){const B=Te(_e,O,Z);if(se===null)se=B;else if(se!==B){se="";break}}}return se===null?Z:se}function Ee(K){if(e.$isDecoratorNode(K)&&!K.isInline())return!0;if(!e.$isElementNode(K)||e.$isRootOrShadowRoot(K))return!1;const O=K.getFirstChild(),Z=O===null||e.$isLineBreakNode(O)||e.$isTextNode(O)||O.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&Z}function de(K,O){let Z=K;for(;Z!==null&&Z.getParent()!==null&&!O(Z);)Z=Z.getParentOrThrow();return O(Z)?Z:null}return Vn.$addNodeStyle=v,Vn.$cloneWithProperties=S,Vn.$getSelectionStyleValueForProperty=Se,Vn.$isAtNodeEnd=M,Vn.$isParentElementRTL=V,Vn.$moveCaretSelection=ce,Vn.$moveCharacter=z,Vn.$patchStyleText=G,Vn.$selectAll=q,Vn.$setBlocksType=I,Vn.$shouldOverrideDefaultCharacterSelection=te,Vn.$sliceSelectedTextNodeContent=w,Vn.$wrapNodes=j,Vn.createDOMRange=l,Vn.createRectsFromDOMRange=d,Vn.getStyleObjectFromCSS=p,Vn.trimTextContentFromAnchor=m,Vn}var qn={},Kf;function tC(){if(Kf)return qn;Kf=1;var e=Gt();let t=new Map;function n(m){for(;m!=null;){if(m.nodeType===Node.TEXT_NODE)return m;m=m.firstChild}return null}function r(m){let v=m.parentNode;if(v==null)throw Error("Should never happen");return[v,Array.from(v.childNodes).indexOf(m)]}function l(m){let v={};m=m.split(";");for(let k of m)if(k!==""){let[G,I]=k.split(/:([^]+)/);G&&I&&(v[G.trim()]=I.trim())}return v}function d(m){let v=t.get(m);return v===void 0&&(v=l(m),t.set(m,v)),v}function f(m){let v="";for(let k in m)k&&(v+=`${k}: ${m[k]};`);return v}function p(m,v){var k=d("getStyle"in m?m.getStyle():m.style);v=Object.entries(v).reduce((G,[I,P])=>(P===null?delete G[I]:G[I]=P,G),{...k}),k=f(v),m.setStyle(k),t.set(k,v)}function _(m,v){var k=m.getNodes(),G=k.length;if(e.$isRangeSelection(m)){--G;var I=k[0],P=k[G];if(m.isCollapsed()&&e.$isRangeSelection(m))p(m,v);else{var H=m.anchor,j=m.focus,re=I.getTextContent().length,te=j.offset,ce=H.offset,V=H.isBefore(j),z=V?ce:te;m=V?te:ce;var q=V?H.type:j.type,Te=V?j.type:H.type;if(j=V?j.key:H.key,e.$isTextNode(I)&&z===re&&(V=I.getNextSibling(),e.$isTextNode(V)&&(z=ce=0,I=V)),k.length===1)e.$isTextNode(I)&&(z=q==="element"?0:ce>te?te:ce,m=Te==="element"?re:ce>te?ce:te,z!==m&&(z===0&&m===re?(p(I,v),I.select(z,m)):(k=I.splitText(z,m),k=z===0?k[0]:k[1],p(k,v),k.select(0,m-z))));else for(e.$isTextNode(I)&&z<I.getTextContentSize()&&(z!==0&&(I=I.splitText(z)[1],z=0,H.set(I.getKey(),z,"text")),p(I,v)),e.$isTextNode(P)&&(z=P.getTextContent().length,P.__key!==j&&m!==0&&(m=z),m!==z&&([P]=P.splitText(m)),m!==0&&p(P,v)),m=1;m<G;m++)z=k[m],H=z.getKey(),e.$isTextNode(z)&&H!==I.getKey()&&H!==P.getKey()&&!z.isToken()&&p(z,v)}}else{for(I=e.$createRangeSelection(),P=I.anchor,z=I.focus,H=0;H<G;H++)re=k[H],e.DEPRECATED_$isGridCellNode(re)&&(P.set(re.getKey(),0,"element"),z.set(re.getKey(),re.getChildrenSize(),"element"),_(e.$normalizeSelection__EXPERIMENTAL(I),v));e.$setSelection(m)}}function T(m){for(;m!==null&&!e.$isRootOrShadowRoot(m);){let v=m.getLatest(),k=m.getParent();v.getChildrenSize()===0&&m.remove(!0),m=k}}function E(m,v,k,G,I=null){if(v.length!==0){var P=v[0],H=new Map,j=[];P=e.$isElementNode(P)?P:P.getParentOrThrow(),P.isInline()&&(P=P.getParentOrThrow());for(var re=!1;P!==null;){var te=P.getPreviousSibling();if(te!==null){P=te,re=!0;break}if(P=P.getParentOrThrow(),e.$isRootOrShadowRoot(P))break}te=new Set;for(var ce=0;ce<k;ce++){var V=v[ce];e.$isElementNode(V)&&V.getChildrenSize()===0&&te.add(V.getKey())}var z=new Set;for(ce=0;ce<k;ce++){V=v[ce];var q=V.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&e.$isLeafNode(V)&&!z.has(V.getKey())){if(V=q.getKey(),H.get(V)===void 0){let Te=G();Te.setFormat(q.getFormatType()),Te.setIndent(q.getIndent()),j.push(Te),H.set(V,Te),q.getChildren().forEach(Se=>{Te.append(Se),z.add(Se.getKey()),e.$isElementNode(Se)&&Se.getChildrenKeys().forEach(Ee=>z.add(Ee))}),T(q)}}else if(te.has(V.getKey())){if(!e.$isElementNode(V))throw Error("Expected node in emptyElements to be an ElementNode");q=G(),q.setFormat(V.getFormatType()),q.setIndent(V.getIndent()),j.push(q),V.remove(!0)}}if(I!==null)for(v=0;v<j.length;v++)I.append(j[v]);if(v=null,e.$isRootOrShadowRoot(P))if(re)if(I!==null)P.insertAfter(I);else for(I=j.length-1;0<=I;I--)P.insertAfter(j[I]);else if(re=P.getFirstChild(),e.$isElementNode(re)&&(P=re),re===null)if(I)P.append(I);else for(I=0;I<j.length;I++)re=j[I],P.append(re),v=re;else if(I!==null)re.insertBefore(I);else for(P=0;P<j.length;P++)I=j[P],re.insertBefore(I),v=I;else if(I)P.insertAfter(I);else for(I=j.length-1;0<=I;I--)re=j[I],P.insertAfter(re),v=re;j=e.$getPreviousSelection(),e.$isRangeSelection(j)&&j.anchor.getNode().isAttached()&&j.focus.getNode().isAttached()?e.$setSelection(j.clone()):v!==null?v.selectEnd():m.dirty=!0}}function S(m,v,k,G){m.modify(v?"extend":"move",k,G)}function w(m){return m=m.anchor.getNode(),(e.$isRootNode(m)?m:m.getParentOrThrow()).getDirection()==="rtl"}function M(m){if(e.$isDecoratorNode(m)&&!m.isInline())return!0;if(!e.$isElementNode(m)||e.$isRootOrShadowRoot(m))return!1;var v=m.getFirstChild();return v=v===null||e.$isLineBreakNode(v)||e.$isTextNode(v)||v.isInline(),!m.isInline()&&m.canBeEmpty()!==!1&&v}return qn.$addNodeStyle=function(m){m=m.getStyle();let v=l(m);t.set(m,v)},qn.$cloneWithProperties=function(m){let v=m.constructor.clone(m);return v.__parent=m.__parent,v.__next=m.__next,v.__prev=m.__prev,e.$isElementNode(m)&&e.$isElementNode(v)?(v.__first=m.__first,v.__last=m.__last,v.__size=m.__size,v.__format=m.__format,v.__indent=m.__indent,v.__dir=m.__dir,v):(e.$isTextNode(m)&&e.$isTextNode(v)&&(v.__format=m.__format,v.__style=m.__style,v.__mode=m.__mode,v.__detail=m.__detail),v)},qn.$getSelectionStyleValueForProperty=function(m,v,k=""){let G=null,I=m.getNodes();var P=m.anchor,H=m.focus,j=m.isBackward();let re=j?H.offset:P.offset;if(P=j?H.getNode():P.getNode(),m.isCollapsed()&&m.style!==""&&(m=d(m.style),m!==null&&v in m))return m[v];for(m=0;m<I.length;m++){var te=I[m];if((m===0||re!==0||!te.is(P))&&e.$isTextNode(te)){if(H=v,j=k,te=te.getStyle(),te=d(te),H=te!==null&&te[H]||j,G===null)G=H;else if(G!==H){G="";break}}}return G===null?k:G},qn.$isAtNodeEnd=function(m){if(m.type==="text")return m.offset===m.getNode().getTextContentSize();let v=m.getNode();if(!e.$isElementNode(v))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return m.offset===v.getChildrenSize()},qn.$isParentElementRTL=w,qn.$moveCaretSelection=S,qn.$moveCharacter=function(m,v,k){let G=w(m);S(m,v,k?!G:G,"character")},qn.$patchStyleText=_,qn.$selectAll=function(m){let v=m.anchor;m=m.focus;var k=v.getNode().getTopLevelElementOrThrow().getParentOrThrow();let G=k.getFirstDescendant();k=k.getLastDescendant();let I="element",P="element",H=0;e.$isTextNode(G)?I="text":e.$isElementNode(G)||G===null||(G=G.getParentOrThrow()),e.$isTextNode(k)?(P="text",H=k.getTextContentSize()):e.$isElementNode(k)||k===null||(k=k.getParentOrThrow()),G&&k&&(v.set(G.getKey(),0,I),m.set(k.getKey(),H,P))},qn.$setBlocksType=function(m,v){if(m.anchor.key==="root"){v=v();var k=e.$getRoot();(m=k.getFirstChild())?m.replace(v,!0):k.append(v)}else{for(k=m.getNodes(),m=m.anchor.getNode();m!==null&&m.getParent()!==null&&!M(m);)m=m.getParentOrThrow();for((m=M(m)?m:null)&&k.indexOf(m)===-1&&k.push(m),m=0;m<k.length;m++){let G=k[m];if(!M(G))continue;if(!e.$isElementNode(G))throw Error("Expected block node to be an ElementNode");let I=v();I.setFormat(G.getFormatType()),I.setIndent(G.getIndent()),G.replace(I,!0)}}},qn.$shouldOverrideDefaultCharacterSelection=function(m,v){return m=e.$getAdjacentNode(m.focus,v),e.$isDecoratorNode(m)&&!m.isIsolated()||e.$isElementNode(m)&&!m.isInline()&&!m.canBeEmpty()},qn.$sliceSelectedTextNodeContent=function(m,v){if(v.isSelected(m)&&!v.isSegmented()&&!v.isToken()&&e.$INTERNAL_isPointSelection(m)){var k=m.anchor.getNode(),G=m.focus.getNode(),I=v.is(k),P=v.is(G);if(I||P){I=m.isBackward();let[H,j]=m.getCharacterOffsets();m=k.is(G),P=v.is(I?G:k),G=v.is(I?k:G),k=0;let re;m?(k=H>j?j:H,re=H>j?H:j):P?(k=I?j:H,re=void 0):G&&(I=I?H:j,k=0,re=I),v.__text=v.__text.slice(k,re)}}return v},qn.$wrapNodes=function(m,v,k=null){var G=m.getNodes();let I=G.length;var P=m.anchor;if(I===0||I===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){m=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),G=m.getChildren();let j=v();j.setFormat(m.getFormatType()),j.setIndent(m.getIndent()),G.forEach(re=>j.append(re)),k&&(j=k.append(j)),m.replace(j)}else{P=null;var H=[];for(let j=0;j<I;j++){let re=G[j];e.$isRootOrShadowRoot(re)?(E(m,H,H.length,v,k),H=[],P=re):P===null||P!==null&&e.$hasAncestor(re,P)?H.push(re):(E(m,H,H.length,v,k),H=[re])}E(m,H,H.length,v,k)}},qn.createDOMRange=function(m,v,k,G,I){let P=v.getKey(),H=G.getKey(),j=document.createRange(),re=m.getElementByKey(P);if(m=m.getElementByKey(H),e.$isTextNode(v)&&(re=n(re)),e.$isTextNode(G)&&(m=n(m)),v===void 0||G===void 0||re===null||m===null)return null;re.nodeName==="BR"&&([re,k]=r(re)),m.nodeName==="BR"&&([m,I]=r(m)),v=re.firstChild,re===m&&v!=null&&v.nodeName==="BR"&&k===0&&I===0&&(I=1);try{j.setStart(re,k),j.setEnd(m,I)}catch{return null}return!j.collapsed||k===I&&P===H||(j.setStart(m,I),j.setEnd(re,k)),j},qn.createRectsFromDOMRange=function(m,v){var k=m.getRootElement();if(k===null)return[];m=k.getBoundingClientRect(),k=getComputedStyle(k),k=parseFloat(k.paddingLeft)+parseFloat(k.paddingRight),v=Array.from(v.getClientRects());let G=v.length;v.sort((P,H)=>{let j=P.top-H.top;return 3>=Math.abs(j)?P.left-H.left:j});let I;for(let P=0;P<G;P++){let H=v[P],j=H.width+k===m.width;I&&I.top<=H.top&&I.top+I.height>H.top&&I.left+I.width>H.left||j?(v.splice(P--,1),G--):I=H}return v},qn.getStyleObjectFromCSS=d,qn.trimTextContentFromAnchor=function(m,v,k){let G=v.getNode();if(e.$isElementNode(G)){var I=G.getDescendantByIndex(v.offset);I!==null&&(G=I)}for(;0<k&&G!==null;){e.$isElementNode(G)&&(I=G.getLastDescendant(),I!==null&&(G=I));var P=G.getPreviousSibling(),H=0;if(P===null){I=G.getParentOrThrow();for(var j=I.getPreviousSibling();j===null;){if(I=I.getParent(),I===null){P=null;break}j=I.getPreviousSibling()}I!==null&&(H=I.isInline()?0:2,P=j)}if(j=G.getTextContent(),j===""&&e.$isElementNode(G)&&!G.isInline()&&(j=`
73
+
74
+ `),I=j.length,!e.$isTextNode(G)||k>=I)j=G.getParent(),G.remove(),j==null||j.getChildrenSize()!==0||e.$isRootNode(j)||j.remove(),k-=I+H,G=P;else{let re=G.getKey();H=m.getEditorState().read(()=>{const ce=e.$getNodeByKey(re);return e.$isTextNode(ce)&&ce.isSimpleText()?ce.getTextContent():null}),P=I-k;let te=j.slice(0,P);H!==null&&H!==j?(k=e.$getPreviousSelection(),I=G,G.isSimpleText()?G.setTextContent(H):(I=e.$createTextNode(H),G.replace(I)),e.$isRangeSelection(k)&&k.isCollapsed()&&(k=k.anchor.offset,I.select(k,k))):G.isSimpleText()?(H=v.key===re,j=v.offset,j<k&&(j=I),k=H?j-k:0,I=H?j:P,H&&k===0?([k]=G.splitText(k,I),k.remove()):([,k]=G.splitText(k,I),k.remove())):(k=e.$createTextNode(te),G.replace(k)),k=0}}},qn}var iu,zf;function So(){return zf||(zf=1,iu=process.env.NODE_ENV==="development"?eC():tC()),iu}var Uf;function nC(){if(Uf)return Sn;Uf=1;var e=So(),t=Gt();function n(...te){return()=>{te.forEach(ce=>ce())}}function r(te){return`${te}px`}const l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(te,ce,V){let z=null,q=null,Te=null,Se=[];const Ee=document.createElement("div");function de(){if(z===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:se,top:Y}=z.getBoundingClientRect(),W=q,J=e.createRectsFromDOMRange(te,ce);Ee.isConnected||W.append(Ee);let R=!1;for(let U=0;U<J.length;U++){const X=J[U],fe=Se[U]||document.createElement("div"),_e=fe.style;_e.position!=="absolute"&&(_e.position="absolute",R=!0);const B=r(X.left-se);_e.left!==B&&(_e.left=B,R=!0);const A=r(X.top-Y);_e.top!==A&&(fe.style.top=A,R=!0);const F=r(X.width);_e.width!==F&&(fe.style.width=F,R=!0);const oe=r(X.height);_e.height!==oe&&(fe.style.height=oe,R=!0),fe.parentNode!==Ee&&(Ee.append(fe),R=!0),Se[U]=fe}for(;Se.length>J.length;)Se.pop();R&&V(Se)}function K(){q=null,z=null,Te!==null&&Te.disconnect(),Te=null,Ee.remove();for(const se of Se)se.remove();Se=[]}function O(){const se=te.getRootElement();if(se===null)return K();const Y=se.parentElement;if(!(Y instanceof HTMLElement))return K();K(),z=se,q=Y,Te=new MutationObserver(W=>{const J=te.getRootElement(),R=J&&J.parentElement;if(J!==z||R!==q)return O();for(const U of W)if(!Ee.contains(U.target))return de()}),Te.observe(Y,l),de()}const Z=te.registerRootListener(O);return()=>{Z(),K()}}function f(te,ce){let V=null,z=null,q=null,Te=null,Se=()=>{};function Ee(de){de.read(()=>{const K=t.$getSelection();if(!t.$isRangeSelection(K)){V=null,z=null,q=null,Te=null,Se(),Se=()=>{};return}const{anchor:O,focus:Z}=K,se=O.getNode(),Y=se.getKey(),W=O.offset,J=Z.getNode(),R=J.getKey(),U=Z.offset,X=te.getElementByKey(Y),fe=te.getElementByKey(R),_e=V===null||X===null||W!==z||Y!==V.getKey()||se!==V&&(!(V instanceof t.TextNode)||se.updateDOM(V,X,te._config)),B=q===null||fe===null||U!==Te||R!==q.getKey()||J!==q&&(!(q instanceof t.TextNode)||J.updateDOM(q,fe,te._config));if(_e||B){const A=te.getElementByKey(O.getNode().getKey()),F=te.getElementByKey(Z.getNode().getKey());if(A!==null&&F!==null&&A.tagName==="SPAN"&&F.tagName==="SPAN"){const oe=document.createRange();let ye,De,ee,ne;Z.isBefore(O)?(ye=F,De=Z.offset,ee=A,ne=O.offset):(ye=A,De=O.offset,ee=F,ne=Z.offset);const ue=ye.firstChild;if(ue===null)throw Error("Expected text node to be first child of span");const be=ee.firstChild;if(be===null)throw Error("Expected text node to be first child of span");oe.setStart(ue,De),oe.setEnd(be,ne),Se(),Se=d(te,oe,Ne=>{for(const Re of Ne){const ke=Re.style;ke.background!=="Highlight"&&(ke.background="Highlight"),ke.color!=="HighlightText"&&(ke.color="HighlightText"),ke.zIndex!=="-1"&&(ke.zIndex="-1"),ke.pointerEvents!=="none"&&(ke.pointerEvents="none"),ke.marginTop!==r(-1.5)&&(ke.marginTop=r(-1.5)),ke.paddingTop!==r(4)&&(ke.paddingTop=r(4)),ke.paddingBottom!==r(0)&&(ke.paddingBottom=r(0))}ce!==void 0&&ce(Ne)})}}V=se,z=W,q=J,Te=U})}return Ee(te.getEditorState()),n(te.registerUpdateListener(({editorState:de})=>Ee(de)),Se,()=>{Se()})}function p(te,...ce){ce.forEach(V=>{if(typeof V=="string"){const z=V.split(" ").filter(q=>q!=="");te.classList.add(...z)}})}function _(te,...ce){ce.forEach(V=>{typeof V=="string"&&te.classList.remove(...V.split(" "))})}function T(te,ce){for(const V of ce)if(te.type.startsWith(V))return!0;return!1}function E(te,ce){const V=te[Symbol.iterator]();return new Promise((z,q)=>{const Te=[],Se=()=>{const{done:Ee,value:de}=V.next();if(Ee)return z(Te);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const O=K.result;typeof O=="string"&&Te.push({file:de,result:O}),Se()}),T(de,ce)?K.readAsDataURL(de):Se()};Se()})}function S(te,ce){const V=[],z=(te||t.$getRoot()).getLatest(),q=ce||(t.$isElementNode(z)?z.getLastDescendant():z);let Te=z,Se=w(Te);for(;Te!==null&&!Te.is(q);)if(V.push({depth:Se,node:Te}),t.$isElementNode(Te)&&Te.getChildrenSize()>0)Te=Te.getFirstChild(),Se++;else{let Ee=null;for(;Ee===null&&Te!==null;)Ee=Te.getNextSibling(),Ee===null?(Te=Te.getParent(),Se--):Te=Ee}return Te!==null&&Te.is(q)&&V.push({depth:Se,node:Te}),V}function w(te){let ce=te,V=0;for(;(ce=ce.getParent())!==null;)V++;return V}function M(te,ce){let V=te;for(;V!=null;){if(V instanceof ce)return V;V=V.getParent()}return null}function m(te){const ce=v(te,V=>t.$isElementNode(V)&&!V.isInline());if(!t.$isElementNode(ce))throw Error(`Expected node ${te.__key} to have closest block element node.`);return ce}const v=(te,ce)=>{let V=te;for(;V!==t.$getRoot()&&V!=null;){if(ce(V))return V;V=V.getParent()}return null};function k(te,ce,V,z){const q=Ee=>Ee instanceof ce,Te=Ee=>{const de=Ee.getChildren();for(let Z=0;Z<de.length;Z++){const se=de[Z];if(q(se))return null}let K=Ee,O=Ee;for(;K!==null;)if(O=K,K=K.getParent(),q(K))return{child:O,parent:K};return null},Se=Ee=>{const de=Te(Ee);if(de!==null){const{child:K,parent:O}=de;if(K.is(Ee)){z(O,Ee);const Z=K.getNextSiblings(),se=Z.length;if(O.insertAfter(K),se!==0){const Y=V(O);K.insertAfter(Y);for(let W=0;W<se;W++)Y.append(Z[W])}!O.canBeEmpty()&&O.getChildrenSize()===0&&O.remove()}}};return te.registerNodeTransform(ce,Se)}function G(te,ce){const z=new Map,q=te._pendingEditorState;for(const[Se,Ee]of ce._nodeMap){const de=e.$cloneWithProperties(Ee);if(t.$isTextNode(de)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");de.__text=Ee.__text}z.set(Se,de)}q&&(q._nodeMap=z),te._dirtyType=2;const Te=ce._selection;t.$setSelection(Te===null?null:Te.clone())}function I(te){const ce=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ce)){const{focus:V}=ce,z=V.getNode(),q=V.offset;if(t.$isRootOrShadowRoot(z)){const Te=z.getChildAtIndex(q);Te==null?z.append(te):Te.insertBefore(te),te.selectNext()}else{let Te,Se;t.$isTextNode(z)?(Te=z.getParentOrThrow(),Se=z.getIndexWithinParent(),q>0&&(Se+=1,z.splitText(q))):(Te=z,Se=q);const[,Ee]=t.$splitNode(Te,Se);Ee.insertBefore(te),Ee.selectStart()}}else{if(ce!=null){const z=ce.getNodes();z[z.length-1].getTopLevelElementOrThrow().insertAfter(te)}else t.$getRoot().append(te);const V=t.$createParagraphNode();te.insertAfter(V),V.select()}return te.getLatest()}function P(te,ce){const V=ce();return te.replace(V),V.append(te),V}function H(te,ce){return te!==null?Object.getPrototypeOf(te).constructor.name===ce.name:!1}function j(te,ce){const V=[];for(let z=0;z<te.length;z++){const q=ce(te[z]);q!==null&&V.push(q)}return V}function re(te,ce){const V=te.getFirstChild();V!==null?V.insertBefore(ce):te.append(ce)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=S,Sn.$filter=j,Sn.$findMatchingParent=v,Sn.$getNearestBlockElementAncestorOrThrow=m,Sn.$getNearestNodeOfType=M,Sn.$insertFirst=re,Sn.$insertNodeToNearestRoot=I,Sn.$restoreEditorState=G,Sn.$wrapNodeInElement=P,Sn.addClassNamesToElement=p,Sn.isMimeType=T,Sn.markSelection=f,Sn.mediaFileReader=E,Sn.mergeRegister=n,Sn.objectKlassEquals=H,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=k,Sn.removeClassNamesFromElement=_,Sn}var wn={},Gf;function rC(){if(Gf)return wn;Gf=1;var e=So(),t=Gt();function n(_){let T=new URLSearchParams;T.append("code",_);for(let E=1;E<arguments.length;E++)T.append("v",arguments[E]);throw Error(`Minified Lexical error #${_}; visit https://lexical.dev/docs/error?${T} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(..._){return()=>{_.forEach(T=>T())}}let l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(_,T,E){function S(){if(m===null)throw Error("Unexpected null rootDOMNode");if(v===null)throw Error("Unexpected null parentDOMNode");let{left:H,top:j}=m.getBoundingClientRect();var re=v;let te=e.createRectsFromDOMRange(_,T);I.isConnected||re.append(I),re=!1;for(let z=0;z<te.length;z++){var ce=te[z];let q=G[z]||document.createElement("div"),Te=q.style;Te.position!=="absolute"&&(Te.position="absolute",re=!0);var V=`${ce.left-H}px`;Te.left!==V&&(Te.left=V,re=!0),V=`${ce.top-j}px`,Te.top!==V&&(q.style.top=V,re=!0),V=`${ce.width}px`,Te.width!==V&&(q.style.width=V,re=!0),ce=`${ce.height}px`,Te.height!==ce&&(q.style.height=ce,re=!0),q.parentNode!==I&&(I.append(q),re=!0),G[z]=q}for(;G.length>te.length;)G.pop();re&&E(G)}function w(){m=v=null,k!==null&&k.disconnect(),k=null,I.remove();for(let H of G)H.remove();G=[]}function M(){let H=_.getRootElement();if(H===null)return w();let j=H.parentElement;if(!(j instanceof HTMLElement))return w();w(),m=H,v=j,k=new MutationObserver(re=>{let te=_.getRootElement(),ce=te&&te.parentElement;if(te!==m||ce!==v)return M();for(let V of re)if(!I.contains(V.target))return S()}),k.observe(j,l),S()}let m=null,v=null,k=null,G=[],I=document.createElement("div"),P=_.registerRootListener(M);return()=>{P(),w()}}function f(_,T){for(let E of T)if(_.type.startsWith(E))return!0;return!1}let p=(_,T)=>{for(;_!==t.$getRoot()&&_!=null;){if(T(_))return _;_=_.getParent()}return null};return wn.$splitNode=t.$splitNode,wn.isHTMLAnchorElement=t.isHTMLAnchorElement,wn.isHTMLElement=t.isHTMLElement,wn.$dfs=function(_,T){let E=[];_=(_||t.$getRoot()).getLatest(),T=T||(t.$isElementNode(_)?_.getLastDescendant():_);for(var S=_,w=0;(S=S.getParent())!==null;)w++;for(S=w;_!==null&&!_.is(T);)if(E.push({depth:S,node:_}),t.$isElementNode(_)&&0<_.getChildrenSize())_=_.getFirstChild(),S++;else for(w=null;w===null&&_!==null;)w=_.getNextSibling(),w===null?(_=_.getParent(),S--):_=w;return _!==null&&_.is(T)&&E.push({depth:S,node:_}),E},wn.$filter=function(_,T){let E=[];for(let S=0;S<_.length;S++){let w=T(_[S]);w!==null&&E.push(w)}return E},wn.$findMatchingParent=p,wn.$getNearestBlockElementAncestorOrThrow=function(_){let T=p(_,E=>t.$isElementNode(E)&&!E.isInline());return t.$isElementNode(T)||n(4,_.__key),T},wn.$getNearestNodeOfType=function(_,T){for(;_!=null;){if(_ instanceof T)return _;_=_.getParent()}return null},wn.$insertFirst=function(_,T){let E=_.getFirstChild();E!==null?E.insertBefore(T):_.append(T)},wn.$insertNodeToNearestRoot=function(_){var T=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(T)){var{focus:E}=T;if(T=E.getNode(),E=E.offset,t.$isRootOrShadowRoot(T))E=T.getChildAtIndex(E),E==null?T.append(_):E.insertBefore(_),_.selectNext();else{let S,w;t.$isTextNode(T)?(S=T.getParentOrThrow(),w=T.getIndexWithinParent(),0<E&&(w+=1,T.splitText(E))):(S=T,w=E),[,T]=t.$splitNode(S,w),T.insertBefore(_),T.selectStart()}}else T!=null?(T=T.getNodes(),T[T.length-1].getTopLevelElementOrThrow().insertAfter(_)):t.$getRoot().append(_),T=t.$createParagraphNode(),_.insertAfter(T),T.select();return _.getLatest()},wn.$restoreEditorState=function(_,T){let E=new Map,S=_._pendingEditorState;for(let[w,M]of T._nodeMap){let m=e.$cloneWithProperties(M);if(t.$isTextNode(m)){if(!t.$isTextNode(M))throw Error("Expected node be a TextNode");m.__text=M.__text}E.set(w,m)}S&&(S._nodeMap=E),_._dirtyType=2,_=T._selection,t.$setSelection(_===null?null:_.clone())},wn.$wrapNodeInElement=function(_,T){return T=T(),_.replace(T),T.append(_),T},wn.addClassNamesToElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&(E=E.split(" ").filter(S=>S!==""),_.classList.add(...E))})},wn.isMimeType=f,wn.markSelection=function(_,T){function E(k){k.read(()=>{var G=t.$getSelection();if(t.$isRangeSelection(G)){var{anchor:I,focus:P}=G;G=I.getNode();var H=G.getKey(),j=I.offset,re=P.getNode(),te=re.getKey(),ce=P.offset,V=_.getElementByKey(H),z=_.getElementByKey(te);if(H=S===null||V===null||j!==w||H!==S.getKey()||G!==S&&(!(S instanceof t.TextNode)||G.updateDOM(S,V,_._config)),te=M===null||z===null||ce!==m||te!==M.getKey()||re!==M&&(!(M instanceof t.TextNode)||re.updateDOM(M,z,_._config)),H||te){V=_.getElementByKey(I.getNode().getKey());var q=_.getElementByKey(P.getNode().getKey());if(V!==null&&q!==null&&V.tagName==="SPAN"&&q.tagName==="SPAN"){if(te=document.createRange(),P.isBefore(I)?(H=q,z=P.offset,q=V,V=I.offset):(H=V,z=I.offset,V=P.offset),H=H.firstChild,H===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");te.setStart(H,z),te.setEnd(q,V),v(),v=d(_,te,Te=>{for(let Se of Te){let Ee=Se.style;Ee.background!=="Highlight"&&(Ee.background="Highlight"),Ee.color!=="HighlightText"&&(Ee.color="HighlightText"),Ee.zIndex!=="-1"&&(Ee.zIndex="-1"),Ee.pointerEvents!=="none"&&(Ee.pointerEvents="none"),Ee.marginTop!=="-1.5px"&&(Ee.marginTop="-1.5px"),Ee.paddingTop!=="4px"&&(Ee.paddingTop="4px"),Ee.paddingBottom!=="0px"&&(Ee.paddingBottom="0px")}T!==void 0&&T(Te)})}}S=G,w=j,M=re,m=ce}else m=M=w=S=null,v(),v=()=>{}})}let S=null,w=null,M=null,m=null,v=()=>{};return E(_.getEditorState()),r(_.registerUpdateListener(({editorState:k})=>E(k)),v,()=>{v()})},wn.mediaFileReader=function(_,T){let E=_[Symbol.iterator]();return new Promise((S,w)=>{let M=[],m=()=>{const{done:v,value:k}=E.next();if(v)return S(M);const G=new FileReader;G.addEventListener("error",w),G.addEventListener("load",()=>{const I=G.result;typeof I=="string"&&M.push({file:k,result:I}),m()}),f(k,T)?G.readAsDataURL(k):m()};m()})},wn.mergeRegister=r,wn.objectKlassEquals=function(_,T){return _!==null?Object.getPrototypeOf(_).constructor.name===T.name:!1},wn.positionNodeOnRange=d,wn.registerNestedElementResolver=function(_,T,E,S){return _.registerNodeTransform(T,w=>{e:{for(var M=w.getChildren(),m=0;m<M.length;m++)if(M[m]instanceof T){M=null;break e}for(M=w;M!==null;)if(m=M,M=M.getParent(),M instanceof T){M={child:m,parent:M};break e}M=null}if(M!==null){const{child:v,parent:k}=M;if(v.is(w)){if(S(k,w),w=v.getNextSiblings(),M=w.length,k.insertAfter(v),M!==0){m=E(k),v.insertAfter(m);for(let G=0;G<M;G++)m.append(w[G])}k.canBeEmpty()||k.getChildrenSize()!==0||k.remove()}}})},wn.removeClassNamesFromElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&_.classList.remove(...E.split(" "))})},wn}var ou,Yf;function gn(){return Yf||(Yf=1,ou=process.env.NODE_ENV==="development"?nC():rC()),ou}var su={},jf;function iC(){if(jf)return su;jf=1;var e=Gt();function t(n){const r=window.location.origin,l=d=>{if(d.origin!==r)return;const f=n.getRootElement();if(document.activeElement!==f)return;const p=d.data;if(typeof p=="string"){let _;try{_=JSON.parse(p)}catch{return}if(_&&_.protocol==="nuanria_messaging"&&_.type==="request"){const T=_.payload;if(T&&T.functionId==="makeChanges"){const E=T.args;if(E){const[S,w,M,m,v,k]=E;n.update(()=>{const G=e.$getSelection();if(e.$isRangeSelection(G)){const I=G.anchor;let P=I.getNode(),H=0,j=0;if(e.$isTextNode(P)&&S>=0&&w>=0&&(H=S,j=S+w,G.setTextNodeRange(P,H,P,j)),(H!==j||M!=="")&&(G.insertRawText(M),P=I.getNode()),e.$isTextNode(P)){H=m,j=m+v;const re=P.getTextContentSize();H=H>re?re:H,j=j>re?re:j,G.setTextNodeRange(P,H,P,j)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",l,!0),()=>{window.removeEventListener("message",l,!0)}}return su.registerDragonSupport=t,su}var lu={},Vf;function oC(){if(Vf)return lu;Vf=1;var e=Gt();return lu.registerDragonSupport=function(t){let n=window.location.origin,r=l=>{if(l.origin===n){var d=t.getRootElement();if(document.activeElement===d&&(d=l.data,typeof d=="string")){try{var f=JSON.parse(d)}catch{return}if(f&&f.protocol==="nuanria_messaging"&&f.type==="request"&&(f=f.payload)&&f.functionId==="makeChanges"&&(f=f.args)){const[p,_,T,E,S]=f;t.update(()=>{const w=e.$getSelection();if(e.$isRangeSelection(w)){var M=w.anchor;let m=M.getNode(),v=0,k=0;e.$isTextNode(m)&&0<=p&&0<=_&&(v=p,k=p+_,w.setTextNodeRange(m,v,m,k)),(v!==k||T!=="")&&(w.insertRawText(T),m=M.getNode()),e.$isTextNode(m)&&(v=E,k=E+S,M=m.getTextContentSize(),v=v>M?M:v,k=k>M?M:k,w.setTextNodeRange(m,v,m,k)),l.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},lu}var au,qf;function xp(){return qf||(qf=1,au=process.env.NODE_ENV==="development"?iC():oC()),au}var ui={},vi={},qa={},Zf;function sC(){if(Zf)return qa;Zf=1;var e=So(),t=gn(),n=Gt();function r(T,E){const S=E.body?E.body.childNodes:[];let w=[];for(let M=0;M<S.length;M++){const m=S[M];if(!p.has(m.nodeName)){const v=_(m,T);v!==null&&(w=w.concat(v))}}return w}function l(T,E){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 S=document.createElement("div"),M=n.$getRoot().getChildren();for(let m=0;m<M.length;m++){const v=M[m];d(T,v,S,E)}return S.innerHTML}function d(T,E,S,w=null){let M=w!=null?E.isSelected(w):!0;const m=n.$isElementNode(E)&&E.excludeFromCopy("html");let v=E;if(w!==null){let re=e.$cloneWithProperties(E);re=n.$isTextNode(re)&&w!=null?e.$sliceSelectedTextNodeContent(w,re):re,v=re}const k=n.$isElementNode(v)?v.getChildren():[],G=T._nodes.get(v.getType());let I;G&&G.exportDOM!==void 0?I=G.exportDOM(T,v):I=v.exportDOM(T);const{element:P,after:H}=I;if(!P)return!1;const j=document.createDocumentFragment();for(let re=0;re<k.length;re++){const te=k[re],ce=d(T,te,j,w);!M&&n.$isElementNode(E)&&ce&&E.extractWithChild(te,w,"html")&&(M=!0)}if(M&&!m){if(t.isHTMLElement(P)&&P.append(j),S.append(P),H){const re=H.call(v,P);re&&P.replaceWith(re)}}else S.append(j);return M}function f(T,E){const{nodeName:S}=T,w=E._htmlConversions.get(S.toLowerCase());let M=null;if(w!==void 0)for(const m of w){const v=m(T);v!==null&&(M===null||(M.priority||0)<(v.priority||0))&&(M=v)}return M!==null?M.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function _(T,E,S=new Map,w){let M=[];if(p.has(T.nodeName))return M;let m=null;const v=f(T,E),k=v?v(T):null;let G=null;if(k!==null){G=k.after;const H=k.node;if(m=Array.isArray(H)?H[H.length-1]:H,m!==null){for(const[,j]of S)if(m=j(m,w),!m)break;m&&M.push(...Array.isArray(H)?H:[m])}k.forChild!=null&&S.set(T.nodeName,k.forChild)}const I=T.childNodes;let P=[];for(let H=0;H<I.length;H++)P.push(..._(I[H],E,new Map(S),m));return G!=null&&(P=G(P)),m==null?M=M.concat(P):n.$isElementNode(m)&&m.append(...P),M}return qa.$generateHtmlFromNodes=l,qa.$generateNodesFromDOM=r,qa}var Za={},Jf;function lC(){if(Jf)return Za;Jf=1;var e=So(),t=gn(),n=Gt();function r(f,p,_,T=null){let E=T!=null?p.isSelected(T):!0,S=n.$isElementNode(p)&&p.excludeFromCopy("html");var w=p;T!==null&&(w=e.$cloneWithProperties(p),w=n.$isTextNode(w)&&T!=null?e.$sliceSelectedTextNodeContent(T,w):w);let M=n.$isElementNode(w)?w.getChildren():[];var m=f._nodes.get(w.getType());m=m&&m.exportDOM!==void 0?m.exportDOM(f,w):w.exportDOM(f);let{element:v,after:k}=m;if(!v)return!1;m=document.createDocumentFragment();for(let G=0;G<M.length;G++){let I=M[G],P=r(f,I,m,T);!E&&n.$isElementNode(p)&&P&&p.extractWithChild(I,T,"html")&&(E=!0)}return E&&!S?(t.isHTMLElement(v)&&v.append(m),_.append(v),k&&(f=k.call(w,v))&&v.replaceWith(f)):_.append(m),E}let l=new Set(["STYLE","SCRIPT"]);function d(f,p,_=new Map,T){let E=[];if(l.has(f.nodeName))return E;let S=null;var w,{nodeName:M}=f,m=p._htmlConversions.get(M.toLowerCase());if(M=null,m!==void 0)for(w of m)m=w(f),m!==null&&(M===null||(M.priority||0)<(m.priority||0))&&(M=m);if(M=(w=M!==null?M.conversion:null)?w(f):null,w=null,M!==null){if(w=M.after,m=M.node,S=Array.isArray(m)?m[m.length-1]:m,S!==null){for(var[,v]of _)if(S=v(S,T),!S)break;S&&E.push(...Array.isArray(m)?m:[S])}M.forChild!=null&&_.set(f.nodeName,M.forChild)}for(f=f.childNodes,T=[],v=0;v<f.length;v++)T.push(...d(f[v],p,new Map(_),S));return w!=null&&(T=w(T)),S==null?E=E.concat(T):n.$isElementNode(S)&&S.append(...T),E}return Za.$generateHtmlFromNodes=function(f,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 _=document.createElement("div"),T=n.$getRoot().getChildren();for(let E=0;E<T.length;E++)r(f,T[E],_,p);return _.innerHTML},Za.$generateNodesFromDOM=function(f,p){p=p.body?p.body.childNodes:[];let _=[];for(let E=0;E<p.length;E++){var T=p[E];l.has(T.nodeName)||(T=d(T,f),T!==null&&(_=_.concat(T)))}return _},Za}var cu,Xf;function vp(){return Xf||(Xf=1,cu=process.env.NODE_ENV==="development"?sC():lC()),cu}var Qf;function aC(){if(Qf)return vi;Qf=1;var e=vp(),t=So(),n=gn(),r=Gt();const l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=P=>l?(P||window).getSelection():null;function f(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?"":e.$generateHtmlFromNodes(P,H)}function p(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?null:JSON.stringify(M(P,H))}function _(P,H){const j=P.getData("text/plain")||P.getData("text/uri-list");j!=null&&H.insertRawText(j)}function T(P,H,j){const re=P.getData("application/x-lexical-editor");if(re)try{const V=JSON.parse(re);if(V.namespace===j._config.namespace&&Array.isArray(V.nodes)){const z=m(V.nodes);return E(j,z,H)}}catch{}const te=P.getData("text/html");if(te)try{const z=new DOMParser().parseFromString(te,"text/html"),q=e.$generateNodesFromDOM(j,z);return E(j,q,H)}catch{}const ce=P.getData("text/plain")||P.getData("text/uri-list");if(ce!=null)if(r.$isRangeSelection(H)){const V=ce.split(/(\r?\n|\t)/);V[V.length-1]===""&&V.pop();for(let z=0;z<V.length;z++){const q=V[z];q===`
75
+ `||q===`\r
76
+ `?H.insertParagraph():q===" "?H.insertNodes([r.$createTabNode()]):H.insertText(q)}}else H.insertRawText(ce)}function E(P,H,j){P.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:H,selection:j})||j.insertNodes(H)}function S(P){const H=P.exportJSON(),j=P.constructor;if(H.type!==j.getType())throw Error(`LexicalNode: Node ${j.name} does not implement .exportJSON().`);if(r.$isElementNode(P)){const re=H.children;if(!Array.isArray(re))throw Error(`LexicalNode: Node ${j.name} is an element but .exportJSON() does not have a children array.`)}return H}function w(P,H,j,re=[]){let te=H!=null?j.isSelected(H):!0;const ce=r.$isElementNode(j)&&j.excludeFromCopy("html");let V=j;if(H!==null){let Te=t.$cloneWithProperties(j);Te=r.$isTextNode(Te)&&H!=null?t.$sliceSelectedTextNodeContent(H,Te):Te,V=Te}const z=r.$isElementNode(V)?V.getChildren():[],q=S(V);if(r.$isTextNode(V)){const Te=V.__text;Te.length>0?q.text=Te:te=!1}for(let Te=0;Te<z.length;Te++){const Se=z[Te],Ee=w(P,H,Se,q.children);!te&&r.$isElementNode(j)&&Ee&&j.extractWithChild(Se,H,"clone")&&(te=!0)}if(te&&!ce)re.push(q);else if(Array.isArray(q.children))for(let Te=0;Te<q.children.length;Te++){const Se=q.children[Te];re.push(Se)}return te}function M(P,H){const j=[],te=r.$getRoot().getChildren();for(let ce=0;ce<te.length;ce++){const V=te[ce];w(P,H,V,j)}return{namespace:P._config.namespace,nodes:j}}function m(P){const H=[];for(let j=0;j<P.length;j++){const re=P[j],te=r.$parseSerializedNode(re);r.$isTextNode(te)&&t.$addNodeStyle(te),H.push(te)}return H}const v=50;let k=null;async function G(P,H){if(k!==null)return!1;if(H!==null)return new Promise((z,q)=>{P.update(()=>{z(I(P,H))})});const j=P.getRootElement(),re=P._window==null?window.document:P._window.document,te=d(P._window);if(j===null||te===null)return!1;const ce=re.createElement("span");ce.style.cssText="position: fixed; top: -1000px;",ce.append(re.createTextNode("#")),j.append(ce);const V=new Range;return V.setStart(ce,0),V.setEnd(ce,1),te.removeAllRanges(),te.addRange(V),new Promise((z,q)=>{const Te=P.registerCommand(r.COPY_COMMAND,Se=>(n.objectKlassEquals(Se,ClipboardEvent)&&(Te(),k!==null&&(window.clearTimeout(k),k=null),z(I(P,Se))),!0),r.COMMAND_PRIORITY_CRITICAL);k=window.setTimeout(()=>{Te(),k=null,z(!1)},v),re.execCommand("copy"),ce.remove()})}function I(P,H){const j=d(P._window);if(!j)return!1;const re=j.anchorNode,te=j.focusNode;if(re!==null&&te!==null&&!r.isSelectionWithinEditor(P,re,te))return!1;H.preventDefault();const ce=H.clipboardData,V=r.$getSelection();if(ce===null||V===null)return!1;const z=f(P),q=p(P);let Te="";return V!==null&&(Te=V.getTextContent()),z!==null&&ce.setData("text/html",z),q!==null&&ce.setData("application/x-lexical-editor",q),ce.setData("text/plain",Te),!0}return vi.$generateJSONFromSelectedNodes=M,vi.$generateNodesFromSerializedNodes=m,vi.$getHtmlContent=f,vi.$getLexicalContent=p,vi.$insertDataTransferForPlainText=_,vi.$insertDataTransferForRichText=T,vi.$insertGeneratedNodes=E,vi.copyToClipboard=G,vi}var Si={},eh;function cC(){if(eh)return Si;eh=1;var e=vp(),t=So(),n=gn(),r=Gt();function l(m){let v=new URLSearchParams;v.append("code",m);for(let k=1;k<arguments.length;k++)v.append("v",arguments[k]);throw Error(`Minified Lexical error #${m}; 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.`)}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function f(m){let v=r.$getSelection();if(v==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(v)&&v.isCollapsed()||v.getNodes().length===0?"":e.$generateHtmlFromNodes(m,v)}function p(m){let v=r.$getSelection();if(v==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(v)&&v.isCollapsed()||v.getNodes().length===0?null:JSON.stringify(E(m,v))}function _(m,v,k){m.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:v,selection:k})||k.insertNodes(v)}function T(m,v,k,G=[]){let I=v!=null?k.isSelected(v):!0,P=r.$isElementNode(k)&&k.excludeFromCopy("html");var H=k;if(v!==null){var j=t.$cloneWithProperties(k);H=j=r.$isTextNode(j)&&v!=null?t.$sliceSelectedTextNodeContent(v,j):j}let re=r.$isElementNode(H)?H.getChildren():[];var te=H;j=te.exportJSON();var ce=te.constructor;for(j.type!==ce.getType()&&l(58,ce.name),r.$isElementNode(te)&&(Array.isArray(j.children)||l(59,ce.name)),r.$isTextNode(H)&&(H=H.__text,0<H.length?j.text=H:I=!1),H=0;H<re.length;H++)te=re[H],ce=T(m,v,te,j.children),!I&&r.$isElementNode(k)&&ce&&k.extractWithChild(te,v,"clone")&&(I=!0);if(I&&!P)G.push(j);else if(Array.isArray(j.children))for(m=0;m<j.children.length;m++)G.push(j.children[m]);return I}function E(m,v){let k=[],G=r.$getRoot().getChildren();for(let I=0;I<G.length;I++)T(m,v,G[I],k);return{namespace:m._config.namespace,nodes:k}}function S(m){let v=[];for(let k=0;k<m.length;k++){let G=r.$parseSerializedNode(m[k]);r.$isTextNode(G)&&t.$addNodeStyle(G),v.push(G)}return v}let w=null;function M(m,v){var k=d?(m._window||window).getSelection():null;if(!k)return!1;var G=k.anchorNode;if(k=k.focusNode,G!==null&&k!==null&&!r.isSelectionWithinEditor(m,G,k)||(v.preventDefault(),v=v.clipboardData,G=r.$getSelection(),v===null||G===null))return!1;k=f(m),m=p(m);let I="";return G!==null&&(I=G.getTextContent()),k!==null&&v.setData("text/html",k),m!==null&&v.setData("application/x-lexical-editor",m),v.setData("text/plain",I),!0}return Si.$generateJSONFromSelectedNodes=E,Si.$generateNodesFromSerializedNodes=S,Si.$getHtmlContent=f,Si.$getLexicalContent=p,Si.$insertDataTransferForPlainText=function(m,v){m=m.getData("text/plain")||m.getData("text/uri-list"),m!=null&&v.insertRawText(m)},Si.$insertDataTransferForRichText=function(m,v,k){var G=m.getData("application/x-lexical-editor");if(G)try{let P=JSON.parse(G);if(P.namespace===k._config.namespace&&Array.isArray(P.nodes)){let H=S(P.nodes);return _(k,H,v)}}catch{}if(G=m.getData("text/html"))try{var I=new DOMParser().parseFromString(G,"text/html");let P=e.$generateNodesFromDOM(k,I);return _(k,P,v)}catch{}if(m=m.getData("text/plain")||m.getData("text/uri-list"),m!=null)if(r.$isRangeSelection(v))for(m=m.split(/(\r?\n|\t)/),m[m.length-1]===""&&m.pop(),k=0;k<m.length;k++)I=m[k],I===`
77
+ `||I===`\r
78
+ `?v.insertParagraph():I===" "?v.insertNodes([r.$createTabNode()]):v.insertText(I);else v.insertRawText(m)},Si.$insertGeneratedNodes=_,Si.copyToClipboard=async function(m,v){if(w!==null)return!1;if(v!==null)return new Promise(H=>{m.update(()=>{H(M(m,v))})});var k=m.getRootElement();let G=m._window==null?window.document:m._window.document,I=d?(m._window||window).getSelection():null;if(k===null||I===null)return!1;let P=G.createElement("span");return P.style.cssText="position: fixed; top: -1000px;",P.append(G.createTextNode("#")),k.append(P),k=new Range,k.setStart(P,0),k.setEnd(P,1),I.removeAllRanges(),I.addRange(k),new Promise(H=>{let j=m.registerCommand(r.COPY_COMMAND,re=>(n.objectKlassEquals(re,ClipboardEvent)&&(j(),w!==null&&(window.clearTimeout(w),w=null),H(M(m,re))),!0),r.COMMAND_PRIORITY_CRITICAL);w=window.setTimeout(()=>{j(),w=null,H(!1)},50),G.execCommand("copy"),P.remove()})},Si}var uu,th;function Sp(){return th||(th=1,uu=process.env.NODE_ENV==="development"?aC():cC()),uu}var nh;function uC(){if(nh)return ui;nh=1;var e=Sp(),t=So(),n=gn(),r=Gt();function l(Se,Ee){if(typeof document.caretRangeFromPoint<"u"){const de=document.caretRangeFromPoint(Se,Ee);return de===null?null:{node:de.startContainer,offset:de.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const de=document.caretPositionFromPoint(Se,Ee);return de===null?null:{node:de.offsetNode,offset:de.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new M(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const de=document.createElement("blockquote");return n.addClassNamesToElement(de,Ee.theme.quote),de}updateDOM(Ee,de){return!1}static importDOM(){return{blockquote:Ee=>({conversion:P,priority:0})}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=m();return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,de){const K=r.$createParagraphNode(),O=this.getDirection();return K.setDirection(O),this.insertAfter(K,de),K}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}}function m(){return r.$applyNodeReplacement(new M)}function v(Se){return Se instanceof M}class k extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new k(Ee.__tag,Ee.__key)}constructor(Ee,de){super(de),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const de=this.__tag,K=document.createElement(de),Z=Ee.theme.heading;if(Z!==void 0){const se=Z[de];n.addClassNamesToElement(K,se)}return K}updateDOM(Ee,de){return!1}static importDOM(){return{h1:Ee=>({conversion:I,priority:0}),h2:Ee=>({conversion:I,priority:0}),h3:Ee=>({conversion:I,priority:0}),h4:Ee=>({conversion:I,priority:0}),h5:Ee=>({conversion:I,priority:0}),h6:Ee=>({conversion:I,priority:0}),p:Ee=>{const K=Ee.firstChild;return K!==null&&G(K)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>G(Ee)?{conversion:de=>({node:H("h1")}),priority:3}:null}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=H(Ee.tag);return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,de=!0){const K=Ee?Ee.anchor.offset:0,O=K===this.getTextContentSize()||!Ee?r.$createParagraphNode():H(this.getTag()),Z=this.getDirection();if(O.setDirection(Z),this.insertAfter(O,de),K===0&&!this.isEmpty()&&Ee){const se=r.$createParagraphNode();se.select(),this.replace(se,!0)}return O}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():H(this.getTag());return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}extractWithChild(){return!0}}function G(Se){return Se.nodeName.toLowerCase()==="span"?Se.style.fontSize==="26pt":!1}function I(Se){const Ee=Se.nodeName.toLowerCase();let de=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(de=H(Ee),Se.style!==null&&de.setFormat(Se.style.textAlign)),{node:de}}function P(Se){const Ee=m();return Se.style!==null&&Ee.setFormat(Se.style.textAlign),{node:Ee}}function H(Se){return r.$applyNodeReplacement(new k(Se))}function j(Se){return Se instanceof k}function re(Se,Ee){Se.preventDefault(),Ee.update(()=>{const de=r.$getSelection(),K=Se instanceof InputEvent||Se instanceof KeyboardEvent?null:Se.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(de)&&e.$insertDataTransferForRichText(K,de,Ee)},{tag:"paste"})}async function te(Se,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(Se,ClipboardEvent)?Se:null),Ee.update(()=>{const de=r.$getSelection();r.$isRangeSelection(de)?de.removeText():r.$isNodeSelection(de)&&de.getNodes().forEach(K=>K.remove())})}function ce(Se){let Ee=null;if(Se instanceof DragEvent?Ee=Se.dataTransfer:Se instanceof ClipboardEvent&&(Ee=Se.clipboardData),Ee===null)return[!1,[],!1];const de=Ee.types,K=de.includes("Files"),O=de.includes("text/html")||de.includes("text/plain");return[K,Array.from(Ee.files),O]}function V(Se){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const de=new Set,K=Ee.getNodes();for(let O=0;O<K.length;O++){const Z=K[O],se=Z.getKey();if(de.has(se))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(Z),W=Y.getKey();Y.canIndent()&&!de.has(W)&&(de.add(W),Se(Y))}return de.size>0}function z(Se){const Ee=r.$getNearestNodeFromDOMNode(Se);return r.$isDecoratorNode(Ee)}function q(Se){const Ee=Se.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function Te(Se){return n.mergeRegister(Se.registerCommand(r.CLICK_COMMAND,de=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),Se.registerCommand(r.DELETE_CHARACTER_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_WORD_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_LINE_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,de=>{const K=r.$getSelection();if(typeof de=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(de);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const O=de.dataTransfer;if(O!=null)e.$insertDataTransferForRichText(O,K,Se);else if(r.$isRangeSelection(K)){const Z=de.data;return Z&&K.insertText(Z),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_TEXT_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_ELEMENT_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const O=K.getNodes();for(const Z of O){const se=n.$findMatchingParent(Z,Y=>r.$isElementNode(Y)&&!Y.isInline());se!==null&&se.setFormat(de)}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_LINE_BREAK_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();de.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();K>0&&de.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_UP_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const O=K.getNodes();if(O.length>0)return O[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const O=r.$getAdjacentNode(K.focus,!0);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectPrevious(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_DOWN_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return O[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return de.preventDefault(),!0;const O=r.$getAdjacentNode(K.focus,!1);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectNext(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_LEFT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return de.preventDefault(),O[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(t.$shouldOverrideDefaultCharacterSelection(K,!0)){const O=de.shiftKey;return de.preventDefault(),t.$moveCharacter(K,O,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const Z=K.getNodes();if(Z.length>0)return de.preventDefault(),Z[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const O=de.shiftKey;return t.$shouldOverrideDefaultCharacterSelection(K,!1)?(de.preventDefault(),t.$moveCharacter(K,O,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_BACKSPACE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;de.preventDefault();const{anchor:O}=K,Z=O.getNode();return K.isCollapsed()&&O.offset===0&&!r.$isRootNode(Z)&&n.$getNearestBlockElementAncestorOrThrow(Z).getIndent()>0?Se.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_DELETE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(de.preventDefault(),Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ENTER_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(de!==null){if((T||_||S)&&p)return!1;if(de.preventDefault(),de.shiftKey)return Se.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return Se.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(Se.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DROP_COMMAND,de=>{const[,K]=ce(de);if(K.length>0){const Z=de.clientX,se=de.clientY,Y=l(Z,se);if(Y!==null){const{offset:W,node:J}=Y,R=r.$getNearestNodeFromDOMNode(J);if(R!==null){const U=r.$createRangeSelection();if(r.$isTextNode(R))U.anchor.set(R.getKey(),W,"text"),U.focus.set(R.getKey(),W,"text");else{const fe=R.getParentOrThrow().getKey(),_e=R.getIndexWithinParent()+1;U.anchor.set(fe,_e,"element"),U.focus.set(fe,_e,"element")}const X=r.$normalizeSelection__EXPERIMENTAL(U);r.$setSelection(X)}Se.dispatchCommand(w,K)}return de.preventDefault(),!0}const O=r.$getSelection();return!!r.$isRangeSelection(O)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGSTART_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();return!(K&&!r.$isRangeSelection(O))},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGOVER_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();if(K&&!r.$isRangeSelection(O))return!1;const Z=de.clientX,se=de.clientY,Y=l(Z,se);if(Y!==null){const W=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(W)&&de.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.COPY_COMMAND,de=>(e.copyToClipboard(Se,n.objectKlassEquals(de,ClipboardEvent)?de:null),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CUT_COMMAND,de=>(te(de,Se),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.PASTE_COMMAND,de=>{const[,K,O]=ce(de);if(K.length>0&&!O)return Se.dispatchCommand(w,K),!0;if(r.isSelectionCapturedInDecoratorInput(de.target))return!1;const Z=r.$getSelection();return r.$INTERNAL_isPointSelection(Z)?(re(de,Se),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ui.$createHeadingNode=H,ui.$createQuoteNode=m,ui.$isHeadingNode=j,ui.$isQuoteNode=v,ui.DRAG_DROP_PASTE=w,ui.HeadingNode=k,ui.QuoteNode=M,ui.eventFiles=ce,ui.registerRichText=Te,ui}var di={},rh;function dC(){if(rh)return di;rh=1;var e=Sp(),t=So(),n=gn(),r=Gt();function l(V,z){return typeof document.caretRangeFromPoint<"u"?(V=document.caretRangeFromPoint(V,z),V===null?null:{node:V.startContainer,offset:V.startOffset}):document.caretPositionFromPoint!=="undefined"?(V=document.caretPositionFromPoint(V,z),V===null?null:{node:V.offsetNode,offset:V.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(z){return new M(z.__key)}constructor(z){super(z)}createDOM(z){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,z.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:I,priority:0})}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=m();return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(z,q){z=r.$createParagraphNode();let Te=this.getDirection();return z.setDirection(Te),this.insertAfter(z,q),z}collapseAtStart(){let z=r.$createParagraphNode();return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}}function m(){return r.$applyNodeReplacement(new M)}class v extends r.ElementNode{static getType(){return"heading"}static clone(z){return new v(z.__tag,z.__key)}constructor(z,q){super(q),this.__tag=z}getTag(){return this.__tag}createDOM(z){let q=this.__tag,Te=document.createElement(q);return z=z.theme.heading,z!==void 0&&n.addClassNamesToElement(Te,z[q]),Te}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:G,priority:0}),h2:()=>({conversion:G,priority:0}),h3:()=>({conversion:G,priority:0}),h4:()=>({conversion:G,priority:0}),h5:()=>({conversion:G,priority:0}),h6:()=>({conversion:G,priority:0}),p:z=>(z=z.firstChild,z!==null&&k(z)?{conversion:()=>({node:null}),priority:3}:null),span:z=>k(z)?{conversion:()=>({node:P("h1")}),priority:3}:null}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=P(z.tag);return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(z,q=!0){let Te=z?z.anchor.offset:0,Se=Te!==this.getTextContentSize()&&z?P(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return Se.setDirection(Ee),this.insertAfter(Se,q),Te===0&&!this.isEmpty()&&z&&(z=r.$createParagraphNode(),z.select(),this.replace(z,!0)),Se}collapseAtStart(){let z=this.isEmpty()?r.$createParagraphNode():P(this.getTag());return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}extractWithChild(){return!0}}function k(V){return V.nodeName.toLowerCase()==="span"?V.style.fontSize==="26pt":!1}function G(V){let z=V.nodeName.toLowerCase(),q=null;return(z==="h1"||z==="h2"||z==="h3"||z==="h4"||z==="h5"||z==="h6")&&(q=P(z),V.style!==null&&q.setFormat(V.style.textAlign)),{node:q}}function I(V){let z=m();return V.style!==null&&z.setFormat(V.style.textAlign),{node:z}}function P(V){return r.$applyNodeReplacement(new v(V))}function H(V,z){V.preventDefault(),z.update(()=>{let q=r.$getSelection(),Te=V instanceof InputEvent||V instanceof KeyboardEvent?null:V.clipboardData;Te!=null&&r.$INTERNAL_isPointSelection(q)&&e.$insertDataTransferForRichText(Te,q,z)},{tag:"paste"})}async function j(V,z){await e.copyToClipboard(z,n.objectKlassEquals(V,ClipboardEvent)?V:null),z.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(Te=>Te.remove())})}function re(V){let z=null;if(V instanceof DragEvent?z=V.dataTransfer:V instanceof ClipboardEvent&&(z=V.clipboardData),z===null)return[!1,[],!1];var q=z.types;return V=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[V,Array.from(z.files),q]}function te(V){var z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;let q=new Set;z=z.getNodes();for(let Ee=0;Ee<z.length;Ee++){var Te=z[Ee],Se=Te.getKey();q.has(Se)||(Te=n.$getNearestBlockElementAncestorOrThrow(Te),Se=Te.getKey(),Te.canIndent()&&!q.has(Se)&&(q.add(Se),V(Te)))}return 0<q.size}function ce(V){return V=r.$getNearestNodeFromDOMNode(V),r.$isDecoratorNode(V)}return di.$createHeadingNode=P,di.$createQuoteNode=m,di.$isHeadingNode=function(V){return V instanceof v},di.$isQuoteNode=function(V){return V instanceof M},di.DRAG_DROP_PASTE=w,di.HeadingNode=v,di.QuoteNode=M,di.eventFiles=re,di.registerRichText=function(V){return n.mergeRegister(V.registerCommand(r.CLICK_COMMAND,()=>{const z=r.$getSelection();return r.$isNodeSelection(z)?(z.clear(),!0):!1},0),V.registerCommand(r.DELETE_CHARACTER_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_WORD_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_LINE_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,z=>{const q=r.$getSelection();if(typeof z=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(z);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const Te=z.dataTransfer;Te!=null?e.$insertDataTransferForRichText(Te,q,V):r.$isRangeSelection(q)&&(z=z.data)&&q.insertText(z)}return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_TEXT_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_ELEMENT_COMMAND,z=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const Te of q)q=n.$findMatchingParent(Te,Se=>r.$isElementNode(Se)&&!Se.isInline()),q!==null&&q.setFormat(z);return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_LINE_BREAK_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();z.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();0<q&&z.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_UP_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){if(z=q.getNodes(),0<z.length)return z[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),z.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_DOWN_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(z=q.getNodes(),0<z.length)return z[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let Te=q.focus;if(Te.key==="root"&&Te.offset===r.$getRoot().getChildrenSize())return z.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),z.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_LEFT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&t.$shouldOverrideDefaultCharacterSelection(q,!0)?(Te=z.shiftKey,z.preventDefault(),t.$moveCharacter(q,Te,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(Te=z.shiftKey,t.$shouldOverrideDefaultCharacterSelection(q,!1)?(z.preventDefault(),t.$moveCharacter(q,Te,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_BACKSPACE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;z.preventDefault(),{anchor:z}=q;const Te=z.getNode();return q.isCollapsed()&&z.offset===0&&!r.$isRootNode(Te)&&0<n.$getNearestBlockElementAncestorOrThrow(Te).getIndent()?V.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_DELETE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(z.preventDefault(),V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ENTER_COMMAND,z=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(z!==null){if((T||_||S)&&p)return!1;if(z.preventDefault(),z.shiftKey)return V.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return V.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(V.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DROP_COMMAND,z=>{const[,q]=re(z);if(0<q.length){var Te=l(z.clientX,z.clientY);if(Te!==null){const{offset:Ee,node:de}=Te;var Se=r.$getNearestNodeFromDOMNode(de);if(Se!==null){if(Te=r.$createRangeSelection(),r.$isTextNode(Se))Te.anchor.set(Se.getKey(),Ee,"text"),Te.focus.set(Se.getKey(),Ee,"text");else{const K=Se.getParentOrThrow().getKey();Se=Se.getIndexWithinParent()+1,Te.anchor.set(K,Se,"element"),Te.focus.set(K,Se,"element")}Te=r.$normalizeSelection__EXPERIMENTAL(Te),r.$setSelection(Te)}V.dispatchCommand(w,q)}return z.preventDefault(),!0}return z=r.$getSelection(),!!r.$isRangeSelection(z)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGSTART_COMMAND,z=>{[z]=re(z);const q=r.$getSelection();return!(z&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGOVER_COMMAND,z=>{var[q]=re(z);const Te=r.$getSelection();return q&&!r.$isRangeSelection(Te)?!1:(q=l(z.clientX,z.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&z.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.COPY_COMMAND,z=>(e.copyToClipboard(V,n.objectKlassEquals(z,ClipboardEvent)?z:null),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CUT_COMMAND,z=>(j(z,V),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.PASTE_COMMAND,z=>{const[,q,Te]=re(z);if(0<q.length&&!Te)return V.dispatchCommand(w,q),!0;if(r.isSelectionCapturedInDecoratorInput(z.target))return!1;const Se=r.$getSelection();return r.$INTERNAL_isPointSelection(Se)?(H(z,V),!0):!1},r.COMMAND_PRIORITY_EDITOR))},di}var du,ih;function md(){return ih||(ih=1,du=process.env.NODE_ENV==="development"?uC():dC()),du}var oh;function fC(){if(oh)return Qc;oh=1;var e=Zn(),t=Ep(),n=rt,r=Tp(),l=gn(),d=ld,f=xp(),p=md(),E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function S(G){return G.getEditorState().read(r.$canShowPlaceholderCurry(G.isComposing()))}function w(G){const[I,P]=n.useState(()=>S(G));return E(()=>{function H(){const j=S(G);P(j)}return H(),l.mergeRegister(G.registerUpdateListener(()=>{H()}),G.registerEditableListener(()=>{H()}))},[G]),I}function M(G,I){const[P,H]=n.useState(()=>G.getDecorators());return E(()=>G.registerDecoratorListener(j=>{d.flushSync(()=>{H(j)})}),[G]),n.useEffect(()=>{H(G.getDecorators())},[G]),n.useMemo(()=>{const j=[],re=Object.keys(P);for(let te=0;te<re.length;te++){const ce=re[te],V=n.createElement(I,{onError:q=>G._onError(q)},n.createElement(n.Suspense,{fallback:null},P[ce])),z=G.getElementByKey(ce);z!==null&&j.push(d.createPortal(V,z,ce))}return j},[I,P,G])}function m(G){E(()=>l.mergeRegister(p.registerRichText(G),f.registerDragonSupport(G)),[G])}function v({contentEditable:G,placeholder:I,ErrorBoundary:P}){const[H]=e.useLexicalComposerContext(),j=M(H,P);return m(H),n.createElement(n.Fragment,null,G,n.createElement(k,{content:I}),j)}function k({content:G}){const[I]=e.useLexicalComposerContext(),P=w(I),H=t();return P?typeof G=="function"?G(H):G:null}return Qc.RichTextPlugin=v,Qc}var fu={},sh;function hC(){if(sh)return fu;sh=1;var e=Zn(),t=Ep(),n=rt,r=Tp(),l=gn(),d=ld,f=xp(),p=md(),_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function T(m){return m.getEditorState().read(r.$canShowPlaceholderCurry(m.isComposing()))}function E(m){let[v,k]=n.useState(()=>T(m));return _(()=>{function G(){let I=T(m);k(I)}return G(),l.mergeRegister(m.registerUpdateListener(()=>{G()}),m.registerEditableListener(()=>{G()}))},[m]),v}function S(m,v){let[k,G]=n.useState(()=>m.getDecorators());return _(()=>m.registerDecoratorListener(I=>{d.flushSync(()=>{G(I)})}),[m]),n.useEffect(()=>{G(m.getDecorators())},[m]),n.useMemo(()=>{let I=[],P=Object.keys(k);for(let H=0;H<P.length;H++){let j=P[H],re=n.createElement(v,{onError:ce=>m._onError(ce)},n.createElement(n.Suspense,{fallback:null},k[j])),te=m.getElementByKey(j);te!==null&&I.push(d.createPortal(re,te,j))}return I},[v,k,m])}function w(m){_(()=>l.mergeRegister(p.registerRichText(m),f.registerDragonSupport(m)),[m])}function M({content:m}){var[v]=e.useLexicalComposerContext();v=E(v);let k=t();return v?typeof m=="function"?m(k):m:null}return fu.RichTextPlugin=function({contentEditable:m,placeholder:v,ErrorBoundary:k}){let[G]=e.useLexicalComposerContext();return k=S(G,k),w(G),n.createElement(n.Fragment,null,m,n.createElement(M,{content:v}),k)},fu}const gC=process.env.NODE_ENV==="development"?fC():hC();var pC=gC,hu={},lh;function mC(){if(lh)return hu;lh=1;var e=Zn(),t=rt;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var T=arguments[_];for(var E in T)Object.prototype.hasOwnProperty.call(T,E)&&(p[E]=T[E])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function f({ariaActiveDescendant:p,ariaAutoComplete:_,ariaControls:T,ariaDescribedBy:E,ariaExpanded:S,ariaLabel:w,ariaLabelledBy:M,ariaMultiline:m,ariaOwns:v,ariaRequired:k,autoCapitalize:G,className:I,id:P,role:H="textbox",spellCheck:j=!0,style:re,tabIndex:te,"data-testid":ce,...V}){const[z]=e.useLexicalComposerContext(),[q,Te]=t.useState(!1),Se=t.useCallback(Ee=>{z.setRootElement(Ee)},[z]);return d(()=>(Te(z.isEditable()),z.registerEditableListener(Ee=>{Te(Ee)})),[z]),t.createElement("div",n({},V,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?_:"none","aria-controls":q?T:void 0,"aria-describedby":E,"aria-expanded":q&&H==="combobox"?!!S:void 0,"aria-label":w,"aria-labelledby":M,"aria-multiline":m,"aria-owns":q?v:void 0,"aria-readonly":q?void 0:!0,"aria-required":k,autoCapitalize:G,className:I,contentEditable:q,"data-testid":ce,id:P,ref:Se,role:H,spellCheck:j,style:re,tabIndex:te}))}return hu.ContentEditable=f,hu}var gu={},ah;function _C(){if(ah)return gu;ah=1;var e=Zn(),t=rt;function n(){return n=Object.assign?Object.assign.bind():function(l){for(var d=1;d<arguments.length;d++){var f=arguments[d],p;for(p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}return l},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;return gu.ContentEditable=function({ariaActiveDescendant:l,ariaAutoComplete:d,ariaControls:f,ariaDescribedBy:p,ariaExpanded:_,ariaLabel:T,ariaLabelledBy:E,ariaMultiline:S,ariaOwns:w,ariaRequired:M,autoCapitalize:m,className:v,id:k,role:G="textbox",spellCheck:I=!0,style:P,tabIndex:H,"data-testid":j,...re}){let[te]=e.useLexicalComposerContext(),[ce,V]=t.useState(!1),z=t.useCallback(q=>{te.setRootElement(q)},[te]);return r(()=>(V(te.isEditable()),te.registerEditableListener(q=>{V(q)})),[te]),t.createElement("div",n({},re,{"aria-activedescendant":ce?l:void 0,"aria-autocomplete":ce?d:"none","aria-controls":ce?f:void 0,"aria-describedby":p,"aria-expanded":ce&&G==="combobox"?!!_:void 0,"aria-label":T,"aria-labelledby":E,"aria-multiline":S,"aria-owns":ce?w:void 0,"aria-readonly":ce?void 0:!0,"aria-required":M,autoCapitalize:m,className:v,contentEditable:ce,"data-testid":j,id:k,ref:z,role:G,spellCheck:I,style:P,tabIndex:H}))},gu}const yC=process.env.NODE_ENV==="development"?mC():_C();var NC=yC,pu,ch;function CC(){if(ch)return pu;ch=1;var e=rt;function t(p,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,S){return E.__proto__=S,E},t(p,_)}function n(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}var r=function(_,T){return _===void 0&&(_=[]),T===void 0&&(T=[]),_.length!==T.length||_.some(function(E,S){return!Object.is(E,T[S])})},l={error:null},d=function(p){n(_,p);function _(){for(var E,S=arguments.length,w=new Array(S),M=0;M<S;M++)w[M]=arguments[M];return E=p.call.apply(p,[this].concat(w))||this,E.state=l,E.resetErrorBoundary=function(){for(var m,v=arguments.length,k=new Array(v),G=0;G<v;G++)k[G]=arguments[G];E.props.onReset==null||(m=E.props).onReset.apply(m,k),E.reset()},E}_.getDerivedStateFromError=function(S){return{error:S}};var T=_.prototype;return T.reset=function(){this.setState(l)},T.componentDidCatch=function(S,w){var M,m;(M=(m=this.props).onError)==null||M.call(m,S,w)},T.componentDidUpdate=function(S,w){var M=this.state.error,m=this.props.resetKeys;if(M!==null&&w.error!==null&&r(S.resetKeys,m)){var v,k;(v=(k=this.props).onResetKeysChange)==null||v.call(k,S.resetKeys,m),this.reset()}},T.render=function(){var S=this.state.error,w=this.props,M=w.fallbackRender,m=w.FallbackComponent,v=w.fallback;if(S!==null){var k={error:S,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(v))return v;if(typeof M=="function")return M(k);if(m)return e.createElement(m,k);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},_}(e.Component);function f({children:p,onError:_}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:_},p)}return pu=f,pu}var mu,uh;function EC(){if(uh)return mu;uh=1;var e=rt;function t(f,p){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,T){return _.__proto__=T,_},t(f,p)}function n(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,t(f,p)}function r(f,p){return f===void 0&&(f=[]),p===void 0&&(p=[]),f.length!==p.length||f.some(function(_,T){return!Object.is(_,p[T])})}var l={error:null},d=function(f){function p(){for(var T,E=arguments.length,S=Array(E),w=0;w<E;w++)S[w]=arguments[w];return T=f.call.apply(f,[this].concat(S))||this,T.state=l,T.resetErrorBoundary=function(){for(var M,m=arguments.length,v=Array(m),k=0;k<m;k++)v[k]=arguments[k];T.props.onReset==null||(M=T.props).onReset.apply(M,v),T.reset()},T}n(p,f),p.getDerivedStateFromError=function(T){return{error:T}};var _=p.prototype;return _.reset=function(){this.setState(l)},_.componentDidCatch=function(T,E){var S,w;(S=(w=this.props).onError)==null||S.call(w,T,E)},_.componentDidUpdate=function(T,E){var S=this.props.resetKeys;if(this.state.error!==null&&E.error!==null&&r(T.resetKeys,S)){var w,M;(w=(M=this.props).onResetKeysChange)==null||w.call(M,T.resetKeys,S),this.reset()}},_.render=function(){var T=this.state.error,E=this.props,S=E.fallbackRender,w=E.FallbackComponent;if(E=E.fallback,T!==null){if(T={error:T,resetErrorBoundary:this.resetErrorBoundary},e.isValidElement(E))return E;if(typeof S=="function")return S(T);if(w)return e.createElement(w,T);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(e.Component);return mu=function({children:f,onError:p}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},f)},mu}const TC=process.env.NODE_ENV==="development"?CC():EC();var xC=TC;const vC=ad(xC);var _u={},pr={},dh;function SC(){if(dh)return pr;dh=1;var e=Gt(),t=gn();function n(Y){let W=1,J=Y.getParent();for(;J!=null;){if(ce(J)){const R=J.getParent();if(de(R)){W++,J=R.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return W}return W}function r(Y){let W=Y.getParent();if(!de(W))throw Error("A ListItemNode must have a ListNode for a parent.");let J=W;for(;J!==null;)J=J.getParent(),de(J)&&(W=J);return W}function l(Y){let W=[];const J=Y.getChildren().filter(ce);for(let R=0;R<J.length;R++){const U=J[R],X=U.getFirstChild();de(X)?W=W.concat(l(X)):W.push(U)}return W}function d(Y){return ce(Y)&&de(Y.getFirstChild())}function f(Y){let W=Y;for(;W.getNextSibling()==null&&W.getPreviousSibling()==null;){const J=W.getParent();if(J==null||!(ce(W)||de(W)))break;W=J}W.remove()}function p(Y){return te().append(Y)}function _(Y,W){return ce(Y)&&(W.length===0||W.length===1&&Y.is(W[0])&&Y.getChildrenSize()===0)}function T(Y){const W=Y.getParent();let J=1;if(W!=null)if(de(W))J=W.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const R=Y.getPreviousSiblings();for(let U=0;U<R.length;U++){const X=R[U];ce(X)&&!de(X.getFirstChild())&&J++}return J}function E(Y,W){Y.update(()=>{const J=e.$getSelection();if(e.$INTERNAL_isPointSelection(J)){const R=J.getNodes(),X=J.anchor.getNode(),fe=X.getParent();if(_(X,R)){const _e=Ee(W);if(e.$isRootOrShadowRoot(fe)){X.replace(_e);const B=te();e.$isElementNode(X)&&(B.setFormat(X.getFormatType()),B.setIndent(X.getIndent())),_e.append(B)}else if(ce(X)){const B=X.getParentOrThrow();S(_e,B.getChildren()),B.replace(_e)}return}else{const _e=new Set;for(let B=0;B<R.length;B++){const A=R[B];if(e.$isElementNode(A)&&A.isEmpty()&&!ce(A)&&!_e.has(A.getKey())){w(A,W);continue}if(e.$isLeafNode(A)){let F=A.getParent();for(;F!=null;){const oe=F.getKey();if(de(F)){if(!_e.has(oe)){const ye=Ee(W);S(ye,F.getChildren()),F.replace(ye),v(ye),_e.add(oe)}break}else{const ye=F.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(oe)){_e.add(oe),w(F,W);break}F=ye}}}}}}})}function S(Y,W){Y.splice(Y.getChildrenSize(),0,W)}function w(Y,W){if(de(Y))return Y;const J=Y.getPreviousSibling(),R=Y.getNextSibling(),U=te();if(U.setFormat(Y.getFormatType()),U.setIndent(Y.getIndent()),S(U,Y.getChildren()),de(J)&&W===J.getListType())return J.append(U),Y.remove(),de(R)&&W===R.getListType()&&(S(J,R.getChildren()),R.remove()),J;if(de(R)&&W===R.getListType())return R.getFirstChildOrThrow().insertBefore(U),Y.remove(),R;{const X=Ee(W);return X.append(U),Y.replace(X),v(X),X}}function M(Y,W){const J=Y.getLastChild(),R=W.getFirstChild();J&&R&&d(J)&&d(R)&&(M(J.getFirstChild(),R.getFirstChild()),R.remove());const U=W.getChildren();U.length>0&&(Y.append(...U),v(Y)),W.remove()}function m(Y){Y.update(()=>{const W=e.$getSelection();if(e.$isRangeSelection(W)){const J=new Set,R=W.getNodes(),U=W.anchor.getNode();if(_(U,R))J.add(r(U));else for(let X=0;X<R.length;X++){const fe=R[X];if(e.$isLeafNode(fe)){const _e=t.$getNearestNodeOfType(fe,P);_e!=null&&J.add(r(_e))}}for(const X of J){let fe=X;const _e=l(X);for(const B of _e){const A=e.$createParagraphNode();S(A,B.getChildren()),fe.insertAfter(A),fe=A,B.__key===W.anchor.key&&W.anchor.set(A.getKey(),0,"element"),B.__key===W.focus.key&&W.focus.set(A.getKey(),0,"element"),B.remove()}X.remove()}}})}function v(Y,W){const J=W||Y.getChildren();if(J!==void 0)for(let R=0;R<J.length;R++){const U=J[R];if(ce(U)){const X=U.getValue(),fe=T(U);X!==fe&&U.setValue(fe)}}}function k(Y){const W=new Set;if(d(Y)||W.has(Y.getKey()))return;const J=Y.getParent(),R=Y.getNextSibling(),U=Y.getPreviousSibling();if(d(R)&&d(U)){const X=U.getFirstChild();if(de(X)){X.append(Y);const fe=R.getFirstChild();if(de(fe)){const _e=fe.getChildren();S(X,_e),R.remove(),W.add(R.getKey())}v(X)}}else if(d(R)){const X=R.getFirstChild();if(de(X)){const fe=X.getFirstChild();fe!==null&&fe.insertBefore(Y),v(X)}}else if(d(U)){const X=U.getFirstChild();de(X)&&(X.append(Y),v(X))}else if(de(J)){const X=te(),fe=Ee(J.getListType());X.append(fe),fe.append(Y),U?U.insertAfter(X):R?R.insertBefore(X):J.append(X),v(fe)}de(J)&&v(J)}function G(Y){if(d(Y))return;const W=Y.getParent(),J=W?W.getParent():void 0,R=J?J.getParent():void 0;if(de(R)&&ce(J)&&de(W)){const U=W?W.getFirstChild():void 0,X=W?W.getLastChild():void 0;if(Y.is(U))J.insertBefore(Y),W.isEmpty()&&J.remove();else if(Y.is(X))J.insertAfter(Y),W.isEmpty()&&J.remove();else{const fe=W.getListType(),_e=te(),B=Ee(fe);_e.append(B),Y.getPreviousSiblings().forEach(oe=>B.append(oe));const A=te(),F=Ee(fe);A.append(F),S(F,Y.getNextSiblings()),J.insertBefore(_e),J.insertAfter(A),J.replace(Y)}v(W),v(R)}}function I(){const Y=e.$getSelection();if(!e.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const W=Y.anchor.getNode();if(!ce(W)||W.getChildrenSize()!==0)return!1;const J=r(W),R=W.getParent();if(!de(R))throw Error("A ListItemNode must have a ListNode for a parent.");const U=R.getParent();let X;if(e.$isRootOrShadowRoot(U))X=e.$createParagraphNode(),J.insertAfter(X);else if(ce(U))X=te(),U.insertAfter(X);else return!1;X.select();const fe=W.getNextSiblings();if(fe.length>0){const _e=Ee(R.getListType());if(e.$isParagraphNode(X))X.insertAfter(_e);else{const B=te();B.append(_e),X.insertAfter(B)}fe.forEach(B=>{B.remove(),_e.append(B)})}return f(W),!0}class P extends e.ElementNode{static getType(){return"listitem"}static clone(W){return new P(W.__value,W.__checked,W.__key)}constructor(W,J,R){super(R),this.__value=W===void 0?1:W,this.__checked=J}createDOM(W){const J=document.createElement("li"),R=this.getParent();return de(R)&&R.getListType()==="check"&&j(J,this,null),J.value=this.__value,H(J,W.theme,this),J}updateDOM(W,J,R){const U=this.getParent();return de(U)&&U.getListType()==="check"&&j(J,this,W),J.value=this.__value,H(J,R.theme,this),!1}static transform(){return W=>{const J=W.getParent();if(de(J)){if(v(J),!ce(W))throw Error("node is not a ListItemNode");J.getListType()!=="check"&&W.getChecked()!=null&&W.setChecked(void 0)}}}static importDOM(){return{li:W=>({conversion:re,priority:0})}}static importJSON(W){const J=te();return J.setChecked(W.checked),J.setValue(W.value),J.setFormat(W.format),J.setDirection(W.direction),J}exportDOM(W){const J=this.createDOM(W._config);return J.style.textAlign=this.getFormatType(),{element:J}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(e.$isElementNode(R)&&this.canMergeWith(R)){const U=R.getChildren();this.append(...U),R.remove()}else super.append(R)}return this}replace(W,J){if(ce(W))return super.replace(W);this.setIndent(0);const R=this.getParentOrThrow();if(!de(R))return W;if(R.__first===this.getKey())R.insertBefore(W);else if(R.__last===this.getKey())R.insertAfter(W);else{const U=Ee(R.getListType());let X=this.getNextSibling();for(;X;){const fe=X;X=X.getNextSibling(),U.append(fe)}R.insertAfter(W),W.insertAfter(U)}if(J){if(!e.$isElementNode(W))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(U=>{W.append(U)})}return this.remove(),R.getChildrenSize()===0&&R.remove(),W}insertAfter(W,J=!0){const R=this.getParentOrThrow();if(!de(R))throw Error("insertAfter: list node is not parent of list item node");const U=this.getNextSiblings();if(ce(W)){const X=super.insertAfter(W,J),fe=W.getParentOrThrow();return de(fe)&&v(fe),X}if(de(W)){let X=W;const fe=W.getChildren();for(let _e=fe.length-1;_e>=0;_e--)X=fe[_e],this.insertAfter(X,J);return X}if(R.insertAfter(W,J),U.length!==0){const X=Ee(R.getListType());U.forEach(fe=>X.append(fe)),W.insertAfter(X,J)}return W}remove(W){const J=this.getPreviousSibling(),R=this.getNextSibling();if(super.remove(W),J&&R&&d(J)&&d(R))M(J.getFirstChild(),R.getFirstChild()),R.remove();else if(R){const U=R.getParent();de(U)&&v(U)}}insertNewAfter(W,J=!0){const R=te(this.__checked==null?void 0:!1);return this.insertAfter(R,J),R}collapseAtStart(W){const J=e.$createParagraphNode();this.getChildren().forEach(_e=>J.append(_e));const U=this.getParentOrThrow(),X=U.getParentOrThrow(),fe=ce(X);if(U.getChildrenSize()===1)if(fe)U.remove(),X.select();else{U.insertBefore(J),U.remove();const _e=W.anchor,B=W.focus,A=J.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(A,_e.offset,"element"),B.type==="element"&&B.getNode().is(this)&&B.set(A,B.offset,"element")}else U.insertBefore(J),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(W){const J=this.getWritable();J.__value=W}getChecked(){return this.getLatest().__checked}setChecked(W){const J=this.getWritable();J.__checked=W}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const W=this.getParent();if(W===null)return this.getLatest().__indent;let J=W.getParentOrThrow(),R=0;for(;ce(J);)J=J.getParentOrThrow().getParentOrThrow(),R++;return R}setIndent(W){if(!(typeof W=="number"&&W>-1))throw Error("Invalid indent value.");let J=this.getIndent();for(;J!==W;)J<W?(k(this),J++):(G(this),J--);return this}insertBefore(W){if(ce(W)){const J=this.getParentOrThrow();if(de(J)){const R=this.getNextSiblings();v(J,R)}}return super.insertBefore(W)}canInsertAfter(W){return ce(W)}canReplaceWith(W){return ce(W)}canMergeWith(W){return e.$isParagraphNode(W)||ce(W)}extractWithChild(W,J){if(!e.$isRangeSelection(J))return!1;const R=J.anchor.getNode(),U=J.focus.getNode();return this.isParentOf(R)&&this.isParentOf(U)&&this.getTextContent().length===J.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function H(Y,W,J){const R=[],U=[],X=W.list,fe=X?X.listitem:void 0;let _e;if(X&&X.nested&&(_e=X.nested.listitem),fe!==void 0){const B=fe.split(" ");R.push(...B)}if(X){const B=J.getParent(),A=de(B)&&B.getListType()==="check",F=J.getChecked();(!A||F)&&U.push(X.listitemUnchecked),(!A||!F)&&U.push(X.listitemChecked),A&&R.push(F?X.listitemChecked:X.listitemUnchecked)}if(_e!==void 0){const B=_e.split(" ");J.getChildren().some(A=>de(A))?R.push(...B):U.push(...B)}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function j(Y,W,J,R){de(W.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!J||W.__checked!==J.__checked)&&Y.setAttribute("aria-checked",W.getChecked()?"true":"false"))}function re(Y){const W=t.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:te(W)}}function te(Y){return e.$applyNodeReplacement(new P(void 0,Y))}function ce(Y){return Y instanceof P}class V extends e.ElementNode{static getType(){return"list"}static clone(W){const J=W.__listType||Se[W.__tag];return new V(J,W.__start,W.__key)}constructor(W,J,R){super(R);const U=Se[W]||W;this.__listType=U,this.__tag=U==="number"?"ol":"ul",this.__start=J}getTag(){return this.__tag}setListType(W){const J=this.getWritable();J.__listType=W,J.__tag=W==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(W,J){const R=this.__tag,U=document.createElement(R);return this.__start!==1&&U.setAttribute("start",String(this.__start)),U.__lexicalListType=this.__listType,z(U,W.theme,this),U}updateDOM(W,J,R){return W.__tag!==this.__tag?!0:(z(J,R.theme,this),!1)}static importDOM(){return{ol:W=>({conversion:Te,priority:0}),ul:W=>({conversion:Te,priority:0})}}static importJSON(W){const J=Ee(W.listType,W.start);return J.setFormat(W.format),J.setIndent(W.indent),J.setDirection(W.direction),J}exportDOM(W){const{element:J}=super.exportDOM(W);return J&&t.isHTMLElement(J)&&(this.__start!==1&&J.setAttribute("start",String(this.__start)),this.__listType==="check"&&J.setAttribute("__lexicalListType","check")),{element:J}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(ce(R))super.append(R);else{const U=te();if(de(R))U.append(R);else if(e.$isElementNode(R)){const X=e.$createTextNode(R.getTextContent());U.append(X)}else U.append(R);super.append(U)}}return v(this),this}extractWithChild(W){return ce(W)}}function z(Y,W,J){const R=[],U=[],X=W.list;if(X!==void 0){const fe=X[`${J.__tag}Depth`]||[],_e=n(J)-1,B=_e%fe.length,A=fe[B],F=X[J.__tag];let oe;const ye=X.nested;if(ye!==void 0&&ye.list&&(oe=ye.list),F!==void 0&&R.push(F),A!==void 0){const De=A.split(" ");R.push(...De);for(let ee=0;ee<fe.length;ee++)ee!==B&&U.push(J.__tag+ee)}if(oe!==void 0){const De=oe.split(" ");_e>1?R.push(...De):U.push(...De)}}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function q(Y){const W=[];for(let J=0;J<Y.length;J++){const R=Y[J];if(ce(R)){W.push(R);const U=R.getChildren();U.length>1&&U.forEach(X=>{de(X)&&W.push(p(X))})}else W.push(p(R))}return W}function Te(Y){const W=Y.nodeName.toLowerCase();let J=null;if(W==="ol"){const R=Y.start;J=Ee("number",R)}else W==="ul"&&(t.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?J=Ee("check"):J=Ee("bullet"));return{after:q,node:J}}const Se={ol:"number",ul:"bullet"};function Ee(Y,W=1){return e.$applyNodeReplacement(new V(Y,W))}function de(Y){return Y instanceof V}const K=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),O=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Z=e.createCommand("INSERT_CHECK_LIST_COMMAND"),se=e.createCommand("REMOVE_LIST_COMMAND");return pr.$createListItemNode=te,pr.$createListNode=Ee,pr.$getListDepth=n,pr.$handleListInsertParagraph=I,pr.$isListItemNode=ce,pr.$isListNode=de,pr.INSERT_CHECK_LIST_COMMAND=Z,pr.INSERT_ORDERED_LIST_COMMAND=O,pr.INSERT_UNORDERED_LIST_COMMAND=K,pr.ListItemNode=P,pr.ListNode=V,pr.REMOVE_LIST_COMMAND=se,pr.insertList=E,pr.removeList=m,pr}var mr={},fh;function wC(){if(fh)return mr;fh=1;var e=Gt(),t=gn();function n(K){let O=new URLSearchParams;O.append("code",K);for(let Z=1;Z<arguments.length;Z++)O.append("v",arguments[Z]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${O} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let O=1;for(K=K.getParent();K!=null;){if(H(K)){if(K=K.getParent(),q(K)){O++,K=K.getParent();continue}n(40)}break}return O}function l(K){K=K.getParent(),q(K)||n(40);let O=K;for(;O!==null;)O=O.getParent(),q(O)&&(K=O);return K}function d(K){let O=[];K=K.getChildren().filter(H);for(let Z=0;Z<K.length;Z++){let se=K[Z],Y=se.getFirstChild();q(Y)?O=O.concat(d(Y)):O.push(se)}return O}function f(K){return H(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let O=K.getParent();if(O==null||!H(K)&&!q(K))break;K=O}K.remove()}function _(K){return P().append(K)}function T(K,O){return H(K)&&(O.length===0||O.length===1&&K.is(O[0])&&K.getChildrenSize()===0)}function E(K,O){K.splice(K.getChildrenSize(),0,O)}function S(K,O){if(q(K))return K;let Z=K.getPreviousSibling(),se=K.getNextSibling(),Y=P();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),E(Y,K.getChildren()),q(Z)&&O===Z.getListType()?(Z.append(Y),K.remove(),q(se)&&O===se.getListType()&&(E(Z,se.getChildren()),se.remove()),Z):q(se)&&O===se.getListType()?(se.getFirstChildOrThrow().insertBefore(Y),K.remove(),se):(O=z(O),O.append(Y),K.replace(O),M(O),O)}function w(K,O){var Z=K.getLastChild();let se=O.getFirstChild();Z&&se&&f(Z)&&f(se)&&(w(Z.getFirstChild(),se.getFirstChild()),se.remove()),Z=O.getChildren(),0<Z.length&&(K.append(...Z),M(K)),O.remove()}function M(K,O){if(K=O||K.getChildren(),K!==void 0)for(O=0;O<K.length;O++){let W=K[O];if(H(W)){let J=W.getValue();var Z=W,se=Z.getParent(),Y=1;for(se!=null&&(q(se)?Y=se.getStart():n(44)),Z=Z.getPreviousSiblings(),se=0;se<Z.length;se++){let R=Z[se];H(R)&&!q(R.getFirstChild())&&Y++}J!==Y&&W.setValue(Y)}}}function m(K){if(!f(K)){var O=K.getParent(),Z=O?O.getParent():void 0,se=Z?Z.getParent():void 0;if(q(se)&&H(Z)&&q(O)){var Y=O?O.getFirstChild():void 0,W=O?O.getLastChild():void 0;if(K.is(Y))Z.insertBefore(K),O.isEmpty()&&Z.remove();else if(K.is(W))Z.insertAfter(K),O.isEmpty()&&Z.remove();else{var J=O.getListType();Y=P();let R=z(J);Y.append(R),K.getPreviousSiblings().forEach(U=>R.append(U)),W=P(),J=z(J),W.append(J),E(J,K.getNextSiblings()),Z.insertBefore(Y),Z.insertAfter(W),Z.replace(K)}M(O),M(se)}}}class v extends e.ElementNode{static getType(){return"listitem"}static clone(O){return new v(O.__value,O.__checked,O.__key)}constructor(O,Z,se){super(se),this.__value=O===void 0?1:O,this.__checked=Z}createDOM(O){let Z=document.createElement("li"),se=this.getParent();return q(se)&&se.getListType()==="check"&&G(Z,this,null),Z.value=this.__value,k(Z,O.theme,this),Z}updateDOM(O,Z,se){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&G(Z,this,O),Z.value=this.__value,k(Z,se.theme,this),!1}static transform(){return O=>{let Z=O.getParent();if(q(Z)){if(M(Z),!H(O))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&O.getChecked()!=null&&O.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:I,priority:0})}}static importJSON(O){let Z=P();return Z.setChecked(O.checked),Z.setValue(O.value),Z.setFormat(O.format),Z.setDirection(O.direction),Z}exportDOM(O){return O=this.createDOM(O._config),O.style.textAlign=this.getFormatType(),{element:O}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...O){for(let Z=0;Z<O.length;Z++){let se=O[Z];if(e.$isElementNode(se)&&this.canMergeWith(se)){let Y=se.getChildren();this.append(...Y),se.remove()}else super.append(se)}return this}replace(O,Z){if(H(O))return super.replace(O);this.setIndent(0);let se=this.getParentOrThrow();if(!q(se))return O;if(se.__first===this.getKey())se.insertBefore(O);else if(se.__last===this.getKey())se.insertAfter(O);else{let Y=z(se.getListType()),W=this.getNextSibling();for(;W;){let J=W;W=W.getNextSibling(),Y.append(J)}se.insertAfter(O),O.insertAfter(Y)}if(Z){if(!e.$isElementNode(O))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Y=>{O.append(Y)})}return this.remove(),se.getChildrenSize()===0&&se.remove(),O}insertAfter(O,Z=!0){var se=this.getParentOrThrow();q(se)||n(39);var Y=this.getNextSiblings();if(H(O))return Z=super.insertAfter(O,Z),O=O.getParentOrThrow(),q(O)&&M(O),Z;if(q(O)){for(se=O,O=O.getChildren(),Y=O.length-1;0<=Y;Y--)se=O[Y],this.insertAfter(se,Z);return se}if(se.insertAfter(O,Z),Y.length!==0){let W=z(se.getListType());Y.forEach(J=>W.append(J)),O.insertAfter(W,Z)}return O}remove(O){let Z=this.getPreviousSibling(),se=this.getNextSibling();super.remove(O),Z&&se&&f(Z)&&f(se)?(w(Z.getFirstChild(),se.getFirstChild()),se.remove()):se&&(O=se.getParent(),q(O)&&M(O))}insertNewAfter(O,Z=!0){return O=P(this.__checked==null?void 0:!1),this.insertAfter(O,Z),O}collapseAtStart(O){let Z=e.$createParagraphNode();this.getChildren().forEach(J=>Z.append(J));var se=this.getParentOrThrow(),Y=se.getParentOrThrow();let W=H(Y);return se.getChildrenSize()===1?W?(se.remove(),Y.select()):(se.insertBefore(Z),se.remove(),se=O.anchor,O=O.focus,Y=Z.getKey(),se.type==="element"&&se.getNode().is(this)&&se.set(Y,se.offset,"element"),O.type==="element"&&O.getNode().is(this)&&O.set(Y,O.offset,"element")):(se.insertBefore(Z),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(O){this.getWritable().__value=O}getChecked(){return this.getLatest().__checked}setChecked(O){this.getWritable().__checked=O}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var O=this.getParent();if(O===null)return this.getLatest().__indent;O=O.getParentOrThrow();let Z=0;for(;H(O);)O=O.getParentOrThrow().getParentOrThrow(),Z++;return Z}setIndent(O){typeof O=="number"&&-1<O||n(117);let Z=this.getIndent();for(;Z!==O;)if(Z<O){e:{var se=new Set;if(f(this)||se.has(this.getKey()))break e;let R=this.getParent();var Y=this.getNextSibling(),W=this.getPreviousSibling();if(f(Y)&&f(W)){if(W=W.getFirstChild(),q(W)){W.append(this);var J=Y.getFirstChild();q(J)&&(J=J.getChildren(),E(W,J),Y.remove(),se.add(Y.getKey())),M(W)}}else f(Y)?(Y=Y.getFirstChild(),q(Y)&&(se=Y.getFirstChild(),se!==null&&se.insertBefore(this),M(Y))):f(W)?(Y=W.getFirstChild(),q(Y)&&(Y.append(this),M(Y))):q(R)&&(se=P(),J=z(R.getListType()),se.append(J),J.append(this),W?W.insertAfter(se):Y?Y.insertBefore(se):R.append(se),M(J));q(R)&&M(R)}Z++}else m(this),Z--;return this}insertBefore(O){if(H(O)){let Z=this.getParentOrThrow();if(q(Z)){let se=this.getNextSiblings();M(Z,se)}}return super.insertBefore(O)}canInsertAfter(O){return H(O)}canReplaceWith(O){return H(O)}canMergeWith(O){return e.$isParagraphNode(O)||H(O)}extractWithChild(O,Z){if(!e.$isRangeSelection(Z))return!1;O=Z.anchor.getNode();let se=Z.focus.getNode();return this.isParentOf(O)&&this.isParentOf(se)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return z("bullet")}}function k(K,O,Z){let se=[],Y=[];var W=(O=O.list)?O.listitem:void 0;if(O&&O.nested)var J=O.nested.listitem;if(W!==void 0&&(W=W.split(" "),se.push(...W)),O){W=Z.getParent(),W=q(W)&&W.getListType()==="check";let R=Z.getChecked();W&&!R||Y.push(O.listitemUnchecked),W&&R||Y.push(O.listitemChecked),W&&se.push(R?O.listitemChecked:O.listitemUnchecked)}J!==void 0&&(J=J.split(" "),Z.getChildren().some(R=>q(R))?se.push(...J):Y.push(...J)),0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<se.length&&t.addClassNamesToElement(K,...se)}function G(K,O,Z){q(O.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),Z&&O.__checked===Z.__checked||K.setAttribute("aria-checked",O.getChecked()?"true":"false"))}function I(K){return K=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:P(K)}}function P(K){return e.$applyNodeReplacement(new v(void 0,K))}function H(K){return K instanceof v}class j extends e.ElementNode{static getType(){return"list"}static clone(O){return new j(O.__listType||V[O.__tag],O.__start,O.__key)}constructor(O,Z,se){super(se),this.__listType=O=V[O]||O,this.__tag=O==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(O){let Z=this.getWritable();Z.__listType=O,Z.__tag=O==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(O){let Z=document.createElement(this.__tag);return this.__start!==1&&Z.setAttribute("start",String(this.__start)),Z.__lexicalListType=this.__listType,re(Z,O.theme,this),Z}updateDOM(O,Z,se){return O.__tag!==this.__tag?!0:(re(Z,se.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ce,priority:0}),ul:()=>({conversion:ce,priority:0})}}static importJSON(O){let Z=z(O.listType,O.start);return Z.setFormat(O.format),Z.setIndent(O.indent),Z.setDirection(O.direction),Z}exportDOM(O){return{element:O}=super.exportDOM(O),O&&t.isHTMLElement(O)&&(this.__start!==1&&O.setAttribute("start",String(this.__start)),this.__listType==="check"&&O.setAttribute("__lexicalListType","check")),{element:O}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...O){for(let se=0;se<O.length;se++){var Z=O[se];if(H(Z))super.append(Z);else{let Y=P();q(Z)||e.$isElementNode(Z)&&(Z=e.$createTextNode(Z.getTextContent())),Y.append(Z),super.append(Y)}}return M(this),this}extractWithChild(O){return H(O)}}function re(K,O,Z){let se=[],Y=[];var W=O.list;if(W!==void 0){let R=W[`${Z.__tag}Depth`]||[];O=r(Z)-1;let U=O%R.length;var J=R[U];let X=W[Z.__tag],fe;if(W=W.nested,W!==void 0&&W.list&&(fe=W.list),X!==void 0&&se.push(X),J!==void 0)for(J=J.split(" "),se.push(...J),J=0;J<R.length;J++)J!==U&&Y.push(Z.__tag+J);fe!==void 0&&(Z=fe.split(" "),1<O?se.push(...Z):Y.push(...Z))}0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<se.length&&t.addClassNamesToElement(K,...se)}function te(K){let O=[];for(let se=0;se<K.length;se++){var Z=K[se];H(Z)?(O.push(Z),Z=Z.getChildren(),1<Z.length&&Z.forEach(Y=>{q(Y)&&O.push(_(Y))})):O.push(_(Z))}return O}function ce(K){let O=K.nodeName.toLowerCase(),Z=null;return O==="ol"?Z=z("number",K.start):O==="ul"&&(Z=t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?z("check"):z("bullet")),{after:te,node:Z}}let V={ol:"number",ul:"bullet"};function z(K,O=1){return e.$applyNodeReplacement(new j(K,O))}function q(K){return K instanceof j}let Te=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),Se=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),de=e.createCommand("REMOVE_LIST_COMMAND");return mr.$createListItemNode=P,mr.$createListNode=z,mr.$getListDepth=r,mr.$handleListInsertParagraph=function(){var K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!H(K)||K.getChildrenSize()!==0))return!1;var O=l(K),Z=K.getParent();q(Z)||n(40);let se=Z.getParent(),Y;if(e.$isRootOrShadowRoot(se))Y=e.$createParagraphNode(),O.insertAfter(Y);else if(H(se))Y=P(),se.insertAfter(Y);else return!1;if(Y.select(),O=K.getNextSiblings(),0<O.length){let W=z(Z.getListType());e.$isParagraphNode(Y)?Y.insertAfter(W):(Z=P(),Z.append(W),Y.insertAfter(Z)),O.forEach(J=>{J.remove(),W.append(J)})}return p(K),!0},mr.$isListItemNode=H,mr.$isListNode=q,mr.INSERT_CHECK_LIST_COMMAND=Ee,mr.INSERT_ORDERED_LIST_COMMAND=Se,mr.INSERT_UNORDERED_LIST_COMMAND=Te,mr.ListItemNode=v,mr.ListNode=j,mr.REMOVE_LIST_COMMAND=de,mr.insertList=function(K,O){K.update(()=>{var Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){var se=Z.getNodes();Z=Z.anchor.getNode();var Y=Z.getParent();if(T(Z,se))se=z(O),e.$isRootOrShadowRoot(Y)?(Z.replace(se),Y=P(),e.$isElementNode(Z)&&(Y.setFormat(Z.getFormatType()),Y.setIndent(Z.getIndent())),se.append(Y)):H(Z)&&(Z=Z.getParentOrThrow(),E(se,Z.getChildren()),Z.replace(se));else for(Z=new Set,Y=0;Y<se.length;Y++){var W=se[Y];if(e.$isElementNode(W)&&W.isEmpty()&&!H(W)&&!Z.has(W.getKey()))S(W,O);else if(e.$isLeafNode(W))for(W=W.getParent();W!=null;){let R=W.getKey();if(q(W)){if(!Z.has(R)){var J=z(O);E(J,W.getChildren()),W.replace(J),M(J),Z.add(R)}break}else{if(J=W.getParent(),e.$isRootOrShadowRoot(J)&&!Z.has(R)){Z.add(R),S(W,O);break}W=J}}}}})},mr.removeList=function(K){K.update(()=>{let O=e.$getSelection();if(e.$isRangeSelection(O)){var Z=new Set,se=O.getNodes(),Y=O.anchor.getNode();if(T(Y,se))Z.add(l(Y));else for(Y=0;Y<se.length;Y++){var W=se[Y];e.$isLeafNode(W)&&(W=t.$getNearestNodeOfType(W,v),W!=null&&Z.add(l(W)))}for(let J of Z){Z=J,se=d(J);for(let R of se)se=e.$createParagraphNode(),E(se,R.getChildren()),Z.insertAfter(se),Z=se,R.__key===O.anchor.key&&O.anchor.set(se.getKey(),0,"element"),R.__key===O.focus.key&&O.focus.set(se.getKey(),0,"element"),R.remove();J.remove()}}})},mr}var yu,hh;function _d(){return hh||(hh=1,yu=process.env.NODE_ENV==="development"?SC():wC()),yu}var gh;function OC(){if(gh)return _u;gh=1;var e=_d(),t=Zn(),n=rt,r=gn(),l=Gt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(p,"number"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(p,"bullet"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(p),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[p])}function f(){const[p]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([e.ListNode,e.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return _u.ListPlugin=f,_u}var Nu={},ph;function DC(){if(ph)return Nu;ph=1;var e=_d(),t=Zn(),n=rt,r=gn(),l=Gt();function d(f){n.useEffect(()=>r.mergeRegister(f.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(f,"number"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(f,"bullet"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(f),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[f])}return Nu.ListPlugin=function(){let[f]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!f.hasNodes([e.ListNode,e.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[f]),d(f),null},Nu}const AC=process.env.NODE_ENV==="development"?OC():DC();var MC=AC,Cu={},wi={},mh;function RC(){if(mh)return wi;mh=1;var e=gn(),t=Gt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(m){return new r(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}constructor(m,v={},k){super(k);const{target:G=null,rel:I=null,title:P=null}=v;this.__url=m,this.__target=G,this.__rel=I,this.__title=P}createDOM(m){const v=document.createElement("a");return v.href=this.sanitizeUrl(this.__url),this.__target!==null&&(v.target=this.__target),this.__rel!==null&&(v.rel=this.__rel),this.__title!==null&&(v.title=this.__title),e.addClassNamesToElement(v,m.theme.link),v}updateDOM(m,v,k){const G=this.__url,I=this.__target,P=this.__rel,H=this.__title;return G!==m.__url&&(v.href=G),I!==m.__target&&(I?v.target=I:v.removeAttribute("target")),P!==m.__rel&&(P?v.rel=P:v.removeAttribute("rel")),H!==m.__title&&(H?v.title=H:v.removeAttribute("title")),!1}static importDOM(){return{a:m=>({conversion:l,priority:1})}}static importJSON(m){const v=d(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}sanitizeUrl(m){try{const v=new URL(m);if(!n.has(v.protocol))return"about:blank"}catch{return m}return m}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(m){const v=this.getWritable();v.__url=m}getTarget(){return this.getLatest().__target}setTarget(m){const v=this.getWritable();v.__target=m}getRel(){return this.getLatest().__rel}setRel(m){const v=this.getWritable();v.__rel=m}getTitle(){return this.getLatest().__title}setTitle(m){const v=this.getWritable();v.__title=m}insertNewAfter(m,v=!0){const k=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(k,v),k}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(m,v,k){if(!t.$isRangeSelection(v))return!1;const G=v.anchor.getNode(),I=v.focus.getNode();return this.isParentOf(G)&&this.isParentOf(I)&&v.getTextContent().length>0}}function l(M){let m=null;if(e.isHTMLAnchorElement(M)){const v=M.textContent;(v!==null&&v!==""||M.children.length>0)&&(m=d(M.getAttribute("href")||"",{rel:M.getAttribute("rel"),target:M.getAttribute("target"),title:M.getAttribute("title")}))}return{node:m}}function d(M,m){return t.$applyNodeReplacement(new r(M,m))}function f(M){return M instanceof r}class p extends r{static getType(){return"autolink"}static clone(m){return new p(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}static importJSON(m){const v=_(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(m,v=!0){const k=this.getParentOrThrow().insertNewAfter(m,v);if(t.$isElementNode(k)){const G=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return k.append(G),G}return null}}function _(M,m){return t.$applyNodeReplacement(new p(M,m))}function T(M){return M instanceof p}const E=t.createCommand("TOGGLE_LINK_COMMAND");function S(M,m={}){const{target:v,title:k}=m,G=m.rel===void 0?"noreferrer":m.rel,I=t.$getSelection();if(!t.$isRangeSelection(I))return;const P=I.extract();if(M===null)P.forEach(H=>{const j=H.getParent();if(f(j)){const re=j.getChildren();for(let te=0;te<re.length;te++)j.insertBefore(re[te]);j.remove()}});else{if(P.length===1){const re=P[0],te=w(re,f);if(te!==null){te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&te.setRel(G),k!==void 0&&te.setTitle(k);return}}let H=null,j=null;P.forEach(re=>{const te=re.getParent();if(!(te===j||te===null||t.$isElementNode(re)&&!re.isInline())){if(f(te)){j=te,te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&j.setRel(G),k!==void 0&&j.setTitle(k);return}if(te.is(H)||(H=te,j=d(M,{rel:G,target:v,title:k}),f(te)?re.getPreviousSibling()===null?te.insertBefore(j):te.insertAfter(j):re.insertBefore(j)),f(re)){if(re.is(j))return;if(j!==null){const ce=re.getChildren();for(let V=0;V<ce.length;V++)j.append(ce[V])}re.remove();return}j!==null&&j.append(re)}})}}function w(M,m){let v=M;for(;v!==null&&v.getParent()!==null&&!m(v);)v=v.getParentOrThrow();return m(v)?v:null}return wi.$createAutoLinkNode=_,wi.$createLinkNode=d,wi.$isAutoLinkNode=T,wi.$isLinkNode=f,wi.AutoLinkNode=p,wi.LinkNode=r,wi.TOGGLE_LINK_COMMAND=E,wi.toggleLink=S,wi}var Oi={},_h;function bC(){if(_h)return Oi;_h=1;var e=gn(),t=Gt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(w){return new r(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}constructor(w,M={},m){super(m);let{target:v=null,rel:k=null,title:G=null}=M;this.__url=w,this.__target=v,this.__rel=k,this.__title=G}createDOM(w){let M=document.createElement("a");return M.href=this.sanitizeUrl(this.__url),this.__target!==null&&(M.target=this.__target),this.__rel!==null&&(M.rel=this.__rel),this.__title!==null&&(M.title=this.__title),e.addClassNamesToElement(M,w.theme.link),M}updateDOM(w,M){let m=this.__url,v=this.__target,k=this.__rel,G=this.__title;return m!==w.__url&&(M.href=m),v!==w.__target&&(v?M.target=v:M.removeAttribute("target")),k!==w.__rel&&(k?M.rel=k:M.removeAttribute("rel")),G!==w.__title&&(G?M.title=G:M.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:l,priority:1})}}static importJSON(w){let M=d(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}sanitizeUrl(w){try{let M=new URL(w);if(!n.has(M.protocol))return"about:blank"}catch{}return w}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(w){this.getWritable().__url=w}getTarget(){return this.getLatest().__target}setTarget(w){this.getWritable().__target=w}getRel(){return this.getLatest().__rel}setRel(w){this.getWritable().__rel=w}getTitle(){return this.getLatest().__title}setTitle(w){this.getWritable().__title=w}insertNewAfter(w,M=!0){return w=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(w,M),w}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(w,M){if(!t.$isRangeSelection(M))return!1;w=M.anchor.getNode();let m=M.focus.getNode();return this.isParentOf(w)&&this.isParentOf(m)&&0<M.getTextContent().length}}function l(S){let w=null;if(e.isHTMLAnchorElement(S)){let M=S.textContent;(M!==null&&M!==""||0<S.children.length)&&(w=d(S.getAttribute("href")||"",{rel:S.getAttribute("rel"),target:S.getAttribute("target"),title:S.getAttribute("title")}))}return{node:w}}function d(S,w){return t.$applyNodeReplacement(new r(S,w))}function f(S){return S instanceof r}class p extends r{static getType(){return"autolink"}static clone(w){return new p(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}static importJSON(w){let M=_(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(w,M=!0){return w=this.getParentOrThrow().insertNewAfter(w,M),t.$isElementNode(w)?(M=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),w.append(M),M):null}}function _(S,w){return t.$applyNodeReplacement(new p(S,w))}let T=t.createCommand("TOGGLE_LINK_COMMAND");function E(S,w){for(;S!==null&&S.getParent()!==null&&!w(S);)S=S.getParentOrThrow();return w(S)?S:null}return Oi.$createAutoLinkNode=_,Oi.$createLinkNode=d,Oi.$isAutoLinkNode=function(S){return S instanceof p},Oi.$isLinkNode=f,Oi.AutoLinkNode=p,Oi.LinkNode=r,Oi.TOGGLE_LINK_COMMAND=T,Oi.toggleLink=function(S,w={}){let{target:M,title:m}=w,v=w.rel===void 0?"noreferrer":w.rel;if(w=t.$getSelection(),t.$isRangeSelection(w))if(w=w.extract(),S===null)w.forEach(k=>{if(k=k.getParent(),f(k)){let G=k.getChildren();for(let I=0;I<G.length;I++)k.insertBefore(G[I]);k.remove()}});else{if(w.length===1){let I=E(w[0],f);if(I!==null){I.setURL(S),M!==void 0&&I.setTarget(M),v!==null&&I.setRel(v),m!==void 0&&I.setTitle(m);return}}let k=null,G=null;w.forEach(I=>{var P=I.getParent();if(P!==G&&P!==null&&(!t.$isElementNode(I)||I.isInline()))if(f(P))G=P,P.setURL(S),M!==void 0&&P.setTarget(M),v!==null&&G.setRel(v),m!==void 0&&G.setTitle(m);else if(P.is(k)||(k=P,G=d(S,{rel:v,target:M,title:m}),f(P)?I.getPreviousSibling()===null?P.insertBefore(G):P.insertAfter(G):I.insertBefore(G)),f(I)){if(!I.is(G)){if(G!==null){P=I.getChildren();for(let H=0;H<P.length;H++)G.append(P[H])}I.remove()}}else G!==null&&G.append(I)})}},Oi}var Eu,yh;function yd(){return yh||(yh=1,Eu=process.env.NODE_ENV==="development"?RC():bC()),Eu}var Nh;function LC(){if(Nh)return Cu;Nh=1;var e=yd(),t=Zn(),n=gn(),r=Gt(),l=rt;function d({validateUrl:f}){const[p]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!p.hasNodes([e.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(e.TOGGLE_LINK_COMMAND,_=>{if(_===null)return e.toggleLink(_),!0;if(typeof _=="string")return f===void 0||f(_)?(e.toggleLink(_),!0):!1;{const{url:T,target:E,rel:S,title:w}=_;return e.toggleLink(T,{rel:S,target:E,title:w}),!0}},r.COMMAND_PRIORITY_LOW),f!==void 0?p.registerCommand(r.PASTE_COMMAND,_=>{const T=r.$getSelection();if(!r.$isRangeSelection(T)||T.isCollapsed()||!(_ instanceof ClipboardEvent)||_.clipboardData==null)return!1;const E=_.clipboardData.getData("text");return f(E)?T.getNodes().some(S=>r.$isElementNode(S))?!1:(p.dispatchCommand(e.TOGGLE_LINK_COMMAND,E),_.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,f]),null}return Cu.LinkPlugin=d,Cu}var Tu={},Ch;function IC(){if(Ch)return Tu;Ch=1;var e=yd(),t=Zn(),n=gn(),r=Gt(),l=rt;return Tu.LinkPlugin=function({validateUrl:d}){let[f]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!f.hasNodes([e.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(f.registerCommand(e.TOGGLE_LINK_COMMAND,p=>{if(p===null)return e.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(e.toggleLink(p),!0):!1;let{url:_,target:T,rel:E,title:S}=p;return e.toggleLink(_,{rel:E,target:T,title:S}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?f.registerCommand(r.PASTE_COMMAND,p=>{let _=r.$getSelection();if(!r.$isRangeSelection(_)||_.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let T=p.clipboardData.getData("text");return d(T)?_.getNodes().some(E=>r.$isElementNode(E))?!1:(f.dispatchCommand(e.TOGGLE_LINK_COMMAND,T),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[f,d]),null},Tu}const kC=process.env.NODE_ENV==="development"?LC():IC();var PC=kC,xu={},Zt={},Eh;function $C(){if(Eh)return Zt;Eh=1;var e=Gt(),t=gn();class n extends e.INTERNAL_PointSelection{constructor(ie,le,ve){super(le,ve),this.gridKey=ie}getCachedNodes(){return this._cachedNodes}setCachedNodes(ie){this._cachedNodes=ie}is(ie){return r(ie)?this.gridKey===ie.gridKey&&this.anchor.is(ie.anchor)&&this.focus.is(ie.focus):!1}set(ie,le,ve){this.dirty=!0,this.gridKey=ie,this.anchor.key=le,this.focus.key=ve,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ie){}insertText(){}insertNodes(ie){const le=this.focus.getNode();if(!e.$isElementNode(le))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(le.select(0,le.getChildrenSize())).insertNodes(ie)}getShape(){const ie=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ie))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const le=e.DEPRECATED_$getGridCellNodeRect(ie);if(le===null)throw Error("getCellRect: expected to find AnchorNode");const ve=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(ve))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Le=e.DEPRECATED_$getGridCellNodeRect(ve);if(Le===null)throw Error("getCellRect: expected to find focusCellNode");const Me=Math.min(le.columnIndex,Le.columnIndex),je=Math.max(le.columnIndex,Le.columnIndex),it=Math.min(le.rowIndex,Le.rowIndex),ot=Math.max(le.rowIndex,Le.rowIndex);return{fromX:Math.min(Me,je),fromY:Math.min(it,ot),toX:Math.max(Me,je),toY:Math.max(it,ot)}}getNodes(){const ie=this._cachedNodes;if(ie!==null)return ie;const le=this.anchor.getNode(),ve=this.focus.getNode(),Le=t.$findMatchingParent(le,e.DEPRECATED_$isGridCellNode),Me=t.$findMatchingParent(ve,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Le))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!e.DEPRECATED_$isGridCellNode(Me))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const je=Le.getParent();if(!e.DEPRECATED_$isGridRowNode(je))throw Error("Expected anchorCell to have a parent GridRowNode");const it=je.getParent();if(!e.DEPRECATED_$isGridNode(it))throw Error("Expected tableNode to have a parent GridNode");const ot=Me.getParents()[1];if(ot!==it){if(it.isParentOf(Me)){const kt=ot.getParent();if(kt==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),kt.getKey())}else{const kt=it.getParent();if(kt==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,kt.getKey(),Me.getKey())}return this.getNodes()}const[st,wt,Ue]=e.DEPRECATED_$computeGridMap(it,Le,Me);let Ge=Math.min(wt.startColumn,Ue.startColumn),tt=Math.min(wt.startRow,Ue.startRow),yt=Math.max(wt.startColumn+wt.cell.__colSpan-1,Ue.startColumn+Ue.cell.__colSpan-1),Nt=Math.max(wt.startRow+wt.cell.__rowSpan-1,Ue.startRow+Ue.cell.__rowSpan-1),Tt=Ge,gt=tt,xt=Ge,mt=tt;function Ft(kt){const{cell:Yt,startColumn:bt,startRow:Qt}=kt;Ge=Math.min(Ge,bt),tt=Math.min(tt,Qt),yt=Math.max(yt,bt+Yt.__colSpan-1),Nt=Math.max(Nt,Qt+Yt.__rowSpan-1)}for(;Ge<Tt||tt<gt||yt>xt||Nt>mt;){if(Ge<Tt){const kt=mt-gt,Yt=Tt-1;for(let bt=0;bt<=kt;bt++)Ft(st[gt+bt][Yt]);Tt=Yt}if(tt<gt){const kt=xt-Tt,Yt=gt-1;for(let bt=0;bt<=kt;bt++)Ft(st[Yt][Tt+bt]);gt=Yt}if(yt>xt){const kt=mt-gt,Yt=xt+1;for(let bt=0;bt<=kt;bt++)Ft(st[gt+bt][Yt]);xt=Yt}if(Nt>mt){const kt=xt-Tt,Yt=mt+1;for(let bt=0;bt<=kt;bt++)Ft(st[Yt][Tt+bt]);mt=Yt}}const Ht=[it];let tn=null;for(let kt=tt;kt<=Nt;kt++)for(let Yt=Ge;Yt<=yt;Yt++){const{cell:bt}=st[kt][Yt],Qt=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(Qt))throw Error("Expected GridCellNode parent to be a GridRowNode");Qt!==tn&&Ht.push(Qt),Ht.push(bt,...d(bt)),tn=Qt}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Ht),Ht}getTextContent(){const ie=this.getNodes();let le="";for(let ve=0;ve<ie.length;ve++)le+=ie[ve].getTextContent();return le}}function r(Oe){return Oe instanceof n}function l(){const Oe=e.$createPoint("root",0,"element"),ie=e.$createPoint("root",0,"element");return new n("root",Oe,ie)}function d(Oe){const ie=[],le=[Oe];for(;le.length>0;){const ve=le.pop();if(ve===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(ve)&&le.unshift(...ve.getChildren()),ve!==Oe&&ie.push(ve)}return ie}const f=/^(\d+(?:\.\d+)?)px$/,p={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class _ extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const le=new _(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return le.__rowSpan=ie.__rowSpan,le.__backgroundColor=ie.__backgroundColor,le}static importDOM(){return{td:ie=>({conversion:T,priority:0}),th:ie=>({conversion:T,priority:0})}}static importJSON(ie){const le=ie.colSpan||1,ve=ie.rowSpan||1,Le=E(ie.headerState,le,ie.width||void 0);return Le.__rowSpan=ve,Le.__backgroundColor=ie.backgroundColor||null,Le}constructor(ie=p.NO_STATUS,le=1,ve,Le){super(le,Le),this.__headerState=ie,this.__width=ve,this.__backgroundColor=null}createDOM(ie){const le=document.createElement(this.getTag());return this.__width&&(le.style.width=`${this.__width}px`),this.__colSpan>1&&(le.colSpan=this.__colSpan),this.__rowSpan>1&&(le.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(le.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(le,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),le}exportDOM(ie){const{element:le}=super.exportDOM(ie);if(le){const ve=le,Le=700,Me=this.getParentOrThrow().getChildrenSize();ve.style.border="1px solid black",this.__colSpan>1&&(ve.colSpan=this.__colSpan),this.__rowSpan>1&&(ve.rowSpan=this.__rowSpan),ve.style.width=`${this.getWidth()||Math.max(90,Le/Me)}px`,ve.style.verticalAlign="top",ve.style.textAlign="start";const je=this.getBackgroundColor();je!==null?ve.style.backgroundColor=je:this.hasHeader()&&(ve.style.backgroundColor="#f2f3f5")}return{element:le}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const le=this.getWritable();return le.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const le=this.getWritable();return le.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const le=this.getWritable();return(le.__headerState&ie)===ie?le.__headerState-=ie:le.__headerState+=ie,le}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==p.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 T(Oe){const ie=Oe,le=Oe.nodeName.toLowerCase();let ve;f.test(ie.style.width)&&(ve=parseFloat(ie.style.width));const Le=E(le==="th"?p.ROW:p.NO_STATUS,ie.colSpan,ve);Le.__rowSpan=ie.rowSpan;const Me=ie.style.backgroundColor;return Me!==""&&(Le.__backgroundColor=Me),{forChild:(je,it)=>{if(S(it)&&!e.$isElementNode(je)){const ot=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
79
+ `?null:(ot.append(je),ot)}return je},node:Le}}function E(Oe,ie=1,le){return e.$applyNodeReplacement(new _(Oe,ie,le))}function S(Oe){return Oe instanceof _}class w extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new w(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:M,priority:0})}}static importJSON(ie){return m(ie.height)}constructor(ie,le){super(le),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const le=document.createElement("tr");return this.__height&&(le.style.height=`${this.__height}px`),t.addClassNamesToElement(le,ie.theme.tableRow),le}isShadowRoot(){return!0}setHeight(ie){const le=this.getWritable();return le.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function M(Oe){const ie=Oe;let le;return f.test(ie.style.height)&&(le=parseFloat(ie.style.height)),{node:m(le)}}function m(Oe){return e.$applyNodeReplacement(new w(Oe))}function v(Oe){return Oe instanceof w}const k=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Oe=>k?(Oe||window).getSelection():null;class I{constructor(ie,le){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=le,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(le=>{this.editor.update(()=>{let ve=!1;for(let Me=0;Me<le.length;Me++){const ot=le[Me].target.nodeName;if(ot==="TABLE"||ot==="TR"){ve=!0;break}}if(!ve)return;const Le=this.editor.getElementByKey(this.tableNodeKey);if(!Le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(Le)})});this.editor.update(()=>{const le=this.editor.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(le),ie.observe(le,{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 le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=ie.getElementByKey(this.tableNodeKey);if(!ve)throw new Error("Expected to find TableElement in DOM");const Le=ce(ve);V(ie,Le,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(le,ie._config.theme.tableSelection),le.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(le,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const le=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),V(le,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,le=!1){const ve=this.editor;ve.update(()=>{const Le=e.$getNodeByKey(this.tableNodeKey);if(!B(Le))throw new Error("Expected TableNode.");if(!ve.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ie.x,it=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const ot=G(ve._window);ot&&ot.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==it||le))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&it===this.focusY)return;if(this.focusX=je,this.focusY=it,this.isHighlightingCells){const ot=e.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&S(ot)){const st=ot.getKey();this.gridSelection=this.gridSelection.clone()||l(),this.focusCellNodeKey=st,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),ve.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),V(ve,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const le=e.$getNearestNodeFromDOMNode(ie.elem);if(S(le)){const ve=le.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():l(),this.anchorCellNodeKey=ve}})}formatCells(ie){this.editor.update(()=>{const le=e.$getSelection();if(!r(le))throw Error("Expected grid selection");const ve=e.$createRangeSelection(),Le=ve.anchor,Me=ve.focus;le.getNodes().forEach(je=>{S(je)&&je.getTextContentSize()!==0&&(Le.set(je.getKey(),0,"element"),Me.set(je.getKey(),je.getChildrenSize(),"element"),ve.formatText(ie))}),e.$setSelection(le),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=e.$getSelection();if(!r(ve))throw Error("Expected grid selection");const Le=ve.getNodes().filter(S);if(Le.length===this.grid.columns*this.grid.rows){le.selectPrevious(),le.remove(),e.$getRoot().selectStart();return}Le.forEach(Me=>{if(e.$isElementNode(Me)){const je=e.$createParagraphNode(),it=e.$createTextNode();je.append(it),Me.append(je),Me.getChildren().forEach(ot=>{ot!==je&&ot.remove()})}}),V(ie,this.grid,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const P="__lexicalTableSelection";function H(Oe,ie,le,ve){const Le=le.getRootElement();if(Le===null)throw new Error("No root element.");const Me=new I(le,Oe.getKey()),je=le._window||window;j(ie,Me),ie.addEventListener("mousedown",Ue=>{setTimeout(()=>{if(Ue.button!==0||!je)return;const Ge=te(Ue.target);Ge!==null&&(R(Ue),Me.setAnchorCellForSelection(Ge));const tt=()=>{je.removeEventListener("mouseup",tt),je.removeEventListener("mousemove",yt)},yt=Nt=>{const Tt=te(Nt.target);Tt!==null&&(Me.anchorX!==Tt.x||Me.anchorY!==Tt.y)&&(Nt.preventDefault(),Me.setFocusCellForSelection(Tt))};je.addEventListener("mouseup",tt),je.addEventListener("mousemove",yt)},0)});const it=Ue=>{Ue.button===0&&le.update(()=>{const Ge=e.$getSelection(),tt=Ue.target;r(Ge)&&Ge.gridKey===Me.tableNodeKey&&Le.contains(tt)&&Me.clearHighlight()})};je.addEventListener("mousedown",it),Me.listenersToRemove.add(()=>je.removeEventListener("mousedown",it)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ue=>J(le,Ue,"down",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_UP_COMMAND,Ue=>J(le,Ue,"up",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ue=>J(le,Ue,"backward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ue=>J(le,Ue,"forward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ESCAPE_COMMAND,Ue=>{const Ge=e.$getSelection();if(r(Ge)){const tt=t.$findMatchingParent(Ge.focus.getNode(),S);if(S(tt))return R(Ue),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const ot=Ue=>()=>{const Ge=e.$getSelection();if(!de(Ge,Oe))return!1;if(r(Ge))return Me.clearText(),!0;if(e.$isRangeSelection(Ge)){const tt=t.$findMatchingParent(Ge.anchor.getNode(),Ht=>S(Ht));if(!S(tt))return!1;const yt=Ge.anchor.getNode(),Nt=Ge.focus.getNode(),Tt=Oe.isParentOf(yt),gt=Oe.isParentOf(Nt);if(Tt&&!gt||gt&&!Tt)return Me.clearText(),!0;const mt=t.$findMatchingParent(Ge.anchor.getNode(),Ht=>e.$isElementNode(Ht)),Ft=mt&&t.$findMatchingParent(mt,Ht=>e.$isElementNode(Ht)&&S(Ht.getParent()));if(!e.$isElementNode(Ft)||!e.$isElementNode(mt))return!1;if(Ue===e.DELETE_LINE_COMMAND&&Ft.getPreviousSibling()===null)return!0;if((Ue===e.DELETE_CHARACTER_COMMAND||Ue===e.DELETE_WORD_COMMAND)&&Ge.isCollapsed()&&Ge.anchor.offset===0&&mt!==Ft){const Ht=mt.getChildren(),tn=e.$createParagraphNode();return Ht.forEach(kt=>tn.append(kt)),mt.replace(tn),mt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ue=>{Me.listenersToRemove.add(le.registerCommand(Ue,ot(Ue),e.COMMAND_PRIORITY_CRITICAL))});const st=Ue=>{const Ge=e.$getSelection();if(!de(Ge,Oe))return!1;if(r(Ge))return Ue.preventDefault(),Ue.stopPropagation(),Me.clearText(),!0;if(e.$isRangeSelection(Ge)){const tt=t.$findMatchingParent(Ge.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1};Me.listenersToRemove.add(le.registerCommand(e.KEY_BACKSPACE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.KEY_DELETE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FORMAT_TEXT_COMMAND,Ue=>{const Ge=e.$getSelection();if(!de(Ge,Oe))return!1;if(r(Ge))return Me.formatCells(Ue),!0;if(e.$isRangeSelection(Ge)){const tt=t.$findMatchingParent(Ge.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ue=>{const Ge=e.$getSelection();if(!de(Ge,Oe))return!1;if(r(Ge))return Me.clearHighlight(),!1;if(e.$isRangeSelection(Ge)){const tt=t.$findMatchingParent(Ge.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),ve&&Me.listenersToRemove.add(le.registerCommand(e.KEY_TAB_COMMAND,Ue=>{const Ge=e.$getSelection();if(!e.$isRangeSelection(Ge)||!Ge.isCollapsed()||!de(Ge,Oe))return!1;const tt=Y(Ge.anchor.getNode());if(tt===null)return!1;R(Ue);const yt=Oe.getCordsFromCellNode(tt,Me.grid);return Se(Me,Oe,yt.x,yt.y,Ue.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FOCUS_COMMAND,Ue=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function wt(Ue){const Ge=Oe.getCordsFromCellNode(Ue,Me.grid);return Oe.getCellFromCordsOrThrow(Ge.x,Ge.y,Me.grid)}return Me.listenersToRemove.add(le.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ue=>{const{nodes:Ge,selection:tt}=Ue,yt=e.$INTERNAL_isPointSelection(tt),Nt=e.$isRangeSelection(tt),Tt=Nt&&t.$findMatchingParent(tt.anchor.getNode(),Et=>e.DEPRECATED_$isGridCellNode(Et))!==null&&t.$findMatchingParent(tt.focus.getNode(),Et=>e.DEPRECATED_$isGridCellNode(Et))!==null||yt&&!Nt;if(Ge.length!==1||!e.DEPRECATED_$isGridNode(Ge[0])||!Tt)return!1;const{anchor:gt}=tt,xt=Ge[0],mt=xt.getChildren(),Ft=xt.getFirstChildOrThrow().getChildrenSize(),Ht=xt.getChildrenSize(),tn=t.$findMatchingParent(gt.getNode(),Et=>e.DEPRECATED_$isGridCellNode(Et)),kt=tn&&t.$findMatchingParent(tn,Et=>e.DEPRECATED_$isGridRowNode(Et)),Yt=kt&&t.$findMatchingParent(kt,Et=>e.DEPRECATED_$isGridNode(Et));if(!e.DEPRECATED_$isGridCellNode(tn)||!e.DEPRECATED_$isGridRowNode(kt)||!e.DEPRECATED_$isGridNode(Yt))return!1;const bt=kt.getIndexWithinParent(),Qt=Math.min(Yt.getChildrenSize()-1,bt+Ht-1),wr=tn.getIndexWithinParent(),mi=Math.min(kt.getChildrenSize()-1,wr+Ft-1),_i=Math.min(wr,mi),pe=Math.min(bt,Qt),Ze=Math.max(wr,mi),nt=Math.max(bt,Qt),St=Yt.getChildren();let Pt=0,Ut,$t;for(let Et=pe;Et<=nt;Et++){const Nn=St[Et];if(!e.DEPRECATED_$isGridRowNode(Nn))return!1;const rn=mt[Pt];if(!e.DEPRECATED_$isGridRowNode(rn))return!1;const cn=Nn.getChildren(),bn=rn.getChildren();let nr=0;for(let Ln=_i;Ln<=Ze;Ln++){const fn=cn[Ln];if(!e.DEPRECATED_$isGridCellNode(fn))return!1;const Jn=bn[nr];if(!e.DEPRECATED_$isGridCellNode(Jn))return!1;Et===pe&&Ln===_i?Ut=fn.getKey():Et===nt&&Ln===Ze&&($t=fn.getKey());const Mi=fn.getChildren();Jn.getChildren().forEach(rr=>{e.$isTextNode(rr)&&e.$createParagraphNode().append(rr),fn.append(rr)}),Mi.forEach(rr=>rr.remove()),nr++}Pt++}if(Ut&&$t){const Et=l();Et.set(Ge[0].getKey(),Ut,$t),e.$setSelection(Et)}return!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ue=e.$getSelection(),Ge=e.$getPreviousSelection();if(e.$isRangeSelection(Ue)){const{anchor:tt,focus:yt}=Ue,Nt=tt.getNode(),Tt=yt.getNode(),gt=Y(Nt),xt=Y(Tt),mt=gt&&Oe.is(W(gt)),Ft=xt&&Oe.is(W(xt)),Ht=mt!==Ft,tn=mt&&Ft,kt=Ue.isBackward();if(Ht){const Yt=Ue.clone();Yt.focus.set(Oe.getKey(),kt?0:Oe.getChildrenSize(),"element"),e.$setSelection(Yt),q(le,Me)}else tn&&(gt.is(xt)||(Me.setAnchorCellForSelection(wt(gt)),Me.setFocusCellForSelection(wt(xt),!0)))}return Ue&&!Ue.is(Ge)&&(r(Ue)||r(Ge))&&Me.gridSelection&&!Me.gridSelection.is(Ge)?(r(Ue)&&Ue.gridKey===Me.tableNodeKey?Me.updateTableGridSelection(Ue):!r(Ue)&&r(Ge)&&Ge.gridKey===Me.tableNodeKey&&Me.updateTableGridSelection(null),!1):(Me.hasHijackedSelectionStyles&&!Oe.isSelected()?Te(le,Me):!Me.hasHijackedSelectionStyles&&Oe.isSelected()&&q(le,Me),!1)},e.COMMAND_PRIORITY_CRITICAL)),Me}function j(Oe,ie){Oe[P]=ie}function re(Oe){return Oe[P]}function te(Oe){let ie=Oe;for(;ie!=null;){const le=ie.nodeName;if(le==="TD"||le==="TH"){const ve=ie._cell;return ve===void 0?null:ve}ie=ie.parentNode}return null}function ce(Oe){const ie=[],le={cells:ie,columns:0,rows:0};let ve=Oe.firstChild,Le=0,Me=0;for(ie.length=0;ve!=null;){const je=ve.nodeName;if(je==="TD"||je==="TH"){const st=ve,wt={elem:st,hasBackgroundColor:st.style.backgroundColor!=="",highlighted:!1,x:Le,y:Me};ve._cell=wt;let Ue=ie[Me];Ue===void 0&&(Ue=ie[Me]=[]),Ue[Le]=wt}else{const st=ve.firstChild;if(st!=null){ve=st;continue}}const it=ve.nextSibling;if(it!=null){Le++,ve=it;continue}const ot=ve.parentNode;if(ot!=null){const st=ot.nextSibling;if(st==null)break;Me++,Le=0,ve=st}}return le.columns=Le+1,le.rows=Me+1,le}function V(Oe,ie,le){const ve=new Set(le?le.getNodes():[]);z(ie,(Le,Me)=>{const je=Le.elem;ve.has(Me)?(Le.highlighted=!0,Z(Oe,Le)):(Le.highlighted=!1,se(Oe,Le),je.getAttribute("style")||je.removeAttribute("style"))})}function z(Oe,ie){const{cells:le}=Oe;for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(Le)for(let Me=0;Me<Le.length;Me++){const je=Le[Me];if(!je)continue;const it=e.$getNearestNodeFromDOMNode(je.elem);it!==null&&ie(je,it,{x:Me,y:ve})}}}function q(Oe,ie){ie.disableHighlightStyle(),z(ie.grid,le=>{le.highlighted=!0,Z(Oe,le)})}function Te(Oe,ie){ie.enableHighlightStyle(),z(ie.grid,le=>{const ve=le.elem;le.highlighted=!1,se(Oe,le),ve.getAttribute("style")||ve.removeAttribute("style")})}const Se=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)?K(ie.getCellNodeFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid),Me):ve!==(Me?Oe.grid.rows-1:0)?K(ie.getCellNodeFromCordsOrThrow(Me?0:Oe.grid.columns-1,ve+(Me?1:-1),Oe.grid),Me):Me?ie.selectNext():ie.selectPrevious(),!0;case"up":return ve!==0?K(ie.getCellNodeFromCordsOrThrow(le,ve-1,Oe.grid),!1):ie.selectPrevious(),!0;case"down":return ve!==Oe.grid.rows-1?K(ie.getCellNodeFromCordsOrThrow(le,ve+1,Oe.grid),!0):ie.selectNext(),!0;default:return!1}},Ee=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid)),!0;case"up":return ve!==0?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve-1,Oe.grid)),!0):!1;case"down":return ve!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve+1,Oe.grid)),!0):!1;default:return!1}};function de(Oe,ie){if(e.$isRangeSelection(Oe)||r(Oe)){const le=ie.isParentOf(Oe.anchor.getNode()),ve=ie.isParentOf(Oe.focus.getNode());return le&&ve}return!1}function K(Oe,ie){ie?Oe.selectStart():Oe.selectEnd()}const O="172,206,247";function Z(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null?le.style.setProperty("background-color",`rgb(${O})`):le.style.setProperty("background-image",`linear-gradient(to right, rgba(${O},0.85), rgba(${O},0.85))`),le.style.setProperty("caret-color","transparent")}function se(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null&&le.style.removeProperty("background-color"),le.style.removeProperty("background-image"),le.style.removeProperty("caret-color")}function Y(Oe){const ie=t.$findMatchingParent(Oe,S);return S(ie)?ie:null}function W(Oe){const ie=t.$findMatchingParent(Oe,B);return B(ie)?ie:null}function J(Oe,ie,le,ve,Le){const Me=e.$getSelection();if(!de(Me,ve))return!1;if(e.$isRangeSelection(Me)&&Me.isCollapsed()){if(le==="backward"||le==="forward")return!1;const{anchor:je,focus:it}=Me,ot=t.$findMatchingParent(je.getNode(),S),st=t.$findMatchingParent(it.getNode(),S);if(!S(ot)||!ot.is(st))return!1;const wt=W(ot);if(wt!==ve&&wt!=null){const xt=Oe.getElementByKey(wt.getKey());if(xt!=null)return Le.grid=ce(xt),J(Oe,ie,le,wt,Le)}const Ue=Oe.getElementByKey(ot.__key),Ge=Oe.getElementByKey(je.key);if(Ge==null||Ue==null)return!1;let tt;if(je.type==="element")tt=Ge.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const yt=le==="up"?ot.getFirstChild():ot.getLastChild();if(yt==null)return!1;const Nt=Oe.getElementByKey(yt.__key);if(Nt==null)return!1;const Tt=Nt.getBoundingClientRect();if(le==="up"?Tt.top>tt.top-tt.height:tt.bottom+tt.height>Tt.bottom){R(ie);const xt=ve.getCordsFromCellNode(ot,Le.grid);if(ie.shiftKey){const mt=ve.getCellFromCordsOrThrow(xt.x,xt.y,Le.grid);Le.setAnchorCellForSelection(mt),Le.setFocusCellForSelection(mt,!0)}else return Se(Le,ve,xt.x,xt.y,le);return!0}}else if(r(Me)){const{anchor:je,focus:it}=Me,ot=t.$findMatchingParent(je.getNode(),S),st=t.$findMatchingParent(it.getNode(),S),[wt]=Me.getNodes(),Ue=Oe.getElementByKey(wt.getKey());if(!S(ot)||!S(st)||!B(wt)||Ue==null)return!1;Le.updateTableGridSelection(Me);const Ge=ce(Ue),tt=ve.getCordsFromCellNode(ot,Ge),yt=ve.getCellFromCordsOrThrow(tt.x,tt.y,Ge);if(Le.setAnchorCellForSelection(yt),R(ie),ie.shiftKey){const Nt=ve.getCordsFromCellNode(st,Ge);return Ee(Le,wt,Nt.x,Nt.y,le)}else st.selectEnd();return!0}return!1}function R(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class U extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new U(ie.__key)}static importDOM(){return{table:ie=>({conversion:fe,priority:1})}}static importJSON(ie){return _e()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,le){const ve=document.createElement("table");return t.addClassNamesToElement(ve,ie.theme.table),ve}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:le=>{if(le){const ve=le.cloneNode(),Le=document.createElement("colgroup"),Me=document.createElement("tbody");t.isHTMLElement(le)&&Me.append(...le.children);const je=this.getFirstChildOrThrow();if(!v(je))throw new Error("Expected to find row node.");const it=je.getChildrenSize();for(let ot=0;ot<it;ot++){const st=document.createElement("col");Le.append(st)}return ve.replaceChildren(Le,Me),ve}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,le){const{rows:ve,cells:Le}=le;for(let Me=0;Me<ve;Me++){const je=Le[Me];if(je==null)continue;const it=je.findIndex(ot=>{if(!ot)return;const{elem:st}=ot;return e.$getNearestNodeFromDOMNode(st)===ie});if(it!==-1)return{x:it,y:Me}}throw new Error("Cell not found in table.")}getCellFromCords(ie,le,ve){const{cells:Le}=ve,Me=Le[le];if(Me==null)return null;const je=Me[ie];return je??null}getCellFromCordsOrThrow(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(!Le)throw new Error("Cell not found at cords.");return Le}getCellNodeFromCords(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(Le==null)return null;const Me=e.$getNearestNodeFromDOMNode(Le.elem);return S(Me)?Me:null}getCellNodeFromCordsOrThrow(ie,le,ve){const Le=this.getCellNodeFromCords(ie,le,ve);if(!Le)throw new Error("Node at cords not TableCellNode.");return Le}canSelectBefore(){return!0}canIndent(){return!1}}function X(Oe,ie){const le=Oe.getElementByKey(ie.getKey());if(le==null)throw new Error("Table Element Not Found");return ce(le)}function fe(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new U)}function B(Oe){return Oe instanceof U}function A(Oe,ie,le=!0){const ve=_e();for(let Le=0;Le<Oe;Le++){const Me=m();for(let je=0;je<ie;je++){let it=p.NO_STATUS;typeof le=="object"?(Le===0&&le.rows&&(it|=p.ROW),je===0&&le.columns&&(it|=p.COLUMN)):le&&(Le===0&&(it|=p.ROW),je===0&&(it|=p.COLUMN));const ot=E(it),st=e.$createParagraphNode();st.append(e.$createTextNode()),ot.append(st),Me.append(ot)}ve.append(Me)}return ve}function F(Oe){const ie=t.$findMatchingParent(Oe,le=>S(le));return S(ie)?ie:null}function oe(Oe){const ie=t.$findMatchingParent(Oe,le=>v(le));if(v(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ie=t.$findMatchingParent(Oe,le=>B(le));if(B(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function De(Oe){const ie=oe(Oe);return ye(ie).getChildren().findIndex(ve=>ve.is(ie))}function ee(Oe){return oe(Oe).getChildren().findIndex(le=>le.is(Oe))}function ne(Oe,ie){const le=ye(Oe),{x:ve,y:Le}=le.getCordsFromCellNode(Oe,ie);return{above:le.getCellNodeFromCords(ve,Le-1,ie),below:le.getCellNodeFromCords(ve,Le+1,ie),left:le.getCellNodeFromCords(ve-1,Le,ie),right:le.getCellNodeFromCords(ve+1,Le,ie)}}function ue(Oe,ie){const le=Oe.getChildren();if(ie>=le.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return le[ie].remove(),Oe}function be(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table row target index out of range");const je=Me[ie];if(v(je))for(let it=0;it<ve;it++){const ot=je.getChildren(),st=ot.length,wt=m();for(let Ue=0;Ue<st;Ue++){const Ge=ot[Ue];if(!S(Ge))throw Error("Expected table cell");const{above:tt,below:yt}=ne(Ge,Le);let Nt=p.NO_STATUS;const Tt=tt&&tt.getWidth()||yt&&yt.getWidth()||void 0;(tt&&tt.hasHeaderState(p.COLUMN)||yt&&yt.hasHeaderState(p.COLUMN))&&(Nt|=p.COLUMN);const gt=E(Nt,1,Tt);gt.append(e.$createParagraphNode()),wt.append(gt)}le?je.insertAfter(wt):je.insertBefore(wt)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const le=ie.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,je]=e.DEPRECATED_$computeGridMap(Le,ve,ve),it=Me[0].length,{startRow:ot}=je;if(Oe){const st=ot+ve.__rowSpan-1,wt=Me[st],Ue=m();for(let tt=0;tt<it;tt++){const{cell:yt,startRow:Nt}=wt[tt];Nt+yt.__rowSpan-1<=st?Ue.append(E(p.NO_STATUS).append(e.$createParagraphNode())):yt.setRowSpan(yt.__rowSpan+1)}const Ge=Le.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertAfter(Ue)}else{const st=Me[ot],wt=m();for(let Ge=0;Ge<it;Ge++){const{cell:tt,startRow:yt}=st[Ge];yt===ot?wt.append(E(p.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ue=Le.getChildAtIndex(ot);if(!e.DEPRECATED_$isGridRowNode(Ue))throw Error("focusEndRow is not a GridRowNode");Ue.insertBefore(wt)}}function Re(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren(),je=[];for(let it=0;it<Me.length;it++){const ot=Me[it];if(v(ot))for(let st=0;st<ve;st++){const wt=ot.getChildren();if(ie>=wt.length||ie<0)throw new Error("Table column target index out of range");const Ue=wt[ie];if(!S(Ue))throw Error("Expected table cell");const{left:Ge,right:tt}=ne(Ue,Le);let yt=p.NO_STATUS;(Ge&&Ge.hasHeaderState(p.ROW)||tt&&tt.hasHeaderState(p.ROW))&&(yt|=p.ROW);const Nt=E(yt);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ue})}}return je.forEach(({newTableCell:it,targetCell:ot})=>{le?ot.insertAfter(it):ot.insertBefore(it)}),Oe}function ke(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const le=ie.anchor.getNode(),ve=ie.focus.getNode(),[Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,,je]=e.DEPRECATED_$getNodeTriplet(ve),[it,ot,st]=e.DEPRECATED_$computeGridMap(je,Me,Le),wt=it.length,Ue=Oe?Math.max(ot.startColumn,st.startColumn):Math.min(ot.startColumn,st.startColumn),Ge=Oe?Ue+Me.__colSpan-1:Ue-1,tt=je.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let yt=null;function Nt(){const gt=E(p.NO_STATUS).append(e.$createParagraphNode());return yt===null&&(yt=gt),gt}let Tt=tt;e:for(let gt=0;gt<wt;gt++){if(gt!==0){const tn=Tt.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(tn))throw Error("Expected row nextSibling to be a row");Tt=tn}const xt=it[gt];if(Ge<0){Mt(Tt,Nt());continue}const{cell:mt,startColumn:Ft,startRow:Ht}=xt[Ge];if(Ft+mt.__colSpan-1<=Ge){let tn=mt,kt=Ht,Yt=Ge;for(;kt!==gt&&tn.__rowSpan>1;)if(Yt-=mt.__colSpan,Yt>=0){const{cell:bt,startRow:Qt}=xt[Yt];tn=bt,kt=Qt}else{Tt.append(Nt());continue e}tn.insertAfter(Nt())}else mt.setColSpan(mt.__colSpan+1)}yt!==null&&ct(yt)}function Fe(Oe,ie){const le=Oe.getChildren();for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(v(Le)){const Me=Le.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table column target index out of range");Me[ie].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,it,ot]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startRow:st}=it,{startRow:wt}=ot,Ue=wt+Me.__rowSpan-1;if(je.length===Ue-st+1){Le.remove();return}const Ge=je[0].length,tt=je[Ue+1],yt=Le.getChildAtIndex(Ue+1);for(let Nt=Ue;Nt>=st;Nt--){for(let gt=Ge-1;gt>=0;gt--){const{cell:xt,startRow:mt,startColumn:Ft}=je[Nt][gt];if(Ft===gt&&(Nt===st&&mt<st&&xt.setRowSpan(xt.__rowSpan-(mt-st)),mt>=st&&mt+xt.__rowSpan-1>Ue)){if(xt.setRowSpan(xt.__rowSpan-(Ue-mt+1)),yt===null)throw Error("Expected nextRowNode not to be null");if(gt===0)Mt(yt,xt);else{const{cell:Ht}=tt[gt-1];Ht.insertAfter(xt)}}}const Tt=Le.getChildAtIndex(Nt);if(!e.DEPRECATED_$isGridRowNode(Tt))throw Error(`Expected GridNode childAtIndex(${String(Nt)}) to be RowNode`);Tt.remove()}if(tt!==void 0){const{cell:Nt}=tt[0];ct(Nt)}else{const Nt=je[st-1],{cell:Tt}=Nt[0];ct(Tt)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,it,ot]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startColumn:st}=it,{startRow:wt,startColumn:Ue}=ot,Ge=Math.min(st,Ue),tt=Math.max(st+ve.__colSpan-1,Ue+Me.__colSpan-1),yt=tt-Ge+1;if(je[0].length===tt-Ge+1){Le.selectPrevious(),Le.remove();return}const Tt=je.length;for(let mt=0;mt<Tt;mt++)for(let Ft=Ge;Ft<=tt;Ft++){const{cell:Ht,startColumn:tn}=je[mt][Ft];if(tn<Ge){if(Ft===Ge){const kt=Ge-tn;Ht.setColSpan(Ht.__colSpan-Math.min(yt,Ht.__colSpan-kt))}}else if(tn+Ht.__colSpan-1>tt){if(Ft===tt){const kt=tt-tn+1;Ht.setColSpan(Ht.__colSpan-kt)}}else Ht.remove()}const gt=je[wt],xt=gt[Ue+Me.__colSpan];if(xt!==void 0){const{cell:mt}=xt;ct(mt)}else{const mt=gt[Ue-1],{cell:Ft}=mt;ct(Ft)}}function ct(Oe){const ie=Oe.getFirstDescendant();ie==null?Oe.selectStart():ie.getParentOrThrow().selectStart()}function Mt(Oe,ie){const le=Oe.getFirstChild();le!==null?le.insertBefore(ie):Oe.append(ie)}function zt(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),[le,ve,Le]=e.DEPRECATED_$getNodeTriplet(ie),Me=le.__colSpan,je=le.__rowSpan;if(Me>1){for(let it=1;it<Me;it++)le.insertAfter(E(p.NO_STATUS));le.setColSpan(1)}if(je>1){const[it,ot]=e.DEPRECATED_$computeGridMap(Le,le,le),{startColumn:st,startRow:wt}=ot;let Ue;for(let Ge=1;Ge<je;Ge++){const tt=wt+Ge,yt=it[tt];if(Ue=(Ue||ve).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ue))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Tt=0;Tt<st;Tt++){const gt=yt[Tt],xt=gt.cell;gt.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Tt+=xt.__colSpan-1)}if(Nt===null)for(let Tt=0;Tt<Me;Tt++)Mt(Ue,E(p.NO_STATUS));else for(let Tt=0;Tt<Me;Tt++)Nt.insertAfter(E(p.NO_STATUS))}le.setRowSpan(1)}}const Vt=e.createCommand("INSERT_TABLE_COMMAND");return Zt.$createGridSelection=l,Zt.$createTableCellNode=E,Zt.$createTableNode=_e,Zt.$createTableNodeWithDimensions=A,Zt.$createTableRowNode=m,Zt.$deleteTableColumn=Fe,Zt.$deleteTableColumn__EXPERIMENTAL=Be,Zt.$deleteTableRow__EXPERIMENTAL=qe,Zt.$getElementGridForTableNode=X,Zt.$getTableCellNodeFromLexicalNode=F,Zt.$getTableColumnIndexFromTableCellNode=ee,Zt.$getTableNodeFromLexicalNodeOrThrow=ye,Zt.$getTableRowIndexFromTableCellNode=De,Zt.$getTableRowNodeFromTableCellNodeOrThrow=oe,Zt.$insertTableColumn=Re,Zt.$insertTableColumn__EXPERIMENTAL=ke,Zt.$insertTableRow=be,Zt.$insertTableRow__EXPERIMENTAL=Ne,Zt.$isGridSelection=r,Zt.$isTableCellNode=S,Zt.$isTableNode=B,Zt.$isTableRowNode=v,Zt.$removeTableRowAtIndex=ue,Zt.$unmergeCell=zt,Zt.INSERT_TABLE_COMMAND=Vt,Zt.TableCellHeaderStates=p,Zt.TableCellNode=_,Zt.TableNode=U,Zt.TableRowNode=w,Zt.TableSelection=I,Zt.applyTableHandlers=H,Zt.getCellFromTarget=te,Zt.getTableSelectionFromTableElement=re,Zt}var Jt={},Th;function FC(){if(Th)return Jt;Th=1;var e=Gt(),t=gn();function n(B){let A=new URLSearchParams;A.append("code",B);for(let F=1;F<arguments.length;F++)A.append("v",arguments[F]);throw Error(`Minified Lexical error #${B}; visit https://lexical.dev/docs/error?${A} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class r extends e.INTERNAL_PointSelection{constructor(A,F,oe){super(F,oe),this.gridKey=A}getCachedNodes(){return this._cachedNodes}setCachedNodes(A){this._cachedNodes=A}is(A){return l(A)?this.gridKey===A.gridKey&&this.anchor.is(A.anchor)&&this.focus.is(A.focus):!1}set(A,F,oe){this.dirty=!0,this.gridKey=A,this.anchor.key=F,this.focus.key=oe,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(A){let F=this.focus.getNode();if(!e.$isElementNode(F))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(F.select(0,F.getChildrenSize())).insertNodes(A)}getShape(){var A=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(A)||n(103),A=e.DEPRECATED_$getGridCellNodeRect(A),A===null)throw Error("getCellRect: expected to find AnchorNode");var F=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(F)||n(104);let oe=e.DEPRECATED_$getGridCellNodeRect(F);if(oe===null)throw Error("getCellRect: expected to find focusCellNode");F=Math.min(A.columnIndex,oe.columnIndex);let ye=Math.max(A.columnIndex,oe.columnIndex),De=Math.min(A.rowIndex,oe.rowIndex);return A=Math.max(A.rowIndex,oe.rowIndex),{fromX:Math.min(F,ye),fromY:Math.min(De,A),toX:Math.max(F,ye),toY:Math.max(De,A)}}getNodes(){function A(ct){let{cell:Mt,startColumn:zt,startRow:Vt}=ct;be=Math.min(be,zt),Ne=Math.min(Ne,Vt),Re=Math.max(Re,zt+Mt.__colSpan-1),ke=Math.max(ke,Vt+Mt.__rowSpan-1)}var F=this._cachedNodes;if(F!==null)return F;var oe=this.anchor.getNode();F=this.focus.getNode();var ye=t.$findMatchingParent(oe,e.DEPRECATED_$isGridCellNode);oe=t.$findMatchingParent(F,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(oe)||n(104),F=ye.getParent(),e.DEPRECATED_$isGridRowNode(F)||n(105),F=F.getParent(),e.DEPRECATED_$isGridNode(F)||n(106);var De=oe.getParents()[1];if(De!==F){if(F.isParentOf(oe)){if(F=De.getParent(),F==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,oe.getKey(),F.getKey())}else{if(F=F.getParent(),F==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,F.getKey(),oe.getKey())}return this.getNodes()}let[ee,ne,ue]=e.DEPRECATED_$computeGridMap(F,ye,oe),be=Math.min(ne.startColumn,ue.startColumn),Ne=Math.min(ne.startRow,ue.startRow),Re=Math.max(ne.startColumn+ne.cell.__colSpan-1,ue.startColumn+ue.cell.__colSpan-1),ke=Math.max(ne.startRow+ne.cell.__rowSpan-1,ue.startRow+ue.cell.__rowSpan-1);oe=be,ye=Ne,De=be;for(var Fe=Ne;be<oe||Ne<ye||Re>De||ke>Fe;){if(be<oe){var qe=Fe-ye;--oe;for(var Be=0;Be<=qe;Be++)A(ee[ye+Be][oe])}if(Ne<ye)for(qe=De-oe,--ye,Be=0;Be<=qe;Be++)A(ee[ye][oe+Be]);if(Re>De)for(qe=Fe-ye,De+=1,Be=0;Be<=qe;Be++)A(ee[ye+Be][De]);if(ke>Fe)for(qe=De-oe,Fe+=1,Be=0;Be<=qe;Be++)A(ee[Fe][oe+Be])}for(F=[F],oe=null,ye=Ne;ye<=ke;ye++)for(De=be;De<=Re;De++)({cell:Fe}=ee[ye][De]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==oe&&F.push(qe),F.push(Fe,...f(Fe)),oe=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=F),F}getTextContent(){let A=this.getNodes(),F="";for(let oe=0;oe<A.length;oe++)F+=A[oe].getTextContent();return F}}function l(B){return B instanceof r}function d(){let B=e.$createPoint("root",0,"element"),A=e.$createPoint("root",0,"element");return new r("root",B,A)}function f(B){let A=[],F=[B];for(;0<F.length;){let oe=F.pop();oe===void 0&&n(112),e.$isElementNode(oe)&&F.unshift(...oe.getChildren()),oe!==B&&A.push(oe)}return A}let p=/^(\d+(?:\.\d+)?)px$/,_={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class T extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(A){let F=new T(A.__headerState,A.__colSpan,A.__width,A.__key);return F.__rowSpan=A.__rowSpan,F.__backgroundColor=A.__backgroundColor,F}static importDOM(){return{td:()=>({conversion:E,priority:0}),th:()=>({conversion:E,priority:0})}}static importJSON(A){let F=A.rowSpan||1,oe=S(A.headerState,A.colSpan||1,A.width||void 0);return oe.__rowSpan=F,oe.__backgroundColor=A.backgroundColor||null,oe}constructor(A=_.NO_STATUS,F=1,oe,ye){super(F,ye),this.__headerState=A,this.__width=oe,this.__backgroundColor=null}createDOM(A){let F=document.createElement(this.getTag());return this.__width&&(F.style.width=`${this.__width}px`),1<this.__colSpan&&(F.colSpan=this.__colSpan),1<this.__rowSpan&&(F.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(F.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(F,A.theme.tableCell,this.hasHeader()&&A.theme.tableCellHeader),F}exportDOM(A){if({element:A}=super.exportDOM(A),A){var F=this.getParentOrThrow().getChildrenSize();A.style.border="1px solid black",1<this.__colSpan&&(A.colSpan=this.__colSpan),1<this.__rowSpan&&(A.rowSpan=this.__rowSpan),A.style.width=`${this.getWidth()||Math.max(90,700/F)}px`,A.style.verticalAlign="top",A.style.textAlign="start",F=this.getBackgroundColor(),F!==null?A.style.backgroundColor=F:this.hasHeader()&&(A.style.backgroundColor="#f2f3f5")}return{element:A}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(A){return this.getWritable().__headerState=A,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(A){return this.getWritable().__width=A,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(A){this.getWritable().__backgroundColor=A}toggleHeaderStyle(A){let F=this.getWritable();return F.__headerState=(F.__headerState&A)===A?F.__headerState-A:F.__headerState+A,F}hasHeaderState(A){return(this.getHeaderStyles()&A)===A}hasHeader(){return this.getLatest().__headerState!==_.NO_STATUS}updateDOM(A){return A.__headerState!==this.__headerState||A.__width!==this.__width||A.__colSpan!==this.__colSpan||A.__rowSpan!==this.__rowSpan||A.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function E(B){var A=B.nodeName.toLowerCase();let F;return p.test(B.style.width)&&(F=parseFloat(B.style.width)),A=S(A==="th"?_.ROW:_.NO_STATUS,B.colSpan,F),A.__rowSpan=B.rowSpan,B=B.style.backgroundColor,B!==""&&(A.__backgroundColor=B),{forChild:(oe,ye)=>w(ye)&&!e.$isElementNode(oe)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(oe)&&oe.getTextContent()===`
80
+ `?null:(ye.append(oe),ye)):oe,node:A}}function S(B,A=1,F){return e.$applyNodeReplacement(new T(B,A,F))}function w(B){return B instanceof T}class M extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(A){return new M(A.__height,A.__key)}static importDOM(){return{tr:()=>({conversion:m,priority:0})}}static importJSON(A){return v(A.height)}constructor(A,F){super(F),this.__height=A}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(A){let F=document.createElement("tr");return this.__height&&(F.style.height=`${this.__height}px`),t.addClassNamesToElement(F,A.theme.tableRow),F}isShadowRoot(){return!0}setHeight(A){return this.getWritable().__height=A,this.__height}getHeight(){return this.getLatest().__height}updateDOM(A){return A.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function m(B){let A;return p.test(B.style.height)&&(A=parseFloat(B.style.height)),{node:v(A)}}function v(B){return e.$applyNodeReplacement(new M(B))}function k(B){return B instanceof M}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class I{constructor(A,F){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=F,this.editor=A,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(A=>A())}trackTableGrid(){let A=new MutationObserver(F=>{this.editor.update(()=>{var oe=!1;for(let ye=0;ye<F.length;ye++){const De=F[ye].target.nodeName;if(De==="TABLE"||De==="TR"){oe=!0;break}}if(oe){if(oe=this.editor.getElementByKey(this.tableNodeKey),!oe)throw Error("Expected to find TableElement in DOM");this.grid=H(oe)}})});this.editor.update(()=>{let F=this.editor.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");this.grid=H(F),A.observe(F,{childList:!0,subtree:!0})})}clearHighlight(){let A=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(),A.update(()=>{var F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");if(F=A.getElementByKey(this.tableNodeKey),!F)throw Error("Expected to find TableElement in DOM");F=H(F),j(A,F,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(F,A._config.theme.tableSelection),F.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(F,A._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(A){if(A!=null&&A.gridKey===this.tableNodeKey){let F=this.editor;this.gridSelection=A,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(F,this.grid,this.gridSelection)}else A==null?this.clearHighlight():(this.tableNodeKey=A.gridKey,this.updateTableGridSelection(A))}setFocusCellForSelection(A,F=!1){let oe=this.editor;oe.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!W(ye))throw Error("Expected TableNode.");if(!oe.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=A.x;let De=A.y;if(this.focusCell=A,this.anchorCell!==null){let ee=G?(oe._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==De||F))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&De===this.focusY)return;this.focusX=ye,this.focusY=De,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(A.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&w(ye)&&(ye=ye.getKey(),this.gridSelection=this.gridSelection.clone()||d(),this.focusCellNodeKey=ye,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),oe.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),j(oe,this.grid,this.gridSelection)))})}setAnchorCellForSelection(A){this.isHighlightingCells=!1,this.anchorCell=A,this.anchorX=A.x,this.anchorY=A.y,this.editor.update(()=>{var F=e.$getNearestNodeFromDOMNode(A.elem);w(F)&&(F=F.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=F)})}formatCells(A){this.editor.update(()=>{let F=e.$getSelection();l(F)||n(11);let oe=e.$createRangeSelection(),ye=oe.anchor,De=oe.focus;F.getNodes().forEach(ee=>{w(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),De.set(ee.getKey(),ee.getChildrenSize(),"element"),oe.formatText(A))}),e.$setSelection(F),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let A=this.editor;A.update(()=>{let F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");var oe=e.$getSelection();l(oe)||n(11),oe=oe.getNodes().filter(w),oe.length===this.grid.columns*this.grid.rows?(F.selectPrevious(),F.remove(),e.$getRoot().selectStart()):(oe.forEach(ye=>{if(e.$isElementNode(ye)){let De=e.$createParagraphNode(),ee=e.$createTextNode();De.append(ee),ye.append(De),ye.getChildren().forEach(ne=>{ne!==De&&ne.remove()})}}),j(A,this.grid,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function P(B){for(;B!=null;){let A=B.nodeName;if(A==="TD"||A==="TH"){if(B=B._cell,B===void 0)break;return B}B=B.parentNode}return null}function H(B){let A=[],F={cells:A,columns:0,rows:0};var oe=B.firstChild;let ye=B=0;for(A.length=0;oe!=null;){var De=oe.nodeName;if(De==="TD"||De==="TH"){De=oe,De={elem:De,hasBackgroundColor:De.style.backgroundColor!=="",highlighted:!1,x:B,y:ye},oe._cell=De;let ee=A[ye];ee===void 0&&(ee=A[ye]=[]),ee[B]=De}else if(De=oe.firstChild,De!=null){oe=De;continue}if(De=oe.nextSibling,De!=null)B++,oe=De;else if(De=oe.parentNode,De!=null){if(oe=De.nextSibling,oe==null)break;ye++,B=0}}return F.columns=B+1,F.rows=ye+1,F}function j(B,A,F){let oe=new Set(F?F.getNodes():[]);re(A,(ye,De)=>{let ee=ye.elem;oe.has(De)?(ye.highlighted=!0,Te(B,ye)):(ye.highlighted=!1,Se(B,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function re(B,A){({cells:B}=B);for(let F=0;F<B.length;F++){let oe=B[F];if(oe)for(let ye=0;ye<oe.length;ye++){let De=oe[ye];if(!De)continue;let ee=e.$getNearestNodeFromDOMNode(De.elem);ee!==null&&A(De,ee,{x:ye,y:F})}}}function te(B,A){A.disableHighlightStyle(),re(A.grid,F=>{F.highlighted=!0,Te(B,F)})}function ce(B,A){A.enableHighlightStyle(),re(A.grid,F=>{let oe=F.elem;F.highlighted=!1,Se(B,F),oe.getAttribute("style")||oe.removeAttribute("style")})}let V=(B,A,F,oe,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)?(B=A.getCellNodeFromCordsOrThrow(F+(De?1:-1),oe,B.grid),De?B.selectStart():B.selectEnd()):oe!==(De?B.grid.rows-1:0)?(B=A.getCellNodeFromCordsOrThrow(De?0:B.grid.columns-1,oe+(De?1:-1),B.grid),De?B.selectStart():B.selectEnd()):De?A.selectNext():A.selectPrevious(),!0;case"up":return oe!==0?A.getCellNodeFromCordsOrThrow(F,oe-1,B.grid).selectEnd():A.selectPrevious(),!0;case"down":return oe!==B.grid.rows-1?A.getCellNodeFromCordsOrThrow(F,oe+1,B.grid).selectStart():A.selectNext(),!0;default:return!1}},z=(B,A,F,oe,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)&&B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F+(De?1:-1),oe,B.grid)),!0;case"up":return oe!==0?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,oe-1,B.grid)),!0):!1;case"down":return oe!==B.grid.rows-1?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,oe+1,B.grid)),!0):!1;default:return!1}};function q(B,A){if(e.$isRangeSelection(B)||l(B)){let F=A.isParentOf(B.anchor.getNode());return B=A.isParentOf(B.focus.getNode()),F&&B}return!1}function Te(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null?B.style.setProperty("background-color","rgb(172,206,247)"):B.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),B.style.setProperty("caret-color","transparent")}function Se(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null&&B.style.removeProperty("background-color"),B.style.removeProperty("background-image"),B.style.removeProperty("caret-color")}function Ee(B){return B=t.$findMatchingParent(B,w),w(B)?B:null}function de(B){return B=t.$findMatchingParent(B,W),W(B)?B:null}function K(B,A,F,oe,ye){let De=e.$getSelection();if(!q(De,oe))return!1;if(e.$isRangeSelection(De)&&De.isCollapsed()){if(F==="backward"||F==="forward")return!1;let{anchor:be,focus:Ne}=De;var ee=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w);if(!w(ee)||!ee.is(ne))return!1;if(ne=de(ee),ne!==oe&&ne!=null){var ue=B.getElementByKey(ne.getKey());if(ue!=null)return ye.grid=H(ue),K(B,A,F,ne,ye)}if(ne=B.getElementByKey(ee.__key),ue=B.getElementByKey(be.key),ue==null||ne==null)return!1;if(be.type==="element")ne=ue.getBoundingClientRect();else{if(ne=window.getSelection(),ne===null||ne.rangeCount===0)return!1;ne=ne.getRangeAt(0).getBoundingClientRect()}if(ue=F==="up"?ee.getFirstChild():ee.getLastChild(),ue==null||(B=B.getElementByKey(ue.__key),B==null))return!1;if(B=B.getBoundingClientRect(),F==="up"?B.top>ne.top-ne.height:ne.bottom+ne.height>B.bottom){if(O(A),B=oe.getCordsFromCellNode(ee,ye.grid),A.shiftKey)F=oe.getCellFromCordsOrThrow(B.x,B.y,ye.grid),ye.setAnchorCellForSelection(F),ye.setFocusCellForSelection(F,!0);else return V(ye,oe,B.x,B.y,F);return!0}}else if(l(De)){let{anchor:be,focus:Ne}=De;return ue=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w),[ee]=De.getNodes(),B=B.getElementByKey(ee.getKey()),!w(ue)||!w(ne)||!W(ee)||B==null?!1:(ye.updateTableGridSelection(De),B=H(B),ue=oe.getCordsFromCellNode(ue,B),ue=oe.getCellFromCordsOrThrow(ue.x,ue.y,B),ye.setAnchorCellForSelection(ue),O(A),A.shiftKey?(A=oe.getCordsFromCellNode(ne,B),z(ye,ee,A.x,A.y,F)):(ne.selectEnd(),!0))}return!1}function O(B){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation()}class Z extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(A){return new Z(A.__key)}static importDOM(){return{table:()=>({conversion:se,priority:1})}}static importJSON(){return Y()}constructor(A){super(A)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(A){let F=document.createElement("table");return t.addClassNamesToElement(F,A.theme.table),F}updateDOM(){return!1}exportDOM(A){return{...super.exportDOM(A),after:F=>{if(F){let oe=F.cloneNode(),ye=document.createElement("colgroup"),De=document.createElement("tbody");if(t.isHTMLElement(F)&&De.append(...F.children),F=this.getFirstChildOrThrow(),!k(F))throw Error("Expected to find row node.");F=F.getChildrenSize();for(let ee=0;ee<F;ee++){let ne=document.createElement("col");ye.append(ne)}return oe.replaceChildren(ye,De),oe}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(A,F){let{rows:oe,cells:ye}=F;for(F=0;F<oe;F++){var De=ye[F];if(De!=null&&(De=De.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===A}),De!==-1))return{x:De,y:F}}throw Error("Cell not found in table.")}getCellFromCords(A,F,oe){return{cells:oe}=oe,F=oe[F],F==null?null:(A=F[A],A??null)}getCellFromCordsOrThrow(A,F,oe){if(A=this.getCellFromCords(A,F,oe),!A)throw Error("Cell not found at cords.");return A}getCellNodeFromCords(A,F,oe){return A=this.getCellFromCords(A,F,oe),A==null?null:(A=e.$getNearestNodeFromDOMNode(A.elem),w(A)?A:null)}getCellNodeFromCordsOrThrow(A,F,oe){if(A=this.getCellNodeFromCords(A,F,oe),!A)throw Error("Node at cords not TableCellNode.");return A}canSelectBefore(){return!0}canIndent(){return!1}}function se(){return{node:Y()}}function Y(){return e.$applyNodeReplacement(new Z)}function W(B){return B instanceof Z}function J(B){if(B=t.$findMatchingParent(B,A=>k(A)),k(B))return B;throw Error("Expected table cell to be inside of table row.")}function R(B){if(B=t.$findMatchingParent(B,A=>W(A)),W(B))return B;throw Error("Expected table cell to be inside of table.")}function U(B,A){let F=R(B),{x:oe,y:ye}=F.getCordsFromCellNode(B,A);return{above:F.getCellNodeFromCords(oe,ye-1,A),below:F.getCellNodeFromCords(oe,ye+1,A),left:F.getCellNodeFromCords(oe-1,ye,A),right:F.getCellNodeFromCords(oe+1,ye,A)}}function X(B){let A=B.getFirstDescendant();A==null?B.selectStart():A.getParentOrThrow().selectStart()}function fe(B,A){let F=B.getFirstChild();F!==null?F.insertBefore(A):B.append(A)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=d,Jt.$createTableCellNode=S,Jt.$createTableNode=Y,Jt.$createTableNodeWithDimensions=function(B,A,F=!0){let oe=Y();for(let De=0;De<B;De++){let ee=v();for(let ne=0;ne<A;ne++){var ye=_.NO_STATUS;typeof F=="object"?(De===0&&F.rows&&(ye|=_.ROW),ne===0&&F.columns&&(ye|=_.COLUMN)):F&&(De===0&&(ye|=_.ROW),ne===0&&(ye|=_.COLUMN)),ye=S(ye);let ue=e.$createParagraphNode();ue.append(e.$createTextNode()),ye.append(ue),ee.append(ye)}oe.append(ee)}return oe},Jt.$createTableRowNode=v,Jt.$deleteTableColumn=function(B,A){let F=B.getChildren();for(let ye=0;ye<F.length;ye++){var oe=F[ye];if(k(oe)){if(oe=oe.getChildren(),A>=oe.length||0>A)throw Error("Table column target index out of range");oe[A].remove()}}return B},Jt.$deleteTableColumn__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,oe]=e.DEPRECATED_$getNodeTriplet(A);[A]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(oe,F,A);var{startColumn:ne}=De;let{startRow:ue,startColumn:be}=ee;B=Math.min(ne,be),ne=Math.max(ne+F.__colSpan-1,be+A.__colSpan-1);let Ne=ne-B+1;if(ye[0].length===ne-B+1)oe.selectPrevious(),oe.remove();else{var Re=ye.length;for(let ke=0;ke<Re;ke++)for(let Fe=B;Fe<=ne;Fe++){let{cell:qe,startColumn:Be}=ye[ke][Fe];Be<B?Fe===B&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(B-Be))):Be+qe.__colSpan-1>ne?Fe===ne&&qe.setColSpan(qe.__colSpan-(ne-Be+1)):qe.remove()}B=ye[ue],A=B[be+A.__colSpan],A!==void 0?({cell:A}=A,X(A)):({cell:A}=B[be-1],X(A))}},Jt.$deleteTableRow__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,oe]=e.DEPRECATED_$getNodeTriplet(A);[B]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(oe,F,B);({startRow:A}=De);var{startRow:ne}=ee;if(B=ne+B.__rowSpan-1,ye.length===B-A+1)oe.remove();else{ne=ye[0].length;var ue=ye[B+1],be=oe.getChildAtIndex(B+1);for(let Re=B;Re>=A;Re--){for(var Ne=ne-1;0<=Ne;Ne--){let{cell:ke,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===A&&Fe<A&&ke.setRowSpan(ke.__rowSpan-(Fe-A)),Fe>=A&&Fe+ke.__rowSpan-1>B))if(ke.setRowSpan(ke.__rowSpan-(B-Fe+1)),be===null&&n(122),Ne===0)fe(be,ke);else{let{cell:Be}=ue[Ne-1];Be.insertAfter(ke)}}Ne=oe.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ue!==void 0?({cell:A}=ue[0],X(A)):({cell:A}=ye[A-1][0],X(A))}},Jt.$getElementGridForTableNode=function(B,A){if(B=B.getElementByKey(A.getKey()),B==null)throw Error("Table Element Not Found");return H(B)},Jt.$getTableCellNodeFromLexicalNode=function(B){return B=t.$findMatchingParent(B,A=>w(A)),w(B)?B:null},Jt.$getTableColumnIndexFromTableCellNode=function(B){return J(B).getChildren().findIndex(A=>A.is(B))},Jt.$getTableNodeFromLexicalNodeOrThrow=R,Jt.$getTableRowIndexFromTableCellNode=function(B){let A=J(B);return R(A).getChildren().findIndex(F=>F.is(A))},Jt.$getTableRowNodeFromTableCellNodeOrThrow=J,Jt.$insertTableColumn=function(B,A,F=!0,oe,ye){let De=B.getChildren(),ee=[];for(let be=0;be<De.length;be++){let Ne=De[be];if(k(Ne))for(let Re=0;Re<oe;Re++){var ne=Ne.getChildren();if(A>=ne.length||0>A)throw Error("Table column target index out of range");ne=ne[A],w(ne)||n(12);let{left:ke,right:Fe}=U(ne,ye);var ue=_.NO_STATUS;(ke&&ke.hasHeaderState(_.ROW)||Fe&&Fe.hasHeaderState(_.ROW))&&(ue|=_.ROW),ue=S(ue),ue.append(e.$createParagraphNode()),ee.push({newTableCell:ue,targetCell:ne})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{F?Ne.insertAfter(be):Ne.insertBefore(be)}),B},Jt.$insertTableColumn__EXPERIMENTAL=function(B=!0){function A(){let Re=S(_.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var F=e.$getSelection();if(!e.$INTERNAL_isPointSelection(F))throw Error("Expected a PointSeleciton");var oe=F.anchor.getNode();F=F.focus.getNode(),[oe]=e.DEPRECATED_$getNodeTriplet(oe);let[ye,,De]=e.DEPRECATED_$getNodeTriplet(F),[ee,ne,ue]=e.DEPRECATED_$computeGridMap(De,ye,oe);oe=ee.length,F=B?Math.max(ne.startColumn,ue.startColumn):Math.min(ne.startColumn,ue.startColumn),B=B?F+ye.__colSpan-1:F-1,F=De.getFirstChild(),e.DEPRECATED_$isGridRowNode(F)||n(120);let be=null;var Ne=F;e:for(F=0;F<oe;F++){F!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[F];if(0>B){fe(Ne,A());continue}let{cell:ke,startColumn:Fe,startRow:qe}=Re[B];if(Fe+ke.__colSpan-1<=B){let Be=ke,ct=qe,Mt=B;for(;ct!==F&&1<Be.__rowSpan;)if(Mt-=ke.__colSpan,0<=Mt){let{cell:zt,startRow:Vt}=Re[Mt];Be=zt,ct=Vt}else{Ne.append(A());continue e}Be.insertAfter(A())}else ke.setColSpan(ke.__colSpan+1)}be!==null&&X(be)},Jt.$insertTableRow=function(B,A,F=!0,oe,ye){var De=B.getChildren();if(A>=De.length||0>A)throw Error("Table row target index out of range");if(A=De[A],k(A))for(De=0;De<oe;De++){let ne=A.getChildren(),ue=ne.length,be=v();for(let Ne=0;Ne<ue;Ne++){var ee=ne[Ne];w(ee)||n(12);let{above:Re,below:ke}=U(ee,ye);ee=_.NO_STATUS;let Fe=Re&&Re.getWidth()||ke&&ke.getWidth()||void 0;(Re&&Re.hasHeaderState(_.COLUMN)||ke&&ke.hasHeaderState(_.COLUMN))&&(ee|=_.COLUMN),ee=S(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}F?A.insertAfter(be):A.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return B},Jt.$insertTableRow__EXPERIMENTAL=function(B=!0){var A=e.$getSelection();if(!e.$INTERNAL_isPointSelection(A))throw Error("Expected a INTERNAL_PointSelection");A=A.focus.getNode();let[F,,oe]=e.DEPRECATED_$getNodeTriplet(A),[ye,De]=e.DEPRECATED_$computeGridMap(oe,F,F);A=ye[0].length;var{startRow:ee}=De;if(B){B=ee+F.__rowSpan-1;var ne=ye[B];ee=v();for(var ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne+be.__rowSpan-1<=B?ee.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=oe.getChildAtIndex(B),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertAfter(ee)}else{for(ne=ye[ee],B=v(),ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne===ee?B.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=oe.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertBefore(B)}},Jt.$isGridSelection=l,Jt.$isTableCellNode=w,Jt.$isTableNode=W,Jt.$isTableRowNode=k,Jt.$removeTableRowAtIndex=function(B,A){let F=B.getChildren();if(A>=F.length||0>A)throw Error("Expected table cell to be inside of table row.");return F[A].remove(),B},Jt.$unmergeCell=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");B=B.anchor.getNode();let[A,F,oe]=e.DEPRECATED_$getNodeTriplet(B);B=A.__colSpan;let ye=A.__rowSpan;if(1<B){for(var De=1;De<B;De++)A.insertAfter(S(_.NO_STATUS));A.setColSpan(1)}if(1<ye){let[ue,be]=e.DEPRECATED_$computeGridMap(oe,A,A),{startColumn:Ne,startRow:Re}=be,ke;for(De=1;De<ye;De++){var ee=Re+De;let Fe=ue[ee];ke=(ke||F).getNextSibling(),e.DEPRECATED_$isGridRowNode(ke)||n(125);var ne=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ct=Be.cell;Be.startRow===ee&&(ne=ct),1<ct.__colSpan&&(qe+=ct.__colSpan-1)}if(ne===null)for(ne=0;ne<B;ne++)fe(ke,S(_.NO_STATUS));else for(ee=0;ee<B;ee++)ne.insertAfter(S(_.NO_STATUS))}A.setRowSpan(1)}},Jt.INSERT_TABLE_COMMAND=_e,Jt.TableCellHeaderStates=_,Jt.TableCellNode=T,Jt.TableNode=Z,Jt.TableRowNode=M,Jt.TableSelection=I,Jt.applyTableHandlers=function(B,A,F,oe){function ye(Ne){return Ne=B.getCordsFromCellNode(Ne,ee.grid),B.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let De=F.getRootElement();if(De===null)throw Error("No root element.");let ee=new I(F,B.getKey()),ne=F._window||window;A.__lexicalTableSelection=ee,A.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&ne){var Re=P(Ne.target);Re!==null&&(O(Ne),ee.setAnchorCellForSelection(Re));var ke=()=>{ne.removeEventListener("mouseup",ke),ne.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=P(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};ne.addEventListener("mouseup",ke),ne.addEventListener("mousemove",Fe)}},0)});let ue=Ne=>{Ne.button===0&&F.update(()=>{const Re=e.$getSelection(),ke=Ne.target;l(Re)&&Re.gridKey===ee.tableNodeKey&&De.contains(ke)&&ee.clearHighlight()})};ne.addEventListener("mousedown",ue),ee.listenersToRemove.add(()=>ne.removeEventListener("mousedown",ue)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>K(F,Ne,"down",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>K(F,Ne,"up",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>K(F,Ne,"backward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>K(F,Ne,"forward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return l(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),w),w(Re))?(O(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!q(Re,B))return!1;if(l(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>w(Be));if(!w(qe))return!1;var ke=Re.anchor.getNode(),Fe=Re.focus.getNode();if(ke=B.isParentOf(ke),Fe=B.isParentOf(Fe),ke&&!Fe||Fe&&!ke)return ee.clearText(),!0;if(ke=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&w(Be.getParent())),!e.$isElementNode(ke)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&ke.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==ke){Re=Fe.getChildren();const Be=e.$createParagraphNode();return Re.forEach(ct=>Be.append(ct)),Fe.replace(Be),Fe.getWritable().__parent=qe.getKey(),!0}}return!1};return[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ne=>{ee.listenersToRemove.add(F.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),A=Ne=>{const Re=e.$getSelection();return q(Re,B)?l(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},ee.listenersToRemove.add(F.registerCommand(e.KEY_BACKSPACE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.KEY_DELETE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return q(Re,B)?l(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return q(Ne,B)&&(l(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>w(Re)),w(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),oe&&ee.listenersToRemove.add(F.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!q(Re,B)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(O(Ne),Re=B.getCordsFromCellNode(Re,ee.grid),V(ee,B,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FOCUS_COMMAND,()=>B.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:ke}=Ne;Ne=e.$INTERNAL_isPointSelection(ke);var Fe=e.$isRangeSelection(ke);if(Ne=Fe&&t.$findMatchingParent(ke.anchor.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null&&t.$findMatchingParent(ke.focus.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=ke,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ct=t.$findMatchingParent(qe.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le)),Mt=(qe=ct&&t.$findMatchingParent(ct,Le=>e.DEPRECATED_$isGridRowNode(Le)))&&t.$findMatchingParent(qe,Le=>e.DEPRECATED_$isGridNode(Le));if(!e.DEPRECATED_$isGridCellNode(ct)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(Mt))return!1;var zt=qe.getIndexWithinParent(),Vt=Math.min(Mt.getChildrenSize()-1,zt+Be-1);Be=ct.getIndexWithinParent(),ct=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ct),qe=Math.min(zt,Vt),Be=Math.max(Be,ct),zt=Math.max(zt,Vt),Mt=Mt.getChildren(),Vt=0;let Oe,ie;for(ct=qe;ct<=zt;ct++){var le=Mt[ct];if(!e.DEPRECATED_$isGridRowNode(le))return!1;var ve=Ne[Vt];if(!e.DEPRECATED_$isGridRowNode(ve))return!1;le=le.getChildren(),ve=ve.getChildren();let Le=0;for(let Me=Fe;Me<=Be;Me++){let je=le[Me];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let it=ve[Le];if(!e.DEPRECATED_$isGridCellNode(it))return!1;ct===qe&&Me===Fe?Oe=je.getKey():ct===zt&&Me===Be&&(ie=je.getKey());let ot=je.getChildren();it.getChildren().forEach(st=>{e.$isTextNode(st)&&e.$createParagraphNode().append(st),je.append(st)}),ot.forEach(st=>st.remove()),Le++}Vt++}return Oe&&ie&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ie),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ct,focus:Mt}=Ne;var ke=ct.getNode(),Fe=Mt.getNode();ke=Ee(ke),Fe=Ee(Fe);var qe=ke&&B.is(de(ke)),Be=Fe&&B.is(de(Fe));let zt=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),zt?(ke=Ne.clone(),ke.focus.set(B.getKey(),qe?0:B.getChildrenSize(),"element"),e.$setSelection(ke),te(F,ee)):Be&&!ke.is(Fe)&&(ee.setAnchorCellForSelection(ye(ke)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(l(Ne)||l(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(l(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!l(Ne)&&l(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!B.isSelected()?ce(F,ee):!ee.hasHijackedSelectionStyles&&B.isSelected()&&te(F,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Jt.getCellFromTarget=P,Jt.getTableSelectionFromTableElement=function(B){return B.__lexicalTableSelection},Jt}var vu,xh;function Nd(){return xh||(xh=1,vu=process.env.NODE_ENV==="development"?$C():FC()),vu}var vh;function BC(){if(vh)return xu;vh=1;var e=Zn(),t=Nd(),n=gn(),r=Gt(),l=rt;function d({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){const[T]=e.useLexicalComposerContext();return l.useEffect(()=>{if(!T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>{const M=t.$createTableNodeWithDimensions(Number(S),Number(E),w);n.$insertNodeToNearestRoot(M);const m=M.getFirstDescendant();return r.$isTextNode(m)&&m.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[T]),l.useEffect(()=>{const E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);if(v&&!E.has(m)){const k=t.applyTableHandlers(M,v,T,_);E.set(m,k)}};T.getEditorState().read(()=>{const M=r.$nodesOfType(t.TableNode);for(const m of M)t.$isTableNode(m)&&S(m)});const w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)if(v==="created")T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)});else if(v==="destroyed"){const k=E.get(m);k!==void 0&&(k.removeListeners(),E.delete(m))}});return()=>{w();for(const[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(E.getColSpan()>1||E.getRowSpan()>1){const[,,S]=r.DEPRECATED_$getNodeTriplet(E),[w]=r.DEPRECATED_$computeGridMap(S,E,E),M=w.length,m=w[0].length;let v=S.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(v))throw Error("Expected TableNode first child to be a RowNode");const k=[];for(let G=0;G<M;G++){if(G!==0&&(v=v.getNextSibling(),!r.DEPRECATED_$isGridRowNode(v)))throw Error("Expected TableNode first child to be a RowNode");let I=null;for(let P=0;P<m;P++){const H=w[G][P],j=H.cell;if(H.startRow===G&&H.startColumn===P)I=j,k.push(j);else if(j.getColSpan()>1||j.getRowSpan()>1){if(!t.$isTableCellNode(j))throw Error("Expected TableNode cell to be a TableCellNode");const re=t.$createTableCellNode(j.__headerState);I!==null?I.insertAfter(re):n.$insertFirst(v,re)}}}for(const G of k)G.setColSpan(1),G.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null}return xu.TablePlugin=d,xu}var Su={},Sh;function HC(){if(Sh)return Su;Sh=1;var e=Zn(),t=Nd(),n=gn(),r=Gt(),l=rt;function d(f){let p=new URLSearchParams;p.append("code",f);for(let _=1;_<arguments.length;_++)p.append("v",arguments[_]);throw Error(`Minified Lexical error #${f}; 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:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){let[T]=e.useLexicalComposerContext();return l.useEffect(()=>(T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode])||d(10),T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>(E=t.$createTableNodeWithDimensions(Number(S),Number(E),w),n.$insertNodeToNearestRoot(E),E=E.getFirstDescendant(),r.$isTextNode(E)&&E.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[T]),l.useEffect(()=>{let E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);v&&!E.has(m)&&(M=t.applyTableHandlers(M,v,T,_),E.set(m,M))};T.getEditorState().read(()=>{let M=r.$nodesOfType(t.TableNode);for(let m of M)t.$isTableNode(m)&&S(m)});let w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)v==="created"?T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)}):v==="destroyed"&&(M=E.get(m),M!==void 0&&(M.removeListeners(),E.delete(m)))});return()=>{w();for(let[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(1<E.getColSpan()||1<E.getRowSpan()){var[,,S]=r.DEPRECATED_$getNodeTriplet(E);[E]=r.DEPRECATED_$computeGridMap(S,E,E);let M=E.length,m=E[0].length;if(S=S.getFirstChild(),!r.DEPRECATED_$isGridRowNode(S))throw Error("Expected TableNode first child to be a RowNode");let v=[];for(let k=0;k<M;k++){if(k!==0&&(S=S.getNextSibling(),!r.DEPRECATED_$isGridRowNode(S)))throw Error("Expected TableNode first child to be a RowNode");let G=null;for(let I=0;I<m;I++){var w=E[k][I];let P=w.cell;if(w.startRow===k&&w.startColumn===I)G=P,v.push(P);else if(1<P.getColSpan()||1<P.getRowSpan()){if(!t.$isTableCellNode(P))throw Error("Expected TableNode cell to be a TableCellNode");w=t.$createTableCellNode(P.__headerState),G!==null?G.insertAfter(w):n.$insertFirst(S,w)}}}for(let k of v)k.setColSpan(1),k.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null},Su}const WC=process.env.NODE_ENV==="development"?BC():HC();var KC=WC,$n={},wu={exports:{}},wh;function wp(){return wh||(wh=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
81
+ * Prism: Lightweight, robust, elegant syntax highlighting
82
+ *
83
+ * @license MIT <https://opensource.org/licenses/MIT>
84
+ * @author Lea Verou <https://lea.verou.me>
85
+ * @namespace
86
+ * @public
87
+ */var n=function(r){var l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,f={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function I(P){return P instanceof _?new _(P.type,I(P.content),P.alias):Array.isArray(P)?P.map(I):P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(I){return Object.prototype.toString.call(I).slice(8,-1)},objId:function(I){return I.__id||Object.defineProperty(I,"__id",{value:++d}),I.__id},clone:function I(P,H){H=H||{};var j,re;switch(p.util.type(P)){case"Object":if(re=p.util.objId(P),H[re])return H[re];j={},H[re]=j;for(var te in P)P.hasOwnProperty(te)&&(j[te]=I(P[te],H));return j;case"Array":return re=p.util.objId(P),H[re]?H[re]:(j=[],H[re]=j,P.forEach(function(ce,V){j[V]=I(ce,H)}),j);default:return P}},getLanguage:function(I){for(;I;){var P=l.exec(I.className);if(P)return P[1].toLowerCase();I=I.parentElement}return"none"},setLanguage:function(I,P){I.className=I.className.replace(RegExp(l,"gi"),""),I.classList.add("language-"+P)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(j){var I=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(j.stack)||[])[1];if(I){var P=document.getElementsByTagName("script");for(var H in P)if(P[H].src==I)return P[H]}return null}},isActive:function(I,P,H){for(var j="no-"+P;I;){var re=I.classList;if(re.contains(P))return!0;if(re.contains(j))return!1;I=I.parentElement}return!!H}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(I,P){var H=p.util.clone(p.languages[I]);for(var j in P)H[j]=P[j];return H},insertBefore:function(I,P,H,j){j=j||p.languages;var re=j[I],te={};for(var ce in re)if(re.hasOwnProperty(ce)){if(ce==P)for(var V in H)H.hasOwnProperty(V)&&(te[V]=H[V]);H.hasOwnProperty(ce)||(te[ce]=re[ce])}var z=j[I];return j[I]=te,p.languages.DFS(p.languages,function(q,Te){Te===z&&q!=I&&(this[q]=te)}),te},DFS:function I(P,H,j,re){re=re||{};var te=p.util.objId;for(var ce in P)if(P.hasOwnProperty(ce)){H.call(P,ce,P[ce],j||ce);var V=P[ce],z=p.util.type(V);z==="Object"&&!re[te(V)]?(re[te(V)]=!0,I(V,H,null,re)):z==="Array"&&!re[te(V)]&&(re[te(V)]=!0,I(V,H,ce,re))}}},plugins:{},highlightAll:function(I,P){p.highlightAllUnder(document,I,P)},highlightAllUnder:function(I,P,H){var j={callback:H,container:I,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",j),j.elements=Array.prototype.slice.apply(j.container.querySelectorAll(j.selector)),p.hooks.run("before-all-elements-highlight",j);for(var re=0,te;te=j.elements[re++];)p.highlightElement(te,P===!0,j.callback)},highlightElement:function(I,P,H){var j=p.util.getLanguage(I),re=p.languages[j];p.util.setLanguage(I,j);var te=I.parentElement;te&&te.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(te,j);var ce=I.textContent,V={element:I,language:j,grammar:re,code:ce};function z(Te){V.highlightedCode=Te,p.hooks.run("before-insert",V),V.element.innerHTML=V.highlightedCode,p.hooks.run("after-highlight",V),p.hooks.run("complete",V),H&&H.call(V.element)}if(p.hooks.run("before-sanity-check",V),te=V.element.parentElement,te&&te.nodeName.toLowerCase()==="pre"&&!te.hasAttribute("tabindex")&&te.setAttribute("tabindex","0"),!V.code){p.hooks.run("complete",V),H&&H.call(V.element);return}if(p.hooks.run("before-highlight",V),!V.grammar){z(p.util.encode(V.code));return}if(P&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(Te){z(Te.data)},q.postMessage(JSON.stringify({language:V.language,code:V.code,immediateClose:!0}))}else z(p.highlight(V.code,V.grammar,V.language))},highlight:function(I,P,H){var j={code:I,grammar:P,language:H};if(p.hooks.run("before-tokenize",j),!j.grammar)throw new Error('The language "'+j.language+'" has no grammar.');return j.tokens=p.tokenize(j.code,j.grammar),p.hooks.run("after-tokenize",j),_.stringify(p.util.encode(j.tokens),j.language)},tokenize:function(I,P){var H=P.rest;if(H){for(var j in H)P[j]=H[j];delete P.rest}var re=new S;return w(re,re.head,I),E(I,re,P,re.head,0),m(re)},hooks:{all:{},add:function(I,P){var H=p.hooks.all;H[I]=H[I]||[],H[I].push(P)},run:function(I,P){var H=p.hooks.all[I];if(!(!H||!H.length))for(var j=0,re;re=H[j++];)re(P)}},Token:_};r.Prism=p;function _(I,P,H,j){this.type=I,this.content=P,this.alias=H,this.length=(j||"").length|0}_.stringify=function I(P,H){if(typeof P=="string")return P;if(Array.isArray(P)){var j="";return P.forEach(function(z){j+=I(z,H)}),j}var re={type:P.type,content:I(P.content,H),tag:"span",classes:["token",P.type],attributes:{},language:H},te=P.alias;te&&(Array.isArray(te)?Array.prototype.push.apply(re.classes,te):re.classes.push(te)),p.hooks.run("wrap",re);var ce="";for(var V in re.attributes)ce+=" "+V+'="'+(re.attributes[V]||"").replace(/"/g,"&quot;")+'"';return"<"+re.tag+' class="'+re.classes.join(" ")+'"'+ce+">"+re.content+"</"+re.tag+">"};function T(I,P,H,j){I.lastIndex=P;var re=I.exec(H);if(re&&j&&re[1]){var te=re[1].length;re.index+=te,re[0]=re[0].slice(te)}return re}function E(I,P,H,j,re,te){for(var ce in H)if(!(!H.hasOwnProperty(ce)||!H[ce])){var V=H[ce];V=Array.isArray(V)?V:[V];for(var z=0;z<V.length;++z){if(te&&te.cause==ce+","+z)return;var q=V[z],Te=q.inside,Se=!!q.lookbehind,Ee=!!q.greedy,de=q.alias;if(Ee&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var O=q.pattern||q,Z=j.next,se=re;Z!==P.tail&&!(te&&se>=te.reach);se+=Z.value.length,Z=Z.next){var Y=Z.value;if(P.length>I.length)return;if(!(Y instanceof _)){var W=1,J;if(Ee){if(J=T(O,se,I,Se),!J||J.index>=I.length)break;var fe=J.index,R=J.index+J[0].length,U=se;for(U+=Z.value.length;fe>=U;)Z=Z.next,U+=Z.value.length;if(U-=Z.value.length,se=U,Z.value instanceof _)continue;for(var X=Z;X!==P.tail&&(U<R||typeof X.value=="string");X=X.next)W++,U+=X.value.length;W--,Y=I.slice(se,U),J.index-=se}else if(J=T(O,0,Y,Se),!J)continue;var fe=J.index,_e=J[0],B=Y.slice(0,fe),A=Y.slice(fe+_e.length),F=se+Y.length;te&&F>te.reach&&(te.reach=F);var oe=Z.prev;B&&(oe=w(P,oe,B),se+=B.length),M(P,oe,W);var ye=new _(ce,Te?p.tokenize(_e,Te):_e,de,_e);if(Z=w(P,oe,ye),A&&w(P,Z,A),W>1){var De={cause:ce+","+z,reach:F};E(I,P,H,Z.prev,se,De),te&&De.reach>te.reach&&(te.reach=De.reach)}}}}}}function S(){var I={value:null,prev:null,next:null},P={value:null,prev:I,next:null};I.next=P,this.head=I,this.tail=P,this.length=0}function w(I,P,H){var j=P.next,re={value:H,prev:P,next:j};return P.next=re,j.prev=re,I.length++,re}function M(I,P,H){for(var j=P.next,re=0;re<H&&j!==I.tail;re++)j=j.next;P.next=j,j.prev=P,I.length-=re}function m(I){for(var P=[],H=I.head.next;H!==I.tail;)P.push(H.value),H=H.next;return P}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(I){var P=JSON.parse(I.data),H=P.language,j=P.code,re=P.immediateClose;r.postMessage(p.highlight(j,p.languages[H],H)),re&&r.close()},!1)),p;var v=p.util.currentScript();v&&(p.filename=v.src,v.hasAttribute("data-manual")&&(p.manual=!0));function k(){p.manual||p.highlightAll()}if(!p.manual){var G=document.readyState;G==="loading"||G==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",k):window.requestAnimationFrame?window.requestAnimationFrame(k):window.setTimeout(k,16)}return p}(t);e.exports&&(e.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(l,d){var f={};f["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},f.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:f}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var _={};_[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",_)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,l){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:[l,"language-"+l],inside:n.languages[l]},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 l=/(?:"(?:\\(?:\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+"|"+l.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\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,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…",l=function(v,k){return"✖ Error "+v+" while fetching file: "+k},d="✖ Error: File does not exist or is empty",f={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",_="loading",T="loaded",E="failed",S="pre[data-src]:not(["+p+'="'+T+'"]):not(['+p+'="'+_+'"])';function w(v,k,G){var I=new XMLHttpRequest;I.open("GET",v,!0),I.onreadystatechange=function(){I.readyState==4&&(I.status<400&&I.responseText?k(I.responseText):I.status>=400?G(l(I.status,I.statusText)):G(d))},I.send(null)}function M(v){var k=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(k){var G=Number(k[1]),I=k[2],P=k[3];return I?P?[G,Number(P)]:[G,void 0]:[G,G]}}n.hooks.add("before-highlightall",function(v){v.selector+=", "+S}),n.hooks.add("before-sanity-check",function(v){var k=v.element;if(k.matches(S)){v.code="",k.setAttribute(p,_);var G=k.appendChild(document.createElement("CODE"));G.textContent=r;var I=k.getAttribute("data-src"),P=v.language;if(P==="none"){var H=(/\.(\w+)$/.exec(I)||[,"none"])[1];P=f[H]||H}n.util.setLanguage(G,P),n.util.setLanguage(k,P);var j=n.plugins.autoloader;j&&j.loadLanguages(P),w(I,function(re){k.setAttribute(p,T);var te=M(k.getAttribute("data-range"));if(te){var ce=re.split(/\r\n?|\n/g),V=te[0],z=te[1]==null?ce.length:te[1];V<0&&(V+=ce.length),V=Math.max(0,Math.min(V-1,ce.length)),z<0&&(z+=ce.length),z=Math.max(0,Math.min(z,ce.length)),re=ce.slice(V,z).join(`
88
+ `),k.hasAttribute("data-start")||k.setAttribute("data-start",String(V+1))}G.textContent=re,n.highlightElement(G)},function(re){k.setAttribute(p,E),G.textContent=re})}}),n.plugins.fileHighlight={highlight:function(k){for(var G=(k||document).querySelectorAll(S),I=0,P;P=G[I++];)n.highlightElement(P)}};var m=!1;n.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(wu)),wu.exports}var Oh={},Dh;function Op(){return Dh||(Dh=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:/[{}[\];(),.:]/}),Oh}var Ah={},Mh;function Dp(){return Mh||(Mh=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),Ah}var Rh={},bh;function Ap(){return bh||(bh=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(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};l["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var d={};d[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:l},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\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:[t,"language-"+t],inside:Prism.languages[t]},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),Rh}var Lh={},Ih;function Mp(){return Ih||(Ih=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(E){return E=E.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+E+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.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:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+d+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+d+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.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(E){["url","bold","italic","strike","code-snippet"].forEach(function(S){E!==S&&(e.languages.markdown[E].inside.content.inside[S]=e.languages.markdown[S])})}),e.hooks.add("after-tokenize",function(E){if(E.language!=="markdown"&&E.language!=="md")return;function S(w){if(!(!w||typeof w=="string"))for(var M=0,m=w.length;M<m;M++){var v=w[M];if(v.type!=="code"){S(v.content);continue}var k=v.content[1],G=v.content[3];if(k&&G&&k.type==="code-language"&&G.type==="code-block"&&typeof k.content=="string"){var I=k.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");I=(/[a-z][\w-]*/i.exec(I)||[""])[0].toLowerCase();var P="language-"+I;G.alias?typeof G.alias=="string"?G.alias=[G.alias,P]:G.alias.push(P):G.alias=[P]}}}S(E.tokens)}),e.hooks.add("wrap",function(E){if(E.type==="code-block"){for(var S="",w=0,M=E.classes.length;w<M;w++){var m=E.classes[w],v=/language-(.+)/.exec(m);if(v){S=v[1];break}}var k=e.languages[S];if(k)E.content=e.highlight(T(E.content),k,S);else if(S&&S!=="none"&&e.plugins.autoloader){var G="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);E.attributes.id=G,e.plugins.autoloader.loadLanguages(S,function(){var I=document.getElementById(G);I&&(I.innerHTML=e.highlight(I.textContent,e.languages[S],S))})}}});var f=RegExp(e.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},_=String.fromCodePoint||String.fromCharCode;function T(E){var S=E.replace(f,"");return S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,M){if(M=M.toLowerCase(),M[0]==="#"){var m;return M[1]==="x"?m=parseInt(M.slice(2),16):m=Number(M.slice(1)),_(m)}else{var v=p[M];return v||w}}),S}e.languages.md=e.languages.markdown}(Prism)),Lh}var kh={},Ph;function Rp(){return Ph||(Ph=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),kh}var $h={},Fh;function bp(){return Fh||(Fh=1,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.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\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,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:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),$h}var Bh={},Hh;function Lp(){return Hh||(Hh=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),Bh}var Wh={},Kh;function Ip(){return Kh||(Kh=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:/[;[\]()`,.]/}),Wh}var zh={},Uh;function kp(){return Uh||(Uh=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),zh}var Gh={},Yh;function Pp(){return Yh||(Yh=1,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),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:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)),Gh}var jh={},Vh;function $p(){return Vh||(Vh=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(e){e.inside.interpolation.inside=Prism.languages.swift})),jh}var qh={},Zh;function Fp(){return Zh||(Zh=1,function(e){e.languages.typescript=e.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/}),e.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 e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.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:t}}}}),e.languages.ts=e.languages.typescript}(Prism)),qh}var Jh={},Xh;function Bp(){return Xh||(Xh=1,function(e){var t=/\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:/\./}};e.languages.java=e.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:t,function:[e.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/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.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:t,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 t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),Jh}var Qh={},eg;function Hp(){return eg||(eg=1,function(e){var t=/\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 t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.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:t,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/}),e.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}}),e.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:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)),Qh}var tg;function zC(){if(tg)return $n;tg=1;var e=wp();Op(),Dp(),Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp(),Hp();var t=gn(),n=Gt();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function l(ee,ne){for(const ue of ee.childNodes){if(t.isHTMLElement(ue)&&ue.tagName===ne)return!0;l(ue,ne)}return!1}const d="data-highlight-language";class f extends n.ElementNode{static getType(){return"code"}static clone(ne){return new f(ne.__language,ne.__key)}constructor(ne,ue){super(ue),this.__language=r(ne)}createDOM(ne){const ue=document.createElement("code");t.addClassNamesToElement(ue,ne.theme.code),ue.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ue.setAttribute(d,be),ue}updateDOM(ne,ue,be){const Ne=this.__language,Re=ne.__language;return Ne?Ne!==Re&&ue.setAttribute(d,Ne):Re&&ue.removeAttribute(d),!1}exportDOM(){const ne=document.createElement("pre");ne.setAttribute("spellcheck","false");const ue=this.getLanguage();return ue&&ne.setAttribute(d,ue),{element:ne}}static importDOM(){return{code:ne=>ne.textContent!=null&&(/\r?\n/.test(ne.textContent)||l(ne,"BR"))?{conversion:T,priority:1}:null,div:ne=>({conversion:E,priority:1}),pre:ne=>({conversion:T,priority:0}),table:ne=>G(ne)?{conversion:S,priority:3}:null,td:ne=>{const ue=ne,be=ue.closest("table");return k(ue)?{conversion:M,priority:3}:be&&G(be)?{conversion:w,priority:3}:null},tr:ne=>{const be=ne.closest("table");return be&&G(be)?{conversion:w,priority:3}:null}}}static importJSON(ne){const ue=p(ne.language);return ue.setFormat(ne.format),ue.setIndent(ne.indent),ue.setDirection(ne.direction),ue}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(ne,ue=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
89
+ `&&be[Ne-2].getTextContent()===`
90
+ `&&ne.isCollapsed()&&ne.anchor.key===this.__key&&ne.anchor.offset===Ne){be[Ne-1].remove(),be[Ne-2].remove();const Be=n.$createParagraphNode();return this.insertAfter(Be,ue),Be}const{anchor:Re,focus:ke}=ne,qe=(Re.isBefore(ke)?Re:ke).getNode();if(n.$isTextNode(qe)){let Be=Se(qe);const ct=[];for(;;)if(n.$isTabNode(Be))ct.push(n.$createTabNode()),Be=Be.getNextSibling();else if(Te(Be)){let ve=0;const Le=Be.getTextContent(),Me=Be.getTextContentSize();for(;ve<Me&&Le[ve]===" ";ve++);if(ve!==0&&ct.push(q(" ".repeat(ve))),ve!==Me)break;Be=Be.getNextSibling()}else break;const Mt=qe.splitText(Re.offset)[0],zt=Re.offset===0?0:1,Vt=Mt.getIndexWithinParent()+zt,Oe=qe.getParentOrThrow(),ie=[n.$createLineBreakNode(),...ct];Oe.splice(Vt,0,ie);const le=ct[ct.length-1];le?le.select():Re.offset===0?Mt.selectPrevious():Mt.getNextSibling().selectNext(0,0)}if(_(qe)){const{offset:Be}=ne.anchor;qe.splice(Be,0,[n.$createLineBreakNode()]),qe.select(Be+1,Be+1)}return null}canIndent(){return!1}collapseAtStart(){const ne=n.$createParagraphNode();return this.getChildren().forEach(be=>ne.append(be)),this.replace(ne),!0}setLanguage(ne){const ue=this.getWritable();ue.__language=r(ne)}getLanguage(){return this.getLatest().__language}}function p(ee){return n.$applyNodeReplacement(new f(ee))}function _(ee){return ee instanceof f}function T(ee){let ne;return t.isHTMLElement(ee)&&(ne=ee.getAttribute(d)),{node:p(ne)}}function E(ee){const ne=ee,ue=m(ne);return!ue&&!v(ne)?{node:null}:{after:be=>{const Ne=ee.parentNode;return Ne!=null&&ee!==Ne.lastChild&&be.push(n.$createLineBreakNode()),be},node:ue?p():null}}function S(){return{node:p()}}function w(){return{node:null}}function M(ee){const ne=ee;return{after:ue=>(ne.parentNode&&ne.parentNode.nextSibling&&ue.push(n.$createLineBreakNode()),ue),node:null}}function m(ee){return ee.style.fontFamily.match("monospace")!==null}function v(ee){let ne=ee.parentElement;for(;ne!==null;){if(m(ne))return!0;ne=ne.parentElement}return!1}function k(ee){return ee.classList.contains("js-file-line")}function G(ee){return ee.classList.contains("js-file-line-container")}const I="javascript",P={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"},H={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function j(ee){return H[ee]||ee}function re(ee){const ne=j(ee);return P[ne]||ne}const te=()=>I,ce=()=>Object.keys(e.languages).filter(ee=>typeof e.languages[ee]!="function").sort();class V extends n.TextNode{constructor(ne,ue,be){super(ne,be),this.__highlightType=ue}static getType(){return"code-highlight"}static clone(ne){return new V(ne.__text,ne.__highlightType||void 0,ne.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(ne){const ue=super.createDOM(ne),be=z(ne.theme,this.__highlightType);return t.addClassNamesToElement(ue,be),ue}updateDOM(ne,ue,be){const Ne=super.updateDOM(ne,ue,be),Re=z(be.theme,ne.__highlightType),ke=z(be.theme,this.__highlightType);return Re!==ke&&(Re&&t.removeClassNamesFromElement(ue,Re),ke&&t.addClassNamesToElement(ue,ke)),Ne}static importJSON(ne){const ue=q(ne.text,ne.highlightType);return ue.setFormat(ne.format),ue.setDetail(ne.detail),ue.setMode(ne.mode),ue.setStyle(ne.style),ue}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(ne){return this}isParentRequired(){return!0}createParentElementNode(){return p()}}function z(ee,ne){return ne&&ee&&ee.codeHighlight&&ee.codeHighlight[ne]}function q(ee,ne){return n.$applyNodeReplacement(new V(ee,ne))}function Te(ee){return ee instanceof V}function Se(ee){let ne=ee,ue=ee;for(;Te(ue)||n.$isTabNode(ue);)ne=ue,ue=ue.getPreviousSibling();return ne}function Ee(ee){let ne=ee,ue=ee;for(;Te(ue)||n.$isTabNode(ue);)ne=ue,ue=ue.getNextSibling();return ne}const de={defaultLanguage:I,tokenize(ee,ne){return e.tokenize(ee,e.languages[ne||""]||e.languages[this.defaultLanguage])}};function K(ee,ne){let ue=null,be=null,Ne=ee,Re=ne,ke=ee.getTextContent();for(;;){if(Re===0){if(Ne=Ne.getPreviousSibling(),Ne===null)break;if(!(Te(Ne)||n.$isTabNode(Ne)||n.$isLineBreakNode(Ne)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Ne)){ue={node:Ne,offset:1};break}Re=Math.max(0,Ne.getTextContentSize()-1),ke=Ne.getTextContent()}else Re--;const qe=ke[Re];Te(Ne)&&qe!==" "&&(be={node:Ne,offset:Re})}if(be!==null)return be;let Fe=null;if(ne<ee.getTextContentSize())Te(ee)&&(Fe=ee.getTextContent()[ne]);else{const qe=ee.getNextSibling();Te(qe)&&(Fe=qe.getTextContent()[0])}if(Fe!==null&&Fe!==" ")return ue;{const qe=O(ee,ne);return qe!==null?qe:ue}}function O(ee,ne){let ue=ee,be=ne,Ne=ee.getTextContent(),Re=ee.getTextContentSize();for(;;){if(!Te(ue)||be===Re){if(ue=ue.getNextSibling(),ue===null||n.$isLineBreakNode(ue))return null;Te(ue)&&(be=0,Ne=ue.getTextContent(),Re=ue.getTextContentSize())}if(Te(ue)){if(Ne[be]!==" ")return{node:ue,offset:be};be++}}}function Z(ee){const ne=Ee(ee);if(n.$isLineBreakNode(ne))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return ne}function se(ee,ne,ue){const be=ee.getParent();_(be)?J(be,ne,ue):Te(ee)&&ee.replace(n.$createTextNode(ee.__text))}function Y(ee,ne){const ue=ne.getElementByKey(ee.getKey());if(ue===null)return;const be=ee.getChildren(),Ne=be.length;if(Ne===ue.__cachedChildrenLength)return;ue.__cachedChildrenLength=Ne;let Re="1",ke=1;for(let Fe=0;Fe<Ne;Fe++)n.$isLineBreakNode(be[Fe])&&(Re+=`
91
+ `+ ++ke);ue.setAttribute("data-gutter",Re)}const W=new Set;function J(ee,ne,ue){const be=ee.getKey();W.has(be)||(W.add(be),ee.getLanguage()===void 0&&ee.setLanguage(ue.defaultLanguage),ne.update(()=>{U(be,()=>{const Ne=n.$getNodeByKey(be);if(!_(Ne)||!Ne.isAttached())return!1;const Re=Ne.getTextContent(),ke=ue.tokenize(Re,Ne.getLanguage()||ue.defaultLanguage),Fe=R(ke),qe=X(Ne.getChildren(),Fe),{from:Be,to:ct,nodesForReplacement:Mt}=qe;return Be!==ct||Mt.length?(ee.splice(Be,ct-Be,Mt),!0):!1})},{onUpdate:()=>{W.delete(be)},skipTransforms:!0}))}function R(ee,ne){const ue=[];for(const be of ee)if(typeof be=="string"){const Ne=be.split(/(\n|\t)/),Re=Ne.length;for(let ke=0;ke<Re;ke++){const Fe=Ne[ke];Fe===`
92
+ `||Fe===`\r
93
+ `?ue.push(n.$createLineBreakNode()):Fe===" "?ue.push(n.$createTabNode()):Fe.length>0&&ue.push(q(Fe,ne))}}else{const{content:Ne}=be;typeof Ne=="string"?ue.push(...R([Ne],be.type)):Array.isArray(Ne)&&ue.push(...R(Ne,be.type))}return ue}function U(ee,ne){const ue=n.$getNodeByKey(ee);if(!_(ue)||!ue.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){ne();return}const Ne=be.anchor,Re=Ne.offset,ke=Ne.type==="element"&&n.$isLineBreakNode(ue.getChildAtIndex(Ne.offset-1));let Fe=0;if(!ke){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((ct,Mt)=>ct+Mt.getTextContentSize(),0)}if(ne()){if(ke){Ne.getNode().select(Re,Re);return}ue.getChildren().some(Be=>{const ct=n.$isTextNode(Be);if(ct||n.$isLineBreakNode(Be)){const Mt=Be.getTextContentSize();if(ct&&Mt>=Fe)return Be.select(Fe,Fe),!0;Fe-=Mt}return!1})}}function X(ee,ne){let ue=0;for(;ue<ee.length&&fe(ee[ue],ne[ue]);)ue++;const be=ee.length,Ne=ne.length,Re=Math.min(be,Ne)-ue;let ke=0;for(;ke<Re;)if(ke++,!fe(ee[be-ke],ne[Ne-ke])){ke--;break}const Fe=ue,qe=be-ke,Be=ne.slice(ue,Ne-ke);return{from:Fe,nodesForReplacement:Be,to:qe}}function fe(ee,ne){return Te(ee)&&Te(ne)&&ee.__text===ne.__text&&ee.__highlightType===ne.__highlightType||n.$isTabNode(ee)&&n.$isTabNode(ne)||n.$isLineBreakNode(ee)&&n.$isLineBreakNode(ne)}function _e(ee){if(!n.$isRangeSelection(ee))return!1;const ne=ee.anchor.getNode(),ue=ee.focus.getNode();if(ne.is(ue)&&_(ne))return!0;const be=ne.getParent();return _(be)&&be.is(ue.getParent())}function B(ee){const ne=ee.getNodes(),ue=[[]];if(ne.length===1&&_(ne[0]))return ue;let be=ue[0];for(let Ne=0;Ne<ne.length;Ne++){const Re=ne[Ne];if(!(Te(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Re)?Ne!==0&&be.length>0&&(be=[],ue.push(be)):be.push(Re)}return ue}function A(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return null;const ue=ee?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,be=ee?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(B(ne).length>1)return ue;const ke=ne.getNodes()[0];if(!(_(ke)||Te(ke)||n.$isTabNode(ke)||n.$isLineBreakNode(ke)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(_(ke))return ue;const Fe=Se(ke),qe=Ee(ke),Be=ne.anchor,ct=ne.focus;let Mt,zt;return ct.isBefore(Be)?(Mt=ct,zt=Be):(Mt=Be,zt=ct),Fe!==null&&qe!==null&&Mt.key===Fe.getKey()&&Mt.offset===0&&zt.key===qe.getKey()&&zt.offset===qe.getTextContentSize()?ue:be}function F(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return!1;const ue=B(ne),be=ue.length;if(ue.length>1){for(let Fe=0;Fe<be;Fe++){const qe=ue[Fe];if(qe.length>0){let Be=qe[0];Fe===0&&(Be=Se(Be)),Be!==null&&(ee===n.INDENT_CONTENT_COMMAND?Be.insertBefore(n.$createTabNode()):n.$isTabNode(Be)&&Be.remove())}}return!0}const Re=ne.getNodes()[0];if(!(_(Re)||Te(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(_(Re))return ee===n.INDENT_CONTENT_COMMAND&&ne.insertNodes([n.$createTabNode()]),!0;const ke=Se(Re);if(ke===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return ee===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(ke)?ke.insertAfter(n.$createTabNode()):ke.insertBefore(n.$createTabNode()):n.$isTabNode(ke)&&ke.remove(),!0}function oe(ee,ne){const ue=n.$getSelection();if(!n.$isRangeSelection(ue))return!1;const{anchor:be,focus:Ne}=ue,Re=be.offset,ke=Ne.offset,Fe=be.getNode(),qe=Ne.getNode(),Be=ee===n.KEY_ARROW_UP_COMMAND;if(!_e(ue)||!(Te(Fe)||n.$isTabNode(Fe))||!(Te(qe)||n.$isTabNode(qe)))return!1;if(!ne.altKey){if(ue.isCollapsed()){const ve=Fe.getParentOrThrow();if(Be&&Re===0&&Fe.getPreviousSibling()===null){if(ve.getPreviousSibling()===null)return ve.selectPrevious(),ne.preventDefault(),!0}else if(!Be&&Re===Fe.getTextContentSize()&&Fe.getNextSibling()===null&&ve.getNextSibling()===null)return ve.selectNext(),ne.preventDefault(),!0}return!1}let ct,Mt;if(Fe.isBefore(qe)?(ct=Se(Fe),Mt=Ee(qe)):(ct=Se(qe),Mt=Ee(Fe)),ct==null||Mt==null)return!1;const zt=ct.getNodesBetween(Mt);for(let ve=0;ve<zt.length;ve++){const Le=zt[ve];if(!Te(Le)&&!n.$isTabNode(Le)&&!n.$isLineBreakNode(Le))return!1}ne.preventDefault(),ne.stopPropagation();const Vt=Be?ct.getPreviousSibling():Mt.getNextSibling();if(!n.$isLineBreakNode(Vt))return!0;const Oe=Be?Vt.getPreviousSibling():Vt.getNextSibling();if(Oe==null)return!0;const ie=Te(Oe)||n.$isTabNode(Oe)||n.$isLineBreakNode(Oe)?Be?Se(Oe):Ee(Oe):null;let le=ie??Oe;return Vt.remove(),zt.forEach(ve=>ve.remove()),ee===n.KEY_ARROW_UP_COMMAND?(zt.forEach(ve=>le.insertBefore(ve)),le.insertBefore(Vt)):(le.insertAfter(Vt),le=Vt,zt.forEach(ve=>{le.insertAfter(ve),le=ve})),ue.setTextNodeRange(Fe,Re,qe,ke),!0}function ye(ee,ne){const ue=n.$getSelection();if(!n.$isRangeSelection(ue))return!1;const{anchor:be,focus:Ne}=ue,Re=be.getNode(),ke=Ne.getNode(),Fe=ee===n.MOVE_TO_START;if(!(Te(Re)||n.$isTabNode(Re))||!(Te(ke)||n.$isTabNode(ke)))return!1;if(Fe){const qe=K(ke,Ne.offset);if(qe!==null){const{node:Be,offset:ct}=qe;n.$isLineBreakNode(Be)?Be.selectNext(0,0):ue.setTextNodeRange(Be,ct,Be,ct)}else ke.getParentOrThrow().selectStart()}else Z(ke).select();return ne.preventDefault(),ne.stopPropagation(),!0}function De(ee,ne){if(!ee.hasNodes([f,V]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return ne==null&&(ne=de),t.mergeRegister(ee.registerMutationListener(f,ue=>{ee.update(()=>{for(const[be,Ne]of ue)if(Ne!=="destroyed"){const Re=n.$getNodeByKey(be);Re!==null&&Y(Re,ee)}})}),ee.registerNodeTransform(f,ue=>J(ue,ee,ne)),ee.registerNodeTransform(n.TextNode,ue=>se(ue,ee,ne)),ee.registerNodeTransform(V,ue=>se(ue,ee,ne)),ee.registerCommand(n.KEY_TAB_COMMAND,ue=>{const be=A(ue.shiftKey);return be===null?!1:(ue.preventDefault(),ee.dispatchCommand(be,void 0),!0)},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ue=n.$getSelection();return _e(ue)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INDENT_CONTENT_COMMAND,ue=>F(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.OUTDENT_CONTENT_COMMAND,ue=>F(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_UP_COMMAND,ue=>oe(n.KEY_ARROW_UP_COMMAND,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ue=>oe(n.KEY_ARROW_DOWN_COMMAND,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_END,ue=>ye(n.MOVE_TO_END,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_START,ue=>ye(n.MOVE_TO_START,ue),n.COMMAND_PRIORITY_LOW))}return $n.$createCodeHighlightNode=q,$n.$createCodeNode=p,$n.$isCodeHighlightNode=Te,$n.$isCodeNode=_,$n.CODE_LANGUAGE_FRIENDLY_NAME_MAP=P,$n.CODE_LANGUAGE_MAP=H,$n.CodeHighlightNode=V,$n.CodeNode=f,$n.DEFAULT_CODE_LANGUAGE=I,$n.PrismTokenizer=de,$n.getCodeLanguages=ce,$n.getDefaultCodeLanguage=te,$n.getEndOfCodeInLine=Z,$n.getFirstCodeNodeOfLine=Se,$n.getLanguageFriendlyName=re,$n.getLastCodeNodeOfLine=Ee,$n.getStartOfCodeInLine=K,$n.normalizeCodeLang=j,$n.registerCodeHighlighting=De,$n}var Fn={},ng;function UC(){if(ng)return Fn;ng=1;var e=wp();Op(),Dp(),Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp(),Hp();var t=gn(),n=Gt();let r=R=>R!=null&&e.languages.hasOwnProperty(R)?R:void 0;function l(R,U){for(let X of R.childNodes){if(t.isHTMLElement(X)&&X.tagName===U)return!0;l(X,U)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(U){return new d(U.__language,U.__key)}constructor(U,X){super(X),this.__language=r(U)}createDOM(U){let X=document.createElement("code");return t.addClassNamesToElement(X,U.theme.code),X.setAttribute("spellcheck","false"),(U=this.getLanguage())&&X.setAttribute("data-highlight-language",U),X}updateDOM(U,X){let fe=this.__language;return U=U.__language,fe?fe!==U&&X.setAttribute("data-highlight-language",fe):U&&X.removeAttribute("data-highlight-language"),!1}exportDOM(){let U=document.createElement("pre");U.setAttribute("spellcheck","false");let X=this.getLanguage();return X&&U.setAttribute("data-highlight-language",X),{element:U}}static importDOM(){return{code:U=>U.textContent!=null&&(/\r?\n/.test(U.textContent)||l(U,"BR"))?{conversion:_,priority:1}:null,div:()=>({conversion:T,priority:1}),pre:()=>({conversion:_,priority:0}),table:U=>m(U)?{conversion:E,priority:3}:null,td:U=>{let X=U.closest("table");return U.classList.contains("js-file-line")?{conversion:w,priority:3}:X&&m(X)?{conversion:S,priority:3}:null},tr:U=>(U=U.closest("table"))&&m(U)?{conversion:S,priority:3}:null}}static importJSON(U){let X=f(U.language);return X.setFormat(U.format),X.setIndent(U.indent),X.setDirection(U.direction),X}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(U,X=!0){var fe=this.getChildren(),_e=fe.length;if(2<=_e&&fe[_e-1].getTextContent()===`
94
+ `&&fe[_e-2].getTextContent()===`
95
+ `&&U.isCollapsed()&&U.anchor.key===this.__key&&U.anchor.offset===_e)return fe[_e-1].remove(),fe[_e-2].remove(),U=n.$createParagraphNode(),this.insertAfter(U,X),U;let{anchor:B,focus:A}=U;if(X=(B.isBefore(A)?B:A).getNode(),n.$isTextNode(X)){for(_e=re(X),fe=[];;)if(n.$isTabNode(_e))fe.push(n.$createTabNode()),_e=_e.getNextSibling();else if(j(_e)){for(var F=0,oe=_e.getTextContent(),ye=_e.getTextContentSize();F<ye&&oe[F]===" ";F++);if(F!==0&&fe.push(H(" ".repeat(F))),F!==ye)break;_e=_e.getNextSibling()}else break;_e=X.splitText(B.offset)[0],F=B.offset===0?0:1,F=_e.getIndexWithinParent()+F,oe=X.getParentOrThrow(),ye=[n.$createLineBreakNode(),...fe],oe.splice(F,0,ye),(fe=fe[fe.length-1])?fe.select():B.offset===0?_e.selectPrevious():_e.getNextSibling().selectNext(0,0)}return p(X)&&({offset:U}=U.anchor,X.splice(U,0,[n.$createLineBreakNode()]),X.select(U+1,U+1)),null}canIndent(){return!1}collapseAtStart(){let U=n.$createParagraphNode();return this.getChildren().forEach(X=>U.append(X)),this.replace(U),!0}setLanguage(U){this.getWritable().__language=r(U)}getLanguage(){return this.getLatest().__language}}function f(R){return n.$applyNodeReplacement(new d(R))}function p(R){return R instanceof d}function _(R){let U;return t.isHTMLElement(R)&&(U=R.getAttribute("data-highlight-language")),{node:f(U)}}function T(R){let U=R.style.fontFamily.match("monospace")!==null;return U||M(R)?{after:X=>{let fe=R.parentNode;return fe!=null&&R!==fe.lastChild&&X.push(n.$createLineBreakNode()),X},node:U?f():null}:{node:null}}function E(){return{node:f()}}function S(){return{node:null}}function w(R){return{after:U=>(R.parentNode&&R.parentNode.nextSibling&&U.push(n.$createLineBreakNode()),U),node:null}}function M(R){for(R=R.parentElement;R!==null;){if(R.style.fontFamily.match("monospace")!==null)return!0;R=R.parentElement}return!1}function m(R){return R.classList.contains("js-file-line-container")}let v={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"},k={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function G(R){return k[R]||R}class I extends n.TextNode{constructor(U,X,fe){super(U,fe),this.__highlightType=X}static getType(){return"code-highlight"}static clone(U){return new I(U.__text,U.__highlightType||void 0,U.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(U){let X=super.createDOM(U);return U=P(U.theme,this.__highlightType),t.addClassNamesToElement(X,U),X}updateDOM(U,X,fe){let _e=super.updateDOM(U,X,fe);return U=P(fe.theme,U.__highlightType),fe=P(fe.theme,this.__highlightType),U!==fe&&(U&&t.removeClassNamesFromElement(X,U),fe&&t.addClassNamesToElement(X,fe)),_e}static importJSON(U){let X=H(U.text,U.highlightType);return X.setFormat(U.format),X.setDetail(U.detail),X.setMode(U.mode),X.setStyle(U.style),X}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return f()}}function P(R,U){return U&&R&&R.codeHighlight&&R.codeHighlight[U]}function H(R,U){return n.$applyNodeReplacement(new I(R,U))}function j(R){return R instanceof I}function re(R){let U=R;for(;j(R)||n.$isTabNode(R);)U=R,R=R.getPreviousSibling();return U}function te(R){let U=R;for(;j(R)||n.$isTabNode(R);)U=R,R=R.getNextSibling();return U}let ce={defaultLanguage:"javascript",tokenize(R,U){return e.tokenize(R,e.languages[U||""]||e.languages[this.defaultLanguage])}};function V(R,U){let X=null;var fe=null,_e=R;let B=U,A=R.getTextContent();for(;;){if(B===0){if(_e=_e.getPreviousSibling(),_e===null)break;if(!(j(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(_e)){X={node:_e,offset:1};break}B=Math.max(0,_e.getTextContentSize()-1),A=_e.getTextContent()}else B--;let F=A[B];j(_e)&&F!==" "&&(fe={node:_e,offset:B})}if(fe!==null)return fe;if(fe=null,U<R.getTextContentSize()?j(R)&&(fe=R.getTextContent()[U]):(_e=R.getNextSibling(),j(_e)&&(fe=_e.getTextContent()[0])),fe!==null&&fe!==" ")return X;e:for(fe=R,_e=R.getTextContent(),R=R.getTextContentSize();;){if(!j(fe)||U===R){if(fe=fe.getNextSibling(),fe===null||n.$isLineBreakNode(fe)){R=null;break e}j(fe)&&(U=0,_e=fe.getTextContent(),R=fe.getTextContentSize())}if(j(fe)){if(_e[U]!==" "){R={node:fe,offset:U};break e}U++}}return R!==null?R:X}function z(R){if(R=te(R),n.$isLineBreakNode(R))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return R}function q(R,U,X){let fe=R.getParent();p(fe)?Se(fe,U,X):j(R)&&R.replace(n.$createTextNode(R.__text))}let Te=new Set;function Se(R,U,X){let fe=R.getKey();Te.has(fe)||(Te.add(fe),R.getLanguage()===void 0&&R.setLanguage(X.defaultLanguage),U.update(()=>{de(fe,()=>{var _e=n.$getNodeByKey(fe);if(!p(_e)||!_e.isAttached())return!1;var B=_e.getTextContent();B=X.tokenize(B,_e.getLanguage()||X.defaultLanguage),B=Ee(B);var A=_e.getChildren();for(_e=0;_e<A.length&&K(A[_e],B[_e]);)_e++;var F=A.length;let oe=B.length,ye=Math.min(F,oe)-_e,De=0;for(;De<ye;)if(De++,!K(A[F-De],B[oe-De])){De--;break}A=_e,F-=De,B=B.slice(_e,oe-De);let{from:ee,to:ne,nodesForReplacement:ue}={from:A,nodesForReplacement:B,to:F};return ee!==ne||ue.length?(R.splice(ee,ne-ee,ue),!0):!1})},{onUpdate:()=>{Te.delete(fe)},skipTransforms:!0}))}function Ee(R,U){let X=[];for(let fe of R)if(typeof fe=="string"){R=fe.split(/(\n|\t)/);let _e=R.length;for(let B=0;B<_e;B++){let A=R[B];A===`
96
+ `||A===`\r
97
+ `?X.push(n.$createLineBreakNode()):A===" "?X.push(n.$createTabNode()):0<A.length&&X.push(H(A,U))}}else({content:R}=fe),typeof R=="string"?X.push(...Ee([R],fe.type)):Array.isArray(R)&&X.push(...Ee(R,fe.type));return X}function de(R,U){if(R=n.$getNodeByKey(R),p(R)&&R.isAttached()){var X=n.$getSelection();if(n.$isRangeSelection(X)){X=X.anchor;var fe=X.offset,_e=X.type==="element"&&n.$isLineBreakNode(R.getChildAtIndex(X.offset-1)),B=0;if(!_e){let A=X.getNode();B=fe+A.getPreviousSiblings().reduce((F,oe)=>F+oe.getTextContentSize(),0)}U()&&(_e?X.getNode().select(fe,fe):R.getChildren().some(A=>{let F=n.$isTextNode(A);if(F||n.$isLineBreakNode(A)){let oe=A.getTextContentSize();if(F&&oe>=B)return A.select(B,B),!0;B-=oe}return!1}))}else U()}}function K(R,U){return j(R)&&j(U)&&R.__text===U.__text&&R.__highlightType===U.__highlightType||n.$isTabNode(R)&&n.$isTabNode(U)||n.$isLineBreakNode(R)&&n.$isLineBreakNode(U)}function O(R){if(!n.$isRangeSelection(R))return!1;var U=R.anchor.getNode();return R=R.focus.getNode(),U.is(R)&&p(U)?!0:(U=U.getParent(),p(U)&&U.is(R.getParent()))}function Z(R){R=R.getNodes();let U=[[]];if(R.length===1&&p(R[0]))return U;let X=U[0];for(let fe=0;fe<R.length;fe++){let _e=R[fe];if(!(j(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(_e)?fe!==0&&0<X.length&&(X=[],U.push(X)):X.push(_e)}return U}function se(R){var U=n.$getSelection();if(!n.$isRangeSelection(U)||!O(U))return null;let X=R?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(R=R?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<Z(U).length)return X;var fe=U.getNodes()[0];if(!(p(fe)||j(fe)||n.$isTabNode(fe)||n.$isLineBreakNode(fe)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(p(fe))return X;let _e=re(fe);fe=te(fe);var B=U.anchor;let A=U.focus;return A.isBefore(B)?U=A:(U=B,B=A),_e!==null&&fe!==null&&U.key===_e.getKey()&&U.offset===0&&B.key===fe.getKey()&&B.offset===fe.getTextContentSize()?X:R}function Y(R){var U=n.$getSelection();if(!n.$isRangeSelection(U)||!O(U))return!1;var X=Z(U);let fe=X.length;if(1<X.length){for(U=0;U<fe;U++){var _e=X[U];0<_e.length&&(_e=_e[0],U===0&&(_e=re(_e)),_e!==null&&(R===n.INDENT_CONTENT_COMMAND?_e.insertBefore(n.$createTabNode()):n.$isTabNode(_e)&&_e.remove()))}return!0}if(X=U.getNodes()[0],!(p(X)||j(X)||n.$isTabNode(X)||n.$isLineBreakNode(X)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(p(X))return R===n.INDENT_CONTENT_COMMAND&&U.insertNodes([n.$createTabNode()]),!0;if(X=re(X),X===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return R===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(X)?X.insertAfter(n.$createTabNode()):X.insertBefore(n.$createTabNode()):n.$isTabNode(X)&&X.remove(),!0}function W(R,U){let X=n.$getSelection();if(!n.$isRangeSelection(X))return!1;let{anchor:fe,focus:_e}=X,B=fe.offset,A=_e.offset,F=fe.getNode(),oe=_e.getNode();var ye=R===n.KEY_ARROW_UP_COMMAND;if(!O(X)||!j(F)&&!n.$isTabNode(F)||!j(oe)&&!n.$isTabNode(oe))return!1;if(!U.altKey){if(X.isCollapsed()){if(R=F.getParentOrThrow(),ye&&B===0&&F.getPreviousSibling()===null){if(R.getPreviousSibling()===null)return R.selectPrevious(),U.preventDefault(),!0}else if(!ye&&B===F.getTextContentSize()&&F.getNextSibling()===null&&R.getNextSibling()===null)return R.selectNext(),U.preventDefault(),!0}return!1}let De;if(F.isBefore(oe)){var ee=re(F);De=te(oe)}else ee=re(oe),De=te(F);if(ee==null||De==null)return!1;let ne=ee.getNodesBetween(De);for(let be=0;be<ne.length;be++){let Ne=ne[be];if(!j(Ne)&&!n.$isTabNode(Ne)&&!n.$isLineBreakNode(Ne))return!1}if(U.preventDefault(),U.stopPropagation(),U=ye?ee.getPreviousSibling():De.getNextSibling(),!n.$isLineBreakNode(U)||(ee=ye?U.getPreviousSibling():U.getNextSibling(),ee==null))return!0;ye=j(ee)||n.$isTabNode(ee)||n.$isLineBreakNode(ee)?ye?re(ee):te(ee):null;let ue=ye??ee;return U.remove(),ne.forEach(be=>be.remove()),R===n.KEY_ARROW_UP_COMMAND?(ne.forEach(be=>ue.insertBefore(be)),ue.insertBefore(U)):(ue.insertAfter(U),ue=U,ne.forEach(be=>{ue.insertAfter(be),ue=be})),X.setTextNodeRange(F,B,oe,A),!0}function J(R,U){let X=n.$getSelection();if(!n.$isRangeSelection(X))return!1;let{anchor:fe,focus:_e}=X;var B=fe.getNode();let A=_e.getNode();if(R=R===n.MOVE_TO_START,!j(B)&&!n.$isTabNode(B)||!j(A)&&!n.$isTabNode(A))return!1;if(R)if(B=V(A,_e.offset),B!==null){let{node:F,offset:oe}=B;n.$isLineBreakNode(F)?F.selectNext(0,0):X.setTextNodeRange(F,oe,F,oe)}else A.getParentOrThrow().selectStart();else z(A).select();return U.preventDefault(),U.stopPropagation(),!0}return Fn.$createCodeHighlightNode=H,Fn.$createCodeNode=f,Fn.$isCodeHighlightNode=j,Fn.$isCodeNode=p,Fn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=v,Fn.CODE_LANGUAGE_MAP=k,Fn.CodeHighlightNode=I,Fn.CodeNode=d,Fn.DEFAULT_CODE_LANGUAGE="javascript",Fn.PrismTokenizer=ce,Fn.getCodeLanguages=()=>Object.keys(e.languages).filter(R=>typeof e.languages[R]!="function").sort(),Fn.getDefaultCodeLanguage=()=>"javascript",Fn.getEndOfCodeInLine=z,Fn.getFirstCodeNodeOfLine=re,Fn.getLanguageFriendlyName=function(R){return R=G(R),v[R]||R},Fn.getLastCodeNodeOfLine=te,Fn.getStartOfCodeInLine=V,Fn.normalizeCodeLang=G,Fn.registerCodeHighlighting=function(R,U){if(!R.hasNodes([d,I]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return U==null&&(U=ce),t.mergeRegister(R.registerMutationListener(d,X=>{R.update(()=>{for(let[B,A]of X)if(A!=="destroyed"){var fe=n.$getNodeByKey(B);if(fe!==null)e:{var _e=fe;if(fe=R.getElementByKey(_e.getKey()),fe===null)break e;_e=_e.getChildren();let F=_e.length;if(F===fe.__cachedChildrenLength)break e;fe.__cachedChildrenLength=F;let oe="1",ye=1;for(let De=0;De<F;De++)n.$isLineBreakNode(_e[De])&&(oe+=`
98
+ `+ ++ye);fe.setAttribute("data-gutter",oe)}}})}),R.registerNodeTransform(d,X=>Se(X,R,U)),R.registerNodeTransform(n.TextNode,X=>q(X,R,U)),R.registerNodeTransform(I,X=>q(X,R,U)),R.registerCommand(n.KEY_TAB_COMMAND,X=>{let fe=se(X.shiftKey);return fe===null?!1:(X.preventDefault(),R.dispatchCommand(fe,void 0),!0)},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INSERT_TAB_COMMAND,()=>{let X=n.$getSelection();return O(X)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_UP_COMMAND,X=>W(n.KEY_ARROW_UP_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_DOWN_COMMAND,X=>W(n.KEY_ARROW_DOWN_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_END,X=>J(n.MOVE_TO_END,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_START,X=>J(n.MOVE_TO_START,X),n.COMMAND_PRIORITY_LOW))},Fn}const GC=process.env.NODE_ENV==="development"?zC():UC();var ju=GC,Cd=Zn();function YC(){const[e]=Cd.useLexicalComposerContext();return rt.useEffect(()=>ju.registerCodeHighlighting(e),[e]),null}var rg=gn(),Bn=Gt();function jC({src:e,altText:t,width:n,height:r,maxWidth:l}){const d=rt.useMemo(()=>({height:r,width:n,maxWidth:l}),[r,n,l]);return ft.jsx("img",{src:e,alt:t,style:d})}function Wp({altText:e,height:t,maxWidth:n=500,src:r,width:l,key:d}){return Bn.$applyNodeReplacement(new ol(r,e,n,l,t,d))}function VC(e){return e instanceof ol}class ol extends Bn.DecoratorNode{constructor(n,r,l,d,f,p){super(p);Ie(this,"__src");Ie(this,"__altText");Ie(this,"__width");Ie(this,"__height");Ie(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=l,this.__width=d||"inherit",this.__height=f||"inherit"}static getType(){return"image"}static clone(n){return new ol(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 Wp(n)}createDOM(n){const r=document.createElement("span"),l=n.theme.image;return l&&(r.className=l),r}updateDOM(){return!1}decorate(){return ft.jsx(jC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const qC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZC=e=>qC?(e||window).getSelection():null,Kp=Bn.createCommand("INSERT_IMAGE_COMMAND");function JC(){const[e]=Cd.useLexicalComposerContext();return rt.useEffect(()=>{if(!e.hasNodes([ol]))throw new Error("ImagePlugin: ImageNode not registered on editor");return rg.mergeRegister(e.registerCommand(Kp,t=>{const n=Wp(t);return Bn.$insertNodes([n]),Bn.$isRootOrShadowRoot(n.getParentOrThrow())&&rg.$wrapNodeInElement(n,Bn.$createParagraphNode).selectEnd(),!0},Bn.COMMAND_PRIORITY_EDITOR),e.registerCommand(Bn.DRAGSTART_COMMAND,t=>XC(t),Bn.COMMAND_PRIORITY_HIGH),e.registerCommand(Bn.DRAGOVER_COMMAND,t=>QC(t),Bn.COMMAND_PRIORITY_LOW),e.registerCommand(Bn.DROP_COMMAND,t=>eE(t,e),Bn.COMMAND_PRIORITY_HIGH))},[e]),null}function XC(e){const t="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=t;const r=Ed();if(!r)return!1;const l=e.dataTransfer;return l?(l.setData("text/plain","_"),l.setDragImage(n,0,0),l.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 QC(e){return Ed()?(zp(e)||e.preventDefault(),!0):!1}function eE(e,t){const n=Ed();if(!n)return!1;const r=tE(e);if(!r)return!1;if(e.preventDefault(),zp(e)){const l=nE(e);n.remove();const d=Bn.$createRangeSelection();l!=null&&d.applyDOMRange(l),Bn.$setSelection(d),t.dispatchCommand(Kp,r)}return!0}function Ed(){const e=Bn.$getSelection();if(!Bn.$isNodeSelection(e))return null;const n=e.getNodes()[0];return VC(n)?n:null}function tE(e){var l;const t=(l=e.dataTransfer)==null?void 0:l.getData("application/x-lexical-drag");if(!t)return null;const{type:n,data:r}=JSON.parse(t);return n!=="image"?null:r}function zp(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.yext-default-richtextv2-theme__image")&&t.parentElement)}function nE(e){let t;const n=e.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,l=ZC(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&l!==null)l.collapse(e.rangeParent,e.rangeOffset||0),t=l.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var is=_d();function rE(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>Bn.$isElementNode(n)?n:n.getParentOrThrow()))}const iE=3;function oE(e){const t=Bn.$getSelection();if(!Bn.$isRangeSelection(t))return!1;const n=rE(t);let r=0;for(const l of n)if(is.$isListNode(l))r=Math.max(is.$getListDepth(l)+1,r);else if(is.$isListItemNode(l)){const d=l.getParent();if(!is.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(is.$getListDepth(d)+1,r)}return r<=e}function sE({maxDepth:e}){const[t]=Cd.useLexicalComposerContext();return rt.useEffect(()=>t.registerCommand(Bn.INDENT_CONTENT_COMMAND,()=>!oE(e||7),iE),[t,e]),null}var Ou=Nd(),ig=yd(),og=md(),Zl={},sg;function lE(){if(sg)return Zl;sg=1;var e=gn(),t=Gt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(f){return new n(f.__text,f.__key)}constructor(f,p){super(f,p)}createDOM(f){const p=super.createDOM(f);return e.addClassNamesToElement(p,f.theme.hashtag),p}static importJSON(f){const p=r(f.text);return p.setFormat(f.format),p.setDetail(f.detail),p.setMode(f.mode),p.setStyle(f.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function l(d){return d instanceof n}return Zl.$createHashtagNode=r,Zl.$isHashtagNode=l,Zl.HashtagNode=n,Zl}var Jl={},lg;function aE(){if(lg)return Jl;lg=1;var e=gn(),t=Gt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,f){super(d,f)}createDOM(d){let f=super.createDOM(d);return e.addClassNamesToElement(f,d.theme.hashtag),f}static importJSON(d){let f=r(d.text);return f.setFormat(d.format),f.setDetail(d.detail),f.setMode(d.mode),f.setStyle(d.style),f}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(l=""){return t.$applyNodeReplacement(new n(l))}return Jl.$createHashtagNode=r,Jl.$isHashtagNode=function(l){return l instanceof n},Jl.HashtagNode=n,Jl}const cE=process.env.NODE_ENV==="development"?lE():aE();var uE=cE;const dE="_rtl_13v3w_295",fE="_selected_13v3w_370",dt={"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:dE,"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:fE,"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"},hE={characterLimit:dt["yext-default-richtextv2-theme__characterLimit"],code:dt["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:dt["yext-default-richtextv2-theme__tokenAttr"],attr:dt["yext-default-richtextv2-theme__tokenAttr"],boolean:dt["yext-default-richtextv2-theme__tokenProperty"],builtin:dt["yext-default-richtextv2-theme__tokenSelector"],cdata:dt["yext-default-richtextv2-theme__tokenComment"],char:dt["yext-default-richtextv2-theme__tokenSelector"],class:dt["yext-default-richtextv2-theme__tokenFunction"],"class-name":dt["yext-default-richtextv2-theme__tokenFunction"],comment:dt["yext-default-richtextv2-theme__tokenComment"],constant:dt["yext-default-richtextv2-theme__tokenProperty"],deleted:dt["yext-default-richtextv2-theme__tokenProperty"],doctype:dt["yext-default-richtextv2-theme__tokenComment"],entity:dt["yext-default-richtextv2-theme__tokenOperator"],function:dt["yext-default-richtextv2-theme__tokenFunction"],important:dt["yext-default-richtextv2-theme__tokenVariable"],inserted:dt["yext-default-richtextv2-theme__tokenSelector"],keyword:dt["yext-default-richtextv2-theme__tokenAttr"],namespace:dt["yext-default-richtextv2-theme__tokenVariable"],number:dt["yext-default-richtextv2-theme__tokenProperty"],operator:dt["yext-default-richtextv2-theme__tokenOperator"],prolog:dt["yext-default-richtextv2-theme__tokenComment"],property:dt["yext-default-richtextv2-theme__tokenProperty"],punctuation:dt["yext-default-richtextv2-theme__tokenPunctuation"],regex:dt["yext-default-richtextv2-theme__tokenVariable"],selector:dt["yext-default-richtextv2-theme__tokenSelector"],string:dt["yext-default-richtextv2-theme__tokenSelector"],symbol:dt["yext-default-richtextv2-theme__tokenProperty"],tag:dt["yext-default-richtextv2-theme__tokenProperty"],url:dt["yext-default-richtextv2-theme__tokenOperator"],variable:dt["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:dt["yext-default-richtextv2-theme__embedBlock"],focus:dt["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:dt["yext-default-richtextv2-theme__hashtag"],heading:{h1:dt["yext-default-richtextv2-theme__h1"],h2:dt["yext-default-richtextv2-theme__h2"],h3:dt["yext-default-richtextv2-theme__h3"],h4:dt["yext-default-richtextv2-theme__h4"],h5:dt["yext-default-richtextv2-theme__h5"],h6:dt["yext-default-richtextv2-theme__h6"]},image:dt["yext-default-richtextv2-theme__image"],link:dt["yext-default-richtextv2-theme__link"],list:{listitem:dt["yext-default-richtextv2-theme__listItem"],listitemChecked:dt["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:dt["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:dt["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[dt["yext-default-richtextv2-theme__ol1"],dt["yext-default-richtextv2-theme__ol2"],dt["yext-default-richtextv2-theme__ol3"],dt["yext-default-richtextv2-theme__ol4"],dt["yext-default-richtextv2-theme__ol5"]],ulDepth:[dt["yext-default-richtextv2-theme__ul1"],dt["yext-default-richtextv2-theme__ul2"],dt["yext-default-richtextv2-theme__ul3"]]},ltr:dt["yext-default-richtextv2-theme__ltr"],mark:dt["yext-default-richtextv2-theme__mark"],markOverlap:dt["yext-default-richtextv2-theme__markOverlap"],paragraph:dt["yext-default-richtextv2-theme__paragraph"],quote:dt["yext-default-richtextv2-theme__quote"],rtl:dt["yext-default-richtextv2-theme__rtl"],table:dt["yext-default-richtextv2-theme__table"],tableCell:dt["yext-default-richtextv2-theme__tableCell"],tableCellHeader:dt["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:dt["yext-default-richtextv2-theme__textBold"],code:dt["yext-default-richtextv2-theme__textCode"],italic:dt["yext-default-richtextv2-theme__textItalic"],strikethrough:dt["yext-default-richtextv2-theme__textStrikethrough"],subscript:dt["yext-default-richtextv2-theme__textSubscript"],superscript:dt["yext-default-richtextv2-theme__textSuperscript"],underline:dt["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:dt["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Ks={},Du={},ag;function gE(){if(ag)return Du;ag=1;var e=Zn(),t=Gt(),n=rt;function r(d,f){return d.getEditorState().read(()=>{const p=t.$getNodeByKey(f);return p===null?!1:p.isSelected()})}function l(d){const[f]=e.useLexicalComposerContext(),[p,_]=n.useState(()=>r(f,d));n.useEffect(()=>{let S=!0;const w=f.registerUpdateListener(()=>{S&&_(r(f,d))});return()=>{S=!1,w()}},[f,d]);const T=n.useCallback(S=>{f.update(()=>{let w=t.$getSelection();t.$isNodeSelection(w)||(w=t.$createNodeSelection(),t.$setSelection(w)),t.$isNodeSelection(w)&&(S?w.add(d):w.delete(d))})},[f,d]),E=n.useCallback(()=>{f.update(()=>{const S=t.$getSelection();t.$isNodeSelection(S)&&S.clear()})},[f]);return[p,T,E]}return Du.useLexicalNodeSelection=l,Du}var Au={},cg;function pE(){if(cg)return Au;cg=1;var e=Zn(),t=Gt(),n=rt;function r(l,d){return l.getEditorState().read(()=>{let f=t.$getNodeByKey(d);return f===null?!1:f.isSelected()})}return Au.useLexicalNodeSelection=function(l){let[d]=e.useLexicalComposerContext(),[f,p]=n.useState(()=>r(d,l));n.useEffect(()=>{let E=!0,S=d.registerUpdateListener(()=>{E&&p(r(d,l))});return()=>{E=!1,S()}},[d,l]);let _=n.useCallback(E=>{d.update(()=>{let S=t.$getSelection();t.$isNodeSelection(S)||(S=t.$createNodeSelection(),t.$setSelection(S)),t.$isNodeSelection(S)&&(E?S.add(l):S.delete(l))})},[d,l]),T=n.useCallback(()=>{d.update(()=>{const E=t.$getSelection();t.$isNodeSelection(E)&&E.clear()})},[d]);return[f,_,T]},Au}var Mu,ug;function Up(){return ug||(ug=1,Mu=process.env.NODE_ENV==="development"?gE():pE()),Mu}var dg;function mE(){if(dg)return Ks;dg=1;var e=Zn(),t=Up(),n=gn(),r=Gt(),l=rt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){const[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),k=l.useCallback(G=>{if(M&&r.$isNodeSelection(r.$getSelection())){G.preventDefault();const I=r.$getNodeByKey(S);E(I)&&I.remove()}return!1},[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{const I=w.getElementByKey(S);return G.target===I?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,k,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,k,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,k,m]),l.useEffect(()=>{const G=w.getElementByKey(S);G!==null&&(G.className=M?"selected":"")},[w,M,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(w){return T()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
99
+ `}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:T()}}function T(){return r.$applyNodeReplacement(new p)}function E(S){return S instanceof p}return Ks.$createHorizontalRuleNode=T,Ks.$isHorizontalRuleNode=E,Ks.HorizontalRuleNode=p,Ks.INSERT_HORIZONTAL_RULE_COMMAND=d,Ks}var zs={},fg;function _E(){if(fg)return zs;fg=1;var e=Zn(),t=Up(),n=gn(),r=Gt(),l=rt;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){let[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),k=l.useCallback(G=>(M&&r.$isNodeSelection(r.$getSelection())&&(G.preventDefault(),G=r.$getNodeByKey(S),E(G)&&G.remove()),!1),[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{let I=w.getElementByKey(S);return G.target===I?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,k,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,k,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,k,m]),l.useEffect(()=>{let G=w.getElementByKey(S);G!==null&&(G.className=M?"selected":"")},[w,M,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(){return T()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
100
+ `}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:T()}}function T(){return r.$applyNodeReplacement(new p)}function E(S){return S instanceof p}return zs.$createHorizontalRuleNode=T,zs.$isHorizontalRuleNode=E,zs.HorizontalRuleNode=p,zs.INSERT_HORIZONTAL_RULE_COMMAND=d,zs}const yE=process.env.NODE_ENV==="development"?mE():_E();var NE=yE;function CE(e,t){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:e,theme:t??hE,nodes:[og.HeadingNode,uE.HashtagNode,ol,is.ListNode,is.ListItemNode,og.QuoteNode,ju.CodeNode,ju.CodeHighlightNode,Ou.TableNode,Ou.TableCellNode,Ou.TableRowNode,ig.AutoLinkNode,ig.LinkNode,NE.HorizontalRuleNode]}}const Ru={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function EE({serializedAST:e,nodeClassNames:t}){return ft.jsx(qN.LexicalComposer,{initialConfig:CE(e,t),children:ft.jsx("div",{className:`${Ru["editor-inner"]} ${Ru["no-border"]}`,children:ft.jsxs("div",{className:Ru["editor-inner"],children:[ft.jsx(pC.RichTextPlugin,{contentEditable:ft.jsx(NC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:vC,placeholder:ft.jsx("div",{})}),ft.jsx(YC,{}),ft.jsx(MC.ListPlugin,{}),ft.jsx(PC.LinkPlugin,{}),ft.jsx(KC.TablePlugin,{}),ft.jsx(JC,{}),ft.jsx(sE,{maxDepth:7})]})})})}function yc(e,t,n,r){const l=e.length;let d=0,f;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,r.length<1e4)f=Array.from(r),f.unshift(t,n),[].splice.apply(e,f);else for(n&&[].splice.apply(e,[t,n]);d<r.length;)f=r.slice(d,d+1e4),f.unshift(t,0),[].splice.apply(e,f),d+=1e4,t+=1e4}function js(e,t){return e.length>0?(yc(e,e.length,0,t),e):t}const hg={}.hasOwnProperty;function Gp(e){const t={};let n=-1;for(;++n<e.length;)TE(t,e[n]);return t}function TE(e,t){let n;for(n in t){const l=(hg.call(e,n)?e[n]:void 0)||(e[n]={}),d=t[n];let f;for(f in d){hg.call(l,f)||(l[f]=[]);const p=d[f];xE(l[f],Array.isArray(p)?p:p?[p]:[])}}}function xE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yc(e,0,0,r)}const eo={plusSign:43,caret:94,tilde:126};var gg=Object.prototype.hasOwnProperty;function pg(e,t,n){for(n of e.keys())if(ia(n,t))return n}function ia(e,t){var n,r,l;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ia(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(l=r,l&&typeof l=="object"&&(l=pg(t,l),!l)||!t.has(l))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(l=r[0],l&&typeof l=="object"&&(l=pg(t,l),!l)||!ia(r[1],t.get(l)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(gg.call(e,n)&&++r&&!gg.call(t,n)||!(n in t)||!ia(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}let Vu,Yp,jp,Vp,qp=!0;typeof process<"u"&&({FORCE_COLOR:Vu,NODE_DISABLE_COLORS:Yp,NO_COLOR:jp,TERM:Vp}=process.env||{},qp=process.stdout&&process.stdout.isTTY);const Xt={enabled:!Yp&&jp==null&&Vp!=="dumb"&&(Vu!=null&&Vu!=="0"||qp),reset:_n(0,0),bold:_n(1,22),dim:_n(2,22),italic:_n(3,23),underline:_n(4,24),inverse:_n(7,27),hidden:_n(8,28),strikethrough:_n(9,29),black:_n(30,39),red:_n(31,39),green:_n(32,39),yellow:_n(33,39),blue:_n(34,39),magenta:_n(35,39),cyan:_n(36,39),white:_n(37,39),gray:_n(90,39),grey:_n(90,39),bgBlack:_n(40,49),bgRed:_n(41,49),bgGreen:_n(42,49),bgYellow:_n(43,49),bgBlue:_n(44,49),bgMagenta:_n(45,49),bgCyan:_n(46,49),bgWhite:_n(47,49)};function mg(e,t){let n=0,r,l="",d="";for(;n<e.length;n++)r=e[n],l+=r.open,d+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return l+t+d}function vE(e,t){let n={has:e,keys:t};return n.reset=Xt.reset.bind(n),n.bold=Xt.bold.bind(n),n.dim=Xt.dim.bind(n),n.italic=Xt.italic.bind(n),n.underline=Xt.underline.bind(n),n.inverse=Xt.inverse.bind(n),n.hidden=Xt.hidden.bind(n),n.strikethrough=Xt.strikethrough.bind(n),n.black=Xt.black.bind(n),n.red=Xt.red.bind(n),n.green=Xt.green.bind(n),n.yellow=Xt.yellow.bind(n),n.blue=Xt.blue.bind(n),n.magenta=Xt.magenta.bind(n),n.cyan=Xt.cyan.bind(n),n.white=Xt.white.bind(n),n.gray=Xt.gray.bind(n),n.grey=Xt.grey.bind(n),n.bgBlack=Xt.bgBlack.bind(n),n.bgRed=Xt.bgRed.bind(n),n.bgGreen=Xt.bgGreen.bind(n),n.bgYellow=Xt.bgYellow.bind(n),n.bgBlue=Xt.bgBlue.bind(n),n.bgMagenta=Xt.bgMagenta.bind(n),n.bgCyan=Xt.bgCyan.bind(n),n.bgWhite=Xt.bgWhite.bind(n),n}function _n(e,t){let n={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),r===void 0?this:Xt.enabled?mg(this.keys,r+""):r+""):r===void 0?vE([e],[n]):Xt.enabled?mg([n],r+""):r+""}}function wo(){}wo.prototype={diff:function(t,n){var r,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=l.callback;typeof l=="function"&&(d=l,l={}),this.options=l;var f=this;function p(H){return d?(setTimeout(function(){d(void 0,H)},0),!0):H}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var _=n.length,T=t.length,E=1,S=_+T;l.maxEditLength&&(S=Math.min(S,l.maxEditLength));var w=(r=l.timeout)!==null&&r!==void 0?r:1/0,M=Date.now()+w,m=[{oldPos:-1,lastComponent:void 0}],v=this.extractCommon(m[0],n,t,0);if(m[0].oldPos+1>=T&&v+1>=_)return p([{value:this.join(n),count:n.length}]);var k=-1/0,G=1/0;function I(){for(var H=Math.max(k,-E);H<=Math.min(G,E);H+=2){var j=void 0,re=m[H-1],te=m[H+1];re&&(m[H-1]=void 0);var ce=!1;if(te){var V=te.oldPos-H;ce=te&&0<=V&&V<_}var z=re&&re.oldPos+1<T;if(!ce&&!z){m[H]=void 0;continue}if(!z||ce&&re.oldPos+1<te.oldPos?j=f.addToPath(te,!0,void 0,0):j=f.addToPath(re,void 0,!0,1),v=f.extractCommon(j,n,t,H),j.oldPos+1>=T&&v+1>=_)return p(SE(f,j.lastComponent,n,t,f.useLongestToken));m[H]=j,j.oldPos+1>=T&&(G=Math.min(G,H-1)),v+1>=_&&(k=Math.max(k,H+1))}E++}if(d)(function H(){setTimeout(function(){if(E>S||Date.now()>M)return d();I()||H()},0)})();else for(;E<=S&&Date.now()<=M;){var P=I();if(P)return P}},addToPath:function(t,n,r,l){var d=t.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:t.oldPos+l,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:t.oldPos+l,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(t,n,r,l){for(var d=n.length,f=r.length,p=t.oldPos,_=p-l,T=0;_+1<d&&p+1<f&&this.equals(n[_+1],r[p+1]);)_++,p++,T++;return T&&(t.lastComponent={count:T,previousComponent:t.lastComponent}),t.oldPos=p,_},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function SE(e,t,n,r,l){for(var d=[],f;t;)d.push(t),f=t.previousComponent,delete t.previousComponent,t=f;d.reverse();for(var p=0,_=d.length,T=0,E=0;p<_;p++){var S=d[p];if(S.removed){if(S.value=e.join(r.slice(E,E+S.count)),E+=S.count,p&&d[p-1].added){var M=d[p-1];d[p-1]=d[p],d[p]=M}}else{if(!S.added&&l){var w=n.slice(T,T+S.count);w=w.map(function(v,k){var G=r[E+k];return G.length>v.length?G:v}),S.value=e.join(w)}else S.value=e.join(n.slice(T,T+S.count));T+=S.count,S.added||(E+=S.count)}}var m=d[_-1];return _>1&&typeof m.value=="string"&&(m.added||m.removed)&&e.equals("",m.value)&&(d[_-2].value+=m.value,d.pop()),d}var _g=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,yg=/\S/,Zp=new wo;Zp.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!yg.test(e)&&!yg.test(t)};Zp.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&_g.test(t[n])&&_g.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Jp=new wo;Jp.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
101
+ `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var l=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),t.push(l))}return t};var wE=new wo;wE.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var OE=new wo;OE.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ic(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ic=function(t){return typeof t}:ic=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ic(e)}var DE=Object.prototype.toString,sa=new wo;sa.useLongestToken=!0;sa.tokenize=Jp.tokenize;sa.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,l=r===void 0?function(d,f){return typeof f>"u"?n:f}:r;return typeof e=="string"?e:JSON.stringify(qu(e,null,null,l),l," ")};sa.equals=function(e,t){return wo.prototype.equals.call(sa,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function qu(e,t,n,r,l){t=t||[],n=n||[],r&&(e=r(l,e));var d;for(d=0;d<t.length;d+=1)if(t[d]===e)return n[d];var f;if(DE.call(e)==="[object Array]"){for(t.push(e),f=new Array(e.length),n.push(f),d=0;d<e.length;d+=1)f[d]=qu(e[d],t,n,r,l);return t.pop(),n.pop(),f}if(e&&e.toJSON&&(e=e.toJSON()),ic(e)==="object"&&e!==null){t.push(e),f={},n.push(f);var p=[],_;for(_ in e)e.hasOwnProperty(_)&&p.push(_);for(p.sort(),d=0;d<p.length;d+=1)_=p[d],f[_]=qu(e[_],t,n,r,_);t.pop(),n.pop()}else f=e;return f}var Zu=new wo;Zu.tokenize=function(e){return e.slice()};Zu.join=Zu.removeEmpty=function(e){return e};Xt.red,Xt.grey,Xt.green;Xt.dim().italic;Xt.dim("→");Xt.dim("·");Xt.dim("↵");function uc(e){e=e.replace(/\r?\n/g,`
102
+ `);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,l=(t||[]).length;for(;n<l;n++)r=Math.min(r,t[n].length);return l&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class AE extends Error{constructor(t={}){super(t.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=t.details||!1,this.generated=!!t.generated,this.operator=t.operator,this.expects=t.expects,this.actual=t.actual}}function ti(e,t,n,r,l,d,f){if(e)return;let p=f||d;if(f instanceof Error)throw f;let _=l;throw new AE({actual:t,expects:n,operator:r,message:p,details:_,generated:!f})}function Nc(e,t){ti(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}function to(e,t){ti(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}to.ok=to;to.equal=function(e,t,n){ti(!ia(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};to.type=function(e,t,n){let r=typeof e;ti(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};to.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";ti(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};to.snapshot=function(e,t,n){e=uc(e),t=uc(t),ti(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};to.fixture=function(e,t,n){e=uc(e),t=uc(t),ti(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};to.match=function(e,t,n){typeof t=="string"?ti(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):ti(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};to.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?ti(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?ti(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||ti(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const ME=/[!-\/:-@\[-`\{-~\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]/,RE=Oo(/[A-Za-z]/),Ju=Oo(/[\dA-Za-z]/),bE=Oo(/[#-'*+\--9=?A-Z^-~]/);function LE(e){return e!==null&&(e<32||e===127)}const IE=Oo(/\d/),kE=Oo(/[\dA-Fa-f]/),PE=Oo(/[!-/:-@[-`{-~]/);function $E(e){return e!==null&&e<-2}function Xp(e){return e!==null&&(e<0||e===32)}function FE(e){return e===-2||e===-1||e===32}const BE=Oo(ME),HE=Oo(/\s/);function Oo(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function la(e){if(e===null||Xp(e)||HE(e))return 1;if(BE(e))return 2}const dc={characterGroupPunctuation:2};function WE(e,t){const n=this.previous,r=la(n);return l;function l(f){return Nc(f===eo.tilde,"expected `~`"),e.enter("tildeSequenceTemporary"),d(f)}function d(f){if(f===eo.tilde)return e.consume(f),d;const p=e.exit("tildeSequenceTemporary"),_=la(f);return p._open=!_||_===dc.characterGroupPunctuation&&!!r,p._close=!r||r===dc.characterGroupPunctuation&&!!_,t(f)}}function Qp(e,t,n){const r=[];let l=-1;for(;++l<e.length;){const d=e[l].resolveAll;d&&!r.includes(d)&&(t=d(t,n),r.push(d))}return t}const KE={data:"data"};function Td(e,t){return!!(e[0]==="enter"&&e[1].type===`${t}SequenceTemporary`&&e[1]._close)}function xd(e,t){return!!(e[0]==="exit"&&e[1].type===`${t}SequenceTemporary`&&e[1]._open)}function vd(e,t,n,r,l,d){const[f,p,_,T]=zE(e[t],e[n],l,d);e[t][1].end=Object.assign({},f.start),e[n][1].start=Object.assign({},p.end);let E=[];e[t][1].end.offset-e[t][1].start.offset&&(E=js(E,[["enter",e[t][1],r],["exit",e[t][1],r]])),E=js(E,[["enter",T,r],["enter",f,r],["exit",f,r],["enter",_,r]]),E=js(E,Qp(r.parser.constructs.insideSpan.null,e.slice(t+1,n),r)),E=js(E,[["exit",_,r],["enter",p,r],["exit",p,r],["exit",T,r]]);let S=0;return e[n][1].end.offset-e[n][1].start.offset&&(S=2,E=js(E,[["enter",e[n][1],r],["exit",e[n][1],r]])),yc(e,t-1,n-t+3,E),t+E.length-S-2}function zE(e,t,n,r){const l=Object.assign({},e[1].end),d=Object.assign({},t[1].start);Ng(l,-r),Ng(d,r);const f={type:`${n}Sequence`,start:l,end:Object.assign({},e[1].end)},p={type:`${n}Sequence`,start:Object.assign({},t[1].start),end:d},_={type:`${n}Text`,start:Object.assign({},e[1].end),end:Object.assign({},t[1].start)},T={type:`${n}`,start:Object.assign({},f.start),end:Object.assign({},p.end)};return[f,p,_,T]}function Ng(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Sd(e,t){e.forEach(n=>{n[1].type===`${t}SequenceTemporary`&&(n[1].type=KE.data)})}function UE(e,t){let n=-1;for(;++n<e.length;)if(Td(e[n],"tilde")){let r=n;for(;r--;)if(xd(e[r],"tilde")){const l=GE(e[r],e[n]);n=vd(e,r,n,t,l===1?"subscript":"strikethrough",l);break}}return Sd(e,"tilde"),e}function GE(e,t){const n=e[1].end.offset-e[1].start.offset,r=t[1].end.offset-t[1].start.offset;return n<3||r<3?r<n?r:n:r%2===0?2:1}function YE(){const e={tokenize:WE,resolveAll:UE};return{text:{[eo.tilde]:e},insideSpan:{null:[e]}}}function jE(e,t){let n=-1;for(;++n<e.length;)if(Td(e[n],"superscript")){let r=n;for(;r--;)if(xd(e[r],"superscript")){n=vd(e,r,n,t,"superscript",1);break}}return Sd(e,"superscript"),e}function VE(e,t){return n;function n(l){return Nc(l===eo.caret,"expected `^`"),e.enter("superscriptSequenceTemporary"),r(l)}function r(l){if(l===eo.caret)return e.consume(l),r;const d=e.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,t(l)}}function qE(){const e={tokenize:VE,resolveAll:jE};return{text:{[eo.caret]:e},insideSpan:{null:[e]}}}function ZE(e,t,n){const r=this.previous,l=la(r);let d=0;return f;function f(_){return Nc(_===eo.plusSign,"expected `+`"),e.enter("underlineSequenceTemporary"),p(_)}function p(_){if(_===eo.plusSign)return e.consume(_),d++,p;if(d<2)return n(_);const T=e.exit("underlineSequenceTemporary"),E=la(_);return T._open=!E||E===dc.characterGroupPunctuation&&!!l,T._close=!l||l===dc.characterGroupPunctuation&&!!E,t(_)}}function JE(e,t){let n=-1;for(;++n<e.length;)if(Td(e[n],"underline")&&e[n][1].end.offset-e[n][1].start.offset>1){let r=n;for(;r--;)if(xd(e[r],"underline")&&e[r][1].end.offset-e[r][1].start.offset>1){n=vd(e,r,n,t,"underline",2);break}}return Sd(e,"underline"),e}function XE(){const e={tokenize:ZE,resolveAll:JE};return{text:{[eo.plusSign]:e},insideSpan:{null:[e]}}}function QE(){return Gp([XE(),qE(),YE()])}const eT={canContainEols:["strikethrough"],enter:{strikethrough:tT},exit:{strikethrough:nT}};function tT(e){this.enter({type:"strikethrough",children:[]},e)}function nT(e){this.exit(e)}const rT={canContainEols:["subscript"],enter:{subscript:iT},exit:{subscript:oT}};function iT(e){this.enter({type:"subscript",children:[]},e)}function oT(e){this.exit(e)}const sT={canContainEols:["superscript"],enter:{superscript:lT},exit:{superscript:aT}};function lT(e){this.enter({type:"superscript",children:[]},e)}function aT(e){this.exit(e)}const cT={canContainEols:["underline"],enter:{underline:uT},exit:{underline:dT}};function uT(e){this.enter({type:"underline",children:[]},e)}function dT(e){this.exit(e)}function fT(){return[cT,eT,rT,sT]}function hT(){const e=this.data();t("micromarkExtensions",QE()),t("fromMarkdownExtensions",fT());function t(n,r){const l=e[n];l?(Nc(Array.isArray(l)),l.push(r)):e[n]=[r]}}function gT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function pT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
103
+ `}]}function mT(e,t){const n=t.value?t.value+`
104
+ `:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,l={};r&&(l.className=["language-"+r]);let d={type:"element",tagName:"code",properties:l,children:[{type:"text",value:n}]};return t.meta&&(d.data={meta:t.meta}),e.patch(t,d),d=e.applyData(t,d),d={type:"element",tagName:"pre",properties:{},children:[d]},e.patch(t,d),d}function _T(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sl(e){const t=[];let n=-1,r=0,l=0;for(;++n<e.length;){const d=e.charCodeAt(n);let f="";if(d===37&&Ju(e.charCodeAt(n+1))&&Ju(e.charCodeAt(n+2)))l=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(f=String.fromCharCode(d));else if(d>55295&&d<57344){const p=e.charCodeAt(n+1);d<56320&&p>56319&&p<57344?(f=String.fromCharCode(d,p),l=1):f="�"}else f=String.fromCharCode(d);f&&(t.push(e.slice(r,n),encodeURIComponent(f)),r=n+l+1,f=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function em(e,t){const n=String(t.identifier).toUpperCase(),r=sl(n.toLowerCase()),l=e.footnoteOrder.indexOf(n);let d;l===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,d=e.footnoteOrder.length):(e.footnoteCounts[n]++,d=l+1);const f=e.footnoteCounts[n],p={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,p);const _={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,_),e.applyData(t,_)}function NT(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const l=String(r);return n[l]={type:"footnoteDefinition",identifier:l,children:[{type:"paragraph",children:t.children}],position:t.position},em(e,{type:"footnoteReference",identifier:l,position:t.position})}function CT(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ET(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function tm(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const l=e.all(t),d=l[0];d&&d.type==="text"?d.value="["+d.value:l.unshift({type:"text",value:"["});const f=l[l.length-1];return f&&f.type==="text"?f.value+=r:l.push({type:"text",value:r}),l}function TT(e,t){const n=e.definition(t.identifier);if(!n)return tm(e,t);const r={src:sl(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,l),e.applyData(t,l)}function xT(e,t){const n={src:sl(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function vT(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function ST(e,t){const n=e.definition(t.identifier);if(!n)return tm(e,t);const r={href:sl(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function wT(e,t){const n={href:sl(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function OT(e,t,n){const r=e.all(t),l=n?DT(n):nm(t),d={},f=[];if(typeof t.checked=="boolean"){const E=r[0];let S;E&&E.type==="element"&&E.tagName==="p"?S=E:(S={type:"element",tagName:"p",properties:{},children:[]},r.unshift(S)),S.children.length>0&&S.children.unshift({type:"text",value:" "}),S.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const E=r[p];(l||p!==0||E.type!=="element"||E.tagName!=="p")&&f.push({type:"text",value:`
105
+ `}),E.type==="element"&&E.tagName==="p"&&!l?f.push(...E.children):f.push(E)}const _=r[r.length-1];_&&(l||_.type!=="element"||_.tagName!=="p")&&f.push({type:"text",value:`
106
+ `});const T={type:"element",tagName:"li",properties:d,children:f};return e.patch(t,T),e.applyData(t,T)}function DT(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=nm(n[r])}return t}function nm(e){const t=e.spread;return t??e.children.length>1}function AT(e,t){const n={},r=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<r.length;){const f=r[l];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const d={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,d),e.applyData(t,d)}function MT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function bT(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const wd=rm("start"),Od=rm("end");function LT(e){return{start:wd(e),end:Od(e)}}function rm(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function IT(e,t){const n=e.all(t),r=n.shift(),l=[];if(r){const f={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],f),l.push(f)}if(n.length>0){const f={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},p=wd(t.children[1]),_=Od(t.children[t.children.length-1]);p.line&&_.line&&(f.position={start:p,end:_}),l.push(f)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,d),e.applyData(t,d)}function kT(e,t,n){const r=n?n.children:void 0,d=(r?r.indexOf(t):1)===0?"th":"td",f=n&&n.type==="table"?n.align:void 0,p=f?f.length:t.children.length;let _=-1;const T=[];for(;++_<p;){const S=t.children[_],w={},M=f?f[_]:void 0;M&&(w.align=M);let m={type:"element",tagName:d,properties:w,children:[]};S&&(m.children=e.all(S),e.patch(S,m),m=e.applyData(t,m)),T.push(m)}const E={type:"element",tagName:"tr",properties:{},children:e.wrap(T,!0)};return e.patch(t,E),e.applyData(t,E)}function PT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Cg=9,Eg=32;function $T(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),l=0;const d=[];for(;r;)d.push(Tg(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return d.push(Tg(t.slice(l),l>0,!1)),d.join("")}function Tg(e,t,n){let r=0,l=e.length;if(t){let d=e.codePointAt(r);for(;d===Cg||d===Eg;)r++,d=e.codePointAt(r)}if(n){let d=e.codePointAt(l-1);for(;d===Cg||d===Eg;)l--,d=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}function FT(e,t){const n={type:"text",value:$T(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function BT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const HT={blockquote:gT,break:pT,code:mT,delete:_T,emphasis:yT,footnoteReference:em,footnote:NT,heading:CT,html:ET,imageReference:TT,image:xT,inlineCode:vT,linkReference:ST,link:wT,listItem:OT,list:AT,paragraph:MT,root:RT,strong:bT,table:IT,tableCell:PT,tableRow:kT,text:FT,thematicBreak:BT,toml:Ja,yaml:Ja,definition:Ja,footnoteDefinition:Ja};function Ja(){return null}const im=function(e){if(e==null)return UT;if(typeof e=="string")return zT(e);if(typeof e=="object")return Array.isArray(e)?WT(e):KT(e);if(typeof e=="function")return Cc(e);throw new Error("Expected function, string, or object as test")};function WT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=im(e[n]);return Cc(r);function r(...l){let d=-1;for(;++d<t.length;)if(t[d].call(this,...l))return!0;return!1}}function KT(e){return Cc(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function zT(e){return Cc(t);function t(n){return n&&n.type===e}}function Cc(e){return t;function t(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&e.call(this,n,...r))}}function UT(){return!0}const GT=!0,xg=!1,YT="skip",jT=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const l=im(t),d=r?-1:1;f(e,void 0,[])();function f(p,_,T){const E=p&&typeof p=="object"?p:{};if(typeof E.type=="string"){const w=typeof E.tagName=="string"?E.tagName:typeof E.name=="string"?E.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(p.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=[],M,m,v;if((!t||l(p,_,T[T.length-1]||null))&&(w=VT(n(p,T)),w[0]===xg))return w;if(p.children&&w[0]!==YT)for(m=(r?p.children.length:-1)+d,v=T.concat(p);m>-1&&m<p.children.length;){if(M=f(p.children[m],m,v)(),M[0]===xg)return M;m=typeof M[1]=="number"?M[1]:m+d}return w}}};function VT(e){return Array.isArray(e)?e:typeof e=="number"?[GT,e]:[e]}const Dd=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),jT(e,t,l,r);function l(d,f){const p=f[f.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function qT(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const vg={}.hasOwnProperty;function ZT(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Dd(e,"definition",r=>{const l=Sg(r.identifier);l&&!vg.call(t,l)&&(t[l]=r)}),n;function n(r){const l=Sg(r);return l&&vg.call(t,l)?t[l]:null}}function Sg(e){return String(e||"").toUpperCase()}const fc={}.hasOwnProperty;function JT(e,t){const n=t||{},r=n.allowDangerousHtml||!1,l={};return f.dangerous=r,f.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,f.footnoteLabel=n.footnoteLabel||"Footnotes",f.footnoteLabelTagName=n.footnoteLabelTagName||"h2",f.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},f.footnoteBackLabel=n.footnoteBackLabel||"Back to content",f.unknownHandler=n.unknownHandler,f.passThrough=n.passThrough,f.handlers={...HT,...n.handlers},f.definition=ZT(e),f.footnoteById=l,f.footnoteOrder=[],f.footnoteCounts={},f.patch=XT,f.applyData=QT,f.one=p,f.all=_,f.wrap=tx,f.augment=d,Dd(e,"footnoteDefinition",T=>{const E=String(T.identifier).toUpperCase();fc.call(l,E)||(l[E]=T)}),f;function d(T,E){if(T&&"data"in T&&T.data){const S=T.data;S.hName&&(E.type!=="element"&&(E={type:"element",tagName:"",properties:{},children:[]}),E.tagName=S.hName),E.type==="element"&&S.hProperties&&(E.properties={...E.properties,...S.hProperties}),"children"in E&&E.children&&S.hChildren&&(E.children=S.hChildren)}if(T){const S="type"in T?T:{position:T};qT(S)||(E.position={start:wd(S),end:Od(S)})}return E}function f(T,E,S,w){return Array.isArray(S)&&(w=S,S={}),d(T,{type:"element",tagName:E,properties:S||{},children:w||[]})}function p(T,E){return om(f,T,E)}function _(T){return ro(f,T)}}function XT(e,t){e.position&&(t.position=LT(e))}function QT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,l=e.data.hChildren,d=e.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&&l!==null&&l!==void 0&&(n.children=l)}return n}function om(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return fc.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:ro(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):ex(e,t)}function ro(e,t){const n=[];if("children"in t){const r=t.children;let l=-1;for(;++l<r.length;){const d=om(e,r[l],t);if(d){if(l&&r[l-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=d.value.replace(/^\s+/,"")),!Array.isArray(d)&&d.type==="element")){const f=d.children[0];f&&f.type==="text"&&(f.value=f.value.replace(/^\s+/,""))}Array.isArray(d)?n.push(...d):n.push(d)}}}return n}function ex(e,t){const n=t.data||{},r="value"in t&&!(fc.call(n,"hProperties")||fc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:ro(e,t)};return e.patch(t,r),e.applyData(t,r)}function tx(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
107
+ `});++r<e.length;)r&&n.push({type:"text",value:`
108
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
109
+ `}),n}const nx=(e,t)=>e(t,"i",ro(e,t)),rx=(e,t)=>e(t,"b",ro(e,t)),ix=(e,t)=>e(t,"u",ro(e,t)),ox=(e,t)=>e(t,"s",ro(e,t)),sx=(e,t)=>e(t,"sub",ro(e,t)),lx=(e,t)=>e(t,"sup",ro(e,t)),ax={emphasis:nx,strong:rx,underline:ix,strikethrough:ox,subscript:sx,superscript:lx},cx=e=>{const[t,n]=rt.useState();let r;return rt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-Dpvz9qZ8.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[hT],remarkRehypeOptions:{handlers:ax}});n(d)})()},[e.markdown]),t||null};class us extends Error{}class ux extends us{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class dx extends us{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class fx extends us{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class qs extends us{}class sm extends us{constructor(t){super(`Invalid unit ${t}`)}}class _r extends us{}class No extends us{constructor(){super("Zone is an abstract class")}}const lt="numeric",pi="short",Gr="long",hc={year:lt,month:lt,day:lt},lm={year:lt,month:pi,day:lt},hx={year:lt,month:pi,day:lt,weekday:pi},am={year:lt,month:Gr,day:lt},cm={year:lt,month:Gr,day:lt,weekday:Gr},um={hour:lt,minute:lt},dm={hour:lt,minute:lt,second:lt},fm={hour:lt,minute:lt,second:lt,timeZoneName:pi},hm={hour:lt,minute:lt,second:lt,timeZoneName:Gr},gm={hour:lt,minute:lt,hourCycle:"h23"},pm={hour:lt,minute:lt,second:lt,hourCycle:"h23"},mm={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:pi},_m={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:Gr},ym={year:lt,month:lt,day:lt,hour:lt,minute:lt},Nm={year:lt,month:lt,day:lt,hour:lt,minute:lt,second:lt},Cm={year:lt,month:pi,day:lt,hour:lt,minute:lt},Em={year:lt,month:pi,day:lt,hour:lt,minute:lt,second:lt},gx={year:lt,month:pi,day:lt,weekday:pi,hour:lt,minute:lt},Tm={year:lt,month:Gr,day:lt,hour:lt,minute:lt,timeZoneName:pi},xm={year:lt,month:Gr,day:lt,hour:lt,minute:lt,second:lt,timeZoneName:pi},vm={year:lt,month:Gr,day:lt,weekday:Gr,hour:lt,minute:lt,timeZoneName:Gr},Sm={year:lt,month:Gr,day:lt,weekday:Gr,hour:lt,minute:lt,second:lt,timeZoneName:Gr};class ca{get type(){throw new No}get name(){throw new No}get ianaName(){return this.name}get isUniversal(){throw new No}offsetName(t,n){throw new No}formatOffset(t,n){throw new No}offset(t){throw new No}equals(t){throw new No}get isValid(){throw new No}}let bu=null;class Ec extends ca{static get instance(){return bu===null&&(bu=new Ec),bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Im(t,n,r)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let oc={};function px(e){return oc[e]||(oc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),oc[e]}const mx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function _x(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,l,d,f,p,_,T,E]=r;return[f,l,d,p,_,T,E]}function yx(e,t){const n=e.formatToParts(t),r=[];for(let l=0;l<n.length;l++){const{type:d,value:f}=n[l],p=mx[d];d==="era"?r[p]=f:It(p)||(r[p]=parseInt(f,10))}return r}let Xa={};class no extends ca{static create(t){return Xa[t]||(Xa[t]=new no(t)),Xa[t]}static resetCache(){Xa={},oc={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=no.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Im(t,n,r,this.name)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=px(this.name);let[l,d,f,p,_,T,E]=r.formatToParts?yx(r,n):_x(r,n);p==="BC"&&(l=-Math.abs(l)+1);const w=xc({year:l,month:d,day:f,hour:_===24?0:_,minute:T,second:E,millisecond:0});let M=+n;const m=M%1e3;return M-=m>=0?m:1e3+m,(w-M)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let wg={};function Nx(e,t={}){const n=JSON.stringify([e,t]);let r=wg[n];return r||(r=new Intl.ListFormat(e,t),wg[n]=r),r}let Xu={};function Qu(e,t={}){const n=JSON.stringify([e,t]);let r=Xu[n];return r||(r=new Intl.DateTimeFormat(e,t),Xu[n]=r),r}let ed={};function Cx(e,t={}){const n=JSON.stringify([e,t]);let r=ed[n];return r||(r=new Intl.NumberFormat(e,t),ed[n]=r),r}let td={};function Ex(e,t={}){const{base:n,...r}=t,l=JSON.stringify([e,r]);let d=td[l];return d||(d=new Intl.RelativeTimeFormat(e,t),td[l]=d),d}let ta=null;function Tx(){return ta||(ta=new Intl.DateTimeFormat().resolvedOptions().locale,ta)}let Og={};function xx(e){let t=Og[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Og[e]=t}return t}function vx(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,l;try{r=Qu(e).resolvedOptions(),l=e}catch{const _=e.substring(0,n);r=Qu(_).resolvedOptions(),l=_}const{numberingSystem:d,calendar:f}=r;return[l,d,f]}}function Sx(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function wx(e){const t=[];for(let n=1;n<=12;n++){const r=Dt.utc(2009,n,1);t.push(e(r))}return t}function Ox(e){const t=[];for(let n=1;n<=7;n++){const r=Dt.utc(2016,11,13+n);t.push(e(r))}return t}function Qa(e,t,n,r){const l=e.listingMode();return l==="error"?null:l==="en"?n(t):r(t)}function Dx(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class Ax{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:l,floor:d,...f}=r;if(!n||Object.keys(f).length>0){const p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=Cx(t,p)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):Ld(t,3);return zn(n,this.padTo)}}}class Mx{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const f=-1*(t.offset/60),p=f>=0?`Etc/GMT+${f}`:`Etc/GMT${f}`;t.offset!==0&&no.create(p).valid?(l=p,this.dt=t):(l="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,l=t.zone.name):(l="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||l,this.dtf=Qu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.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}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Rx{constructor(t,n,r){this.opts={style:"long",...r},!n&&bm()&&(this.rtf=Ex(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):ev(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const bx={firstDay:1,minimalDays:4,weekend:[6,7]};class an{static fromOpts(t){return an.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,l,d=!1){const f=t||Rn.defaultLocale,p=f||(d?"en-US":Tx()),_=n||Rn.defaultNumberingSystem,T=r||Rn.defaultOutputCalendar,E=nd(l)||Rn.defaultWeekSettings;return new an(p,_,T,E,f)}static resetCache(){ta=null,Xu={},ed={},td={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:l}={}){return an.create(t,n,r,l)}constructor(t,n,r,l,d){const[f,p,_]=vx(t);this.locale=f,this.numberingSystem=n||p||null,this.outputCalendar=r||_||null,this.weekSettings=l,this.intl=Sx(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=Dx(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:an.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,nd(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Qa(this,t,$m,()=>{const r=n?{month:t,day:"numeric"}:{month:t},l=n?"format":"standalone";return this.monthsCache[l][t]||(this.monthsCache[l][t]=wx(d=>this.extract(d,r,"month"))),this.monthsCache[l][t]})}weekdays(t,n=!1){return Qa(this,t,Hm,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},l=n?"format":"standalone";return this.weekdaysCache[l][t]||(this.weekdaysCache[l][t]=Ox(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[l][t]})}meridiems(){return Qa(this,void 0,()=>Wm,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Dt.utc(2016,11,13,9),Dt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Qa(this,t,Km,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[Dt.utc(-40,1,1),Dt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const l=this.dtFormatter(t,n),d=l.formatToParts(),f=d.find(p=>p.type.toLowerCase()===r);return f?f.value:null}numberFormatter(t={}){return new Ax(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Mx(t,this.intl,n)}relFormatter(t={}){return new Rx(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Nx(this.intl,t)}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:Lm()?xx(this.locale):bx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Lu=null;class xr extends ca{static get utcInstance(){return Lu===null&&(Lu=new xr(0)),Lu}static instance(t){return t===0?xr.utcInstance:new xr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new xr(vc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${oa(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${oa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return oa(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class Lx extends ca{constructor(t){super(),this.zoneName=t}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 To(e,t){if(It(e)||e===null)return t;if(e instanceof ca)return e;if(Bx(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ec.instance:n==="utc"||n==="gmt"?xr.utcInstance:xr.parseSpecifier(n)||no.create(e)}else return vo(e)?xr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Lx(e)}const Ad={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Dg={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]},Ix=Ad.hanidec.replace(/[\[|\]]/g,"").split("");function kx(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Ad.hanidec)!==-1)t+=Ix.indexOf(e[n]);else for(const l in Dg){const[d,f]=Dg[l];r>=d&&r<=f&&(t+=r-d)}}return parseInt(t,10)}else return t}let Vs={};function Px(){Vs={}}function fi({numberingSystem:e},t=""){const n=e||"latn";return Vs[n]||(Vs[n]={}),Vs[n][t]||(Vs[n][t]=new RegExp(`${Ad[n]}${t}`)),Vs[n][t]}let Ag=()=>Date.now(),Mg="system",Rg=null,bg=null,Lg=null,Ig=60,kg,Pg=null;class Rn{static get now(){return Ag}static set now(t){Ag=t}static set defaultZone(t){Mg=t}static get defaultZone(){return To(Mg,Ec.instance)}static get defaultLocale(){return Rg}static set defaultLocale(t){Rg=t}static get defaultNumberingSystem(){return bg}static set defaultNumberingSystem(t){bg=t}static get defaultOutputCalendar(){return Lg}static set defaultOutputCalendar(t){Lg=t}static get defaultWeekSettings(){return Pg}static set defaultWeekSettings(t){Pg=nd(t)}static get twoDigitCutoffYear(){return Ig}static set twoDigitCutoffYear(t){Ig=t%100}static get throwOnInvalid(){return kg}static set throwOnInvalid(t){kg=t}static resetCaches(){an.resetCache(),no.resetCache(),Dt.resetCache(),Px()}}class gi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const wm=[0,31,59,90,120,151,181,212,243,273,304,334],Om=[0,31,60,91,121,152,182,213,244,274,305,335];function Qr(e,t){return new gi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Md(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const l=r.getUTCDay();return l===0?7:l}function Dm(e,t,n){return n+(ua(e)?Om:wm)[t-1]}function Am(e,t){const n=ua(e)?Om:wm,r=n.findIndex(d=>d<t),l=t-n[r];return{month:r+1,day:l}}function Rd(e,t){return(e-t+7)%7+1}function gc(e,t=4,n=1){const{year:r,month:l,day:d}=e,f=Dm(r,l,d),p=Rd(Md(r,l,d),n);let _=Math.floor((f-p+14-t)/7),T;return _<1?(T=r-1,_=aa(T,t,n)):_>aa(r,t,n)?(T=r+1,_=1):T=r,{weekYear:T,weekNumber:_,weekday:p,...Sc(e)}}function $g(e,t=4,n=1){const{weekYear:r,weekNumber:l,weekday:d}=e,f=Rd(Md(r,1,t),n),p=Zs(r);let _=l*7+d-f-7+t,T;_<1?(T=r-1,_+=Zs(T)):_>p?(T=r+1,_-=Zs(r)):T=r;const{month:E,day:S}=Am(T,_);return{year:T,month:E,day:S,...Sc(e)}}function Iu(e){const{year:t,month:n,day:r}=e,l=Dm(t,n,r);return{year:t,ordinal:l,...Sc(e)}}function Fg(e){const{year:t,ordinal:n}=e,{month:r,day:l}=Am(t,n);return{year:t,month:r,day:l,...Sc(e)}}function Bg(e,t){if(!It(e.localWeekday)||!It(e.localWeekNumber)||!It(e.localWeekYear)){if(!It(e.weekday)||!It(e.weekNumber)||!It(e.weekYear))throw new qs("Cannot mix locale-based week fields with ISO-based week fields");return It(e.localWeekday)||(e.weekday=e.localWeekday),It(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),It(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function $x(e,t=4,n=1){const r=Tc(e.weekYear),l=ei(e.weekNumber,1,aa(e.weekYear,t,n)),d=ei(e.weekday,1,7);return r?l?d?!1:Qr("weekday",e.weekday):Qr("week",e.weekNumber):Qr("weekYear",e.weekYear)}function Fx(e){const t=Tc(e.year),n=ei(e.ordinal,1,Zs(e.year));return t?n?!1:Qr("ordinal",e.ordinal):Qr("year",e.year)}function Mm(e){const t=Tc(e.year),n=ei(e.month,1,12),r=ei(e.day,1,pc(e.year,e.month));return t?n?r?!1:Qr("day",e.day):Qr("month",e.month):Qr("year",e.year)}function Rm(e){const{hour:t,minute:n,second:r,millisecond:l}=e,d=ei(t,0,23)||t===24&&n===0&&r===0&&l===0,f=ei(n,0,59),p=ei(r,0,59),_=ei(l,0,999);return d?f?p?_?!1:Qr("millisecond",l):Qr("second",r):Qr("minute",n):Qr("hour",t)}function It(e){return typeof e>"u"}function vo(e){return typeof e=="number"}function Tc(e){return typeof e=="number"&&e%1===0}function Bx(e){return typeof e=="string"}function Hx(e){return Object.prototype.toString.call(e)==="[object Date]"}function bm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Lm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Wx(e){return Array.isArray(e)?e:[e]}function Hg(e,t,n){if(e.length!==0)return e.reduce((r,l)=>{const d=[t(l),l];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function Kx(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function el(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nd(e){if(e==null)return null;if(typeof e!="object")throw new _r("Week settings must be an object");if(!ei(e.firstDay,1,7)||!ei(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ei(t,1,7)))throw new _r("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ei(e,t,n){return Tc(e)&&e>=t&&e<=n}function zx(e,t){return e-t*Math.floor(e/t)}function zn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Eo(e){if(!(It(e)||e===null||e===""))return parseInt(e,10)}function es(e){if(!(It(e)||e===null||e===""))return parseFloat(e)}function bd(e){if(!(It(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Ld(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function ua(e){return e%4===0&&(e%100!==0||e%400===0)}function Zs(e){return ua(e)?366:365}function pc(e,t){const n=zx(t-1,12)+1,r=e+(t-n)/12;return n===2?ua(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function xc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Wg(e,t,n){return-Rd(Md(e,1,t),n)+t-1}function aa(e,t=4,n=1){const r=Wg(e,t,n),l=Wg(e+1,t,n);return(Zs(e)-r+l)/7}function rd(e){return e>99?e:e>Rn.twoDigitCutoffYear?1900+e:2e3+e}function Im(e,t,n,r=null){const l=new Date(e),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const f={timeZoneName:t,...d},p=new Intl.DateTimeFormat(n,f).formatToParts(l).find(_=>_.type.toLowerCase()==="timezonename");return p?p.value:null}function vc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,l=n<0||Object.is(n,-0)?-r:r;return n*60+l}function km(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new _r(`Invalid unit value ${e}`);return t}function mc(e,t){const n={};for(const r in e)if(el(e,r)){const l=e[r];if(l==null)continue;n[t(r)]=km(l)}return n}function oa(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),l=e>=0?"+":"-";switch(t){case"short":return`${l}${zn(n,2)}:${zn(r,2)}`;case"narrow":return`${l}${n}${r>0?`:${r}`:""}`;case"techie":return`${l}${zn(n,2)}${zn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Sc(e){return Kx(e,["hour","minute","second","millisecond"])}const Ux=["January","February","March","April","May","June","July","August","September","October","November","December"],Pm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Gx=["J","F","M","A","M","J","J","A","S","O","N","D"];function $m(e){switch(e){case"narrow":return[...Gx];case"short":return[...Pm];case"long":return[...Ux];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 Fm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Bm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Yx=["M","T","W","T","F","S","S"];function Hm(e){switch(e){case"narrow":return[...Yx];case"short":return[...Bm];case"long":return[...Fm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Wm=["AM","PM"],jx=["Before Christ","Anno Domini"],Vx=["BC","AD"],qx=["B","A"];function Km(e){switch(e){case"narrow":return[...qx];case"short":return[...Vx];case"long":return[...jx];default:return null}}function Zx(e){return Wm[e.hour<12?0:1]}function Jx(e,t){return Hm(t)[e.weekday-1]}function Xx(e,t){return $m(t)[e.month-1]}function Qx(e,t){return Km(t)[e.year<0?0:1]}function ev(e,t,n="always",r=!1){const l={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(e)===-1;if(n==="auto"&&d){const S=e==="days";switch(t){case 1:return S?"tomorrow":`next ${l[e][0]}`;case-1:return S?"yesterday":`last ${l[e][0]}`;case 0:return S?"today":`this ${l[e][0]}`}}const f=Object.is(t,-0)||t<0,p=Math.abs(t),_=p===1,T=l[e],E=r?_?T[1]:T[2]||T[1]:_?l[e][0]:e;return f?`${p} ${E} ago`:`in ${p} ${E}`}function Kg(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const tv={D:hc,DD:lm,DDD:am,DDDD:cm,t:um,tt:dm,ttt:fm,tttt:hm,T:gm,TT:pm,TTT:mm,TTTT:_m,f:ym,ff:Cm,fff:Tm,ffff:vm,F:Nm,FF:Em,FFF:xm,FFFF:Sm};class yr{static create(t,n={}){return new yr(t,n)}static parseFormat(t){let n=null,r="",l=!1;const d=[];for(let f=0;f<t.length;f++){const p=t.charAt(f);p==="'"?(r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),n=null,r="",l=!l):l||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:l||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return tv[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return zn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(M,m)=>this.loc.extract(t,M,m),f=M=>t.isOffsetFixed&&t.offset===0&&M.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,M.format):"",p=()=>r?Zx(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),_=(M,m)=>r?Xx(t,M):d(m?{month:M}:{month:M,day:"numeric"},"month"),T=(M,m)=>r?Jx(t,M):d(m?{weekday:M}:{weekday:M,month:"long",day:"numeric"},"weekday"),E=M=>{const m=yr.macroTokenToFormatOpts(M);return m?this.formatWithSystemDefault(t,m):M},S=M=>r?Qx(t,M):d({era:M},"era"),w=M=>{switch(M){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return f({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return f({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return f({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return p();case"d":return l?d({day:"numeric"},"day"):this.num(t.day);case"dd":return l?d({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return T("short",!0);case"cccc":return T("long",!0);case"ccccc":return T("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return T("short",!1);case"EEEE":return T("long",!1);case"EEEEE":return T("narrow",!1);case"L":return l?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return l?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return _("short",!0);case"LLLL":return _("long",!0);case"LLLLL":return _("narrow",!0);case"M":return l?d({month:"numeric"},"month"):this.num(t.month);case"MM":return l?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return _("short",!1);case"MMMM":return _("long",!1);case"MMMMM":return _("narrow",!1);case"y":return l?d({year:"numeric"},"year"):this.num(t.year);case"yy":return l?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return l?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return l?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return S("short");case"GG":return S("long");case"GGGGG":return S("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return E(M)}};return Kg(yr.parseFormat(n),w)}formatDurationFromString(t,n){const r=_=>{switch(_[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}},l=_=>T=>{const E=r(T);return E?this.num(_.get(E),T.length):T},d=yr.parseFormat(n),f=d.reduce((_,{literal:T,val:E})=>T?_:_.concat(E),[]),p=t.shiftTo(...f.map(r).filter(_=>_));return Kg(d,l(p))}}const zm=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ll(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function al(...e){return t=>e.reduce(([n,r,l],d)=>{const[f,p,_]=d(t,l);return[{...n,...f},p||r,_]},[{},null,1]).slice(0,2)}function cl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const l=n.exec(e);if(l)return r(l)}return[null,null]}function Um(...e){return(t,n)=>{const r={};let l;for(l=0;l<e.length;l++)r[e[l]]=Eo(t[n+l]);return[r,null,n+l]}}const Gm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,nv=`(?:${Gm.source}?(?:\\[(${zm.source})\\])?)?`,Id=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Ym=RegExp(`${Id.source}${nv}`),kd=RegExp(`(?:T${Ym.source})?`),rv=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,iv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ov=/(\d{4})-?(\d{3})/,sv=Um("weekYear","weekNumber","weekDay"),lv=Um("year","ordinal"),av=/(\d{4})-(\d\d)-(\d\d)/,jm=RegExp(`${Id.source} ?(?:${Gm.source}|(${zm.source}))?`),cv=RegExp(`(?: ${jm.source})?`);function Js(e,t,n){const r=e[t];return It(r)?n:Eo(r)}function uv(e,t){return[{year:Js(e,t),month:Js(e,t+1,1),day:Js(e,t+2,1)},null,t+3]}function ul(e,t){return[{hours:Js(e,t,0),minutes:Js(e,t+1,0),seconds:Js(e,t+2,0),milliseconds:bd(e[t+3])},null,t+4]}function da(e,t){const n=!e[t]&&!e[t+1],r=vc(e[t+1],e[t+2]),l=n?null:xr.instance(r);return[{},l,t+3]}function fa(e,t){const n=e[t]?no.create(e[t]):null;return[{},n,t+1]}const dv=RegExp(`^T?${Id.source}$`),fv=/^-?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 hv(e){const[t,n,r,l,d,f,p,_,T]=e,E=t[0]==="-",S=_&&_[0]==="-",w=(M,m=!1)=>M!==void 0&&(m||M&&E)?-M:M;return[{years:w(es(n)),months:w(es(r)),weeks:w(es(l)),days:w(es(d)),hours:w(es(f)),minutes:w(es(p)),seconds:w(es(_),_==="-0"),milliseconds:w(bd(T),S)}]}const gv={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 Pd(e,t,n,r,l,d,f){const p={year:t.length===2?rd(Eo(t)):Eo(t),month:Pm.indexOf(n)+1,day:Eo(r),hour:Eo(l),minute:Eo(d)};return f&&(p.second=Eo(f)),e&&(p.weekday=e.length>3?Fm.indexOf(e)+1:Bm.indexOf(e)+1),p}const pv=/^(?:(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 mv(e){const[,t,n,r,l,d,f,p,_,T,E,S]=e,w=Pd(t,l,r,n,d,f,p);let M;return _?M=gv[_]:T?M=0:M=vc(E,S),[w,new xr(M)]}function _v(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const yv=/^(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$/,Nv=/^(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$/,Cv=/^(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(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,l,r,n,d,f,p),xr.utcInstance]}function Ev(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,p,n,r,l,d,f),xr.utcInstance]}const Tv=ll(rv,kd),xv=ll(iv,kd),vv=ll(ov,kd),Sv=ll(Ym),Vm=al(uv,ul,da,fa),wv=al(sv,ul,da,fa),Ov=al(lv,ul,da,fa),Dv=al(ul,da,fa);function Av(e){return cl(e,[Tv,Vm],[xv,wv],[vv,Ov],[Sv,Dv])}function Mv(e){return cl(_v(e),[pv,mv])}function Rv(e){return cl(e,[yv,zg],[Nv,zg],[Cv,Ev])}function bv(e){return cl(e,[fv,hv])}const Lv=al(ul);function Iv(e){return cl(e,[dv,Lv])}const kv=ll(av,cv),Pv=ll(jm),$v=al(ul,da,fa);function Fv(e){return cl(e,[kv,Vm],[Pv,$v])}const Ug="Invalid Duration",qm={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}},Bv={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},...qm},Xr=146097/400,Us=146097/4800,Hv={years:{quarters:4,months:12,weeks:Xr/7,days:Xr,hours:Xr*24,minutes:Xr*24*60,seconds:Xr*24*60*60,milliseconds:Xr*24*60*60*1e3},quarters:{months:3,weeks:Xr/28,days:Xr/4,hours:Xr*24/4,minutes:Xr*24*60/4,seconds:Xr*24*60*60/4,milliseconds:Xr*24*60*60*1e3/4},months:{weeks:Us/7,days:Us,hours:Us*24,minutes:Us*24*60,seconds:Us*24*60*60,milliseconds:Us*24*60*60*1e3},...qm},ss=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Wv=ss.slice(0).reverse();function Co(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new en(r)}function Zm(e,t){let n=t.milliseconds??0;for(const r of Wv.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Gg(e,t){const n=Zm(e,t)<0?-1:1;ss.reduceRight((r,l)=>{if(It(t[l]))return r;if(r){const d=t[r]*n,f=e[l][r],p=Math.floor(d/f);t[l]+=p*n,t[r]-=p*f*n}return l},null),ss.reduce((r,l)=>{if(It(t[l]))return r;if(r){const d=t[r]%1;t[r]-=d,t[l]+=d*e[r][l]}return l},null)}function Kv(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class en{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?Hv:Bv;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||an.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return en.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new _r(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new en({values:mc(t,en.normalizeUnit),loc:an.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(vo(t))return en.fromMillis(t);if(en.isDuration(t))return t;if(typeof t=="object")return en.fromObject(t);throw new _r(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=bv(t);return r?en.fromObject(r,n):en.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Iv(t);return r?en.fromObject(r,n):en.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new _r("need to specify a reason the Duration is invalid");const r=t instanceof gi?t:new gi(t,n);if(Rn.throwOnInvalid)throw new fx(r);return new en({invalid:r})}static normalizeUnit(t){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"}[t&&t.toLowerCase()];if(!n)throw new sm(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?yr.create(this.loc,r).formatDurationFromString(this,t):Ug}toHuman(t={}){if(!this.isValid)return Ug;const n=ss.map(r=>{const l=this.values[r];return It(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(l)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Ld(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Dt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}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?Zm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t),r={};for(const l of ss)(el(n.values,l)||el(this.values,l))&&(r[l]=n.get(l)+this.get(l));return Co(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=km(t(this.values[r],r));return Co(this,{values:n},!0)}get(t){return this[en.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...mc(t,en.normalizeUnit)};return Co(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:l}={}){const f={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:l,conversionAccuracy:r};return Co(this,f)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Gg(this.matrix,t),Co(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Kv(this.normalize().shiftToAll().toObject());return Co(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(f=>en.normalizeUnit(f));const n={},r={},l=this.toObject();let d;for(const f of ss)if(t.indexOf(f)>=0){d=f;let p=0;for(const T in r)p+=this.matrix[T][f]*r[T],r[T]=0;vo(l[f])&&(p+=l[f]);const _=Math.trunc(p);n[f]=_,r[f]=(p*1e3-_*1e3)/1e3}else vo(l[f])&&(r[f]=l[f]);for(const f in r)r[f]!==0&&(n[d]+=f===d?r[f]:r[f]/this.matrix[d][f]);return Gg(this.matrix,n),Co(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 t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Co(this,{values:t},!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(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,l){return r===void 0||r===0?l===void 0||l===0:r===l}for(const r of ss)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Gs="Invalid Interval";function zv(e,t){return!e||!e.isValid?Mn.invalid("missing or invalid start"):!t||!t.isValid?Mn.invalid("missing or invalid end"):t<e?Mn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Mn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new _r("need to specify a reason the Interval is invalid");const r=t instanceof gi?t:new gi(t,n);if(Rn.throwOnInvalid)throw new dx(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Xl(t),l=Xl(n),d=zv(r,l);return d??new Mn({start:r,end:l})}static after(t,n){const r=en.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l,l.plus(r))}static before(t,n){const r=en.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l.minus(r),l)}static fromISO(t,n){const[r,l]=(t||"").split("/",2);if(r&&l){let d,f;try{d=Dt.fromISO(r,n),f=d.isValid}catch{f=!1}let p,_;try{p=Dt.fromISO(l,n),_=p.isValid}catch{_=!1}if(f&&_)return Mn.fromDateTimes(d,p);if(f){const T=en.fromISO(l,n);if(T.isValid)return Mn.after(d,T)}else if(_){const T=en.fromISO(r,n);if(T.isValid)return Mn.before(p,T)}}return Mn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.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(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let l;return n!=null&&n.useLocaleWeeks?l=this.end.reconfigure({locale:r.locale}):l=this.end,l=l.startOf(t,n),Math.floor(l.diff(r,t).get(t))+(l.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Mn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Xl).filter(f=>this.contains(f)).sort((f,p)=>f.toMillis()-p.toMillis()),r=[];let{s:l}=this,d=0;for(;l<this.e;){const f=n[d]||this.e,p=+f>+this.e?this.e:f;r.push(Mn.fromDateTimes(l,p)),l=p,d+=1}return r}splitBy(t){const n=en.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,l=1,d;const f=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(_=>_*l));d=+p>+this.e?this.e:p,f.push(Mn.fromDateTimes(r,d)),r=d,l+=1}return f}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Mn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Mn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((l,d)=>l.s-d.s).reduce(([l,d],f)=>d?d.overlaps(f)||d.abutsStart(f)?[l,d.union(f)]:[l.concat([d]),f]:[l,f],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const l=[],d=t.map(_=>[{time:_.s,type:"s"},{time:_.e,type:"e"}]),f=Array.prototype.concat(...d),p=f.sort((_,T)=>_.time-T.time);for(const _ of p)r+=_.type==="s"?1:-1,r===1?n=_.time:(n&&+n!=+_.time&&l.push(Mn.fromDateTimes(n,_.time)),n=null);return Mn.merge(l)}difference(...t){return Mn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Gs}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=hc,n={}){return this.isValid?yr.create(this.s.loc.clone(n),t).formatInterval(this):Gs}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Gs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Gs}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Gs}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Gs}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):en.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class ec{static hasDST(t=Rn.defaultZone){const n=Dt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return no.isValidZone(t)}static normalizeZone(t){return To(t,Rn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||an.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||an.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||an.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||an.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||an.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||an.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||an.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return an.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return an.create(n,null,"gregory").eras(t)}static features(){return{relative:bm(),localeWeek:Lm()}}}function Yg(e,t){const n=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(en.fromMillis(r).as("days"))}function Uv(e,t,n){const r=[["years",(_,T)=>T.year-_.year],["quarters",(_,T)=>T.quarter-_.quarter+(T.year-_.year)*4],["months",(_,T)=>T.month-_.month+(T.year-_.year)*12],["weeks",(_,T)=>{const E=Yg(_,T);return(E-E%7)/7}],["days",Yg]],l={},d=e;let f,p;for(const[_,T]of r)n.indexOf(_)>=0&&(f=_,l[_]=T(e,t),p=d.plus(l),p>t?(l[_]--,e=d.plus(l),e>t&&(p=e,l[_]--,e=d.plus(l))):e=p);return[e,l,p,f]}function Gv(e,t,n,r){let[l,d,f,p]=Uv(e,t,n);const _=t-l,T=n.filter(S=>["hours","minutes","seconds","milliseconds"].indexOf(S)>=0);T.length===0&&(f<t&&(f=l.plus({[p]:1})),f!==l&&(d[p]=(d[p]||0)+_/(f-l)));const E=en.fromObject(d,r);return T.length>0?en.fromMillis(_,r).shiftTo(...T).plus(E):E}const Yv="missing Intl.DateTimeFormat.formatToParts support";function on(e,t=n=>n){return{regex:e,deser:([n])=>t(kx(n))}}const jv=" ",Jm=`[ ${jv}]`,Xm=new RegExp(Jm,"g");function Vv(e){return e.replace(/\./g,"\\.?").replace(Xm,Jm)}function jg(e){return e.replace(/\./g,"").replace(Xm," ").toLowerCase()}function hi(e,t){return e===null?null:{regex:RegExp(e.map(Vv).join("|")),deser:([n])=>e.findIndex(r=>jg(n)===jg(r))+t}}function Vg(e,t){return{regex:e,deser:([,n,r])=>vc(n,r),groups:t}}function tc(e){return{regex:e,deser:([t])=>t}}function qv(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Zv(e,t){const n=fi(t),r=fi(t,"{2}"),l=fi(t,"{3}"),d=fi(t,"{4}"),f=fi(t,"{6}"),p=fi(t,"{1,2}"),_=fi(t,"{1,3}"),T=fi(t,"{1,6}"),E=fi(t,"{1,9}"),S=fi(t,"{2,4}"),w=fi(t,"{4,6}"),M=k=>({regex:RegExp(qv(k.val)),deser:([G])=>G,literal:!0}),v=(k=>{if(e.literal)return M(k);switch(k.val){case"G":return hi(t.eras("short"),0);case"GG":return hi(t.eras("long"),0);case"y":return on(T);case"yy":return on(S,rd);case"yyyy":return on(d);case"yyyyy":return on(w);case"yyyyyy":return on(f);case"M":return on(p);case"MM":return on(r);case"MMM":return hi(t.months("short",!0),1);case"MMMM":return hi(t.months("long",!0),1);case"L":return on(p);case"LL":return on(r);case"LLL":return hi(t.months("short",!1),1);case"LLLL":return hi(t.months("long",!1),1);case"d":return on(p);case"dd":return on(r);case"o":return on(_);case"ooo":return on(l);case"HH":return on(r);case"H":return on(p);case"hh":return on(r);case"h":return on(p);case"mm":return on(r);case"m":return on(p);case"q":return on(p);case"qq":return on(r);case"s":return on(p);case"ss":return on(r);case"S":return on(_);case"SSS":return on(l);case"u":return tc(E);case"uu":return tc(p);case"uuu":return on(n);case"a":return hi(t.meridiems(),0);case"kkkk":return on(d);case"kk":return on(S,rd);case"W":return on(p);case"WW":return on(r);case"E":case"c":return on(n);case"EEE":return hi(t.weekdays("short",!1),1);case"EEEE":return hi(t.weekdays("long",!1),1);case"ccc":return hi(t.weekdays("short",!0),1);case"cccc":return hi(t.weekdays("long",!0),1);case"Z":case"ZZ":return Vg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return Vg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return tc(/[a-z_+-/]{1,256}?/i);case" ":return tc(/[^\S\n\r]/);default:return M(k)}})(e)||{invalidReason:Yv};return v.token=e,v}const Jv={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 Xv(e,t,n){const{type:r,value:l}=e;if(r==="literal"){const _=/^\s+$/.test(l);return{literal:!_,val:_?" ":l}}const d=t[r];let f=r;r==="hour"&&(t.hour12!=null?f=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?f="hour12":f="hour24":f=n.hour12?"hour12":"hour24");let p=Jv[f];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Qv(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function eS(e,t,n){const r=e.match(t);if(r){const l={};let d=1;for(const f in n)if(el(n,f)){const p=n[f],_=p.groups?p.groups+1:1;!p.literal&&p.token&&(l[p.token.val[0]]=p.deser(r.slice(d,d+_))),d+=_}return[r,l]}else return[r,{}]}function tS(e){const t=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 It(e.z)||(n=no.create(e.z)),It(e.Z)||(n||(n=new xr(e.Z)),r=e.Z),It(e.q)||(e.M=(e.q-1)*3+1),It(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),It(e.u)||(e.S=bd(e.u)),[Object.keys(e).reduce((d,f)=>{const p=t(f);return p&&(d[p]=e[f]),d},{}),n,r]}let ku=null;function nS(){return ku||(ku=Dt.fromMillis(1555555555555)),ku}function rS(e,t){if(e.literal)return e;const n=yr.macroTokenToFormatOpts(e.val),r=n_(n,t);return r==null||r.includes(void 0)?e:r}function Qm(e,t){return Array.prototype.concat(...e.map(n=>rS(n,t)))}class e_{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Qm(yr.parseFormat(n),t),this.units=this.tokens.map(r=>Zv(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,l]=Qv(this.units);this.regex=RegExp(r,"i"),this.handlers=l}}explainFromTokens(t){if(this.isValid){const[n,r]=eS(t,this.regex,this.handlers),[l,d,f]=r?tS(r):[null,null,void 0];if(el(r,"a")&&el(r,"H"))throw new qs("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:l,zone:d,specificOffset:f}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function t_(e,t,n){return new e_(e,n).explainFromTokens(t)}function iS(e,t,n){const{result:r,zone:l,specificOffset:d,invalidReason:f}=t_(e,t,n);return[r,l,d,f]}function n_(e,t){if(!e)return null;const r=yr.create(t,e).dtFormatter(nS()),l=r.formatToParts(),d=r.resolvedOptions();return l.map(f=>Xv(f,e,d))}const Pu="Invalid DateTime",qg=864e13;function na(e){return new gi("unsupported zone",`the zone "${e.name}" is not supported`)}function $u(e){return e.weekData===null&&(e.weekData=gc(e.c)),e.weekData}function Fu(e){return e.localWeekData===null&&(e.localWeekData=gc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function ts(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Dt({...n,...t,old:n})}function r_(e,t,n){let r=e-t*60*1e3;const l=n.offset(r);if(t===l)return[r,t];r-=(l-t)*60*1e3;const d=n.offset(r);return l===d?[r,l]:[e-Math.min(l,d)*60*1e3,Math.max(l,d)]}function nc(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function sc(e,t,n){return r_(xc(e),t,n)}function Zg(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),l=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:l,day:Math.min(e.c.day,pc(r,l))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},f=en.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),p=xc(d);let[_,T]=r_(p,n,e.zone);return f!==0&&(_+=f,T=e.zone.offset(_)),{ts:_,o:T}}function Ys(e,t,n,r,l,d){const{setZone:f,zone:p}=n;if(e&&Object.keys(e).length!==0||t){const _=t||p,T=Dt.fromObject(e,{...n,zone:_,specificOffset:d});return f?T:T.setZone(p)}else return Dt.invalid(new gi("unparsable",`the input "${l}" can't be parsed as ${r}`))}function rc(e,t,n=!0){return e.isValid?yr.create(an.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Bu(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=zn(e.c.year,n?6:4),t?(r+="-",r+=zn(e.c.month),r+="-",r+=zn(e.c.day)):(r+=zn(e.c.month),r+=zn(e.c.day)),r}function Jg(e,t,n,r,l,d){let f=zn(e.c.hour);return t?(f+=":",f+=zn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=":")):f+=zn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=zn(e.c.second),(e.c.millisecond!==0||!r)&&(f+=".",f+=zn(e.c.millisecond,3))),l&&(e.isOffsetFixed&&e.offset===0&&!d?f+="Z":e.o<0?(f+="-",f+=zn(Math.trunc(-e.o/60)),f+=":",f+=zn(Math.trunc(-e.o%60))):(f+="+",f+=zn(Math.trunc(e.o/60)),f+=":",f+=zn(Math.trunc(e.o%60)))),d&&(f+="["+e.zone.ianaName+"]"),f}const i_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},oS={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},sS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},o_=["year","month","day","hour","minute","second","millisecond"],lS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],aS=["year","ordinal","hour","minute","second","millisecond"];function cS(e){const t={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"}[e.toLowerCase()];if(!t)throw new sm(e);return t}function Xg(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return cS(e)}}function uS(e){return ac[e]||(lc===void 0&&(lc=Rn.now()),ac[e]=e.offset(lc)),ac[e]}function Qg(e,t){const n=To(t.zone,Rn.defaultZone);if(!n.isValid)return Dt.invalid(na(n));const r=an.fromObject(t);let l,d;if(It(e.year))l=Rn.now();else{for(const _ of o_)It(e[_])&&(e[_]=i_[_]);const f=Mm(e)||Rm(e);if(f)return Dt.invalid(f);const p=uS(n);[l,d]=sc(e,p,n)}return new Dt({ts:l,zone:n,loc:r,o:d})}function ep(e,t,n){const r=It(n.round)?!0:n.round,l=(f,p)=>(f=Ld(f,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(f,p)),d=f=>n.calendary?t.hasSame(e,f)?0:t.startOf(f).diff(e.startOf(f),f).get(f):t.diff(e,f).get(f);if(n.unit)return l(d(n.unit),n.unit);for(const f of n.units){const p=d(f);if(Math.abs(p)>=1)return l(p,f)}return l(e>t?-0:0,n.units[n.units.length-1])}function tp(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let lc,ac={};class Dt{constructor(t){const n=t.zone||Rn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new gi("invalid input"):null)||(n.isValid?null:na(n));this.ts=It(t.ts)?Rn.now():t.ts;let l=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[l,d]=[t.old.c,t.old.o];else{const p=vo(t.o)&&!t.old?t.o:n.offset(this.ts);l=nc(this.ts,p),r=Number.isNaN(l.year)?new gi("invalid input"):null,l=r?null:l,d=r?null:p}this._zone=n,this.loc=t.loc||an.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=l,this.o=d,this.isLuxonDateTime=!0}static now(){return new Dt({})}static local(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static utc(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return t.zone=xr.utcInstance,Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static fromJSDate(t,n={}){const r=Hx(t)?t.valueOf():NaN;if(Number.isNaN(r))return Dt.invalid("invalid input");const l=To(n.zone,Rn.defaultZone);return l.isValid?new Dt({ts:r,zone:l,loc:an.fromObject(n)}):Dt.invalid(na(l))}static fromMillis(t,n={}){if(vo(t))return t<-qg||t>qg?Dt.invalid("Timestamp out of range"):new Dt({ts:t,zone:To(n.zone,Rn.defaultZone),loc:an.fromObject(n)});throw new _r(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(vo(t))return new Dt({ts:t*1e3,zone:To(n.zone,Rn.defaultZone),loc:an.fromObject(n)});throw new _r("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=To(n.zone,Rn.defaultZone);if(!r.isValid)return Dt.invalid(na(r));const l=an.fromObject(n),d=mc(t,Xg),{minDaysInFirstWeek:f,startOfWeek:p}=Bg(d,l),_=Rn.now(),T=It(n.specificOffset)?r.offset(_):n.specificOffset,E=!It(d.ordinal),S=!It(d.year),w=!It(d.month)||!It(d.day),M=S||w,m=d.weekYear||d.weekNumber;if((M||E)&&m)throw new qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&E)throw new qs("Can't mix ordinal dates with month/day");const v=m||d.weekday&&!M;let k,G,I=nc(_,T);v?(k=lS,G=oS,I=gc(I,f,p)):E?(k=aS,G=sS,I=Iu(I)):(k=o_,G=i_);let P=!1;for(const z of k){const q=d[z];It(q)?P?d[z]=G[z]:d[z]=I[z]:P=!0}const H=v?$x(d,f,p):E?Fx(d):Mm(d),j=H||Rm(d);if(j)return Dt.invalid(j);const re=v?$g(d,f,p):E?Fg(d):d,[te,ce]=sc(re,T,r),V=new Dt({ts:te,zone:r,o:ce,loc:l});return d.weekday&&M&&t.weekday!==V.weekday?Dt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${V.toISO()}`):V.isValid?V:Dt.invalid(V.invalid)}static fromISO(t,n={}){const[r,l]=Av(t);return Ys(r,l,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,l]=Mv(t);return Ys(r,l,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,l]=Rv(t);return Ys(r,l,n,"HTTP",n)}static fromFormat(t,n,r={}){if(It(t)||It(n))throw new _r("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:d=null}=r,f=an.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0}),[p,_,T,E]=iS(f,t,n);return E?Dt.invalid(E):Ys(p,_,r,`format ${n}`,t,T)}static fromString(t,n,r={}){return Dt.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,l]=Fv(t);return Ys(r,l,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new _r("need to specify a reason the DateTime is invalid");const r=t instanceof gi?t:new gi(t,n);if(Rn.throwOnInvalid)throw new ux(r);return new Dt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=n_(t,an.fromObject(n));return r?r.map(l=>l?l.val:null).join(""):null}static expandFormat(t,n={}){return Qm(yr.parseFormat(t),an.fromObject(n)).map(l=>l.val).join("")}static resetCache(){lc=void 0,ac={}}get(t){return this[t]}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?Iu(this.c).ordinal:NaN}get monthShort(){return this.isValid?ec.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ec.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ec.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ec.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 t=864e5,n=6e4,r=xc(this.c),l=this.zone.offset(r-t),d=this.zone.offset(r+t),f=this.zone.offset(r-l*n),p=this.zone.offset(r-d*n);if(f===p)return[this];const _=r-f*n,T=r-p*n,E=nc(_,f),S=nc(T,p);return E.hour===S.hour&&E.minute===S.minute&&E.second===S.second&&E.millisecond===S.millisecond?[ts(this,{ts:_}),ts(this,{ts:T})]:[this]}get isInLeapYear(){return ua(this.year)}get daysInMonth(){return pc(this.year,this.month)}get daysInYear(){return this.isValid?Zs(this.year):NaN}get weeksInWeekYear(){return this.isValid?aa(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?aa(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:l}=yr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:l}}toUTC(t=0,n={}){return this.setZone(xr.instance(t),n)}toLocal(){return this.setZone(Rn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=To(t,Rn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let l=this.ts;if(n||r){const d=t.offset(this.ts),f=this.toObject();[l]=sc(f,d,t)}return ts(this,{ts:l,zone:t})}else return Dt.invalid(na(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const l=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return ts(this,{loc:l})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=mc(t,Xg),{minDaysInFirstWeek:r,startOfWeek:l}=Bg(n,this.loc),d=!It(n.weekYear)||!It(n.weekNumber)||!It(n.weekday),f=!It(n.ordinal),p=!It(n.year),_=!It(n.month)||!It(n.day),T=p||_,E=n.weekYear||n.weekNumber;if((T||f)&&E)throw new qs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new qs("Can't mix ordinal dates with month/day");let S;d?S=$g({...gc(this.c,r,l),...n},r,l):It(n.ordinal)?(S={...this.toObject(),...n},It(n.day)&&(S.day=Math.min(pc(S.year,S.month),S.day))):S=Fg({...Iu(this.c),...n});const[w,M]=sc(S,this.o,this.zone);return ts(this,{ts:w,o:M})}plus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t);return ts(this,Zg(this,n))}minus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t).negate();return ts(this,Zg(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},l=en.normalizeUnit(t);switch(l){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(l==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:f}=this;f<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(l==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?yr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Pu}toLocaleString(t=hc,n={}){return this.isValid?yr.create(this.loc.clone(n),t).formatDateTime(this):Pu}toLocaleParts(t={}){return this.isValid?yr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:l=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const f=t==="extended";let p=Bu(this,f);return p+="T",p+=Jg(this,f,n,r,l,d),p}toISODate({format:t="extended"}={}){return this.isValid?Bu(this,t==="extended"):null}toISOWeekDate(){return rc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:l=!1,extendedZone:d=!1,format:f="extended"}={}){return this.isValid?(l?"T":"")+Jg(this,f==="extended",n,t,r,d):null}toRFC2822(){return rc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return rc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Bu(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let l="HH:mm:ss.SSS";return(n||t)&&(r&&(l+=" "),n?l+="z":t&&(l+="ZZ")),rc(this,l,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`: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(t={}){if(!this.isValid)return{};const n={...this.c};return t.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(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return en.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Wx(n).map(en.normalizeUnit),f=t.valueOf()>this.valueOf(),p=f?this:t,_=f?t:this,T=Gv(p,_,d,l);return f?T.negate():T}diffNow(t="milliseconds",n={}){return this.diff(Dt.now(),t,n)}until(t){return this.isValid?Mn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const l=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=l&&l<=d.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||Dt.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let l=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(l=t.unit,d=void 0),ep(n,this.plus(r),{...t,numeric:"always",units:l,unit:d})}toRelativeCalendar(t={}){return this.isValid?ep(t.base||Dt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Dt.isDateTime))throw new _r("min requires all arguments be DateTimes");return Hg(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(Dt.isDateTime))throw new _r("max requires all arguments be DateTimes");return Hg(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:l=null,numberingSystem:d=null}=r,f=an.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});return t_(f,t,n)}static fromStringExplain(t,n,r={}){return Dt.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:l=null}=n,d=an.fromOpts({locale:r,numberingSystem:l,defaultToEN:!0});return new e_(d,t)}static fromFormatParser(t,n,r={}){if(It(t)||It(n))throw new _r("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:d=null}=r,f=an.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});if(!f.equals(n.locale))throw new _r(`fromFormatParser called with a locale of ${f}, but the format parser was created for ${n.locale}`);const{result:p,zone:_,specificOffset:T,invalidReason:E}=n.explainFromTokens(t);return E?Dt.invalid(E):Ys(p,_,r,`format ${n.format}`,t,T)}static get DATE_SHORT(){return hc}static get DATE_MED(){return lm}static get DATE_MED_WITH_WEEKDAY(){return hx}static get DATE_FULL(){return am}static get DATE_HUGE(){return cm}static get TIME_SIMPLE(){return um}static get TIME_WITH_SECONDS(){return dm}static get TIME_WITH_SHORT_OFFSET(){return fm}static get TIME_WITH_LONG_OFFSET(){return hm}static get TIME_24_SIMPLE(){return gm}static get TIME_24_WITH_SECONDS(){return pm}static get TIME_24_WITH_SHORT_OFFSET(){return mm}static get TIME_24_WITH_LONG_OFFSET(){return _m}static get DATETIME_SHORT(){return ym}static get DATETIME_SHORT_WITH_SECONDS(){return Nm}static get DATETIME_MED(){return Cm}static get DATETIME_MED_WITH_SECONDS(){return Em}static get DATETIME_MED_WITH_WEEKDAY(){return gx}static get DATETIME_FULL(){return Tm}static get DATETIME_FULL_WITH_SECONDS(){return xm}static get DATETIME_HUGE(){return vm}static get DATETIME_HUGE_WITH_SECONDS(){return Sm}}function Xl(e){if(Dt.isDateTime(e))return e;if(e&&e.valueOf&&vo(e.valueOf()))return Dt.fromJSDate(e);if(e&&typeof e=="object")return Dt.fromObject(e);throw new _r(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var sn=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(sn||{});function $d(e){const t={1:sn.Monday,2:sn.Tuesday,3:sn.Wednesday,4:sn.Thursday,5:sn.Friday,6:sn.Saturday,7:sn.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function Di(e){return{[sn.Monday]:"Monday",[sn.Tuesday]:"Tuesday",[sn.Wednesday]:"Wednesday",[sn.Thursday]:"Thursday",[sn.Friday]:"Friday",[sn.Saturday]:"Saturday",[sn.Sunday]:"Sunday"}[e]}class np{constructor(t,n,r){Ie(this,"end");Ie(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(_=>{if(_.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[l,d]=n.start.split(":"),[f,p]=n.end.split(":");this.end=this.end.set({hour:Number(f),minute:Number(p)}),this.start=this.start.set({hour:Number(l),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(t){return this.start<=t&&t<this.end}getStartTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(t||"en-US").toLocaleString(r)}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r)}timeIsEqualTo(t){const n=this.getStartTime()===t.getStartTime(),r=this.getEndTime()===t.getEndTime();return n&&r}is24h(){const t=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 t&&n&&r}}class s_{constructor(t,n){Ie(this,"holidayHoursByDate");Ie(this,"hours");Ie(this,"timezone");this.holidayHoursByDate=Object.fromEntries((t.holidayHours||[]).map(r=>[r.date,r])),this.hours=t,this.timezone=n}getInterval(t){if(this.isTemporarilyClosedAt(t))return null;let n=t;n=n.minus({days:1});for(const r of[n,t]){const l=this.getHours(r);if(l&&!l.isClosed)for(const d of l.openIntervals||[]){const f=new np(r,d,this.timezone);if(f.contains(t))return f}}return null}getCurrentInterval(){return this.getInterval(Dt.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,f)=>d.start===f.start?0:d.start>f.start?1:-1,l=n.sort(r);for(const[d,f]of l.entries())if(f.contains(t)&&l.length>d+1)return l[d+1];for(const d of l)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let l=0;l<t;l++){let d=n;d=d.plus({days:l});const f=this.getHours(d);f&&!f.isClosed&&r.push(...f.openIntervals.map(p=>new np(d,p,this.timezone)))}return r}getHolidayHours(t){return this.isTemporarilyClosedAt(t)?null:this.holidayHoursByDate[(t.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(t){if(this.isTemporarilyClosedAt(t))return null;const n=Di($d(t)).toLowerCase();return this.hours[n]}getHours(t){const n=this.getHolidayHours(t);return!n||n.isRegularHours?this.getNormalHours(t):n}getNextInterval(){return this.getIntervalAfter(Dt.now())}isHoliday(t){return!!this.getHolidayHours(t)}isTemporarilyClosedAt(t){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,l,d]=n,f=Dt.fromObject({year:Number(r),month:Number(l),day:Number(d)},{zone:this.timezone});if(t<f)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(Dt.now())}}function dS(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function fS(e,t){if(e.length!==t.length)return!1;for(const[n,r]of e.entries())if(!r.timeIsEqualTo(t[n]))return!1;return!0}function ha(e){var t,n;return((n=(t=e==null?void 0:e.currentInterval)==null?void 0:t.is24h)==null?void 0:n.call(t))||!1}function ga(e){return!e.futureInterval}function hS(e){return ha(e)?ft.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):ga(e)?ft.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):ft.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function gS(e){return ha(e)||ga(e)?null:ft.jsx("span",{className:"HoursStatus-separator",children:" • "})}function pS(e){return ha(e)||ga(e)?null:ft.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function mS(e){if(ha(e)||ga(e))return null;let t="";if(e.isOpen){const n=e.currentInterval;t+=n?n.getEndTime("en-US",e.timeOptions):""}else{const n=e.futureInterval;t+=n?n.getStartTime("en-US",e.timeOptions):""}return ft.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function _S(e){var r,l;if(ha(e)||ga(e))return null;const t={weekday:"long",...e.dayOptions??{}};let n="";if(e.isOpen){const d=e.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(t))||""}else{const d=e.futureInterval;n+=((l=d==null?void 0:d.start)==null?void 0:l.setLocale("en-US").toLocaleString(t))||""}return ft.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function yS(e,t){const n=e.currentTemplate||hS,r=e.separatorTemplate||gS,l=e.futureTemplate||pS,d=e.timeTemplate||mS,f=e.dayOfWeekTemplate||_S;return ft.jsxs("div",{className:Qs("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),l(e),d(e),f(e)]})}const NS=e=>{const[t,n]=rt.useState(!1),[r,l]=rt.useState(!1);rt.useEffect(()=>{l(!0)},[]);const d=e.statusTemplate||yS,f=new s_(e.hours,e.timezone),p=f.isOpenNow(),_=f.getCurrentInterval(),T=f.getNextInterval(),E=(_==null?void 0:_.end)||(T==null?void 0:T.start);if(E&&!t){n(!0);const w=E.toMillis()-Dt.now().toMillis();setTimeout(()=>n(!1),w)}const S={isOpen:p,currentInterval:_,futureInterval:T,...e};return ft.jsx(ft.Fragment,{children:r&&d(S,e)})};function CS(e,t){const n=[];return e.forEach(r=>{const l=n[n.length-1];l?fS(l.intervals,r.intervals)?(l.endDay=r.endDay,l.isToday=l.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const l=t&&Di(r.startDay)in t?t[Di(r.startDay)]||"":Di(r.startDay),d=t&&Di(r.endDay)in t?t[Di(r.endDay)]||"":Di(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${l}`:`${l} - ${d}`}})}function ES(e,t){const n=[],r=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):e.intervals.forEach(l=>{const d=l.getStartTime("en-US",t),f=l.getEndTime("en-US",t);n.push(`${d} - ${f}`)}),n}function TS(e,t,n){const r=[];for(let l=1;l<=7;l++){const d=Dt.fromObject({weekday:l}),f=$d(d);r.push({startDay:f,endDay:f,dayName:n&&Di(f).toLowerCase()in n?n[Di(f).toLowerCase()]||"":Di(f),intervals:e.filter(p=>p.start.weekday===l),isToday:t.weekday===l})}return r}const xS=e=>{const[t,n]=rt.useState(!1);rt.useEffect(()=>{n(!0)},[]);const r=new s_(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),l=Dt.now(),d=r.getIntervalsForNDays(7,l);let f=TS(d,l,e.dayOfWeekNames);function p(E){return E?{today:$d(l),monday:sn.Monday,tuesday:sn.Tuesday,wednesday:sn.Wednesday,thursday:sn.Thursday,friday:sn.Friday,saturday:sn.Saturday,sunday:sn.Sunday}[E]:sn.Sunday}let _=[sn.Sunday,sn.Monday,sn.Tuesday,sn.Wednesday,sn.Thursday,sn.Friday,sn.Saturday];const T=_.indexOf(p(e.startOfWeek));return _=dS(_,7-T),f.sort((E,S)=>_.indexOf(E.startDay)-_.indexOf(S.startDay)),e.collapseDays&&(f=CS(f,e.dayOfWeekNames)),ft.jsx(ft.Fragment,{children:t&&ft.jsx("div",{className:Qs("HoursTable",e.className),children:f.map(E=>{const w=(e.intervalStringsBuilderFn||ES)(E,e.timeOptions);return ft.jsxs("div",{className:Qs("HoursTable-row",{"is-today":E.isToday}),children:[ft.jsx("span",{className:"HoursTable-day",children:E.dayName}),ft.jsx("span",{className:"HoursTable-intervals",children:w.map((M,m)=>ft.jsx("span",{className:"HoursTable-interval",children:M},m))})]},E.dayName)})})})},vS=e=>`<script type="application/ld+json">
110
+ ${JSON.stringify(e)}
111
+ <\/script>`,wc=(e,t)=>({"@context":"https://schema.org","@type":t,name:e.name}),SS=e=>typeof e!="object"?!1:"name"in e||"address"in e,wS=e=>typeof e!="object"?!1:"line1"in e||"city"in e||"region"in e||"postalCode"in e||"countryCode"in e,Fd=e=>wS(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},l_=e=>SS(e)&&{"@type":"Place",name:e.name,...Fd(e.address)},a_=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image,Oc=e=>{if(!e)return{};const t=new Array;for(const n of e)a_(n)&&t.push(n.image.url);return{image:t}},OS=e=>a_(e)&&{image:e.image.url},DS=e=>typeof e!="object"?!1:"url"in e||"name"in e,AS=e=>Array.isArray(e),c_=e=>AS(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},u_=e=>DS(e)&&{organizer:{"@type":"Organization",name:e.name,url:e.url}},MS=e=>typeof e!="object"?!1:"url"in e||"priceCurrency"in e||"price"in e||"priceValidUntil"in e||"itemCondition"in e||"availability"in e,Bd=e=>MS(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},RS=(e,t)=>({...wc(e,t??"Event"),...Oc(e.photoGallery),...l_({name:e.geomodifier,address:e.address}),startDate:e.c_startDate,endDate:e.c_endDate,description:e.description,eventAttendanceMode:e.attendance,eventStatus:e.eventStatus,...c_(e.performers),...u_({name:e.organizerName}),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate})}),bS=e=>typeof e!="object"?!1:"monday"in e||"tuesday"in e||"wednesday"in e||"thursday"in e||"friday"in e||"saturday"in e||"sunday"in e,LS=e=>typeof e=="object"&&"isClosed"in e&&Array.isArray(e.openIntervals)?e.openIntervals.length===0?!0:e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,d_=e=>{if(!bS(e))return{};let t=new Map;t=ns(e.monday,t,"Mo"),t=ns(e.tuesday,t,"Tu"),t=ns(e.wednesday,t,"We"),t=ns(e.thursday,t,"Th"),t=ns(e.friday,t,"Fr"),t=ns(e.saturday,t,"Sa"),t=ns(e.sunday,t,"Su");const n=new Array;for(const[r,l]of t){const d=l.join(",");n.push(d+" "+r)}return{openingHours:n}},ns=(e,t,n)=>{if(!LS(e)||e.isClosed){const r="00:00-00:00",l=t.get(r)??[];return l.push(n),t.set(r,l),t}for(let r=0;r<e.openIntervals.length;r++){const l=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(l)??[];d.push(n),t.set(l,d)}return t},IS=(e,t)=>({...wc(e,t??"LocalBusiness"),...Fd(e.address),...d_(e.hours),...Oc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),kS=e=>typeof e!="object"?!1:"ratingValue"in e||"bestRating"in e||"author"in e,PS=e=>typeof e!="object"?!1:"ratingValue"in e||"reviewCount"in e,f_=e=>kS(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},author:{"@type":"Person",name:e.author}}},h_=e=>PS(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,$S=(e,t)=>({...wc(e,t??"Product"),...Oc(e.photoGallery),...f_(e.c_reviews),...h_(e.c_aggregateRating),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate}),description:e.description,sku:e.sku,mpn:e.mpn,brand:{"@type":"Brand",name:e.brand}}),FS=e=>typeof e!="object"?!1:"question"in e&&"answer"in e,BS=e=>typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function id(e,t){for(const n in e)if(typeof e[n]=="object")if(Array.isArray(e[n]))for(let r=0;r<e[n].length;r++)id(e[n][r],t);else id(e[n],t);else n==="text"&&t.push(e[n])}function HS(e){if(e.json){const t=[];return id(e.json,t),t.join("")}return""}const WS=e=>({"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:e.map(t=>{if(FS(t)||BS(t))return{"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:"answer"in t?t.answer:HS(t.answerV2)}}})}),od=Math.log2(1.6745627884839434),KS=4,zS=19,sd="js-baidu-neg-lng-fix";let g_;const US=new Promise(e=>g_=e),GS="https://api.map.baidu.com/geoconv/v1/";let Ql=[];const YS="gcj02ToBD09Callback_b872c21c";let jS=0,rp;async function p_(e){return await new Promise((t,n)=>{Ql.push({coordinates:e,resolve:t,reject:n}),Ql.length===1&&(rp=setTimeout(r,100)),Ql.length>40&&(clearTimeout(rp),r());function r(){const l=Ql;Ql=[];const d=[].concat(...l.map(_=>_.coordinates)),f=YS+"_"+jS++,p=document.createElement("script");window[f]=_=>{var S;if(_.status){const w=new Error(`Unable to convert coordinates to BD-09: Received status code ${_.status}${_.message?": "+_.message:""}`);l.forEach(M=>M.reject(w))}const T=_.result.map(w=>new un(w.y,w.x));let E=0;l.forEach(w=>{w.resolve(T.slice(E,E+=w.coordinates.length))}),delete window[f],(S=p.parentNode)==null||S.removeChild(p)},US.then(_=>{const T={ak:_,callback:f,coords:d.map(E=>`${E.longitude},${E.latitude}`).join(";"),from:3,to:5};p.src=GS+"?"+Object.entries(T).map(([E,S])=>E+"="+S).join("&"),document.head.appendChild(p)})}})}class VS extends rl{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"map");Ie(this,"_panStartHandler");Ie(this,"_panHandler");Ie(this,"_centerReady");const r=!!(window.MSInputMethodContext&&document.DOCUMENT_NODE);this._wrapper=n.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:n.controlEnabled,maxZoom:r?14:18,...n.providerOptions}),n.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._panStartHandler=()=>null,this._panHandler=()=>null,this.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper&&(this._wrapper.dataset.baiduZoom=this.map.getZoom()),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new un(this.map.getCenter())}getZoom(){return this.map.getZoom()-od}setCenter(n,r){this._centerReady=p_([n]).then(([l])=>{const d=new BMap.Point(l.longitude,l.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+od)},{enableAnimation:r})})}}class qS extends il{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"_zIndex");Ie(this,"_wrapperClass");Ie(this,"_originalWrapperClass");Ie(this,"_element");Ie(this,"_coordinateReady");Ie(this,"_negativeLngFix");Ie(this,"pin");this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;class r extends BMap.Marker{constructor(p,_){super(p);Ie(this,"pin");this.pin=_}initialize(p){return this.pin._wrapper=super.initialize(p),this.pin._wrapper&&(this.pin._wrapper.style.zIndex=this.pin._zIndex.toString(),this.pin._originalWrapperClass=this.pin._wrapper.getAttribute("class")??"",this.pin._wrapper.setAttribute("class",this.pin._getClass()),this.pin._wrapper.appendChild(this.pin._element),this.pin.addListeners()),this.pin._wrapper}draw(){if(this.pin._wrapper){const p=this.pin._wrapper.style.zIndex;super.draw(),this.pin._wrapper.style.height="",this.pin._wrapper.style.width="",this.pin._wrapper.style.pointerEvents="none",this.pin._wrapper.style.zIndex=p}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const l=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(l),this.pin.setShadow(l)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=p_([n]).then(([r])=>{this._negativeLngFix=r.longitude<0,this.pin.setPosition(new BMap.Point(r.longitude+(this._negativeLngFix?180:0),r.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](sd)})}setMap(n,r){this._coordinateReady.then(()=>{r&&r.getProviderMap().map.removeOverlay(this.pin),n&&n.getProviderMap().map.addOverlay(this.pin)})}setProperties(n){super.setProperties(n),this._wrapperClass=n.getClass(),this._element=n.getElement()||this._pinEl,this._zIndex=n.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?sd:""} ${this._wrapperClass}`}}const ZS="https://api.map.baidu.com/getscript";function JS(e,t,n,{params:r={},version:l="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,f={ak:d,v:l,...r};g_(d);const p=document.createElement("script");p.src=ZS+"?"+Object.entries(f).map(([E,S])=>E+"="+S).join("&"),p.onload=()=>e(),document.head.appendChild(p);let _="";for(let E=KS;E<=zS;E++){const S=2**(E-od+7);_+=`[data-baidu-zoom="${E}"] .${sd}{transform:translateX(-${S}px);}`}const T=document.createElement("style");T.appendChild(document.createTextNode(_)),document.head.appendChild(T)}const XS=new as().withLoadFunction(JS).withMapClass(VS).withPinClass(qS).withProviderName("Baidu").build();let m_;function QS(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});Ie(this,"_container");Ie(this,"_pins");Ie(this,"_viewChangeEventHandler");Ie(this,"_map");this._container=document.createElement("div"),this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(r){this._pins.add(r),r._wrapper&&(r._wrapper.style.position="absolute",this._container.appendChild(r._wrapper)),this._map&&this.updatePinPosition(r)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){this._viewChangeEventHandler&&Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(r){this._pins.delete(r),r._wrapper&&this._container.removeChild(r._wrapper)}updatePinPosition(r){if(!this._map)return;const l=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&l instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=l.x+"px",r._wrapper.style.top=l.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}m_=e}class ew extends rl{constructor(n){super(n);Ie(this,"wrapper");Ie(this,"map");Ie(this,"pinOverlay");this.wrapper=n.wrapper,this.wrapper&&(this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!n.controlEnabled,disableZooming:!n.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...n.providerOptions}),this.pinOverlay=new m_(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(){var n;return new un(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:l}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var l;(l=this.map)==null||l.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class __ extends il{constructor(n){super(n);Ie(this,"_location");Ie(this,"_map");this._map=null,this._location=new Microsoft.Maps.Location(0,0)}static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}setCoordinate(n){this._location=new Microsoft.Maps.Location(n.latitude,n.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(n,r){r&&r.getProviderMap().pinOverlay.removePin(this),n&&n.getProviderMap().pinOverlay.addPin(this),this._map=n}}Ie(__,"_pinId");const ip="BingMapsCallback_593d7d33",tw="https://www.bing.com/api/maps/mapcontrol";function nw(e,t,n,{params:r={}}={}){window[ip]=()=>{QS(),e()};const l={callback:ip,key:n,...r};gp(tw+"?"+Object.entries(l).map(([d,f])=>d+"="+f).join("&"))}const rw=new as().withLoadFunction(nw).withMapClass(ew).withPinClass(__).withProviderName("Bing").build();class iw extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");if(n.wrapper&&(this.map=new mapboxgl.Map({container:n.wrapper,interactive:n.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...n.providerOptions})),n.controlEnabled){const f=new mapboxgl.NavigationControl({showCompass:!1});(r=this.map)==null||r.addControl(f)}(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new un(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return(((n=this.map)==null?void 0:n.getZoom())??0)+1}setCenter(n,r){const l=new mapboxgl.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](l)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,l){const d=new mapboxgl.LngLat(r.longitude,r.latitude);this.map&&this.map[l?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class ow extends il{constructor(n){super(n);Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new mapboxgl.LngLat(n.longitude,n.latitude))}setMap(n,r){var l,d;if(n){const f=n.getProviderMap().map;f&&((l=this.pin)==null||l.addTo(f))}else(d=this.pin)==null||d.remove()}}function sw(e,t,n,{version:r="v1.13.0"}={}){const l=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{mapboxgl.accessToken=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const lw=new as().withLoadFunction(sw).withMapClass(iw).withPinClass(ow).withProviderName("Mapbox").build();var ls;let y_=(ls=class extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new un(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(l,{animate:r})}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(n,{animate:r})}setZoomCenter(n,r,l){var f;const d=new L.LatLng(r.latitude,r.longitude);(f=this.map)==null||f.setView(d,n,{animate:l})}_initMap(n){n.wrapper&&(this.map=new L.Map(n.wrapper,{boxZoom:n.controlEnabled,doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions}));const r=n.providerOptions,l=r.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",d=r.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"};d.accessToken=ls.apiKey,this.map&&L.tileLayer(l,d).addTo(this.map)}},Ie(ls,"apiKey"),ls),aw=class extends fd{constructor(n){super(n);Ie(this,"pin");this.pin=new L.Marker(new L.LatLng(0,0)),this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(n){const r=new L.LatLng(n.latitude,n.longitude);this.pin.setLatLng(r)}setMap(n,r){if(n){const l=n.getProviderMap().map;l&&this.pin.addTo(l)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),l=n.getHeight(),d=n.getAnchorX(),f=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,l],iconAnchor:[d*r,f*l],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function cw(e,t,n,{version:r="1.7.1"}={}){const l=`https://unpkg.com/leaflet@${r}/dist/leaflet`;y_.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(f)}const Hd=new as().withLoadFunction(cw).withMapClass(y_).withPinClass(aw).withProviderName("Leaflet").build(),uw=Hd.getMapClass(),dw=Hd.getPinClass();class fw extends uw{constructor(){super(...arguments);Ie(this,"map")}_initMap(n){this.map=L.mapquest.map(n.wrapper,{boxZoom:n.controlEnabled,center:new L.LatLng(0,0),doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions})}}class hw extends dw{}function gw(e,t,n,{version:r="v1.3.2"}={}){const l=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const pw=new as().withLoadFunction(gw).withMapClass(fw).withPinClass(hw).withProviderName("MapQuest").build();exports.Address=cy;exports.AddressSchema=Fd;exports.AggregateRatingSchema=h_;exports.Analytics=cp;exports.AnalyticsContext=ud;exports.AnalyticsProvider=lN;exports.AnalyticsScopeProvider=aN;exports.BaiduMaps=XS;exports.BaseSchema=wc;exports.BingMaps=rw;exports.Clusterer=FN;exports.Coordinate=un;exports.Day=sn;exports.Event=RS;exports.FAQPage=WS;exports.GoogleMaps=_p;exports.HoursStatus=NS;exports.HoursTable=xS;exports.Image=mN;exports.ImageLayoutOption=xo;exports.LeafletMaps=Hd;exports.LegacyRichText=cx;exports.LexicalRichText=EE;exports.Link=hp;exports.LinkTypes=TN;exports.ListingPublisherOption=op;exports.LocalBusiness=IS;exports.LocationMap=WN;exports.LocationSchema=l_;exports.Map=Cp;exports.MapProviderOption=Wu;exports.MapQuestMaps=pw;exports.MapboxMaps=lw;exports.Marker=pd;exports.OfferSchema=Bd;exports.OpeningHoursSchema=d_;exports.OrganizationSchema=u_;exports.PerformerSchema=c_;exports.PhotoGallerySchema=Oc;exports.PhotoSchema=OS;exports.Product=$S;exports.ReviewSchema=f_;exports.SchemaWrapper=vS;exports.asciiAlpha=RE;exports.asciiAlphanumeric=Ju;exports.asciiAtext=bE;exports.asciiControl=LE;exports.asciiDigit=IE;exports.asciiHexDigit=kE;exports.asciiPunctuation=PE;exports.c=Qs;exports.classifyCharacter=la;exports.combineExtensions=Gp;exports.createState=JT;exports.debuggingParamDetected=cc;exports.getDefaultExportFromCjs=ad;exports.getDirections=ly;exports.getRuntime=Xs;exports.jsxRuntimeExports=ft;exports.markdownLineEnding=$E;exports.markdownLineEndingOrSpace=Xp;exports.markdownSpace=FE;exports.normalizeUri=sl;exports.push=js;exports.resolveAll=Qp;exports.splice=yc;exports.useAnalytics=nl;exports.useClusterContext=$N;exports.useIdentify=dN;exports.useMapContext=kN;exports.usePageView=uN;exports.useScope=dd;exports.useTrack=cN;exports.visit=Dd;