@yext/pages-components 1.1.14 → 1.2.0
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.
- package/THIRD-PARTY-NOTICES +15 -45
- package/dist/{debugger-BxGLUF0a.js → debugger-o-hgjM54.js} +1 -1
- package/dist/index-DpqXrf_z.js +6740 -0
- package/dist/index-sidm05Eh.js +20870 -0
- package/dist/index.d.ts +9 -9
- package/dist/pages-components.js +13 -13
- package/package.json +24 -29
- package/dist/debugger-Bc6LFql_.cjs +0 -1
- package/dist/index-7fAhZ2Ii.cjs +0 -47
- package/dist/index-BZoK3sUE.js +0 -5937
- package/dist/index-CDEZRpEm.js +0 -31791
- package/dist/index-CjhHamzw.cjs +0 -111
- package/dist/index.d.cts +0 -1997
- package/dist/pages-components.cjs +0 -1
package/dist/index-CjhHamzw.cjs
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
"use strict";var Ym=Object.defineProperty;var jm=(e,t,n)=>t in e?Ym(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ie=(e,t,n)=>jm(e,typeof t!="symbol"?t+"":t,n);const yt=require("react"),Vm=require("react-dom"),pu=require("mapbox-gl");function qm(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 Zm=qm(yt);var Pd=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function rg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var mu={exports:{}},Wl={};/**
|
|
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 $d;function Jm(){if($d)return Wl;$d=1;var e=yt,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,c=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function g(y,E,T){var R,I={},k=null,U=null;T!==void 0&&(k=""+T),E.key!==void 0&&(k=""+E.key),E.ref!==void 0&&(U=E.ref);for(R in E)r.call(E,R)&&!d.hasOwnProperty(R)&&(I[R]=E[R]);if(y&&y.defaultProps)for(R in E=y.defaultProps,E)I[R]===void 0&&(I[R]=E[R]);return{$$typeof:t,type:y,key:k,ref:U,props:I,_owner:c.current}}return Wl.Fragment=n,Wl.jsx=g,Wl.jsxs=g,Wl}var Kl={};/**
|
|
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 Fd;function Xm(){return Fd||(Fd=1,process.env.NODE_ENV!=="production"&&function(){var e=yt,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),C=Symbol.iterator,w="@@iterator";function z(pe){if(pe===null||typeof pe!="object")return null;var Ze=C&&pe[C]||pe[w];return typeof Ze=="function"?Ze:null}var Q=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function F(pe){{for(var Ze=arguments.length,ot=new Array(Ze>1?Ze-1:0),wt=1;wt<Ze;wt++)ot[wt-1]=arguments[wt];W("error",pe,ot)}}function W(pe,Ze,ot){{var wt=Q.ReactDebugCurrentFrame,Gt=wt.getStackAddendum();Gt!==""&&(Ze+="%s",ot=ot.concat([Gt]));var Bt=ot.map(function(Pt){return String(Pt)});Bt.unshift("Warning: "+Ze),Function.prototype.apply.call(console[pe],console,Bt)}}var G=!1,q=!1,le=!1,se=!1,ge=!1,j;j=Symbol.for("react.module.reference");function B(pe){return!!(typeof pe=="string"||typeof pe=="function"||pe===r||pe===d||ge||pe===c||pe===T||pe===R||se||pe===U||G||q||le||typeof pe=="object"&&pe!==null&&(pe.$$typeof===k||pe.$$typeof===I||pe.$$typeof===g||pe.$$typeof===y||pe.$$typeof===E||pe.$$typeof===j||pe.getModuleId!==void 0))}function V(pe,Ze,ot){var wt=pe.displayName;if(wt)return wt;var Gt=Ze.displayName||Ze.name||"";return Gt!==""?ot+"("+Gt+")":ot}function xe(pe){return pe.displayName||"Context"}function we(pe){if(pe==null)return null;if(typeof pe.tag=="number"&&F("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 c:return"StrictMode";case T:return"Suspense";case R:return"SuspenseList"}if(typeof pe=="object")switch(pe.$$typeof){case y:var Ze=pe;return xe(Ze)+".Consumer";case g:var ot=pe;return xe(ot._context)+".Provider";case E:return V(pe,pe.render,"ForwardRef");case I:var wt=pe.displayName||null;return wt!==null?wt:we(pe.type)||"Memo";case k:{var Gt=pe,Bt=Gt._payload,Pt=Gt._init;try{return we(Pt(Bt))}catch{return null}}}return null}var Ee=Object.assign,ue=0,$,x,Y,ie,K,P,Z;function O(){}O.__reactDisabledLog=!0;function H(){{if(ue===0){$=console.log,x=console.info,Y=console.warn,ie=console.error,K=console.group,P=console.groupCollapsed,Z=console.groupEnd;var pe={configurable:!0,enumerable:!0,value:O,writable:!0};Object.defineProperties(console,{info:pe,log:pe,warn:pe,error:pe,group:pe,groupCollapsed:pe,groupEnd:pe})}ue++}}function J(){{if(ue--,ue===0){var pe={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ee({},pe,{value:$}),info:Ee({},pe,{value:x}),warn:Ee({},pe,{value:Y}),error:Ee({},pe,{value:ie}),group:Ee({},pe,{value:K}),groupCollapsed:Ee({},pe,{value:P}),groupEnd:Ee({},pe,{value:Z})})}ue<0&&F("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var de=Q.ReactCurrentDispatcher,_e;function b(pe,Ze,ot){{if(_e===void 0)try{throw Error()}catch(Gt){var wt=Gt.stack.trim().match(/\n( *(at )?)/);_e=wt&&wt[1]||""}return`
|
|
18
|
-
`+_e+pe}}var v=!1,M;{var re=typeof WeakMap=="function"?WeakMap:Map;M=new re}function ye(pe,Ze){if(!pe||v)return"";{var ot=M.get(pe);if(ot!==void 0)return ot}var wt;v=!0;var Gt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Bt;Bt=de.current,de.current=null,H();try{if(Ze){var Pt=function(){throw Error()};if(Object.defineProperty(Pt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Pt,[])}catch(dn){wt=dn}Reflect.construct(pe,[],Pt)}else{try{Pt.call()}catch(dn){wt=dn}pe.call(Pt.prototype)}}else{try{throw Error()}catch(dn){wt=dn}pe()}}catch(dn){if(dn&&wt&&typeof dn.stack=="string"){for(var Lt=dn.stack.split(`
|
|
19
|
-
`),Ht=wt.stack.split(`
|
|
20
|
-
`),sn=Lt.length-1,ln=Ht.length-1;sn>=1&&ln>=0&&Lt[sn]!==Ht[ln];)ln--;for(;sn>=1&&ln>=0;sn--,ln--)if(Lt[sn]!==Ht[ln]){if(sn!==1||ln!==1)do if(sn--,ln--,ln<0||Lt[sn]!==Ht[ln]){var Rn=`
|
|
21
|
-
`+Lt[sn].replace(" at new "," at ");return pe.displayName&&Rn.includes("<anonymous>")&&(Rn=Rn.replace("<anonymous>",pe.displayName)),typeof pe=="function"&&M.set(pe,Rn),Rn}while(sn>=1&&ln>=0);break}}}finally{v=!1,de.current=Bt,J(),Error.prepareStackTrace=Gt}var mr=pe?pe.displayName||pe.name:"",jn=mr?b(mr):"";return typeof pe=="function"&&M.set(pe,jn),jn}function Ae(pe,Ze,ot){return ye(pe,!1)}function ee(pe){var Ze=pe.prototype;return!!(Ze&&Ze.isReactComponent)}function te(pe,Ze,ot){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 R:return b("SuspenseList")}if(typeof pe=="object")switch(pe.$$typeof){case E:return Ae(pe.render);case I:return te(pe.type,Ze,ot);case k:{var wt=pe,Gt=wt._payload,Bt=wt._init;try{return te(Bt(Gt),Ze,ot)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,be={},Ne=Q.ReactDebugCurrentFrame;function Re(pe){if(pe){var Ze=pe._owner,ot=te(pe.type,pe._source,Ze?Ze.type:null);Ne.setExtraStackFrame(ot)}else Ne.setExtraStackFrame(null)}function Le(pe,Ze,ot,wt,Gt){{var Bt=Function.call.bind(ce);for(var Pt in pe)if(Bt(pe,Pt)){var Lt=void 0;try{if(typeof pe[Pt]!="function"){var Ht=Error((wt||"React class")+": "+ot+" type `"+Pt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof pe[Pt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ht.name="Invariant Violation",Ht}Lt=pe[Pt](Ze,Pt,wt,ot,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(sn){Lt=sn}Lt&&!(Lt instanceof Error)&&(Re(Gt),F("%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).",wt||"React class",ot,Pt,typeof Lt),Re(null)),Lt instanceof Error&&!(Lt.message in be)&&(be[Lt.message]=!0,Re(Gt),F("Failed %s type: %s",ot,Lt.message),Re(null))}}}var Fe=Array.isArray;function qe(pe){return Fe(pe)}function Be(pe){{var Ze=typeof Symbol=="function"&&Symbol.toStringTag,ot=Ze&&pe[Symbol.toStringTag]||pe.constructor.name||"Object";return ot}}function ct(pe){try{return Dt(pe),!1}catch{return!0}}function Dt(pe){return""+pe}function Ut(pe){if(ct(pe))return F("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Be(pe)),Dt(pe)}var en=Q.ReactCurrentOwner,Oe={key:!0,ref:!0,__self:!0,__source:!0},ne,oe;function Se(pe){if(ce.call(pe,"ref")){var Ze=Object.getOwnPropertyDescriptor(pe,"ref").get;if(Ze&&Ze.isReactWarning)return!1}return pe.ref!==void 0}function ke(pe){if(ce.call(pe,"key")){var Ze=Object.getOwnPropertyDescriptor(pe,"key").get;if(Ze&&Ze.isReactWarning)return!1}return pe.key!==void 0}function Me(pe,Ze){typeof pe.ref=="string"&&en.current}function je(pe,Ze){{var ot=function(){ne||(ne=!0,F("%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))};ot.isReactWarning=!0,Object.defineProperty(pe,"key",{get:ot,configurable:!0})}}function rt(pe,Ze){{var ot=function(){oe||(oe=!0,F("%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))};ot.isReactWarning=!0,Object.defineProperty(pe,"ref",{get:ot,configurable:!0})}}var it=function(pe,Ze,ot,wt,Gt,Bt,Pt){var Lt={$$typeof:t,type:pe,key:Ze,ref:ot,props:Pt,_owner:Bt};return Lt._store={},Object.defineProperty(Lt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Lt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:wt}),Object.defineProperty(Lt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Gt}),Object.freeze&&(Object.freeze(Lt.props),Object.freeze(Lt)),Lt};function st(pe,Ze,ot,wt,Gt){{var Bt,Pt={},Lt=null,Ht=null;ot!==void 0&&(Ut(ot),Lt=""+ot),ke(Ze)&&(Ut(Ze.key),Lt=""+Ze.key),Se(Ze)&&(Ht=Ze.ref,Me(Ze,Gt));for(Bt in Ze)ce.call(Ze,Bt)&&!Oe.hasOwnProperty(Bt)&&(Pt[Bt]=Ze[Bt]);if(pe&&pe.defaultProps){var sn=pe.defaultProps;for(Bt in sn)Pt[Bt]===void 0&&(Pt[Bt]=sn[Bt])}if(Lt||Ht){var ln=typeof pe=="function"?pe.displayName||pe.name||"Unknown":pe;Lt&&je(Pt,ln),Ht&&rt(Pt,ln)}return it(pe,Lt,Ht,Gt,wt,en.current,Pt)}}var vt=Q.ReactCurrentOwner,Ge=Q.ReactDebugCurrentFrame;function ze(pe){if(pe){var Ze=pe._owner,ot=te(pe.type,pe._source,Ze?Ze.type:null);Ge.setExtraStackFrame(ot)}else Ge.setExtraStackFrame(null)}var tt;tt=!1;function _t(pe){return typeof pe=="object"&&pe!==null&&pe.$$typeof===t}function Nt(){{if(vt.current){var pe=we(vt.current.type);if(pe)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+pe+"`."}return""}}function Et(pe){return""}var ht={};function xt(pe){{var Ze=Nt();if(!Ze){var ot=typeof pe=="string"?pe:pe.displayName||pe.name;ot&&(Ze=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+ot+">.")}return Ze}}function pt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var ot=xt(Ze);if(ht[ot])return;ht[ot]=!0;var wt="";pe&&pe._owner&&pe._owner!==vt.current&&(wt=" It was passed a child from "+we(pe._owner.type)+"."),ze(pe),F('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ot,wt),ze(null)}}function $t(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var ot=0;ot<pe.length;ot++){var wt=pe[ot];_t(wt)&&pt(wt,Ze)}else if(_t(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Gt=z(pe);if(typeof Gt=="function"&&Gt!==pe.entries)for(var Bt=Gt.call(pe),Pt;!(Pt=Bt.next()).done;)_t(Pt.value)&&pt(Pt.value,Ze)}}}function Kt(pe){{var Ze=pe.type;if(Ze==null||typeof Ze=="string")return;var ot;if(typeof Ze=="function")ot=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===E||Ze.$$typeof===I))ot=Ze.propTypes;else return;if(ot){var wt=we(Ze);Le(ot,pe.props,"prop",wt,pe)}else if(Ze.PropTypes!==void 0&&!tt){tt=!0;var Gt=we(Ze);F("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Gt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&F("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function tn(pe){{for(var Ze=Object.keys(pe.props),ot=0;ot<Ze.length;ot++){var wt=Ze[ot];if(wt!=="children"&&wt!=="key"){ze(pe),F("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",wt),ze(null);break}}pe.ref!==null&&(ze(pe),F("Invalid attribute `ref` supplied to `React.Fragment`."),ze(null))}}var kt={};function jt(pe,Ze,ot,wt,Gt,Bt){{var Pt=B(pe);if(!Pt){var Lt="";(pe===void 0||typeof pe=="object"&&pe!==null&&Object.keys(pe).length===0)&&(Lt+=" 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 Ht=Et();Ht?Lt+=Ht:Lt+=Nt();var sn;pe===null?sn="null":qe(pe)?sn="array":pe!==void 0&&pe.$$typeof===t?(sn="<"+(we(pe.type)||"Unknown")+" />",Lt=" Did you accidentally export a JSX literal instead of a component?"):sn=typeof pe,F("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",sn,Lt)}var ln=st(pe,Ze,ot,Gt,Bt);if(ln==null)return ln;if(Pt){var Rn=Ze.children;if(Rn!==void 0)if(wt)if(qe(Rn)){for(var mr=0;mr<Rn.length;mr++)$t(Rn[mr],pe);Object.freeze&&Object.freeze(Rn)}else F("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 $t(Rn,pe)}if(ce.call(Ze,"key")){var jn=we(pe),dn=Object.keys(Ze).filter(function(Oi){return Oi!=="key"}),rr=dn.length>0?"{key: someKey, "+dn.join(": ..., ")+": ...}":"{key: someKey}";if(!kt[jn+rr]){var ir=dn.length>0?"{"+dn.join(": ..., ")+": ...}":"{}";F(`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} />`,rr,jn,ir,jn),kt[jn+rr]=!0}}return pe===r?tn(ln):Kt(ln),ln}}function bt(pe,Ze,ot){return jt(pe,Ze,ot,!0)}function nn(pe,Ze,ot){return jt(pe,Ze,ot,!1)}var Sr=nn,pi=bt;Kl.Fragment=r,Kl.jsx=Sr,Kl.jsxs=pi}()),Kl}process.env.NODE_ENV==="production"?mu.exports=Jm():mu.exports=Xm();var nt=mu.exports;function Qm(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 ig={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},_u={GOOGLE:"google",APPLE:"apple",BING:"bing"},e_=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},t_=(e,t=[],n,r={route:!1},c)=>{const d="Failed to construct query for maps service.";let g=e&&Kd([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case _u.APPLE:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return Bd(`${c.latitude},${c.longitude}`,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Bd(g,r.route)}case _u.BING:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return Hd(`${c.latitude},${c.longitude}`,r.route);if(g=e&&Kd([e.line1,e.city,e.region,e.postalCode]),!g){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Hd(g,r.route)}default:{if(c!=null&&c.latitude&&(c!=null&&c.longitude))return Wd(`${c.latitude},${c.longitude}`,r.route);const y=t.find(E=>{var T;return((T=E==null?void 0:E.publisher)==null?void 0:T.toUpperCase())===ig.GOOGLEMYBUSINESS});if(y!=null&&y.listingUrl)return y.listingUrl;if(n)return n_(n,g,r.route);if(!g){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return Wd(g,r.route)}}},Bd=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,Hd=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,n_=(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`},Wd=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,Kd=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},r_=({address:e,lines:t,separator:n=",",...r})=>{const c=(t||Qm(e.countryCode)).map(d=>nt.jsx(i_,{address:e,line:d,separator:n},d.toString()));return yt.createElement("div",{...r,key:e.toString()},c)},i_=({address:e,line:t,separator:n})=>{const r=[];let c=0;for(const d of t){if(d===","){r.push(nt.jsx("span",{children:n},`separator-${c++}`));continue}const g=e[d];if(!g)continue;const y=e_(d,e);if(y){r.push(nt.jsxs(Zm.Fragment,{children:[" ",nt.jsx("abbr",{title:y,children:g})]},d));continue}r.push(nt.jsx("span",{children:" "+g},d))}return nt.jsx("div",{className:"address-line",children:r})};var Jo={};Object.defineProperty(Jo,"__esModule",{value:!0});var s_=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},o_=typeof window<"u"&&typeof window.document<"u",l_=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,a_=(typeof self>"u"?"undefined":s_(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",c_=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),u_=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",zd=Jo.isBrowser=o_;Jo.isWebWorker=a_;var d_=Jo.isNode=l_;Jo.isJsDom=c_;var f_=Jo.isDeno=u_;class h_{constructor(){Ie(this,"name");Ie(this,"isServerSide");Ie(this,"version");var t;f_?(this.name="deno",this.version="",zd&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):d_?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):zd?(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 qo=()=>new h_,g_=(...e)=>{var t;if(typeof window<"u"){if(window.IS_PRODUCTION)return!0;const n=(t=window.location)==null?void 0:t.hostname;return e==null?void 0:e.some(r=>r==null?void 0:r.includes(n))}return!1};function jc(e){if(!Fu(e))throw new Error("Parameter was not an error")}function Fu(e){return!!e&&typeof e=="object"&&p_(e)==="[object Error]"||e instanceof Error}function p_(e){return Object.prototype.toString.call(e)}const m_="Layerr";let __=m_;function y_(){return __}function N_(e){let t,n="";if(e.length===0)t={};else if(Fu(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 wi extends Error{constructor(t,n){const r=[...arguments],{options:c,shortMessage:d}=N_(r);let g=d;if(c.cause&&(g=`${g}: ${c.cause.message}`),super(g),this.message=g,c.name&&typeof c.name=="string"?this.name=c.name:this.name=y_(),c.cause&&Object.defineProperty(this,"_cause",{value:c.cause}),Object.defineProperty(this,"_info",{value:{}}),c.info&&typeof c.info=="object"&&Object.assign(this._info,c.info),Error.captureStackTrace){const y=c.constructorOpt||this.constructor;Error.captureStackTrace(this,y)}}static cause(t){return jc(t),t._cause&&Fu(t._cause)?t._cause:null}static fullStack(t){jc(t);const n=wi.cause(t);return n?`${t.stack}
|
|
31
|
-
caused by: ${wi.fullStack(n)}`:t.stack??""}static info(t){jc(t);const n={},r=wi.cause(t);return r&&Object.assign(n,wi.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 sg="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ql=32,Ud=0xffffffffffff,C_=10,E_=16,ql=Object.freeze({source:"ulid"});function T_(e){const t=x_(),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 wi({info:{code:"PRNG_DETECT",...ql}},"Failed to find a reliable PRNG")}function x_(){return w_()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function S_(e,t){let n="";for(;e>0;e--)n=O_(t)+n;return n}function v_(e,t){if(isNaN(e))throw new wi({info:{code:"ENC_TIME_NAN",...ql}},`Time must be a number: ${e}`);if(e>Ud)throw new wi({info:{code:"ENC_TIME_SIZE_EXCEED",...ql}},`Cannot encode a time larger than ${Ud}: ${e}`);if(e<0)throw new wi({info:{code:"ENC_TIME_NEG",...ql}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new wi({info:{code:"ENC_TIME_TYPE",...ql}},`Time must be an integer: ${e}`);let n,r="";for(let c=t;c>0;c--)n=e%Ql,r=sg.charAt(n)+r,e=(e-n)/Ql;return r}function w_(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function O_(e){let t=Math.floor(e()*Ql);return t===Ql&&(t=Ql-1),sg.charAt(t)}function A_(e,t){const n=T_(),r=isNaN(e)?Date.now():e;return v_(r,C_)+S_(E_,n)}var Gd="yext_analytics_session_id";function D_(){if(typeof window>"u")return null;try{var e=window.sessionStorage.getItem(Gd);return e||(e=A_(),window.sessionStorage.setItem(Gd,e)),e}catch(t){return console.warn(`Unable to use browser sessionStorage for sessionId.
|
|
32
|
-
`,t),null}}const M_="1.0.0",Yd={version:M_};function R_(e,t,n){return n.debug?(og(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function b_(e,t,n){return n.debug?(og(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function I_(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function og(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 yu=function(){return yu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c])}return e},yu.apply(this,arguments)},Nu=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 c=t[r];c==null?delete n[r]:typeof c!="object"?n[r]=c:n[r]=Nu(n[r],c)}return yu({},n)},k_="yextevents.com/accounts/me/events";function L_(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")+"."+k_}var P_=function(e,t,n,r){function c(d){return d instanceof n?d:new n(function(g){g(d)})}return new(n||(n=Promise))(function(d,g){function y(R){try{T(r.next(R))}catch(I){g(I)}}function E(R){try{T(r.throw(R))}catch(I){g(I)}}function T(R){R.done?d(R.value):c(R.value).then(y,E)}T((r=r.apply(e,t||[])).next())})},$_=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,c,d,g;return g={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function y(T){return function(R){return E([T,R])}}function E(T){if(r)throw new TypeError("Generator is already executing.");for(;g&&(g=0,T[0]&&(n=0)),n;)try{if(r=1,c&&(d=T[0]&2?c.return:T[0]?c.throw||((d=c.return)&&d.call(c),0):c.next)&&!(d=d.call(c,T[1])).done)return d;switch(c=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++,c=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(R){T=[6,R],c=0}finally{r=d=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},F_=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:Nu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return P_(this,void 0,void 0,function(){var r,c,d,g,y=this;return $_(this,function(E){return r=Nu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=D_()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Yd.version:r.clientSdk=(g={},g.ANALYTICS=Yd.version,g),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,c=I_(r,this.config.forceFetch),d=L_(this.config.env,this.config.region),c?[2,new Promise(function(T,R){R_(d,r,y.config)?T(""):R("Failed Beacon Call")})]:[2,b_(d,r,this.config).then(function(T){return T}).catch(function(T){return T})]})})},e}();function B_(e){return new F_(e)}function Cu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function lg(e,t){return[e,t].filter(n=>!!n).map(n=>Cu(n)).join("_")}const H_=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},Bu=yt.createContext(null),W_=yt.lazy(()=>Promise.resolve().then(()=>require("./debugger-Bc6LFql_.cjs")));function K_(e){const{children:t,apiKey:n,currency:r,templateData:c,requireOptIn:d,disableSessionTracking:g,enableDebugging:y,productionDomains:E}=e;if(!n)throw new Error("API Key is required for AnalyticsProvider");const T=yt.useRef(null),[R,I]=yt.useState(!1);yt.useEffect(()=>{I(!0)},[]),T.current===null&&(T.current=new ag(n,r,c,d,g,E,y??sc()));const k=T.current;return yt.useEffect(()=>(window.enableYextAnalytics=()=>{k.optIn()},()=>{delete window.enableYextAnalytics}),[k]),nt.jsxs(nt.Fragment,{children:[nt.jsx(Bu.Provider,{value:k,children:t}),R&&(y||sc())&&qo().name==="browser"?nt.jsx(yt.Suspense,{fallback:nt.jsx(nt.Fragment,{}),children:nt.jsx(W_,{})}):null]})}function sc(){return qo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class ag{constructor(t,n,r,c,d,g,y=!1){Ie(this,"_optedIn");Ie(this,"_sessionTrackingEnabled");Ie(this,"_analyticsEventService");Ie(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.productionDomains=g,this.enableDebugging=y,this._optedIn=!c,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(qo().name!=="browser"||!this._optedIn)return;if(!g_(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=H_(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,pageUrl:document.URL,referrerUrl:document.referrer!==""?document.referrer:void 0};this._analyticsEventService=B_(n).with(r)}canTrack(){return qo().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 I;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:c,currency:d,amount:g,destinationUrl:y,customTags:E,customValues:T}=t;let R;g&&(R={amount:g,currency:d||this.defaultCurrency}),await((I=this._analyticsEventService)==null?void 0:I.report({action:n,pages:{scope:Cu(r)||void 0,originalEventName:lg(r||"",Cu(c)||"")},value:R,destinationUrl:y||void 0,customTags:E,customValues:T}))}getDebugEnabled(){return this.enableDebugging||sc()}}const Eu=yt.createContext({name:""}),Hu=()=>yt.useContext(Eu).name;function z_(e){var g;const t=Hu(),[n]=yt.useState({name:lg(t,e.name)}),r=(g=Xo())==null?void 0:g.getDebugEnabled(),[c,d]=yt.useState(!1);return yt.useEffect(()=>{d(!0)},[]),r&&c?nt.jsx("section",{"data-ya-scope":n.name,children:nt.jsx(Eu.Provider,{value:n,children:e.children})}):nt.jsx(Eu.Provider,{value:n,children:e.children})}function Xo(){const e=yt.useContext(Bu);if(!e)return e;qo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=Hu();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 U_=()=>{var e;return(e=Xo())==null?void 0:e.track},G_=()=>{var e;return(e=Xo())==null?void 0:e.pageView},Y_=()=>{var e;return(e=Xo())==null?void 0:e.identify},qi={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},j_=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 c=e.pathname.replace(/^\//,"").split("/");if(c.length<2||c.length>3){console.error(`Invalid path: ${e}`);return}let d;if(c[0]==="f")d="prod";else switch(c[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${e}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${e}`);return}let g;if(c.length===3&&(g=parseInt(c[1]),Number.isNaN(g))){console.error(`Invalid account id: ${e}`);return}const y=c[c.length-1].split("."),E=y.length===2?`.${y[1]}`:"",T=y[0];return{scheme:t,partition:r,env:d,accountId:g,contentHash:T,extension:E}},V_=(e,t,n,r)=>{const c=`https://dyn${e.partition==="us"?"":`.${e.partition}`}.mktgcdn.com`;let d="f";switch(e.env){case"prod":break;case"sbx":{d+="-sandbox";break}default:d+=`-${e.env.toString()}`}const g=e.accountId!==void 0?`${e.accountId}/`:"",y=ug(r);return`${c}/${d}/${g}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}${y}`},q_=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 c=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 g=n[n.length-1].split("."),y=g.length===2?`.${g[1]}`:"",E=g[0];return{scheme:t,env:r,contentHash:c,aspectRatio:d,name:E,extension:y}},Z_=(e,t,n,r)=>{const c="https://dyn.mktgcdn.com";let d="p";switch(e.env){case"prod":break;case"sbx":{d+="-sandbox";break}default:d+=`-${e.env.toString()}`}const g=ug(r);return`${c}/${d}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}${g}`},oc=(e,t,n,r)=>{if(!cg(e)){console.error(`Invalid image url: ${e}.`);return}const c=new URL(e);if(c.pathname.startsWith("/p")){const d=q_(c);if(d)return Z_(d,t,n,r)}else if(c.pathname.startsWith("/f")){const d=j_(c);if(d)return V_(d,t,n,r)}return e},cg=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},ug=e=>{if(!e||Object.keys(e).length===0)return"";const t=Object.entries(e).filter(([n,r])=>r!==void 0&&String(r)!=="").map(([n,r])=>`${n}=${r}`).join(",");return t.length>0?`,${t}`:""},J_=({image:e,className:t,width:n,height:r,aspectRatio:c,layout:d=qi.INTRINSIC,placeholder:g,imgOverrides:y,style:E={},imageTransformations:T,loading:R="lazy"})=>{const I=yt.useRef(null),[k,U]=yt.useState(!1),C="image"in e?e.image:e;yt.useEffect(()=>{var B;(B=I.current)!=null&&B.complete&&U(!0)},[]),X_(d,C.width,C.height,n,r,c);const w=Math.abs(C.width);w||console.warn("Invalid image width.");const z=Math.abs(C.height);if(z||console.warn("Invalid image height."),!cg(C.url))return console.error(`Invalid image url: ${C.url}`),nt.jsx(nt.Fragment,{children:g!=null&&g});const Q=n&&n>0?n:void 0,F=r&&r>0?r:void 0,{src:W,imgStyle:G,widths:q,updatedImageTransformations:le}=Q_(d,w,z,E,C.url,Q,F,c,T),se=q.map(B=>`${oc(C.url,B,(d===qi.ASPECT&&c?1/c:z/w)*B,le)} ${B}w`).join(", "),ge=[640,768,1024,1280,1536],j=q.map((B,V)=>V===q.length-1?`${B}px`:`(max-width: ${ge[V]}px) ${B}px`).join(", ");return nt.jsxs(nt.Fragment,{children:[!k&&g!=null&&g,nt.jsx("img",{ref:I,style:G,src:W,className:t,width:Q,height:F,srcSet:se,sizes:j,loading:R,alt:C.alternateText||"",...y})]})},X_=(e,t,n,r,c,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===qi.FIXED){if(!r&&!c){console.warn("Using fixed layout but neither width nor height is passed as props.");return}r&&r<0&&console.warn(`Using fixed layout but width is invalid: ${r}.`),c&&c<0&&console.warn(`Using fixed layout but height is invalid: ${c}.`);return}(r||c)&&console.warn("Width or height is passed in but layout is not fixed. These will have no impact. If you want to have a fixed height or width then set layout to fixed."),e===qi.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},Q_=(e,t,n,r,c,d,g,y,E)=>{let T=[100,320,640,960,1280,1920],R=oc(c,500,y?500/y:500,E);const I={...r},k=E?{...E}:{};switch(I.objectFit=I.objectFit||"cover",I.objectPosition=I.objectPosition||"center",e){case qi.INTRINSIC:I.maxWidth=t,I.width="100%",I.aspectRatio=y?`${y}`:`${t} / ${n}`;break;case qi.FIXED:{const{fixedWidth:U,fixedHeight:C,fixedWidths:w}=ey(t,n,T,d,g);I.width=U,I.height=C,T=w,R=oc(c,U,C,k);break}case qi.ASPECT:I.aspectRatio=y?`${y}`:`${t} / ${n}`,k&&(k.fit=(k==null?void 0:k.fit)||"cover");break;case qi.FILL:I.width="100%",I.aspectRatio=y?`${y}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:R,imgStyle:I,widths:T,updatedImageTransformations:k}},ey=(e,t,n,r,c)=>r&&c?{fixedWidth:r,fixedHeight:c,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:c?{fixedWidth:c/t*e,fixedHeight:c,fixedWidths:[c/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var dg={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="",g=0;g<arguments.length;g++){var y=arguments[g];y&&(d=c(d,r(y)))}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 g="";for(var y in d)t.call(d,y)&&d[y]&&(g=c(g,y));return g}function c(d,g){return g?d?d+" "+g:d+g:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(dg);var ty=dg.exports;const ro=rg(ty),ny="phonecall",ry="drivingdirection",jd="calltoactionclick",iy="clicktowebsite",sy="other",Vd="link",oy="cta",ly=e=>{const t={...e.cta??{link:e.href}};if(!t.link)throw e.cta?new Error("CTA's link is undefined"):new Error("Link's href is undefined");if(typeof t.link!="string")throw e.cta?new Error("CTA's link is not a valid string"):new Error("Link's href is not a valid string");return t.linkType||(t.linkType=uy(t.link)),t.link=dy(t),t},ay=(e,t)=>{switch(e.linkType){case"EMAIL":return"CTA_CLICK";case"PHONE":return"TAP_TO_CALL";case"CLICK_TO_WEBSITE":return"WEBSITE";case"DRIVING_DIRECTIONS":return"DRIVING_DIRECTIONS";case"OTHER":return"CTA_CLICK";case"URL":return"LINK";default:return t?"CTA_CLICK":"LINK"}},cy=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return ny;case"EMAIL":return jd;case"URL":return Vd;case"DRIVING_DIRECTIONS":return ry;case"CLICK_TO_WEBSITE":return iy;case"OTHER":return sy;default:return n?jd:Vd}return oy},uy=e=>fy(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",dy=e=>e.linkType==="EMAIL"?e.link.startsWith("mailto:")?e.link:`mailto:${e.link}`:e.linkType==="PHONE"?e.link.startsWith("tel:")?e.link:`tel:${e.link}`:e.link,fy=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),fg=yt.forwardRef(function(t,n){const{children:r,onClick:c,className:d,eventName:g,scope:y,currency:E,amount:T,cta:R,obfuscate:I,customTags:k,customValues:U,...C}=t,w=ly(t),z=ay(w,!!R),Q=cy(g,w.linkType,!!R),F=Xo(),W=I||I!==!1&&w.linkType==="EMAIL",G=async se=>{const ge=se.currentTarget;let j="";if(W){se.preventDefault();const B=ge.href.split("/").at(-1);B&&(j=atob(B))}if(F!==null)try{await F.track({action:z,scope:y,eventName:Q,currency:E,amount:T,destinationUrl:j||ge.href,customTags:k,customValues:U})}catch{console.error("Failed to report click Analytics Event")}c&&c(se),j&&(window.location.href=j)},q=W?"Obfuscated, set a label or child":w.link,le={className:ro("Link",d),href:W?btoa(w.link):w.link,onClick:G,rel:t.target&&!t.rel?"noopener":t.rel,ref:n};return F!=null&&F.getDebugEnabled()&&(le["data-ya-action"]=z,le["data-ya-scopeoverride"]=y,le["data-ya-eventname"]=Q),nt.jsx("a",{...C,...le,suppressHydrationWarning:!0,children:r||w.label||q})});var yn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(yn||{}),Kr=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Kr||{});const Vc=3959,qc=6371,hy=["latitude","lat"],gy=["longitude","lon","lng","long"];function qd(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function Zd(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 Qs(e){return e*Math.PI/180}function Vi(e){return e/Math.PI*180}function py(e,t){const n=Qs(e.latitude),r=Qs(t.latitude),c=r-n,d=Qs(t.longitude-e.longitude),g=Math.pow(Math.sin(c/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g))}function my(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 _y(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,c=n;this._lat=0,this._lon=0,typeof t=="object"?(r=qd(t,hy)??0,c=qd(t,gy)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof c=="function"?c():c):typeof r=="number"&&typeof c=="number"&&(this.latitude=r,this.longitude=c)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(Zd(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=Zd(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=yn.DEGREE,c=Kr.SPHERICAL){if(c===Kr.MERCATOR&&(r===yn.DEGREE||r===yn.RADIAN)){const d=r===yn.DEGREE?Qs(t):t,g=r===yn.DEGREE?n:Vi(n);this.latitude=_y(this.latitude,d),this.longitude+=g}else switch(r){case yn.DEGREE:this.latitude+=t,this.longitude+=n;break;case yn.KILOMETER:this.latitude+=Vi(t)*qc,this.longitude+=Vi(n)*qc*Math.cos(Qs(this.latitude));break;case yn.MILE:this.latitude+=Vi(t)*Vc,this.longitude+=Vi(n)*Vc*Math.cos(Qs(this.latitude));break;case yn.RADIAN:this.latitude+=Vi(t),this.longitude+=Vi(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=yn.MILE,r=Kr.SPHERICAL){if(r===Kr.MERCATOR&&(n===yn.DEGREE||n===yn.RADIAN)){const c=my(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),g=Qs(Math.min(d,360-d)),y=Math.sqrt(Math.pow(c,2)+Math.pow(g,2));switch(n){case yn.DEGREE:return Vi(y);case yn.RADIAN:return y;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const c=py(this,t);switch(n){case yn.DEGREE:return Vi(c);case yn.KILOMETER:return c*qc;case yn.MILE:return c*Vc;case yn.RADIAN:return c;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 hg(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var xr=(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))(xr||{});function br(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 Wu(e){if(!(e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.tagName=="string"))throw new Error(`Value with name ${e.constructor.name} is not a valid HTMLElement.`)}function Qr(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 gg{constructor(t,n){Ie(this,"providerMapClass");Ie(this,"wrapper");Ie(this,"controlEnabled");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"providerOptions");Ie(this,"iframeWindow");Ie(this,"apiKey");Qr(t,Ns),n&&Wu(n),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 br(t,xr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return br(t,xr.FUNCTION),this.panStartHandler=t,this}withProviderOptions(t){return this.providerOptions=t,this}withIframeWindow(t){return this.iframeWindow=t,this}withApiKey(t){return this.apiKey=t,this}build(){const t=this.providerMapClass;return new t(this)}}class Qo{constructor(t){Ie(this,"_panHandler");Ie(this,"_panStartHandler");Qr(t,gg),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 pg{constructor(t){Ie(this,"providerPinClass");Ie(this,"clickHandler");Ie(this,"focusHandler");Ie(this,"hoverHandler");Ie(this,"icons");Ie(this,"hasPinUrl");Qr(t,Ns),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return br(t,xr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return br(t,xr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return br(t,xr.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 Ku{constructor(t){Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_icons");Qr(t,pg),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 yy=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class el extends Ku{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,el.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 yy}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(),c=n.getElement()||this._pinEl,d=n.getZIndex();c.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),c!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(c)))}setElementProperties(n){const r=n.getAnchorX(),c=n.getAnchorY(),d=n.getHeight(),g=this._icons[n.getIcon()],y=n.getSRText(),E=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:g?`url("${g}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*c}%)`,width:E+"px"}),this._pinAlt.innerText=y}}class io{constructor(){Ie(this,"loadFunction");Ie(this,"mapClass");Ie(this,"pinClass");Ie(this,"providerName");this.loadFunction=(t,n,r,c)=>t(),this.mapClass=Qo,this.pinClass=Ku,this.providerName=""}withLoadFunction(t){return br(t,xr.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 Ns(this)}}class Ns{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");Qr(t,io),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 Ny extends Qo{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,g;const c=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(c):(g=this.map)==null||g.setCenter(c)}setZoom(n,r){var c;(c=this.map)==null||c.setZoom(Math.floor(n))}setZoomCenter(n,r,c){this.setCenter(r,c),this.setZoom(n,c)}}class Cy extends el{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(g){super();Ie(this,"pin");this.pin=g}draw(){var y;const g=(y=this.getProjection())==null?void 0:y.fromLatLngToDivPixel(this.pin._latLng??null);g&&this.pin._wrapper&&(this.pin._wrapper.style.left=g.x+"px",this.pin._wrapper.style.top=g.y+"px")}onAdd(){var g;this.pin._wrapper&&((g=this.getPanes())==null||g.floatPane.appendChild(this.pin._wrapper))}onRemove(){var g,y;(y=(g=this.pin._wrapper)==null?void 0:g.parentNode)==null||y.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 c=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(c??null)}}const Jd="GoogleMapsCallback_b7d77ff2",Ey="https://maps.googleapis.com/maps/api/js";function Ty(e,t,n,{autocomplete:r=!1,channel:c=window.location.hostname,client:d,language:g,region:y,libraries:E=[],loading:T="async",params:R={}}={}){window[Jd]=e,r&&E.push("geocoder","places");const I={callback:Jd,channel:c,libraries:E.join(","),...R};n&&(I.key=n),d&&(I.client=d),g&&(I.language=g),y&&(I.region=y),T&&(I.loading=T),hg(Ey+"?"+Object.entries(I).map(([k,U])=>k+"="+U).join("&"))}const mg=new io().withLoadFunction(Ty).withMapClass(Ny).withPinClass(Cy).withProviderName("Google").build();class Xs{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),c=Math.min(...n),d=t.map(T=>T.normalLon).sort((T,R)=>T-R),g=d.map((T,R)=>({distance:(R<d.length-1?d[R+1]:d[0]+360)-T,index:R})).reduce((T,R)=>R.distance>T.distance?R:T).index,y=d[g],E=d[(g+1)%d.length];return new this(new un(c,E),new un(r,y))}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,c=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||c)}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=Kr.SPHERICAL){const n=new un(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,yn.DEGREE,t),c=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,yn.DEGREE,t),n.longitude=c,n}}class xy{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 zu{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 xy,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 br(t,xr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(Qr(t,Ns),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new Sy(this)}}class Sy{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(Qr(t,zu),t.provider&&Qr(t.provider,Ns),!((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=c=>this._hoverHandler(c),this._hoverHandler=c=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new pg(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(c=>this._focusHandler(c)).withHoverHandler(c=>this._hoverHandler(c)).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){br(t,xr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new un(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){br(t,xr.FUNCTION),this._focusHandler=t}setHoverHandler(t){br(t,xr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&Qr(t,yg),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(c=>{this._cancelHiddenUpdater=()=>{n=!0,c()}});(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 hs=.98;function Ua(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class _g{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");Ie(this,"iframeWindow");Ie(this,"apiKey");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 br(t,xr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return br(t,xr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return Qr(t,Ns),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(Wu(t),this.wrapper=t,this):this}withIframeWindow(t){return this.iframeWindow=t,this}withApiKey(t){return this.apiKey=t,this}build(){return new yg(this)}}let yg=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,c;if(Qr(t,_g),t.provider&&Qr(t.provider,Ns),t.wrapper&&Wu(t.wrapper),!((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);(c=this._wrapper)!=null&&c.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new gg(t.provider,this._wrapper).withControlEnabled(t.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(t.providerOptions).withIframeWindow(t.iframeWindow).withApiKey(t.apiKey).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(t,n=!1,r=this._singlePinZoom){t.length?this.setBounds(Xs.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,c=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),g=this.getCenter(),y=360/Math.pow(2,d+8),E=c*y,T=r*y;this._cachedBounds=new Xs(g,g),this._cachedBounds.ne.add(T/2,E/2,yn.DEGREE,Kr.MERCATOR),this._cachedBounds.sw.add(-T/2,-E/2,yn.DEGREE,Kr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new Xs(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 zu().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new Xs(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 Xs(new un(this._currentBounds.sw),new un(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,c={},d=1/0){var B,V;const g=(B=this._wrapper)==null?void 0:B.offsetHeight,y=(V=this._wrapper)==null?void 0:V.offsetWidth;if(!g||!y)return;let E=Ua(c.bottom,g),T=Ua(c.left,y),R=Ua(c.right,y),I=Ua(c.top,g),k=T+R,U=E+I;k>hs&&(T*=hs/k,R*=hs/k,k=hs),U>hs&&(E*=hs/U,I*=hs/U,U=hs);const C=g*(1-U),w=y*(1-k),z=new Xs(n,t),Q=new un(z.ne.latitude,z.sw.longitude),F=z.sw.distanceTo(Q,yn.DEGREE,Kr.MERCATOR),W=(z.ne.longitude-Q.longitude+360)%360;let G=Math.max(F,W*C/w)/(1-U),q=Math.max(W,F*w/C)/(1-k),le=Math.log2(y*360/q)-8;le>d&&(le=d,q=y*360/2**(le+8),G=q*g/y);const se=z.getCenter(Kr.MERCATOR),ge=(I-E)/2*G,j=(R-T)/2*q;se.add(ge,j,yn.DEGREE,Kr.MERCATOR),this.setZoomCenter(le,se,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:c=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:c},this}setPanHandler(t){br(t,xr.FUNCTION),this._panHandler=t}setPanStartHandler(t){br(t,xr.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 mc=yt.createContext(null);function vy(){const e=yt.useContext(mc);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Ng=({apiKey:e,bounds:t,children:n,className:r,clientKey:c,controls:d=!0,defaultCenter:g={latitude:39.83,longitude:-98.58},defaultZoom:y=4,mapRef:E,padding:T={bottom:50,left:50,right:50,top:50},panHandler:R=()=>null,panStartHandler:I=()=>null,provider:k=mg,providerOptions:U={},singleZoom:C=14,iframeId:w})=>{const z=yt.useRef(null),[Q,F]=yt.useState(new un(g)),[W,G]=yt.useState(!1),[q,le]=yt.useState(),[se,ge]=yt.useState(y),j=(B,V)=>{R(B,V),V&&F(V.getCenter())};return yt.useEffect(()=>{!W||!q||ge(q.getZoom())},[Q]),yt.useEffect(()=>{if(!t||!W||!q)return;const B=t.map(V=>new un(V));q.fitCoordinates(B)},[JSON.stringify(t),q]),yt.useEffect(()=>{var xe;if(!W||q)return;const B=w&&typeof document<"u"?((xe=document.getElementById(w))==null?void 0:xe.contentWindow)??void 0:void 0,V=new _g().withControlEnabled(d).withDefaultCenter(Q).withDefaultZoom(se).withPadding(T).withPanHandler(j).withPanStartHandler(I).withProvider(k).withProviderOptions(U).withSinglePinZoom(C).withWrapper(z.current).withIframeWindow(B).withApiKey(e).build();le(V),E&&(E.current=V)},[W]),yt.useEffect(()=>{W||q||!z.current||k instanceof Ns&&k.load(e,{...U,...c&&{client:c}}).then(()=>G(!0))},[]),nt.jsx("div",{className:ro({"is-loaded":W},r),id:"map",ref:z,"data-testid":"map",children:q&&nt.jsx(mc.Provider,{value:{map:q,provider:k},children:n})})},wy=({count:e})=>nt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:nt.jsxs("g",{fill:"none",fillRule:"evenodd",children:[nt.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),nt.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:nt.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),Uu=yt.createContext(null);function Oy(){const e=yt.useContext(Uu);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const Ay=({clusterRadius:e=50,children:t,ClusterTemplate:n=wy})=>{const{map:r}=yt.useContext(mc),[c,d]=yt.useState([]),[g,y]=yt.useState(),[E,T]=yt.useState([]),[R,I]=yt.useState([]);return yt.useEffect(()=>{y(Dy(c,r.getZoom(),e))},[c,r.getZoom()]),yt.useEffect(()=>{I(()=>[]),T(()=>[]),(g==null?void 0:g.length)!==0&&(g==null||g.forEach(k=>{if(k.length===1){k[0].pin.setMap(r);return}if(k.length>1){const U=Xs.fit(k.map(w=>w.pin.getCoordinate())).getCenter(Kr.MERCATOR),C=`cluster-{${U._lat},${U._lon}}`;k.forEach(w=>w.pin.setMap(null)),T(w=>[...w,C]),I(w=>[...w,nt.jsx(Gu,{coordinate:U,id:C,onClick:()=>r.fitCoordinates(k.map(z=>z.pin.getCoordinate()),!0,1/0),children:nt.jsx(n,{count:k.length})},C)])}}))},[g]),nt.jsx(Uu.Provider,{value:{clusters:g??[],clusterIds:E,setPinStore:d},children:nt.jsxs(nt.Fragment,{children:[R.map((k,U)=>nt.jsx(yt.Fragment,{children:k},U)),t]})})},Dy=(e,t,n)=>{const r=n*Math.PI/2**(t+7),c=e.map((y,E)=>[E]),d=[];e.forEach((y,E)=>{for(let T=E;T<e.length;T++)T!==E&&new un(y.pin.getCoordinate()).distanceTo(new un(e[T].pin.getCoordinate()),yn.RADIAN,Kr.MERCATOR)<=r&&(c[E].push(T),c[T].push(E))});let g=1;for(;g;){g=0;let y;if(c.forEach((R,I)=>{R.length>g&&(g=R.length,y=I)}),!g)break;const E=c[y??0],T=[];c[y??0]=[];for(const R of E){const I=c[R];T.push(e[R]),c[R]=[],I.forEach(k=>c[k].splice(c[k].indexOf(R),1))}d.push(T)}return d},My=nt.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:nt.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"})}),Gu=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:c=My,onClick:d=()=>null,onFocus:g=()=>null,onHover:y=()=>null,zIndex:E,hasPinUrl:T=!1})=>{const{map:R,provider:I}=yt.useContext(mc),k=yt.useContext(Uu),U=yt.useMemo(()=>new zu().withCoordinate(t).withHideOffscreen(n).withProvider(I).withHasPinUrl(T).build(),[]);yt.useEffect(()=>{if(E!==0&&!E)return;const w=U.getProviderPin().getWrapperElement();w&&(w.style.zIndex=E.toString())},[E]),yt.useEffect(()=>{U.setMap(R),U.setClickHandler(()=>d(r)),U.setFocusHandler(z=>g(z,r)),U.setHoverHandler(z=>y(z,r));const w=k==null?void 0:k.clusterIds.includes(r);return k&&!w&&k.setPinStore(z=>[...z,{pin:U,id:r}]),()=>{U.setMap(null),k&&k.setPinStore(z=>z.filter(Q=>Q.id!==r))}},[]);const C=e||c;if(C){const w=U.getProviderPin().getPinElement();return Object.assign(w.style,{height:"auto",width:"auto"}),Vm.createPortal(C,w)}return null},Ry=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:c=()=>null,onHover:d=()=>null,onFocus:g=()=>null,...y})=>{var E;return nt.jsx(Ng,{bounds:[t],...y,children:nt.jsx(Gu,{coordinate:t,id:"location-map-marker",onClick:c,onHover:d,onFocus:g,hasPinUrl:((E=r||"")==null?void 0:E.length)>0,children:r?nt.jsx(fg,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var Zc={},zl={},Xd;function by(){if(Xd)return zl;Xd=1;var e=yt;const t=e.createContext(null);function n(c,d){let g=null;c!=null&&(g=c[1]);function y(){return d??(g!=null?g.getTheme():null)}return{getTheme:y}}function r(){const c=e.useContext(t);if(c==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return c}return zl.LexicalComposerContext=t,zl.createLexicalComposerContext=n,zl.useLexicalComposerContext=r,zl}var Ul={},Qd;function Iy(){if(Qd)return Ul;Qd=1;var e=yt;function t(r){let c=new URLSearchParams;c.append("code",r);for(let d=1;d<arguments.length;d++)c.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${c} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return Ul.LexicalComposerContext=n,Ul.createLexicalComposerContext=function(r,c){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return c??(d!=null?d.getTheme():null)}}},Ul.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},Ul}const ky=process.env.NODE_ENV==="development"?by():Iy();var so=ky,He={},ef;function Ly(){if(ef)return He;ef=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),c=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),g=e("INSERT_PARAGRAPH_COMMAND"),y=e("CONTROLLED_TEXT_INSERTION_COMMAND"),E=e("PASTE_COMMAND"),T=e("REMOVE_TEXT_COMMAND"),R=e("DELETE_WORD_COMMAND"),I=e("DELETE_LINE_COMMAND"),k=e("FORMAT_TEXT_COMMAND"),U=e("UNDO_COMMAND"),C=e("REDO_COMMAND"),w=e("KEYDOWN_COMMAND"),z=e("KEY_ARROW_RIGHT_COMMAND"),Q=e("MOVE_TO_END"),F=e("KEY_ARROW_LEFT_COMMAND"),W=e("MOVE_TO_START"),G=e("KEY_ARROW_UP_COMMAND"),q=e("KEY_ARROW_DOWN_COMMAND"),le=e("KEY_ENTER_COMMAND"),se=e("KEY_SPACE_COMMAND"),ge=e("KEY_BACKSPACE_COMMAND"),j=e("KEY_ESCAPE_COMMAND"),B=e("KEY_DELETE_COMMAND"),V=e("KEY_TAB_COMMAND"),xe=e("INSERT_TAB_COMMAND"),we=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),ue=e("DROP_COMMAND"),$=e("FORMAT_ELEMENT_COMMAND"),x=e("DRAGSTART_COMMAND"),Y=e("DRAGOVER_COMMAND"),ie=e("DRAGEND_COMMAND"),K=e("COPY_COMMAND"),P=e("CUT_COMMAND"),Z=e("SELECT_ALL_COMMAND"),O=e("CLEAR_EDITOR_COMMAND"),H=e("CLEAR_HISTORY_COMMAND"),J=e("CAN_REDO_COMMAND"),de=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),b=e("BLUR_COMMAND"),v=e("KEY_MODIFIER_COMMAND"),M=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",re=M&&"documentMode"in document?document.documentMode:null,ye=M&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ae=M&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=M&&"InputEvent"in window&&!re?"getTargetRanges"in new window.InputEvent("input"):!1,te=M&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ce=M&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=M&&/Android/.test(navigator.userAgent),Ne=M&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=M&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,Le=1,Fe=3,qe=0,Be=1,ct=2,Dt=0,Ut=1,en=2,Oe=1,ne=2,oe=4,Se=8,ke=16,Me=32,je=64,rt=128,it=Oe|ne|oe|Se|ke|Me|je|rt,st=1,vt=2,Ge=1,ze=2,tt=3,_t=4,Nt=5,Et=6,ht=" ",pt=te||ce||Re?ht:"",$t=`
|
|
37
|
-
|
|
38
|
-
`,Kt=Ae?ht:pt,tn="֑-߿יִ-﷽ﹰ-ﻼ",kt="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",jt=new RegExp("^[^"+kt+"]*["+tn+"]"),bt=new RegExp("^[^"+tn+"]*["+kt+"]"),nn={bold:Oe,code:ke,highlight:rt,italic:ne,strikethrough:oe,subscript:Me,superscript:je,underline:Se},Sr={directionless:st,unmergeable:vt},pi={center:ze,end:Et,justify:_t,left:Ge,right:tt,start:Nt},pe={[ze]:"center",[Et]:"end",[_t]:"justify",[Ge]:"left",[tt]:"right",[Nt]:"start"},Ze={normal:Dt,segmented:en,token:Ut},ot={[Dt]:"normal",[en]:"segmented",[Ut]:"token"},wt=100;let Gt=!1,Bt=0;function Pt(){return Gt}function Lt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&mo(u).addEventListener("textInput",Lt,!0)}function sn(u,s,a){return s.__lexicalLineBreak===u||u[`__lexicalKey_${a._key}`]!==void 0}function ln(u){return u.getEditorState().read(()=>{const s=mn();return s!==null?s.clone():null})}function Rn(u,s,a){const f=or(a._window);let p=null,m=null;f!==null&&f.anchorNode===u&&(p=f.anchorOffset,m=f.focusOffset);const A=u.nodeValue;A!==null&&kr(s,A,p,m,!1)}function mr(u,s,a){if(Tt(u)){const f=u.anchor.getNode();if(f.is(a)&&u.format!==f.getFormat())return!1}return s.nodeType===Fe&&a.isAttached()}function jn(u,s,a){Gt=!0;const f=performance.now()-Bt>wt;try{Hr(u,()=>{const p=mn()||ln(u),m=new Map,A=u.getRootElement(),D=u._editorState,ae=u._blockCursorElement;let fe=!1,me="";for(let ve=0;ve<s.length;ve++){const Ce=s[ve],Ve=Ce.type,Ue=Ce.target;let $e=ni(Ue,D);if(!($e===null&&Ue!==A||An($e))){if(Ve==="characterData")f&&mt($e)&&mr(p,Ue,$e)&&Rn(Ue,$e,u);else if(Ve==="childList"){fe=!0;const Rt=Ce.addedNodes;for(let qt=0;qt<Rt.length;qt++){const Wt=Rt[qt],At=co(Wt),an=Wt.parentNode;if(an!=null&&Wt!==ae&&At===null&&(Wt.nodeName!=="BR"||!sn(Wt,an,u))){if(Ae){const nr=Wt.innerText||Wt.nodeValue;nr&&(me+=nr)}an.removeChild(Wt)}}const Qe=Ce.removedNodes,ft=Qe.length;if(ft>0){let qt=0;for(let Wt=0;Wt<ft;Wt++){const At=Qe[Wt];(At.nodeName==="BR"&&sn(At,Ue,u)||ae===At)&&(Ue.appendChild(At),qt++)}ft!==qt&&(Ue===A&&($e=dl(D)),m.set(Ue,$e))}}}}if(m.size>0)for(const[ve,Ce]of m)if(et(Ce)){const Ve=Ce.getChildrenKeys();let Ue=ve.firstChild;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=u.getElementByKey(Rt);Qe!==null&&(Ue==null?(ve.appendChild(Qe),Ue=Qe):Ue!==Qe&&ve.replaceChild(Qe,Ue),Ue=Ue.nextSibling)}}else mt(Ce)&&Ce.markDirty();const Te=a.takeRecords();if(Te.length>0){for(let ve=0;ve<Te.length;ve++){const Ce=Te[ve],Ve=Ce.addedNodes,Ue=Ce.target;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=Rt.parentNode;Qe!=null&&Rt.nodeName==="BR"&&!sn(Rt,Ue,u)&&Qe.removeChild(Rt)}}a.takeRecords()}p!==null&&(fe&&(p.dirty=!0,yr(p)),Ae&&Tl(u)&&p.insertRawText(me))})}finally{Gt=!1}}function dn(u){const s=u._observer;if(s!==null){const a=s.takeRecords();jn(u,a,s)}}function rr(u){Ht(u),u._observer=new MutationObserver((s,a)=>{jn(u,s,a)})}function ir(u,s){const a=u.__mode,f=u.__format,p=u.__style,m=s.__mode,A=s.__format,D=s.__style;return(a===null||a===m)&&(f===null||f===A)&&(p===null||p===D)}function Oi(u,s){const a=u.mergeWithSibling(s),f=Tn()._normalizedNodes;return f.add(u.__key),f.add(s.__key),a}function _r(u){let s=u;if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable()){s.remove();return}let a;for(;(a=s.getPreviousSibling())!==null&&mt(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else if(ir(a,s)){s=Oi(a,s);break}else break;let f;for(;(f=s.getNextSibling())!==null&&mt(f)&&f.isSimpleText()&&!f.isUnmergeable();)if(f.__text==="")f.remove();else if(ir(s,f)){s=Oi(s,f);break}else break}function xs(u){return lo(u.anchor),lo(u.focus),u}function lo(u){for(;u.type==="element";){const s=u.getNode(),a=u.offset;let f,p;if(a===s.getChildrenSize()?(f=s.getChildAtIndex(a-1),p=!0):(f=s.getChildAtIndex(a),p=!1),mt(f)){u.set(f.__key,p?f.getTextContentSize():0,"text");break}else if(!et(f))break;u.set(f.__key,p?f.getChildrenSize():0,"element")}}let ol=1;function Ur(){return""+ol++}function da(u,s){const a=u._nodes.get(s);if(a===void 0)throw Error(`registeredNode: Type ${s} not found`);return a}const ao=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function es(u){return An(ni(u))}function Ss(u){const s=document.activeElement;if(s===null)return!1;const a=s.nodeName;return An(ni(u))&&(a==="INPUT"||a==="TEXTAREA"||s.contentEditable==="true"&&s.__lexicalEditor==null)}function ts(u,s,a){const f=u.getRootElement();try{return f!==null&&f.contains(s)&&f.contains(a)&&s!==null&&!Ss(s)&&ll(s)===u}catch{return!1}}function ll(u){let s=u;for(;s!=null;){const a=s.__lexicalEditor;if(a!=null)return a;s=po(s)}return null}function bn(u){return jt.test(u)?"rtl":bt.test(u)?"ltr":null}function Wn(u){return u.isToken()||u.isSegmented()}function ti(u){return u.nodeType===Fe}function Ir(u){let s=u;for(;s!=null;){if(ti(s))return s;s=s.firstChild}return null}function $n(u,s,a){const f=nn[s];if(a!==null&&(u&f)===(a&f))return u;let p=u^f;return s==="subscript"?p&=-65:s==="superscript"&&(p&=-33),p}function vs(u){return mt(u)||oi(u)||An(u)}function al(u,s){if(s!=null){u.__key=s;return}ur(),Td();const a=Tn(),f=Ei(),p=Ur();f._nodeMap.set(p,u),et(u)?a._dirtyElements.set(p,!0):a._dirtyLeaves.add(p),a._cloneNotNeeded.add(p),a._dirtyType=Be,u.__key=p}function cl(u,s,a){let f=u;for(;f!==null;){if(a.has(f))return;const p=s.get(f);if(p===void 0)break;a.set(f,!1),f=p.__parent}}function Gr(u){const s=u.getParent();if(s!==null){const a=u.getWritable(),f=s.getWritable(),p=u.getPreviousSibling(),m=u.getNextSibling();if(p===null)if(m!==null){const A=m.getWritable();f.__first=m.__key,A.__prev=null}else f.__first=null;else{const A=p.getWritable();if(m!==null){const D=m.getWritable();D.__prev=A.__key,A.__next=D.__key}else A.__next=null;a.__prev=null}if(m===null)if(p!==null){const A=p.getWritable();f.__last=p.__key,A.__next=null}else f.__last=null;else{const A=m.getWritable();if(p!==null){const D=p.getWritable();D.__next=A.__key,A.__prev=D.__key}else A.__prev=null;a.__next=null}f.__size--,a.__parent=null}}function Ai(u){Td();const s=u.getLatest(),a=s.__parent,f=Ei(),p=Tn(),m=f._nodeMap,A=p._dirtyElements;a!==null&&cl(a,m,A);const D=s.__key;p._dirtyType=Be,et(u)?A.set(D,!0):p._dirtyLeaves.add(D)}function ul(u){const s=u.getPreviousSibling(),a=u.getNextSibling();s!==null&&Ai(s),a!==null&&Ai(a)}function xn(u){ur();const s=Tn(),a=s._compositionKey;if(u!==a){if(s._compositionKey=u,a!==null){const f=Nn(a);f!==null&&f.getWritable()}if(u!==null){const f=Nn(u);f!==null&&f.getWritable()}}}function sr(){return Lo()?null:Tn()._compositionKey}function Nn(u,s){const f=(s||Ei())._nodeMap.get(u);return f===void 0?null:f}function co(u,s){const a=Tn(),f=u[`__lexicalKey_${a._key}`];return f!==void 0?Nn(f,s):null}function ni(u,s){let a=u;for(;a!=null;){const f=co(a,s);if(f!==null)return f;a=po(a)}return null}function ws(u){const s=u._decorators,a=Object.assign({},s);return u._pendingDecorators=a,a}function uo(u){return u.read(()=>Qn().getTextContent())}function Di(u,s){Hr(u,()=>{const a=Ei();if(a.isEmpty())return;if(s==="root"){Qn().markDirty();return}const f=a._nodeMap;for(const[,p]of f)p.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function Qn(){return dl(Ei())}function dl(u){return u._nodeMap.get("root")}function yr(u){ur();const s=Ei();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)}s._selection=u}function fl(){ur();const u=Tn();dn(u)}function Mi(u){const s=Tn(),a=fa(u,s);if(a===null){const f=s.getRootElement();return u===f?Nn("root"):null}return Nn(a)}function hl(u,s){return s?u.getTextContentSize():0}function fa(u,s){let a=u;for(;a!=null;){const f=a[`__lexicalKey_${s._key}`];if(f!==void 0)return f;a=po(a)}return null}function Os(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Ri(u){const s=[];let a=u;for(;a!==null;)s.push(a),a=a._parentEditor;return s}function gl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function fo(u){return u.nodeType===Fe?u.nodeValue:null}function As(u,s,a){const f=or(s._window);if(f===null)return;const p=f.anchorNode;let{anchorOffset:m,focusOffset:A}=f;if(p!==null){let D=fo(p);const ae=ni(p);if(D!==null&&mt(ae)){if(D===pt&&a){const fe=a.length;D=a,m=fe,A=fe}D!==null&&kr(ae,D,m,A,u)}}}function kr(u,s,a,f,p){let m=u;if(m.isAttached()&&(p||!m.isDirty())){const A=m.isComposing();let D=s;(A||p)&&s[s.length-1]===pt&&(D=s.slice(0,-1));const ae=m.getTextContent();if(p||D!==ae){if(D===""){if(xn(null),!te&&!ce&&!Re){const Ue=Tn();setTimeout(()=>{Ue.update(()=>{m.isAttached()&&m.remove()})},20)}else m.remove();return}const fe=m.getParent(),me=ko(),Te=m.getTextContentSize(),ve=sr(),Ce=m.getKey();if(m.isToken()||ve!==null&&Ce===ve&&!A||Tt(me)&&(fe!==null&&!fe.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!m.canInsertTextBefore()&&!A||me.focus.key===u.__key&&me.focus.offset===Te&&!m.canInsertTextAfter()&&!A)){m.markDirty();return}const Ve=mn();if(!Tt(Ve)||a===null||f===null){m.setTextContent(D);return}if(Ve.setTextNodeRange(m,a,m,f),m.isSegmented()){const Ue=m.getTextContent(),$e=On(Ue);m.replace($e),m=$e}m.setTextContent(D)}}}function pl(u){const s=u.getPreviousSibling();return(mt(s)||et(s)&&s.isInline())&&!s.canInsertTextAfter()}function Ds(u,s){if(s.isSegmented())return!0;if(!u.isCollapsed())return!1;const a=u.anchor.offset,f=s.getParentOrThrow(),p=s.isToken();return a===0?!s.canInsertTextBefore()||!f.canInsertTextBefore()||p||pl(s):a===s.getTextContentSize()?!s.canInsertTextAfter()||!f.canInsertTextAfter()||p:!1}function ha(u,s,a,f){return u===9&&!s&&!a&&!f}function ga(u,s,a,f){return u===66&&!s&&Yr(a,f)}function ns(u,s,a,f){return u===73&&!s&&Yr(a,f)}function Ms(u,s,a,f){return u===85&&!s&&Yr(a,f)}function ml(u,s){return Sa(u)&&!s}function _l(u,s){return Sa(u)&&s}function Rs(u,s){return ye&&s&&u===79}function bs(u,s,a){return jr(u)&&(ye?s:a)}function pa(u,s,a){return Ii(u)&&(ye?s:a)}function ma(u,s){return ye&&s&&jr(u)}function _a(u,s){return ye&&s&&Ii(u)}function ya(u,s,a,f){return ye?s||a?!1:jr(u)||u===72&&f:f||s||a?!1:jr(u)}function Dc(u,s,a,f,p){return ye?a||f||p?!1:Ii(u)||u===68&&s:s||f||p?!1:Ii(u)}function Mc(u,s,a,f){return u===90&&!s&&Yr(a,f)}function Na(u,s,a,f){return ye?u===90&&a&&s:u===89&&f||u===90&&f&&s}function Rc(u,s,a,f){return s?!1:u===67?ye?a:f:!1}function bc(u,s,a,f){return s?!1:u===88?ye?a:f:!1}function Ca(u){return u===37}function Ea(u){return u===39}function yl(u){return u===38}function Ic(u){return u===40}function kc(u,s,a,f){return Ca(u)&&!s&&!f&&!a}function Ta(u,s,a,f,p){return Ca(u)&&!f&&!a&&(s||p)}function rs(u,s,a,f){return Ea(u)&&!s&&!f&&!a}function xa(u,s,a,f,p){return Ea(u)&&!f&&!a&&(s||p)}function Lc(u,s,a){return yl(u)&&!s&&!a}function Nl(u,s,a){return Ic(u)&&!s&&!a}function Is(u,s,a,f){return u||s||a||f}function Pc(u){return u===32}function Yr(u,s){return ye?u:s}function Sa(u){return u===13}function jr(u){return u===8}function bi(u){return u===27}function Ii(u){return u===46}function ho(u,s,a){return u===65&&Yr(s,a)}function Cl(){const u=Qn(),s=u.select(0,u.getChildrenSize());yr(xs(s))}function ki(u,s){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const a=u.__lexicalClassNameCache,f=a[s];if(f!==void 0)return f;const p=u[s];if(typeof p=="string"){const m=p.split(" ");return a[s]=m,m}return p}function is(u,s,a,f,p){if(a.size===0)return;const m=f.__type,A=f.__key,D=s.get(m);if(D===void 0)throw Error(`Type ${m} not in registeredNodes`);const ae=D.klass;let fe=u.get(ae);fe===void 0&&(fe=new Map,u.set(ae,fe));const me=fe.get(A),Te=me==="destroyed"&&p==="created";(me===void 0||Te)&&fe.set(A,Te?"updated":p)}function Li(u){const s=Ei(),a=s._readOnly,f=u.getType(),p=s._nodeMap,m=[];for(const[,A]of p)A instanceof u&&A.__type===f&&(a||A.isAttached())&&m.push(A);return m}function va(u,s,a){const f=u.getParent();let p=a,m=u;return f!==null&&(s&&a===0?(p=m.getIndexWithinParent(),m=f):!s&&a===m.getChildrenSize()&&(p=m.getIndexWithinParent()+1,m=f)),m.getChildAtIndex(s?p-1:p)}function El(u,s){const a=u.offset;if(u.type==="element"){const f=u.getNode();return va(f,s,a)}else{const f=u.getNode();if(s&&a===0||!s&&a===f.getTextContentSize()){const p=s?f.getPreviousSibling():f.getNextSibling();return p===null?va(f.getParentOrThrow(),s,f.getIndexWithinParent()+(s?0:1)):p}}return null}function Tl(u){const s=mo(u).event,a=s&&s.inputType;return a==="insertFromPaste"||a==="insertFromPasteAsQuotation"}function ut(u,s,a){return Od(u,s,a)}function go(u){return!Wr(u)&&!u.isLastChild()&&!u.isInline()}function ks(u,s){const a=u._keyToDOMMap.get(s);if(a===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${s}`);return a}function po(u){const s=u.assignedSlot||u.parentElement;return s!==null&&s.nodeType===11?s.host:s}function mi(u,s,a){const f=a.ownerDocument,p=f.defaultView;if(p===null)return;let{top:m,bottom:A}=s,D=0,ae=0,fe=a;for(;fe!==null;){const me=fe===f.body;if(me)D=0,ae=mo(u).innerHeight;else{const ve=fe.getBoundingClientRect();D=ve.top,ae=ve.bottom}let Te=0;if(m<D?Te=-(D-m):A>ae&&(Te=A-ae),Te!==0)if(me)p.scrollBy(0,Te);else{const ve=fe.scrollTop;fe.scrollTop+=Te;const Ce=fe.scrollTop-ve;m-=Ce,A-=Ce}if(me)break;fe=po(fe)}}function Kn(u){return Tn()._updateTags.has(u)}function Ct(u){ur(),Tn()._updateTags.add(u)}function ss(u){const s=mn();if(!Tt(s)||!et(u))return s;const{anchor:a,focus:f}=s,p=a.getNode(),m=f.getNode();return Pi(p,u)&&a.set(u.__key,0,"element"),Pi(m,u)&&f.set(u.__key,0,"element"),s}function Pi(u,s){let a=u.getParent();for(;a!==null;){if(a.is(s))return!0;a=a.getParent()}return!1}function wa(u){const s=u.ownerDocument;return s&&s.defaultView||null}function mo(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function Lr(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function _o(u){let s=u.getParentOrThrow();for(;s!==null;){if(ri(s))return s;s=s.getParentOrThrow()}return s}function ri(u){return Wr(u)||et(u)&&u.isShadowRoot()}function xl(u){const s=u.constructor.clone(u);return al(s,null),s}function vr(u){const s=Tn(),a=u.constructor.getType(),f=s._nodes.get(a);if(f===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const p=f.replace;if(p!==null){const m=p(u);if(!(m instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return m}return u}function Ls(u,s){const a=u.getParent();if(Wr(a)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function yo(u){const s=u.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let f=s.blockCursor;if(f!==void 0){if(typeof f=="string"){const p=f.split(" ");f=s.blockCursor=p}f!==void 0&&a.classList.add(...f)}return a}function Mt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function Ps(u,s,a){a.style.removeProperty("caret-color"),s._blockCursorElement=null;const f=u.parentElement;f!==null&&f.removeChild(u)}function _i(u,s,a){let f=u._blockCursorElement;if(Tt(a)&&a.isCollapsed()&&a.anchor.type==="element"&&s.contains(document.activeElement)){const p=a.anchor,m=p.getNode(),A=p.offset,D=m.getChildrenSize();let ae=!1,fe=null;if(A===D){const me=m.getChildAtIndex(A-1);Mt(me)&&(ae=!0)}else{const me=m.getChildAtIndex(A);if(Mt(me)){const Te=me.getPreviousSibling();(Te===null||Mt(Te))&&(ae=!0,fe=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(m.__key);f===null&&(u._blockCursorElement=f=yo(u._config)),s.style.caretColor="transparent",fe===null?me.appendChild(f):me.insertBefore(f,fe);return}}f!==null&&Ps(f,u,s)}function or(u){return M?(u||window).getSelection():null}function Oa(u,s){let a=u.getChildAtIndex(s);if(a==null&&(a=u),ri(u))throw Error("Can not call $splitNode() on root element");const f=A=>{const D=A.getParentOrThrow(),ae=ri(D),fe=A===a&&!ae?A:xl(A);if(ae){if(!(et(A)&&et(fe)))throw Error("Children of a root must be ElementNode");return A.insertAfter(fe),[A,fe,fe]}else{const[me,Te,ve]=f(D),Ce=A.getNextSiblings();return ve.append(fe,...Ce),[me,Te,fe]}},[p,m]=f(a);return[p,m]}function No(u,s){let a=u;for(;a!==Qn()&&a!=null;){if(s(a))return a;a=a.getParent()}return null}function Aa(u){return $s(u)&&u.tagName==="A"}function $s(u){return u.nodeType===1}function $i(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||ri(u))return!1;const s=u.getFirstChild(),a=s===null||oi(s)||mt(s)||s.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&a}function Co(u,s){let a=u;for(;a!==null&&a.getParent()!==null&&!s(a);)a=a.getParentOrThrow();return s(a)?a:null}function Da(u,s){const a=u._decorators;let p=u._pendingDecorators||a;const m=s._nodeMap;let A;for(A in p)m.has(A)||(p===a&&(p=ws(u)),delete p[A])}function Sl(u,s,a,f,p,m){let A=u.getFirstChild();for(;A!==null;){const D=A.__key;A.__parent===s&&(et(A)&&Sl(A,D,a,f,p,m),a.has(D)||m.delete(D),p.push(D)),A=A.getNextSibling()}}function vl(u,s,a,f){const p=u._nodeMap,m=s._nodeMap,A=[];for(const[D]of f){const ae=m.get(D);ae!==void 0&&(ae.isAttached()||(et(ae)&&Sl(ae,D,p,m,A,f),p.has(D)||f.delete(D),A.push(D)))}for(const D of A)m.delete(D);for(const D of a){const ae=m.get(D);ae!==void 0&&!ae.isAttached()&&(p.has(D)||a.delete(D),m.delete(D))}}let In="",zn="",Vt="",Nr,Fn,os,Ma=!1,ls=!1,Fs,Bs=null,Hs,wl,Fi,hn,wn,Bn;function as(u,s){const a=Fi.get(u);if(s!==null){const f=xo(u);f.parentNode===s&&s.removeChild(f)}if(hn.has(u)||Fn._keyToDOMMap.delete(u),et(a)){const f=Ni(a,Fi);Bi(f,0,f.length-1,null)}a!==void 0&&is(Bn,os,Fs,a,"destroyed")}function Bi(u,s,a,f){let p=s;for(;p<=a;++p){const m=u[p];m!==void 0&&as(m,f)}}function yi(u,s){u.setProperty("text-align",s)}const cs="40px";function Vn(u,s){const a=Nr.theme.indent;if(typeof a=="string"){const p=u.classList.contains(a);s>0&&!p?u.classList.add(a):s<1&&p&&u.classList.remove(a)}const f=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||cs;u.style.setProperty("padding-inline-start",s===0?"":`calc(${s} * ${f})`)}function Pr(u,s){const a=u.style;s===0?yi(a,""):s===Ge?yi(a,"left"):s===ze?yi(a,"center"):s===tt?yi(a,"right"):s===_t?yi(a,"justify"):s===Nt?yi(a,"start"):s===Et&&yi(a,"end")}function fn(u,s,a){const f=hn.get(u);if(f===void 0)throw Error("createNode: node does not exist in nodeMap");const p=f.createDOM(Nr,Fn);if(Je(u,p,Fn),mt(f)?p.setAttribute("data-lexical-text","true"):An(f)&&p.setAttribute("data-lexical-decorator","true"),et(f)){const m=f.__indent,A=f.__size;if(m!==0&&Vn(p,m),A!==0){const ae=A-1,fe=Ni(f,hn);Ra(fe,ae,f,p)}const D=f.__format;D!==0&&Pr(p,D),f.isInline()||Eo(null,f,p),go(f)&&(In+=$t,Vt+=$t)}else{const m=f.getTextContent();if(An(f)){const A=f.decorate(Fn,Nr);A!==null&&Dl(u,A),p.contentEditable="false"}else mt(f)&&(f.isDirectionless()||(zn+=m));In+=m,Vt+=m}if(s!==null)if(a!=null)s.insertBefore(p,a);else{const m=s.__lexicalLineBreak;m!=null?s.insertBefore(p,m):s.appendChild(p)}return Object.freeze(f),is(Bn,os,Fs,f,"created"),p}function Ra(u,s,a,f){const p=zn;zn="",Ol(u,a,0,s,f,null),Al(a,f),zn=p}function Ol(u,s,a,f,p,m){const A=In;In="";let D=a;for(;D<=f;++D)fn(u[D],p,m);go(s)&&(In+=$t),p.__lexicalTextContent=In,In=A+In}function ba(u,s){const a=s.get(u);return oi(a)||An(a)&&a.isInline()}function Eo(u,s,a){const f=u!==null&&(u.__size===0||ba(u.__last,Fi)),p=s.__size===0||ba(s.__last,hn);if(f){if(!p){const m=a.__lexicalLineBreak;m!=null&&a.removeChild(m),a.__lexicalLineBreak=null}}else if(p){const m=document.createElement("br");a.__lexicalLineBreak=m,a.appendChild(m)}}function Al(u,s){const a=s.__lexicalDirTextContent,f=s.__lexicalDir;if(a!==zn||f!==Bs){const p=zn==="",m=p?Bs:bn(zn);if(m!==f){const A=s.classList,D=Nr.theme;let ae=f!==null?D[f]:void 0,fe=m!==null?D[m]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=D[f]=me}A.remove(...ae)}if(m===null||p&&m==="ltr")s.removeAttribute("dir");else{if(fe!==void 0){if(typeof fe=="string"){const me=fe.split(" ");fe=D[m]=me}fe!==void 0&&A.add(...fe)}s.dir=m}if(!ls){const me=u.getWritable();me.__dir=m}}Bs=m,s.__lexicalDirTextContent=zn,s.__lexicalDir=m}}function Hi(u,s,a){const f=zn;zn="",at(u,s,a),Al(s,a),zn=f}function Ni(u,s){const a=[];let f=u.__first;for(;f!==null;){const p=s.get(f);if(p===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");a.push(f),f=p.__next}return a}function at(u,s,a){const f=In,p=u.__size,m=s.__size;if(In="",p===1&&m===1){const A=u.__first,D=s.__first;if(A===D)us(A,a);else{const ae=xo(A),fe=fn(D,null,null);a.replaceChild(fe,ae),as(A,null)}}else{const A=Ni(u,Fi),D=Ni(s,hn);if(p===0)m!==0&&Ol(D,s,0,m-1,a,null);else if(m===0){if(p!==0){const fe=a.__lexicalLineBreak==null;Bi(A,0,p-1,fe?null:a),fe&&(a.textContent="")}}else Cn(s,A,D,p,m,a)}go(s)&&(In+=$t),a.__lexicalTextContent=In,In=f+In}function us(u,s){const a=Fi.get(u);let f=hn.get(u);if(a===void 0||f===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const p=Ma||wl.has(u)||Hs.has(u),m=ks(Fn,u);if(a===f&&!p){if(et(a)){const A=m.__lexicalTextContent;A!==void 0&&(In+=A,Vt+=A);const D=m.__lexicalDirTextContent;D!==void 0&&(zn+=D)}else{const A=a.getTextContent();mt(a)&&!a.isDirectionless()&&(zn+=A),Vt+=A,In+=A}return m}if(a!==f&&p&&is(Bn,os,Fs,f,"updated"),f.updateDOM(a,m,Nr)){const A=fn(u,null,null);if(s===null)throw Error("reconcileNode: parentDOM is null");return s.replaceChild(A,m),as(u,null),A}if(et(a)&&et(f)){const A=f.__indent;A!==a.__indent&&Vn(m,A);const D=f.__format;D!==a.__format&&Pr(m,D),p&&(Hi(a,f,m),!Wr(f)&&!f.isInline()&&Eo(a,f,m)),go(f)&&(In+=$t,Vt+=$t)}else{const A=f.getTextContent();if(An(f)){const D=f.decorate(Fn,Nr);D!==null&&Dl(u,D)}else mt(f)&&!f.isDirectionless()&&(zn+=A);In+=A,Vt+=A}if(!ls&&Wr(f)&&f.__cachedText!==Vt){const A=f.getWritable();A.__cachedText=Vt,f=A}return Object.freeze(f),m}function Dl(u,s){let a=Fn._pendingDecorators;const f=Fn._decorators;if(a===null){if(f[u]===s)return;a=ws(Fn)}a[u]=s}function Cr(u){return u.firstChild}function To(u){let s=u.nextSibling;return s!==null&&s===Fn._blockCursorElement&&(s=s.nextSibling),s}function Cn(u,s,a,f,p,m){const A=f-1,D=p-1;let ae,fe,me=Cr(m),Te=0,ve=0;for(;Te<=A&&ve<=D;){const Ue=s[Te],$e=a[ve];if(Ue===$e)me=To(us($e,m)),Te++,ve++;else{ae===void 0&&(ae=new Set(s)),fe===void 0&&(fe=new Set(a));const Rt=fe.has(Ue),Qe=ae.has($e);if(!Rt)me=To(xo(Ue)),as(Ue,m),Te++;else if(!Qe)fn($e,m,me),ve++;else{const ft=ks(Fn,$e);ft===me?me=To(us($e,m)):(me!=null?m.insertBefore(ft,me):m.appendChild(ft),us($e,m)),Te++,ve++}}}const Ce=Te>A,Ve=ve>D;if(Ce&&!Ve){const Ue=a[D+1],$e=Ue===void 0?null:Fn.getElementByKey(Ue);Ol(a,u,ve,D,m,$e)}else Ve&&!Ce&&Bi(s,Te,A,m)}function Wi(u,s,a,f,p,m){In="",Vt="",zn="",Ma=f===ct,Bs=null,Fn=a,Nr=a._config,os=a._nodes,Fs=Fn._listeners.mutation,Hs=p,wl=m,Fi=u._nodeMap,hn=s._nodeMap,ls=s._readOnly,wn=new Map(a._keyToDOMMap);const A=new Map;return Bn=A,us("root",null),Fn=void 0,os=void 0,Hs=void 0,wl=void 0,Fi=void 0,hn=void 0,Nr=void 0,wn=void 0,Bn=void 0,A}function Je(u,s,a){const f=a._keyToDOMMap;s["__lexicalKey_"+a._key]=u,f.set(u,s)}function xo(u){const s=wn.get(u);if(s===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return s}const lr=Object.freeze({}),er=30,Ml=[["keydown",he],["pointerdown",kl],["compositionstart",N],["compositionend",X],["input",_],["click",Ia],["cut",lr],["copy",lr],["dragstart",lr],["dragover",lr],["dragend",lr],["paste",lr],["focus",lr],["blur",lr],["drop",lr]];ee&&Ml.push(["beforeinput",(u,s)=>h(u,s)]);let Ki=0,Rl=0,Ws=0,$r=null,Ks=0,Fr=!1,So=!1,zs=!1,Us=!1,vo=[0,"",0,"root",0];function zi(u,s,a,f,p){const m=u.anchor,A=u.focus,D=m.getNode(),ae=Tn(),fe=or(ae._window),me=fe!==null?fe.anchorNode:null,Te=m.key,ve=ae.getElementByKey(Te),Ce=a.length;return Te!==A.key||!mt(D)||(!p&&(!ee||Ws<f+50)||D.isDirty()&&Ce<2||Os(a))&&m.offset!==A.offset&&!D.isComposing()||Wn(D)||D.isDirty()&&Ce>1||(p||!ee)&&ve!==null&&!D.isComposing()&&me!==Ir(ve)||fe!==null&&s!==null&&(!s.collapsed||s.startContainer!==fe.anchorNode||s.startOffset!==fe.anchorOffset)||D.getFormat()!==u.format||D.getStyle()!==u.style||Ds(u,D)}function bl(u,s){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&s!==0&&s!==u.nodeValue.length}function Il(u,s,a){const{anchorNode:f,anchorOffset:p,focusNode:m,focusOffset:A}=u;Fr&&(Fr=!1,bl(f,p)&&bl(m,A))||Hr(s,()=>{if(!a){yr(null);return}if(!ts(s,f,m))return;const D=mn();if(Tt(D)){const ae=D.anchor,fe=ae.getNode();if(D.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&(D.dirty=!0);const me=mo(s).event,Te=me?me.timeStamp:performance.now(),[ve,Ce,Ve,Ue,$e]=vo,Rt=Qn(),Qe=s.isComposing()===!1&&Rt.getTextContent()==="";if(Te<$e+200&&ae.offset===Ve&&ae.key===Ue)D.format=ve,D.style=Ce;else if(ae.type==="text"){if(!mt(fe))throw Error("Point.getNode() must return TextNode when type is text");D.format=fe.getFormat(),D.style=fe.getStyle()}else ae.type==="element"&&!Qe&&(D.format=0,D.style="")}else{let me=it,Te=!1;const ve=D.getNodes(),Ce=ve.length;for(let Ve=0;Ve<Ce;Ve++){const Ue=ve[Ve];if(mt(Ue)&&(Te=!0,me&=Ue.getFormat(),me===0))break}D.format=Te?me:0}}ut(s,t,void 0)})}function Ia(u,s){Hr(s,()=>{const a=mn(),f=or(s._window),p=ko();if(f){if(Tt(a)){const m=a.anchor,A=m.getNode();if(m.type==="element"&&m.offset===0&&a.isCollapsed()&&!Wr(A)&&Qn().getChildrenSize()===1&&A.getTopLevelElementOrThrow().isEmpty()&&p!==null&&a.is(p))f.removeAllRanges(),a.dirty=!0;else if(u.detail===3&&!a.isCollapsed()){const ae=a.focus.getNode();A!==ae&&(et(A)?A.select(0):A.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const m=f.anchorNode;if(m!==null){const A=m.nodeType;if(A===Le||A===Fe){const D=Bc(p,f,s,u);yr(D)}}}}ut(s,r,u)})}function kl(u,s){const a=u.target,f=u.pointerType;a instanceof Node&&f!=="touch"&&Hr(s,()=>{es(a)||(So=!0)})}function o(u){if(!u.getTargetRanges)return null;const s=u.getTargetRanges();return s.length===0?null:s[0]}function i(u,s){return u!==s||et(u)||et(s)||!u.isToken()||!s.isToken()}function l(u){return Rl===229&&u<Ki+er}function h(u,s){const a=u.inputType,f=o(u);a==="deleteCompositionText"||Ae&&Tl(s)||a!=="insertCompositionText"&&Hr(s,()=>{const p=mn();if(a==="deleteContentBackward"){if(p===null){const me=ko();if(!Tt(me))return;yr(me.clone())}if(Tt(p)){if(be&&xn(p.anchor.key),l(u.timeStamp)&&s.isComposing()&&p.anchor.key===p.focus.key){if(xn(null),Ki=0,setTimeout(()=>{Hr(s,()=>{xn(null)})},er),Tt(p)){const Te=p.anchor.getNode();if(Te.markDirty(),p.format=Te.getFormat(),!mt(Te))throw Error("Anchor node must be a TextNode");p.style=Te.getStyle()}p.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),ut(s,c,!0))}else xn(null),u.preventDefault(),ut(s,c,!0);return}}if(!Tt(p))return;const m=u.data;$r!==null&&As(!1,s,$r),(!p.dirty||$r!==null)&&p.isCollapsed()&&!Wr(p.anchor.getNode())&&f!==null&&p.applyDOMRange(f),$r=null;const A=p.anchor,D=p.focus,ae=A.getNode(),fe=D.getNode();if(a==="insertText"||a==="insertTranspose"){if(m===`
|
|
39
|
-
`)u.preventDefault(),ut(s,d,!1);else if(m===$t)u.preventDefault(),ut(s,g,void 0);else if(m==null&&u.dataTransfer){const me=u.dataTransfer.getData("text/plain");u.preventDefault(),p.insertRawText(me)}else m!=null&&zi(p,f,m,u.timeStamp,!0)?(u.preventDefault(),ut(s,y,m)):$r=m;Ws=u.timeStamp;return}switch(u.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{ut(s,y,u);break}case"insertFromComposition":{xn(null),ut(s,y,u);break}case"insertLineBreak":{xn(null),ut(s,d,!1);break}case"insertParagraph":{xn(null),zs&&!ce?(zs=!1,ut(s,d,!1)):ut(s,g,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{ut(s,E,u);break}case"deleteByComposition":{i(ae,fe)&&ut(s,T,u);break}case"deleteByDrag":case"deleteByCut":{ut(s,T,u);break}case"deleteContent":{ut(s,c,!1);break}case"deleteWordBackward":{ut(s,R,!0);break}case"deleteWordForward":{ut(s,R,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{ut(s,I,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{ut(s,I,!1);break}case"formatStrikeThrough":{ut(s,k,"strikethrough");break}case"formatBold":{ut(s,k,"bold");break}case"formatItalic":{ut(s,k,"italic");break}case"formatUnderline":{ut(s,k,"underline");break}case"historyUndo":{ut(s,U,void 0);break}case"historyRedo":{ut(s,C,void 0);break}}})}function _(u,s){u.stopPropagation(),Hr(s,()=>{const a=mn(),f=u.data,p=o(u);if(f!=null&&Tt(a)&&zi(a,p,f,u.timeStamp,!1)){Us&&(S(s,f),Us=!1);const m=a.anchor,A=m.getNode(),D=or(s._window);if(D===null)return;const ae=m.offset;(!ee||a.isCollapsed()||!mt(A)||D.anchorNode===null||A.getTextContent().slice(0,ae)+f+A.getTextContent().slice(ae+a.focus.offset)!==fo(D.anchorNode))&&ut(s,y,f);const fe=f.length;Ae&&fe>1&&u.inputType==="insertCompositionText"&&!s.isComposing()&&(a.anchor.offset-=fe),!te&&!ce&&!Re&&s.isComposing()&&(Ki=0,xn(null))}else As(!1,s,f!==null?f:void 0),Us&&(S(s,f||void 0),Us=!1);fl()}),$r=null}function N(u,s){Hr(s,()=>{const a=mn();if(Tt(a)&&!s.isComposing()){const f=a.anchor,p=a.anchor.getNode();xn(f.key),(u.timeStamp<Ki+er||f.type==="element"||!a.isCollapsed()||p.getFormat()!==a.format||mt(p)&&p.getStyle()!==a.style)&&ut(s,y,Kt)}})}function S(u,s){const a=u._compositionKey;if(xn(null),a!==null&&s!=null){if(s===""){const f=Nn(a),p=Ir(u.getElementByKey(a));p!==null&&p.nodeValue!==null&&mt(f)&&kr(f,p.nodeValue,null,null,!0);return}if(s[s.length-1]===`
|
|
40
|
-
`){const f=mn();if(Tt(f)){const p=f.focus;f.anchor.set(p.key,p.offset,p.type),ut(u,le,null);return}}}As(!0,u,s)}function X(u,s){Ae?Us=!0:Hr(s,()=>{S(s,u.data)})}function he(u,s){if(Ki=u.timeStamp,Rl=u.keyCode,s.isComposing())return;const{keyCode:a,shiftKey:f,ctrlKey:p,metaKey:m,altKey:A}=u;if(!ut(s,w,u)){if(rs(a,p,A,m))ut(s,z,u);else if(xa(a,p,f,A,m))ut(s,Q,u);else if(kc(a,p,A,m))ut(s,F,u);else if(Ta(a,p,f,A,m))ut(s,W,u);else if(Lc(a,p,m))ut(s,G,u);else if(Nl(a,p,m))ut(s,q,u);else if(_l(a,f))zs=!0,ut(s,le,u);else if(Pc(a))ut(s,se,u);else if(Rs(a,p))u.preventDefault(),zs=!0,ut(s,d,!0);else if(ml(a,f))zs=!1,ut(s,le,u);else if(ya(a,A,m,p))jr(a)?ut(s,ge,u):(u.preventDefault(),ut(s,c,!0));else if(bi(a))ut(s,j,u);else if(Dc(a,p,f,A,m))Ii(a)?ut(s,B,u):(u.preventDefault(),ut(s,c,!1));else if(bs(a,A,p))u.preventDefault(),ut(s,R,!0);else if(pa(a,A,p))u.preventDefault(),ut(s,R,!1);else if(ma(a,m))u.preventDefault(),ut(s,I,!0);else if(_a(a,m))u.preventDefault(),ut(s,I,!1);else if(ga(a,A,m,p))u.preventDefault(),ut(s,k,"bold");else if(Ms(a,A,m,p))u.preventDefault(),ut(s,k,"underline");else if(ns(a,A,m,p))u.preventDefault(),ut(s,k,"italic");else if(ha(a,A,p,m))ut(s,V,u);else if(Mc(a,f,m,p))u.preventDefault(),ut(s,U,void 0);else if(Na(a,f,m,p))u.preventDefault(),ut(s,C,void 0);else{const D=s._editorState._selection;Br(D)?Rc(a,f,m,p)?(u.preventDefault(),ut(s,K,u)):bc(a,f,m,p)?(u.preventDefault(),ut(s,P,u)):ho(a,m,p)&&(u.preventDefault(),ut(s,Z,u)):!Ae&&ho(a,m,p)&&(u.preventDefault(),ut(s,Z,u))}Is(p,f,A,m)&&ut(s,v,u)}}function De(u){let s=u.__lexicalEventHandles;return s===void 0&&(s=[],u.__lexicalEventHandles=s),s}const Ye=new Map;function Xe(u){const s=u.target,a=s==null?null:s.nodeType===9?s.defaultView:s.ownerDocument.defaultView,f=or(a);if(f===null)return;const p=ll(f.anchorNode);if(p===null)return;So&&(So=!1,Hr(p,()=>{const me=ko(),Te=f.anchorNode;if(Te===null)return;const ve=Te.nodeType;if(ve!==Le&&ve!==Fe)return;const Ce=Bc(me,f,p,u);yr(Ce)}));const m=Ri(p),A=m[m.length-1],D=A._key,ae=Ye.get(D),fe=ae||A;fe!==p&&Il(f,fe,!1),Il(f,p,!0),p!==A?Ye.set(D,p):ae&&Ye.delete(D)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function gt(u,s){Ks===0&&u.ownerDocument.addEventListener("selectionchange",Xe),Ks++,u.__lexicalEditor=s;const a=De(u);for(let f=0;f<Ml.length;f++){const[p,m]=Ml[f],A=typeof m=="function"?D=>{Pe(D)||(Ke(D),s.isEditable()&&m(D,s))}:D=>{if(!Pe(D)&&(Ke(D),s.isEditable()))switch(p){case"cut":return ut(s,P,D);case"copy":return ut(s,K,D);case"paste":return ut(s,E,D);case"dragstart":return ut(s,x,D);case"dragover":return ut(s,Y,D);case"dragend":return ut(s,ie,D);case"focus":return ut(s,_e,D);case"blur":return ut(s,b,D);case"drop":return ut(s,ue,D)}};u.addEventListener(p,A),a.push(()=>{u.removeEventListener(p,A)})}}function Ot(u){Ks!==0&&(Ks--,Ks===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const s=u.__lexicalEditor;s!=null&&(Ft(s),u.__lexicalEditor=null);const a=De(u);for(let f=0;f<a.length;f++)a[f]();u.__lexicalEventHandles=[]}function Ft(u){if(u._parentEditor!==null){const s=Ri(u),f=s[s.length-1]._key;Ye.get(f)===u&&Ye.delete(f)}else Ye.delete(u._key)}function zt(){Fr=!0}function Un(u,s,a,f,p){vo=[u,s,a,f,p]}function wr(u,s,a){ur();const f=u.__key,p=u.getParent();if(p===null)return;const m=ss(u);let A=!1;if(Tt(m)&&s){const D=m.anchor,ae=m.focus;D.key===f&&(Wa(D,u,p,u.getPreviousSibling(),u.getNextSibling()),A=!0),ae.key===f&&(Wa(ae,u,p,u.getPreviousSibling(),u.getNextSibling()),A=!0)}else Br(m)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(m)&&s&&!A){const D=u.getIndexWithinParent();Gr(u),Ha(m,p,D,-1)}else Gr(u);!a&&!ri(p)&&!p.canBeEmpty()&&p.isEmpty()&&wr(p,s),s&&Wr(p)&&p.isEmpty()&&p.selectEnd()}class ii{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(s){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(s){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,al(this,s),this.__type!=="root"&&(ur(),si(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let s=this.__key;for(;s!==null;){if(s==="root")return!0;const a=Nn(s);if(a===null)break;s=a.__parent}return!1}isSelected(s){const a=s||mn();if(a==null)return!1;const f=a.getNodes().some(p=>p.__key===this.__key);return mt(this)?f:Tt(a)&&a.anchor.type==="element"&&a.focus.type==="element"&&a.anchor.key===a.focus.key&&a.anchor.offset===a.focus.offset?!1:f}getKey(){return this.__key}getIndexWithinParent(){const s=this.getParent();if(s===null)return-1;let a=s.getFirstChild(),f=0;for(;a!==null;){if(this.is(a))return f;f++,a=a.getNextSibling()}return-1}getParent(){const s=this.getLatest().__parent;return s===null?null:Nn(s)}getParentOrThrow(){const s=this.getParent();if(s===null)throw Error(`Expected node ${this.__key} to have a parent.`);return s}getTopLevelElement(){let s=this;for(;s!==null;){const a=s.getParent();if(ri(a)){if(!et(s))throw Error("Children of root nodes must be elements");return s}s=a}return null}getTopLevelElementOrThrow(){const s=this.getTopLevelElement();if(s===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return s}getParents(){const s=[];let a=this.getParent();for(;a!==null;)s.push(a),a=a.getParent();return s}getParentKeys(){const s=[];let a=this.getParent();for(;a!==null;)s.push(a.__key),a=a.getParent();return s}getPreviousSibling(){const a=this.getLatest().__prev;return a===null?null:Nn(a)}getPreviousSiblings(){const s=[],a=this.getParent();if(a===null)return s;let f=a.getFirstChild();for(;f!==null&&!f.is(this);)s.push(f),f=f.getNextSibling();return s}getNextSibling(){const a=this.getLatest().__next;return a===null?null:Nn(a)}getNextSiblings(){const s=[];let a=this.getNextSibling();for(;a!==null;)s.push(a),a=a.getNextSibling();return s}getCommonAncestor(s){const a=this.getParents(),f=s.getParents();et(this)&&a.unshift(this),et(s)&&f.unshift(s);const p=a.length,m=f.length;if(p===0||m===0||a[p-1]!==f[m-1])return null;const A=new Set(f);for(let D=0;D<p;D++){const ae=a[D];if(A.has(ae))return ae}return null}is(s){return s==null?!1:this.__key===s.__key}isBefore(s){if(this===s)return!1;if(s.isParentOf(this))return!0;if(this.isParentOf(s))return!1;const a=this.getCommonAncestor(s);let f=0,p=0,m=this;for(;;){const A=m.getParentOrThrow();if(A===a){f=m.getIndexWithinParent();break}m=A}for(m=s;;){const A=m.getParentOrThrow();if(A===a){p=m.getIndexWithinParent();break}m=A}return f<p}isParentOf(s){const a=this.__key;if(a===s.__key)return!1;let f=s;for(;f!==null;){if(f.__key===a)return!0;f=f.getParent()}return!1}getNodesBetween(s){const a=this.isBefore(s),f=[],p=new Set;let m=this;for(;;){const A=m.__key;if(p.has(A)||(p.add(A),f.push(m)),m===s)break;const D=et(m)?a?m.getFirstChild():m.getLastChild():null;if(D!==null){m=D;continue}const ae=a?m.getNextSibling():m.getPreviousSibling();if(ae!==null){m=ae;continue}const fe=m.getParentOrThrow();if(p.has(fe.__key)||f.push(fe),fe===s)break;let me=null,Te=fe;do{if(Te===null)throw Error("getNodesBetween: ancestor is null");me=a?Te.getNextSibling():Te.getPreviousSibling(),Te=Te.getParent(),Te!==null&&me===null&&!p.has(Te.__key)&&f.push(Te)}while(me===null);m=me}return a||f.reverse(),f}isDirty(){const a=Tn()._dirtyLeaves;return a!==null&&a.has(this.__key)}getLatest(){const s=Nn(this.__key);if(s===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 s}getWritable(){ur();const s=Ei(),a=Tn(),f=s._nodeMap,p=this.__key,m=this.getLatest(),A=m.__parent,D=a._cloneNotNeeded,ae=mn();if(ar(ae)&&ae.setCachedNodes(null),D.has(p))return Ai(m),m;const me=m.constructor.clone(m);return me.__parent=A,me.__next=m.__next,me.__prev=m.__prev,et(m)&&et(me)?(me.__first=m.__first,me.__last=m.__last,me.__size=m.__size,me.__indent=m.__indent,me.__format=m.__format,me.__dir=m.__dir):mt(m)&&mt(me)&&(me.__format=m.__format,me.__style=m.__style,me.__mode=m.__mode,me.__detail=m.__detail),D.add(p),me.__key=p,Ai(me),f.set(p,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(s,a){throw Error("createDOM: base method not extended")}updateDOM(s,a,f){throw Error("updateDOM: base method not extended")}exportDOM(s){return{element:this.createDOM(s._config,s)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(s){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(s){wr(this,!0,s)}replace(s,a){ur();let f=mn();f!==null&&(f=f.clone()),Ls(this,s);const p=this.getLatest(),m=this.__key,A=s.__key,D=s.getWritable(),ae=this.getParentOrThrow().getWritable(),fe=ae.__size;Gr(D);const me=p.getPreviousSibling(),Te=p.getNextSibling(),ve=p.__prev,Ce=p.__next,Ve=p.__parent;if(wr(p,!1,!0),me===null)ae.__first=A;else{const Ue=me.getWritable();Ue.__next=A}if(D.__prev=ve,Te===null)ae.__last=A;else{const Ue=Te.getWritable();Ue.__prev=A}if(D.__next=Ce,D.__parent=Ve,ae.__size=fe,a){if(!(et(this)&&et(D)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Ue=>{D.append(Ue)})}if(Tt(f)){yr(f);const Ue=f.anchor,$e=f.focus;Ue.key===m&&pn(Ue,D),$e.key===m&&pn($e,D)}return sr()===m&&xn(A),D}insertAfter(s,a=!0){ur(),Ls(this,s);const f=this.getWritable(),p=s.getWritable(),m=p.getParent(),A=mn();let D=!1,ae=!1;if(m!==null){const Ce=s.getIndexWithinParent();if(Gr(p),Tt(A)){const Ve=m.__key,Ue=A.anchor,$e=A.focus;D=Ue.type==="element"&&Ue.key===Ve&&Ue.offset===Ce+1,ae=$e.type==="element"&&$e.key===Ve&&$e.offset===Ce+1}}const fe=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),Te=p.__key,ve=f.__next;if(fe===null)me.__last=Te;else{const Ce=fe.getWritable();Ce.__prev=Te}if(me.__size++,f.__next=Te,p.__next=ve,p.__prev=f.__key,p.__parent=f.__parent,a&&Tt(A)){const Ce=this.getIndexWithinParent();Ha(A,me,Ce+1);const Ve=me.__key;D&&A.anchor.set(Ve,Ce+2,"element"),ae&&A.focus.set(Ve,Ce+2,"element")}return s}insertBefore(s,a=!0){ur(),Ls(this,s);const f=this.getWritable(),p=s.getWritable(),m=p.__key;Gr(p);const A=this.getPreviousSibling(),D=this.getParentOrThrow().getWritable(),ae=f.__prev,fe=this.getIndexWithinParent();if(A===null)D.__first=m;else{const Te=A.getWritable();Te.__next=m}D.__size++,f.__prev=m,p.__prev=ae,p.__next=f.__key,p.__parent=f.__parent;const me=mn();if(a&&Tt(me)){const Te=this.getParentOrThrow();Ha(me,Te,fe)}return s}isParentRequired(){return!1}createParentElementNode(){return Yi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(s,a){ur();const f=this.getPreviousSibling(),p=this.getParentOrThrow();if(f===null)return p.select(0,0);if(et(f))return f.select();if(!mt(f)){const m=f.getIndexWithinParent()+1;return p.select(m,m)}return f.select(s,a)}selectNext(s,a){ur();const f=this.getNextSibling(),p=this.getParentOrThrow();if(f===null)return p.select();if(et(f))return f.select(0,0);if(!mt(f)){const m=f.getIndexWithinParent();return p.select(m,m)}return f.select(s,a)}markDirty(){this.getWritable()}}function si(u,s){const a=Tn()._nodes.get(u);if(a===void 0)throw Error(`Create node: Attempted to create node ${s.name} that was not configured to be used on the editor.`);const f=a.klass;if(f!==s)throw Error(`Create node: Type ${u} in node ${s.name} does not match registered node ${f.name} with the same type`)}function Ll(u,s,a){const f=s.getParentOrThrow().getLastChild();let p=s;const m=[s];for(;p!==f;){if(!p.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");p=p.getNextSibling(),m.push(p)}let A=u;for(const D of m)A=A.insertAfter(D)}class Ui extends ii{static getType(){return"linebreak"}static clone(s){return new Ui(s.__key)}constructor(s){super(s)}getTextContent(){return`
|
|
41
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:s=>{const a=s.parentElement;let f,p;return a!==null&&((f=a.firstChild)===s||f.nextSibling===s&&f.nodeType===Fe&&(f.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((p=a.lastChild)===s||p.previousSibling===s&&p.nodeType===Fe&&(p.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:wo,priority:0}}}}static importJSON(s){return ds()}exportJSON(){return{type:"linebreak",version:1}}}function wo(u){return{node:ds()}}function ds(){return vr(new Ui)}function oi(u){return u instanceof Ui}function Or(u,s){return s&ke?"code":s&rt?"mark":s&Me?"sub":s&je?"sup":null}function Gi(u,s){return s&Oe?"strong":s&ne?"em":"span"}function Oo(u,s,a,f,p){const m=f.classList;let A=ki(p,"base");A!==void 0&&m.add(...A),A=ki(p,"underlineStrikethrough");let D=!1;const ae=s&Se&&s&oe,fe=a&Se&&a&oe;A!==void 0&&(fe?(D=!0,ae||m.add(...A)):ae&&m.remove(...A));for(const me in nn){const ve=nn[me];if(A=ki(p,me),A!==void 0)if(a&ve){if(D&&(me==="underline"||me==="strikethrough")){s&ve&&m.remove(...A);continue}(!(s&ve)||ae&&me==="underline"||me==="strikethrough")&&m.add(...A)}else s&ve&&m.remove(...A)}}function ka(u,s){const a=u.length,f=s.length;let p=0,m=0;for(;p<a&&p<f&&u[p]===s[p];)p++;for(;m+p<a&&m+p<f&&u[a-m-1]===s[f-m-1];)m++;return[p,a-p-m,s.slice(p,f-m)]}function La(u,s,a){const f=s.firstChild,p=a.isComposing(),A=u+(p?pt:"");if(f==null)s.textContent=A;else{const D=f.nodeValue;if(D!==A)if(p||Ae){const[ae,fe,me]=ka(D,A);fe!==0&&f.deleteData(ae,fe),f.insertData(ae,me)}else f.nodeValue=A}}function Pl(u,s,a,f,p,m){La(p,u,s);const D=m.theme.text;D!==void 0&&Oo(a,0,f,u,D)}function Gs(u,s){const a=document.createElement(s);return a.appendChild(u),a}class Vr extends ii{static getType(){return"text"}static clone(s){return new Vr(s.__text,s.__key)}constructor(s,a){super(a),this.__text=s,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const s=this.getLatest();return ot[s.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===Ut}isComposing(){return this.__key===sr()}isSegmented(){return this.getLatest().__mode===en}isDirectionless(){return(this.getLatest().__detail&st)!==0}isUnmergeable(){return(this.getLatest().__detail&vt)!==0}hasFormat(s){const a=nn[s];return(this.getFormat()&a)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(s,a){const p=this.getLatest().__format;return $n(p,s,a)}createDOM(s,a){const f=this.__format,p=Or(this,f),m=Gi(this,f),A=p===null?m:p,D=document.createElement(A);let ae=D;this.hasFormat("code")&&D.setAttribute("spellcheck","false"),p!==null&&(ae=document.createElement(m),D.appendChild(ae));const fe=this.__text;Pl(ae,this,m,f,fe,s);const me=this.__style;return me!==""&&(D.style.cssText=me),D}updateDOM(s,a,f){const p=this.__text,m=s.__format,A=this.__format,D=Or(this,m),ae=Or(this,A),fe=Gi(this,m),me=Gi(this,A);if((D===null?fe:D)!==(ae===null?me:ae))return!0;if(D===ae&&fe!==me){const Qe=a.firstChild;if(Qe==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const ft=document.createElement(me);return Pl(ft,this,me,A,p,f),a.replaceChild(ft,Qe),!1}let Ce=a;if(ae!==null&&D!==null&&(Ce=a.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");La(p,Ce,this);const Ue=f.theme.text;Ue!==void 0&&m!==A&&Oo(me,m,A,Ce,Ue);const $e=s.__style,Rt=this.__style;return $e!==Rt&&(a.style.cssText=Rt),!1}static importDOM(){return{"#text":()=>({conversion:Do,priority:0}),b:()=>({conversion:$l,priority:0}),code:()=>({conversion:qr,priority:0}),em:()=>({conversion:qr,priority:0}),i:()=>({conversion:qr,priority:0}),s:()=>({conversion:qr,priority:0}),span:()=>({conversion:Pa,priority:0}),strong:()=>({conversion:qr,priority:0}),sub:()=>({conversion:qr,priority:0}),sup:()=>({conversion:qr,priority:0}),u:()=>({conversion:qr,priority:0})}}static importJSON(s){const a=On(s.text);return a.setFormat(s.format),a.setDetail(s.detail),a.setMode(s.mode),a.setStyle(s.style),a}exportDOM(s){let{element:a}=super.exportDOM(s);if(!(a!==null&&$s(a)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return a.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(a=Gs(a,"b")),this.hasFormat("italic")&&(a=Gs(a,"i")),this.hasFormat("strikethrough")&&(a=Gs(a,"s")),this.hasFormat("underline")&&(a=Gs(a,"u")),{element:a}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(s,a){}setFormat(s){const a=this.getWritable();return a.__format=typeof s=="string"?nn[s]:s,a}setDetail(s){const a=this.getWritable();return a.__detail=typeof s=="string"?Sr[s]:s,a}setStyle(s){const a=this.getWritable();return a.__style=s,a}toggleFormat(s){const a=this.getFormat(),f=$n(a,s,null);return this.setFormat(f)}toggleDirectionless(){const s=this.getWritable();return s.__detail^=st,s}toggleUnmergeable(){const s=this.getWritable();return s.__detail^=vt,s}setMode(s){const a=Ze[s];if(this.__mode===a)return this;const f=this.getWritable();return f.__mode=a,f}setTextContent(s){if(this.__text===s)return this;const a=this.getWritable();return a.__text=s,a}select(s,a){ur();let f=s,p=a;const m=mn(),A=this.getTextContent(),D=this.__key;if(typeof A=="string"){const ae=A.length;f===void 0&&(f=ae),p===void 0&&(p=ae)}else f=0,p=0;if(Tt(m)){const ae=sr();(ae===m.anchor.key||ae===m.focus.key)&&xn(D),m.setTextNodeRange(this,f,this,p)}else return _d(D,f,D,p,"text","text");return m}selectStart(){return this.select(0,0)}selectEnd(){const s=this.getTextContentSize();return this.select(s,s)}spliceText(s,a,f,p){const m=this.getWritable(),A=m.__text,D=f.length;let ae=s;ae<0&&(ae=D+ae,ae<0&&(ae=0));const fe=mn();if(p&&Tt(fe)){const Te=s+D;fe.setTextNodeRange(m,Te,m,Te)}const me=A.slice(0,ae)+f+A.slice(ae+a);return m.__text=me,m}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...s){ur();const a=this.getLatest(),f=a.getTextContent(),p=a.__key,m=sr(),A=new Set(s),D=[],ae=f.length;let fe="";for(let an=0;an<ae;an++)fe!==""&&A.has(an)&&(D.push(fe),fe=""),fe+=f[an];fe!==""&&D.push(fe);const me=D.length;if(me===0)return[];if(D[0]===f)return[a];const Te=D[0],ve=a.getParentOrThrow();let Ce;const Ve=a.getFormat(),Ue=a.getStyle(),$e=a.__detail;let Rt=!1;a.isSegmented()?(Ce=On(Te),Ce.__format=Ve,Ce.__style=Ue,Ce.__detail=$e,Rt=!0):(Ce=a.getWritable(),Ce.__text=Te);const Qe=mn(),ft=[Ce];let qt=Te.length;for(let an=1;an<me;an++){const nr=D[an],fs=nr.length,dr=On(nr).getWritable();dr.__format=Ve,dr.__style=Ue,dr.__detail=$e;const rn=dr.__key,kn=qt+fs;if(Tt(Qe)){const ai=Qe.anchor,ji=Qe.focus;ai.key===p&&ai.type==="text"&&ai.offset>qt&&ai.offset<=kn&&(ai.key=rn,ai.offset-=qt,Qe.dirty=!0),ji.key===p&&ji.type==="text"&&ji.offset>qt&&ji.offset<=kn&&(ji.key=rn,ji.offset-=qt,Qe.dirty=!0)}m===p&&xn(rn),qt=kn,ft.push(dr)}ul(this);const Wt=ve.getWritable(),At=this.getIndexWithinParent();return Rt?(Wt.splice(At,0,ft),this.remove()):Wt.splice(At,1,ft),Tt(Qe)&&Ha(Qe,ve,At,me-1),ft}mergeWithSibling(s){const a=s===this.getPreviousSibling();if(!a&&s!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const f=this.__key,p=s.__key,m=this.__text,A=m.length;sr()===p&&xn(f);const ae=mn();if(Tt(ae)){const ve=ae.anchor,Ce=ae.focus;ve!==null&&ve.key===p&&(Nd(ve,a,f,s,A),ae.dirty=!0),Ce!==null&&Ce.key===p&&(Nd(Ce,a,f,s,A),ae.dirty=!0)}const fe=s.__text,me=a?fe+m:m+fe;this.setTextContent(me);const Te=this.getWritable();return s.remove(),Te}isTextEntity(){return!1}}function Pa(u){const s=u,a=s.style.fontWeight==="700",f=s.style.textDecoration==="line-through",p=s.style.fontStyle==="italic",m=s.style.textDecoration==="underline",A=s.style.verticalAlign;return{forChild:D=>(mt(D)&&(a&&D.toggleFormat("bold"),f&&D.toggleFormat("strikethrough"),p&&D.toggleFormat("italic"),m&&D.toggleFormat("underline"),A==="sub"&&D.toggleFormat("subscript"),A==="super"&&D.toggleFormat("superscript")),D),node:null}}function $l(u){const a=u.style.fontWeight==="normal";return{forChild:f=>(mt(f)&&!a&&f.toggleFormat("bold"),f),node:null}}const Ao=new WeakMap;function $a(u){return u.nodeName==="PRE"||u.nodeType===Le&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function Ys(u){let s,a=u.parentNode;const f=[u];for(;a!==null&&(s=Ao.get(a))===void 0&&!$a(a);)f.push(a),a=a.parentNode;const p=s===void 0?a:s;for(let m=0;m<f.length;m++)Ao.set(f[m],p);return p}function Do(u){const s=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let f=s.textContent||"";if(Ys(s)!==null){const p=f.split(/(\r?\n|\t)/),m=[],A=p.length;for(let D=0;D<A;D++){const ae=p[D];ae===`
|
|
42
|
-
`||ae===`\r
|
|
43
|
-
`?m.push(ds()):ae===" "?m.push(Mo()):ae!==""&&m.push(On(ae))}return{node:m}}if(f=f.replace(/\r/g,"").replace(/[ \t\n]+/g," "),f==="")return{node:null};if(f[0]===" "){let p=s,m=!0;for(;p!==null&&(p=Fa(p,!1))!==null;){const A=p.textContent||"";if(A.length>0){/[ \t\n]$/.test(A)&&(f=f.slice(1)),m=!1;break}}m&&(f=f.slice(1))}if(f[f.length-1]===" "){let p=s,m=!0;for(;p!==null&&(p=Fa(p,!0))!==null;)if((p.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){m=!1;break}m&&(f=f.slice(0,f.length-1))}return f===""?{node:null}:{node:On(f)}}const Fl=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 Fa(u,s){let a=u;for(;;){let f;for(;(f=s?a.nextSibling:a.previousSibling)===null;){const m=a.parentElement;if(m===null)return null;a=m}if(a=f,a.nodeType===Le){const m=a.style.display;if(m===""&&a.nodeName.match(Fl)===null||m!==""&&!m.startsWith("inline"))return null}let p=a;for(;(p=s?a.firstChild:a.lastChild)!==null;)a=p;if(a.nodeType===Fe)return a;if(a.nodeName==="BR")return null}}const Bl={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function qr(u){const s=Bl[u.nodeName.toLowerCase()];return s===void 0?{node:null}:{forChild:a=>(mt(a)&&!a.hasFormat(s)&&a.toggleFormat(s),a),node:null}}function On(u=""){return vr(new Vr(u))}function mt(u){return u instanceof Vr}class Er extends Vr{static getType(){return"tab"}static clone(s){const a=new Er(s.__key);return a.__text=s.__text,a.__format=s.__format,a.__style=s.__style,a}constructor(s){super(" ",s),this.__detail=vt}static importDOM(){return null}static importJSON(s){const a=Mo();return a.setFormat(s.format),a.setStyle(s.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(s){throw Error("TabNode does not support setTextContent")}setDetail(s){throw Error("TabNode does not support setDetail")}setMode(s){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Mo(){return vr(new Er)}function Ro(u){return u instanceof Er}class $c{constructor(s,a,f){this._selection=null,this.key=s,this.offset=a,this.type=f}is(s){return this.key===s.key&&this.offset===s.offset&&this.type===s.type}isBefore(s){let a=this.getNode(),f=s.getNode();const p=this.offset,m=s.offset;if(et(a)){const A=a.getDescendantByIndex(p);a=A??a}if(et(f)){const A=f.getDescendantByIndex(m);f=A??f}return a===f?p<m:a.isBefore(f)}getNode(){const s=this.key,a=Nn(s);if(a===null)throw Error("Point.getNode: node not found");return a}set(s,a,f){const p=this._selection,m=this.key;this.key=s,this.offset=a,this.type=f,Lo()||(sr()===m&&xn(s),p!==null&&(p.setCachedNodes(null),p.dirty=!0))}}function Ar(u,s,a){return new $c(u,s,a)}function bo(u,s){let a=s.__key,f=u.offset,p="element";if(mt(s)){p="text";const m=s.getTextContentSize();f>m&&(f=m)}else if(!et(s)){const m=s.getNextSibling();if(mt(m))a=m.__key,f=0,p="text";else{const A=s.getParent();A&&(a=A.__key,f=s.getIndexWithinParent()+1)}}u.set(a,f,p)}function pn(u,s){if(et(s)){const a=s.getLastDescendant();et(a)||mt(a)?bo(u,a):bo(u,s)}else bo(u,s)}function qn(u,s,a,f){const p=u.getNode(),m=p.getChildAtIndex(u.offset),A=On(),D=Wr(p)?Yi().append(A):A;A.setFormat(a),A.setStyle(f),m===null?p.append(D):m.insertBefore(D),u.is(s)&&s.set(A.__key,0,"text"),u.set(A.__key,0,"text")}function En(u,s,a,f){u.key=s,u.offset=a,u.type=f}class Dr{constructor(s,a){this.anchor=s,this.focus=a,s._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){return ar(s)?this.anchor.is(s.anchor)&&this.focus.is(s.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return li(this)}}class Ci{constructor(s){this.dirty=!1,this._nodes=s,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){if(!Br(s))return!1;const a=this._nodes,f=s._nodes;return a.size===f.size&&Array.from(a).every(p=>f.has(p))}add(s){this.dirty=!0,this._nodes.add(s),this._cachedNodes=null}delete(s){this.dirty=!0,this._nodes.delete(s),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(s){return this._nodes.has(s)}clone(){return new Ci(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(s){}insertText(){}insertNodes(s){const a=this.getNodes(),f=a.length,p=a[f-1];let m;if(mt(p))m=p.select();else{const A=p.getIndexWithinParent()+1;m=p.getParentOrThrow().select(A,A)}m.insertNodes(s);for(let A=0;A<f;A++)a[A].remove()}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const a=this._nodes,f=[];for(const p of a){const m=Nn(p);m!==null&&f.push(m)}return Lo()||(this._cachedNodes=f),f}getTextContent(){const s=this.getNodes();let a="";for(let f=0;f<s.length;f++)a+=s[f].getTextContent();return a}}function Tt(u){return u instanceof tr}function ar(u){return u instanceof Dr}function Mr(u){const[s,,a]=Cd(u),f=a.getChildren(),p=f.length,m=f[0].getChildren().length,A=new Array(p);for(let D=0;D<p;D++)A[D]=new Array(m);for(let D=0;D<p;D++){const fe=f[D].getChildren();let me=0;for(let Te=0;Te<fe.length;Te++){for(;A[D][me];)me++;const ve=fe[Te],Ce=ve.__rowSpan||1,Ve=ve.__colSpan||1;for(let Ue=0;Ue<Ce;Ue++)for(let $e=0;$e<Ve;$e++)A[D+Ue][me+$e]=ve;if(s===ve)return{colSpan:Ve,columnIndex:me,rowIndex:D,rowSpan:Ce};me+=Ve}}return null}class tr extends Dr{constructor(s,a,f,p){super(s,a),this.format=f,this.style=p}is(s){return Tt(s)?this.anchor.is(s.anchor)&&this.focus.is(s.focus)&&this.format===s.format&&this.style===s.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const a=this.anchor,f=this.focus,p=a.isBefore(f),m=p?a:f,A=p?f:a;let D=m.getNode(),ae=A.getNode();const fe=m.offset,me=A.offset;if(et(D)){const ve=D.getDescendantByIndex(fe);D=ve??D}if(et(ae)){let ve=ae.getDescendantByIndex(me);ve!==null&&ve!==D&&ae.getChildAtIndex(me)===ve&&(ve=ve.getPreviousSibling()),ae=ve??ae}let Te;return D.is(ae)?et(D)&&D.getChildrenSize()>0?Te=[]:Te=[D]:Te=D.getNodesBetween(ae),Lo()||(this._cachedNodes=Te),Te}setTextNodeRange(s,a,f,p){En(this.anchor,s.__key,a,"text"),En(this.focus,f.__key,p,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const s=this.getNodes();if(s.length===0)return"";const a=s[0],f=s[s.length-1],p=this.anchor,m=this.focus,A=p.isBefore(m),[D,ae]=li(this);let fe="",me=!0;for(let Te=0;Te<s.length;Te++){const ve=s[Te];if(et(ve)&&!ve.isInline())me||(fe+=`
|
|
44
|
-
`),ve.isEmpty()?me=!1:me=!0;else if(me=!1,mt(ve)){let Ce=ve.getTextContent();ve===a?ve===f?(p.type!=="element"||m.type!=="element"||m.offset===p.offset)&&(Ce=D<ae?Ce.slice(D,ae):Ce.slice(ae,D)):Ce=A?Ce.slice(D):Ce.slice(ae):ve===f&&(Ce=A?Ce.slice(0,ae):Ce.slice(0,D)),fe+=Ce}else(An(ve)||oi(ve))&&(ve!==f||!this.isCollapsed())&&(fe+=ve.getTextContent())}return fe}applyDOMRange(s){const a=Tn(),p=a.getEditorState()._selection,m=md(s.startContainer,s.startOffset,s.endContainer,s.endOffset,a,p);if(m===null)return;const[A,D]=m;En(this.anchor,A.key,A.offset,A.type),En(this.focus,D.key,D.offset,D.type),this._cachedNodes=null}clone(){const s=this.anchor,a=this.focus;return new tr(Ar(s.key,s.offset,s.type),Ar(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(s){this.format=$n(this.format,s,null),this.dirty=!0}setStyle(s){this.style=s,this.dirty=!0}hasFormat(s){const a=nn[s];return(this.format&a)!==0}insertRawText(s){const a=s.split(/(\r?\n|\t)/),f=[],p=a.length;for(let m=0;m<p;m++){const A=a[m];A===`
|
|
45
|
-
`||A===`\r
|
|
46
|
-
`?f.push(ds()):A===" "?f.push(Mo()):f.push(On(A))}this.insertNodes(f)}insertText(s){const a=this.anchor,f=this.focus,p=this.isCollapsed()||a.isBefore(f),m=this.format,A=this.style;p&&a.type==="element"?qn(a,f,m,A):!p&&f.type==="element"&&qn(f,a,m,A);const D=this.getNodes(),ae=D.length,fe=p?a:f,me=p?f:a,Te=fe.offset,ve=me.offset;let Ce=D[0];if(!mt(Ce))throw Error("insertText: first node is not a text node");const Ue=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Rt=ae-1;let Qe=D[Rt];if(this.isCollapsed()&&Te===Ue&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ft=Ce.getNextSibling();if((!mt(ft)||!ft.canInsertTextBefore()||Wn(ft))&&(ft=On(),ft.setFormat(m),$e.canInsertTextAfter()?Ce.insertAfter(ft):$e.insertAfter(ft)),ft.select(0,0),Ce=ft,s!==""){this.insertText(s);return}}else if(this.isCollapsed()&&Te===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ft=Ce.getPreviousSibling();if((!mt(ft)||Wn(ft))&&(ft=On(),ft.setFormat(m),$e.canInsertTextBefore()?Ce.insertBefore(ft):$e.insertBefore(ft)),ft.select(),Ce=ft,s!==""){this.insertText(s);return}}else if(Ce.isSegmented()&&Te!==Ue){const ft=On(Ce.getTextContent());ft.setFormat(m),Ce.replace(ft),Ce=ft}else if(!this.isCollapsed()&&s!==""){const ft=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ft)&&(!ft.canInsertTextBefore()||!ft.canInsertTextAfter())){this.insertText(""),pd(this.anchor,this.focus,null),this.insertText(s);return}}if(ae===1){if(Ce.isToken()){const At=On(s);At.select(),Ce.replace(At);return}const ft=Ce.getFormat(),qt=Ce.getStyle();if(Te===ve&&(ft!==m||qt!==A))if(Ce.getTextContent()==="")Ce.setFormat(m),Ce.setStyle(A);else{const At=On(s);if(At.setFormat(m),At.setStyle(A),At.select(),Te===0)Ce.insertBefore(At,!1);else{const[an]=Ce.splitText(Te);an.insertAfter(At,!1)}At.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);return}else if(Ro(Ce)){const At=On(s);At.setFormat(m),At.setStyle(A),At.select(),Ce.replace(At);return}const Wt=ve-Te;Ce=Ce.spliceText(Te,Wt,s,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=s.length:(this.format=ft,this.style=qt))}else{const ft=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"&&(ve!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<ve)if(mt(Qe)&&!Qe.isToken()&&ve!==Qe.getTextContentSize()){if(Qe.isSegmented()){const rn=On(Qe.getTextContent());Qe.replace(rn),Qe=rn}!Wr(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,ve,"")),ft.add(Qe.__key)}else{const rn=Qe.getParentOrThrow();!rn.canBeEmpty()&&rn.getChildrenSize()===1?rn.remove():Qe.remove()}else ft.add(Qe.__key);const an=Wt.getChildren(),nr=new Set(D),fs=qt.is(Wt),dr=qt.isInline()&&Ce.getNextSibling()===null?qt:Ce;for(let rn=an.length-1;rn>=0;rn--){const kn=an[rn];if(kn.is(Ce)||et(kn)&&kn.isParentOf(Ce))break;kn.isAttached()&&(!nr.has(kn)||kn.is(At)?fs||dr.insertAfter(kn,!1):kn.remove())}if(!fs){let rn=Wt,kn=null;for(;rn!==null;){const ai=rn.getChildren(),ji=ai.length;(ji===0||ai[ji-1].is(kn))&&(ft.delete(rn.__key),kn=rn),rn=rn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(Te,Ue-Te,s,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);else if(Te===Ue)Ce.select();else{const rn=On(s);rn.select(),Ce.replace(rn)}for(let rn=1;rn<ae;rn++){const kn=D[rn],ai=kn.__key;ft.has(ai)||kn.remove()}}}removeText(){this.insertText("")}formatText(s){if(this.isCollapsed()){this.toggleFormat(s),xn(null);return}const a=this.getNodes(),f=[];for(const Qe of a)mt(Qe)&&f.push(Qe);const p=f.length;if(p===0){this.toggleFormat(s),xn(null);return}const m=this.anchor,A=this.focus,D=this.isBackward(),ae=D?A:m,fe=D?m:A;let me=0,Te=f[0],ve=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&ve===Te.getTextContentSize()&&(me=1,Te=f[1],ve=0),Te==null)return;const Ce=Te.getFormatFlags(s,null),Ve=p-1;let Ue=f[Ve];const $e=fe.type==="text"?fe.offset:Ue.getTextContentSize();if(Te.is(Ue)){if(ve===$e)return;if(ve===0&&$e===Te.getTextContentSize())Te.setFormat(Ce);else{const Qe=Te.splitText(ve,$e),ft=ve===0?Qe[0]:Qe[1];ft.setFormat(Ce),ae.type==="text"&&ae.set(ft.__key,0,"text"),fe.type==="text"&&fe.set(ft.__key,$e-ve,"text")}this.format=Ce;return}ve!==0&&([,Te]=Te.splitText(ve),ve=0),Te.setFormat(Ce);const Rt=Ue.getFormatFlags(s,Ce);$e>0&&($e!==Ue.getTextContentSize()&&([Ue]=Ue.splitText($e)),Ue.setFormat(Rt));for(let Qe=me+1;Qe<Ve;Qe++){const ft=f[Qe];if(!ft.isToken()){const qt=ft.getFormatFlags(s,Rt);ft.setFormat(qt)}}ae.type==="text"&&ae.set(Te.__key,ve,"text"),fe.type==="text"&&fe.set(Ue.__key,$e,"text"),this.format=Ce|Rt}insertNodes(s){if(s.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const $e=mn();if(!Tt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(s)}const a=Co(this.anchor.getNode(),$i),f=s[s.length-1];if("__language"in a&&et(a)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Hc(this);a.splice($e,0,s),f.selectEnd()}return}const p=$e=>(et($e)||An($e))&&!$e.isInline();if(!s.some(p)){if(!et(a))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Hc(this);a.splice($e,0,s),f.selectEnd();return}const m=xm(s),A=m.getLastDescendant(),D=m.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,fe=$e=>et($e)&&$i($e)&&!$e.isEmpty()&&et(a)&&(!a.isEmpty()||ae(a)),Te=!et(a)||!a.isEmpty()?this.insertParagraph():null,ve=D[D.length-1];let Ce=D[0];if(fe(Ce)){if(!et(a))throw Error("Expected 'firstBlock' to be an ElementNode");a.append(...Ce.getChildren()),Ce=D[1]}Ce&&Ll(a,Ce);const Ve=Co(A,$i);Te&&et(Ve)&&(ae(Te)||$i(ve))&&(Ve.append(...Te.getChildren()),Te.remove()),et(a)&&a.isEmpty()&&a.remove(),A.selectEnd();const Ue=et(a)?a.getLastChild():null;oi(Ue)&&Ve!==a&&Ue.remove()}insertParagraph(){if(this.anchor.key==="root"){const A=Yi();return Qn().splice(this.anchor.offset,0,[A]),A.select(),A}const s=Hc(this),a=Co(this.anchor.getNode(),$i);if(!et(a))throw Error("Expected ancestor to be an ElementNode");const f=a.getChildAtIndex(s),p=f?[f,...f.getNextSiblings()]:[],m=a.insertNewAfter(this,!1);return m?(m.append(...p),m.selectStart(),m):null}insertLineBreak(s){const a=ds();if(this.insertNodes([a]),s){const f=a.getParentOrThrow(),p=a.getIndexWithinParent();f.select(p,p)}}extract(){const s=this.getNodes(),a=s.length,f=a-1,p=this.anchor,m=this.focus;let A=s[0],D=s[f];const[ae,fe]=li(this);if(a===0)return[];if(a===1){if(mt(A)&&!this.isCollapsed()){const Te=ae>fe?fe:ae,ve=ae>fe?ae:fe,Ce=A.splitText(Te,ve),Ve=Te===0?Ce[0]:Ce[1];return Ve!=null?[Ve]:[]}return[A]}const me=p.isBefore(m);if(mt(A)){const Te=me?ae:fe;Te===A.getTextContentSize()?s.shift():Te!==0&&([,A]=A.splitText(Te),s[0]=A)}if(mt(D)){const ve=D.getTextContent().length,Ce=me?fe:ae;Ce===0?s.pop():Ce!==ve&&([D]=D.splitText(Ce),s[f]=D)}return s}modify(s,a,f){const p=this.focus,m=this.anchor,A=s==="move",D=El(p,a);if(An(D)&&!D.isIsolated()){if(A&&D.isKeyboardSelectable()){const Ce=Fc();Ce.add(D.__key),yr(Ce);return}const ve=a?D.getPreviousSibling():D.getNextSibling();if(mt(ve)){const Ce=ve.__key,Ve=a?ve.getTextContent().length:0;p.set(Ce,Ve,"text"),A&&m.set(Ce,Ve,"text");return}else{const Ce=D.getParentOrThrow();let Ve,Ue;et(ve)?(Ue=ve.__key,Ve=a?ve.getChildrenSize():0):(Ve=D.getIndexWithinParent(),Ue=Ce.__key,a||Ve++),p.set(Ue,Ve,"element"),A&&m.set(Ue,Ve,"element");return}}const ae=Tn(),fe=or(ae._window);if(!fe)return;const me=ae._blockCursorElement,Te=ae._rootElement;if(Te!==null&&me!==null&&et(D)&&!D.isInline()&&!D.canBeEmpty()&&Ps(me,ae,Te),Ba(fe,s,a?"backward":"forward",f),fe.rangeCount>0){const ve=fe.getRangeAt(0),Ce=this.anchor.getNode(),Ve=Wr(Ce)?Ce:_o(Ce);if(this.applyDOMRange(ve),this.dirty=!0,!A){const Ue=this.getNodes(),$e=[];let Rt=!1;for(let Qe=0;Qe<Ue.length;Qe++){const ft=Ue[Qe];Pi(ft,Ve)?$e.push(ft):Rt=!0}if(Rt&&$e.length>0)if(a){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()}(fe.anchorNode!==ve.startContainer||fe.anchorOffset!==ve.startOffset)&&Io(this)}}}deleteCharacter(s){const a=this.isCollapsed();if(this.isCollapsed()){const f=this.anchor,p=this.focus;let m=f.getNode();if(!s&&(f.type==="element"&&et(m)&&f.offset===m.getChildrenSize()||f.type==="text"&&f.offset===m.getTextContentSize())){const D=m.getParent(),ae=m.getNextSibling()||(D===null?null:D.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const A=El(p,s);if(An(A)&&!A.isIsolated()){if(A.isKeyboardSelectable()&&et(m)&&m.getChildrenSize()===0){m.remove();const D=Fc();D.add(A.__key),yr(D)}else A.remove(),Tn().dispatchCommand(t,void 0);return}else if(!s&&et(A)&&et(m)&&m.isEmpty()){m.remove(),A.selectStart();return}if(this.modify("extend",s,"character"),this.isCollapsed()){if(s&&f.offset===0&&(f.type==="element"?f.getNode():f.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const D=p.type==="text"?p.getNode():null;if(m=f.type==="text"?f.getNode():null,D!==null&&D.isSegmented()){const ae=p.offset,fe=D.getTextContentSize();if(D.is(m)||s&&ae!==fe||!s&&ae!==0){fd(D,s,ae);return}}else if(m!==null&&m.isSegmented()){const ae=f.offset,fe=m.getTextContentSize();if(m.is(D)||s&&ae!==0||!s&&ae!==fe){fd(m,s,ae);return}}fm(this,s)}}if(this.removeText(),s&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const f=this.anchor.getNode();f.isEmpty()&&Wr(f.getParent())&&f.getIndexWithinParent()===0&&f.collapseAtStart(this)}}deleteLine(s){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",s,"lineboundary"),(s?this.focus:this.anchor).offset===0&&this.modify("extend",s,"character")),this.removeText()}deleteWord(s){this.isCollapsed()&&this.modify("extend",s,"word"),this.removeText()}}function Br(u){return u instanceof Ci}function cr(u){const s=u.offset;if(u.type==="text")return s;const a=u.getNode();return s===a.getChildrenSize()?a.getTextContent().length:0}function li(u){const s=u.anchor,a=u.focus;return s.type==="element"&&a.type==="element"&&s.key===a.key&&s.offset===a.offset?[0,0]:[cr(s),cr(a)]}function Io(u){const s=u.focus,a=u.anchor,f=a.key,p=a.offset,m=a.type;En(a,s.key,s.offset,s.type),En(s,f,p,m),u._cachedNodes=null}function Ba(u,s,a,f){u.modify(s,a,f)}function fm(u,s){const a=u.anchor,f=u.focus,p=a.getNode(),m=f.getNode();if(p===m&&a.type==="text"&&f.type==="text"){const A=a.offset,D=f.offset,ae=A<D,fe=ae?A:D,me=ae?D:A,Te=me-1;if(fe!==Te){const ve=p.getTextContent().slice(fe,me);Os(ve)||(s?f.offset=Te:a.offset=Te)}}}function fd(u,s,a){const f=u,m=f.getTextContent().split(/(?=\s)/g),A=m.length;let D=0,ae=0;for(let me=0;me<A;me++){const Te=m[me],ve=me===A-1;if(ae=D,D+=Te.length,s&&D===a||D>a||ve){m.splice(me,1),ve&&(ae=void 0);break}}const fe=m.join("").trim();fe===""?f.remove():(f.setTextContent(fe),f.select(ae,ae))}function hm(u,s,a){const f=u.getParent();return a===null||f===null||!f.canBeEmpty()||f!==a.getNode()}function hd(u,s,a,f){let p=s,m;if(u.nodeType===Le){let A=!1;const D=u.childNodes,ae=D.length;p===ae&&(A=!0,p=ae-1);let fe=D[p],me=!1;if(fe===f._blockCursorElement?(fe=D[p+1],me=!0):f._blockCursorElement!==null&&p--,m=Mi(fe),mt(m))p=hl(m,A);else{let Te=Mi(u);if(Te===null)return null;if(et(Te)){let ve=Te.getChildAtIndex(p);if(et(ve)&&hm(ve,p,a)){const Ce=A?ve.getLastDescendant():ve.getFirstDescendant();Ce===null?(Te=ve,p=0):(ve=Ce,Te=et(ve)?ve:ve.getParentOrThrow())}mt(ve)?(m=ve,Te=null,p=hl(ve,A)):ve!==Te&&A&&!me&&p++}else{const ve=Te.getIndexWithinParent();s===0&&An(Te)&&Mi(u)===Te?p=ve:p=ve+1,Te=Te.getParentOrThrow()}if(et(Te))return Ar(Te.__key,p,"element")}}else m=Mi(u);return mt(m)?Ar(m.__key,p,"text"):null}function gd(u,s,a){const f=u.offset,p=u.getNode();if(f===0){const m=p.getPreviousSibling(),A=p.getParent();if(!s)et(m)&&!a&&m.isInline()?(u.key=m.__key,u.offset=m.getChildrenSize(),u.type="element"):mt(m)&&(u.key=m.__key,u.offset=m.getTextContent().length);else if((a||!s)&&m===null&&et(A)&&A.isInline()){const D=A.getPreviousSibling();mt(D)&&(u.key=D.__key,u.offset=D.getTextContent().length)}}else if(f===p.getTextContent().length){const m=p.getNextSibling(),A=p.getParent();if(s&&et(m)&&m.isInline())u.key=m.__key,u.offset=0,u.type="element";else if((a||s)&&m===null&&et(A)&&A.isInline()&&!A.canInsertTextAfter()){const D=A.getNextSibling();mt(D)&&(u.key=D.__key,u.offset=0)}}}function pd(u,s,a){if(u.type==="text"&&s.type==="text"){const f=u.isBefore(s),p=u.is(s);gd(u,f,p),gd(s,!f,p),p&&(s.key=u.key,s.offset=u.offset,s.type=u.type);const m=Tn();if(m.isComposing()&&m._compositionKey!==u.key&&Tt(a)){const A=a.anchor,D=a.focus;En(u,A.key,A.offset,A.type),En(s,D.key,D.offset,D.type)}}}function md(u,s,a,f,p,m){if(u===null||a===null||!ts(p,u,a))return null;const A=hd(u,s,Tt(m)?m.anchor:null,p);if(A===null)return null;const D=hd(a,f,Tt(m)?m.focus:null,p);if(D===null)return null;if(A.type==="element"&&D.type==="element"){const ae=Mi(u),fe=Mi(a);if(An(ae)&&An(fe))return null}return pd(A,D,m),[A,D]}function gm(u){return et(u)&&!u.isInline()}function _d(u,s,a,f,p,m){const A=Ei(),D=new tr(Ar(u,s,p),Ar(a,f,m),0,"");return D.dirty=!0,A._selection=D,D}function pm(){const u=Ar("root",0,"element"),s=Ar("root",0,"element");return new tr(u,s,0,"")}function Fc(){return new Ci(new Set)}function mm(u){const a=u.getEditorState()._selection,f=or(u._window);return Tt(a)||a==null?Bc(a,f,u,null):a.clone()}function Bc(u,s,a,f){const p=a._window;if(p===null)return null;const m=f||p.event,A=m?m.type:void 0,D=A==="selectionchange",ae=!Pt()&&(D||A==="beforeinput"||A==="compositionstart"||A==="compositionend"||A==="click"&&m&&m.detail===3||A==="drop"||A===void 0);let fe,me,Te,ve;if(!Tt(u)||ae){if(s===null)return null;if(fe=s.anchorNode,me=s.focusNode,Te=s.anchorOffset,ve=s.focusOffset,D&&Tt(u)&&!ts(a,fe,me))return u.clone()}else return u.clone();const Ce=md(fe,Te,me,ve,a,u);if(Ce===null)return null;const[Ve,Ue]=Ce;return new tr(Ve,Ue,Tt(u)?u.format:0,Tt(u)?u.style:"")}function mn(){return Ei()._selection}function ko(){return Tn()._editorState._selection}function Ha(u,s,a,f=1){const p=u.anchor,m=u.focus,A=p.getNode(),D=m.getNode();if(!s.is(A)&&!s.is(D))return;const ae=s.__key;if(u.isCollapsed()){const fe=p.offset;if(a<=fe&&f>0||a<fe&&f<0){const me=Math.max(0,fe+f);p.set(ae,me,"element"),m.set(ae,me,"element"),yd(u)}}else{const fe=u.isBackward(),me=fe?m:p,Te=me.getNode(),ve=fe?p:m,Ce=ve.getNode();if(s.is(Te)){const Ve=me.offset;(a<=Ve&&f>0||a<Ve&&f<0)&&me.set(ae,Math.max(0,Ve+f),"element")}if(s.is(Ce)){const Ve=ve.offset;(a<=Ve&&f>0||a<Ve&&f<0)&&ve.set(ae,Math.max(0,Ve+f),"element")}}yd(u)}function yd(u){const s=u.anchor,a=s.offset,f=u.focus,p=f.offset,m=s.getNode(),A=f.getNode();if(u.isCollapsed()){if(!et(m))return;const D=m.getChildrenSize(),ae=a>=D,fe=ae?m.getChildAtIndex(D-1):m.getChildAtIndex(a);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),s.set(fe.__key,me,"text"),f.set(fe.__key,me,"text")}return}if(et(m)){const D=m.getChildrenSize(),ae=a>=D,fe=ae?m.getChildAtIndex(D-1):m.getChildAtIndex(a);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),s.set(fe.__key,me,"text")}}if(et(A)){const D=A.getChildrenSize(),ae=p>=D,fe=ae?A.getChildAtIndex(D-1):A.getChildAtIndex(p);if(mt(fe)){let me=0;ae&&(me=fe.getTextContentSize()),f.set(fe.__key,me,"text")}}}function _m(u,s){const f=s.getEditorState()._selection,p=u._selection;if(Tt(p)){const m=p.anchor,A=p.focus;let D;if(m.type==="text"&&(D=m.getNode(),D.selectionTransform(f,p)),A.type==="text"){const ae=A.getNode();D!==ae&&ae.selectionTransform(f,p)}}}function Wa(u,s,a,f,p){let m=null,A=0,D=null;f!==null?(m=f.__key,mt(f)?(A=f.getTextContentSize(),D="text"):et(f)&&(A=f.getChildrenSize(),D="element")):p!==null&&(m=p.__key,mt(p)?D="text":et(p)&&(D="element")),m!==null&&D!==null?u.set(m,A,D):(A=s.getIndexWithinParent(),A===-1&&(A=a.getChildrenSize()),u.set(a.__key,A,"element"))}function Nd(u,s,a,f,p){u.type==="text"?(u.key=a,s||(u.offset+=p)):u.offset>f.getIndexWithinParent()&&(u.offset-=1)}function ym(u,s,a,f,p,m,A){const D=f.anchorNode,ae=f.focusNode,fe=f.anchorOffset,me=f.focusOffset,Te=document.activeElement;if(p.has("collaboration")&&Te!==m||Te!==null&&Ss(Te))return;if(!Tt(s)){u!==null&&ts(a,D,ae)&&f.removeAllRanges();return}const ve=s.anchor,Ce=s.focus,Ve=ve.key,Ue=Ce.key,$e=ks(a,Ve),Rt=ks(a,Ue),Qe=ve.offset,ft=Ce.offset,qt=s.format,Wt=s.style,At=s.isCollapsed();let an=$e,nr=Rt,fs=!1;if(ve.type==="text"){an=Ir($e);const dr=ve.getNode();fs=dr.getFormat()!==qt||dr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(fs=!0);if(Ce.type==="text"&&(nr=Ir(Rt)),!(an===null||nr===null)&&(At&&(u===null||fs||Tt(u)&&(u.format!==qt||u.style!==Wt))&&Un(qt,Wt,Qe,Ve,performance.now()),!(fe===Qe&&me===ft&&D===an&&ae===nr&&!(f.type==="Range"&&At)&&((Te===null||!m.contains(Te))&&m.focus({preventScroll:!0}),ve.type!=="element")))){try{f.setBaseAndExtent(an,Qe,nr,ft)}catch{}if(!p.has("skip-scroll-into-view")&&s.isCollapsed()&&m!==null&&m===document.activeElement){const dr=s instanceof tr&&s.anchor.type==="element"?an.childNodes[Qe]||null:f.rangeCount>0?f.getRangeAt(0):null;if(dr!==null){let rn;if(dr instanceof Text){const kn=document.createRange();kn.selectNode(dr),rn=kn.getBoundingClientRect()}else rn=dr.getBoundingClientRect();mi(a,rn,m)}}zt()}}function Nm(u){let s=mn()||ko();s===null&&(s=Qn().selectEnd()),s.insertNodes(u)}function Cm(){const u=mn();return u===null?"":u.getTextContent()}function Em(u,s,a){const f=[];let p=null,m=null;function A(fe,me,Te){const ve={cell:Te,startColumn:me,startRow:fe},Ce=Te.__rowSpan,Ve=Te.__colSpan;for(let Ue=0;Ue<Ce;Ue++){f[fe+Ue]===void 0&&(f[fe+Ue]=[]);for(let $e=0;$e<Ve;$e++)f[fe+Ue][me+$e]=ve}s.is(Te)&&(p=ve),a.is(Te)&&(m=ve)}function D(fe,me){return f[fe]===void 0||f[fe][me]===void 0}const ae=u.getChildren();for(let fe=0;fe<ae.length;fe++){const me=ae[fe];if(!Yc(me))throw Error("Expected GridNode children to be GridRowNode");const Te=me.getChildren();let ve=0;for(const Ce of Te){if(!Fo(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!D(fe,ve);)ve++;A(fe,ve,Ce),ve+=Ce.__colSpan}}if(p===null)throw Error("Anchor not found in Grid");if(m===null)throw Error("Focus not found in Grid");return[f,p,m]}function Cd(u){let s;if(u instanceof Gc)s=u;else if(u instanceof ii){const p=No(u,Fo);if(!Fo(p))throw Error("Expected to find a parent GridCellNode");s=p}else{const p=No(u.getNode(),Fo);if(!Fo(p))throw Error("Expected to find a parent GridCellNode");s=p}const a=s.getParent();if(!Yc(a))throw Error("Expected GridCellNode to have a parent GridRowNode");const f=a.getParent();if(!kd(f))throw Error("Expected GridRowNode to have a parent GridNode");return[s,a,f]}function Hc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let a=s.getNode(),f=s.offset;for(;!$i(a);)[a,f]=Tm(a,f);return f}function Tm(u,s){const a=u.getParent();if(!a){const p=Yi();return Qn().append(p),p.select(),[Qn(),0]}if(mt(u)){const p=u.splitText(s);if(p.length===0)return[a,u.getIndexWithinParent()];const m=s===0?0:1,A=p[0].getIndexWithinParent()+m;return[a,A]}if(!et(u)||s===0)return[a,u.getIndexWithinParent()];const f=u.getChildAtIndex(s);if(f){const p=new tr(Ar(u.__key,s,"element"),Ar(u.__key,s,"element"),0,""),m=u.insertNewAfter(p);m&&m.append(f,...f.getNextSiblings())}return[a,u.getIndexWithinParent()+1]}function xm(u){const s=Yi();let a=null;for(let f=0;f<u.length;f++){const p=u[f],m=oi(p);if(m||An(p)&&p.isInline()||et(p)&&p.isInline()||mt(p)||p.isParentRequired()){if(a===null&&(a=p.createParentElementNode(),s.append(a),m))continue;a!==null&&a.append(p)}else s.append(p),a=null}return s}let Zn=null,Jn=null,Rr=!1,Wc=!1,Ka=0;const Ed={characterData:!0,childList:!0,subtree:!0};function Lo(){return Rr||Zn!==null&&Zn._readOnly}function ur(){if(Rr)throw Error("Cannot use method in read-only mode.")}function Td(){if(Ka>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 Ei(){if(Zn===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 Zn}function Tn(){if(Jn===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return Jn}function Sm(){return Jn}function xd(u,s,a){const f=s.__type,p=da(u,f);let m=a.get(f);m===void 0&&(m=Array.from(p.transforms),a.set(f,m));const A=m.length;for(let D=0;D<A&&(m[D](s),!!s.isAttached());D++);}function Sd(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function vm(u,s){const a=s._dirtyLeaves,f=u._nodeMap;for(const p of a){const m=f.get(p);mt(m)&&m.isAttached()&&m.isSimpleText()&&!m.isUnmergeable()&&_r(m)}}function wm(u,s){const a=s._dirtyLeaves,f=s._dirtyElements,p=u._nodeMap,m=sr(),A=new Map;let D=a,ae=D.size,fe=f,me=fe.size;for(;ae>0||me>0;){if(ae>0){s._dirtyLeaves=new Set;for(const Te of D){const ve=p.get(Te);mt(ve)&&ve.isAttached()&&ve.isSimpleText()&&!ve.isUnmergeable()&&_r(ve),ve!==void 0&&Sd(ve,m)&&xd(s,ve,A),a.add(Te)}if(D=s._dirtyLeaves,ae=D.size,ae>0){Ka++;continue}}s._dirtyLeaves=new Set,s._dirtyElements=new Map;for(const Te of fe){const ve=Te[0],Ce=Te[1];if(ve!=="root"&&!Ce)continue;const Ve=p.get(ve);Ve!==void 0&&Sd(Ve,m)&&xd(s,Ve,A),f.set(ve,Ce)}D=s._dirtyLeaves,ae=D.size,fe=s._dirtyElements,me=fe.size,Ka++}s._dirtyLeaves=a,s._dirtyElements=f}function Om(u){return Kc(u,Tn()._nodes)}function Kc(u,s){const a=u.type,f=s.get(a);if(f===void 0)throw Error(`parseEditorState: type "${a}" + not found`);const p=f.klass;if(u.type!==p.getType())throw Error(`LexicalNode: Node ${p.name} does not implement .importJSON().`);const m=p.importJSON(u),A=u.children;if(et(m)&&Array.isArray(A))for(let D=0;D<A.length;D++){const ae=A[D],fe=Kc(ae,s);m.append(fe)}return m}function Am(u,s,a){const f=Uc(),p=Zn,m=Rr,A=Jn,D=s._dirtyElements,ae=s._dirtyLeaves,fe=s._cloneNotNeeded,me=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Zn=f,Rr=!1,Jn=s;try{const Te=s._nodes,ve=u.root;Kc(ve,Te),a&&a(),f._readOnly=!0,wd(f)}catch(Te){Te instanceof Error&&s._onError(Te)}finally{s._dirtyElements=D,s._dirtyLeaves=ae,s._cloneNotNeeded=fe,s._dirtyType=me,Zn=p,Rr=m,Jn=A}return f}function vd(u,s){const a=Zn,f=Rr,p=Jn;Zn=u,Rr=!0,Jn=null;try{return s()}finally{Zn=a,Rr=f,Jn=p}}function wd(u){const s=u._nodeMap;s.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},s.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},s.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function js(u,s){const a=u._pendingEditorState,f=u._rootElement,p=u._headless||f===null;if(a===null)return;const m=u._editorState,A=m._selection,D=a._selection,ae=u._dirtyType!==qe,fe=Zn,me=Rr,Te=Jn,ve=u._updating,Ce=u._observer;let Ve=null;if(u._pendingEditorState=null,u._editorState=a,!p&&ae&&Ce!==null){Jn=u,Zn=a,Rr=!1,u._updating=!0;try{const At=u._dirtyType,an=u._dirtyElements,nr=u._dirtyLeaves;Ce.disconnect(),Ve=Wi(m,a,u,At,an,nr)}catch(At){if(At instanceof Error&&u._onError(At),!Wc)bd(u,null,f,a),rr(u),u._dirtyType=ct,Wc=!0,js(u,m),Wc=!1;else throw At;return}finally{Ce.observe(f,Ed),u._updating=ve,Zn=fe,Rr=me,Jn=Te}}a._readOnly||(a._readOnly=!0,wd(a),Tt(D)&&(Object.freeze(D.anchor),Object.freeze(D.focus)),Object.freeze(D));const Ue=u._dirtyLeaves,$e=u._dirtyElements,Rt=u._normalizedNodes,Qe=u._updateTags,ft=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),Da(u,a);const qt=p?null:or(u._window);if(u._editable&&qt!==null&&(ae||D===null||D.dirty)){Jn=u,Zn=a;try{if(Ce!==null&&Ce.disconnect(),ae||D===null||D.dirty){const At=u._blockCursorElement;At!==null&&Ps(At,u,f),ym(A,D,u,qt,Qe,f)}_i(u,f,D),Ce!==null&&Ce.observe(f,Ed)}finally{Jn=Te,Zn=fe}}Ve!==null&&Mm(u,Ve,Qe,Ue,m),!Tt(D)&&D!==null&&(A===null||!A.is(D))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Hl("decorator",u,!0,Wt)),Dm(u,s||m,a),Hl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:a,normalizedNodes:Rt,prevEditorState:s||m,tags:Qe}),bm(u,ft),Rm(u)}function Dm(u,s,a){const f=uo(s),p=uo(a);f!==p&&Hl("textcontent",u,!0,p)}function Mm(u,s,a,f,p){const m=Array.from(u._listeners.mutation),A=m.length;for(let D=0;D<A;D++){const[ae,fe]=m[D],me=s.get(fe);me!==void 0&&ae(me,{dirtyLeaves:f,prevEditorState:p,updateTags:a})}}function Hl(u,s,a,...f){const p=s._updating;s._updating=a;try{const m=Array.from(s._listeners[u]);for(let A=0;A<m.length;A++)m[A].apply(null,f)}finally{s._updating=p}}function Od(u,s,a){if(u._updating===!1||Jn!==u){let p=!1;return u.update(()=>{p=Od(u,s,a)}),p}const f=Ri(u);for(let p=4;p>=0;p--)for(let m=0;m<f.length;m++){const ae=f[m]._commands.get(s);if(ae!==void 0){const fe=ae[p];if(fe!==void 0){const me=Array.from(fe),Te=me.length;for(let ve=0;ve<Te;ve++)if(me[ve](a,u)===!0)return!0}}}return!1}function Rm(u){const s=u._updates;if(s.length!==0){const a=s.shift();if(a){const[f,p]=a;Dd(u,f,p)}}}function bm(u,s){if(u._deferred=[],s.length!==0){const a=u._updating;u._updating=!0;try{for(let f=0;f<s.length;f++)s[f]()}finally{u._updating=a}}}function Ad(u,s){const a=u._updates;let f=s||!1;for(;a.length!==0;){const p=a.shift();if(p){const[m,A]=p;let D,ae;A!==void 0&&(D=A.onUpdate,ae=A.tag,A.skipTransforms&&(f=!0),D&&u._deferred.push(D),ae&&u._updateTags.add(ae)),m()}}return f}function Dd(u,s,a){const f=u._updateTags;let p,m,A=!1,D=!1;a!==void 0&&(p=a.onUpdate,m=a.tag,m!=null&&f.add(m),A=a.skipTransforms||!1,D=a.discrete||!1),p&&u._deferred.push(p);const ae=u._editorState;let fe=u._pendingEditorState,me=!1;(fe===null||fe._readOnly)&&(fe=u._pendingEditorState=Lm(fe||ae),me=!0),fe._flushSync=D;const Te=Zn,ve=Rr,Ce=Jn,Ve=u._updating;Zn=fe,Rr=!1,u._updating=!0,Jn=u;try{me&&(u._headless?ae._selection!=null&&(fe._selection=ae._selection.clone()):fe._selection=mm(u));const $e=u._compositionKey;s(),A=Ad(u,A),_m(fe,u),u._dirtyType!==qe&&(A?vm(fe,u):wm(fe,u),Ad(u),vl(ae,fe,u._dirtyLeaves,u._dirtyElements));const Rt=u._compositionKey;$e!==Rt&&(fe._flushSync=!0);const Qe=fe._selection;if(Tt(Qe)){const ft=fe._nodeMap,qt=Qe.anchor.key,Wt=Qe.focus.key;if(ft.get(qt)===void 0||ft.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 Br(Qe)&&Qe._nodes.size===0&&(fe._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(),js(u);return}finally{Zn=Te,Rr=ve,Jn=Ce,u._updating=Ve,Ka=0}u._dirtyType!==qe||km(fe,u)?fe._flushSync?(fe._flushSync=!1,js(u)):me&&ao(()=>{js(u)}):(fe._flushSync=!1,me&&(f.clear(),u._deferred=[],u._pendingEditorState=null))}function Hr(u,s,a){u._updating?u._updates.push([s,a]):Dd(u,s,a)}class zc extends ii{constructor(s){super(s)}decorate(s,a){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof zc}class Vs extends ii{constructor(s){super(s),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 s=this.getFormat();return pe[s]||""}getIndent(){return this.getLatest().__indent}getChildren(){const s=[];let a=this.getFirstChild();for(;a!==null;)s.push(a),a=a.getNextSibling();return s}getChildrenKeys(){const s=[];let a=this.getFirstChild();for(;a!==null;)s.push(a.__key),a=a.getNextSibling();return s}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const a=Tn()._dirtyElements;return a!==null&&a.has(this.__key)}isLastChild(){const s=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(s)}getAllTextNodes(){const s=[];let a=this.getFirstChild();for(;a!==null;){if(mt(a)&&s.push(a),et(a)){const f=a.getAllTextNodes();s.push(...f)}a=a.getNextSibling()}return s}getFirstDescendant(){let s=this.getFirstChild();for(;s!==null;){if(et(s)){const a=s.getFirstChild();if(a!==null){s=a;continue}}break}return s}getLastDescendant(){let s=this.getLastChild();for(;s!==null;){if(et(s)){const a=s.getLastChild();if(a!==null){s=a;continue}}break}return s}getDescendantByIndex(s){const a=this.getChildren(),f=a.length;if(s>=f){const m=a[f-1];return et(m)&&m.getLastDescendant()||m||null}const p=a[s];return et(p)&&p.getFirstDescendant()||p||null}getFirstChild(){const a=this.getLatest().__first;return a===null?null:Nn(a)}getFirstChildOrThrow(){const s=this.getFirstChild();if(s===null)throw Error(`Expected node ${this.__key} to have a first child.`);return s}getLastChild(){const a=this.getLatest().__last;return a===null?null:Nn(a)}getLastChildOrThrow(){const s=this.getLastChild();if(s===null)throw Error(`Expected node ${this.__key} to have a last child.`);return s}getChildAtIndex(s){const a=this.getChildrenSize();let f,p;if(s<a/2){for(f=this.getFirstChild(),p=0;f!==null&&p<=s;){if(p===s)return f;f=f.getNextSibling(),p++}return null}for(f=this.getLastChild(),p=a-1;f!==null&&p>=s;){if(p===s)return f;f=f.getPreviousSibling(),p--}return null}getTextContent(){let s="";const a=this.getChildren(),f=a.length;for(let p=0;p<f;p++){const m=a[p];s+=m.getTextContent(),et(m)&&p!==f-1&&!m.isInline()&&(s+=$t)}return s}getTextContentSize(){let s=0;const a=this.getChildren(),f=a.length;for(let p=0;p<f;p++){const m=a[p];s+=m.getTextContentSize(),et(m)&&p!==f-1&&!m.isInline()&&(s+=$t.length)}return s}getDirection(){return this.getLatest().__dir}hasFormat(s){if(s!==""){const a=pi[s];return(this.getFormat()&a)!==0}return!1}select(s,a){ur();const f=mn();let p=s,m=a;const A=this.getChildrenSize();if(!this.canBeEmpty()){if(s===0&&a===0){const ae=this.getFirstChild();if(mt(ae)||et(ae))return ae.select(0,0)}else if((s===void 0||s===A)&&(a===void 0||a===A)){const ae=this.getLastChild();if(mt(ae)||et(ae))return ae.select()}}p===void 0&&(p=A),m===void 0&&(m=A);const D=this.__key;if(Tt(f))f.anchor.set(D,p,"element"),f.focus.set(D,m,"element"),f.dirty=!0;else return _d(D,p,D,m,"element","element");return f}selectStart(){const s=this.getFirstDescendant();return s?s.selectStart():this.select()}selectEnd(){const s=this.getLastDescendant();return s?s.selectEnd():this.select()}clear(){const s=this.getWritable();return this.getChildren().forEach(f=>f.remove()),s}append(...s){return this.splice(this.getChildrenSize(),0,s)}setDirection(s){const a=this.getWritable();return a.__dir=s,a}setFormat(s){const a=this.getWritable();return a.__format=s!==""?pi[s]:0,this}setIndent(s){const a=this.getWritable();return a.__indent=s,this}splice(s,a,f){const p=f.length,m=this.getChildrenSize(),A=this.getWritable(),D=A.__key,ae=[],fe=[],me=this.getChildAtIndex(s+a);let Te=null,ve=m-a+p;if(s!==0)if(s===m)Te=this.getLastChild();else{const Ve=this.getChildAtIndex(s);Ve!==null&&(Te=Ve.getPreviousSibling())}if(a>0){let Ve=Te===null?this.getFirstChild():Te.getNextSibling();for(let Ue=0;Ue<a;Ue++){if(Ve===null)throw Error("splice: sibling not found");const $e=Ve.getNextSibling(),Rt=Ve.__key,Qe=Ve.getWritable();Gr(Qe),fe.push(Rt),Ve=$e}}let Ce=Te;for(let Ve=0;Ve<p;Ve++){const Ue=f[Ve];Ce!==null&&Ue.is(Ce)&&(Te=Ce=Ce.getPreviousSibling());const $e=Ue.getWritable();$e.__parent===D&&ve--,Gr($e);const Rt=Ue.__key;if(Ce===null)A.__first=Rt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Rt,$e.__prev=Qe.__key}if(Ue.__key===D)throw Error("append: attempting to append self");$e.__parent=D,ae.push(Rt),Ce=Ue}if(s+a===m){if(Ce!==null){const Ve=Ce.getWritable();Ve.__next=null,A.__last=Ce.__key}}else if(me!==null){const Ve=me.getWritable();if(Ce!==null){const Ue=Ce.getWritable();Ve.__prev=Ce.__key,Ue.__next=me.__key}else Ve.__prev=null}if(A.__size=ve,fe.length){const Ve=mn();if(Tt(Ve)){const Ue=new Set(fe),$e=new Set(ae),{anchor:Rt,focus:Qe}=Ve;Md(Rt,Ue,$e)&&Wa(Rt,Rt.getNode(),this,Te,me),Md(Qe,Ue,$e)&&Wa(Qe,Qe.getNode(),this,Te,me),ve===0&&!this.canBeEmpty()&&!ri(this)&&this.remove()}}return A}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(s,a){return null}canIndent(){return!0}collapseAtStart(s){return!1}excludeFromCopy(s){return!1}canExtractContents(){return!0}canReplaceWith(s){return!0}canInsertAfter(s){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(s){return!1}extractWithChild(s,a,f){return!1}}function et(u){return u instanceof Vs}function Md(u,s,a){let f=u.getNode();for(;f;){const p=f.__key;if(s.has(p)&&!a.has(p))return!0;f=f.getParent()}return!1}class Po extends Vs{static getType(){return"root"}static clone(){return new Po}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Lo()||Tn()._dirtyType===qe)&&s!==null?s:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(s){throw Error("replace: cannot be called on root nodes")}insertBefore(s){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(s){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(s,a){return!1}append(...s){for(let a=0;a<s.length;a++){const f=s[a];if(!et(f)&&!An(f))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...s)}static importJSON(s){const a=Qn();return a.setFormat(s.format),a.setIndent(s.indent),a.setDirection(s.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function Im(){return new Po}function Wr(u){return u instanceof Po}function km(u,s){const a=s.getEditorState()._selection,f=u._selection;if(f!==null){if(f.dirty||!f.is(a))return!0}else if(a!==null)return!0;return!1}function Lm(u){return new za(new Map(u._nodeMap))}function Uc(){return new za(new Map([["root",Im()]]))}function Rd(u){const s=u.exportJSON(),a=u.constructor;if(s.type!==a.getType())throw Error(`LexicalNode: Node ${a.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const f=s.children;if(!Array.isArray(f))throw Error(`LexicalNode: Node ${a.name} is an element but .exportJSON() does not have a children array.`);const p=u.getChildren();for(let m=0;m<p.length;m++){const A=p[m],D=Rd(A);f.push(D)}}return s}class za{constructor(s,a){this._nodeMap=s,this._selection=a||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(s){return vd(this,s)}clone(s){const a=new za(this._nodeMap,s===void 0?this._selection:s);return a._readOnly=!0,a}toJSON(){return vd(this,()=>({root:Rd(Qn())}))}}class $o extends Vs{static getType(){return"paragraph"}static clone(s){return new $o(s.__key)}createDOM(s){const a=document.createElement("p"),f=ki(s.theme,"paragraph");return f!==void 0&&a.classList.add(...f),a}updateDOM(s,a,f){return!1}static importDOM(){return{p:s=>({conversion:Pm,priority:0})}}exportDOM(s){const{element:a}=super.exportDOM(s);if(a&&$s(a)){this.isEmpty()&&a.append(document.createElement("br"));const f=this.getFormatType();a.style.textAlign=f;const p=this.getDirection();p&&(a.dir=p);const m=this.getIndent();m>0&&(a.style.textIndent=`${m*20}px`)}return{element:a}}static importJSON(s){const a=Yi();return a.setFormat(s.format),a.setIndent(s.indent),a.setDirection(s.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(s,a){const f=Yi(),p=this.getDirection();return f.setDirection(p),this.insertAfter(f,a),f}collapseAtStart(){const s=this.getChildren();if(s.length===0||mt(s[0])&&s[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 Pm(u){const s=Yi();if(u.style){s.setFormat(u.style.textAlign);const a=parseInt(u.style.textIndent,10)/20;a>0&&s.setIndent(a)}return{node:s}}function Yi(){return vr(new $o)}function $m(u){return u instanceof $o}const Fm=0,Bm=1,Hm=2,Wm=3,Km=4;function bd(u,s,a,f){const p=u._keyToDOMMap;p.clear(),u._editorState=Uc(),u._pendingEditorState=f,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 m=u._observer;m!==null&&(m.disconnect(),u._observer=null),s!==null&&(s.textContent=""),a!==null&&(a.textContent="",p.set("root",a))}function zm(u,s){const a=new Map,f=new Set,p=m=>{Object.keys(m).forEach(A=>{let D=a.get(A);D===void 0&&(D=[],a.set(A,D)),D.push(m[A])})};return u.forEach(m=>{const A=m.klass.importDOM!=null?m.klass.importDOM.bind(m.klass):null;if(A==null||f.has(A))return;f.add(A);const D=A();D!==null&&p(D)}),s&&p(s),a}function Um(u){const s=u||{},a=Sm(),f=s.theme||{},p=u===void 0?a:s.parentEditor||null,m=s.disableEvents||!1,A=Uc(),D=s.namespace||(p!==null?p._config.namespace:gl()),ae=s.editorState,fe=[Po,Vr,Ui,Er,$o,...s.nodes||[]],{onError:me,html:Te}=s,ve=s.editable!==void 0?s.editable:!0;let Ce;if(u===void 0&&a!==null)Ce=a._nodes;else{Ce=new Map;for(let Ue=0;Ue<fe.length;Ue++){let $e=fe[Ue],Rt=null,Qe=null;if(typeof $e!="function"){const At=$e;$e=At.replace,Rt=At.with,Qe=At.withKlass||null}{const At=$e.name;if(At!=="RootNode"){const an=$e.prototype;["getType","clone"].forEach(nr=>{$e.hasOwnProperty(nr)||console.warn(`${At} must implement static "${nr}" 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`),an instanceof zc&&(an.hasOwnProperty("decorate")||console.warn(`${an.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`),an.hasOwnProperty("exportJSON")||console.warn(`${At} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ft=$e.getType(),qt=$e.transform(),Wt=new Set;qt!==null&&Wt.add(qt),Ce.set(ft,{exportDOM:Te&&Te.export?Te.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new Gm(A,p,Ce,{disableEvents:m,namespace:D,theme:f},me||console.error,zm(Ce,Te?Te.import:void 0),ve);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ct),Ve}class Gm{constructor(s,a,f,p,m,A,D){this._parentEditor=a,this._rootElement=null,this._editorState=s,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=p,this._nodes=f,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=gl(),this._onError=m,this._htmlConversions=A,this._editable=D,this._headless=a!==null&&a._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(s){const a=this._listeners.update;return a.add(s),()=>{a.delete(s)}}registerEditableListener(s){const a=this._listeners.editable;return a.add(s),()=>{a.delete(s)}}registerDecoratorListener(s){const a=this._listeners.decorator;return a.add(s),()=>{a.delete(s)}}registerTextContentListener(s){const a=this._listeners.textcontent;return a.add(s),()=>{a.delete(s)}}registerRootListener(s){const a=this._listeners.root;return s(this._rootElement,null),a.add(s),()=>{s(null,this._rootElement),a.delete(s)}}registerCommand(s,a,f){if(f===void 0)throw Error('Listener for type "command" requires a "priority".');const p=this._commands;p.has(s)||p.set(s,[new Set,new Set,new Set,new Set,new Set]);const m=p.get(s);if(m===void 0)throw Error(`registerCommand: Command ${String(s)} not found in command map`);const A=m[f];return A.add(a),()=>{A.delete(a),m.every(D=>D.size===0)&&p.delete(s)}}registerMutationListener(s,a){if(this._nodes.get(s.getType())===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);const p=this._listeners.mutation;return p.set(a,s),()=>{p.delete(a)}}registerNodeTransformToKlass(s,a){const f=s.getType(),p=this._nodes.get(f);if(p===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);return p.transforms.add(a),p}registerNodeTransform(s,a){const f=this.registerNodeTransformToKlass(s,a),p=[f],m=f.replaceWithKlass;if(m!=null){const A=this.registerNodeTransformToKlass(m,a);p.push(A)}return Di(this,s.getType()),()=>{p.forEach(A=>A.transforms.delete(a))}}hasNode(s){return this._nodes.has(s.getType())}hasNodes(s){return s.every(this.hasNode.bind(this))}dispatchCommand(s,a){return ut(this,s,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(s){const a=this._rootElement;if(s!==a){const f=ki(this._config.theme,"root"),p=this._pendingEditorState||this._editorState;if(this._rootElement=s,bd(this,a,s,p),a!==null&&(this._config.disableEvents||Ot(a),f!=null&&a.classList.remove(...f)),s!==null){const m=wa(s),A=s.style;A.userSelect="text",A.whiteSpace="pre-wrap",A.wordBreak="break-word",s.setAttribute("data-lexical-editor","true"),this._window=m,this._dirtyType=ct,rr(this),this._updateTags.add("history-merge"),js(this),this._config.disableEvents||gt(s,this),f!=null&&s.classList.add(...f)}else this._editorState=p,this._pendingEditorState=null,this._window=null;Hl("root",this,!1,s,a)}}getElementByKey(s){return this._keyToDOMMap.get(s)||null}getEditorState(){return this._editorState}setEditorState(s,a){if(s.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");dn(this);const f=this._pendingEditorState,p=this._updateTags,m=a!==void 0?a.tag:null;f!==null&&!f.isEmpty()&&(m!=null&&p.add(m),js(this)),this._pendingEditorState=s,this._dirtyType=ct,this._dirtyElements.set("root",!1),this._compositionKey=null,m!=null&&p.add(m),js(this)}parseEditorState(s,a){const f=typeof s=="string"?JSON.parse(s):s;return Am(f,this,a)}update(s,a){Hr(this,s,a)}focus(s,a={}){const f=this._rootElement;f!==null&&(f.setAttribute("autocapitalize","off"),Hr(this,()=>{const p=mn(),m=Qn();p!==null?p.dirty=!0:m.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?m.selectStart():m.selectEnd())},{onUpdate:()=>{f.removeAttribute("autocapitalize"),s&&s()},tag:"focus"}),this._pendingEditorState===null&&f.removeAttribute("autocapitalize"))}blur(){const s=this._rootElement;s!==null&&s.blur();const a=or(this._window);a!==null&&a.removeAllRanges()}isEditable(){return this._editable}setEditable(s){this._editable!==s&&(this._editable=s,Hl("editable",this,!0,s))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Gc extends Vs{constructor(s,a){super(a),this.__colSpan=s,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(s){return this.getWritable().__colSpan=s,this}getRowSpan(){return this.__rowSpan}setRowSpan(s){return this.getWritable().__rowSpan=s,this}}function Fo(u){return u instanceof Gc}class Id extends Vs{}function kd(u){return u instanceof Id}class Ld extends Vs{}function Yc(u){return u instanceof Ld}return He.$INTERNAL_isPointSelection=ar,He.$addUpdateTag=Ct,He.$applyNodeReplacement=vr,He.$copyNode=xl,He.$createLineBreakNode=ds,He.$createNodeSelection=Fc,He.$createParagraphNode=Yi,He.$createPoint=Ar,He.$createRangeSelection=pm,He.$createTabNode=Mo,He.$createTextNode=On,He.$getAdjacentNode=El,He.$getNearestNodeFromDOMNode=ni,He.$getNearestRootOrShadowRoot=_o,He.$getNodeByKey=Nn,He.$getPreviousSelection=ko,He.$getRoot=Qn,He.$getSelection=mn,He.$getTextContent=Cm,He.$hasAncestor=Pi,He.$hasUpdateTag=Kn,He.$insertNodes=Nm,He.$isBlockElementNode=gm,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Lr,He.$isLeafNode=vs,He.$isLineBreakNode=oi,He.$isNodeSelection=Br,He.$isParagraphNode=$m,He.$isRangeSelection=Tt,He.$isRootNode=Wr,He.$isRootOrShadowRoot=ri,He.$isTabNode=Ro,He.$isTextNode=mt,He.$nodesOfType=Li,He.$normalizeSelection__EXPERIMENTAL=xs,He.$parseSerializedNode=Om,He.$selectAll=Cl,He.$setCompositionKey=xn,He.$setSelection=yr,He.$splitNode=Oa,He.BLUR_COMMAND=b,He.CAN_REDO_COMMAND=J,He.CAN_UNDO_COMMAND=de,He.CLEAR_EDITOR_COMMAND=O,He.CLEAR_HISTORY_COMMAND=H,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=Km,He.COMMAND_PRIORITY_EDITOR=Fm,He.COMMAND_PRIORITY_HIGH=Wm,He.COMMAND_PRIORITY_LOW=Bm,He.COMMAND_PRIORITY_NORMAL=Hm,He.CONTROLLED_TEXT_INSERTION_COMMAND=y,He.COPY_COMMAND=K,He.CUT_COMMAND=P,He.DELETE_CHARACTER_COMMAND=c,He.DELETE_LINE_COMMAND=I,He.DELETE_WORD_COMMAND=R,He.DEPRECATED_$computeGridMap=Em,He.DEPRECATED_$getGridCellNodeRect=Mr,He.DEPRECATED_$getNodeTriplet=Cd,He.DEPRECATED_$isGridCellNode=Fo,He.DEPRECATED_$isGridNode=kd,He.DEPRECATED_$isGridRowNode=Yc,He.DEPRECATED_GridCellNode=Gc,He.DEPRECATED_GridNode=Id,He.DEPRECATED_GridRowNode=Ld,He.DRAGEND_COMMAND=ie,He.DRAGOVER_COMMAND=Y,He.DRAGSTART_COMMAND=x,He.DROP_COMMAND=ue,He.DecoratorNode=zc,He.ElementNode=Vs,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=$,He.FORMAT_TEXT_COMMAND=k,He.INDENT_CONTENT_COMMAND=we,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=g,He.INSERT_TAB_COMMAND=xe,He.INTERNAL_PointSelection=Dr,He.KEY_ARROW_DOWN_COMMAND=q,He.KEY_ARROW_LEFT_COMMAND=F,He.KEY_ARROW_RIGHT_COMMAND=z,He.KEY_ARROW_UP_COMMAND=G,He.KEY_BACKSPACE_COMMAND=ge,He.KEY_DELETE_COMMAND=B,He.KEY_DOWN_COMMAND=w,He.KEY_ENTER_COMMAND=le,He.KEY_ESCAPE_COMMAND=j,He.KEY_MODIFIER_COMMAND=v,He.KEY_SPACE_COMMAND=se,He.KEY_TAB_COMMAND=V,He.LineBreakNode=Ui,He.MOVE_TO_END=Q,He.MOVE_TO_START=W,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=E,He.ParagraphNode=$o,He.REDO_COMMAND=C,He.REMOVE_TEXT_COMMAND=T,He.RootNode=Po,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=Z,He.TabNode=Er,He.TextNode=Vr,He.UNDO_COMMAND=U,He.createCommand=e,He.createEditor=Um,He.getNearestEditorFromDOMNode=ll,He.isCurrentlyReadOnlyMode=Lo,He.isHTMLAnchorElement=Aa,He.isHTMLElement=$s,He.isSelectionCapturedInDecoratorInput=Ss,He.isSelectionWithinEditor=ts,He}var We={},tf;function Py(){if(tf)return We;tf=1;let e={},t={},n={},r={},c={},d={},g={},y={},E={},T={},R={},I={},k={},U={},C={},w={},z={},Q={},F={},W={},G={},q={},le={},se={},ge={},j={},B={},V={},xe={},we={},Ee={},ue={},$={},x={},Y={},ie={};function K(o){let i=new URLSearchParams;i.append("code",o);for(let l=1;l<arguments.length;l++)i.append("v",arguments[l]);throw Error(`Minified Lexical error #${o}; 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 P=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Z=P&&"documentMode"in document?document.documentMode:null,O=P&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),H=P&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),J=P&&"InputEvent"in window&&!Z?"getTargetRanges"in new window.InputEvent("input"):!1,de=P&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=P&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,b=P&&/Android/.test(navigator.userAgent),v=P&&/^(?=.*Chrome).*/i.test(navigator.userAgent),M=P&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!v,re=de||_e||M?" ":"",ye=H?" ":re,Ae=/^[^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]/,te={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ce={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},Le={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(o){qe=o.timeStamp}function ct(o,i,l){return i.__lexicalLineBreak===o||o[`__lexicalKey_${l._key}`]!==void 0}function Dt(o){return o.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function Ut(o,i,l){Fe=!0;let h=100<performance.now()-qe;try{Cr(o,()=>{let _=Vt()||Dt(o);var N=new Map,S=o.getRootElement(),X=o._editorState,he=o._blockCursorElement;let De=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,gt=Ke.target,Ot=Kt(gt,X);if(!(Ot===null&>!==S||Cn(Ot))){if(Pe==="characterData"){if(Ke=h&&Ct(Ot))e:{Ke=_,Pe=gt;var Ft=Ot;if(Mt(Ke)){var zt=Ke.anchor.getNode();if(zt.is(Ft)&&Ke.format!==zt.getFormat()){Ke=!1;break e}}Ke=Pe.nodeType===3&&Ft.isAttached()}Ke&&(Ft=Ur(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===gt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),gt=gt.nodeValue,gt!==null&&wt(Ot,gt,Ke,Pe,!1))}else if(Pe==="childList"){for(De=!0,Pe=Ke.addedNodes,Ft=0;Ft<Pe.length;Ft++){zt=Pe[Ft];var Un=$t(zt),wr=zt.parentNode;wr==null||zt===he||Un!==null||zt.nodeName==="BR"&&ct(zt,wr,o)||(H&&(Un=zt.innerText||zt.nodeValue)&&(Ye+=Un),wr.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)wr=Ke[zt],(wr.nodeName==="BR"&&ct(wr,gt,o)||he===wr)&&(gt.appendChild(wr),Ft++);Pe!==Ft&&(gt===S&&(Ot=X._nodeMap.get("root")),N.set(gt,Ot))}}}}if(0<N.size)for(let[ii,si]of N)if(Je(si))for(N=si.getChildrenKeys(),S=ii.firstChild,X=0;X<N.length;X++)he=o.getElementByKey(N[X]),he!==null&&(S==null?(ii.appendChild(he),S=he):S!==he&&ii.replaceChild(he,S),S=S.nextSibling);else Ct(si)&&si.markDirty();if(N=l.takeRecords(),0<N.length){for(S=0;S<N.length;S++)for(he=N[S],X=he.addedNodes,he=he.target,Xe=0;Xe<X.length;Xe++)Ot=X[Xe],gt=Ot.parentNode,gt==null||Ot.nodeName!=="BR"||ct(Ot,he,o)||gt.removeChild(Ot);l.takeRecords()}_!==null&&(De&&(_.dirty=!0,nn(_)),H&&sn(o)&&_.insertRawText(Ye))})}finally{Fe=!1}}function en(o){let i=o._observer;if(i!==null){let l=i.takeRecords();Ut(o,l,i)}}function Oe(o){qe===0&&dn(o).addEventListener("textInput",Be,!0),o._observer=new MutationObserver((i,l)=>{Ut(o,i,l)})}function ne(o,i){let l=o.__mode,h=o.__format;o=o.__style;let _=i.__mode,N=i.__format;return i=i.__style,(l===null||l===_)&&(h===null||h===N)&&(o===null||o===i)}function oe(o,i){let l=o.mergeWithSibling(i),h=fn()._normalizedNodes;return h.add(o.__key),h.add(i.__key),l}function Se(o){if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable())o.remove();else{for(var i;(i=o.getPreviousSibling())!==null&&Ct(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{ne(i,o)&&(o=oe(i,o));break}for(var l;(l=o.getNextSibling())!==null&&Ct(l)&&l.isSimpleText()&&!l.isUnmergeable();)if(l.__text==="")l.remove();else{ne(o,l)&&oe(o,l);break}}}function ke(o){return Me(o.anchor),Me(o.focus),o}function Me(o){for(;o.type==="element";){var i=o.getNode(),l=o.offset;if(l===i.getChildrenSize()?(i=i.getChildAtIndex(l-1),l=!0):(i=i.getChildAtIndex(l),l=!1),Ct(i)){o.set(i.__key,l?i.getTextContentSize():0,"text");break}else if(!Je(i))break;o.set(i.__key,l?i.getChildrenSize():0,"element")}}let je=1,rt=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function it(o){let i=document.activeElement;if(i===null)return!1;let l=i.nodeName;return Cn(Kt(o))&&(l==="INPUT"||l==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function st(o,i,l){let h=o.getRootElement();try{return h!==null&&h.contains(i)&&h.contains(l)&&i!==null&&!it(i)&&vt(i)===o}catch{return!1}}function vt(o){for(;o!=null;){let i=o.__lexicalEditor;if(i!=null)return i;o=mr(o)}return null}function Ge(o){return o.isToken()||o.isSegmented()}function ze(o){for(;o!=null;){if(o.nodeType===3)return o;o=o.firstChild}return null}function tt(o,i,l){let h=te[i];return l!==null&&(o&h)===(l&h)||(o^=h,i==="subscript"?o&=-65:i==="superscript"&&(o&=-33)),o}function _t(o,i){if(i!=null)o.__key=i;else{Vn(),99<Bi&&K(14),i=fn();var l=Pr(),h=""+je++;l._nodeMap.set(h,o),Je(o)?i._dirtyElements.set(h,!0):i._dirtyLeaves.add(h),i._cloneNotNeeded.add(h),i._dirtyType=1,o.__key=h}}function Nt(o){var i=o.getParent();if(i!==null){let _=o.getWritable();i=i.getWritable();var l=o.getPreviousSibling();if(o=o.getNextSibling(),l===null)if(o!==null){var h=o.getWritable();i.__first=o.__key,h.__prev=null}else i.__first=null;else{if(h=l.getWritable(),o!==null){let N=o.getWritable();N.__prev=h.__key,h.__next=N.__key}else h.__next=null;_.__prev=null}o===null?l!==null?(o=l.getWritable(),i.__last=l.__key,o.__next=null):i.__last=null:(o=o.getWritable(),l!==null?(l=l.getWritable(),l.__next=o.__key,o.__prev=l.__key):o.__prev=null,_.__next=null),i.__size--,_.__parent=null}}function Et(o){99<Bi&&K(14);var i=o.getLatest(),l=i.__parent,h=Pr();let _=fn(),N=h._nodeMap;if(h=_._dirtyElements,l!==null)e:for(;l!==null;){if(h.has(l))break e;let S=N.get(l);if(S===void 0)break;h.set(l,!1),l=S.__parent}i=i.__key,_._dirtyType=1,Je(o)?h.set(i,!0):_._dirtyLeaves.add(i)}function ht(o){Vn();var i=fn();let l=i._compositionKey;o!==l&&(i._compositionKey=o,l!==null&&(i=pt(l),i!==null&&i.getWritable()),o!==null&&(o=pt(o),o!==null&&o.getWritable()))}function xt(){return cs()?null:fn()._compositionKey}function pt(o,i){return o=(i||Pr())._nodeMap.get(o),o===void 0?null:o}function $t(o,i){let l=fn();return o=o[`__lexicalKey_${l._key}`],o!==void 0?pt(o,i):null}function Kt(o,i){for(;o!=null;){let l=$t(o,i);if(l!==null)return l;o=mr(o)}return null}function tn(o){let i=Object.assign({},o._decorators);return o._pendingDecorators=i}function kt(o){return o.read(()=>bt().getTextContent())}function jt(o,i){Cr(o,()=>{var l=Pr();if(!l.isEmpty())if(i==="root")bt().markDirty();else{l=l._nodeMap;for(let[,h]of l)h.markDirty()}},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return Pr()._nodeMap.get("root")}function nn(o){Vn();let i=Pr();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function Sr(o){var i=fn(),l;e:{for(l=o;l!=null;){let h=l[`__lexicalKey_${i._key}`];if(h!==void 0){l=h;break e}l=mr(l)}l=null}return l===null?(i=i.getRootElement(),o===i?pt("root"):null):pt(l)}function pi(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function pe(o){let i=[];for(;o!==null;)i.push(o),o=o._parentEditor;return i}function Ze(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ot(o,i,l){if(i=Ur(i._window),i!==null){var h=i.anchorNode,{anchorOffset:_,focusOffset:N}=i;if(h!==null&&(i=h.nodeType===3?h.nodeValue:null,h=Kt(h),i!==null&&Ct(h))){if(i===re&&l){let S=l.length;i=l,N=_=S}i!==null&&wt(h,i,_,N,o)}}}function wt(o,i,l,h,_){let N=o;if(N.isAttached()&&(_||!N.isDirty())){let De=N.isComposing(),Ye=i;if((De||_)&&i[i.length-1]===re&&(Ye=i.slice(0,-1)),i=N.getTextContent(),_||Ye!==i)if(Ye==="")if(ht(null),de||_e||M)N.remove();else{let Xe=fn();setTimeout(()=>{Xe.update(()=>{N.isAttached()&&N.remove()})},20)}else{_=N.getParent(),i=Nr();var S=N.getTextContentSize(),X=xt(),he=N.getKey();N.isToken()||X!==null&&he===X&&!De||Mt(i)&&(_!==null&&!_.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===o.__key&&i.anchor.offset===0&&!N.canInsertTextBefore()&&!De||i.focus.key===o.__key&&i.focus.offset===S&&!N.canInsertTextAfter()&&!De)?N.markDirty():(o=Vt(),Mt(o)&&l!==null&&h!==null&&(o.setTextNodeRange(N,l,N,h),N.isSegmented()&&(l=N.getTextContent(),l=Kn(l),N.replace(l),N=l)),N.setTextContent(Ye))}}}function Gt(o,i){if(i.isSegmented())return!0;if(!o.isCollapsed())return!1;o=o.anchor.offset;let l=i.getParentOrThrow(),h=i.isToken();return o===0?((o=!i.canInsertTextBefore()||!l.canInsertTextBefore()||h)||(i=i.getPreviousSibling(),o=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),o):o===i.getTextContentSize()?!i.canInsertTextAfter()||!l.canInsertTextAfter()||h:!1}function Bt(o,i){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let l=o.__lexicalClassNameCache,h=l[i];return h!==void 0?h:(o=o[i],typeof o=="string"?(o=o.split(" "),l[i]=o):o)}function Pt(o,i,l,h,_){l.size!==0&&(l=h.__type,h=h.__key,i=i.get(l),i===void 0&&K(33,l),l=i.klass,i=o.get(l),i===void 0&&(i=new Map,o.set(l,i)),o=i.get(h),l=o==="destroyed"&&_==="created",(o===void 0||l)&&i.set(h,l?"updated":_))}function Lt(o,i,l){let h=o.getParent(),_=l;return h!==null&&(i&&l===0?(_=o.getIndexWithinParent(),o=h):i||l!==o.getChildrenSize()||(_=o.getIndexWithinParent()+1,o=h)),o.getChildAtIndex(i?_-1:_)}function Ht(o,i){var l=o.offset;return o.type==="element"?(o=o.getNode(),Lt(o,i,l)):(o=o.getNode(),i&&l===0||!i&&l===o.getTextContentSize()?(l=i?o.getPreviousSibling():o.getNextSibling(),l===null?Lt(o.getParentOrThrow(),i,o.getIndexWithinParent()+(i?0:1)):l):null)}function sn(o){return o=(o=dn(o).event)&&o.inputType,o==="insertFromPaste"||o==="insertFromPasteAsQuotation"}function ln(o){return!er(o)&&!o.isLastChild()&&!o.isInline()}function Rn(o,i){return o=o._keyToDOMMap.get(i),o===void 0&&K(75,i),o}function mr(o){return o=o.assignedSlot||o.parentElement,o!==null&&o.nodeType===11?o.host:o}function jn(o,i){for(o=o.getParent();o!==null;){if(o.is(i))return!0;o=o.getParent()}return!1}function dn(o){return o=o._window,o===null&&K(78),o}function rr(o){for(o=o.getParentOrThrow();o!==null&&!ir(o);)o=o.getParentOrThrow();return o}function ir(o){return er(o)||Je(o)&&o.isShadowRoot()}function Oi(o){return o=o.constructor.clone(o),_t(o,null),o}function _r(o){var i=fn();let l=o.constructor.getType();return i=i._nodes.get(l),i===void 0&&K(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||K(98),i):o}function xs(o,i){o=o.getParent(),!er(o)||Je(i)||Cn(i)||K(99)}function lo(o){return(Cn(o)||Je(o)&&!o.canBeEmpty())&&!o.isInline()}function ol(o,i,l){l.style.removeProperty("caret-color"),i._blockCursorElement=null,i=o.parentElement,i!==null&&i.removeChild(o)}function Ur(o){return P?(o||window).getSelection():null}function da(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function ao(o){return o.nodeType===1}function es(o){if(Cn(o)&&!o.isInline())return!0;if(!Je(o)||ir(o))return!1;var i=o.getFirstChild();return i=i===null||bi(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function Ss(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function ts(o,i,l,h,_,N){for(o=o.getFirstChild();o!==null;){let S=o.__key;o.__parent===i&&(Je(o)&&ts(o,S,l,h,_,N),l.has(S)||N.delete(S),_.push(S)),o=o.getNextSibling()}}function ll(o,i,l,h){o=o._nodeMap,i=i._nodeMap;let _=[];for(let[N]of h){let S=i.get(N);S===void 0||S.isAttached()||(Je(S)&&ts(S,N,o,i,_,h),o.has(N)||h.delete(N),_.push(N))}for(let N of _)i.delete(N);for(let N of l)h=i.get(N),h===void 0||h.isAttached()||(o.has(N)||l.delete(N),i.delete(N))}let bn="",Wn="",ti="",Ir,$n,vs,al=!1,cl=!1,Gr,Ai=null,ul,xn,sr,Nn,co,ni;function ws(o,i){let l=sr.get(o);if(i!==null){let h=As(o);h.parentNode===i&&i.removeChild(h)}Nn.has(o)||$n._keyToDOMMap.delete(o),Je(l)&&(o=Os(l,sr),uo(o,0,o.length-1,null)),l!==void 0&&Pt(ni,vs,Gr,l,"destroyed")}function uo(o,i,l,h){for(;i<=l;++i){let _=o[i];_!==void 0&&ws(_,h)}}function Di(o,i){o.setProperty("text-align",i)}function Qn(o,i){var l=Ir.theme.indent;if(typeof l=="string"){let h=o.classList.contains(l);0<i&&!h?o.classList.add(l):1>i&&h&&o.classList.remove(l)}l=getComputedStyle(o).getPropertyValue("--lexical-indent-base-value")||"40px",o.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${l})`)}function dl(o,i){o=o.style,i===0?Di(o,""):i===1?Di(o,"left"):i===2?Di(o,"center"):i===3?Di(o,"right"):i===4?Di(o,"justify"):i===5?Di(o,"start"):i===6&&Di(o,"end")}function yr(o,i,l){let h=Nn.get(o);h===void 0&&K(60);let _=h.createDOM(Ir,$n);var N=$n._keyToDOMMap;if(_["__lexicalKey_"+$n._key]=o,N.set(o,_),Ct(h)?_.setAttribute("data-lexical-text","true"):Cn(h)&&_.setAttribute("data-lexical-decorator","true"),Je(h)){if(o=h.__indent,N=h.__size,o!==0&&Qn(_,o),N!==0){--N,o=Os(h,Nn);var S=Wn;Wn="",fl(o,h,0,N,_,null),fa(h,_),Wn=S}o=h.__format,o!==0&&dl(_,o),h.isInline()||hl(null,h,_),ln(h)&&(bn+=`
|
|
47
|
-
|
|
48
|
-
`,ti+=`
|
|
49
|
-
|
|
50
|
-
`)}else N=h.getTextContent(),Cn(h)?(S=h.decorate($n,Ir),S!==null&&gl(o,S),_.contentEditable="false"):Ct(h)&&(h.isDirectionless()||(Wn+=N)),bn+=N,ti+=N;return i!==null&&(l!=null?i.insertBefore(_,l):(l=i.__lexicalLineBreak,l!=null?i.insertBefore(_,l):i.appendChild(_))),Pt(ni,vs,Gr,h,"created"),_}function fl(o,i,l,h,_,N){let S=bn;for(bn="";l<=h;++l)yr(o[l],_,N);ln(i)&&(bn+=`
|
|
51
|
-
|
|
52
|
-
`),_.__lexicalTextContent=bn,bn=S+bn}function Mi(o,i){return o=i.get(o),bi(o)||Cn(o)&&o.isInline()}function hl(o,i,l){o=o!==null&&(o.__size===0||Mi(o.__last,sr)),i=i.__size===0||Mi(i.__last,Nn),o?i||(i=l.__lexicalLineBreak,i!=null&&l.removeChild(i),l.__lexicalLineBreak=null):i&&(i=document.createElement("br"),l.__lexicalLineBreak=i,l.appendChild(i))}function fa(o,i){var l=i.__lexicalDir;if(i.__lexicalDirTextContent!==Wn||l!==Ai){let N=Wn==="";if(N)var h=Ai;else h=Wn,h=Ae.test(h)?"rtl":ee.test(h)?"ltr":null;if(h!==l){let S=i.classList,X=Ir.theme;var _=l!==null?X[l]:void 0;let he=h!==null?X[h]:void 0;_!==void 0&&(typeof _=="string"&&(_=_.split(" "),_=X[l]=_),S.remove(..._)),h===null||N&&h==="ltr"?i.removeAttribute("dir"):(he!==void 0&&(typeof he=="string"&&(l=he.split(" "),he=X[h]=l),he!==void 0&&S.add(...he)),i.dir=h),cl||(o.getWritable().__dir=h)}Ai=h,i.__lexicalDirTextContent=Wn,i.__lexicalDir=h}}function Os(o,i){let l=[];for(o=o.__first;o!==null;){let h=i.get(o);h===void 0&&K(101),l.push(o),o=h.__next}return l}function Ri(o,i){var l=sr.get(o),h=Nn.get(o);l!==void 0&&h!==void 0||K(61);var _=al||xn.has(o)||ul.has(o);let N=Rn($n,o);if(l===h&&!_)return Je(l)?(h=N.__lexicalTextContent,h!==void 0&&(bn+=h,ti+=h),h=N.__lexicalDirTextContent,h!==void 0&&(Wn+=h)):(h=l.getTextContent(),Ct(l)&&!l.isDirectionless()&&(Wn+=h),ti+=h,bn+=h),N;if(l!==h&&_&&Pt(ni,vs,Gr,h,"updated"),h.updateDOM(l,N,Ir))return h=yr(o,null,null),i===null&&K(62),i.replaceChild(h,N),ws(o,null),h;if(Je(l)&&Je(h)){if(o=h.__indent,o!==l.__indent&&Qn(N,o),o=h.__format,o!==l.__format&&dl(N,o),_){o=Wn,Wn="",_=bn;var S=l.__size,X=h.__size;if(bn="",S===1&&X===1){var he=l.__first;if(i=h.__first,he===i)Ri(he,N);else{var De=As(he);i=yr(i,null,null),N.replaceChild(i,De),ws(he,null)}}else{i=Os(l,sr);var Ye=Os(h,Nn);if(S===0)X!==0&&fl(Ye,h,0,X-1,N,null);else if(X===0)S!==0&&(he=N.__lexicalLineBreak==null,uo(i,0,S-1,he?null:N),he&&(N.textContent=""));else{var Xe=i;i=Ye,Ye=S-1,S=X-1;let Pe=N.firstChild,gt=0;for(X=0;gt<=Ye&&X<=S;){var Ke=Xe[gt];let Ot=i[X];if(Ke===Ot)Pe=fo(Ri(Ot,N)),gt++,X++;else{he===void 0&&(he=new Set(Xe)),De===void 0&&(De=new Set(i));let Ft=De.has(Ke),zt=he.has(Ot);Ft?(zt?(Ke=Rn($n,Ot),Ke===Pe?Pe=fo(Ri(Ot,N)):(Pe!=null?N.insertBefore(Ke,Pe):N.appendChild(Ke),Ri(Ot,N)),gt++):yr(Ot,N,Pe),X++):(Pe=fo(As(Ke)),ws(Ke,N),gt++)}}he=gt>Ye,De=X>S,he&&!De?(he=i[S+1],he=he===void 0?null:$n.getElementByKey(he),fl(i,h,X,S,N,he)):De&&!he&&uo(Xe,gt,Ye,N)}}ln(h)&&(bn+=`
|
|
53
|
-
|
|
54
|
-
`),N.__lexicalTextContent=bn,bn=_+bn,fa(h,N),Wn=o,er(h)||h.isInline()||hl(l,h,N)}ln(h)&&(bn+=`
|
|
55
|
-
|
|
56
|
-
`,ti+=`
|
|
57
|
-
|
|
58
|
-
`)}else l=h.getTextContent(),Cn(h)?(_=h.decorate($n,Ir),_!==null&&gl(o,_)):Ct(h)&&!h.isDirectionless()&&(Wn+=l),bn+=l,ti+=l;return!cl&&er(h)&&h.__cachedText!==ti&&(h.getWritable().__cachedText=ti),N}function gl(o,i){let l=$n._pendingDecorators,h=$n._decorators;if(l===null){if(h[o]===i)return;l=tn($n)}l[o]=i}function fo(o){return o=o.nextSibling,o!==null&&o===$n._blockCursorElement&&(o=o.nextSibling),o}function As(o){let i=co.get(o);return i===void 0&&K(75,o),i}let kr=Object.freeze({}),pl=[["keydown",kc],["pointerdown",Mc],["compositionstart",Ea],["compositionend",Ic],["input",Ca],["click",Dc],["cut",kr],["copy",kr],["dragstart",kr],["dragover",kr],["dragend",kr],["paste",kr],["focus",kr],["blur",kr],["drop",kr]];J&&pl.push(["beforeinput",(o,i)=>bc(o,i)]);let Ds=0,ha=0,ga=0,ns=null,Ms=0,ml=!1,_l=!1,Rs=!1,bs=!1,pa=[0,"",0,"root",0];function ma(o,i,l,h,_){let N=o.anchor,S=o.focus,X=N.getNode();var he=fn();let De=Ur(he._window),Ye=De!==null?De.anchorNode:null,Xe=N.key;he=he.getElementByKey(Xe);let Ke=l.length;return Xe!==S.key||!Ct(X)||(!_&&(!J||ga<h+50)||X.isDirty()&&2>Ke||pi(l))&&N.offset!==S.offset&&!X.isComposing()||Ge(X)||X.isDirty()&&1<Ke||(_||!J)&&he!==null&&!X.isComposing()&&Ye!==ze(he)||De!==null&&i!==null&&(!i.collapsed||i.startContainer!==De.anchorNode||i.startOffset!==De.anchorOffset)||X.getFormat()!==o.format||X.getStyle()!==o.style||Gt(o,X)}function _a(o,i){return o!==null&&o.nodeValue!==null&&o.nodeType===3&&i!==0&&i!==o.nodeValue.length}function ya(o,i,l){let{anchorNode:h,anchorOffset:_,focusNode:N,focusOffset:S}=o;ml&&(ml=!1,_a(h,_)&&_a(N,S))||Cr(i,()=>{if(!l)nn(null);else if(st(i,h,N)){var X=Vt();if(Mt(X)){var he=X.anchor,De=he.getNode();if(X.isCollapsed()){o.type==="Range"&&o.anchorNode===o.focusNode&&(X.dirty=!0);var Ye=dn(i).event;Ye=Ye?Ye.timeStamp:performance.now();let[Ke,Pe,gt,Ot,Ft]=pa;var Xe=bt();if(Xe=i.isComposing()===!1&&Xe.getTextContent()==="",Ye<Ft+200&&he.offset===gt&&he.key===Ot)X.format=Ke,X.style=Pe;else if(he.type==="text"){if(!Ct(De))throw Error("Point.getNode() must return TextNode when type is text");X.format=De.getFormat(),X.style=De.getStyle()}else he.type!=="element"||Xe||(X.format=0,X.style="")}else{he=255,De=!1,Ye=X.getNodes(),Xe=Ye.length;for(let Ke=0;Ke<Xe;Ke++){let Pe=Ye[Ke];if(Ct(Pe)&&(De=!0,he&=Pe.getFormat(),he===0))break}X.format=De?he:0}}at(i,e,void 0)}})}function Dc(o,i){Cr(i,()=>{let l=Vt();var h=Ur(i._window);let _=Nr();if(h)if(Mt(l)){let S=l.anchor;var N=S.getNode();S.type==="element"&&S.offset===0&&l.isCollapsed()&&!er(N)&&bt().getChildrenSize()===1&&N.getTopLevelElementOrThrow().isEmpty()&&_!==null&&l.is(_)?(h.removeAllRanges(),l.dirty=!0):o.detail!==3||l.isCollapsed()||(h=l.focus.getNode(),N!==h&&(Je(N)?N.select(0):N.getParentOrThrow().select(0)))}else o.pointerType==="touch"&&(N=h.anchorNode,N!==null&&(N=N.nodeType,N===1||N===3))&&(h=zn(_,h,i,o),nn(h));at(i,t,o)})}function Mc(o,i){let l=o.target;o=o.pointerType,l instanceof Node&&o!=="touch"&&Cr(i,()=>{Cn(Kt(l))||(_l=!0)})}function Na(o){return o.getTargetRanges?(o=o.getTargetRanges(),o.length===0?null:o[0]):null}function Rc(o,i){return o!==i||Je(o)||Je(i)||!o.isToken()||!i.isToken()}function bc(o,i){let l=o.inputType,h=Na(o);l==="deleteCompositionText"||H&&sn(i)||l!=="insertCompositionText"&&Cr(i,()=>{let _=Vt();if(l==="deleteContentBackward"){if(_===null){var N=Nr();if(!Mt(N))return;nn(N.clone())}if(Mt(_)){if(b&&ht(_.anchor.key),ha===229&&o.timeStamp<Ds+30&&i.isComposing()&&_.anchor.key===_.focus.key){if(ht(null),Ds=0,setTimeout(()=>{Cr(i,()=>{ht(null)})},30),Mt(_)){if(N=_.anchor.getNode(),N.markDirty(),_.format=N.getFormat(),!Ct(N))throw Error("Anchor node must be a TextNode");_.style=N.getStyle()}1>=_.anchor.getNode().getTextContent().length&&(o.preventDefault(),at(i,n,!0))}else ht(null),o.preventDefault(),at(i,n,!0);return}}if(Mt(_)){N=o.data,ns!==null&&ot(!1,i,ns),_.dirty&&ns===null||!_.isCollapsed()||er(_.anchor.getNode())||h===null||_.applyDOMRange(h),ns=null;var S=_.focus,X=_.anchor.getNode();if(S=S.getNode(),l==="insertText"||l==="insertTranspose")N===`
|
|
59
|
-
`?(o.preventDefault(),at(i,r,!1)):N===`
|
|
60
|
-
|
|
61
|
-
`?(o.preventDefault(),at(i,c,void 0)):N==null&&o.dataTransfer?(N=o.dataTransfer.getData("text/plain"),o.preventDefault(),_.insertRawText(N)):N!=null&&ma(_,h,N,o.timeStamp,!0)?(o.preventDefault(),at(i,d,N)):ns=N,ga=o.timeStamp;else switch(o.preventDefault(),l){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":at(i,d,o);break;case"insertFromComposition":ht(null),at(i,d,o);break;case"insertLineBreak":ht(null),at(i,r,!1);break;case"insertParagraph":ht(null),Rs&&!_e?(Rs=!1,at(i,r,!1)):at(i,c,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":at(i,g,o);break;case"deleteByComposition":Rc(X,S)&&at(i,y,o);break;case"deleteByDrag":case"deleteByCut":at(i,y,o);break;case"deleteContent":at(i,n,!1);break;case"deleteWordBackward":at(i,E,!0);break;case"deleteWordForward":at(i,E,!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,R,"strikethrough");break;case"formatBold":at(i,R,"bold");break;case"formatItalic":at(i,R,"italic");break;case"formatUnderline":at(i,R,"underline");break;case"historyUndo":at(i,I,void 0);break;case"historyRedo":at(i,k,void 0)}}})}function Ca(o,i){o.stopPropagation(),Cr(i,()=>{var l=Vt(),h=o.data,_=Na(o);if(h!=null&&Mt(l)&&ma(l,_,h,o.timeStamp,!1)){bs&&(yl(i,h),bs=!1);var N=l.anchor,S=N.getNode();if(_=Ur(i._window),_===null)return;let X=N.offset;(N=J&&!l.isCollapsed()&&Ct(S)&&_.anchorNode!==null)&&(S=S.getTextContent().slice(0,X)+h+S.getTextContent().slice(X+l.focus.offset),_=_.anchorNode,N=S===(_.nodeType===3?_.nodeValue:null)),N||at(i,d,h),h=h.length,H&&1<h&&o.inputType==="insertCompositionText"&&!i.isComposing()&&(l.anchor.offset-=h),de||_e||M||!i.isComposing()||(Ds=0,ht(null))}else ot(!1,i,h!==null?h:void 0),bs&&(yl(i,h||void 0),bs=!1);Vn(),l=fn(),en(l)}),ns=null}function Ea(o,i){Cr(i,()=>{let l=Vt();if(Mt(l)&&!i.isComposing()){let h=l.anchor,_=l.anchor.getNode();ht(h.key),(o.timeStamp<Ds+30||h.type==="element"||!l.isCollapsed()||_.getFormat()!==l.format||Ct(_)&&_.getStyle()!==l.style)&&at(i,d,ye)}})}function yl(o,i){var l=o._compositionKey;if(ht(null),l!==null&&i!=null){if(i===""){i=pt(l),o=ze(o.getElementByKey(l)),o!==null&&o.nodeValue!==null&&Ct(i)&&wt(i,o.nodeValue,null,null,!0);return}if(i[i.length-1]===`
|
|
62
|
-
`&&(l=Vt(),Mt(l))){i=l.focus,l.anchor.set(i.key,i.offset,i.type),at(o,G,null);return}}ot(!0,o,i)}function Ic(o,i){H?bs=!0:Cr(i,()=>{yl(i,o.data)})}function kc(o,i){if(Ds=o.timeStamp,ha=o.keyCode,!i.isComposing()){var{keyCode:l,shiftKey:h,ctrlKey:_,metaKey:N,altKey:S}=o;if(!at(i,U,o)){if(l!==39||_||N||S)if(l!==39||S||h||!_&&!N)if(l!==37||_||N||S)if(l!==37||S||h||!_&&!N)if(l!==38||_||N)if(l!==40||_||N)if(l===13&&h)Rs=!0,at(i,G,o);else if(l===32)at(i,q,o);else if(O&&_&&l===79)o.preventDefault(),Rs=!0,at(i,r,!0);else if(l!==13||h){var X=O?S||N?!1:l===8||l===72&&_:_||S||N?!1:l===8;X?l===8?at(i,le,o):(o.preventDefault(),at(i,n,!0)):l===27?at(i,se,o):(X=O?h||S||N?!1:l===46||l===68&&_:_||S||N?!1:l===46,X?l===46?at(i,ge,o):(o.preventDefault(),at(i,n,!1)):l===8&&(O?S:_)?(o.preventDefault(),at(i,E,!0)):l===46&&(O?S:_)?(o.preventDefault(),at(i,E,!1)):O&&N&&l===8?(o.preventDefault(),at(i,T,!0)):O&&N&&l===46?(o.preventDefault(),at(i,T,!1)):l===66&&!S&&(O?N:_)?(o.preventDefault(),at(i,R,"bold")):l===85&&!S&&(O?N:_)?(o.preventDefault(),at(i,R,"underline")):l===73&&!S&&(O?N:_)?(o.preventDefault(),at(i,R,"italic")):l!==9||S||_||N?l===90&&!h&&(O?N:_)?(o.preventDefault(),at(i,I,void 0)):(X=O?l===90&&N&&h:l===89&&_||l===90&&_&&h,X?(o.preventDefault(),at(i,k,void 0)):or(i._editorState._selection)?(X=h?!1:l===67?O?N:_:!1,X?(o.preventDefault(),at(i,Ee,o)):(X=h?!1:l===88?O?N:_:!1,X?(o.preventDefault(),at(i,ue,o)):l===65&&(O?N:_)&&(o.preventDefault(),at(i,$,o)))):!H&&l===65&&(O?N:_)&&(o.preventDefault(),at(i,$,o))):at(i,j,o))}else Rs=!1,at(i,G,o);else at(i,W,o);else at(i,F,o);else at(i,Q,o);else at(i,z,o);else at(i,w,o);else at(i,C,o);(_||h||S||N)&&at(i,ie,o)}}}function Ta(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let rs=new Map;function xa(o){var i=o.target;let l=Ur(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(l!==null){var h=vt(l.anchorNode);if(h!==null){_l&&(_l=!1,Cr(h,()=>{var X=Nr(),he=l.anchorNode;he!==null&&(he=he.nodeType,he===1||he===3)&&(X=zn(X,l,h,o),nn(X))})),i=pe(h),i=i[i.length-1];var _=i._key,N=rs.get(_),S=N||i;S!==h&&ya(l,S,!1),ya(l,h,!0),h!==i?rs.set(_,h):N&&rs.delete(_)}}}function Lc(o,i){Ms===0&&o.ownerDocument.addEventListener("selectionchange",xa),Ms++,o.__lexicalEditor=i;let l=Ta(o);for(let h=0;h<pl.length;h++){let[_,N]=pl[h],S=typeof N=="function"?X=>{X._lexicalHandled!==!0&&(X._lexicalHandled=!0,i.isEditable()&&N(X,i))}:X=>{if(X._lexicalHandled!==!0&&(X._lexicalHandled=!0,i.isEditable()))switch(_){case"cut":return at(i,ue,X);case"copy":return at(i,Ee,X);case"paste":return at(i,g,X);case"dragstart":return at(i,V,X);case"dragover":return at(i,xe,X);case"dragend":return at(i,we,X);case"focus":return at(i,x,X);case"blur":return at(i,Y,X);case"drop":return at(i,B,X)}};o.addEventListener(_,S),l.push(()=>{o.removeEventListener(_,S)})}}function Nl(o,i,l){Vn();var h=o.__key;let _=o.getParent();if(_!==null){var N=Vt();if(Mt(N)&&Je(o)){var{anchor:S,focus:X}=N,he=S.getNode(),De=X.getNode();jn(he,o)&&S.set(o.__key,0,"element"),jn(De,o)&&X.set(o.__key,0,"element")}if(he=N,De=!1,Mt(he)&&i){N=he.anchor;let Ye=he.focus;N.key===h&&(ls(N,o,_,o.getPreviousSibling(),o.getNextSibling()),De=!0),Ye.key===h&&(ls(Ye,o,_,o.getPreviousSibling(),o.getNextSibling()),De=!0)}else or(he)&&i&&o.isSelected()&&o.selectPrevious();Mt(he)&&i&&!De?(h=o.getIndexWithinParent(),Nt(o),Fn(he,_,h,-1)):Nt(o),l||ir(_)||_.canBeEmpty()||!_.isEmpty()||Nl(_,i),i&&er(_)&&_.isEmpty()&&_.selectEnd()}}class Is{static getType(){K(64,this.name)}static clone(){K(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,_t(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=pt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let l=i.getNodes().some(h=>h.__key===this.__key);return Ct(this)?l:Mt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:l}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let l=0;for(;i!==null;){if(this.is(i))return l;l++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:pt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&K(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let l=i.getParent();if(ir(l)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=l}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&K(67,this.__key),i}getParents(){let i=[],l=this.getParent();for(;l!==null;)i.push(l),l=l.getParent();return i}getParentKeys(){let i=[],l=this.getParent();for(;l!==null;)i.push(l.__key),l=l.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:pt(i)}getPreviousSiblings(){let i=[];var l=this.getParent();if(l===null)return i;for(l=l.getFirstChild();l!==null&&!l.is(this);)i.push(l),l=l.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:pt(i)}getNextSiblings(){let i=[],l=this.getNextSibling();for(;l!==null;)i.push(l),l=l.getNextSibling();return i}getCommonAncestor(i){let l=this.getParents();var h=i.getParents();Je(this)&&l.unshift(this),Je(i)&&h.unshift(i),i=l.length;var _=h.length;if(i===0||_===0||l[i-1]!==h[_-1])return null;for(h=new Set(h),_=0;_<i;_++){let N=l[_];if(h.has(N))return N}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 l=this.getCommonAncestor(i);let h=this;for(;;){var _=h.getParentOrThrow();if(_===l){_=h.getIndexWithinParent();break}h=_}for(h=i;;){if(i=h.getParentOrThrow(),i===l){l=h.getIndexWithinParent();break}h=i}return _<l}isParentOf(i){let l=this.__key;if(l===i.__key)return!1;for(;i!==null;){if(i.__key===l)return!0;i=i.getParent()}return!1}getNodesBetween(i){let l=this.isBefore(i),h=[],_=new Set;for(var N=this;;){var S=N.__key;if(_.has(S)||(_.add(S),h.push(N)),N===i)break;if(S=Je(N)?l?N.getFirstChild():N.getLastChild():null,S!==null)N=S;else if(S=l?N.getNextSibling():N.getPreviousSibling(),S!==null)N=S;else{if(N=N.getParentOrThrow(),_.has(N.__key)||h.push(N),N===i)break;S=N;do S===null&&K(68),N=l?S.getNextSibling():S.getPreviousSibling(),S=S.getParent(),S!==null&&(N!==null||_.has(S.__key)||h.push(S));while(N===null)}}return l||h.reverse(),h}isDirty(){let i=fn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=pt(this.__key);return i===null&&K(113),i}getWritable(){Vn();var i=Pr(),l=fn();i=i._nodeMap;let h=this.__key,_=this.getLatest(),N=_.__parent;l=l._cloneNotNeeded;var S=Vt();return Ps(S)&&S.setCachedNodes(null),l.has(h)?(Et(_),_):(S=_.constructor.clone(_),S.__parent=N,S.__next=_.__next,S.__prev=_.__prev,Je(_)&&Je(S)?(S.__first=_.__first,S.__last=_.__last,S.__size=_.__size,S.__indent=_.__indent,S.__format=_.__format,S.__dir=_.__dir):Ct(_)&&Ct(S)&&(S.__format=_.__format,S.__style=_.__style,S.__mode=_.__mode,S.__detail=_.__detail),l.add(h),S.__key=h,Et(S),i.set(h,S),S)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){K(70)}updateDOM(){K(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){K(72)}static importJSON(){K(18,this.name)}static transform(){return null}remove(i){Nl(this,!0,i)}replace(i,l){Vn();var h=Vt();h!==null&&(h=h.clone()),xs(this,i);let _=this.getLatest(),N=this.__key,S=i.__key,X=i.getWritable();i=this.getParentOrThrow().getWritable();let he=i.__size;Nt(X);let De=_.getPreviousSibling(),Ye=_.getNextSibling(),Xe=_.__prev,Ke=_.__next,Pe=_.__parent;if(Nl(_,!1,!0),De===null?i.__first=S:De.getWritable().__next=S,X.__prev=Xe,Ye===null?i.__last=S:Ye.getWritable().__prev=S,X.__next=Ke,X.__parent=Pe,i.__size=he,l){if(!Je(this)||!Je(X))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(gt=>{X.append(gt)})}return Mt(h)&&(nn(h),l=h.anchor,h=h.focus,l.key===N&&ri(l,X),h.key===N&&ri(h,X)),xt()===N&&ht(S),X}insertAfter(i,l=!0){Vn(),xs(this,i);var h=this.getWritable();let _=i.getWritable();var N=_.getParent();let S=Vt();var X=!1,he=!1;if(N!==null){var De=i.getIndexWithinParent();Nt(_),Mt(S)&&(he=N.__key,X=S.anchor,N=S.focus,X=X.type==="element"&&X.key===he&&X.offset===De+1,he=N.type==="element"&&N.key===he&&N.offset===De+1)}N=this.getNextSibling(),De=this.getParentOrThrow().getWritable();let Ye=_.__key,Xe=h.__next;return N===null?De.__last=Ye:N.getWritable().__prev=Ye,De.__size++,h.__next=Ye,_.__next=Xe,_.__prev=h.__key,_.__parent=h.__parent,l&&Mt(S)&&(l=this.getIndexWithinParent(),Fn(S,De,l+1),h=De.__key,X&&S.anchor.set(h,l+2,"element"),he&&S.focus.set(h,l+2,"element")),i}insertBefore(i,l=!0){Vn(),xs(this,i);var h=this.getWritable();let _=i.getWritable(),N=_.__key;Nt(_);let S=this.getPreviousSibling(),X=this.getParentOrThrow().getWritable(),he=h.__prev,De=this.getIndexWithinParent();return S===null?X.__first=N:S.getWritable().__next=N,X.__size++,h.__prev=N,_.__prev=he,_.__next=h.__key,_.__parent=h.__parent,h=Vt(),l&&Mt(h)&&(l=this.getParentOrThrow(),Fn(h,l,De)),i}isParentRequired(){return!1}createParentElementNode(){return Fr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,l){Vn();let h=this.getPreviousSibling(),_=this.getParentOrThrow();return h===null?_.select(0,0):Je(h)?h.select():Ct(h)?h.select(i,l):(i=h.getIndexWithinParent()+1,_.select(i,i))}selectNext(i,l){Vn();let h=this.getNextSibling(),_=this.getParentOrThrow();return h===null?_.select():Je(h)?h.select(0,0):Ct(h)?h.select(i,l):(i=h.getIndexWithinParent(),_.select(i,i))}markDirty(){this.getWritable()}}function Pc(o,i,l){l=l||i.getParentOrThrow().getLastChild();let h=i;for(i=[i];h!==l;){if(!h.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");h=h.getNextSibling(),i.push(h)}for(let _ of i)o=o.insertAfter(_)}class Yr extends Is{static getType(){return"linebreak"}static clone(i){return new Yr(i.__key)}constructor(i){super(i)}getTextContent(){return`
|
|
63
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let l=i.parentElement,h,_;return l!==null&&((h=l.firstChild)===i||h.nextSibling===i&&h.nodeType===3&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((_=l.lastChild)===i||_.previousSibling===i&&_.nodeType===3&&(_.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Sa,priority:0}}}}static importJSON(){return jr()}exportJSON(){return{type:"linebreak",version:1}}}function Sa(){return{node:jr()}}function jr(){return _r(new Yr)}function bi(o){return o instanceof Yr}function Ii(o,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function ho(o,i){return i&1?"strong":i&2?"em":"span"}function Cl(o,i,l,h,_){o=h.classList,h=Bt(_,"base"),h!==void 0&&o.add(...h),h=Bt(_,"underlineStrikethrough");let N=!1,S=i&8&&i&4;var X=l&8&&l&4;h!==void 0&&(X?(N=!0,S||o.add(...h)):S&&o.remove(...h));for(let he in te)X=te[he],h=Bt(_,he),h!==void 0&&(l&X?!N||he!=="underline"&&he!=="strikethrough"?(!(i&X)||S&&he==="underline"||he==="strikethrough")&&o.add(...h):i&X&&o.remove(...h):i&X&&o.remove(...h))}function ki(o,i,l){let h=i.firstChild;if(l=l.isComposing(),o+=l?re:"",h==null)i.textContent=o;else if(i=h.nodeValue,i!==o)if(l||H){l=i.length;let _=o.length,N=0,S=0;for(;N<l&&N<_&&i[N]===o[N];)N++;for(;S+N<l&&S+N<_&&i[l-S-1]===o[_-S-1];)S++;o=[N,l-N-S,o.slice(N,_-S)];let[X,he,De]=o;he!==0&&h.deleteData(X,he),h.insertData(X,De)}else h.nodeValue=o}function is(o,i){return i=document.createElement(i),i.appendChild(o),i}class Li extends Is{static getType(){return"text"}static clone(i){return new Li(i.__text,i.__key)}constructor(i,l){super(l),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 Le[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=te[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,l){let h=this.getLatest().__format;return tt(h,i,l)}createDOM(i){var l=this.__format,h=Ii(this,l);let _=ho(this,l),N=document.createElement(h===null?_:h),S=N;return this.hasFormat("code")&&N.setAttribute("spellcheck","false"),h!==null&&(S=document.createElement(_),N.appendChild(S)),h=S,ki(this.__text,h,this),i=i.theme.text,i!==void 0&&Cl(_,0,l,h,i),l=this.__style,l!==""&&(N.style.cssText=l),N}updateDOM(i,l,h){let _=this.__text;var N=i.__format,S=this.__format,X=Ii(this,N);let he=Ii(this,S);var De=ho(this,N);let Ye=ho(this,S);return(X===null?De:X)!==(he===null?Ye:he)?!0:X===he&&De!==Ye?(N=l.firstChild,N==null&&K(48),i=X=document.createElement(Ye),ki(_,i,this),h=h.theme.text,h!==void 0&&Cl(Ye,0,S,i,h),l.replaceChild(X,N),!1):(De=l,he!==null&&X!==null&&(De=l.firstChild,De==null&&K(49)),ki(_,De,this),h=h.theme.text,h!==void 0&&N!==S&&Cl(Ye,N,S,De,h),S=this.__style,i.__style!==S&&(l.style.cssText=S),!1)}static importDOM(){return{"#text":()=>({conversion:ut,priority:0}),b:()=>({conversion:El,priority:0}),code:()=>({conversion:mi,priority:0}),em:()=>({conversion:mi,priority:0}),i:()=>({conversion:mi,priority:0}),s:()=>({conversion:mi,priority:0}),span:()=>({conversion:va,priority:0}),strong:()=>({conversion:mi,priority:0}),sub:()=>({conversion:mi,priority:0}),sup:()=>({conversion:mi,priority:0}),u:()=>({conversion:mi,priority:0})}}static importJSON(i){let l=Kn(i.text);return l.setFormat(i.format),l.setDetail(i.detail),l.setMode(i.mode),l.setStyle(i.style),l}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&ao(i)||K(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=is(i,"b")),this.hasFormat("italic")&&(i=is(i,"i")),this.hasFormat("strikethrough")&&(i=is(i,"s")),this.hasFormat("underline")&&(i=is(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 l=this.getWritable();return l.__format=typeof i=="string"?te[i]:i,l}setDetail(i){let l=this.getWritable();return l.__detail=typeof i=="string"?ce[i]:i,l}setStyle(i){let l=this.getWritable();return l.__style=i,l}toggleFormat(i){let l=this.getFormat();return i=tt(l,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 l=this.getWritable();return l.__mode=i,l}setTextContent(i){if(this.__text===i)return this;let l=this.getWritable();return l.__text=i,l}select(i,l){Vn();let h=Vt();var _=this.getTextContent();let N=this.__key;if(typeof _=="string"?(_=_.length,i===void 0&&(i=_),l===void 0&&(l=_)):l=i=0,Mt(h))_=xt(),_!==h.anchor.key&&_!==h.focus.key||ht(N),h.setTextNodeRange(this,i,this,l);else return Sl(N,i,N,l,"text","text");return h}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,l,h,_){let N=this.getWritable(),S=N.__text,X=h.length,he=i;0>he&&(he=X+he,0>he&&(he=0));let De=Vt();return _&&Mt(De)&&(i+=X,De.setTextNodeRange(N,i,N,i)),l=S.slice(0,he)+h+S.slice(he+l),N.__text=l,N}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Vn();var l=this.getLatest(),h=l.getTextContent(),_=l.__key,N=xt(),S=new Set(i);i=[];for(var X=h.length,he="",De=0;De<X;De++)he!==""&&S.has(De)&&(i.push(he),he=""),he+=h[De];if(he!==""&&i.push(he),S=i.length,S===0)return[];if(i[0]===h)return[l];var Ye=i[0];h=l.getParentOrThrow(),De=l.getFormat();let Xe=l.getStyle(),Ke=l.__detail;X=!1,l.isSegmented()?(he=Kn(Ye),he.__format=De,he.__style=Xe,he.__detail=Ke,X=!0):(he=l.getWritable(),he.__text=Ye),l=Vt(),he=[he],Ye=Ye.length;for(let Ot=1;Ot<S;Ot++){var Pe=i[Ot],gt=Pe.length;Pe=Kn(Pe).getWritable(),Pe.__format=De,Pe.__style=Xe,Pe.__detail=Ke;let Ft=Pe.__key;if(gt=Ye+gt,Mt(l)){let zt=l.anchor,Un=l.focus;zt.key===_&&zt.type==="text"&&zt.offset>Ye&&zt.offset<=gt&&(zt.key=Ft,zt.offset-=Ye,l.dirty=!0),Un.key===_&&Un.type==="text"&&Un.offset>Ye&&Un.offset<=gt&&(Un.key=Ft,Un.offset-=Ye,l.dirty=!0)}N===_&&ht(Ft),Ye=gt,he.push(Pe)}return _=this.getPreviousSibling(),N=this.getNextSibling(),_!==null&&Et(_),N!==null&&Et(N),_=h.getWritable(),N=this.getIndexWithinParent(),X?(_.splice(N,0,he),this.remove()):_.splice(N,1,he),Mt(l)&&Fn(l,h,N,S-1),he}mergeWithSibling(i){var l=i===this.getPreviousSibling();l||i===this.getNextSibling()||K(50);var h=this.__key;let _=i.__key,N=this.__text,S=N.length;xt()===_&&ht(h);let X=Vt();if(Mt(X)){let he=X.anchor,De=X.focus;he!==null&&he.key===_&&(Fs(he,l,h,i,S),X.dirty=!0),De!==null&&De.key===_&&(Fs(De,l,h,i,S),X.dirty=!0)}return h=i.__text,this.setTextContent(l?h+N:N+h),l=this.getWritable(),i.remove(),l}isTextEntity(){return!1}}function va(o){let i=o.style.fontWeight==="700",l=o.style.textDecoration==="line-through",h=o.style.fontStyle==="italic",_=o.style.textDecoration==="underline",N=o.style.verticalAlign;return{forChild:S=>(Ct(S)&&(i&&S.toggleFormat("bold"),l&&S.toggleFormat("strikethrough"),h&&S.toggleFormat("italic"),_&&S.toggleFormat("underline"),N==="sub"&&S.toggleFormat("subscript"),N==="super"&&S.toggleFormat("superscript")),S),node:null}}function El(o){let i=o.style.fontWeight==="normal";return{forChild:l=>(Ct(l)&&!i&&l.toggleFormat("bold"),l),node:null}}let Tl=new WeakMap;function ut(o){o.parentElement===null&&K(129);for(var i=o.textContent||"",l,h=o.parentNode,_=[o];h!==null&&(l=Tl.get(h))===void 0&&!(h.nodeName==="PRE"||h.nodeType===1&&h.style!==void 0&&h.style.whiteSpace!==void 0&&h.style.whiteSpace.startsWith("pre"));)_.push(h),h=h.parentNode;for(l=l===void 0?h:l,h=0;h<_.length;h++)Tl.set(_[h],l);if(l!==null){for(i=i.split(/(\r?\n|\t)/),o=[],_=i.length,l=0;l<_;l++)h=i[l],h===`
|
|
64
|
-
`||h===`\r
|
|
65
|
-
`?o.push(jr()):h===" "?o.push(Pi()):h!==""&&o.push(Kn(h));return{node:o}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(_=o,l=!0;_!==null&&(_=ks(_,!1))!==null;)if(h=_.textContent||"",0<h.length){/[ \t\n]$/.test(h)&&(i=i.slice(1)),l=!1;break}l&&(i=i.slice(1))}if(i[i.length-1]===" "){for(_=!0;o!==null&&(o=ks(o,!0))!==null;)if(0<(o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){_=!1;break}_&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Kn(i)}}let go=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 ks(o,i){for(;;){for(var l=void 0;(l=i?o.nextSibling:o.previousSibling)===null;)if(o=o.parentElement,o===null)return null;if(o=l,o.nodeType===1&&(l=o.style.display,l===""&&o.nodeName.match(go)===null||l!==""&&!l.startsWith("inline")))return null;for(;(l=i?o.firstChild:o.lastChild)!==null;)o=l;if(o.nodeType===3)return o;if(o.nodeName==="BR")return null}}let po={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function mi(o){let i=po[o.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:l=>(Ct(l)&&!l.hasFormat(i)&&l.toggleFormat(i),l),node:null}}function Kn(o=""){return _r(new Li(o))}function Ct(o){return o instanceof Li}class ss extends Li{static getType(){return"tab"}static clone(i){let l=new ss(i.__key);return l.__text=i.__text,l.__format=i.__format,l.__style=i.__style,l}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let l=Pi();return l.setFormat(i.format),l.setStyle(i.style),l}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){K(126)}setDetail(){K(127)}setMode(){K(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Pi(){return _r(new ss)}function wa(o){return o instanceof ss}class mo{constructor(i,l,h){this._selection=null,this.key=i,this.offset=l,this.type=h}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let l=this.getNode(),h=i.getNode(),_=this.offset;if(i=i.offset,Je(l)){var N=l.getDescendantByIndex(_);l=N??l}return Je(h)&&(N=h.getDescendantByIndex(i),h=N??h),l===h?_<i:l.isBefore(h)}getNode(){let i=pt(this.key);return i===null&&K(20),i}set(i,l,h){let _=this._selection,N=this.key;this.key=i,this.offset=l,this.type=h,cs()||(xt()===N&&ht(i),_!==null&&(_.setCachedNodes(null),_.dirty=!0))}}function Lr(o,i,l){return new mo(o,i,l)}function _o(o,i){let l=i.__key,h=o.offset,_="element";if(Ct(i))_="text",i=i.getTextContentSize(),h>i&&(h=i);else if(!Je(i)){var N=i.getNextSibling();Ct(N)?(l=N.__key,h=0,_="text"):(N=i.getParent())&&(l=N.__key,h=i.getIndexWithinParent()+1)}o.set(l,h,_)}function ri(o,i){if(Je(i)){let l=i.getLastDescendant();Je(l)||Ct(l)?_o(o,l):_o(o,i)}else _o(o,i)}function xl(o,i,l,h){let _=o.getNode(),N=_.getChildAtIndex(o.offset),S=Kn(),X=er(_)?Fr().append(S):S;S.setFormat(l),S.setStyle(h),N===null?_.append(X):N.insertBefore(X),o.is(i)&&i.set(S.__key,0,"text"),o.set(S.__key,0,"text")}function vr(o,i,l,h){o.key=i,o.offset=l,o.type=h}class Ls{constructor(i,l){this.anchor=i,this.focus=l,i._selection=this,l._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Ps(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 No(this)}}class yo{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!or(i))return!1;let l=this._nodes,h=i._nodes;return l.size===h.size&&Array.from(l).every(_=>h.has(_))}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 yo(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let l=this.getNodes(),h=l.length;var _=l[h-1];if(Ct(_))_=_.select();else{let N=_.getIndexWithinParent()+1;_=_.getParentOrThrow().select(N,N)}for(_.insertNodes(i),i=0;i<h;i++)l[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var l=this._nodes;i=[];for(let h of l)l=pt(h),l!==null&&i.push(l);return cs()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),l="";for(let h=0;h<i.length;h++)l+=i[h].getTextContent();return l}}function Mt(o){return o instanceof _i}function Ps(o){return o instanceof Ls}class _i extends Ls{constructor(i,l,h,_){super(i,l),this.format=h,this.style=_}is(i){return Mt(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 l=this.focus,h=i.isBefore(l),_=h?i:l;h=h?l:i,i=_.getNode(),l=h.getNode();let N=_.offset;return _=h.offset,Je(i)&&(h=i.getDescendantByIndex(N),i=h??i),Je(l)&&(h=l.getDescendantByIndex(_),h!==null&&h!==i&&l.getChildAtIndex(_)===h&&(h=h.getPreviousSibling()),l=h??l),i=i.is(l)?Je(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(l),cs()||(this._cachedNodes=i),i}setTextNodeRange(i,l,h,_){vr(this.anchor,i.__key,l,"text"),vr(this.focus,h.__key,_,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let l=i[0],h=i[i.length-1],_=this.anchor,N=this.focus,S=_.isBefore(N),[X,he]=No(this),De="",Ye=!0;for(let Xe=0;Xe<i.length;Xe++){let Ke=i[Xe];if(Je(Ke)&&!Ke.isInline())Ye||(De+=`
|
|
66
|
-
`),Ye=!Ke.isEmpty();else if(Ye=!1,Ct(Ke)){let Pe=Ke.getTextContent();Ke===l?Ke===h?(_.type!=="element"||N.type!=="element"||N.offset===_.offset)&&(Pe=X<he?Pe.slice(X,he):Pe.slice(he,X)):Pe=S?Pe.slice(X):Pe.slice(he):Ke===h&&(Pe=S?Pe.slice(0,he):Pe.slice(0,X)),De+=Pe}else!Cn(Ke)&&!bi(Ke)||Ke===h&&this.isCollapsed()||(De+=Ke.getTextContent())}return De}applyDOMRange(i){let l=fn(),h=l.getEditorState()._selection;if(i=Da(i.startContainer,i.startOffset,i.endContainer,i.endOffset,l,h),i!==null){var[_,N]=i;vr(this.anchor,_.key,_.offset,_.type),vr(this.focus,N.key,N.offset,N.type),this._cachedNodes=null}}clone(){let i=this.anchor,l=this.focus;return new _i(Lr(i.key,i.offset,i.type),Lr(l.key,l.offset,l.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&te[i])!==0}insertRawText(i){i=i.split(/(\r?\n|\t)/);let l=[],h=i.length;for(let _=0;_<h;_++){let N=i[_];N===`
|
|
67
|
-
`||N===`\r
|
|
68
|
-
`?l.push(jr()):N===" "?l.push(Pi()):l.push(Kn(N))}this.insertNodes(l)}insertText(i){var l=this.anchor,h=this.focus,_=this.isCollapsed()||l.isBefore(h),N=this.format,S=this.style;_&&l.type==="element"?xl(l,h,N,S):_||h.type!=="element"||xl(h,l,N,S);var X=this.getNodes(),he=X.length,De=_?h:l;h=(_?l:h).offset;var Ye=De.offset;l=X[0],Ct(l)||K(26),_=l.getTextContent().length;var Xe=l.getParentOrThrow(),Ke=X[he-1];if(this.isCollapsed()&&h===_&&(l.isSegmented()||l.isToken()||!l.canInsertTextAfter()||!Xe.canInsertTextAfter()&&l.getNextSibling()===null)){var Pe=l.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ge(Pe)||(Pe=Kn(),Pe.setFormat(N),Xe.canInsertTextAfter()?l.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),l=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&h===0&&(l.isSegmented()||l.isToken()||!l.canInsertTextBefore()||!Xe.canInsertTextBefore()&&l.getPreviousSibling()===null)){if(Pe=l.getPreviousSibling(),(!Ct(Pe)||Ge(Pe))&&(Pe=Kn(),Pe.setFormat(N),Xe.canInsertTextBefore()?l.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),l=Pe,i!==""){this.insertText(i);return}}else if(l.isSegmented()&&h!==_)Xe=Kn(l.getTextContent()),Xe.setFormat(N),l.replace(Xe),l=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),Co(this.anchor,this.focus,null),this.insertText(i);return}if(he===1)if(l.isToken())i=Kn(i),i.select(),l.replace(i);else{if(X=l.getFormat(),he=l.getStyle(),h===Ye&&(X!==N||he!==S))if(l.getTextContent()==="")l.setFormat(N),l.setStyle(S);else{X=Kn(i),X.setFormat(N),X.setStyle(S),X.select(),h===0?l.insertBefore(X,!1):([he]=l.splitText(h),he.insertAfter(X,!1)),X.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(wa(l)){i=Kn(i),i.setFormat(N),i.setStyle(S),i.select(),l.replace(i);return}l=l.spliceText(h,Ye-h,i,!0),l.getTextContent()===""?l.remove():this.anchor.type==="text"&&(l.isComposing()?this.anchor.offset-=i.length:(this.format=X,this.style=he))}else{if(N=new Set([...l.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(l)?l:l.getParentOrThrow(),S=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(S)&&S.isInline())do Xe=S,S=S.getParentOrThrow();while(S.isInline());if(De.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||De.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var gt=Kn(Ke.getTextContent());Ke.replace(gt),Ke=gt}er(De.getNode())||De.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),N.add(Ke.__key)}else De=Ke.getParentOrThrow(),De.canBeEmpty()||De.getChildrenSize()!==1?Ke.remove():De.remove();else N.add(Ke.__key);for(De=S.getChildren(),Ye=new Set(X),Ke=Pe.is(S),Pe=Pe.isInline()&&l.getNextSibling()===null?Pe:l,gt=De.length-1;0<=gt;gt--){let Ot=De[gt];if(Ot.is(l)||Je(Ot)&&Ot.isParentOf(l))break;Ot.isAttached()&&(!Ye.has(Ot)||Ot.is(Xe)?Ke||Pe.insertAfter(Ot,!1):Ot.remove())}if(!Ke)for(De=S,S=null;De!==null;)Ye=De.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(S))&&(N.delete(De.__key),S=De),De=De.getParent();for(l.isToken()?h===_?l.select():(i=Kn(i),i.select(),l.replace(i)):(l=l.spliceText(h,_-h,i,!0),l.getTextContent()===""?l.remove():l.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<he;i++)l=X[i],N.has(l.__key)||l.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),ht(null);else{var l=this.getNodes(),h=[];for(var _ of l)Ct(_)&&h.push(_);var N=h.length;if(N===0)this.toggleFormat(i),ht(null);else{_=this.anchor;var S=this.focus,X=this.isBackward();l=X?S:_,_=X?_:S;var he=0,De=h[0];if(S=l.type==="element"?0:l.offset,l.type==="text"&&S===De.getTextContentSize()&&(he=1,De=h[1],S=0),De!=null){X=De.getFormatFlags(i,null);var Ye=N-1,Xe=h[Ye];if(N=_.type==="text"?_.offset:Xe.getTextContentSize(),De.is(Xe))S!==N&&(S===0&&N===De.getTextContentSize()?De.setFormat(X):(i=De.splitText(S,N),i=S===0?i[0]:i[1],i.setFormat(X),l.type==="text"&&l.set(i.__key,0,"text"),_.type==="text"&&_.set(i.__key,N-S,"text")),this.format=X);else{S!==0&&([,De]=De.splitText(S),S=0),De.setFormat(X);var Ke=Xe.getFormatFlags(i,X);for(0<N&&(N!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(N)),Xe.setFormat(Ke)),he+=1;he<Ye;he++){let Pe=h[he];if(!Pe.isToken()){let gt=Pe.getFormatFlags(i,Ke);Pe.setFormat(gt)}}l.type==="text"&&l.set(De.__key,S,"text"),_.type==="text"&&_.set(Xe.__key,N,"text"),this.format=X|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var l=Vt();if(!Mt(l))throw Error("Expected RangeSelection after insertParagraph");return l.insertNodes(i)}var h=Ss(this.anchor.getNode(),es);if(l=i[i.length-1],"__language"in h&&Je(h))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var _=Hs(this);h.splice(_,0,i),l.selectEnd()}else if(i.some(X=>(Je(X)||Cn(X))&&!X.isInline())){l=Fi(i),i=l.getLastDescendant();var N=l.getChildren();l=Je(h)&&h.isEmpty()?null:this.insertParagraph(),_=N[N.length-1];var S=N[0];if((X=>Je(X)&&es(X)&&!X.isEmpty()&&Je(h)&&(!h.isEmpty()||"__value"in h&&"__checked"in h))(S)){if(!Je(h))throw Error("Expected 'firstBlock' to be an ElementNode");h.append(...S.getChildren()),S=N[1]}S&&Pc(h,S),N=Ss(i,es),l&&Je(N)&&("__value"in l&&"__checked"in l||es(_))&&(N.append(...l.getChildren()),l.remove()),Je(h)&&h.isEmpty()&&h.remove(),i.selectEnd(),i=Je(h)?h.getLastChild():null,bi(i)&&N!==h&&i.remove()}else{if(!Je(h))throw Error("Expected 'firstBlock' to be an ElementNode");_=Hs(this),h.splice(_,0,i),l.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Fr();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var l=Hs(this);if(i=Ss(this.anchor.getNode(),es),!Je(i))throw Error("Expected ancestor to be an ElementNode");return l=(l=i.getChildAtIndex(l))?[l,...l.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...l),i.selectStart(),i):null}insertLineBreak(i){var l=jr();this.insertNodes([l]),i&&(i=l.getParentOrThrow(),l=l.getIndexWithinParent(),i.select(l,l))}extract(){var i=this.getNodes(),l=i.length,h=l-1,_=this.anchor;let N=this.focus;var S=i[0];let X=i[h],[he,De]=No(this);return l===0?[]:l===1?Ct(S)&&!this.isCollapsed()?(i=he>De?De:he,h=S.splitText(i,he>De?he:De),i=i===0?h[0]:h[1],i!=null?[i]:[]):[S]:(l=_.isBefore(N),Ct(S)&&(_=l?he:De,_===S.getTextContentSize()?i.shift():_!==0&&([,S]=S.splitText(_),i[0]=S)),Ct(X)&&(S=X.getTextContent().length,l=l?De:he,l===0?i.pop():l!==S&&([X]=X.splitText(l),i[h]=X)),i)}modify(i,l,h){var _=this.focus,N=this.anchor,S=i==="move",X=Ht(_,l);if(Cn(X)&&!X.isIsolated())S&&X.isKeyboardSelectable()?(l=vl(),l.add(X.__key),nn(l)):(i=l?X.getPreviousSibling():X.getNextSibling(),Ct(i)?(X=i.__key,l=l?i.getTextContent().length:0,_.set(X,l,"text"),S&&N.set(X,l,"text")):(h=X.getParentOrThrow(),Je(i)?(h=i.__key,X=l?i.getChildrenSize():0):(X=X.getIndexWithinParent(),h=h.__key,l||X++),_.set(h,X,"element"),S&&N.set(h,X,"element")));else if(N=fn(),_=Ur(N._window)){var he=N._blockCursorElement,De=N._rootElement;if(De===null||he===null||!Je(X)||X.isInline()||X.canBeEmpty()||ol(he,N,De),_.modify(i,l?"backward":"forward",h),0<_.rangeCount&&(X=_.getRangeAt(0),N=this.anchor.getNode(),N=er(N)?N:rr(N),this.applyDOMRange(X),this.dirty=!0,!S)){for(S=this.getNodes(),i=[],h=!1,he=0;he<S.length;he++)De=S[he],jn(De,N)?i.push(De):h=!0;h&&0<i.length&&(l?(l=i[0],Je(l)?l.selectStart():l.getParentOrThrow().selectStart()):(l=i[i.length-1],Je(l)?l.selectEnd():l.getParentOrThrow().selectEnd())),(_.anchorNode!==X.startContainer||_.anchorOffset!==X.startOffset)&&(l=this.focus,S=this.anchor,_=S.key,X=S.offset,N=S.type,vr(S,l.key,l.offset,l.type),vr(l,_,X,N),this._cachedNodes=null)}}}deleteCharacter(i){let l=this.isCollapsed();if(this.isCollapsed()){var h=this.anchor,_=this.focus,N=h.getNode();if(!i&&(h.type==="element"&&Je(N)&&h.offset===N.getChildrenSize()||h.type==="text"&&h.offset===N.getTextContentSize())){var S=N.getParent();if(S=N.getNextSibling()||(S===null?null:S.getNextSibling()),Je(S)&&S.isShadowRoot())return}if(S=Ht(_,i),Cn(S)&&!S.isIsolated()){S.isKeyboardSelectable()&&Je(N)&&N.getChildrenSize()===0?(N.remove(),i=vl(),i.add(S.__key),nn(i)):(S.remove(),fn().dispatchCommand(e,void 0));return}if(!i&&Je(S)&&Je(N)&&N.isEmpty()){N.remove(),S.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(S=_.type==="text"?_.getNode():null,N=h.type==="text"?h.getNode():null,S!==null&&S.isSegmented()){if(h=_.offset,_=S.getTextContentSize(),S.is(N)||i&&h!==_||!i&&h!==0){Aa(S,i,h);return}}else if(N!==null&&N.isSegmented()&&(h=h.offset,_=N.getTextContentSize(),N.is(S)||i&&h!==0||!i&&h!==_)){Aa(N,i,h);return}if(N=this.anchor,S=this.focus,h=N.getNode(),_=S.getNode(),h===_&&N.type==="text"&&S.type==="text"){var X=N.offset,he=S.offset;let De=X<he;_=De?X:he,he=De?he:X,X=he-1,_!==X&&(h=h.getTextContent().slice(_,he),pi(h)||(i?S.offset=X:N.offset=X))}}}this.removeText(),i&&!l&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&er(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 or(o){return o instanceof yo}function Oa(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function No(o){let i=o.anchor;return o=o.focus,i.type==="element"&&o.type==="element"&&i.key===o.key&&i.offset===o.offset?[0,0]:[Oa(i),Oa(o)]}function Aa(o,i,l){let h=o.getTextContent().split(/(?=\s)/g),_=h.length,N=0,S=0;for(let X=0;X<_;X++){let he=h[X],De=X===_-1;if(S=N,N+=he.length,i&&N===l||N>l||De){h.splice(X,1),De&&(S=void 0);break}}i=h.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(S,S))}function $s(o,i,l,h){var _=i;if(o.nodeType===1){let X=!1;var N=o.childNodes,S=N.length;_===S&&(X=!0,_=S-1);let he=N[_];if(S=!1,he===h._blockCursorElement?(he=N[_+1],S=!0):h._blockCursorElement!==null&&_--,h=Sr(he),Ct(h))_=X?h.getTextContentSize():0;else{if(N=Sr(o),N===null)return null;if(Je(N)?(o=N.getChildAtIndex(_),(i=Je(o))&&(i=o.getParent(),i=l===null||i===null||!i.canBeEmpty()||i!==l.getNode()),i&&(l=X?o.getLastDescendant():o.getFirstDescendant(),l===null?(N=o,_=0):(o=l,N=Je(o)?o:o.getParentOrThrow())),Ct(o)?(h=o,N=null,_=X?o.getTextContentSize():0):o!==N&&X&&!S&&_++):(_=N.getIndexWithinParent(),_=i===0&&Cn(N)&&Sr(o)===N?_:_+1,N=N.getParentOrThrow()),Je(N))return Lr(N.__key,_,"element")}}else h=Sr(o);return Ct(h)?Lr(h.__key,_,"text"):null}function $i(o,i,l){var h=o.offset,_=o.getNode();h===0?(h=_.getPreviousSibling(),_=_.getParent(),i?(l||!i)&&h===null&&Je(_)&&_.isInline()&&(i=_.getPreviousSibling(),Ct(i)&&(o.key=i.__key,o.offset=i.getTextContent().length)):Je(h)&&!l&&h.isInline()?(o.key=h.__key,o.offset=h.getChildrenSize(),o.type="element"):Ct(h)&&(o.key=h.__key,o.offset=h.getTextContent().length)):h===_.getTextContent().length&&(h=_.getNextSibling(),_=_.getParent(),i&&Je(h)&&h.isInline()?(o.key=h.__key,o.offset=0,o.type="element"):(l||i)&&h===null&&Je(_)&&_.isInline()&&!_.canInsertTextAfter()&&(i=_.getNextSibling(),Ct(i)&&(o.key=i.__key,o.offset=0)))}function Co(o,i,l){if(o.type==="text"&&i.type==="text"){var h=o.isBefore(i);let _=o.is(i);$i(o,h,_),$i(i,!h,_),_&&(i.key=o.key,i.offset=o.offset,i.type=o.type),h=fn(),h.isComposing()&&h._compositionKey!==o.key&&Mt(l)&&(h=l.anchor,l=l.focus,vr(o,h.key,h.offset,h.type),vr(i,l.key,l.offset,l.type))}}function Da(o,i,l,h,_,N){return o===null||l===null||!st(_,o,l)||(i=$s(o,i,Mt(N)?N.anchor:null,_),i===null)||(h=$s(l,h,Mt(N)?N.focus:null,_),h===null||i.type==="element"&&h.type==="element"&&(o=Sr(o),l=Sr(l),Cn(o)&&Cn(l)))?null:(Co(i,h,N),[i,h])}function Sl(o,i,l,h,_,N){let S=Pr();return o=new _i(Lr(o,i,_),Lr(l,h,N),0,""),o.dirty=!0,S._selection=o}function vl(){return new yo(new Set)}function In(o){let i=o.getEditorState()._selection,l=Ur(o._window);return Mt(i)||i==null?zn(i,l,o,null):i.clone()}function zn(o,i,l,h){var _=l._window;if(_===null)return null;var N=(_=h||_.event)?_.type:void 0;h=N==="selectionchange",_=!Fe&&(h||N==="beforeinput"||N==="compositionstart"||N==="compositionend"||N==="click"&&_&&_.detail===3||N==="drop"||N===void 0);let S;if(!Mt(o)||_){if(i===null)return null;if(_=i.anchorNode,N=i.focusNode,S=i.anchorOffset,i=i.focusOffset,h&&Mt(o)&&!st(l,_,N))return o.clone()}else return o.clone();if(l=Da(_,S,N,i,l,o),l===null)return null;let[X,he]=l;return new _i(X,he,Mt(o)?o.format:0,Mt(o)?o.style:"")}function Vt(){return Pr()._selection}function Nr(){return fn()._editorState._selection}function Fn(o,i,l,h=1){var _=o.anchor,N=o.focus,S=_.getNode(),X=N.getNode();if(i.is(S)||i.is(X)){if(S=i.__key,o.isCollapsed())i=_.offset,(l<=i&&0<h||l<i&&0>h)&&(l=Math.max(0,i+h),_.set(S,l,"element"),N.set(S,l,"element"),os(o));else{let De=o.isBackward();X=De?N:_;var he=X.getNode();_=De?_:N,N=_.getNode(),i.is(he)&&(he=X.offset,(l<=he&&0<h||l<he&&0>h)&&X.set(S,Math.max(0,he+h),"element")),i.is(N)&&(i=_.offset,(l<=i&&0<h||l<i&&0>h)&&_.set(S,Math.max(0,i+h),"element"))}os(o)}}function os(o){var i=o.anchor,l=i.offset;let h=o.focus;var _=h.offset,N=i.getNode(),S=h.getNode();if(o.isCollapsed())Je(N)&&(S=N.getChildrenSize(),S=(_=l>=S)?N.getChildAtIndex(S-1):N.getChildAtIndex(l),Ct(S)&&(l=0,_&&(l=S.getTextContentSize()),i.set(S.__key,l,"text"),h.set(S.__key,l,"text")));else{if(Je(N)){let X=N.getChildrenSize();l=(o=l>=X)?N.getChildAtIndex(X-1):N.getChildAtIndex(l),Ct(l)&&(N=0,o&&(N=l.getTextContentSize()),i.set(l.__key,N,"text"))}Je(S)&&(l=S.getChildrenSize(),_=(i=_>=l)?S.getChildAtIndex(l-1):S.getChildAtIndex(_),Ct(_)&&(S=0,i&&(S=_.getTextContentSize()),h.set(_.__key,S,"text")))}}function Ma(o,i){if(i=i.getEditorState()._selection,o=o._selection,Mt(o)){var l=o.anchor;let h=o.focus,_;l.type==="text"&&(_=l.getNode(),_.selectionTransform(i,o)),h.type==="text"&&(l=h.getNode(),_!==l&&l.selectionTransform(i,o))}}function ls(o,i,l,h,_){let N=null,S=0,X=null;h!==null?(N=h.__key,Ct(h)?(S=h.getTextContentSize(),X="text"):Je(h)&&(S=h.getChildrenSize(),X="element")):_!==null&&(N=_.__key,Ct(_)?X="text":Je(_)&&(X="element")),N!==null&&X!==null?o.set(N,S,X):(S=i.getIndexWithinParent(),S===-1&&(S=l.getChildrenSize()),o.set(l.__key,S,"element"))}function Fs(o,i,l,h,_){o.type==="text"?(o.key=l,i||(o.offset+=_)):o.offset>h.getIndexWithinParent()&&--o.offset}function Bs(o){o instanceof vo||(o instanceof Is?(o=da(o,zi),zi(o)||K(114)):(o=da(o.getNode(),zi),zi(o)||K(114)));let i=o.getParent();kl(i)||K(115);let l=i.getParent();return Il(l)||K(116),[o,i,l]}function Hs(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!es(o);)[o,i]=wl(o,i);return i}function wl(o,i){var l=o.getParent();if(!l)return l=Fr(),bt().append(l),l.select(),[bt(),0];if(Ct(o)){var h=o.splitText(i);return h.length===0?[l,o.getIndexWithinParent()]:(o=i===0?0:1,o=h[0].getIndexWithinParent()+o,[l,o])}return!Je(o)||i===0?[l,o.getIndexWithinParent()]:((h=o.getChildAtIndex(i))&&(i=new _i(Lr(o.__key,i,"element"),Lr(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(h,...h.getNextSiblings())),[l,o.getIndexWithinParent()+1])}function Fi(o){let i=Fr(),l=null;for(let h=0;h<o.length;h++){let _=o[h],N=bi(_);if(N||Cn(_)&&_.isInline()||Je(_)&&_.isInline()||Ct(_)||_.isParentRequired()){if(l===null&&(l=_.createParentElementNode(),i.append(l),N))continue;l!==null&&l.append(_)}else i.append(_),l=null}return i}let hn=null,wn=null,Bn=!1,as=!1,Bi=0,yi={characterData:!0,childList:!0,subtree:!0};function cs(){return Bn||hn!==null&&hn._readOnly}function Vn(){Bn&&K(13)}function Pr(){return hn===null&&K(15),hn}function fn(){return wn===null&&K(16),wn}function Ra(o,i,l){var h=i.__type;let _=o._nodes.get(h);for(_===void 0&&K(30,h),o=l.get(h),o===void 0&&(o=Array.from(_.transforms),l.set(h,o)),l=o.length,h=0;h<l&&(o[h](i),i.isAttached());h++);}function Ol(o,i){i=i._dirtyLeaves,o=o._nodeMap;for(let l of i)i=o.get(l),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&Se(i)}function ba(o,i){let l=i._dirtyLeaves,h=i._dirtyElements;o=o._nodeMap;let _=xt(),N=new Map;var S=l;let X=S.size;for(var he=h,De=he.size;0<X||0<De;){if(0<X){i._dirtyLeaves=new Set;for(let Ye of S)S=o.get(Ye),Ct(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&Se(S),S!==void 0&&S!==void 0&&S.__key!==_&&S.isAttached()&&Ra(i,S,N),l.add(Ye);if(S=i._dirtyLeaves,X=S.size,0<X){Bi++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of he)he=Ye[0],De=Ye[1],(he==="root"||De)&&(S=o.get(he),S!==void 0&&S!==void 0&&S.__key!==_&&S.isAttached()&&Ra(i,S,N),h.set(he,De));S=i._dirtyLeaves,X=S.size,he=i._dirtyElements,De=he.size,Bi++}i._dirtyLeaves=l,i._dirtyElements=h}function Eo(o,i){var l=o.type,h=i.get(l);if(h===void 0&&K(17,l),l=h.klass,o.type!==l.getType()&&K(18,l.name),l=l.importJSON(o),o=o.children,Je(l)&&Array.isArray(o))for(h=0;h<o.length;h++){let _=Eo(o[h],i);l.append(_)}return l}function Al(o,i){let l=hn,h=Bn,_=wn;hn=o,Bn=!0,wn=null;try{return i()}finally{hn=l,Bn=h,wn=_}}function Hi(o,i){let l=o._pendingEditorState,h=o._rootElement,_=o._headless||h===null;if(l!==null){var N=o._editorState,S=N._selection,X=l._selection,he=o._dirtyType!==0,De=hn,Ye=Bn,Xe=wn,Ke=o._updating,Pe=o._observer,gt=null;if(o._pendingEditorState=null,o._editorState=l,!_&&he&&Pe!==null){wn=o,hn=l,Bn=!1,o._updating=!0;try{let pn=o._dirtyType,qn=o._dirtyElements,En=o._dirtyLeaves;Pe.disconnect();var Ot=pn,Ft=qn,zt=En;Wn=ti=bn="",al=Ot===2,Ai=null,$n=o,Ir=o._config,vs=o._nodes,Gr=$n._listeners.mutation,ul=Ft,xn=zt,sr=N._nodeMap,Nn=l._nodeMap,cl=l._readOnly,co=new Map(o._keyToDOMMap);let Dr=new Map;ni=Dr,Ri("root",null),ni=co=Ir=Nn=sr=xn=ul=vs=$n=void 0,gt=Dr}catch(pn){if(pn instanceof Error&&o._onError(pn),as)throw pn;So(o,null,h,l),Oe(o),o._dirtyType=2,as=!0,Hi(o,N),as=!1;return}finally{Pe.observe(h,yi),o._updating=Ke,hn=De,Bn=Ye,wn=Xe}}l._readOnly||(l._readOnly=!0);var Un=o._dirtyLeaves,wr=o._dirtyElements,ii=o._normalizedNodes,si=o._updateTags,Ll=o._deferred;he&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set);var Ui=o._decorators,wo=o._pendingDecorators||Ui,ds=l._nodeMap,oi;for(oi in wo)ds.has(oi)||(wo===Ui&&(wo=tn(o)),delete wo[oi]);var Or=_?null:Ur(o._window);if(o._editable&&Or!==null&&(he||X===null||X.dirty)){wn=o,hn=l;try{if(Pe!==null&&Pe.disconnect(),he||X===null||X.dirty){let pn=o._blockCursorElement;pn!==null&&ol(pn,o,h);e:{let qn=Or.anchorNode,En=Or.focusNode,Dr=Or.anchorOffset,Ci=Or.focusOffset,Tt=document.activeElement;if(!(si.has("collaboration")&&Tt!==h||Tt!==null&&it(Tt)))if(Mt(X)){var Gi=X.anchor,Oo=X.focus,ka=Gi.key,La=Oo.key,Pl=Rn(o,ka),Gs=Rn(o,La),Vr=Gi.offset,Pa=Oo.offset,$l=X.format,Ao=X.style,$a=X.isCollapsed(),Ys=Pl,Do=Gs,Fl=!1;if(Gi.type==="text"){Ys=ze(Pl);let ar=Gi.getNode();Fl=ar.getFormat()!==$l||ar.getStyle()!==Ao}else Mt(S)&&S.anchor.type==="text"&&(Fl=!0);if(Oo.type==="text"&&(Do=ze(Gs)),Ys!==null&&Do!==null){if($a&&(S===null||Fl||Mt(S)&&(S.format!==$l||S.style!==Ao))){var Fa=performance.now();pa=[$l,Ao,Vr,ka,Fa]}if(Dr===Vr&&Ci===Pa&&qn===Ys&&En===Do&&(Or.type!=="Range"||!$a)&&(Tt!==null&&h.contains(Tt)||h.focus({preventScroll:!0}),Gi.type!=="element"))break e;try{Or.setBaseAndExtent(Ys,Vr,Do,Pa)}catch{}if(!si.has("skip-scroll-into-view")&&X.isCollapsed()&&h!==null&&h===document.activeElement){let ar=X instanceof _i&&X.anchor.type==="element"?Ys.childNodes[Vr]||null:0<Or.rangeCount?Or.getRangeAt(0):null;if(ar!==null){let Mr;if(ar instanceof Text){let cr=document.createRange();cr.selectNode(ar),Mr=cr.getBoundingClientRect()}else Mr=ar.getBoundingClientRect();let tr=h.ownerDocument,Br=tr.defaultView;if(Br!==null)for(var{top:Bl,bottom:qr}=Mr,On,mt,Er=h;Er!==null;){let cr=Er===tr.body;if(cr)On=0,mt=dn(o).innerHeight;else{let Io=Er.getBoundingClientRect();On=Io.top,mt=Io.bottom}let li=0;if(Bl<On?li=-(On-Bl):qr>mt&&(li=qr-mt),li!==0)if(cr)Br.scrollBy(0,li);else{let Io=Er.scrollTop;Er.scrollTop+=li;let Ba=Er.scrollTop-Io;Bl-=Ba,qr-=Ba}if(cr)break;Er=mr(Er)}}}ml=!0}}else S!==null&&st(o,qn,En)&&Or.removeAllRanges()}}e:{let pn=o._blockCursorElement;if(Mt(X)&&X.isCollapsed()&&X.anchor.type==="element"&&h.contains(document.activeElement)){let qn=X.anchor,En=qn.getNode(),Dr=qn.offset,Ci=En.getChildrenSize(),Tt=!1,ar=null;if(Dr===Ci){let Mr=En.getChildAtIndex(Dr-1);lo(Mr)&&(Tt=!0)}else{let Mr=En.getChildAtIndex(Dr);if(lo(Mr)){let tr=Mr.getPreviousSibling();(tr===null||lo(tr))&&(Tt=!0,ar=o.getElementByKey(Mr.__key))}}if(Tt){let Mr=o.getElementByKey(En.__key);if(pn===null){let tr=o._config.theme,Br=document.createElement("div");Br.contentEditable="false",Br.setAttribute("data-lexical-cursor","true");let cr=tr.blockCursor;if(cr!==void 0){if(typeof cr=="string"){let li=cr.split(" ");cr=tr.blockCursor=li}cr!==void 0&&Br.classList.add(...cr)}o._blockCursorElement=pn=Br}h.style.caretColor="transparent",ar===null?Mr.appendChild(pn):Mr.insertBefore(pn,ar);break e}}pn!==null&&ol(pn,o,h)}Pe!==null&&Pe.observe(h,yi)}finally{wn=Xe,hn=De}}if(gt!==null){var Mo=gt;let pn=Array.from(o._listeners.mutation),qn=pn.length;for(let En=0;En<qn;En++){let[Dr,Ci]=pn[En],Tt=Mo.get(Ci);Tt!==void 0&&Dr(Tt,{dirtyLeaves:Un,prevEditorState:N,updateTags:si})}}Mt(X)||X===null||S!==null&&S.is(X)||o.dispatchCommand(e,void 0);var Ro=o._pendingDecorators;Ro!==null&&(o._decorators=Ro,o._pendingDecorators=null,Ni("decorator",o,!0,Ro));var $c=kt(i||N),Ar=kt(l);if($c!==Ar&&Ni("textcontent",o,!0,Ar),Ni("update",o,!0,{dirtyElements:wr,dirtyLeaves:Un,editorState:l,normalizedNodes:ii,prevEditorState:i||N,tags:si}),o._deferred=[],Ll.length!==0){let pn=o._updating;o._updating=!0;try{for(let qn=0;qn<Ll.length;qn++)Ll[qn]()}finally{o._updating=pn}}var bo=o._updates;if(bo.length!==0){let pn=bo.shift();if(pn){let[qn,En]=pn;Dl(o,qn,En)}}}}function Ni(o,i,l,...h){let _=i._updating;i._updating=l;try{let N=Array.from(i._listeners[o]);for(o=0;o<N.length;o++)N[o].apply(null,h)}finally{i._updating=_}}function at(o,i,l){if(o._updating===!1||wn!==o){let N=!1;return o.update(()=>{N=at(o,i,l)}),N}let h=pe(o);for(let N=4;0<=N;N--)for(let S=0;S<h.length;S++){var _=h[S]._commands.get(i);if(_!==void 0&&(_=_[N],_!==void 0)){_=Array.from(_);let X=_.length;for(let he=0;he<X;he++)if(_[he](l,o)===!0)return!0}}return!1}function us(o,i){let l=o._updates;for(i=i||!1;l.length!==0;){var h=l.shift();if(h){let[_,N]=h,S;N!==void 0&&(h=N.onUpdate,S=N.tag,N.skipTransforms&&(i=!0),h&&o._deferred.push(h),S&&o._updateTags.add(S)),_()}}return i}function Dl(o,i,l){let h=o._updateTags;var _,N=_=!1;if(l!==void 0){var S=l.onUpdate;_=l.tag,_!=null&&h.add(_),_=l.skipTransforms||!1,N=l.discrete||!1}S&&o._deferred.push(S),l=o._editorState,S=o._pendingEditorState;let X=!1;(S===null||S._readOnly)&&(S=o._pendingEditorState=new Ws(new Map((S||l)._nodeMap)),X=!0),S._flushSync=N,N=hn;let he=Bn,De=wn,Ye=o._updating;hn=S,Bn=!1,o._updating=!0,wn=o;try{X&&(o._headless?l._selection!=null&&(S._selection=l._selection.clone()):S._selection=In(o));let Xe=o._compositionKey;i(),_=us(o,_),Ma(S,o),o._dirtyType!==0&&(_?Ol(S,o):ba(S,o),us(o),ll(l,S,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(S._flushSync=!0);let Ke=S._selection;if(Mt(Ke)){let Pe=S._nodeMap,gt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(gt)!==void 0||K(19)}else or(Ke)&&Ke._nodes.size===0&&(S._selection=null)}catch(Xe){Xe instanceof Error&&o._onError(Xe),o._pendingEditorState=l,o._dirtyType=2,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),Hi(o);return}finally{hn=N,Bn=he,wn=De,o._updating=Ye,Bi=0}o._dirtyType!==0||Ml(S,o)?S._flushSync?(S._flushSync=!1,Hi(o)):X&&rt(()=>{Hi(o)}):(S._flushSync=!1,X&&(h.clear(),o._deferred=[],o._pendingEditorState=null))}function Cr(o,i,l){o._updating?o._updates.push([i,l]):Dl(o,i,l)}class To extends Is{constructor(i){super(i)}decorate(){K(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Cn(o){return o instanceof To}class Wi extends Is{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=[],l=this.getFirstChild();for(;l!==null;)i.push(l),l=l.getNextSibling();return i}getChildrenKeys(){let i=[],l=this.getFirstChild();for(;l!==null;)i.push(l.__key),l=l.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=fn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),l=this.getParentOrThrow().getLastChild();return l!==null&&l.is(i)}getAllTextNodes(){let i=[],l=this.getFirstChild();for(;l!==null;){if(Ct(l)&&i.push(l),Je(l)){let h=l.getAllTextNodes();i.push(...h)}l=l.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let l=i.getFirstChild();if(l!==null){i=l;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let l=i.getLastChild();if(l!==null){i=l;continue}}break}return i}getDescendantByIndex(i){let l=this.getChildren(),h=l.length;return i>=h?(i=l[h-1],Je(i)&&i.getLastDescendant()||i||null):(i=l[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:pt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&K(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:pt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&K(96,this.__key),i}getChildAtIndex(i){var l=this.getChildrenSize();let h;if(i<l/2){for(h=this.getFirstChild(),l=0;h!==null&&l<=i;){if(l===i)return h;h=h.getNextSibling(),l++}return null}for(h=this.getLastChild(),--l;h!==null&&l>=i;){if(l===i)return h;h=h.getPreviousSibling(),l--}return null}getTextContent(){let i="",l=this.getChildren(),h=l.length;for(let _=0;_<h;_++){let N=l[_];i+=N.getTextContent(),Je(N)&&_!==h-1&&!N.isInline()&&(i+=`
|
|
69
|
-
|
|
70
|
-
`)}return i}getTextContentSize(){let i=0,l=this.getChildren(),h=l.length;for(let _=0;_<h;_++){let N=l[_];i+=N.getTextContentSize(),Je(N)&&_!==h-1&&!N.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,l){Vn();let h=Vt(),_=i,N=l;var S=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&l===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==S||l!==void 0&&l!==S)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(_===void 0&&(_=S),N===void 0&&(N=S),S=this.__key,Mt(h))h.anchor.set(S,_,"element"),h.focus.set(S,N,"element"),h.dirty=!0;else return Sl(S,_,S,N,"element","element");return h}selectStart(){let i=this.getFirstDescendant();return i?i.selectStart():this.select()}selectEnd(){let i=this.getLastDescendant();return i?i.selectEnd():this.select()}clear(){let i=this.getWritable();return this.getChildren().forEach(l=>l.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let l=this.getWritable();return l.__dir=i,l}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,l,h){let _=h.length,N=this.getChildrenSize(),S=this.getWritable(),X=S.__key;var he=[],De=[];let Ye=this.getChildAtIndex(i+l),Xe=null,Ke=N-l+_;if(i!==0)if(i===N)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<l){var gt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<l;Pe++){gt===null&&K(100);var Ot=gt.getNextSibling(),Ft=gt.__key;gt=gt.getWritable(),Nt(gt),De.push(Ft),gt=Ot}}for(Pe=Xe,Ot=0;Ot<_;Ot++){Ft=h[Ot],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),gt=Ft.getWritable(),gt.__parent===X&&Ke--,Nt(gt);let zt=Ft.__key;Pe===null?(S.__first=zt,gt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=zt,gt.__prev=Pe.__key),Ft.__key===X&&K(76),gt.__parent=X,he.push(zt),Pe=Ft}if(i+l===N?Pe!==null&&(Pe.getWritable().__next=null,S.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(l=Pe.getWritable(),i.__prev=Pe.__key,l.__next=Ye.__key):i.__prev=null),S.__size=Ke,De.length&&(i=Vt(),Mt(i))){De=new Set(De),he=new Set(he);let{anchor:zt,focus:Un}=i;xo(zt,De,he)&&ls(zt,zt.getNode(),this,Xe,Ye),xo(Un,De,he)&&ls(Un,Un.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||ir(this)||this.remove()}return S}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(o){return o instanceof Wi}function xo(o,i,l){for(o=o.getNode();o;){let h=o.__key;if(i.has(h)&&!l.has(h))return!0;o=o.getParent()}return!1}class lr extends Wi{static getType(){return"root"}static clone(){return new lr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){K(51)}getTextContent(){let i=this.__cachedText;return!cs()&&fn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){K(52)}replace(){K(53)}insertBefore(){K(54)}insertAfter(){K(55)}updateDOM(){return!1}append(...i){for(let l=0;l<i.length;l++){let h=i[l];Je(h)||Cn(h)||K(56)}return super.append(...i)}static importJSON(i){let l=bt();return l.setFormat(i.format),l.setIndent(i.indent),l.setDirection(i.direction),l}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function er(o){return o instanceof lr}function Ml(o,i){if(i=i.getEditorState()._selection,o=o._selection,o!==null){if(o.dirty||!o.is(i))return!0}else if(i!==null)return!0;return!1}function Ki(){return new Ws(new Map([["root",new lr]]))}function Rl(o){let i=o.exportJSON();var l=o.constructor;if(i.type!==l.getType()&&K(130,l.name),Je(o)){let h=i.children;for(Array.isArray(h)||K(59,l.name),o=o.getChildren(),l=0;l<o.length;l++){let _=Rl(o[l]);h.push(_)}}return i}class Ws{constructor(i,l){this._nodeMap=i,this._selection=l||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Al(this,i)}clone(i){return i=new Ws(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Al(this,()=>({root:Rl(bt())}))}}class $r extends Wi{static getType(){return"paragraph"}static clone(i){return new $r(i.__key)}createDOM(i){let l=document.createElement("p");return i=Bt(i.theme,"paragraph"),i!==void 0&&l.classList.add(...i),l}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Ks,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&ao(i)){this.isEmpty()&&i.append(document.createElement("br"));var l=this.getFormatType();i.style.textAlign=l,(l=this.getDirection())&&(i.dir=l),l=this.getIndent(),0<l&&(i.style.textIndent=`${20*l}px`)}return{element:i}}static importJSON(i){let l=Fr();return l.setFormat(i.format),l.setIndent(i.indent),l.setDirection(i.direction),l}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,l){i=Fr();let h=this.getDirection();return i.setDirection(h),this.insertAfter(i,l),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 Ks(o){let i=Fr();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Fr(){return _r(new $r)}function So(o,i,l,h){let _=o._keyToDOMMap;_.clear(),o._editorState=Ki(),o._pendingEditorState=h,o._compositionKey=null,o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),o._normalizedNodes=new Set,o._updateTags=new Set,o._updates=[],o._blockCursorElement=null,h=o._observer,h!==null&&(h.disconnect(),o._observer=null),i!==null&&(i.textContent=""),l!==null&&(l.textContent="",_.set("root",l))}function zs(o,i){let l=new Map,h=new Set,_=N=>{Object.keys(N).forEach(S=>{let X=l.get(S);X===void 0&&(X=[],l.set(S,X)),X.push(N[S])})};return o.forEach(N=>{N=N.klass.importDOM!=null?N.klass.importDOM.bind(N.klass):null,N==null||h.has(N)||(h.add(N),N=N(),N!==null&&_(N))}),i&&_(i),l}class Us{constructor(i,l,h,_,N,S,X){this._parentEditor=l,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=_,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Ze(),this._onError=N,this._htmlConversions=S,this._editable=X,this._headless=l!==null&&l._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let l=this._listeners.update;return l.add(i),()=>{l.delete(i)}}registerEditableListener(i){let l=this._listeners.editable;return l.add(i),()=>{l.delete(i)}}registerDecoratorListener(i){let l=this._listeners.decorator;return l.add(i),()=>{l.delete(i)}}registerTextContentListener(i){let l=this._listeners.textcontent;return l.add(i),()=>{l.delete(i)}}registerRootListener(i){let l=this._listeners.root;return i(this._rootElement,null),l.add(i),()=>{i(null,this._rootElement),l.delete(i)}}registerCommand(i,l,h){h===void 0&&K(35);let _=this._commands;_.has(i)||_.set(i,[new Set,new Set,new Set,new Set,new Set]);let N=_.get(i);N===void 0&&K(36,String(i));let S=N[h];return S.add(l),()=>{S.delete(l),N.every(X=>X.size===0)&&_.delete(i)}}registerMutationListener(i,l){this._nodes.get(i.getType())===void 0&&K(37,i.name);let h=this._listeners.mutation;return h.set(l,i),()=>{h.delete(l)}}registerNodeTransformToKlass(i,l){var h=i.getType();return h=this._nodes.get(h),h===void 0&&K(37,i.name),h.transforms.add(l),h}registerNodeTransform(i,l){var h=this.registerNodeTransformToKlass(i,l);let _=[h];return h=h.replaceWithKlass,h!=null&&(h=this.registerNodeTransformToKlass(h,l),_.push(h)),jt(this,i.getType()),()=>{_.forEach(N=>N.transforms.delete(l))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,l){return at(this,i,l)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let l=this._rootElement;if(i!==l){let S=Bt(this._config.theme,"root");var h=this._pendingEditorState||this._editorState;if(this._rootElement=i,So(this,l,i,h),l!==null){if(!this._config.disableEvents){Ms!==0&&(Ms--,Ms===0&&l.ownerDocument.removeEventListener("selectionchange",xa));var _=l.__lexicalEditor;if(_!=null){if(_._parentEditor!==null){var N=pe(_);N=N[N.length-1]._key,rs.get(N)===_&&rs.delete(N)}else rs.delete(_._key);l.__lexicalEditor=null}for(_=Ta(l),N=0;N<_.length;N++)_[N]();l.__lexicalEventHandles=[]}S!=null&&l.classList.remove(...S)}i!==null?(h=(h=i.ownerDocument)&&h.defaultView||null,_=i.style,_.userSelect="text",_.whiteSpace="pre-wrap",_.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=h,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),Hi(this),this._config.disableEvents||Lc(i,this),S!=null&&i.classList.add(...S)):(this._editorState=h,this._window=this._pendingEditorState=null),Ni("root",this,!1,i,l)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,l){i.isEmpty()&&K(38),en(this);let h=this._pendingEditorState,_=this._updateTags;l=l!==void 0?l.tag:null,h===null||h.isEmpty()||(l!=null&&_.add(l),Hi(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,l!=null&&_.add(l),Hi(this)}parseEditorState(i,l){i=typeof i=="string"?JSON.parse(i):i;let h=Ki(),_=hn,N=Bn,S=wn,X=this._dirtyElements,he=this._dirtyLeaves,De=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,hn=h,Bn=!1,wn=this;try{Eo(i.root,this._nodes),l&&l(),h._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=X,this._dirtyLeaves=he,this._cloneNotNeeded=De,this._dirtyType=Ye,hn=_,Bn=N,wn=S}return h}update(i,l){Cr(this,i,l)}focus(i,l={}){let h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),Cr(this,()=>{let _=Vt(),N=bt();_!==null?_.dirty=!0:N.getChildrenSize()!==0&&(l.defaultSelection==="rootStart"?N.selectStart():N.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=Ur(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ni("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class vo extends Wi{constructor(i,l){super(l),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 zi(o){return o instanceof vo}class bl extends Wi{}function Il(o){return o instanceof bl}class Ia extends Wi{}function kl(o){return o instanceof Ia}return We.$INTERNAL_isPointSelection=Ps,We.$addUpdateTag=function(o){Vn(),fn()._updateTags.add(o)},We.$applyNodeReplacement=_r,We.$copyNode=Oi,We.$createLineBreakNode=jr,We.$createNodeSelection=vl,We.$createParagraphNode=Fr,We.$createPoint=Lr,We.$createRangeSelection=function(){let o=Lr("root",0,"element"),i=Lr("root",0,"element");return new _i(o,i,0,"")},We.$createTabNode=Pi,We.$createTextNode=Kn,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=rr,We.$getNodeByKey=pt,We.$getPreviousSelection=Nr,We.$getRoot=bt,We.$getSelection=Vt,We.$getTextContent=function(){let o=Vt();return o===null?"":o.getTextContent()},We.$hasAncestor=jn,We.$hasUpdateTag=function(o){return fn()._updateTags.has(o)},We.$insertNodes=function(o){let i=Vt()||Nr();i===null&&(i=bt().selectEnd()),i.insertNodes(o)},We.$isBlockElementNode=function(o){return Je(o)&&!o.isInline()},We.$isDecoratorNode=Cn,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(o){return Je(o)&&o.isInline()||Cn(o)&&o.isInline()},We.$isLeafNode=function(o){return Ct(o)||bi(o)||Cn(o)},We.$isLineBreakNode=bi,We.$isNodeSelection=or,We.$isParagraphNode=function(o){return o instanceof $r},We.$isRangeSelection=Mt,We.$isRootNode=er,We.$isRootOrShadowRoot=ir,We.$isTabNode=wa,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=Pr();let l=i._readOnly,h=o.getType();i=i._nodeMap;let _=[];for(let[,N]of i)N instanceof o&&N.__type===h&&(l||N.isAttached())&&_.push(N);return _},We.$normalizeSelection__EXPERIMENTAL=ke,We.$parseSerializedNode=function(o){return Eo(o,fn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),nn(ke(o))},We.$setCompositionKey=ht,We.$setSelection=nn,We.$splitNode=function(o,i){let l=o.getChildAtIndex(i);l==null&&(l=o),ir(o)&&K(102);let h=S=>{const X=S.getParentOrThrow(),he=ir(X),De=S!==l||he?Oi(S):S;if(he){if(!Je(S)||!Je(De))throw Error("Children of a root must be ElementNode");return S.insertAfter(De),[S,De,De]}const[Ye,Xe,Ke]=h(X);return S=S.getNextSiblings(),Ke.append(De,...S),[Ye,Xe,De]},[_,N]=h(l);return[_,N]},We.BLUR_COMMAND=Y,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=ue,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=T,We.DELETE_WORD_COMMAND=E,We.DEPRECATED_$computeGridMap=function(o,i,l){let h=[],_=null,N=null;o=o.getChildren();for(let Ye=0;Ye<o.length;Ye++){var S=o[Ye];kl(S)||K(108);var X=S.getChildren();S=0;for(let Xe of X){for(zi(Xe)||K(109);h[Ye]!==void 0&&h[Ye][S]!==void 0;)S++;X=Ye;var he=S,De=Xe;let Ke={cell:De,startColumn:he,startRow:X},Pe=De.__rowSpan,gt=De.__colSpan;for(let Ot=0;Ot<Pe;Ot++){h[X+Ot]===void 0&&(h[X+Ot]=[]);for(let Ft=0;Ft<gt;Ft++)h[X+Ot][he+Ft]=Ke}i.is(De)&&(_=Ke),l.is(De)&&(N=Ke),S+=Xe.__colSpan}}return _===null&&K(110),N===null&&K(111),[h,_,N]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,l]=Bs(o);o=l.getChildren();let h=o.length;var _=o[0].getChildren().length;let N=Array(h);for(var S=0;S<h;S++)N[S]=Array(_);for(_=0;_<h;_++){S=o[_].getChildren();let X=0;for(let he=0;he<S.length;he++){for(;N[_][X];)X++;let De=S[he],Ye=De.__rowSpan||1,Xe=De.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)N[_+Ke][X+Pe]=De;if(i===De)return{colSpan:Xe,columnIndex:X,rowIndex:_,rowSpan:Ye};X+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=Bs,We.DEPRECATED_$isGridCellNode=zi,We.DEPRECATED_$isGridNode=Il,We.DEPRECATED_$isGridRowNode=kl,We.DEPRECATED_GridCellNode=vo,We.DEPRECATED_GridNode=bl,We.DEPRECATED_GridRowNode=Ia,We.DRAGEND_COMMAND=we,We.DRAGOVER_COMMAND=xe,We.DRAGSTART_COMMAND=V,We.DROP_COMMAND=B,We.DecoratorNode=To,We.ElementNode=Wi,We.FOCUS_COMMAND=x,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=R,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=c,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Ls,We.KEY_ARROW_DOWN_COMMAND=W,We.KEY_ARROW_LEFT_COMMAND=z,We.KEY_ARROW_RIGHT_COMMAND=C,We.KEY_ARROW_UP_COMMAND=F,We.KEY_BACKSPACE_COMMAND=le,We.KEY_DELETE_COMMAND=ge,We.KEY_DOWN_COMMAND=U,We.KEY_ENTER_COMMAND=G,We.KEY_ESCAPE_COMMAND=se,We.KEY_MODIFIER_COMMAND=ie,We.KEY_SPACE_COMMAND=q,We.KEY_TAB_COMMAND=j,We.LineBreakNode=Yr,We.MOVE_TO_END=w,We.MOVE_TO_START=Q,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=g,We.ParagraphNode=$r,We.REDO_COMMAND=k,We.REMOVE_TEXT_COMMAND=y,We.RootNode=lr,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=$,We.TabNode=ss,We.TextNode=Li,We.UNDO_COMMAND=I,We.createCommand=function(){return{}},We.createEditor=function(o){var i=o||{},l=wn,h=i.theme||{};let _=o===void 0?l:i.parentEditor||null,N=i.disableEvents||!1,S=Ki(),X=i.namespace||(_!==null?_._config.namespace:Ze()),he=i.editorState,De=[lr,Li,Yr,ss,$r,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,o===void 0&&l!==null)o=l._nodes;else for(o=new Map,l=0;l<De.length;l++){let Pe=De[l],gt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,gt=Ke.with,Ke=Ke.withKlass||null);let Ot=Pe.getType(),Ft=Pe.transform(),zt=new Set;Ft!==null&&zt.add(Ft),o.set(Ot,{exportDOM:Xe&&Xe.export?Xe.export.get(Pe):void 0,klass:Pe,replace:gt,replaceWithKlass:Ke,transforms:zt})}return h=new Us(S,_,o,{disableEvents:N,namespace:X,theme:h},Ye||console.error,zs(o,Xe?Xe.import:void 0),i),he!==void 0&&(h._pendingEditorState=he,h._dirtyType=2),h},We.getNearestEditorFromDOMNode=vt,We.isCurrentlyReadOnlyMode=cs,We.isHTMLAnchorElement=function(o){return ao(o)&&o.tagName==="A"},We.isHTMLElement=ao,We.isSelectionCapturedInDecoratorInput=it,We.isSelectionWithinEditor=st,We}var Jc,nf;function gn(){return nf||(nf=1,Jc=process.env.NODE_ENV==="development"?Ly():Py()),Jc}var rf;function $y(){if(rf)return Zc;rf=1;var e=so,t=gn(),n=yt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const g={tag:"history-merge"};function y({initialConfig:T,children:R}){const I=n.useMemo(()=>{const{theme:k,namespace:U,editor__DEPRECATED:C,nodes:w,onError:z,editorState:Q,html:F}=T,W=e.createLexicalComposerContext(null,k);let G=C||null;if(G===null){const q=t.createEditor({editable:T.editable,html:F,namespace:U,nodes:w,onError:le=>z(le,q),theme:k});E(q,Q),G=q}return[G,W]},[]);return d(()=>{const k=T.editable,[U]=I;U.setEditable(k!==void 0?k:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:I},R)}function E(T,R){if(R!==null){if(R===void 0)T.update(()=>{const I=t.$getRoot();if(I.isEmpty()){const k=t.$createParagraphNode();I.append(k);const U=r?document.activeElement:null;(t.$getSelection()!==null||U!==null&&U===T.getRootElement())&&k.select()}},g);else if(R!==null)switch(typeof R){case"string":{const I=T.parseEditorState(R);T.setEditorState(I,g);break}case"object":{T.setEditorState(R,g);break}case"function":{T.update(()=>{t.$getRoot().isEmpty()&&R(T)},g);break}}}}return Zc.LexicalComposer=y,Zc}var Xc={},sf;function Fy(){if(sf)return Xc;sf=1;var e=so,t=gn(),n=yt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var c=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function g(y,E){if(E!==null){if(E===void 0)y.update(()=>{var T=t.$getRoot();if(T.isEmpty()){let R=t.$createParagraphNode();T.append(R),T=r?document.activeElement:null,(t.$getSelection()!==null||T!==null&&T===y.getRootElement())&&R.select()}},d);else if(E!==null)switch(typeof E){case"string":let T=y.parseEditorState(E);y.setEditorState(T,d);break;case"object":y.setEditorState(E,d);break;case"function":y.update(()=>{t.$getRoot().isEmpty()&&E(y)},d)}}}return Xc.LexicalComposer=function({initialConfig:y,children:E}){let T=n.useMemo(()=>{const{theme:R,namespace:I,editor__DEPRECATED:k,nodes:U,onError:C,editorState:w,html:z}=y,Q=e.createLexicalComposerContext(null,R);let F=k||null;if(F===null){const W=t.createEditor({editable:y.editable,html:z,namespace:I,nodes:U,onError:G=>C(G,W),theme:R});g(W,w),F=W}return[F,Q]},[]);return c(()=>{let R=y.editable,[I]=T;I.setEditable(R!==void 0?R:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:T},E)},Xc}const By=process.env.NODE_ENV==="development"?$y():Fy();var Hy=By,Zt={},Sn={},Gn={},of;function Wy(){if(of)return Gn;of=1;var e=gn();const t=new Map;function n($){let x=$;for(;x!=null;){if(x.nodeType===Node.TEXT_NODE)return x;x=x.firstChild}return null}function r($){const x=$.parentNode;if(x==null)throw new Error("Should never happen");return[x,Array.from(x.childNodes).indexOf($)]}function c($,x,Y,ie,K){const P=x.getKey(),Z=ie.getKey(),O=document.createRange();let H=$.getElementByKey(P),J=$.getElementByKey(Z),de=Y,_e=K;if(e.$isTextNode(x)&&(H=n(H)),e.$isTextNode(ie)&&(J=n(J)),x===void 0||ie===void 0||H===null||J===null)return null;H.nodeName==="BR"&&([H,de]=r(H)),J.nodeName==="BR"&&([J,_e]=r(J));const b=H.firstChild;H===J&&b!=null&&b.nodeName==="BR"&&de===0&&_e===0&&(_e=1);try{O.setStart(H,de),O.setEnd(J,_e)}catch{return null}return O.collapsed&&(de!==_e||P!==Z)&&(O.setStart(J,_e),O.setEnd(H,de)),O}function d($,x){const Y=$.getRootElement();if(Y===null)return[];const ie=Y.getBoundingClientRect(),K=getComputedStyle(Y),P=parseFloat(K.paddingLeft)+parseFloat(K.paddingRight),Z=Array.from(x.getClientRects());let O=Z.length;Z.sort((J,de)=>{const _e=J.top-de.top;return Math.abs(_e)<=3?J.left-de.left:_e});let H;for(let J=0;J<O;J++){const de=Z[J],_e=H&&H.top<=de.top&&H.top+H.height>de.top&&H.left+H.width>de.left,b=de.width+P===ie.width;if(_e||b){Z.splice(J--,1),O--;continue}H=de}return Z}function g($){const x={},Y=$.split(";");for(const ie of Y)if(ie!==""){const[K,P]=ie.split(/:([^]+)/);K&&P&&(x[K.trim()]=P.trim())}return x}function y($){let x=t.get($);return x===void 0&&(x=g($),t.set($,x)),Object.freeze(x),x}function E($){let x="";for(const Y in $)Y&&(x+=`${Y}: ${$[Y]};`);return x}function T($,x){return $.__first=x.__first,$.__last=x.__last,$.__size=x.__size,$.__format=x.__format,$.__indent=x.__indent,$.__dir=x.__dir,$}function R($,x){return $.__format=x.__format,$.__style=x.__style,$.__mode=x.__mode,$.__detail=x.__detail,$}function I($){const Y=$.constructor.clone($);return Y.__parent=$.__parent,Y.__next=$.__next,Y.__prev=$.__prev,e.$isElementNode($)&&e.$isElementNode(Y)?T(Y,$):e.$isTextNode($)&&e.$isTextNode(Y)?R(Y,$):Y}function k($,x){if(x.isSelected($)&&!x.isSegmented()&&!x.isToken()&&e.$INTERNAL_isPointSelection($)){const Y=$.anchor.getNode(),ie=$.focus.getNode(),K=x.is(Y),P=x.is(ie);if(K||P){const Z=$.isBackward(),[O,H]=$.getCharacterOffsets(),J=Y.is(ie),de=x.is(Z?ie:Y),_e=x.is(Z?Y:ie);let b=0,v;if(J)b=O>H?H:O,v=O>H?O:H;else if(de)b=Z?H:O,v=void 0;else if(_e){const M=Z?O:H;b=0,v=M}return x.__text=x.__text.slice(b,v),x}}return x}function U($){if($.type==="text")return $.offset===$.getNode().getTextContentSize();const x=$.getNode();if(!e.$isElementNode(x))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return $.offset===x.getChildrenSize()}function C($,x,Y){let ie=x.getNode(),K=Y;if(e.$isElementNode(ie)){const P=ie.getDescendantByIndex(x.offset);P!==null&&(ie=P)}for(;K>0&&ie!==null;){if(e.$isElementNode(ie)){const J=ie.getLastDescendant();J!==null&&(ie=J)}let P=ie.getPreviousSibling(),Z=0;if(P===null){let J=ie.getParentOrThrow(),de=J.getPreviousSibling();for(;de===null;){if(J=J.getParent(),J===null){P=null;break}de=J.getPreviousSibling()}J!==null&&(Z=J.isInline()?0:2,P=de)}let O=ie.getTextContent();O===""&&e.$isElementNode(ie)&&!ie.isInline()&&(O=`
|
|
71
|
-
|
|
72
|
-
`);const H=O.length;if(!e.$isTextNode(ie)||K>=H){const J=ie.getParent();ie.remove(),J!=null&&J.getChildrenSize()===0&&!e.$isRootNode(J)&&J.remove(),K-=H+Z,ie=P}else{const J=ie.getKey(),de=$.getEditorState().read(()=>{const v=e.$getNodeByKey(J);return e.$isTextNode(v)&&v.isSimpleText()?v.getTextContent():null}),_e=H-K,b=O.slice(0,_e);if(de!==null&&de!==O){const v=e.$getPreviousSelection();let M=ie;if(ie.isSimpleText())ie.setTextContent(de);else{const re=e.$createTextNode(de);ie.replace(re),M=re}if(e.$isRangeSelection(v)&&v.isCollapsed()){const re=v.anchor.offset;M.select(re,re)}}else if(ie.isSimpleText()){const v=x.key===J;let M=x.offset;M<K&&(M=H);const re=v?M-K:0,ye=v?M:_e;if(v&&re===0){const[Ae]=ie.splitText(re,ye);Ae.remove()}else{const[,Ae]=ie.splitText(re,ye);Ae.remove()}}else{const v=e.$createTextNode(b);ie.replace(v)}K=0}}}function w($){const x=$.getStyle(),Y=g(x);t.set(x,Y)}function z($,x){const Y=y("getStyle"in $?$.getStyle():$.style),ie=Object.entries(x).reduce((P,[Z,O])=>(O===null?delete P[Z]:P[Z]=O,P),{...Y}),K=E(ie);$.setStyle(K),t.set(K,ie)}function Q($,x){const Y=$.getNodes(),ie=Y.length;if(!e.$isRangeSelection($)){const te=e.$createRangeSelection(),ce=te.anchor,be=te.focus;for(let Ne=0;Ne<ie;Ne++){const Re=Y[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ce.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),Q(e.$normalizeSelection__EXPERIMENTAL(te),x))}e.$setSelection($);return}const K=ie-1;let P=Y[0],Z=Y[K];if($.isCollapsed()&&e.$isRangeSelection($)){z($,x);return}const O=$.anchor,H=$.focus,de=P.getTextContent().length,_e=H.offset;let b=O.offset;const v=O.isBefore(H);let M=v?b:_e,re=v?_e:b;const ye=v?O.type:H.type,Ae=v?H.type:O.type,ee=v?H.key:O.key;if(e.$isTextNode(P)&&M===de){const te=P.getNextSibling();e.$isTextNode(te)&&(b=0,M=0,P=te)}if(Y.length===1){if(e.$isTextNode(P)){if(M=ye==="element"?0:b>_e?_e:b,re=Ae==="element"?de:b>_e?b:_e,M===re)return;if(M===0&&re===de)z(P,x),P.select(M,re);else{const te=P.splitText(M,re),ce=M===0?te[0]:te[1];z(ce,x),ce.select(0,re-M)}}}else{if(e.$isTextNode(P)&&M<P.getTextContentSize()&&(M!==0&&(P=P.splitText(M)[1],M=0,O.set(P.getKey(),M,"text")),z(P,x)),e.$isTextNode(Z)){const ce=Z.getTextContent().length;Z.__key!==ee&&re!==0&&(re=ce),re!==ce&&([Z]=Z.splitText(re)),re!==0&&z(Z,x)}for(let te=1;te<K;te++){const ce=Y[te],be=ce.getKey();e.$isTextNode(ce)&&be!==P.getKey()&&be!==Z.getKey()&&!ce.isToken()&&z(ce,x)}}}function F($,x){if($.anchor.key==="root"){const K=x(),P=e.$getRoot(),Z=P.getFirstChild();Z?Z.replace(K,!0):P.append(K);return}const Y=$.getNodes(),ie=ue($.anchor.getNode(),Ee);ie&&Y.indexOf(ie)===-1&&Y.push(ie);for(let K=0;K<Y.length;K++){const P=Y[K];if(!Ee(P))continue;if(!e.$isElementNode(P))throw Error("Expected block node to be an ElementNode");const Z=x();Z.setFormat(P.getFormatType()),Z.setIndent(P.getIndent()),P.replace(Z,!0)}}function W($){return $.getNode().isAttached()}function G($){let x=$;for(;x!==null&&!e.$isRootOrShadowRoot(x);){const Y=x.getLatest(),ie=x.getParent();Y.getChildrenSize()===0&&x.remove(!0),x=ie}}function q($,x,Y=null){const ie=$.getNodes(),K=ie.length,P=$.anchor;if(K===0||K===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){const H=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),J=H.getChildren();let de=x();de.setFormat(H.getFormatType()),de.setIndent(H.getIndent()),J.forEach(_e=>de.append(_e)),Y&&(de=Y.append(de)),H.replace(de);return}let Z=null,O=[];for(let H=0;H<K;H++){const J=ie[H];e.$isRootOrShadowRoot(J)?(le($,O,O.length,x,Y),O=[],Z=J):Z===null||Z!==null&&e.$hasAncestor(J,Z)?O.push(J):(le($,O,O.length,x,Y),O=[J])}le($,O,O.length,x,Y)}function le($,x,Y,ie,K=null){if(x.length===0)return;const P=x[0],Z=new Map,O=[];let H=e.$isElementNode(P)?P:P.getParentOrThrow();H.isInline()&&(H=H.getParentOrThrow());let J=!1;for(;H!==null;){const M=H.getPreviousSibling();if(M!==null){H=M,J=!0;break}if(H=H.getParentOrThrow(),e.$isRootOrShadowRoot(H))break}const de=new Set;for(let M=0;M<Y;M++){const re=x[M];e.$isElementNode(re)&&re.getChildrenSize()===0&&de.add(re.getKey())}const _e=new Set;for(let M=0;M<Y;M++){const re=x[M];let ye=re.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(re)&&!_e.has(re.getKey())){const Ae=ye.getKey();if(Z.get(Ae)===void 0){const ee=ie();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),O.push(ee),Z.set(Ae,ee),ye.getChildren().forEach(te=>{ee.append(te),_e.add(te.getKey()),e.$isElementNode(te)&&te.getChildrenKeys().forEach(ce=>_e.add(ce))}),G(ye)}}else if(de.has(re.getKey())){if(!e.$isElementNode(re))throw Error("Expected node in emptyElements to be an ElementNode");const Ae=ie();Ae.setFormat(re.getFormatType()),Ae.setIndent(re.getIndent()),O.push(Ae),re.remove(!0)}}if(K!==null)for(let M=0;M<O.length;M++){const re=O[M];K.append(re)}let b=null;if(e.$isRootOrShadowRoot(H))if(J)if(K!==null)H.insertAfter(K);else for(let M=O.length-1;M>=0;M--){const re=O[M];H.insertAfter(re)}else{const M=H.getFirstChild();if(e.$isElementNode(M)&&(H=M),M===null)if(K)H.append(K);else for(let re=0;re<O.length;re++){const ye=O[re];H.append(ye),b=ye}else if(K!==null)M.insertBefore(K);else for(let re=0;re<O.length;re++){const ye=O[re];M.insertBefore(ye),b=ye}}else if(K)H.insertAfter(K);else for(let M=O.length-1;M>=0;M--){const re=O[M];H.insertAfter(re),b=re}const v=e.$getPreviousSelection();e.$isRangeSelection(v)&&W(v.anchor)&&W(v.focus)?e.$setSelection(v.clone()):b!==null?b.selectEnd():$.dirty=!0}function se($,x){const Y=e.$getAdjacentNode($.focus,x);return e.$isDecoratorNode(Y)&&!Y.isIsolated()||e.$isElementNode(Y)&&!Y.isInline()&&!Y.canBeEmpty()}function ge($,x,Y,ie){$.modify(x?"extend":"move",Y,ie)}function j($){const x=$.anchor.getNode();return(e.$isRootNode(x)?x:x.getParentOrThrow()).getDirection()==="rtl"}function B($,x,Y){const ie=j($);ge($,x,Y?!ie:ie,"character")}function V($){const x=$.anchor,Y=$.focus,P=x.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Z=P.getFirstDescendant(),O=P.getLastDescendant(),H="element",J="element",de=0;e.$isTextNode(Z)?H="text":!e.$isElementNode(Z)&&Z!==null&&(Z=Z.getParentOrThrow()),e.$isTextNode(O)?(J="text",de=O.getTextContentSize()):!e.$isElementNode(O)&&O!==null&&(O=O.getParentOrThrow()),Z&&O&&(x.set(Z.getKey(),0,H),Y.set(O.getKey(),de,J))}function xe($,x,Y){const ie=$.getStyle(),K=y(ie);return K!==null&&K[x]||Y}function we($,x,Y=""){let ie=null;const K=$.getNodes(),P=$.anchor,Z=$.focus,O=$.isBackward(),H=O?Z.offset:P.offset,J=O?Z.getNode():P.getNode();if($.isCollapsed()&&$.style!==""){const de=$.style,_e=y(de);if(_e!==null&&x in _e)return _e[x]}for(let de=0;de<K.length;de++){const _e=K[de];if(!(de!==0&&H===0&&_e.is(J))&&e.$isTextNode(_e)){const b=xe(_e,x,Y);if(ie===null)ie=b;else if(ie!==b){ie="";break}}}return ie===null?Y:ie}function Ee($){if(e.$isDecoratorNode($)&&!$.isInline())return!0;if(!e.$isElementNode($)||e.$isRootOrShadowRoot($))return!1;const x=$.getFirstChild(),Y=x===null||e.$isLineBreakNode(x)||e.$isTextNode(x)||x.isInline();return!$.isInline()&&$.canBeEmpty()!==!1&&Y}function ue($,x){let Y=$;for(;Y!==null&&Y.getParent()!==null&&!x(Y);)Y=Y.getParentOrThrow();return x(Y)?Y:null}return Gn.$addNodeStyle=w,Gn.$cloneWithProperties=I,Gn.$getSelectionStyleValueForProperty=we,Gn.$isAtNodeEnd=U,Gn.$isParentElementRTL=j,Gn.$moveCaretSelection=ge,Gn.$moveCharacter=B,Gn.$patchStyleText=Q,Gn.$selectAll=V,Gn.$setBlocksType=F,Gn.$shouldOverrideDefaultCharacterSelection=se,Gn.$sliceSelectedTextNodeContent=k,Gn.$wrapNodes=q,Gn.createDOMRange=c,Gn.createRectsFromDOMRange=d,Gn.getStyleObjectFromCSS=y,Gn.trimTextContentFromAnchor=C,Gn}var Yn={},lf;function Ky(){if(lf)return Yn;lf=1;var e=gn();let t=new Map;function n(C){for(;C!=null;){if(C.nodeType===Node.TEXT_NODE)return C;C=C.firstChild}return null}function r(C){let w=C.parentNode;if(w==null)throw Error("Should never happen");return[w,Array.from(w.childNodes).indexOf(C)]}function c(C){let w={};C=C.split(";");for(let z of C)if(z!==""){let[Q,F]=z.split(/:([^]+)/);Q&&F&&(w[Q.trim()]=F.trim())}return w}function d(C){let w=t.get(C);return w===void 0&&(w=c(C),t.set(C,w)),w}function g(C){let w="";for(let z in C)z&&(w+=`${z}: ${C[z]};`);return w}function y(C,w){var z=d("getStyle"in C?C.getStyle():C.style);w=Object.entries(w).reduce((Q,[F,W])=>(W===null?delete Q[F]:Q[F]=W,Q),{...z}),z=g(w),C.setStyle(z),t.set(z,w)}function E(C,w){var z=C.getNodes(),Q=z.length;if(e.$isRangeSelection(C)){--Q;var F=z[0],W=z[Q];if(C.isCollapsed()&&e.$isRangeSelection(C))y(C,w);else{var G=C.anchor,q=C.focus,le=F.getTextContent().length,se=q.offset,ge=G.offset,j=G.isBefore(q),B=j?ge:se;C=j?se:ge;var V=j?G.type:q.type,xe=j?q.type:G.type;if(q=j?q.key:G.key,e.$isTextNode(F)&&B===le&&(j=F.getNextSibling(),e.$isTextNode(j)&&(B=ge=0,F=j)),z.length===1)e.$isTextNode(F)&&(B=V==="element"?0:ge>se?se:ge,C=xe==="element"?le:ge>se?ge:se,B!==C&&(B===0&&C===le?(y(F,w),F.select(B,C)):(z=F.splitText(B,C),z=B===0?z[0]:z[1],y(z,w),z.select(0,C-B))));else for(e.$isTextNode(F)&&B<F.getTextContentSize()&&(B!==0&&(F=F.splitText(B)[1],B=0,G.set(F.getKey(),B,"text")),y(F,w)),e.$isTextNode(W)&&(B=W.getTextContent().length,W.__key!==q&&C!==0&&(C=B),C!==B&&([W]=W.splitText(C)),C!==0&&y(W,w)),C=1;C<Q;C++)B=z[C],G=B.getKey(),e.$isTextNode(B)&&G!==F.getKey()&&G!==W.getKey()&&!B.isToken()&&y(B,w)}}else{for(F=e.$createRangeSelection(),W=F.anchor,B=F.focus,G=0;G<Q;G++)le=z[G],e.DEPRECATED_$isGridCellNode(le)&&(W.set(le.getKey(),0,"element"),B.set(le.getKey(),le.getChildrenSize(),"element"),E(e.$normalizeSelection__EXPERIMENTAL(F),w));e.$setSelection(C)}}function T(C){for(;C!==null&&!e.$isRootOrShadowRoot(C);){let w=C.getLatest(),z=C.getParent();w.getChildrenSize()===0&&C.remove(!0),C=z}}function R(C,w,z,Q,F=null){if(w.length!==0){var W=w[0],G=new Map,q=[];W=e.$isElementNode(W)?W:W.getParentOrThrow(),W.isInline()&&(W=W.getParentOrThrow());for(var le=!1;W!==null;){var se=W.getPreviousSibling();if(se!==null){W=se,le=!0;break}if(W=W.getParentOrThrow(),e.$isRootOrShadowRoot(W))break}se=new Set;for(var ge=0;ge<z;ge++){var j=w[ge];e.$isElementNode(j)&&j.getChildrenSize()===0&&se.add(j.getKey())}var B=new Set;for(ge=0;ge<z;ge++){j=w[ge];var V=j.getParent();if(V!==null&&V.isInline()&&(V=V.getParent()),V!==null&&e.$isLeafNode(j)&&!B.has(j.getKey())){if(j=V.getKey(),G.get(j)===void 0){let xe=Q();xe.setFormat(V.getFormatType()),xe.setIndent(V.getIndent()),q.push(xe),G.set(j,xe),V.getChildren().forEach(we=>{xe.append(we),B.add(we.getKey()),e.$isElementNode(we)&&we.getChildrenKeys().forEach(Ee=>B.add(Ee))}),T(V)}}else if(se.has(j.getKey())){if(!e.$isElementNode(j))throw Error("Expected node in emptyElements to be an ElementNode");V=Q(),V.setFormat(j.getFormatType()),V.setIndent(j.getIndent()),q.push(V),j.remove(!0)}}if(F!==null)for(w=0;w<q.length;w++)F.append(q[w]);if(w=null,e.$isRootOrShadowRoot(W))if(le)if(F!==null)W.insertAfter(F);else for(F=q.length-1;0<=F;F--)W.insertAfter(q[F]);else if(le=W.getFirstChild(),e.$isElementNode(le)&&(W=le),le===null)if(F)W.append(F);else for(F=0;F<q.length;F++)le=q[F],W.append(le),w=le;else if(F!==null)le.insertBefore(F);else for(W=0;W<q.length;W++)F=q[W],le.insertBefore(F),w=F;else if(F)W.insertAfter(F);else for(F=q.length-1;0<=F;F--)le=q[F],W.insertAfter(le),w=le;q=e.$getPreviousSelection(),e.$isRangeSelection(q)&&q.anchor.getNode().isAttached()&&q.focus.getNode().isAttached()?e.$setSelection(q.clone()):w!==null?w.selectEnd():C.dirty=!0}}function I(C,w,z,Q){C.modify(w?"extend":"move",z,Q)}function k(C){return C=C.anchor.getNode(),(e.$isRootNode(C)?C:C.getParentOrThrow()).getDirection()==="rtl"}function U(C){if(e.$isDecoratorNode(C)&&!C.isInline())return!0;if(!e.$isElementNode(C)||e.$isRootOrShadowRoot(C))return!1;var w=C.getFirstChild();return w=w===null||e.$isLineBreakNode(w)||e.$isTextNode(w)||w.isInline(),!C.isInline()&&C.canBeEmpty()!==!1&&w}return Yn.$addNodeStyle=function(C){C=C.getStyle();let w=c(C);t.set(C,w)},Yn.$cloneWithProperties=function(C){let w=C.constructor.clone(C);return w.__parent=C.__parent,w.__next=C.__next,w.__prev=C.__prev,e.$isElementNode(C)&&e.$isElementNode(w)?(w.__first=C.__first,w.__last=C.__last,w.__size=C.__size,w.__format=C.__format,w.__indent=C.__indent,w.__dir=C.__dir,w):(e.$isTextNode(C)&&e.$isTextNode(w)&&(w.__format=C.__format,w.__style=C.__style,w.__mode=C.__mode,w.__detail=C.__detail),w)},Yn.$getSelectionStyleValueForProperty=function(C,w,z=""){let Q=null,F=C.getNodes();var W=C.anchor,G=C.focus,q=C.isBackward();let le=q?G.offset:W.offset;if(W=q?G.getNode():W.getNode(),C.isCollapsed()&&C.style!==""&&(C=d(C.style),C!==null&&w in C))return C[w];for(C=0;C<F.length;C++){var se=F[C];if((C===0||le!==0||!se.is(W))&&e.$isTextNode(se)){if(G=w,q=z,se=se.getStyle(),se=d(se),G=se!==null&&se[G]||q,Q===null)Q=G;else if(Q!==G){Q="";break}}}return Q===null?z:Q},Yn.$isAtNodeEnd=function(C){if(C.type==="text")return C.offset===C.getNode().getTextContentSize();let w=C.getNode();if(!e.$isElementNode(w))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return C.offset===w.getChildrenSize()},Yn.$isParentElementRTL=k,Yn.$moveCaretSelection=I,Yn.$moveCharacter=function(C,w,z){let Q=k(C);I(C,w,z?!Q:Q,"character")},Yn.$patchStyleText=E,Yn.$selectAll=function(C){let w=C.anchor;C=C.focus;var z=w.getNode().getTopLevelElementOrThrow().getParentOrThrow();let Q=z.getFirstDescendant();z=z.getLastDescendant();let F="element",W="element",G=0;e.$isTextNode(Q)?F="text":e.$isElementNode(Q)||Q===null||(Q=Q.getParentOrThrow()),e.$isTextNode(z)?(W="text",G=z.getTextContentSize()):e.$isElementNode(z)||z===null||(z=z.getParentOrThrow()),Q&&z&&(w.set(Q.getKey(),0,F),C.set(z.getKey(),G,W))},Yn.$setBlocksType=function(C,w){if(C.anchor.key==="root"){w=w();var z=e.$getRoot();(C=z.getFirstChild())?C.replace(w,!0):z.append(w)}else{for(z=C.getNodes(),C=C.anchor.getNode();C!==null&&C.getParent()!==null&&!U(C);)C=C.getParentOrThrow();for((C=U(C)?C:null)&&z.indexOf(C)===-1&&z.push(C),C=0;C<z.length;C++){let Q=z[C];if(!U(Q))continue;if(!e.$isElementNode(Q))throw Error("Expected block node to be an ElementNode");let F=w();F.setFormat(Q.getFormatType()),F.setIndent(Q.getIndent()),Q.replace(F,!0)}}},Yn.$shouldOverrideDefaultCharacterSelection=function(C,w){return C=e.$getAdjacentNode(C.focus,w),e.$isDecoratorNode(C)&&!C.isIsolated()||e.$isElementNode(C)&&!C.isInline()&&!C.canBeEmpty()},Yn.$sliceSelectedTextNodeContent=function(C,w){if(w.isSelected(C)&&!w.isSegmented()&&!w.isToken()&&e.$INTERNAL_isPointSelection(C)){var z=C.anchor.getNode(),Q=C.focus.getNode(),F=w.is(z),W=w.is(Q);if(F||W){F=C.isBackward();let[G,q]=C.getCharacterOffsets();C=z.is(Q),W=w.is(F?Q:z),Q=w.is(F?z:Q),z=0;let le;C?(z=G>q?q:G,le=G>q?G:q):W?(z=F?q:G,le=void 0):Q&&(F=F?G:q,z=0,le=F),w.__text=w.__text.slice(z,le)}}return w},Yn.$wrapNodes=function(C,w,z=null){var Q=C.getNodes();let F=Q.length;var W=C.anchor;if(F===0||F===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){C=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),Q=C.getChildren();let q=w();q.setFormat(C.getFormatType()),q.setIndent(C.getIndent()),Q.forEach(le=>q.append(le)),z&&(q=z.append(q)),C.replace(q)}else{W=null;var G=[];for(let q=0;q<F;q++){let le=Q[q];e.$isRootOrShadowRoot(le)?(R(C,G,G.length,w,z),G=[],W=le):W===null||W!==null&&e.$hasAncestor(le,W)?G.push(le):(R(C,G,G.length,w,z),G=[le])}R(C,G,G.length,w,z)}},Yn.createDOMRange=function(C,w,z,Q,F){let W=w.getKey(),G=Q.getKey(),q=document.createRange(),le=C.getElementByKey(W);if(C=C.getElementByKey(G),e.$isTextNode(w)&&(le=n(le)),e.$isTextNode(Q)&&(C=n(C)),w===void 0||Q===void 0||le===null||C===null)return null;le.nodeName==="BR"&&([le,z]=r(le)),C.nodeName==="BR"&&([C,F]=r(C)),w=le.firstChild,le===C&&w!=null&&w.nodeName==="BR"&&z===0&&F===0&&(F=1);try{q.setStart(le,z),q.setEnd(C,F)}catch{return null}return!q.collapsed||z===F&&W===G||(q.setStart(C,F),q.setEnd(le,z)),q},Yn.createRectsFromDOMRange=function(C,w){var z=C.getRootElement();if(z===null)return[];C=z.getBoundingClientRect(),z=getComputedStyle(z),z=parseFloat(z.paddingLeft)+parseFloat(z.paddingRight),w=Array.from(w.getClientRects());let Q=w.length;w.sort((W,G)=>{let q=W.top-G.top;return 3>=Math.abs(q)?W.left-G.left:q});let F;for(let W=0;W<Q;W++){let G=w[W],q=G.width+z===C.width;F&&F.top<=G.top&&F.top+F.height>G.top&&F.left+F.width>G.left||q?(w.splice(W--,1),Q--):F=G}return w},Yn.getStyleObjectFromCSS=d,Yn.trimTextContentFromAnchor=function(C,w,z){let Q=w.getNode();if(e.$isElementNode(Q)){var F=Q.getDescendantByIndex(w.offset);F!==null&&(Q=F)}for(;0<z&&Q!==null;){e.$isElementNode(Q)&&(F=Q.getLastDescendant(),F!==null&&(Q=F));var W=Q.getPreviousSibling(),G=0;if(W===null){F=Q.getParentOrThrow();for(var q=F.getPreviousSibling();q===null;){if(F=F.getParent(),F===null){W=null;break}q=F.getPreviousSibling()}F!==null&&(G=F.isInline()?0:2,W=q)}if(q=Q.getTextContent(),q===""&&e.$isElementNode(Q)&&!Q.isInline()&&(q=`
|
|
73
|
-
|
|
74
|
-
`),F=q.length,!e.$isTextNode(Q)||z>=F)q=Q.getParent(),Q.remove(),q==null||q.getChildrenSize()!==0||e.$isRootNode(q)||q.remove(),z-=F+G,Q=W;else{let le=Q.getKey();G=C.getEditorState().read(()=>{const ge=e.$getNodeByKey(le);return e.$isTextNode(ge)&&ge.isSimpleText()?ge.getTextContent():null}),W=F-z;let se=q.slice(0,W);G!==null&&G!==q?(z=e.$getPreviousSelection(),F=Q,Q.isSimpleText()?Q.setTextContent(G):(F=e.$createTextNode(G),Q.replace(F)),e.$isRangeSelection(z)&&z.isCollapsed()&&(z=z.anchor.offset,F.select(z,z))):Q.isSimpleText()?(G=w.key===le,q=w.offset,q<z&&(q=F),z=G?q-z:0,F=G?q:W,G&&z===0?([z]=Q.splitText(z,F),z.remove()):([,z]=Q.splitText(z,F),z.remove())):(z=e.$createTextNode(se),Q.replace(z)),z=0}}},Yn}var Qc,af;function Cs(){return af||(af=1,Qc=process.env.NODE_ENV==="development"?Wy():Ky()),Qc}var cf;function zy(){if(cf)return Sn;cf=1;var e=Cs(),t=gn();function n(...se){return()=>{se.forEach(ge=>ge())}}function r(se){return`${se}px`}const c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(se,ge,j){let B=null,V=null,xe=null,we=[];const Ee=document.createElement("div");function ue(){if(B===null)throw Error("Unexpected null rootDOMNode");if(V===null)throw Error("Unexpected null parentDOMNode");const{left:ie,top:K}=B.getBoundingClientRect(),P=V,Z=e.createRectsFromDOMRange(se,ge);Ee.isConnected||P.append(Ee);let O=!1;for(let H=0;H<Z.length;H++){const J=Z[H],de=we[H]||document.createElement("div"),_e=de.style;_e.position!=="absolute"&&(_e.position="absolute",O=!0);const b=r(J.left-ie);_e.left!==b&&(_e.left=b,O=!0);const v=r(J.top-K);_e.top!==v&&(de.style.top=v,O=!0);const M=r(J.width);_e.width!==M&&(de.style.width=M,O=!0);const re=r(J.height);_e.height!==re&&(de.style.height=re,O=!0),de.parentNode!==Ee&&(Ee.append(de),O=!0),we[H]=de}for(;we.length>Z.length;)we.pop();O&&j(we)}function $(){V=null,B=null,xe!==null&&xe.disconnect(),xe=null,Ee.remove();for(const ie of we)ie.remove();we=[]}function x(){const ie=se.getRootElement();if(ie===null)return $();const K=ie.parentElement;if(!(K instanceof HTMLElement))return $();$(),B=ie,V=K,xe=new MutationObserver(P=>{const Z=se.getRootElement(),O=Z&&Z.parentElement;if(Z!==B||O!==V)return x();for(const H of P)if(!Ee.contains(H.target))return ue()}),xe.observe(K,c),ue()}const Y=se.registerRootListener(x);return()=>{Y(),$()}}function g(se,ge){let j=null,B=null,V=null,xe=null,we=()=>{};function Ee(ue){ue.read(()=>{const $=t.$getSelection();if(!t.$isRangeSelection($)){j=null,B=null,V=null,xe=null,we(),we=()=>{};return}const{anchor:x,focus:Y}=$,ie=x.getNode(),K=ie.getKey(),P=x.offset,Z=Y.getNode(),O=Z.getKey(),H=Y.offset,J=se.getElementByKey(K),de=se.getElementByKey(O),_e=j===null||J===null||P!==B||K!==j.getKey()||ie!==j&&(!(j instanceof t.TextNode)||ie.updateDOM(j,J,se._config)),b=V===null||de===null||H!==xe||O!==V.getKey()||Z!==V&&(!(V instanceof t.TextNode)||Z.updateDOM(V,de,se._config));if(_e||b){const v=se.getElementByKey(x.getNode().getKey()),M=se.getElementByKey(Y.getNode().getKey());if(v!==null&&M!==null&&v.tagName==="SPAN"&&M.tagName==="SPAN"){const re=document.createRange();let ye,Ae,ee,te;Y.isBefore(x)?(ye=M,Ae=Y.offset,ee=v,te=x.offset):(ye=v,Ae=x.offset,ee=M,te=Y.offset);const ce=ye.firstChild;if(ce===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");re.setStart(ce,Ae),re.setEnd(be,te),we(),we=d(se,re,Ne=>{for(const Re of Ne){const Le=Re.style;Le.background!=="Highlight"&&(Le.background="Highlight"),Le.color!=="HighlightText"&&(Le.color="HighlightText"),Le.zIndex!=="-1"&&(Le.zIndex="-1"),Le.pointerEvents!=="none"&&(Le.pointerEvents="none"),Le.marginTop!==r(-1.5)&&(Le.marginTop=r(-1.5)),Le.paddingTop!==r(4)&&(Le.paddingTop=r(4)),Le.paddingBottom!==r(0)&&(Le.paddingBottom=r(0))}ge!==void 0&&ge(Ne)})}}j=ie,B=P,V=Z,xe=H})}return Ee(se.getEditorState()),n(se.registerUpdateListener(({editorState:ue})=>Ee(ue)),we,()=>{we()})}function y(se,...ge){ge.forEach(j=>{if(typeof j=="string"){const B=j.split(" ").filter(V=>V!=="");se.classList.add(...B)}})}function E(se,...ge){ge.forEach(j=>{typeof j=="string"&&se.classList.remove(...j.split(" "))})}function T(se,ge){for(const j of ge)if(se.type.startsWith(j))return!0;return!1}function R(se,ge){const j=se[Symbol.iterator]();return new Promise((B,V)=>{const xe=[],we=()=>{const{done:Ee,value:ue}=j.next();if(Ee)return B(xe);const $=new FileReader;$.addEventListener("error",V),$.addEventListener("load",()=>{const x=$.result;typeof x=="string"&&xe.push({file:ue,result:x}),we()}),T(ue,ge)?$.readAsDataURL(ue):we()};we()})}function I(se,ge){const j=[],B=(se||t.$getRoot()).getLatest(),V=ge||(t.$isElementNode(B)?B.getLastDescendant():B);let xe=B,we=k(xe);for(;xe!==null&&!xe.is(V);)if(j.push({depth:we,node:xe}),t.$isElementNode(xe)&&xe.getChildrenSize()>0)xe=xe.getFirstChild(),we++;else{let Ee=null;for(;Ee===null&&xe!==null;)Ee=xe.getNextSibling(),Ee===null?(xe=xe.getParent(),we--):xe=Ee}return xe!==null&&xe.is(V)&&j.push({depth:we,node:xe}),j}function k(se){let ge=se,j=0;for(;(ge=ge.getParent())!==null;)j++;return j}function U(se,ge){let j=se;for(;j!=null;){if(j instanceof ge)return j;j=j.getParent()}return null}function C(se){const ge=w(se,j=>t.$isElementNode(j)&&!j.isInline());if(!t.$isElementNode(ge))throw Error(`Expected node ${se.__key} to have closest block element node.`);return ge}const w=(se,ge)=>{let j=se;for(;j!==t.$getRoot()&&j!=null;){if(ge(j))return j;j=j.getParent()}return null};function z(se,ge,j,B){const V=Ee=>Ee instanceof ge,xe=Ee=>{const ue=Ee.getChildren();for(let Y=0;Y<ue.length;Y++){const ie=ue[Y];if(V(ie))return null}let $=Ee,x=Ee;for(;$!==null;)if(x=$,$=$.getParent(),V($))return{child:x,parent:$};return null},we=Ee=>{const ue=xe(Ee);if(ue!==null){const{child:$,parent:x}=ue;if($.is(Ee)){B(x,Ee);const Y=$.getNextSiblings(),ie=Y.length;if(x.insertAfter($),ie!==0){const K=j(x);$.insertAfter(K);for(let P=0;P<ie;P++)K.append(Y[P])}!x.canBeEmpty()&&x.getChildrenSize()===0&&x.remove()}}};return se.registerNodeTransform(ge,we)}function Q(se,ge){const B=new Map,V=se._pendingEditorState;for(const[we,Ee]of ge._nodeMap){const ue=e.$cloneWithProperties(Ee);if(t.$isTextNode(ue)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");ue.__text=Ee.__text}B.set(we,ue)}V&&(V._nodeMap=B),se._dirtyType=2;const xe=ge._selection;t.$setSelection(xe===null?null:xe.clone())}function F(se){const ge=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ge)){const{focus:j}=ge,B=j.getNode(),V=j.offset;if(t.$isRootOrShadowRoot(B)){const xe=B.getChildAtIndex(V);xe==null?B.append(se):xe.insertBefore(se),se.selectNext()}else{let xe,we;t.$isTextNode(B)?(xe=B.getParentOrThrow(),we=B.getIndexWithinParent(),V>0&&(we+=1,B.splitText(V))):(xe=B,we=V);const[,Ee]=t.$splitNode(xe,we);Ee.insertBefore(se),Ee.selectStart()}}else{if(ge!=null){const B=ge.getNodes();B[B.length-1].getTopLevelElementOrThrow().insertAfter(se)}else t.$getRoot().append(se);const j=t.$createParagraphNode();se.insertAfter(j),j.select()}return se.getLatest()}function W(se,ge){const j=ge();return se.replace(j),j.append(se),j}function G(se,ge){return se!==null?Object.getPrototypeOf(se).constructor.name===ge.name:!1}function q(se,ge){const j=[];for(let B=0;B<se.length;B++){const V=ge(se[B]);V!==null&&j.push(V)}return j}function le(se,ge){const j=se.getFirstChild();j!==null?j.insertBefore(ge):se.append(ge)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=I,Sn.$filter=q,Sn.$findMatchingParent=w,Sn.$getNearestBlockElementAncestorOrThrow=C,Sn.$getNearestNodeOfType=U,Sn.$insertFirst=le,Sn.$insertNodeToNearestRoot=F,Sn.$restoreEditorState=Q,Sn.$wrapNodeInElement=W,Sn.addClassNamesToElement=y,Sn.isMimeType=T,Sn.markSelection=g,Sn.mediaFileReader=R,Sn.mergeRegister=n,Sn.objectKlassEquals=G,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=z,Sn.removeClassNamesFromElement=E,Sn}var vn={},uf;function Uy(){if(uf)return vn;uf=1;var e=Cs(),t=gn();function n(E){let T=new URLSearchParams;T.append("code",E);for(let R=1;R<arguments.length;R++)T.append("v",arguments[R]);throw Error(`Minified Lexical error #${E}; 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(...E){return()=>{E.forEach(T=>T())}}let c={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(E,T,R){function I(){if(C===null)throw Error("Unexpected null rootDOMNode");if(w===null)throw Error("Unexpected null parentDOMNode");let{left:G,top:q}=C.getBoundingClientRect();var le=w;let se=e.createRectsFromDOMRange(E,T);F.isConnected||le.append(F),le=!1;for(let B=0;B<se.length;B++){var ge=se[B];let V=Q[B]||document.createElement("div"),xe=V.style;xe.position!=="absolute"&&(xe.position="absolute",le=!0);var j=`${ge.left-G}px`;xe.left!==j&&(xe.left=j,le=!0),j=`${ge.top-q}px`,xe.top!==j&&(V.style.top=j,le=!0),j=`${ge.width}px`,xe.width!==j&&(V.style.width=j,le=!0),ge=`${ge.height}px`,xe.height!==ge&&(V.style.height=ge,le=!0),V.parentNode!==F&&(F.append(V),le=!0),Q[B]=V}for(;Q.length>se.length;)Q.pop();le&&R(Q)}function k(){C=w=null,z!==null&&z.disconnect(),z=null,F.remove();for(let G of Q)G.remove();Q=[]}function U(){let G=E.getRootElement();if(G===null)return k();let q=G.parentElement;if(!(q instanceof HTMLElement))return k();k(),C=G,w=q,z=new MutationObserver(le=>{let se=E.getRootElement(),ge=se&&se.parentElement;if(se!==C||ge!==w)return U();for(let j of le)if(!F.contains(j.target))return I()}),z.observe(q,c),I()}let C=null,w=null,z=null,Q=[],F=document.createElement("div"),W=E.registerRootListener(U);return()=>{W(),k()}}function g(E,T){for(let R of T)if(E.type.startsWith(R))return!0;return!1}let y=(E,T)=>{for(;E!==t.$getRoot()&&E!=null;){if(T(E))return E;E=E.getParent()}return null};return vn.$splitNode=t.$splitNode,vn.isHTMLAnchorElement=t.isHTMLAnchorElement,vn.isHTMLElement=t.isHTMLElement,vn.$dfs=function(E,T){let R=[];E=(E||t.$getRoot()).getLatest(),T=T||(t.$isElementNode(E)?E.getLastDescendant():E);for(var I=E,k=0;(I=I.getParent())!==null;)k++;for(I=k;E!==null&&!E.is(T);)if(R.push({depth:I,node:E}),t.$isElementNode(E)&&0<E.getChildrenSize())E=E.getFirstChild(),I++;else for(k=null;k===null&&E!==null;)k=E.getNextSibling(),k===null?(E=E.getParent(),I--):E=k;return E!==null&&E.is(T)&&R.push({depth:I,node:E}),R},vn.$filter=function(E,T){let R=[];for(let I=0;I<E.length;I++){let k=T(E[I]);k!==null&&R.push(k)}return R},vn.$findMatchingParent=y,vn.$getNearestBlockElementAncestorOrThrow=function(E){let T=y(E,R=>t.$isElementNode(R)&&!R.isInline());return t.$isElementNode(T)||n(4,E.__key),T},vn.$getNearestNodeOfType=function(E,T){for(;E!=null;){if(E instanceof T)return E;E=E.getParent()}return null},vn.$insertFirst=function(E,T){let R=E.getFirstChild();R!==null?R.insertBefore(T):E.append(T)},vn.$insertNodeToNearestRoot=function(E){var T=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(T)){var{focus:R}=T;if(T=R.getNode(),R=R.offset,t.$isRootOrShadowRoot(T))R=T.getChildAtIndex(R),R==null?T.append(E):R.insertBefore(E),E.selectNext();else{let I,k;t.$isTextNode(T)?(I=T.getParentOrThrow(),k=T.getIndexWithinParent(),0<R&&(k+=1,T.splitText(R))):(I=T,k=R),[,T]=t.$splitNode(I,k),T.insertBefore(E),T.selectStart()}}else T!=null?(T=T.getNodes(),T[T.length-1].getTopLevelElementOrThrow().insertAfter(E)):t.$getRoot().append(E),T=t.$createParagraphNode(),E.insertAfter(T),T.select();return E.getLatest()},vn.$restoreEditorState=function(E,T){let R=new Map,I=E._pendingEditorState;for(let[k,U]of T._nodeMap){let C=e.$cloneWithProperties(U);if(t.$isTextNode(C)){if(!t.$isTextNode(U))throw Error("Expected node be a TextNode");C.__text=U.__text}R.set(k,C)}I&&(I._nodeMap=R),E._dirtyType=2,E=T._selection,t.$setSelection(E===null?null:E.clone())},vn.$wrapNodeInElement=function(E,T){return T=T(),E.replace(T),T.append(E),T},vn.addClassNamesToElement=function(E,...T){T.forEach(R=>{typeof R=="string"&&(R=R.split(" ").filter(I=>I!==""),E.classList.add(...R))})},vn.isMimeType=g,vn.markSelection=function(E,T){function R(z){z.read(()=>{var Q=t.$getSelection();if(t.$isRangeSelection(Q)){var{anchor:F,focus:W}=Q;Q=F.getNode();var G=Q.getKey(),q=F.offset,le=W.getNode(),se=le.getKey(),ge=W.offset,j=E.getElementByKey(G),B=E.getElementByKey(se);if(G=I===null||j===null||q!==k||G!==I.getKey()||Q!==I&&(!(I instanceof t.TextNode)||Q.updateDOM(I,j,E._config)),se=U===null||B===null||ge!==C||se!==U.getKey()||le!==U&&(!(U instanceof t.TextNode)||le.updateDOM(U,B,E._config)),G||se){j=E.getElementByKey(F.getNode().getKey());var V=E.getElementByKey(W.getNode().getKey());if(j!==null&&V!==null&&j.tagName==="SPAN"&&V.tagName==="SPAN"){if(se=document.createRange(),W.isBefore(F)?(G=V,B=W.offset,V=j,j=F.offset):(G=j,B=F.offset,j=W.offset),G=G.firstChild,G===null||(V=V.firstChild,V===null))throw Error("Expected text node to be first child of span");se.setStart(G,B),se.setEnd(V,j),w(),w=d(E,se,xe=>{for(let we of xe){let Ee=we.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(xe)})}}I=Q,k=q,U=le,C=ge}else C=U=k=I=null,w(),w=()=>{}})}let I=null,k=null,U=null,C=null,w=()=>{};return R(E.getEditorState()),r(E.registerUpdateListener(({editorState:z})=>R(z)),w,()=>{w()})},vn.mediaFileReader=function(E,T){let R=E[Symbol.iterator]();return new Promise((I,k)=>{let U=[],C=()=>{const{done:w,value:z}=R.next();if(w)return I(U);const Q=new FileReader;Q.addEventListener("error",k),Q.addEventListener("load",()=>{const F=Q.result;typeof F=="string"&&U.push({file:z,result:F}),C()}),g(z,T)?Q.readAsDataURL(z):C()};C()})},vn.mergeRegister=r,vn.objectKlassEquals=function(E,T){return E!==null?Object.getPrototypeOf(E).constructor.name===T.name:!1},vn.positionNodeOnRange=d,vn.registerNestedElementResolver=function(E,T,R,I){return E.registerNodeTransform(T,k=>{e:{for(var U=k.getChildren(),C=0;C<U.length;C++)if(U[C]instanceof T){U=null;break e}for(U=k;U!==null;)if(C=U,U=U.getParent(),U instanceof T){U={child:C,parent:U};break e}U=null}if(U!==null){const{child:w,parent:z}=U;if(w.is(k)){if(I(z,k),k=w.getNextSiblings(),U=k.length,z.insertAfter(w),U!==0){C=R(z),w.insertAfter(C);for(let Q=0;Q<U;Q++)C.append(k[Q])}z.canBeEmpty()||z.getChildrenSize()!==0||z.remove()}}})},vn.removeClassNamesFromElement=function(E,...T){T.forEach(R=>{typeof R=="string"&&E.classList.remove(...R.split(" "))})},vn}var eu,df;function Xn(){return df||(df=1,eu=process.env.NODE_ENV==="development"?zy():Uy()),eu}var ff;function Gy(){if(ff)return Zt;ff=1;var e=gn(),t=Xn();class n extends e.INTERNAL_PointSelection{constructor(ne,oe,Se){super(oe,Se),this.gridKey=ne}getCachedNodes(){return this._cachedNodes}setCachedNodes(ne){this._cachedNodes=ne}is(ne){return r(ne)?this.gridKey===ne.gridKey&&this.anchor.is(ne.anchor)&&this.focus.is(ne.focus):!1}set(ne,oe,Se){this.dirty=!0,this.gridKey=ne,this.anchor.key=oe,this.focus.key=Se,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ne){}insertText(){}insertNodes(ne){const oe=this.focus.getNode();if(!e.$isElementNode(oe))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(oe.select(0,oe.getChildrenSize())).insertNodes(ne)}getShape(){const ne=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ne))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const oe=e.DEPRECATED_$getGridCellNodeRect(ne);if(oe===null)throw Error("getCellRect: expected to find AnchorNode");const Se=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(Se))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const ke=e.DEPRECATED_$getGridCellNodeRect(Se);if(ke===null)throw Error("getCellRect: expected to find focusCellNode");const Me=Math.min(oe.columnIndex,ke.columnIndex),je=Math.max(oe.columnIndex,ke.columnIndex),rt=Math.min(oe.rowIndex,ke.rowIndex),it=Math.max(oe.rowIndex,ke.rowIndex);return{fromX:Math.min(Me,je),fromY:Math.min(rt,it),toX:Math.max(Me,je),toY:Math.max(rt,it)}}getNodes(){const ne=this._cachedNodes;if(ne!==null)return ne;const oe=this.anchor.getNode(),Se=this.focus.getNode(),ke=t.$findMatchingParent(oe,e.DEPRECATED_$isGridCellNode),Me=t.$findMatchingParent(Se,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(ke))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=ke.getParent();if(!e.DEPRECATED_$isGridRowNode(je))throw Error("Expected anchorCell to have a parent GridRowNode");const rt=je.getParent();if(!e.DEPRECATED_$isGridNode(rt))throw Error("Expected tableNode to have a parent GridNode");const it=Me.getParents()[1];if(it!==rt){if(rt.isParentOf(Me)){const kt=it.getParent();if(kt==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),kt.getKey())}else{const kt=rt.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,vt,Ge]=e.DEPRECATED_$computeGridMap(rt,ke,Me);let ze=Math.min(vt.startColumn,Ge.startColumn),tt=Math.min(vt.startRow,Ge.startRow),_t=Math.max(vt.startColumn+vt.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(vt.startRow+vt.cell.__rowSpan-1,Ge.startRow+Ge.cell.__rowSpan-1),Et=ze,ht=tt,xt=ze,pt=tt;function $t(kt){const{cell:jt,startColumn:bt,startRow:nn}=kt;ze=Math.min(ze,bt),tt=Math.min(tt,nn),_t=Math.max(_t,bt+jt.__colSpan-1),Nt=Math.max(Nt,nn+jt.__rowSpan-1)}for(;ze<Et||tt<ht||_t>xt||Nt>pt;){if(ze<Et){const kt=pt-ht,jt=Et-1;for(let bt=0;bt<=kt;bt++)$t(st[ht+bt][jt]);Et=jt}if(tt<ht){const kt=xt-Et,jt=ht-1;for(let bt=0;bt<=kt;bt++)$t(st[jt][Et+bt]);ht=jt}if(_t>xt){const kt=pt-ht,jt=xt+1;for(let bt=0;bt<=kt;bt++)$t(st[ht+bt][jt]);xt=jt}if(Nt>pt){const kt=xt-Et,jt=pt+1;for(let bt=0;bt<=kt;bt++)$t(st[jt][Et+bt]);pt=jt}}const Kt=[rt];let tn=null;for(let kt=tt;kt<=Nt;kt++)for(let jt=ze;jt<=_t;jt++){const{cell:bt}=st[kt][jt],nn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected GridCellNode parent to be a GridRowNode");nn!==tn&&Kt.push(nn),Kt.push(bt,...d(bt)),tn=nn}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Kt),Kt}getTextContent(){const ne=this.getNodes();let oe="";for(let Se=0;Se<ne.length;Se++)oe+=ne[Se].getTextContent();return oe}}function r(Oe){return Oe instanceof n}function c(){const Oe=e.$createPoint("root",0,"element"),ne=e.$createPoint("root",0,"element");return new n("root",Oe,ne)}function d(Oe){const ne=[],oe=[Oe];for(;oe.length>0;){const Se=oe.pop();if(Se===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(Se)&&oe.unshift(...Se.getChildren()),Se!==Oe&&ne.push(Se)}return ne}const g=/^(\d+(?:\.\d+)?)px$/,y={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class E extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ne){const oe=new E(ne.__headerState,ne.__colSpan,ne.__width,ne.__key);return oe.__rowSpan=ne.__rowSpan,oe.__backgroundColor=ne.__backgroundColor,oe}static importDOM(){return{td:ne=>({conversion:T,priority:0}),th:ne=>({conversion:T,priority:0})}}static importJSON(ne){const oe=ne.colSpan||1,Se=ne.rowSpan||1,ke=R(ne.headerState,oe,ne.width||void 0);return ke.__rowSpan=Se,ke.__backgroundColor=ne.backgroundColor||null,ke}constructor(ne=y.NO_STATUS,oe=1,Se,ke){super(oe,ke),this.__headerState=ne,this.__width=Se,this.__backgroundColor=null}createDOM(ne){const oe=document.createElement(this.getTag());return this.__width&&(oe.style.width=`${this.__width}px`),this.__colSpan>1&&(oe.colSpan=this.__colSpan),this.__rowSpan>1&&(oe.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(oe.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(oe,ne.theme.tableCell,this.hasHeader()&&ne.theme.tableCellHeader),oe}exportDOM(ne){const{element:oe}=super.exportDOM(ne);if(oe){const Se=oe,ke=700,Me=this.getParentOrThrow().getChildrenSize();Se.style.border="1px solid black",this.__colSpan>1&&(Se.colSpan=this.__colSpan),this.__rowSpan>1&&(Se.rowSpan=this.__rowSpan),Se.style.width=`${this.getWidth()||Math.max(90,ke/Me)}px`,Se.style.verticalAlign="top",Se.style.textAlign="start";const je=this.getBackgroundColor();je!==null?Se.style.backgroundColor=je:this.hasHeader()&&(Se.style.backgroundColor="#f2f3f5")}return{element:oe}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ne){const oe=this.getWritable();return oe.__headerState=ne,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ne){const oe=this.getWritable();return oe.__width=ne,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ne){this.getWritable().__backgroundColor=ne}toggleHeaderStyle(ne){const oe=this.getWritable();return(oe.__headerState&ne)===ne?oe.__headerState-=ne:oe.__headerState+=ne,oe}hasHeaderState(ne){return(this.getHeaderStyles()&ne)===ne}hasHeader(){return this.getLatest().__headerState!==y.NO_STATUS}updateDOM(ne){return ne.__headerState!==this.__headerState||ne.__width!==this.__width||ne.__colSpan!==this.__colSpan||ne.__rowSpan!==this.__rowSpan||ne.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(Oe){const ne=Oe,oe=Oe.nodeName.toLowerCase();let Se;g.test(ne.style.width)&&(Se=parseFloat(ne.style.width));const ke=R(oe==="th"?y.ROW:y.NO_STATUS,ne.colSpan,Se);ke.__rowSpan=ne.rowSpan;const Me=ne.style.backgroundColor;return Me!==""&&(ke.__backgroundColor=Me),{forChild:(je,rt)=>{if(I(rt)&&!e.$isElementNode(je)){const it=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
75
|
-
`?null:(it.append(je),it)}return je},node:ke}}function R(Oe,ne=1,oe){return e.$applyNodeReplacement(new E(Oe,ne,oe))}function I(Oe){return Oe instanceof E}class k extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ne){return new k(ne.__height,ne.__key)}static importDOM(){return{tr:ne=>({conversion:U,priority:0})}}static importJSON(ne){return C(ne.height)}constructor(ne,oe){super(oe),this.__height=ne}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ne){const oe=document.createElement("tr");return this.__height&&(oe.style.height=`${this.__height}px`),t.addClassNamesToElement(oe,ne.theme.tableRow),oe}isShadowRoot(){return!0}setHeight(ne){const oe=this.getWritable();return oe.__height=ne,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ne){return ne.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function U(Oe){const ne=Oe;let oe;return g.test(ne.style.height)&&(oe=parseFloat(ne.style.height)),{node:C(oe)}}function C(Oe){return e.$applyNodeReplacement(new k(Oe))}function w(Oe){return Oe instanceof k}const z=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q=Oe=>z?(Oe||window).getSelection():null;class F{constructor(ne,oe){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=oe,this.editor=ne,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(ne=>ne())}trackTableGrid(){const ne=new MutationObserver(oe=>{this.editor.update(()=>{let Se=!1;for(let Me=0;Me<oe.length;Me++){const it=oe[Me].target.nodeName;if(it==="TABLE"||it==="TR"){Se=!0;break}}if(!Se)return;const ke=this.editor.getElementByKey(this.tableNodeKey);if(!ke)throw new Error("Expected to find TableElement in DOM");this.grid=ge(ke)})});this.editor.update(()=>{const oe=this.editor.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");this.grid=ge(oe),ne.observe(oe,{childList:!0,subtree:!0})})}clearHighlight(){const ne=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(),ne.update(()=>{const oe=e.$getNodeByKey(this.tableNodeKey);if(!b(oe))throw new Error("Expected TableNode.");const Se=ne.getElementByKey(this.tableNodeKey);if(!Se)throw new Error("Expected to find TableElement in DOM");const ke=ge(Se);j(ne,ke,null),e.$setSelection(null),ne.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ne=this.editor;ne.update(()=>{const oe=ne.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(oe,ne._config.theme.tableSelection),oe.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ne=this.editor;ne.update(()=>{const oe=ne.getElementByKey(this.tableNodeKey);if(!oe)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(oe,ne._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ne){if(ne!=null&&ne.gridKey===this.tableNodeKey){const oe=this.editor;this.gridSelection=ne,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(oe,this.grid,this.gridSelection)}else ne==null?this.clearHighlight():(this.tableNodeKey=ne.gridKey,this.updateTableGridSelection(ne))}setFocusCellForSelection(ne,oe=!1){const Se=this.editor;Se.update(()=>{const ke=e.$getNodeByKey(this.tableNodeKey);if(!b(ke))throw new Error("Expected TableNode.");if(!Se.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ne.x,rt=ne.y;if(this.focusCell=ne,this.anchorCell!==null){const it=Q(Se._window);it&&it.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==rt||oe))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&rt===this.focusY)return;if(this.focusX=je,this.focusY=rt,this.isHighlightingCells){const it=e.$getNearestNodeFromDOMNode(ne.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&I(it)){const st=it.getKey();this.gridSelection=this.gridSelection.clone()||c(),this.focusCellNodeKey=st,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),Se.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),j(Se,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ne){this.isHighlightingCells=!1,this.anchorCell=ne,this.anchorX=ne.x,this.anchorY=ne.y,this.editor.update(()=>{const oe=e.$getNearestNodeFromDOMNode(ne.elem);if(I(oe)){const Se=oe.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():c(),this.anchorCellNodeKey=Se}})}formatCells(ne){this.editor.update(()=>{const oe=e.$getSelection();if(!r(oe))throw Error("Expected grid selection");const Se=e.$createRangeSelection(),ke=Se.anchor,Me=Se.focus;oe.getNodes().forEach(je=>{I(je)&&je.getTextContentSize()!==0&&(ke.set(je.getKey(),0,"element"),Me.set(je.getKey(),je.getChildrenSize(),"element"),Se.formatText(ne))}),e.$setSelection(oe),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ne=this.editor;ne.update(()=>{const oe=e.$getNodeByKey(this.tableNodeKey);if(!b(oe))throw new Error("Expected TableNode.");const Se=e.$getSelection();if(!r(Se))throw Error("Expected grid selection");const ke=Se.getNodes().filter(I);if(ke.length===this.grid.columns*this.grid.rows){oe.selectPrevious(),oe.remove(),e.$getRoot().selectStart();return}ke.forEach(Me=>{if(e.$isElementNode(Me)){const je=e.$createParagraphNode(),rt=e.$createTextNode();je.append(rt),Me.append(je),Me.getChildren().forEach(it=>{it!==je&&it.remove()})}}),j(ne,this.grid,null),e.$setSelection(null),ne.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const W="__lexicalTableSelection";function G(Oe,ne,oe,Se){const ke=oe.getRootElement();if(ke===null)throw new Error("No root element.");const Me=new F(oe,Oe.getKey()),je=oe._window||window;q(ne,Me),ne.addEventListener("mousedown",Ge=>{setTimeout(()=>{if(Ge.button!==0||!je)return;const ze=se(Ge.target);ze!==null&&(O(Ge),Me.setAnchorCellForSelection(ze));const tt=()=>{je.removeEventListener("mouseup",tt),je.removeEventListener("mousemove",_t)},_t=Nt=>{const Et=se(Nt.target);Et!==null&&(Me.anchorX!==Et.x||Me.anchorY!==Et.y)&&(Nt.preventDefault(),Me.setFocusCellForSelection(Et))};je.addEventListener("mouseup",tt),je.addEventListener("mousemove",_t)},0)});const rt=Ge=>{Ge.button===0&&oe.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===Me.tableNodeKey&&ke.contains(tt)&&Me.clearHighlight()})};je.addEventListener("mousedown",rt),Me.listenersToRemove.add(()=>je.removeEventListener("mousedown",rt)),Me.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ge=>Z(oe,Ge,"down",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_UP_COMMAND,Ge=>Z(oe,Ge,"up",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ge=>Z(oe,Ge,"backward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(oe.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ge=>Z(oe,Ge,"forward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(oe.registerCommand(e.KEY_ESCAPE_COMMAND,Ge=>{const ze=e.$getSelection();if(r(ze)){const tt=t.$findMatchingParent(ze.focus.getNode(),I);if(I(tt))return O(Ge),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const it=Ge=>()=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>I(Kt));if(!I(tt))return!1;const _t=ze.anchor.getNode(),Nt=ze.focus.getNode(),Et=Oe.isParentOf(_t),ht=Oe.isParentOf(Nt);if(Et&&!ht||ht&&!Et)return Me.clearText(),!0;const pt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>e.$isElementNode(Kt)),$t=pt&&t.$findMatchingParent(pt,Kt=>e.$isElementNode(Kt)&&I(Kt.getParent()));if(!e.$isElementNode($t)||!e.$isElementNode(pt))return!1;if(Ge===e.DELETE_LINE_COMMAND&&$t.getPreviousSibling()===null)return!0;if((Ge===e.DELETE_CHARACTER_COMMAND||Ge===e.DELETE_WORD_COMMAND)&&ze.isCollapsed()&&ze.anchor.offset===0&&pt!==$t){const Kt=pt.getChildren(),tn=e.$createParagraphNode();return Kt.forEach(kt=>tn.append(kt)),pt.replace(tn),pt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ge=>{Me.listenersToRemove.add(oe.registerCommand(Ge,it(Ge),e.COMMAND_PRIORITY_CRITICAL))});const st=Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return Ge.preventDefault(),Ge.stopPropagation(),Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>I(_t));if(!I(tt))return!1}return!1};Me.listenersToRemove.add(oe.registerCommand(e.KEY_BACKSPACE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(oe.registerCommand(e.KEY_DELETE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(oe.registerCommand(e.FORMAT_TEXT_COMMAND,Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return Me.formatCells(Ge),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>I(_t));if(!I(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(oe.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ge=>{const ze=e.$getSelection();if(!ue(ze,Oe))return!1;if(r(ze))return Me.clearHighlight(),!1;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),_t=>I(_t));if(!I(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Se&&Me.listenersToRemove.add(oe.registerCommand(e.KEY_TAB_COMMAND,Ge=>{const ze=e.$getSelection();if(!e.$isRangeSelection(ze)||!ze.isCollapsed()||!ue(ze,Oe))return!1;const tt=K(ze.anchor.getNode());if(tt===null)return!1;O(Ge);const _t=Oe.getCordsFromCellNode(tt,Me.grid);return we(Me,Oe,_t.x,_t.y,Ge.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(oe.registerCommand(e.FOCUS_COMMAND,Ge=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function vt(Ge){const ze=Oe.getCordsFromCellNode(Ge,Me.grid);return Oe.getCellFromCordsOrThrow(ze.x,ze.y,Me.grid)}return Me.listenersToRemove.add(oe.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ge=>{const{nodes:ze,selection:tt}=Ge,_t=e.$INTERNAL_isPointSelection(tt),Nt=e.$isRangeSelection(tt),Et=Nt&&t.$findMatchingParent(tt.anchor.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null&&t.$findMatchingParent(tt.focus.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null||_t&&!Nt;if(ze.length!==1||!e.DEPRECATED_$isGridNode(ze[0])||!Et)return!1;const{anchor:ht}=tt,xt=ze[0],pt=xt.getChildren(),$t=xt.getFirstChildOrThrow().getChildrenSize(),Kt=xt.getChildrenSize(),tn=t.$findMatchingParent(ht.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),kt=tn&&t.$findMatchingParent(tn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),jt=kt&&t.$findMatchingParent(kt,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(tn)||!e.DEPRECATED_$isGridRowNode(kt)||!e.DEPRECATED_$isGridNode(jt))return!1;const bt=kt.getIndexWithinParent(),nn=Math.min(jt.getChildrenSize()-1,bt+Kt-1),Sr=tn.getIndexWithinParent(),pi=Math.min(kt.getChildrenSize()-1,Sr+$t-1),pe=Math.min(Sr,pi),Ze=Math.min(bt,nn),ot=Math.max(Sr,pi),wt=Math.max(bt,nn),Gt=jt.getChildren();let Bt=0,Pt,Lt;for(let Ht=Ze;Ht<=wt;Ht++){const sn=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(sn))return!1;const ln=pt[Bt];if(!e.DEPRECATED_$isGridRowNode(ln))return!1;const Rn=sn.getChildren(),mr=ln.getChildren();let jn=0;for(let dn=pe;dn<=ot;dn++){const rr=Rn[dn];if(!e.DEPRECATED_$isGridCellNode(rr))return!1;const ir=mr[jn];if(!e.DEPRECATED_$isGridCellNode(ir))return!1;Ht===Ze&&dn===pe?Pt=rr.getKey():Ht===wt&&dn===ot&&(Lt=rr.getKey());const Oi=rr.getChildren();ir.getChildren().forEach(_r=>{e.$isTextNode(_r)&&e.$createParagraphNode().append(_r),rr.append(_r)}),Oi.forEach(_r=>_r.remove()),jn++}Bt++}if(Pt&&Lt){const Ht=c();Ht.set(ze[0].getKey(),Pt,Lt),e.$setSelection(Ht)}return!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(oe.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ge=e.$getSelection(),ze=e.$getPreviousSelection();if(e.$isRangeSelection(Ge)){const{anchor:tt,focus:_t}=Ge,Nt=tt.getNode(),Et=_t.getNode(),ht=K(Nt),xt=K(Et),pt=ht&&Oe.is(P(ht)),$t=xt&&Oe.is(P(xt)),Kt=pt!==$t,tn=pt&&$t,kt=Ge.isBackward();if(Kt){const jt=Ge.clone();jt.focus.set(Oe.getKey(),kt?0:Oe.getChildrenSize(),"element"),e.$setSelection(jt),V(oe,Me)}else tn&&(ht.is(xt)||(Me.setAnchorCellForSelection(vt(ht)),Me.setFocusCellForSelection(vt(xt),!0)))}return Ge&&!Ge.is(ze)&&(r(Ge)||r(ze))&&Me.gridSelection&&!Me.gridSelection.is(ze)?(r(Ge)&&Ge.gridKey===Me.tableNodeKey?Me.updateTableGridSelection(Ge):!r(Ge)&&r(ze)&&ze.gridKey===Me.tableNodeKey&&Me.updateTableGridSelection(null),!1):(Me.hasHijackedSelectionStyles&&!Oe.isSelected()?xe(oe,Me):!Me.hasHijackedSelectionStyles&&Oe.isSelected()&&V(oe,Me),!1)},e.COMMAND_PRIORITY_CRITICAL)),Me}function q(Oe,ne){Oe[W]=ne}function le(Oe){return Oe[W]}function se(Oe){let ne=Oe;for(;ne!=null;){const oe=ne.nodeName;if(oe==="TD"||oe==="TH"){const Se=ne._cell;return Se===void 0?null:Se}ne=ne.parentNode}return null}function ge(Oe){const ne=[],oe={cells:ne,columns:0,rows:0};let Se=Oe.firstChild,ke=0,Me=0;for(ne.length=0;Se!=null;){const je=Se.nodeName;if(je==="TD"||je==="TH"){const st=Se,vt={elem:st,hasBackgroundColor:st.style.backgroundColor!=="",highlighted:!1,x:ke,y:Me};Se._cell=vt;let Ge=ne[Me];Ge===void 0&&(Ge=ne[Me]=[]),Ge[ke]=vt}else{const st=Se.firstChild;if(st!=null){Se=st;continue}}const rt=Se.nextSibling;if(rt!=null){ke++,Se=rt;continue}const it=Se.parentNode;if(it!=null){const st=it.nextSibling;if(st==null)break;Me++,ke=0,Se=st}}return oe.columns=ke+1,oe.rows=Me+1,oe}function j(Oe,ne,oe){const Se=new Set(oe?oe.getNodes():[]);B(ne,(ke,Me)=>{const je=ke.elem;Se.has(Me)?(ke.highlighted=!0,Y(Oe,ke)):(ke.highlighted=!1,ie(Oe,ke),je.getAttribute("style")||je.removeAttribute("style"))})}function B(Oe,ne){const{cells:oe}=Oe;for(let Se=0;Se<oe.length;Se++){const ke=oe[Se];if(ke)for(let Me=0;Me<ke.length;Me++){const je=ke[Me];if(!je)continue;const rt=e.$getNearestNodeFromDOMNode(je.elem);rt!==null&&ne(je,rt,{x:Me,y:Se})}}}function V(Oe,ne){ne.disableHighlightStyle(),B(ne.grid,oe=>{oe.highlighted=!0,Y(Oe,oe)})}function xe(Oe,ne){ne.enableHighlightStyle(),B(ne.grid,oe=>{const Se=oe.elem;oe.highlighted=!1,ie(Oe,oe),Se.getAttribute("style")||Se.removeAttribute("style")})}const we=(Oe,ne,oe,Se,ke)=>{const Me=ke==="forward";switch(ke){case"backward":case"forward":return oe!==(Me?Oe.grid.columns-1:0)?$(ne.getCellNodeFromCordsOrThrow(oe+(Me?1:-1),Se,Oe.grid),Me):Se!==(Me?Oe.grid.rows-1:0)?$(ne.getCellNodeFromCordsOrThrow(Me?0:Oe.grid.columns-1,Se+(Me?1:-1),Oe.grid),Me):Me?ne.selectNext():ne.selectPrevious(),!0;case"up":return Se!==0?$(ne.getCellNodeFromCordsOrThrow(oe,Se-1,Oe.grid),!1):ne.selectPrevious(),!0;case"down":return Se!==Oe.grid.rows-1?$(ne.getCellNodeFromCordsOrThrow(oe,Se+1,Oe.grid),!0):ne.selectNext(),!0;default:return!1}},Ee=(Oe,ne,oe,Se,ke)=>{const Me=ke==="forward";switch(ke){case"backward":case"forward":return oe!==(Me?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe+(Me?1:-1),Se,Oe.grid)),!0;case"up":return Se!==0?(Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe,Se-1,Oe.grid)),!0):!1;case"down":return Se!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ne.getCellFromCordsOrThrow(oe,Se+1,Oe.grid)),!0):!1;default:return!1}};function ue(Oe,ne){if(e.$isRangeSelection(Oe)||r(Oe)){const oe=ne.isParentOf(Oe.anchor.getNode()),Se=ne.isParentOf(Oe.focus.getNode());return oe&&Se}return!1}function $(Oe,ne){ne?Oe.selectStart():Oe.selectEnd()}const x="172,206,247";function Y(Oe,ne){const oe=ne.elem,Se=e.$getNearestNodeFromDOMNode(oe);if(!I(Se))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Se.getBackgroundColor()===null?oe.style.setProperty("background-color",`rgb(${x})`):oe.style.setProperty("background-image",`linear-gradient(to right, rgba(${x},0.85), rgba(${x},0.85))`),oe.style.setProperty("caret-color","transparent")}function ie(Oe,ne){const oe=ne.elem,Se=e.$getNearestNodeFromDOMNode(oe);if(!I(Se))throw Error("Expected to find LexicalNode from Table Cell DOMNode");Se.getBackgroundColor()===null&&oe.style.removeProperty("background-color"),oe.style.removeProperty("background-image"),oe.style.removeProperty("caret-color")}function K(Oe){const ne=t.$findMatchingParent(Oe,I);return I(ne)?ne:null}function P(Oe){const ne=t.$findMatchingParent(Oe,b);return b(ne)?ne:null}function Z(Oe,ne,oe,Se,ke){const Me=e.$getSelection();if(!ue(Me,Se))return!1;if(e.$isRangeSelection(Me)&&Me.isCollapsed()){if(oe==="backward"||oe==="forward")return!1;const{anchor:je,focus:rt}=Me,it=t.$findMatchingParent(je.getNode(),I),st=t.$findMatchingParent(rt.getNode(),I);if(!I(it)||!it.is(st))return!1;const vt=P(it);if(vt!==Se&&vt!=null){const xt=Oe.getElementByKey(vt.getKey());if(xt!=null)return ke.grid=ge(xt),Z(Oe,ne,oe,vt,ke)}const Ge=Oe.getElementByKey(it.__key),ze=Oe.getElementByKey(je.key);if(ze==null||Ge==null)return!1;let tt;if(je.type==="element")tt=ze.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const _t=oe==="up"?it.getFirstChild():it.getLastChild();if(_t==null)return!1;const Nt=Oe.getElementByKey(_t.__key);if(Nt==null)return!1;const Et=Nt.getBoundingClientRect();if(oe==="up"?Et.top>tt.top-tt.height:tt.bottom+tt.height>Et.bottom){O(ne);const xt=Se.getCordsFromCellNode(it,ke.grid);if(ne.shiftKey){const pt=Se.getCellFromCordsOrThrow(xt.x,xt.y,ke.grid);ke.setAnchorCellForSelection(pt),ke.setFocusCellForSelection(pt,!0)}else return we(ke,Se,xt.x,xt.y,oe);return!0}}else if(r(Me)){const{anchor:je,focus:rt}=Me,it=t.$findMatchingParent(je.getNode(),I),st=t.$findMatchingParent(rt.getNode(),I),[vt]=Me.getNodes(),Ge=Oe.getElementByKey(vt.getKey());if(!I(it)||!I(st)||!b(vt)||Ge==null)return!1;ke.updateTableGridSelection(Me);const ze=ge(Ge),tt=Se.getCordsFromCellNode(it,ze),_t=Se.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(ke.setAnchorCellForSelection(_t),O(ne),ne.shiftKey){const Nt=Se.getCordsFromCellNode(st,ze);return Ee(ke,vt,Nt.x,Nt.y,oe)}else st.selectEnd();return!0}return!1}function O(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class H extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ne){return new H(ne.__key)}static importDOM(){return{table:ne=>({conversion:de,priority:1})}}static importJSON(ne){return _e()}constructor(ne){super(ne)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ne,oe){const Se=document.createElement("table");return t.addClassNamesToElement(Se,ne.theme.table),Se}updateDOM(){return!1}exportDOM(ne){return{...super.exportDOM(ne),after:oe=>{if(oe){const Se=oe.cloneNode(),ke=document.createElement("colgroup"),Me=document.createElement("tbody");t.isHTMLElement(oe)&&Me.append(...oe.children);const je=this.getFirstChildOrThrow();if(!w(je))throw new Error("Expected to find row node.");const rt=je.getChildrenSize();for(let it=0;it<rt;it++){const st=document.createElement("col");ke.append(st)}return Se.replaceChildren(ke,Me),Se}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ne,oe){const{rows:Se,cells:ke}=oe;for(let Me=0;Me<Se;Me++){const je=ke[Me];if(je==null)continue;const rt=je.findIndex(it=>{if(!it)return;const{elem:st}=it;return e.$getNearestNodeFromDOMNode(st)===ne});if(rt!==-1)return{x:rt,y:Me}}throw new Error("Cell not found in table.")}getCellFromCords(ne,oe,Se){const{cells:ke}=Se,Me=ke[oe];if(Me==null)return null;const je=Me[ne];return je??null}getCellFromCordsOrThrow(ne,oe,Se){const ke=this.getCellFromCords(ne,oe,Se);if(!ke)throw new Error("Cell not found at cords.");return ke}getCellNodeFromCords(ne,oe,Se){const ke=this.getCellFromCords(ne,oe,Se);if(ke==null)return null;const Me=e.$getNearestNodeFromDOMNode(ke.elem);return I(Me)?Me:null}getCellNodeFromCordsOrThrow(ne,oe,Se){const ke=this.getCellNodeFromCords(ne,oe,Se);if(!ke)throw new Error("Node at cords not TableCellNode.");return ke}canSelectBefore(){return!0}canIndent(){return!1}}function J(Oe,ne){const oe=Oe.getElementByKey(ne.getKey());if(oe==null)throw new Error("Table Element Not Found");return ge(oe)}function de(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new H)}function b(Oe){return Oe instanceof H}function v(Oe,ne,oe=!0){const Se=_e();for(let ke=0;ke<Oe;ke++){const Me=C();for(let je=0;je<ne;je++){let rt=y.NO_STATUS;typeof oe=="object"?(ke===0&&oe.rows&&(rt|=y.ROW),je===0&&oe.columns&&(rt|=y.COLUMN)):oe&&(ke===0&&(rt|=y.ROW),je===0&&(rt|=y.COLUMN));const it=R(rt),st=e.$createParagraphNode();st.append(e.$createTextNode()),it.append(st),Me.append(it)}Se.append(Me)}return Se}function M(Oe){const ne=t.$findMatchingParent(Oe,oe=>I(oe));return I(ne)?ne:null}function re(Oe){const ne=t.$findMatchingParent(Oe,oe=>w(oe));if(w(ne))return ne;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ne=t.$findMatchingParent(Oe,oe=>b(oe));if(b(ne))return ne;throw new Error("Expected table cell to be inside of table.")}function Ae(Oe){const ne=re(Oe);return ye(ne).getChildren().findIndex(Se=>Se.is(ne))}function ee(Oe){return re(Oe).getChildren().findIndex(oe=>oe.is(Oe))}function te(Oe,ne){const oe=ye(Oe),{x:Se,y:ke}=oe.getCordsFromCellNode(Oe,ne);return{above:oe.getCellNodeFromCords(Se,ke-1,ne),below:oe.getCellNodeFromCords(Se,ke+1,ne),left:oe.getCellNodeFromCords(Se-1,ke,ne),right:oe.getCellNodeFromCords(Se+1,ke,ne)}}function ce(Oe,ne){const oe=Oe.getChildren();if(ne>=oe.length||ne<0)throw new Error("Expected table cell to be inside of table row.");return oe[ne].remove(),Oe}function be(Oe,ne,oe=!0,Se,ke){const Me=Oe.getChildren();if(ne>=Me.length||ne<0)throw new Error("Table row target index out of range");const je=Me[ne];if(w(je))for(let rt=0;rt<Se;rt++){const it=je.getChildren(),st=it.length,vt=C();for(let Ge=0;Ge<st;Ge++){const ze=it[Ge];if(!I(ze))throw Error("Expected table cell");const{above:tt,below:_t}=te(ze,ke);let Nt=y.NO_STATUS;const Et=tt&&tt.getWidth()||_t&&_t.getWidth()||void 0;(tt&&tt.hasHeaderState(y.COLUMN)||_t&&_t.hasHeaderState(y.COLUMN))&&(Nt|=y.COLUMN);const ht=R(Nt,1,Et);ht.append(e.$createParagraphNode()),vt.append(ht)}oe?je.insertAfter(vt):je.insertBefore(vt)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ne=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ne))throw Error("Expected a INTERNAL_PointSelection");const oe=ne.focus.getNode(),[Se,,ke]=e.DEPRECATED_$getNodeTriplet(oe),[Me,je]=e.DEPRECATED_$computeGridMap(ke,Se,Se),rt=Me[0].length,{startRow:it}=je;if(Oe){const st=it+Se.__rowSpan-1,vt=Me[st],Ge=C();for(let tt=0;tt<rt;tt++){const{cell:_t,startRow:Nt}=vt[tt];Nt+_t.__rowSpan-1<=st?Ge.append(R(y.NO_STATUS).append(e.$createParagraphNode())):_t.setRowSpan(_t.__rowSpan+1)}const ze=ke.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const st=Me[it],vt=C();for(let ze=0;ze<rt;ze++){const{cell:tt,startRow:_t}=st[ze];_t===it?vt.append(R(y.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=ke.getChildAtIndex(it);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(vt)}}function Re(Oe,ne,oe=!0,Se,ke){const Me=Oe.getChildren(),je=[];for(let rt=0;rt<Me.length;rt++){const it=Me[rt];if(w(it))for(let st=0;st<Se;st++){const vt=it.getChildren();if(ne>=vt.length||ne<0)throw new Error("Table column target index out of range");const Ge=vt[ne];if(!I(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=te(Ge,ke);let _t=y.NO_STATUS;(ze&&ze.hasHeaderState(y.ROW)||tt&&tt.hasHeaderState(y.ROW))&&(_t|=y.ROW);const Nt=R(_t);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:rt,targetCell:it})=>{oe?it.insertAfter(rt):it.insertBefore(rt)}),Oe}function Le(Oe=!0){const ne=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ne))throw Error("Expected a PointSeleciton");const oe=ne.anchor.getNode(),Se=ne.focus.getNode(),[ke]=e.DEPRECATED_$getNodeTriplet(oe),[Me,,je]=e.DEPRECATED_$getNodeTriplet(Se),[rt,it,st]=e.DEPRECATED_$computeGridMap(je,Me,ke),vt=rt.length,Ge=Oe?Math.max(it.startColumn,st.startColumn):Math.min(it.startColumn,st.startColumn),ze=Oe?Ge+Me.__colSpan-1:Ge-1,tt=je.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let _t=null;function Nt(){const ht=R(y.NO_STATUS).append(e.$createParagraphNode());return _t===null&&(_t=ht),ht}let Et=tt;e:for(let ht=0;ht<vt;ht++){if(ht!==0){const tn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(tn))throw Error("Expected row nextSibling to be a row");Et=tn}const xt=rt[ht];if(ze<0){Dt(Et,Nt());continue}const{cell:pt,startColumn:$t,startRow:Kt}=xt[ze];if($t+pt.__colSpan-1<=ze){let tn=pt,kt=Kt,jt=ze;for(;kt!==ht&&tn.__rowSpan>1;)if(jt-=pt.__colSpan,jt>=0){const{cell:bt,startRow:nn}=xt[jt];tn=bt,kt=nn}else{Et.append(Nt());continue e}tn.insertAfter(Nt())}else pt.setColSpan(pt.__colSpan+1)}_t!==null&&ct(_t)}function Fe(Oe,ne){const oe=Oe.getChildren();for(let Se=0;Se<oe.length;Se++){const ke=oe[Se];if(w(ke)){const Me=ke.getChildren();if(ne>=Me.length||ne<0)throw new Error("Table column target index out of range");Me[ne].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),oe=Oe.focus.getNode(),[Se,,ke]=e.DEPRECATED_$getNodeTriplet(ne),[Me]=e.DEPRECATED_$getNodeTriplet(oe),[je,rt,it]=e.DEPRECATED_$computeGridMap(ke,Se,Me),{startRow:st}=rt,{startRow:vt}=it,Ge=vt+Me.__rowSpan-1;if(je.length===Ge-st+1){ke.remove();return}const ze=je[0].length,tt=je[Ge+1],_t=ke.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=st;Nt--){for(let ht=ze-1;ht>=0;ht--){const{cell:xt,startRow:pt,startColumn:$t}=je[Nt][ht];if($t===ht&&(Nt===st&&pt<st&&xt.setRowSpan(xt.__rowSpan-(pt-st)),pt>=st&&pt+xt.__rowSpan-1>Ge)){if(xt.setRowSpan(xt.__rowSpan-(Ge-pt+1)),_t===null)throw Error("Expected nextRowNode not to be null");if(ht===0)Dt(_t,xt);else{const{cell:Kt}=tt[ht-1];Kt.insertAfter(xt)}}}const Et=ke.getChildAtIndex(Nt);if(!e.DEPRECATED_$isGridRowNode(Et))throw Error(`Expected GridNode childAtIndex(${String(Nt)}) to be RowNode`);Et.remove()}if(tt!==void 0){const{cell:Nt}=tt[0];ct(Nt)}else{const Nt=je[st-1],{cell:Et}=Nt[0];ct(Et)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),oe=Oe.focus.getNode(),[Se,,ke]=e.DEPRECATED_$getNodeTriplet(ne),[Me]=e.DEPRECATED_$getNodeTriplet(oe),[je,rt,it]=e.DEPRECATED_$computeGridMap(ke,Se,Me),{startColumn:st}=rt,{startRow:vt,startColumn:Ge}=it,ze=Math.min(st,Ge),tt=Math.max(st+Se.__colSpan-1,Ge+Me.__colSpan-1),_t=tt-ze+1;if(je[0].length===tt-ze+1){ke.selectPrevious(),ke.remove();return}const Et=je.length;for(let pt=0;pt<Et;pt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:tn}=je[pt][$t];if(tn<ze){if($t===ze){const kt=ze-tn;Kt.setColSpan(Kt.__colSpan-Math.min(_t,Kt.__colSpan-kt))}}else if(tn+Kt.__colSpan-1>tt){if($t===tt){const kt=tt-tn+1;Kt.setColSpan(Kt.__colSpan-kt)}}else Kt.remove()}const ht=je[vt],xt=ht[Ge+Me.__colSpan];if(xt!==void 0){const{cell:pt}=xt;ct(pt)}else{const pt=ht[Ge-1],{cell:$t}=pt;ct($t)}}function ct(Oe){const ne=Oe.getFirstDescendant();ne==null?Oe.selectStart():ne.getParentOrThrow().selectStart()}function Dt(Oe,ne){const oe=Oe.getFirstChild();oe!==null?oe.insertBefore(ne):Oe.append(ne)}function Ut(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ne=Oe.anchor.getNode(),[oe,Se,ke]=e.DEPRECATED_$getNodeTriplet(ne),Me=oe.__colSpan,je=oe.__rowSpan;if(Me>1){for(let rt=1;rt<Me;rt++)oe.insertAfter(R(y.NO_STATUS));oe.setColSpan(1)}if(je>1){const[rt,it]=e.DEPRECATED_$computeGridMap(ke,oe,oe),{startColumn:st,startRow:vt}=it;let Ge;for(let ze=1;ze<je;ze++){const tt=vt+ze,_t=rt[tt];if(Ge=(Ge||Se).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ge))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Et=0;Et<st;Et++){const ht=_t[Et],xt=ht.cell;ht.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Et+=xt.__colSpan-1)}if(Nt===null)for(let Et=0;Et<Me;Et++)Dt(Ge,R(y.NO_STATUS));else for(let Et=0;Et<Me;Et++)Nt.insertAfter(R(y.NO_STATUS))}oe.setRowSpan(1)}}const en=e.createCommand("INSERT_TABLE_COMMAND");return Zt.$createGridSelection=c,Zt.$createTableCellNode=R,Zt.$createTableNode=_e,Zt.$createTableNodeWithDimensions=v,Zt.$createTableRowNode=C,Zt.$deleteTableColumn=Fe,Zt.$deleteTableColumn__EXPERIMENTAL=Be,Zt.$deleteTableRow__EXPERIMENTAL=qe,Zt.$getElementGridForTableNode=J,Zt.$getTableCellNodeFromLexicalNode=M,Zt.$getTableColumnIndexFromTableCellNode=ee,Zt.$getTableNodeFromLexicalNodeOrThrow=ye,Zt.$getTableRowIndexFromTableCellNode=Ae,Zt.$getTableRowNodeFromTableCellNodeOrThrow=re,Zt.$insertTableColumn=Re,Zt.$insertTableColumn__EXPERIMENTAL=Le,Zt.$insertTableRow=be,Zt.$insertTableRow__EXPERIMENTAL=Ne,Zt.$isGridSelection=r,Zt.$isTableCellNode=I,Zt.$isTableNode=b,Zt.$isTableRowNode=w,Zt.$removeTableRowAtIndex=ce,Zt.$unmergeCell=Ut,Zt.INSERT_TABLE_COMMAND=en,Zt.TableCellHeaderStates=y,Zt.TableCellNode=E,Zt.TableNode=H,Zt.TableRowNode=k,Zt.TableSelection=F,Zt.applyTableHandlers=G,Zt.getCellFromTarget=se,Zt.getTableSelectionFromTableElement=le,Zt}var Jt={},hf;function Yy(){if(hf)return Jt;hf=1;var e=gn(),t=Xn();function n(b){let v=new URLSearchParams;v.append("code",b);for(let M=1;M<arguments.length;M++)v.append("v",arguments[M]);throw Error(`Minified Lexical error #${b}; 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.`)}class r extends e.INTERNAL_PointSelection{constructor(v,M,re){super(M,re),this.gridKey=v}getCachedNodes(){return this._cachedNodes}setCachedNodes(v){this._cachedNodes=v}is(v){return c(v)?this.gridKey===v.gridKey&&this.anchor.is(v.anchor)&&this.focus.is(v.focus):!1}set(v,M,re){this.dirty=!0,this.gridKey=v,this.anchor.key=M,this.focus.key=re,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(v){let M=this.focus.getNode();if(!e.$isElementNode(M))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(M.select(0,M.getChildrenSize())).insertNodes(v)}getShape(){var v=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(v)||n(103),v=e.DEPRECATED_$getGridCellNodeRect(v),v===null)throw Error("getCellRect: expected to find AnchorNode");var M=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(M)||n(104);let re=e.DEPRECATED_$getGridCellNodeRect(M);if(re===null)throw Error("getCellRect: expected to find focusCellNode");M=Math.min(v.columnIndex,re.columnIndex);let ye=Math.max(v.columnIndex,re.columnIndex),Ae=Math.min(v.rowIndex,re.rowIndex);return v=Math.max(v.rowIndex,re.rowIndex),{fromX:Math.min(M,ye),fromY:Math.min(Ae,v),toX:Math.max(M,ye),toY:Math.max(Ae,v)}}getNodes(){function v(ct){let{cell:Dt,startColumn:Ut,startRow:en}=ct;be=Math.min(be,Ut),Ne=Math.min(Ne,en),Re=Math.max(Re,Ut+Dt.__colSpan-1),Le=Math.max(Le,en+Dt.__rowSpan-1)}var M=this._cachedNodes;if(M!==null)return M;var re=this.anchor.getNode();M=this.focus.getNode();var ye=t.$findMatchingParent(re,e.DEPRECATED_$isGridCellNode);re=t.$findMatchingParent(M,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(re)||n(104),M=ye.getParent(),e.DEPRECATED_$isGridRowNode(M)||n(105),M=M.getParent(),e.DEPRECATED_$isGridNode(M)||n(106);var Ae=re.getParents()[1];if(Ae!==M){if(M.isParentOf(re)){if(M=Ae.getParent(),M==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,re.getKey(),M.getKey())}else{if(M=M.getParent(),M==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,M.getKey(),re.getKey())}return this.getNodes()}let[ee,te,ce]=e.DEPRECATED_$computeGridMap(M,ye,re),be=Math.min(te.startColumn,ce.startColumn),Ne=Math.min(te.startRow,ce.startRow),Re=Math.max(te.startColumn+te.cell.__colSpan-1,ce.startColumn+ce.cell.__colSpan-1),Le=Math.max(te.startRow+te.cell.__rowSpan-1,ce.startRow+ce.cell.__rowSpan-1);re=be,ye=Ne,Ae=be;for(var Fe=Ne;be<re||Ne<ye||Re>Ae||Le>Fe;){if(be<re){var qe=Fe-ye;--re;for(var Be=0;Be<=qe;Be++)v(ee[ye+Be][re])}if(Ne<ye)for(qe=Ae-re,--ye,Be=0;Be<=qe;Be++)v(ee[ye][re+Be]);if(Re>Ae)for(qe=Fe-ye,Ae+=1,Be=0;Be<=qe;Be++)v(ee[ye+Be][Ae]);if(Le>Fe)for(qe=Ae-re,Fe+=1,Be=0;Be<=qe;Be++)v(ee[Fe][re+Be])}for(M=[M],re=null,ye=Ne;ye<=Le;ye++)for(Ae=be;Ae<=Re;Ae++)({cell:Fe}=ee[ye][Ae]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==re&&M.push(qe),M.push(Fe,...g(Fe)),re=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=M),M}getTextContent(){let v=this.getNodes(),M="";for(let re=0;re<v.length;re++)M+=v[re].getTextContent();return M}}function c(b){return b instanceof r}function d(){let b=e.$createPoint("root",0,"element"),v=e.$createPoint("root",0,"element");return new r("root",b,v)}function g(b){let v=[],M=[b];for(;0<M.length;){let re=M.pop();re===void 0&&n(112),e.$isElementNode(re)&&M.unshift(...re.getChildren()),re!==b&&v.push(re)}return v}let y=/^(\d+(?:\.\d+)?)px$/,E={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class T extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(v){let M=new T(v.__headerState,v.__colSpan,v.__width,v.__key);return M.__rowSpan=v.__rowSpan,M.__backgroundColor=v.__backgroundColor,M}static importDOM(){return{td:()=>({conversion:R,priority:0}),th:()=>({conversion:R,priority:0})}}static importJSON(v){let M=v.rowSpan||1,re=I(v.headerState,v.colSpan||1,v.width||void 0);return re.__rowSpan=M,re.__backgroundColor=v.backgroundColor||null,re}constructor(v=E.NO_STATUS,M=1,re,ye){super(M,ye),this.__headerState=v,this.__width=re,this.__backgroundColor=null}createDOM(v){let M=document.createElement(this.getTag());return this.__width&&(M.style.width=`${this.__width}px`),1<this.__colSpan&&(M.colSpan=this.__colSpan),1<this.__rowSpan&&(M.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(M.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(M,v.theme.tableCell,this.hasHeader()&&v.theme.tableCellHeader),M}exportDOM(v){if({element:v}=super.exportDOM(v),v){var M=this.getParentOrThrow().getChildrenSize();v.style.border="1px solid black",1<this.__colSpan&&(v.colSpan=this.__colSpan),1<this.__rowSpan&&(v.rowSpan=this.__rowSpan),v.style.width=`${this.getWidth()||Math.max(90,700/M)}px`,v.style.verticalAlign="top",v.style.textAlign="start",M=this.getBackgroundColor(),M!==null?v.style.backgroundColor=M:this.hasHeader()&&(v.style.backgroundColor="#f2f3f5")}return{element:v}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(v){return this.getWritable().__headerState=v,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(v){return this.getWritable().__width=v,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(v){this.getWritable().__backgroundColor=v}toggleHeaderStyle(v){let M=this.getWritable();return M.__headerState=(M.__headerState&v)===v?M.__headerState-v:M.__headerState+v,M}hasHeaderState(v){return(this.getHeaderStyles()&v)===v}hasHeader(){return this.getLatest().__headerState!==E.NO_STATUS}updateDOM(v){return v.__headerState!==this.__headerState||v.__width!==this.__width||v.__colSpan!==this.__colSpan||v.__rowSpan!==this.__rowSpan||v.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function R(b){var v=b.nodeName.toLowerCase();let M;return y.test(b.style.width)&&(M=parseFloat(b.style.width)),v=I(v==="th"?E.ROW:E.NO_STATUS,b.colSpan,M),v.__rowSpan=b.rowSpan,b=b.style.backgroundColor,b!==""&&(v.__backgroundColor=b),{forChild:(re,ye)=>k(ye)&&!e.$isElementNode(re)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(re)&&re.getTextContent()===`
|
|
76
|
-
`?null:(ye.append(re),ye)):re,node:v}}function I(b,v=1,M){return e.$applyNodeReplacement(new T(b,v,M))}function k(b){return b instanceof T}class U extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(v){return new U(v.__height,v.__key)}static importDOM(){return{tr:()=>({conversion:C,priority:0})}}static importJSON(v){return w(v.height)}constructor(v,M){super(M),this.__height=v}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(v){let M=document.createElement("tr");return this.__height&&(M.style.height=`${this.__height}px`),t.addClassNamesToElement(M,v.theme.tableRow),M}isShadowRoot(){return!0}setHeight(v){return this.getWritable().__height=v,this.__height}getHeight(){return this.getLatest().__height}updateDOM(v){return v.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function C(b){let v;return y.test(b.style.height)&&(v=parseFloat(b.style.height)),{node:w(v)}}function w(b){return e.$applyNodeReplacement(new U(b))}function z(b){return b instanceof U}let Q=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class F{constructor(v,M){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=M,this.editor=v,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(v=>v())}trackTableGrid(){let v=new MutationObserver(M=>{this.editor.update(()=>{var re=!1;for(let ye=0;ye<M.length;ye++){const Ae=M[ye].target.nodeName;if(Ae==="TABLE"||Ae==="TR"){re=!0;break}}if(re){if(re=this.editor.getElementByKey(this.tableNodeKey),!re)throw Error("Expected to find TableElement in DOM");this.grid=G(re)}})});this.editor.update(()=>{let M=this.editor.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");this.grid=G(M),v.observe(M,{childList:!0,subtree:!0})})}clearHighlight(){let v=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(),v.update(()=>{var M=e.$getNodeByKey(this.tableNodeKey);if(!P(M))throw Error("Expected TableNode.");if(M=v.getElementByKey(this.tableNodeKey),!M)throw Error("Expected to find TableElement in DOM");M=G(M),q(v,M,null),e.$setSelection(null),v.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let v=this.editor;v.update(()=>{let M=v.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(M,v._config.theme.tableSelection),M.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let v=this.editor;v.update(()=>{let M=v.getElementByKey(this.tableNodeKey);if(!M)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(M,v._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(v){if(v!=null&&v.gridKey===this.tableNodeKey){let M=this.editor;this.gridSelection=v,this.isHighlightingCells=!0,this.disableHighlightStyle(),q(M,this.grid,this.gridSelection)}else v==null?this.clearHighlight():(this.tableNodeKey=v.gridKey,this.updateTableGridSelection(v))}setFocusCellForSelection(v,M=!1){let re=this.editor;re.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!P(ye))throw Error("Expected TableNode.");if(!re.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=v.x;let Ae=v.y;if(this.focusCell=v,this.anchorCell!==null){let ee=Q?(re._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==Ae||M))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&Ae===this.focusY)return;this.focusX=ye,this.focusY=Ae,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(v.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&k(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),re.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),q(re,this.grid,this.gridSelection)))})}setAnchorCellForSelection(v){this.isHighlightingCells=!1,this.anchorCell=v,this.anchorX=v.x,this.anchorY=v.y,this.editor.update(()=>{var M=e.$getNearestNodeFromDOMNode(v.elem);k(M)&&(M=M.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=M)})}formatCells(v){this.editor.update(()=>{let M=e.$getSelection();c(M)||n(11);let re=e.$createRangeSelection(),ye=re.anchor,Ae=re.focus;M.getNodes().forEach(ee=>{k(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),Ae.set(ee.getKey(),ee.getChildrenSize(),"element"),re.formatText(v))}),e.$setSelection(M),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let v=this.editor;v.update(()=>{let M=e.$getNodeByKey(this.tableNodeKey);if(!P(M))throw Error("Expected TableNode.");var re=e.$getSelection();c(re)||n(11),re=re.getNodes().filter(k),re.length===this.grid.columns*this.grid.rows?(M.selectPrevious(),M.remove(),e.$getRoot().selectStart()):(re.forEach(ye=>{if(e.$isElementNode(ye)){let Ae=e.$createParagraphNode(),ee=e.$createTextNode();Ae.append(ee),ye.append(Ae),ye.getChildren().forEach(te=>{te!==Ae&&te.remove()})}}),q(v,this.grid,null),e.$setSelection(null),v.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function W(b){for(;b!=null;){let v=b.nodeName;if(v==="TD"||v==="TH"){if(b=b._cell,b===void 0)break;return b}b=b.parentNode}return null}function G(b){let v=[],M={cells:v,columns:0,rows:0};var re=b.firstChild;let ye=b=0;for(v.length=0;re!=null;){var Ae=re.nodeName;if(Ae==="TD"||Ae==="TH"){Ae=re,Ae={elem:Ae,hasBackgroundColor:Ae.style.backgroundColor!=="",highlighted:!1,x:b,y:ye},re._cell=Ae;let ee=v[ye];ee===void 0&&(ee=v[ye]=[]),ee[b]=Ae}else if(Ae=re.firstChild,Ae!=null){re=Ae;continue}if(Ae=re.nextSibling,Ae!=null)b++,re=Ae;else if(Ae=re.parentNode,Ae!=null){if(re=Ae.nextSibling,re==null)break;ye++,b=0}}return M.columns=b+1,M.rows=ye+1,M}function q(b,v,M){let re=new Set(M?M.getNodes():[]);le(v,(ye,Ae)=>{let ee=ye.elem;re.has(Ae)?(ye.highlighted=!0,xe(b,ye)):(ye.highlighted=!1,we(b,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function le(b,v){({cells:b}=b);for(let M=0;M<b.length;M++){let re=b[M];if(re)for(let ye=0;ye<re.length;ye++){let Ae=re[ye];if(!Ae)continue;let ee=e.$getNearestNodeFromDOMNode(Ae.elem);ee!==null&&v(Ae,ee,{x:ye,y:M})}}}function se(b,v){v.disableHighlightStyle(),le(v.grid,M=>{M.highlighted=!0,xe(b,M)})}function ge(b,v){v.enableHighlightStyle(),le(v.grid,M=>{let re=M.elem;M.highlighted=!1,we(b,M),re.getAttribute("style")||re.removeAttribute("style")})}let j=(b,v,M,re,ye)=>{const Ae=ye==="forward";switch(ye){case"backward":case"forward":return M!==(Ae?b.grid.columns-1:0)?(b=v.getCellNodeFromCordsOrThrow(M+(Ae?1:-1),re,b.grid),Ae?b.selectStart():b.selectEnd()):re!==(Ae?b.grid.rows-1:0)?(b=v.getCellNodeFromCordsOrThrow(Ae?0:b.grid.columns-1,re+(Ae?1:-1),b.grid),Ae?b.selectStart():b.selectEnd()):Ae?v.selectNext():v.selectPrevious(),!0;case"up":return re!==0?v.getCellNodeFromCordsOrThrow(M,re-1,b.grid).selectEnd():v.selectPrevious(),!0;case"down":return re!==b.grid.rows-1?v.getCellNodeFromCordsOrThrow(M,re+1,b.grid).selectStart():v.selectNext(),!0;default:return!1}},B=(b,v,M,re,ye)=>{const Ae=ye==="forward";switch(ye){case"backward":case"forward":return M!==(Ae?b.grid.columns-1:0)&&b.setFocusCellForSelection(v.getCellFromCordsOrThrow(M+(Ae?1:-1),re,b.grid)),!0;case"up":return re!==0?(b.setFocusCellForSelection(v.getCellFromCordsOrThrow(M,re-1,b.grid)),!0):!1;case"down":return re!==b.grid.rows-1?(b.setFocusCellForSelection(v.getCellFromCordsOrThrow(M,re+1,b.grid)),!0):!1;default:return!1}};function V(b,v){if(e.$isRangeSelection(b)||c(b)){let M=v.isParentOf(b.anchor.getNode());return b=v.isParentOf(b.focus.getNode()),M&&b}return!1}function xe(b,v){b=v.elem,v=e.$getNearestNodeFromDOMNode(b),k(v)||n(131),v.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 we(b,v){b=v.elem,v=e.$getNearestNodeFromDOMNode(b),k(v)||n(131),v.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,k),k(b)?b:null}function ue(b){return b=t.$findMatchingParent(b,P),P(b)?b:null}function $(b,v,M,re,ye){let Ae=e.$getSelection();if(!V(Ae,re))return!1;if(e.$isRangeSelection(Ae)&&Ae.isCollapsed()){if(M==="backward"||M==="forward")return!1;let{anchor:be,focus:Ne}=Ae;var ee=t.$findMatchingParent(be.getNode(),k),te=t.$findMatchingParent(Ne.getNode(),k);if(!k(ee)||!ee.is(te))return!1;if(te=ue(ee),te!==re&&te!=null){var ce=b.getElementByKey(te.getKey());if(ce!=null)return ye.grid=G(ce),$(b,v,M,te,ye)}if(te=b.getElementByKey(ee.__key),ce=b.getElementByKey(be.key),ce==null||te==null)return!1;if(be.type==="element")te=ce.getBoundingClientRect();else{if(te=window.getSelection(),te===null||te.rangeCount===0)return!1;te=te.getRangeAt(0).getBoundingClientRect()}if(ce=M==="up"?ee.getFirstChild():ee.getLastChild(),ce==null||(b=b.getElementByKey(ce.__key),b==null))return!1;if(b=b.getBoundingClientRect(),M==="up"?b.top>te.top-te.height:te.bottom+te.height>b.bottom){if(x(v),b=re.getCordsFromCellNode(ee,ye.grid),v.shiftKey)M=re.getCellFromCordsOrThrow(b.x,b.y,ye.grid),ye.setAnchorCellForSelection(M),ye.setFocusCellForSelection(M,!0);else return j(ye,re,b.x,b.y,M);return!0}}else if(c(Ae)){let{anchor:be,focus:Ne}=Ae;return ce=t.$findMatchingParent(be.getNode(),k),te=t.$findMatchingParent(Ne.getNode(),k),[ee]=Ae.getNodes(),b=b.getElementByKey(ee.getKey()),!k(ce)||!k(te)||!P(ee)||b==null?!1:(ye.updateTableGridSelection(Ae),b=G(b),ce=re.getCordsFromCellNode(ce,b),ce=re.getCellFromCordsOrThrow(ce.x,ce.y,b),ye.setAnchorCellForSelection(ce),x(v),v.shiftKey?(v=re.getCordsFromCellNode(te,b),B(ye,ee,v.x,v.y,M)):(te.selectEnd(),!0))}return!1}function x(b){b.preventDefault(),b.stopImmediatePropagation(),b.stopPropagation()}class Y extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(v){return new Y(v.__key)}static importDOM(){return{table:()=>({conversion:ie,priority:1})}}static importJSON(){return K()}constructor(v){super(v)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(v){let M=document.createElement("table");return t.addClassNamesToElement(M,v.theme.table),M}updateDOM(){return!1}exportDOM(v){return{...super.exportDOM(v),after:M=>{if(M){let re=M.cloneNode(),ye=document.createElement("colgroup"),Ae=document.createElement("tbody");if(t.isHTMLElement(M)&&Ae.append(...M.children),M=this.getFirstChildOrThrow(),!z(M))throw Error("Expected to find row node.");M=M.getChildrenSize();for(let ee=0;ee<M;ee++){let te=document.createElement("col");ye.append(te)}return re.replaceChildren(ye,Ae),re}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(v,M){let{rows:re,cells:ye}=M;for(M=0;M<re;M++){var Ae=ye[M];if(Ae!=null&&(Ae=Ae.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===v}),Ae!==-1))return{x:Ae,y:M}}throw Error("Cell not found in table.")}getCellFromCords(v,M,re){return{cells:re}=re,M=re[M],M==null?null:(v=M[v],v??null)}getCellFromCordsOrThrow(v,M,re){if(v=this.getCellFromCords(v,M,re),!v)throw Error("Cell not found at cords.");return v}getCellNodeFromCords(v,M,re){return v=this.getCellFromCords(v,M,re),v==null?null:(v=e.$getNearestNodeFromDOMNode(v.elem),k(v)?v:null)}getCellNodeFromCordsOrThrow(v,M,re){if(v=this.getCellNodeFromCords(v,M,re),!v)throw Error("Node at cords not TableCellNode.");return v}canSelectBefore(){return!0}canIndent(){return!1}}function ie(){return{node:K()}}function K(){return e.$applyNodeReplacement(new Y)}function P(b){return b instanceof Y}function Z(b){if(b=t.$findMatchingParent(b,v=>z(v)),z(b))return b;throw Error("Expected table cell to be inside of table row.")}function O(b){if(b=t.$findMatchingParent(b,v=>P(v)),P(b))return b;throw Error("Expected table cell to be inside of table.")}function H(b,v){let M=O(b),{x:re,y:ye}=M.getCordsFromCellNode(b,v);return{above:M.getCellNodeFromCords(re,ye-1,v),below:M.getCellNodeFromCords(re,ye+1,v),left:M.getCellNodeFromCords(re-1,ye,v),right:M.getCellNodeFromCords(re+1,ye,v)}}function J(b){let v=b.getFirstDescendant();v==null?b.selectStart():v.getParentOrThrow().selectStart()}function de(b,v){let M=b.getFirstChild();M!==null?M.insertBefore(v):b.append(v)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=d,Jt.$createTableCellNode=I,Jt.$createTableNode=K,Jt.$createTableNodeWithDimensions=function(b,v,M=!0){let re=K();for(let Ae=0;Ae<b;Ae++){let ee=w();for(let te=0;te<v;te++){var ye=E.NO_STATUS;typeof M=="object"?(Ae===0&&M.rows&&(ye|=E.ROW),te===0&&M.columns&&(ye|=E.COLUMN)):M&&(Ae===0&&(ye|=E.ROW),te===0&&(ye|=E.COLUMN)),ye=I(ye);let ce=e.$createParagraphNode();ce.append(e.$createTextNode()),ye.append(ce),ee.append(ye)}re.append(ee)}return re},Jt.$createTableRowNode=w,Jt.$deleteTableColumn=function(b,v){let M=b.getChildren();for(let ye=0;ye<M.length;ye++){var re=M[ye];if(z(re)){if(re=re.getChildren(),v>=re.length||0>v)throw Error("Table column target index out of range");re[v].remove()}}return b},Jt.$deleteTableColumn__EXPERIMENTAL=function(){var b=e.$getSelection();if(!e.$INTERNAL_isPointSelection(b))throw Error("Expected a INTERNAL_PointSelection");var v=b.anchor.getNode();b=b.focus.getNode();let[M,,re]=e.DEPRECATED_$getNodeTriplet(v);[v]=e.DEPRECATED_$getNodeTriplet(b);let[ye,Ae,ee]=e.DEPRECATED_$computeGridMap(re,M,v);var{startColumn:te}=Ae;let{startRow:ce,startColumn:be}=ee;b=Math.min(te,be),te=Math.max(te+M.__colSpan-1,be+v.__colSpan-1);let Ne=te-b+1;if(ye[0].length===te-b+1)re.selectPrevious(),re.remove();else{var Re=ye.length;for(let Le=0;Le<Re;Le++)for(let Fe=b;Fe<=te;Fe++){let{cell:qe,startColumn:Be}=ye[Le][Fe];Be<b?Fe===b&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(b-Be))):Be+qe.__colSpan-1>te?Fe===te&&qe.setColSpan(qe.__colSpan-(te-Be+1)):qe.remove()}b=ye[ce],v=b[be+v.__colSpan],v!==void 0?({cell:v}=v,J(v)):({cell:v}=b[be-1],J(v))}},Jt.$deleteTableRow__EXPERIMENTAL=function(){var b=e.$getSelection();if(!e.$INTERNAL_isPointSelection(b))throw Error("Expected a INTERNAL_PointSelection");var v=b.anchor.getNode();b=b.focus.getNode();let[M,,re]=e.DEPRECATED_$getNodeTriplet(v);[b]=e.DEPRECATED_$getNodeTriplet(b);let[ye,Ae,ee]=e.DEPRECATED_$computeGridMap(re,M,b);({startRow:v}=Ae);var{startRow:te}=ee;if(b=te+b.__rowSpan-1,ye.length===b-v+1)re.remove();else{te=ye[0].length;var ce=ye[b+1],be=re.getChildAtIndex(b+1);for(let Re=b;Re>=v;Re--){for(var Ne=te-1;0<=Ne;Ne--){let{cell:Le,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===v&&Fe<v&&Le.setRowSpan(Le.__rowSpan-(Fe-v)),Fe>=v&&Fe+Le.__rowSpan-1>b))if(Le.setRowSpan(Le.__rowSpan-(b-Fe+1)),be===null&&n(122),Ne===0)de(be,Le);else{let{cell:Be}=ce[Ne-1];Be.insertAfter(Le)}}Ne=re.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ce!==void 0?({cell:v}=ce[0],J(v)):({cell:v}=ye[v-1][0],J(v))}},Jt.$getElementGridForTableNode=function(b,v){if(b=b.getElementByKey(v.getKey()),b==null)throw Error("Table Element Not Found");return G(b)},Jt.$getTableCellNodeFromLexicalNode=function(b){return b=t.$findMatchingParent(b,v=>k(v)),k(b)?b:null},Jt.$getTableColumnIndexFromTableCellNode=function(b){return Z(b).getChildren().findIndex(v=>v.is(b))},Jt.$getTableNodeFromLexicalNodeOrThrow=O,Jt.$getTableRowIndexFromTableCellNode=function(b){let v=Z(b);return O(v).getChildren().findIndex(M=>M.is(v))},Jt.$getTableRowNodeFromTableCellNodeOrThrow=Z,Jt.$insertTableColumn=function(b,v,M=!0,re,ye){let Ae=b.getChildren(),ee=[];for(let be=0;be<Ae.length;be++){let Ne=Ae[be];if(z(Ne))for(let Re=0;Re<re;Re++){var te=Ne.getChildren();if(v>=te.length||0>v)throw Error("Table column target index out of range");te=te[v],k(te)||n(12);let{left:Le,right:Fe}=H(te,ye);var ce=E.NO_STATUS;(Le&&Le.hasHeaderState(E.ROW)||Fe&&Fe.hasHeaderState(E.ROW))&&(ce|=E.ROW),ce=I(ce),ce.append(e.$createParagraphNode()),ee.push({newTableCell:ce,targetCell:te})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{M?Ne.insertAfter(be):Ne.insertBefore(be)}),b},Jt.$insertTableColumn__EXPERIMENTAL=function(b=!0){function v(){let Re=I(E.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var M=e.$getSelection();if(!e.$INTERNAL_isPointSelection(M))throw Error("Expected a PointSeleciton");var re=M.anchor.getNode();M=M.focus.getNode(),[re]=e.DEPRECATED_$getNodeTriplet(re);let[ye,,Ae]=e.DEPRECATED_$getNodeTriplet(M),[ee,te,ce]=e.DEPRECATED_$computeGridMap(Ae,ye,re);re=ee.length,M=b?Math.max(te.startColumn,ce.startColumn):Math.min(te.startColumn,ce.startColumn),b=b?M+ye.__colSpan-1:M-1,M=Ae.getFirstChild(),e.DEPRECATED_$isGridRowNode(M)||n(120);let be=null;var Ne=M;e:for(M=0;M<re;M++){M!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[M];if(0>b){de(Ne,v());continue}let{cell:Le,startColumn:Fe,startRow:qe}=Re[b];if(Fe+Le.__colSpan-1<=b){let Be=Le,ct=qe,Dt=b;for(;ct!==M&&1<Be.__rowSpan;)if(Dt-=Le.__colSpan,0<=Dt){let{cell:Ut,startRow:en}=Re[Dt];Be=Ut,ct=en}else{Ne.append(v());continue e}Be.insertAfter(v())}else Le.setColSpan(Le.__colSpan+1)}be!==null&&J(be)},Jt.$insertTableRow=function(b,v,M=!0,re,ye){var Ae=b.getChildren();if(v>=Ae.length||0>v)throw Error("Table row target index out of range");if(v=Ae[v],z(v))for(Ae=0;Ae<re;Ae++){let te=v.getChildren(),ce=te.length,be=w();for(let Ne=0;Ne<ce;Ne++){var ee=te[Ne];k(ee)||n(12);let{above:Re,below:Le}=H(ee,ye);ee=E.NO_STATUS;let Fe=Re&&Re.getWidth()||Le&&Le.getWidth()||void 0;(Re&&Re.hasHeaderState(E.COLUMN)||Le&&Le.hasHeaderState(E.COLUMN))&&(ee|=E.COLUMN),ee=I(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}M?v.insertAfter(be):v.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return b},Jt.$insertTableRow__EXPERIMENTAL=function(b=!0){var v=e.$getSelection();if(!e.$INTERNAL_isPointSelection(v))throw Error("Expected a INTERNAL_PointSelection");v=v.focus.getNode();let[M,,re]=e.DEPRECATED_$getNodeTriplet(v),[ye,Ae]=e.DEPRECATED_$computeGridMap(re,M,M);v=ye[0].length;var{startRow:ee}=Ae;if(b){b=ee+M.__rowSpan-1;var te=ye[b];ee=w();for(var ce=0;ce<v;ce++){let{cell:be,startRow:Ne}=te[ce];Ne+be.__rowSpan-1<=b?ee.append(I(E.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}v=re.getChildAtIndex(b),e.DEPRECATED_$isGridRowNode(v)||n(119),v.insertAfter(ee)}else{for(te=ye[ee],b=w(),ce=0;ce<v;ce++){let{cell:be,startRow:Ne}=te[ce];Ne===ee?b.append(I(E.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}v=re.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(v)||n(119),v.insertBefore(b)}},Jt.$isGridSelection=c,Jt.$isTableCellNode=k,Jt.$isTableNode=P,Jt.$isTableRowNode=z,Jt.$removeTableRowAtIndex=function(b,v){let M=b.getChildren();if(v>=M.length||0>v)throw Error("Expected table cell to be inside of table row.");return M[v].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[v,M,re]=e.DEPRECATED_$getNodeTriplet(b);b=v.__colSpan;let ye=v.__rowSpan;if(1<b){for(var Ae=1;Ae<b;Ae++)v.insertAfter(I(E.NO_STATUS));v.setColSpan(1)}if(1<ye){let[ce,be]=e.DEPRECATED_$computeGridMap(re,v,v),{startColumn:Ne,startRow:Re}=be,Le;for(Ae=1;Ae<ye;Ae++){var ee=Re+Ae;let Fe=ce[ee];Le=(Le||M).getNextSibling(),e.DEPRECATED_$isGridRowNode(Le)||n(125);var te=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ct=Be.cell;Be.startRow===ee&&(te=ct),1<ct.__colSpan&&(qe+=ct.__colSpan-1)}if(te===null)for(te=0;te<b;te++)de(Le,I(E.NO_STATUS));else for(ee=0;ee<b;ee++)te.insertAfter(I(E.NO_STATUS))}v.setRowSpan(1)}},Jt.INSERT_TABLE_COMMAND=_e,Jt.TableCellHeaderStates=E,Jt.TableCellNode=T,Jt.TableNode=Y,Jt.TableRowNode=U,Jt.TableSelection=F,Jt.applyTableHandlers=function(b,v,M,re){function ye(Ne){return Ne=b.getCordsFromCellNode(Ne,ee.grid),b.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let Ae=M.getRootElement();if(Ae===null)throw Error("No root element.");let ee=new F(M,b.getKey()),te=M._window||window;v.__lexicalTableSelection=ee,v.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&te){var Re=W(Ne.target);Re!==null&&(x(Ne),ee.setAnchorCellForSelection(Re));var Le=()=>{te.removeEventListener("mouseup",Le),te.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=W(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};te.addEventListener("mouseup",Le),te.addEventListener("mousemove",Fe)}},0)});let ce=Ne=>{Ne.button===0&&M.update(()=>{const Re=e.$getSelection(),Le=Ne.target;c(Re)&&Re.gridKey===ee.tableNodeKey&&Ae.contains(Le)&&ee.clearHighlight()})};te.addEventListener("mousedown",ce),ee.listenersToRemove.add(()=>te.removeEventListener("mousedown",ce)),ee.listenersToRemove.add(M.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>$(M,Ne,"down",b,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(M.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>$(M,Ne,"up",b,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(M.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>$(M,Ne,"backward",b,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(M.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>$(M,Ne,"forward",b,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(M.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return c(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),k),k(Re))?(x(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!V(Re,b))return!1;if(c(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>k(Be));if(!k(qe))return!1;var Le=Re.anchor.getNode(),Fe=Re.focus.getNode();if(Le=b.isParentOf(Le),Fe=b.isParentOf(Fe),Le&&!Fe||Fe&&!Le)return ee.clearText(),!0;if(Le=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&k(Be.getParent())),!e.$isElementNode(Le)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&Le.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==Le){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(M.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),v=Ne=>{const Re=e.$getSelection();return V(Re,b)?c(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),Le=>k(Le)),k(Ne)),!1):!1},ee.listenersToRemove.add(M.registerCommand(e.KEY_BACKSPACE_COMMAND,v,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(M.registerCommand(e.KEY_DELETE_COMMAND,v,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(M.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return V(Re,b)?c(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),Le=>k(Le)),k(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(M.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return V(Ne,b)&&(c(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>k(Re)),k(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),re&&ee.listenersToRemove.add(M.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!V(Re,b)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(x(Ne),Re=b.getCordsFromCellNode(Re,ee.grid),j(ee,b,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(M.registerCommand(e.FOCUS_COMMAND,()=>b.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(M.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:Le}=Ne;Ne=e.$INTERNAL_isPointSelection(Le);var Fe=e.$isRangeSelection(Le);if(Ne=Fe&&t.$findMatchingParent(Le.anchor.getNode(),ke=>e.DEPRECATED_$isGridCellNode(ke))!==null&&t.$findMatchingParent(Le.focus.getNode(),ke=>e.DEPRECATED_$isGridCellNode(ke))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=Le,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ct=t.$findMatchingParent(qe.getNode(),ke=>e.DEPRECATED_$isGridCellNode(ke)),Dt=(qe=ct&&t.$findMatchingParent(ct,ke=>e.DEPRECATED_$isGridRowNode(ke)))&&t.$findMatchingParent(qe,ke=>e.DEPRECATED_$isGridNode(ke));if(!e.DEPRECATED_$isGridCellNode(ct)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(Dt))return!1;var Ut=qe.getIndexWithinParent(),en=Math.min(Dt.getChildrenSize()-1,Ut+Be-1);Be=ct.getIndexWithinParent(),ct=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ct),qe=Math.min(Ut,en),Be=Math.max(Be,ct),Ut=Math.max(Ut,en),Dt=Dt.getChildren(),en=0;let Oe,ne;for(ct=qe;ct<=Ut;ct++){var oe=Dt[ct];if(!e.DEPRECATED_$isGridRowNode(oe))return!1;var Se=Ne[en];if(!e.DEPRECATED_$isGridRowNode(Se))return!1;oe=oe.getChildren(),Se=Se.getChildren();let ke=0;for(let Me=Fe;Me<=Be;Me++){let je=oe[Me];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let rt=Se[ke];if(!e.DEPRECATED_$isGridCellNode(rt))return!1;ct===qe&&Me===Fe?Oe=je.getKey():ct===Ut&&Me===Be&&(ne=je.getKey());let it=je.getChildren();rt.getChildren().forEach(st=>{e.$isTextNode(st)&&e.$createParagraphNode().append(st),je.append(st)}),it.forEach(st=>st.remove()),ke++}en++}return Oe&&ne&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ne),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(M.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ct,focus:Dt}=Ne;var Le=ct.getNode(),Fe=Dt.getNode();Le=Ee(Le),Fe=Ee(Fe);var qe=Le&&b.is(ue(Le)),Be=Fe&&b.is(ue(Fe));let Ut=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),Ut?(Le=Ne.clone(),Le.focus.set(b.getKey(),qe?0:b.getChildrenSize(),"element"),e.$setSelection(Le),se(M,ee)):Be&&!Le.is(Fe)&&(ee.setAnchorCellForSelection(ye(Le)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(c(Ne)||c(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(c(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!c(Ne)&&c(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!b.isSelected()?ge(M,ee):!ee.hasHijackedSelectionStyles&&b.isSelected()&&se(M,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Jt.getCellFromTarget=W,Jt.getTableSelectionFromTableElement=function(b){return b.__lexicalTableSelection},Jt}const jy=process.env.NODE_ENV==="development"?Gy():Yy();var Tu=jy,fr={},gf;function Vy(){if(gf)return fr;gf=1;var e=gn(),t=Xn();function n(K){let P=1,Z=K.getParent();for(;Z!=null;){if(ge(Z)){const O=Z.getParent();if(ue(O)){P++,Z=O.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return P}return P}function r(K){let P=K.getParent();if(!ue(P))throw Error("A ListItemNode must have a ListNode for a parent.");let Z=P;for(;Z!==null;)Z=Z.getParent(),ue(Z)&&(P=Z);return P}function c(K){let P=[];const Z=K.getChildren().filter(ge);for(let O=0;O<Z.length;O++){const H=Z[O],J=H.getFirstChild();ue(J)?P=P.concat(c(J)):P.push(H)}return P}function d(K){return ge(K)&&ue(K.getFirstChild())}function g(K){let P=K;for(;P.getNextSibling()==null&&P.getPreviousSibling()==null;){const Z=P.getParent();if(Z==null||!(ge(P)||ue(P)))break;P=Z}P.remove()}function y(K){return se().append(K)}function E(K,P){return ge(K)&&(P.length===0||P.length===1&&K.is(P[0])&&K.getChildrenSize()===0)}function T(K){const P=K.getParent();let Z=1;if(P!=null)if(ue(P))Z=P.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const O=K.getPreviousSiblings();for(let H=0;H<O.length;H++){const J=O[H];ge(J)&&!ue(J.getFirstChild())&&Z++}return Z}function R(K,P){K.update(()=>{const Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){const O=Z.getNodes(),J=Z.anchor.getNode(),de=J.getParent();if(E(J,O)){const _e=Ee(P);if(e.$isRootOrShadowRoot(de)){J.replace(_e);const b=se();e.$isElementNode(J)&&(b.setFormat(J.getFormatType()),b.setIndent(J.getIndent())),_e.append(b)}else if(ge(J)){const b=J.getParentOrThrow();I(_e,b.getChildren()),b.replace(_e)}return}else{const _e=new Set;for(let b=0;b<O.length;b++){const v=O[b];if(e.$isElementNode(v)&&v.isEmpty()&&!ge(v)&&!_e.has(v.getKey())){k(v,P);continue}if(e.$isLeafNode(v)){let M=v.getParent();for(;M!=null;){const re=M.getKey();if(ue(M)){if(!_e.has(re)){const ye=Ee(P);I(ye,M.getChildren()),M.replace(ye),w(ye),_e.add(re)}break}else{const ye=M.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(re)){_e.add(re),k(M,P);break}M=ye}}}}}}})}function I(K,P){K.splice(K.getChildrenSize(),0,P)}function k(K,P){if(ue(K))return K;const Z=K.getPreviousSibling(),O=K.getNextSibling(),H=se();if(H.setFormat(K.getFormatType()),H.setIndent(K.getIndent()),I(H,K.getChildren()),ue(Z)&&P===Z.getListType())return Z.append(H),K.remove(),ue(O)&&P===O.getListType()&&(I(Z,O.getChildren()),O.remove()),Z;if(ue(O)&&P===O.getListType())return O.getFirstChildOrThrow().insertBefore(H),K.remove(),O;{const J=Ee(P);return J.append(H),K.replace(J),w(J),J}}function U(K,P){const Z=K.getLastChild(),O=P.getFirstChild();Z&&O&&d(Z)&&d(O)&&(U(Z.getFirstChild(),O.getFirstChild()),O.remove());const H=P.getChildren();H.length>0&&(K.append(...H),w(K)),P.remove()}function C(K){K.update(()=>{const P=e.$getSelection();if(e.$isRangeSelection(P)){const Z=new Set,O=P.getNodes(),H=P.anchor.getNode();if(E(H,O))Z.add(r(H));else for(let J=0;J<O.length;J++){const de=O[J];if(e.$isLeafNode(de)){const _e=t.$getNearestNodeOfType(de,W);_e!=null&&Z.add(r(_e))}}for(const J of Z){let de=J;const _e=c(J);for(const b of _e){const v=e.$createParagraphNode();I(v,b.getChildren()),de.insertAfter(v),de=v,b.__key===P.anchor.key&&P.anchor.set(v.getKey(),0,"element"),b.__key===P.focus.key&&P.focus.set(v.getKey(),0,"element"),b.remove()}J.remove()}}})}function w(K,P){const Z=P||K.getChildren();if(Z!==void 0)for(let O=0;O<Z.length;O++){const H=Z[O];if(ge(H)){const J=H.getValue(),de=T(H);J!==de&&H.setValue(de)}}}function z(K){const P=new Set;if(d(K)||P.has(K.getKey()))return;const Z=K.getParent(),O=K.getNextSibling(),H=K.getPreviousSibling();if(d(O)&&d(H)){const J=H.getFirstChild();if(ue(J)){J.append(K);const de=O.getFirstChild();if(ue(de)){const _e=de.getChildren();I(J,_e),O.remove(),P.add(O.getKey())}w(J)}}else if(d(O)){const J=O.getFirstChild();if(ue(J)){const de=J.getFirstChild();de!==null&&de.insertBefore(K),w(J)}}else if(d(H)){const J=H.getFirstChild();ue(J)&&(J.append(K),w(J))}else if(ue(Z)){const J=se(),de=Ee(Z.getListType());J.append(de),de.append(K),H?H.insertAfter(J):O?O.insertBefore(J):Z.append(J),w(de)}ue(Z)&&w(Z)}function Q(K){if(d(K))return;const P=K.getParent(),Z=P?P.getParent():void 0,O=Z?Z.getParent():void 0;if(ue(O)&&ge(Z)&&ue(P)){const H=P?P.getFirstChild():void 0,J=P?P.getLastChild():void 0;if(K.is(H))Z.insertBefore(K),P.isEmpty()&&Z.remove();else if(K.is(J))Z.insertAfter(K),P.isEmpty()&&Z.remove();else{const de=P.getListType(),_e=se(),b=Ee(de);_e.append(b),K.getPreviousSiblings().forEach(re=>b.append(re));const v=se(),M=Ee(de);v.append(M),I(M,K.getNextSiblings()),Z.insertBefore(_e),Z.insertAfter(v),Z.replace(K)}w(P),w(O)}}function F(){const K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed())return!1;const P=K.anchor.getNode();if(!ge(P)||P.getChildrenSize()!==0)return!1;const Z=r(P),O=P.getParent();if(!ue(O))throw Error("A ListItemNode must have a ListNode for a parent.");const H=O.getParent();let J;if(e.$isRootOrShadowRoot(H))J=e.$createParagraphNode(),Z.insertAfter(J);else if(ge(H))J=se(),H.insertAfter(J);else return!1;J.select();const de=P.getNextSiblings();if(de.length>0){const _e=Ee(O.getListType());if(e.$isParagraphNode(J))J.insertAfter(_e);else{const b=se();b.append(_e),J.insertAfter(b)}de.forEach(b=>{b.remove(),_e.append(b)})}return g(P),!0}class W extends e.ElementNode{static getType(){return"listitem"}static clone(P){return new W(P.__value,P.__checked,P.__key)}constructor(P,Z,O){super(O),this.__value=P===void 0?1:P,this.__checked=Z}createDOM(P){const Z=document.createElement("li"),O=this.getParent();return ue(O)&&O.getListType()==="check"&&q(Z,this,null),Z.value=this.__value,G(Z,P.theme,this),Z}updateDOM(P,Z,O){const H=this.getParent();return ue(H)&&H.getListType()==="check"&&q(Z,this,P),Z.value=this.__value,G(Z,O.theme,this),!1}static transform(){return P=>{const Z=P.getParent();if(ue(Z)){if(w(Z),!ge(P))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&P.getChecked()!=null&&P.setChecked(void 0)}}}static importDOM(){return{li:P=>({conversion:le,priority:0})}}static importJSON(P){const Z=se();return Z.setChecked(P.checked),Z.setValue(P.value),Z.setFormat(P.format),Z.setDirection(P.direction),Z}exportDOM(P){const Z=this.createDOM(P._config);return Z.style.textAlign=this.getFormatType(),{element:Z}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...P){for(let Z=0;Z<P.length;Z++){const O=P[Z];if(e.$isElementNode(O)&&this.canMergeWith(O)){const H=O.getChildren();this.append(...H),O.remove()}else super.append(O)}return this}replace(P,Z){if(ge(P))return super.replace(P);this.setIndent(0);const O=this.getParentOrThrow();if(!ue(O))return P;if(O.__first===this.getKey())O.insertBefore(P);else if(O.__last===this.getKey())O.insertAfter(P);else{const H=Ee(O.getListType());let J=this.getNextSibling();for(;J;){const de=J;J=J.getNextSibling(),H.append(de)}O.insertAfter(P),P.insertAfter(H)}if(Z){if(!e.$isElementNode(P))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(H=>{P.append(H)})}return this.remove(),O.getChildrenSize()===0&&O.remove(),P}insertAfter(P,Z=!0){const O=this.getParentOrThrow();if(!ue(O))throw Error("insertAfter: list node is not parent of list item node");const H=this.getNextSiblings();if(ge(P)){const J=super.insertAfter(P,Z),de=P.getParentOrThrow();return ue(de)&&w(de),J}if(ue(P)){let J=P;const de=P.getChildren();for(let _e=de.length-1;_e>=0;_e--)J=de[_e],this.insertAfter(J,Z);return J}if(O.insertAfter(P,Z),H.length!==0){const J=Ee(O.getListType());H.forEach(de=>J.append(de)),P.insertAfter(J,Z)}return P}remove(P){const Z=this.getPreviousSibling(),O=this.getNextSibling();if(super.remove(P),Z&&O&&d(Z)&&d(O))U(Z.getFirstChild(),O.getFirstChild()),O.remove();else if(O){const H=O.getParent();ue(H)&&w(H)}}insertNewAfter(P,Z=!0){const O=se(this.__checked==null?void 0:!1);return this.insertAfter(O,Z),O}collapseAtStart(P){const Z=e.$createParagraphNode();this.getChildren().forEach(_e=>Z.append(_e));const H=this.getParentOrThrow(),J=H.getParentOrThrow(),de=ge(J);if(H.getChildrenSize()===1)if(de)H.remove(),J.select();else{H.insertBefore(Z),H.remove();const _e=P.anchor,b=P.focus,v=Z.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(v,_e.offset,"element"),b.type==="element"&&b.getNode().is(this)&&b.set(v,b.offset,"element")}else H.insertBefore(Z),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(P){const Z=this.getWritable();Z.__value=P}getChecked(){return this.getLatest().__checked}setChecked(P){const Z=this.getWritable();Z.__checked=P}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const P=this.getParent();if(P===null)return this.getLatest().__indent;let Z=P.getParentOrThrow(),O=0;for(;ge(Z);)Z=Z.getParentOrThrow().getParentOrThrow(),O++;return O}setIndent(P){if(!(typeof P=="number"&&P>-1))throw Error("Invalid indent value.");let Z=this.getIndent();for(;Z!==P;)Z<P?(z(this),Z++):(Q(this),Z--);return this}insertBefore(P){if(ge(P)){const Z=this.getParentOrThrow();if(ue(Z)){const O=this.getNextSiblings();w(Z,O)}}return super.insertBefore(P)}canInsertAfter(P){return ge(P)}canReplaceWith(P){return ge(P)}canMergeWith(P){return e.$isParagraphNode(P)||ge(P)}extractWithChild(P,Z){if(!e.$isRangeSelection(Z))return!1;const O=Z.anchor.getNode(),H=Z.focus.getNode();return this.isParentOf(O)&&this.isParentOf(H)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function G(K,P,Z){const O=[],H=[],J=P.list,de=J?J.listitem:void 0;let _e;if(J&&J.nested&&(_e=J.nested.listitem),de!==void 0){const b=de.split(" ");O.push(...b)}if(J){const b=Z.getParent(),v=ue(b)&&b.getListType()==="check",M=Z.getChecked();(!v||M)&&H.push(J.listitemUnchecked),(!v||!M)&&H.push(J.listitemChecked),v&&O.push(M?J.listitemChecked:J.listitemUnchecked)}if(_e!==void 0){const b=_e.split(" ");Z.getChildren().some(v=>ue(v))?O.push(...b):H.push(...b)}H.length>0&&t.removeClassNamesFromElement(K,...H),O.length>0&&t.addClassNamesToElement(K,...O)}function q(K,P,Z,O){ue(P.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),(!Z||P.__checked!==Z.__checked)&&K.setAttribute("aria-checked",P.getChecked()?"true":"false"))}function le(K){const P=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true";return{node:se(P)}}function se(K){return e.$applyNodeReplacement(new W(void 0,K))}function ge(K){return K instanceof W}class j extends e.ElementNode{static getType(){return"list"}static clone(P){const Z=P.__listType||we[P.__tag];return new j(Z,P.__start,P.__key)}constructor(P,Z,O){super(O);const H=we[P]||P;this.__listType=H,this.__tag=H==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(P){const Z=this.getWritable();Z.__listType=P,Z.__tag=P==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(P,Z){const O=this.__tag,H=document.createElement(O);return this.__start!==1&&H.setAttribute("start",String(this.__start)),H.__lexicalListType=this.__listType,B(H,P.theme,this),H}updateDOM(P,Z,O){return P.__tag!==this.__tag?!0:(B(Z,O.theme,this),!1)}static importDOM(){return{ol:P=>({conversion:xe,priority:0}),ul:P=>({conversion:xe,priority:0})}}static importJSON(P){const Z=Ee(P.listType,P.start);return Z.setFormat(P.format),Z.setIndent(P.indent),Z.setDirection(P.direction),Z}exportDOM(P){const{element:Z}=super.exportDOM(P);return Z&&t.isHTMLElement(Z)&&(this.__start!==1&&Z.setAttribute("start",String(this.__start)),this.__listType==="check"&&Z.setAttribute("__lexicalListType","check")),{element:Z}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...P){for(let Z=0;Z<P.length;Z++){const O=P[Z];if(ge(O))super.append(O);else{const H=se();if(ue(O))H.append(O);else if(e.$isElementNode(O)){const J=e.$createTextNode(O.getTextContent());H.append(J)}else H.append(O);super.append(H)}}return w(this),this}extractWithChild(P){return ge(P)}}function B(K,P,Z){const O=[],H=[],J=P.list;if(J!==void 0){const de=J[`${Z.__tag}Depth`]||[],_e=n(Z)-1,b=_e%de.length,v=de[b],M=J[Z.__tag];let re;const ye=J.nested;if(ye!==void 0&&ye.list&&(re=ye.list),M!==void 0&&O.push(M),v!==void 0){const Ae=v.split(" ");O.push(...Ae);for(let ee=0;ee<de.length;ee++)ee!==b&&H.push(Z.__tag+ee)}if(re!==void 0){const Ae=re.split(" ");_e>1?O.push(...Ae):H.push(...Ae)}}H.length>0&&t.removeClassNamesFromElement(K,...H),O.length>0&&t.addClassNamesToElement(K,...O)}function V(K){const P=[];for(let Z=0;Z<K.length;Z++){const O=K[Z];if(ge(O)){P.push(O);const H=O.getChildren();H.length>1&&H.forEach(J=>{ue(J)&&P.push(y(J))})}else P.push(y(O))}return P}function xe(K){const P=K.nodeName.toLowerCase();let Z=null;if(P==="ol"){const O=K.start;Z=Ee("number",O)}else P==="ul"&&(t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?Z=Ee("check"):Z=Ee("bullet"));return{after:V,node:Z}}const we={ol:"number",ul:"bullet"};function Ee(K,P=1){return e.$applyNodeReplacement(new j(K,P))}function ue(K){return K instanceof j}const $=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),x=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Y=e.createCommand("INSERT_CHECK_LIST_COMMAND"),ie=e.createCommand("REMOVE_LIST_COMMAND");return fr.$createListItemNode=se,fr.$createListNode=Ee,fr.$getListDepth=n,fr.$handleListInsertParagraph=F,fr.$isListItemNode=ge,fr.$isListNode=ue,fr.INSERT_CHECK_LIST_COMMAND=Y,fr.INSERT_ORDERED_LIST_COMMAND=x,fr.INSERT_UNORDERED_LIST_COMMAND=$,fr.ListItemNode=W,fr.ListNode=j,fr.REMOVE_LIST_COMMAND=ie,fr.insertList=R,fr.removeList=C,fr}var hr={},pf;function qy(){if(pf)return hr;pf=1;var e=gn(),t=Xn();function n($){let x=new URLSearchParams;x.append("code",$);for(let Y=1;Y<arguments.length;Y++)x.append("v",arguments[Y]);throw Error(`Minified Lexical error #${$}; visit https://lexical.dev/docs/error?${x} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r($){let x=1;for($=$.getParent();$!=null;){if(G($)){if($=$.getParent(),V($)){x++,$=$.getParent();continue}n(40)}break}return x}function c($){$=$.getParent(),V($)||n(40);let x=$;for(;x!==null;)x=x.getParent(),V(x)&&($=x);return $}function d($){let x=[];$=$.getChildren().filter(G);for(let Y=0;Y<$.length;Y++){let ie=$[Y],K=ie.getFirstChild();V(K)?x=x.concat(d(K)):x.push(ie)}return x}function g($){return G($)&&V($.getFirstChild())}function y($){for(;$.getNextSibling()==null&&$.getPreviousSibling()==null;){let x=$.getParent();if(x==null||!G($)&&!V($))break;$=x}$.remove()}function E($){return W().append($)}function T($,x){return G($)&&(x.length===0||x.length===1&&$.is(x[0])&&$.getChildrenSize()===0)}function R($,x){$.splice($.getChildrenSize(),0,x)}function I($,x){if(V($))return $;let Y=$.getPreviousSibling(),ie=$.getNextSibling(),K=W();return K.setFormat($.getFormatType()),K.setIndent($.getIndent()),R(K,$.getChildren()),V(Y)&&x===Y.getListType()?(Y.append(K),$.remove(),V(ie)&&x===ie.getListType()&&(R(Y,ie.getChildren()),ie.remove()),Y):V(ie)&&x===ie.getListType()?(ie.getFirstChildOrThrow().insertBefore(K),$.remove(),ie):(x=B(x),x.append(K),$.replace(x),U(x),x)}function k($,x){var Y=$.getLastChild();let ie=x.getFirstChild();Y&&ie&&g(Y)&&g(ie)&&(k(Y.getFirstChild(),ie.getFirstChild()),ie.remove()),Y=x.getChildren(),0<Y.length&&($.append(...Y),U($)),x.remove()}function U($,x){if($=x||$.getChildren(),$!==void 0)for(x=0;x<$.length;x++){let P=$[x];if(G(P)){let Z=P.getValue();var Y=P,ie=Y.getParent(),K=1;for(ie!=null&&(V(ie)?K=ie.getStart():n(44)),Y=Y.getPreviousSiblings(),ie=0;ie<Y.length;ie++){let O=Y[ie];G(O)&&!V(O.getFirstChild())&&K++}Z!==K&&P.setValue(K)}}}function C($){if(!g($)){var x=$.getParent(),Y=x?x.getParent():void 0,ie=Y?Y.getParent():void 0;if(V(ie)&&G(Y)&&V(x)){var K=x?x.getFirstChild():void 0,P=x?x.getLastChild():void 0;if($.is(K))Y.insertBefore($),x.isEmpty()&&Y.remove();else if($.is(P))Y.insertAfter($),x.isEmpty()&&Y.remove();else{var Z=x.getListType();K=W();let O=B(Z);K.append(O),$.getPreviousSiblings().forEach(H=>O.append(H)),P=W(),Z=B(Z),P.append(Z),R(Z,$.getNextSiblings()),Y.insertBefore(K),Y.insertAfter(P),Y.replace($)}U(x),U(ie)}}}class w extends e.ElementNode{static getType(){return"listitem"}static clone(x){return new w(x.__value,x.__checked,x.__key)}constructor(x,Y,ie){super(ie),this.__value=x===void 0?1:x,this.__checked=Y}createDOM(x){let Y=document.createElement("li"),ie=this.getParent();return V(ie)&&ie.getListType()==="check"&&Q(Y,this,null),Y.value=this.__value,z(Y,x.theme,this),Y}updateDOM(x,Y,ie){let K=this.getParent();return V(K)&&K.getListType()==="check"&&Q(Y,this,x),Y.value=this.__value,z(Y,ie.theme,this),!1}static transform(){return x=>{let Y=x.getParent();if(V(Y)){if(U(Y),!G(x))throw Error("node is not a ListItemNode");Y.getListType()!=="check"&&x.getChecked()!=null&&x.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:F,priority:0})}}static importJSON(x){let Y=W();return Y.setChecked(x.checked),Y.setValue(x.value),Y.setFormat(x.format),Y.setDirection(x.direction),Y}exportDOM(x){return x=this.createDOM(x._config),x.style.textAlign=this.getFormatType(),{element:x}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...x){for(let Y=0;Y<x.length;Y++){let ie=x[Y];if(e.$isElementNode(ie)&&this.canMergeWith(ie)){let K=ie.getChildren();this.append(...K),ie.remove()}else super.append(ie)}return this}replace(x,Y){if(G(x))return super.replace(x);this.setIndent(0);let ie=this.getParentOrThrow();if(!V(ie))return x;if(ie.__first===this.getKey())ie.insertBefore(x);else if(ie.__last===this.getKey())ie.insertAfter(x);else{let K=B(ie.getListType()),P=this.getNextSibling();for(;P;){let Z=P;P=P.getNextSibling(),K.append(Z)}ie.insertAfter(x),x.insertAfter(K)}if(Y){if(!e.$isElementNode(x))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(K=>{x.append(K)})}return this.remove(),ie.getChildrenSize()===0&&ie.remove(),x}insertAfter(x,Y=!0){var ie=this.getParentOrThrow();V(ie)||n(39);var K=this.getNextSiblings();if(G(x))return Y=super.insertAfter(x,Y),x=x.getParentOrThrow(),V(x)&&U(x),Y;if(V(x)){for(ie=x,x=x.getChildren(),K=x.length-1;0<=K;K--)ie=x[K],this.insertAfter(ie,Y);return ie}if(ie.insertAfter(x,Y),K.length!==0){let P=B(ie.getListType());K.forEach(Z=>P.append(Z)),x.insertAfter(P,Y)}return x}remove(x){let Y=this.getPreviousSibling(),ie=this.getNextSibling();super.remove(x),Y&&ie&&g(Y)&&g(ie)?(k(Y.getFirstChild(),ie.getFirstChild()),ie.remove()):ie&&(x=ie.getParent(),V(x)&&U(x))}insertNewAfter(x,Y=!0){return x=W(this.__checked==null?void 0:!1),this.insertAfter(x,Y),x}collapseAtStart(x){let Y=e.$createParagraphNode();this.getChildren().forEach(Z=>Y.append(Z));var ie=this.getParentOrThrow(),K=ie.getParentOrThrow();let P=G(K);return ie.getChildrenSize()===1?P?(ie.remove(),K.select()):(ie.insertBefore(Y),ie.remove(),ie=x.anchor,x=x.focus,K=Y.getKey(),ie.type==="element"&&ie.getNode().is(this)&&ie.set(K,ie.offset,"element"),x.type==="element"&&x.getNode().is(this)&&x.set(K,x.offset,"element")):(ie.insertBefore(Y),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(x){this.getWritable().__value=x}getChecked(){return this.getLatest().__checked}setChecked(x){this.getWritable().__checked=x}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var x=this.getParent();if(x===null)return this.getLatest().__indent;x=x.getParentOrThrow();let Y=0;for(;G(x);)x=x.getParentOrThrow().getParentOrThrow(),Y++;return Y}setIndent(x){typeof x=="number"&&-1<x||n(117);let Y=this.getIndent();for(;Y!==x;)if(Y<x){e:{var ie=new Set;if(g(this)||ie.has(this.getKey()))break e;let O=this.getParent();var K=this.getNextSibling(),P=this.getPreviousSibling();if(g(K)&&g(P)){if(P=P.getFirstChild(),V(P)){P.append(this);var Z=K.getFirstChild();V(Z)&&(Z=Z.getChildren(),R(P,Z),K.remove(),ie.add(K.getKey())),U(P)}}else g(K)?(K=K.getFirstChild(),V(K)&&(ie=K.getFirstChild(),ie!==null&&ie.insertBefore(this),U(K))):g(P)?(K=P.getFirstChild(),V(K)&&(K.append(this),U(K))):V(O)&&(ie=W(),Z=B(O.getListType()),ie.append(Z),Z.append(this),P?P.insertAfter(ie):K?K.insertBefore(ie):O.append(ie),U(Z));V(O)&&U(O)}Y++}else C(this),Y--;return this}insertBefore(x){if(G(x)){let Y=this.getParentOrThrow();if(V(Y)){let ie=this.getNextSiblings();U(Y,ie)}}return super.insertBefore(x)}canInsertAfter(x){return G(x)}canReplaceWith(x){return G(x)}canMergeWith(x){return e.$isParagraphNode(x)||G(x)}extractWithChild(x,Y){if(!e.$isRangeSelection(Y))return!1;x=Y.anchor.getNode();let ie=Y.focus.getNode();return this.isParentOf(x)&&this.isParentOf(ie)&&this.getTextContent().length===Y.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return B("bullet")}}function z($,x,Y){let ie=[],K=[];var P=(x=x.list)?x.listitem:void 0;if(x&&x.nested)var Z=x.nested.listitem;if(P!==void 0&&(P=P.split(" "),ie.push(...P)),x){P=Y.getParent(),P=V(P)&&P.getListType()==="check";let O=Y.getChecked();P&&!O||K.push(x.listitemUnchecked),P&&O||K.push(x.listitemChecked),P&&ie.push(O?x.listitemChecked:x.listitemUnchecked)}Z!==void 0&&(Z=Z.split(" "),Y.getChildren().some(O=>V(O))?ie.push(...Z):K.push(...Z)),0<K.length&&t.removeClassNamesFromElement($,...K),0<ie.length&&t.addClassNamesToElement($,...ie)}function Q($,x,Y){V(x.getFirstChild())?($.removeAttribute("role"),$.removeAttribute("tabIndex"),$.removeAttribute("aria-checked")):($.setAttribute("role","checkbox"),$.setAttribute("tabIndex","-1"),Y&&x.__checked===Y.__checked||$.setAttribute("aria-checked",x.getChecked()?"true":"false"))}function F($){return $=t.isHTMLElement($)&&$.getAttribute("aria-checked")==="true",{node:W($)}}function W($){return e.$applyNodeReplacement(new w(void 0,$))}function G($){return $ instanceof w}class q extends e.ElementNode{static getType(){return"list"}static clone(x){return new q(x.__listType||j[x.__tag],x.__start,x.__key)}constructor(x,Y,ie){super(ie),this.__listType=x=j[x]||x,this.__tag=x==="number"?"ol":"ul",this.__start=Y}getTag(){return this.__tag}setListType(x){let Y=this.getWritable();Y.__listType=x,Y.__tag=x==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(x){let Y=document.createElement(this.__tag);return this.__start!==1&&Y.setAttribute("start",String(this.__start)),Y.__lexicalListType=this.__listType,le(Y,x.theme,this),Y}updateDOM(x,Y,ie){return x.__tag!==this.__tag?!0:(le(Y,ie.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ge,priority:0}),ul:()=>({conversion:ge,priority:0})}}static importJSON(x){let Y=B(x.listType,x.start);return Y.setFormat(x.format),Y.setIndent(x.indent),Y.setDirection(x.direction),Y}exportDOM(x){return{element:x}=super.exportDOM(x),x&&t.isHTMLElement(x)&&(this.__start!==1&&x.setAttribute("start",String(this.__start)),this.__listType==="check"&&x.setAttribute("__lexicalListType","check")),{element:x}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...x){for(let ie=0;ie<x.length;ie++){var Y=x[ie];if(G(Y))super.append(Y);else{let K=W();V(Y)||e.$isElementNode(Y)&&(Y=e.$createTextNode(Y.getTextContent())),K.append(Y),super.append(K)}}return U(this),this}extractWithChild(x){return G(x)}}function le($,x,Y){let ie=[],K=[];var P=x.list;if(P!==void 0){let O=P[`${Y.__tag}Depth`]||[];x=r(Y)-1;let H=x%O.length;var Z=O[H];let J=P[Y.__tag],de;if(P=P.nested,P!==void 0&&P.list&&(de=P.list),J!==void 0&&ie.push(J),Z!==void 0)for(Z=Z.split(" "),ie.push(...Z),Z=0;Z<O.length;Z++)Z!==H&&K.push(Y.__tag+Z);de!==void 0&&(Y=de.split(" "),1<x?ie.push(...Y):K.push(...Y))}0<K.length&&t.removeClassNamesFromElement($,...K),0<ie.length&&t.addClassNamesToElement($,...ie)}function se($){let x=[];for(let ie=0;ie<$.length;ie++){var Y=$[ie];G(Y)?(x.push(Y),Y=Y.getChildren(),1<Y.length&&Y.forEach(K=>{V(K)&&x.push(E(K))})):x.push(E(Y))}return x}function ge($){let x=$.nodeName.toLowerCase(),Y=null;return x==="ol"?Y=B("number",$.start):x==="ul"&&(Y=t.isHTMLElement($)&&$.getAttribute("__lexicallisttype")==="check"?B("check"):B("bullet")),{after:se,node:Y}}let j={ol:"number",ul:"bullet"};function B($,x=1){return e.$applyNodeReplacement(new q($,x))}function V($){return $ instanceof q}let xe=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),we=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),ue=e.createCommand("REMOVE_LIST_COMMAND");return hr.$createListItemNode=W,hr.$createListNode=B,hr.$getListDepth=r,hr.$handleListInsertParagraph=function(){var $=e.$getSelection();if(!e.$isRangeSelection($)||!$.isCollapsed()||($=$.anchor.getNode(),!G($)||$.getChildrenSize()!==0))return!1;var x=c($),Y=$.getParent();V(Y)||n(40);let ie=Y.getParent(),K;if(e.$isRootOrShadowRoot(ie))K=e.$createParagraphNode(),x.insertAfter(K);else if(G(ie))K=W(),ie.insertAfter(K);else return!1;if(K.select(),x=$.getNextSiblings(),0<x.length){let P=B(Y.getListType());e.$isParagraphNode(K)?K.insertAfter(P):(Y=W(),Y.append(P),K.insertAfter(Y)),x.forEach(Z=>{Z.remove(),P.append(Z)})}return y($),!0},hr.$isListItemNode=G,hr.$isListNode=V,hr.INSERT_CHECK_LIST_COMMAND=Ee,hr.INSERT_ORDERED_LIST_COMMAND=we,hr.INSERT_UNORDERED_LIST_COMMAND=xe,hr.ListItemNode=w,hr.ListNode=q,hr.REMOVE_LIST_COMMAND=ue,hr.insertList=function($,x){$.update(()=>{var Y=e.$getSelection();if(e.$INTERNAL_isPointSelection(Y)){var ie=Y.getNodes();Y=Y.anchor.getNode();var K=Y.getParent();if(T(Y,ie))ie=B(x),e.$isRootOrShadowRoot(K)?(Y.replace(ie),K=W(),e.$isElementNode(Y)&&(K.setFormat(Y.getFormatType()),K.setIndent(Y.getIndent())),ie.append(K)):G(Y)&&(Y=Y.getParentOrThrow(),R(ie,Y.getChildren()),Y.replace(ie));else for(Y=new Set,K=0;K<ie.length;K++){var P=ie[K];if(e.$isElementNode(P)&&P.isEmpty()&&!G(P)&&!Y.has(P.getKey()))I(P,x);else if(e.$isLeafNode(P))for(P=P.getParent();P!=null;){let O=P.getKey();if(V(P)){if(!Y.has(O)){var Z=B(x);R(Z,P.getChildren()),P.replace(Z),U(Z),Y.add(O)}break}else{if(Z=P.getParent(),e.$isRootOrShadowRoot(Z)&&!Y.has(O)){Y.add(O),I(P,x);break}P=Z}}}}})},hr.removeList=function($){$.update(()=>{let x=e.$getSelection();if(e.$isRangeSelection(x)){var Y=new Set,ie=x.getNodes(),K=x.anchor.getNode();if(T(K,ie))Y.add(c(K));else for(K=0;K<ie.length;K++){var P=ie[K];e.$isLeafNode(P)&&(P=t.$getNearestNodeOfType(P,w),P!=null&&Y.add(c(P)))}for(let Z of Y){Y=Z,ie=d(Z);for(let O of ie)ie=e.$createParagraphNode(),R(ie,O.getChildren()),Y.insertAfter(ie),Y=ie,O.__key===x.anchor.key&&x.anchor.set(ie.getKey(),0,"element"),O.__key===x.focus.key&&x.focus.set(ie.getKey(),0,"element"),O.remove();Z.remove()}}})},hr}const Zy=process.env.NODE_ENV==="development"?Vy():qy();var mf=Zy,Ln={},tu={exports:{}},_f;function Cg(){return _f||(_f=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
77
|
-
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
78
|
-
*
|
|
79
|
-
* @license MIT <https://opensource.org/licenses/MIT>
|
|
80
|
-
* @author Lea Verou <https://lea.verou.me>
|
|
81
|
-
* @namespace
|
|
82
|
-
* @public
|
|
83
|
-
*/var n=function(r){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,g={},y={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function F(W){return W instanceof E?new E(W.type,F(W.content),W.alias):Array.isArray(W)?W.map(F):W.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(F){return Object.prototype.toString.call(F).slice(8,-1)},objId:function(F){return F.__id||Object.defineProperty(F,"__id",{value:++d}),F.__id},clone:function F(W,G){G=G||{};var q,le;switch(y.util.type(W)){case"Object":if(le=y.util.objId(W),G[le])return G[le];q={},G[le]=q;for(var se in W)W.hasOwnProperty(se)&&(q[se]=F(W[se],G));return q;case"Array":return le=y.util.objId(W),G[le]?G[le]:(q=[],G[le]=q,W.forEach(function(ge,j){q[j]=F(ge,G)}),q);default:return W}},getLanguage:function(F){for(;F;){var W=c.exec(F.className);if(W)return W[1].toLowerCase();F=F.parentElement}return"none"},setLanguage:function(F,W){F.className=F.className.replace(RegExp(c,"gi"),""),F.classList.add("language-"+W)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(q){var F=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(q.stack)||[])[1];if(F){var W=document.getElementsByTagName("script");for(var G in W)if(W[G].src==F)return W[G]}return null}},isActive:function(F,W,G){for(var q="no-"+W;F;){var le=F.classList;if(le.contains(W))return!0;if(le.contains(q))return!1;F=F.parentElement}return!!G}},languages:{plain:g,plaintext:g,text:g,txt:g,extend:function(F,W){var G=y.util.clone(y.languages[F]);for(var q in W)G[q]=W[q];return G},insertBefore:function(F,W,G,q){q=q||y.languages;var le=q[F],se={};for(var ge in le)if(le.hasOwnProperty(ge)){if(ge==W)for(var j in G)G.hasOwnProperty(j)&&(se[j]=G[j]);G.hasOwnProperty(ge)||(se[ge]=le[ge])}var B=q[F];return q[F]=se,y.languages.DFS(y.languages,function(V,xe){xe===B&&V!=F&&(this[V]=se)}),se},DFS:function F(W,G,q,le){le=le||{};var se=y.util.objId;for(var ge in W)if(W.hasOwnProperty(ge)){G.call(W,ge,W[ge],q||ge);var j=W[ge],B=y.util.type(j);B==="Object"&&!le[se(j)]?(le[se(j)]=!0,F(j,G,null,le)):B==="Array"&&!le[se(j)]&&(le[se(j)]=!0,F(j,G,ge,le))}}},plugins:{},highlightAll:function(F,W){y.highlightAllUnder(document,F,W)},highlightAllUnder:function(F,W,G){var q={callback:G,container:F,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};y.hooks.run("before-highlightall",q),q.elements=Array.prototype.slice.apply(q.container.querySelectorAll(q.selector)),y.hooks.run("before-all-elements-highlight",q);for(var le=0,se;se=q.elements[le++];)y.highlightElement(se,W===!0,q.callback)},highlightElement:function(F,W,G){var q=y.util.getLanguage(F),le=y.languages[q];y.util.setLanguage(F,q);var se=F.parentElement;se&&se.nodeName.toLowerCase()==="pre"&&y.util.setLanguage(se,q);var ge=F.textContent,j={element:F,language:q,grammar:le,code:ge};function B(xe){j.highlightedCode=xe,y.hooks.run("before-insert",j),j.element.innerHTML=j.highlightedCode,y.hooks.run("after-highlight",j),y.hooks.run("complete",j),G&&G.call(j.element)}if(y.hooks.run("before-sanity-check",j),se=j.element.parentElement,se&&se.nodeName.toLowerCase()==="pre"&&!se.hasAttribute("tabindex")&&se.setAttribute("tabindex","0"),!j.code){y.hooks.run("complete",j),G&&G.call(j.element);return}if(y.hooks.run("before-highlight",j),!j.grammar){B(y.util.encode(j.code));return}if(W&&r.Worker){var V=new Worker(y.filename);V.onmessage=function(xe){B(xe.data)},V.postMessage(JSON.stringify({language:j.language,code:j.code,immediateClose:!0}))}else B(y.highlight(j.code,j.grammar,j.language))},highlight:function(F,W,G){var q={code:F,grammar:W,language:G};if(y.hooks.run("before-tokenize",q),!q.grammar)throw new Error('The language "'+q.language+'" has no grammar.');return q.tokens=y.tokenize(q.code,q.grammar),y.hooks.run("after-tokenize",q),E.stringify(y.util.encode(q.tokens),q.language)},tokenize:function(F,W){var G=W.rest;if(G){for(var q in G)W[q]=G[q];delete W.rest}var le=new I;return k(le,le.head,F),R(F,le,W,le.head,0),C(le)},hooks:{all:{},add:function(F,W){var G=y.hooks.all;G[F]=G[F]||[],G[F].push(W)},run:function(F,W){var G=y.hooks.all[F];if(!(!G||!G.length))for(var q=0,le;le=G[q++];)le(W)}},Token:E};r.Prism=y;function E(F,W,G,q){this.type=F,this.content=W,this.alias=G,this.length=(q||"").length|0}E.stringify=function F(W,G){if(typeof W=="string")return W;if(Array.isArray(W)){var q="";return W.forEach(function(B){q+=F(B,G)}),q}var le={type:W.type,content:F(W.content,G),tag:"span",classes:["token",W.type],attributes:{},language:G},se=W.alias;se&&(Array.isArray(se)?Array.prototype.push.apply(le.classes,se):le.classes.push(se)),y.hooks.run("wrap",le);var ge="";for(var j in le.attributes)ge+=" "+j+'="'+(le.attributes[j]||"").replace(/"/g,""")+'"';return"<"+le.tag+' class="'+le.classes.join(" ")+'"'+ge+">"+le.content+"</"+le.tag+">"};function T(F,W,G,q){F.lastIndex=W;var le=F.exec(G);if(le&&q&&le[1]){var se=le[1].length;le.index+=se,le[0]=le[0].slice(se)}return le}function R(F,W,G,q,le,se){for(var ge in G)if(!(!G.hasOwnProperty(ge)||!G[ge])){var j=G[ge];j=Array.isArray(j)?j:[j];for(var B=0;B<j.length;++B){if(se&&se.cause==ge+","+B)return;var V=j[B],xe=V.inside,we=!!V.lookbehind,Ee=!!V.greedy,ue=V.alias;if(Ee&&!V.pattern.global){var $=V.pattern.toString().match(/[imsuy]*$/)[0];V.pattern=RegExp(V.pattern.source,$+"g")}for(var x=V.pattern||V,Y=q.next,ie=le;Y!==W.tail&&!(se&&ie>=se.reach);ie+=Y.value.length,Y=Y.next){var K=Y.value;if(W.length>F.length)return;if(!(K instanceof E)){var P=1,Z;if(Ee){if(Z=T(x,ie,F,we),!Z||Z.index>=F.length)break;var de=Z.index,O=Z.index+Z[0].length,H=ie;for(H+=Y.value.length;de>=H;)Y=Y.next,H+=Y.value.length;if(H-=Y.value.length,ie=H,Y.value instanceof E)continue;for(var J=Y;J!==W.tail&&(H<O||typeof J.value=="string");J=J.next)P++,H+=J.value.length;P--,K=F.slice(ie,H),Z.index-=ie}else if(Z=T(x,0,K,we),!Z)continue;var de=Z.index,_e=Z[0],b=K.slice(0,de),v=K.slice(de+_e.length),M=ie+K.length;se&&M>se.reach&&(se.reach=M);var re=Y.prev;b&&(re=k(W,re,b),ie+=b.length),U(W,re,P);var ye=new E(ge,xe?y.tokenize(_e,xe):_e,ue,_e);if(Y=k(W,re,ye),v&&k(W,Y,v),P>1){var Ae={cause:ge+","+B,reach:M};R(F,W,G,Y.prev,ie,Ae),se&&Ae.reach>se.reach&&(se.reach=Ae.reach)}}}}}}function I(){var F={value:null,prev:null,next:null},W={value:null,prev:F,next:null};F.next=W,this.head=F,this.tail=W,this.length=0}function k(F,W,G){var q=W.next,le={value:G,prev:W,next:q};return W.next=le,q.prev=le,F.length++,le}function U(F,W,G){for(var q=W.next,le=0;le<G&&q!==F.tail;le++)q=q.next;W.next=q,q.prev=W,F.length-=le}function C(F){for(var W=[],G=F.head.next;G!==F.tail;)W.push(G.value),G=G.next;return W}if(!r.document)return r.addEventListener&&(y.disableWorkerMessageHandler||r.addEventListener("message",function(F){var W=JSON.parse(F.data),G=W.language,q=W.code,le=W.immediateClose;r.postMessage(y.highlight(q,y.languages[G],G)),le&&r.close()},!1)),y;var w=y.util.currentScript();w&&(y.filename=w.src,w.hasAttribute("data-manual")&&(y.manual=!0));function z(){y.manual||y.highlightAll()}if(!y.manual){var Q=document.readyState;Q==="loading"||Q==="interactive"&&w&&w.defer?document.addEventListener("DOMContentLoaded",z):window.requestAnimationFrame?window.requestAnimationFrame(z):window.setTimeout(z,16)}return y}(t);e.exports&&(e.exports=n),typeof Pd<"u"&&(Pd.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(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(c,d){var g={};g["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},g.cdata=/^<!\[CDATA\[|\]\]>$/i;var y={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:g}};y["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var E={};E[c]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return c}),"i"),lookbehind:!0,greedy:!0,inside:y},n.languages.insertBefore("markup","cdata",E)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,c){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[c,"language-"+c],inside:n.languages[c]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var c=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+c.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+c.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+c.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+c.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:c,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var d=r.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",c=function(w,z){return"✖ Error "+w+" while fetching file: "+z},d="✖ Error: File does not exist or is empty",g={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},y="data-src-status",E="loading",T="loaded",R="failed",I="pre[data-src]:not(["+y+'="'+T+'"]):not(['+y+'="'+E+'"])';function k(w,z,Q){var F=new XMLHttpRequest;F.open("GET",w,!0),F.onreadystatechange=function(){F.readyState==4&&(F.status<400&&F.responseText?z(F.responseText):F.status>=400?Q(c(F.status,F.statusText)):Q(d))},F.send(null)}function U(w){var z=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(w||"");if(z){var Q=Number(z[1]),F=z[2],W=z[3];return F?W?[Q,Number(W)]:[Q,void 0]:[Q,Q]}}n.hooks.add("before-highlightall",function(w){w.selector+=", "+I}),n.hooks.add("before-sanity-check",function(w){var z=w.element;if(z.matches(I)){w.code="",z.setAttribute(y,E);var Q=z.appendChild(document.createElement("CODE"));Q.textContent=r;var F=z.getAttribute("data-src"),W=w.language;if(W==="none"){var G=(/\.(\w+)$/.exec(F)||[,"none"])[1];W=g[G]||G}n.util.setLanguage(Q,W),n.util.setLanguage(z,W);var q=n.plugins.autoloader;q&&q.loadLanguages(W),k(F,function(le){z.setAttribute(y,T);var se=U(z.getAttribute("data-range"));if(se){var ge=le.split(/\r\n?|\n/g),j=se[0],B=se[1]==null?ge.length:se[1];j<0&&(j+=ge.length),j=Math.max(0,Math.min(j-1,ge.length)),B<0&&(B+=ge.length),B=Math.max(0,Math.min(B,ge.length)),le=ge.slice(j,B).join(`
|
|
84
|
-
`),z.hasAttribute("data-start")||z.setAttribute("data-start",String(j+1))}Q.textContent=le,n.highlightElement(Q)},function(le){z.setAttribute(y,R),Q.textContent=le})}}),n.plugins.fileHighlight={highlight:function(z){for(var Q=(z||document).querySelectorAll(I),F=0,W;W=Q[F++];)n.highlightElement(W)}};var C=!1;n.fileHighlight=function(){C||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),C=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(tu)),tu.exports}var yf={},Nf;function Eg(){return Nf||(Nf=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:/[{}[\];(),.:]/}),yf}var Cf={},Ef;function Tg(){return Ef||(Ef=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),Cf}var Tf={},xf;function xg(){return xf||(xf=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(/&/,"&"))}),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 c={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};c["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:c},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),Tf}var Sf={},vf;function Sg(){return vf||(vf=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(R){return R=R.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+R+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,c=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;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("^"+c+d+"(?:"+c+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+c+d+")(?:"+c+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+c+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+c+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside: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(R){["url","bold","italic","strike","code-snippet"].forEach(function(I){R!==I&&(e.languages.markdown[R].inside.content.inside[I]=e.languages.markdown[I])})}),e.hooks.add("after-tokenize",function(R){if(R.language!=="markdown"&&R.language!=="md")return;function I(k){if(!(!k||typeof k=="string"))for(var U=0,C=k.length;U<C;U++){var w=k[U];if(w.type!=="code"){I(w.content);continue}var z=w.content[1],Q=w.content[3];if(z&&Q&&z.type==="code-language"&&Q.type==="code-block"&&typeof z.content=="string"){var F=z.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");F=(/[a-z][\w-]*/i.exec(F)||[""])[0].toLowerCase();var W="language-"+F;Q.alias?typeof Q.alias=="string"?Q.alias=[Q.alias,W]:Q.alias.push(W):Q.alias=[W]}}}I(R.tokens)}),e.hooks.add("wrap",function(R){if(R.type==="code-block"){for(var I="",k=0,U=R.classes.length;k<U;k++){var C=R.classes[k],w=/language-(.+)/.exec(C);if(w){I=w[1];break}}var z=e.languages[I];if(z)R.content=e.highlight(T(R.content),z,I);else if(I&&I!=="none"&&e.plugins.autoloader){var Q="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);R.attributes.id=Q,e.plugins.autoloader.loadLanguages(I,function(){var F=document.getElementById(Q);F&&(F.innerHTML=e.highlight(F.textContent,e.languages[I],I))})}}});var g=RegExp(e.languages.markup.tag.pattern.source,"gi"),y={amp:"&",lt:"<",gt:">",quot:'"'},E=String.fromCodePoint||String.fromCharCode;function T(R){var I=R.replace(g,"");return I=I.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(k,U){if(U=U.toLowerCase(),U[0]==="#"){var C;return U[1]==="x"?C=parseInt(U.slice(2),16):C=Number(U.slice(1)),E(C)}else{var w=y[U];return w||k}}),I}e.languages.md=e.languages.markdown}(Prism)),Sf}var wf={},Of;function vg(){return Of||(Of=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),wf}var Af={},Df;function wg(){return Df||(Df=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)),Af}var Mf={},Rf;function Og(){return Rf||(Rf=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),Mf}var bf={},If;function Ag(){return If||(If=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:/[;[\]()`,.]/}),bf}var kf={},Lf;function Dg(){return Lf||(Lf=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://,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),kf}var Pf={},$f;function Mg(){return $f||($f=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)),Pf}var Ff={},Bf;function Rg(){return Bf||(Bf=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})),Ff}var Hf={},Wf;function bg(){return Wf||(Wf=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)),Hf}var Kf={},zf;function Ig(){return zf||(zf=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)),Kf}var Uf={},Gf;function kg(){return Gf||(Gf=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)),Uf}var Yf;function Jy(){if(Yf)return Ln;Yf=1;var e=Cg();Eg(),Tg(),xg(),Sg(),vg(),wg(),Og(),Ag(),Dg(),Mg(),Rg(),bg(),Ig(),kg();var t=Xn(),n=gn();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function c(ee,te){for(const ce of ee.childNodes){if(t.isHTMLElement(ce)&&ce.tagName===te)return!0;c(ce,te)}return!1}const d="data-highlight-language";class g extends n.ElementNode{static getType(){return"code"}static clone(te){return new g(te.__language,te.__key)}constructor(te,ce){super(ce),this.__language=r(te)}createDOM(te){const ce=document.createElement("code");t.addClassNamesToElement(ce,te.theme.code),ce.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ce.setAttribute(d,be),ce}updateDOM(te,ce,be){const Ne=this.__language,Re=te.__language;return Ne?Ne!==Re&&ce.setAttribute(d,Ne):Re&&ce.removeAttribute(d),!1}exportDOM(){const te=document.createElement("pre");te.setAttribute("spellcheck","false");const ce=this.getLanguage();return ce&&te.setAttribute(d,ce),{element:te}}static importDOM(){return{code:te=>te.textContent!=null&&(/\r?\n/.test(te.textContent)||c(te,"BR"))?{conversion:T,priority:1}:null,div:te=>({conversion:R,priority:1}),pre:te=>({conversion:T,priority:0}),table:te=>Q(te)?{conversion:I,priority:3}:null,td:te=>{const ce=te,be=ce.closest("table");return z(ce)?{conversion:U,priority:3}:be&&Q(be)?{conversion:k,priority:3}:null},tr:te=>{const be=te.closest("table");return be&&Q(be)?{conversion:k,priority:3}:null}}}static importJSON(te){const ce=y(te.language);return ce.setFormat(te.format),ce.setIndent(te.indent),ce.setDirection(te.direction),ce}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(te,ce=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
|
|
85
|
-
`&&be[Ne-2].getTextContent()===`
|
|
86
|
-
`&&te.isCollapsed()&&te.anchor.key===this.__key&&te.anchor.offset===Ne){be[Ne-1].remove(),be[Ne-2].remove();const Be=n.$createParagraphNode();return this.insertAfter(Be,ce),Be}const{anchor:Re,focus:Le}=te,qe=(Re.isBefore(Le)?Re:Le).getNode();if(n.$isTextNode(qe)){let Be=we(qe);const ct=[];for(;;)if(n.$isTabNode(Be))ct.push(n.$createTabNode()),Be=Be.getNextSibling();else if(xe(Be)){let Se=0;const ke=Be.getTextContent(),Me=Be.getTextContentSize();for(;Se<Me&&ke[Se]===" ";Se++);if(Se!==0&&ct.push(V(" ".repeat(Se))),Se!==Me)break;Be=Be.getNextSibling()}else break;const Dt=qe.splitText(Re.offset)[0],Ut=Re.offset===0?0:1,en=Dt.getIndexWithinParent()+Ut,Oe=qe.getParentOrThrow(),ne=[n.$createLineBreakNode(),...ct];Oe.splice(en,0,ne);const oe=ct[ct.length-1];oe?oe.select():Re.offset===0?Dt.selectPrevious():Dt.getNextSibling().selectNext(0,0)}if(E(qe)){const{offset:Be}=te.anchor;qe.splice(Be,0,[n.$createLineBreakNode()]),qe.select(Be+1,Be+1)}return null}canIndent(){return!1}collapseAtStart(){const te=n.$createParagraphNode();return this.getChildren().forEach(be=>te.append(be)),this.replace(te),!0}setLanguage(te){const ce=this.getWritable();ce.__language=r(te)}getLanguage(){return this.getLatest().__language}}function y(ee){return n.$applyNodeReplacement(new g(ee))}function E(ee){return ee instanceof g}function T(ee){let te;return t.isHTMLElement(ee)&&(te=ee.getAttribute(d)),{node:y(te)}}function R(ee){const te=ee,ce=C(te);return!ce&&!w(te)?{node:null}:{after:be=>{const Ne=ee.parentNode;return Ne!=null&&ee!==Ne.lastChild&&be.push(n.$createLineBreakNode()),be},node:ce?y():null}}function I(){return{node:y()}}function k(){return{node:null}}function U(ee){const te=ee;return{after:ce=>(te.parentNode&&te.parentNode.nextSibling&&ce.push(n.$createLineBreakNode()),ce),node:null}}function C(ee){return ee.style.fontFamily.match("monospace")!==null}function w(ee){let te=ee.parentElement;for(;te!==null;){if(C(te))return!0;te=te.parentElement}return!1}function z(ee){return ee.classList.contains("js-file-line")}function Q(ee){return ee.classList.contains("js-file-line-container")}const F="javascript",W={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},G={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function q(ee){return G[ee]||ee}function le(ee){const te=q(ee);return W[te]||te}const se=()=>F,ge=()=>Object.keys(e.languages).filter(ee=>typeof e.languages[ee]!="function").sort();class j extends n.TextNode{constructor(te,ce,be){super(te,be),this.__highlightType=ce}static getType(){return"code-highlight"}static clone(te){return new j(te.__text,te.__highlightType||void 0,te.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(te){const ce=super.createDOM(te),be=B(te.theme,this.__highlightType);return t.addClassNamesToElement(ce,be),ce}updateDOM(te,ce,be){const Ne=super.updateDOM(te,ce,be),Re=B(be.theme,te.__highlightType),Le=B(be.theme,this.__highlightType);return Re!==Le&&(Re&&t.removeClassNamesFromElement(ce,Re),Le&&t.addClassNamesToElement(ce,Le)),Ne}static importJSON(te){const ce=V(te.text,te.highlightType);return ce.setFormat(te.format),ce.setDetail(te.detail),ce.setMode(te.mode),ce.setStyle(te.style),ce}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(te){return this}isParentRequired(){return!0}createParentElementNode(){return y()}}function B(ee,te){return te&&ee&&ee.codeHighlight&&ee.codeHighlight[te]}function V(ee,te){return n.$applyNodeReplacement(new j(ee,te))}function xe(ee){return ee instanceof j}function we(ee){let te=ee,ce=ee;for(;xe(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getPreviousSibling();return te}function Ee(ee){let te=ee,ce=ee;for(;xe(ce)||n.$isTabNode(ce);)te=ce,ce=ce.getNextSibling();return te}const ue={defaultLanguage:F,tokenize(ee,te){return e.tokenize(ee,e.languages[te||""]||e.languages[this.defaultLanguage])}};function $(ee,te){let ce=null,be=null,Ne=ee,Re=te,Le=ee.getTextContent();for(;;){if(Re===0){if(Ne=Ne.getPreviousSibling(),Ne===null)break;if(!(xe(Ne)||n.$isTabNode(Ne)||n.$isLineBreakNode(Ne)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Ne)){ce={node:Ne,offset:1};break}Re=Math.max(0,Ne.getTextContentSize()-1),Le=Ne.getTextContent()}else Re--;const qe=Le[Re];xe(Ne)&&qe!==" "&&(be={node:Ne,offset:Re})}if(be!==null)return be;let Fe=null;if(te<ee.getTextContentSize())xe(ee)&&(Fe=ee.getTextContent()[te]);else{const qe=ee.getNextSibling();xe(qe)&&(Fe=qe.getTextContent()[0])}if(Fe!==null&&Fe!==" ")return ce;{const qe=x(ee,te);return qe!==null?qe:ce}}function x(ee,te){let ce=ee,be=te,Ne=ee.getTextContent(),Re=ee.getTextContentSize();for(;;){if(!xe(ce)||be===Re){if(ce=ce.getNextSibling(),ce===null||n.$isLineBreakNode(ce))return null;xe(ce)&&(be=0,Ne=ce.getTextContent(),Re=ce.getTextContentSize())}if(xe(ce)){if(Ne[be]!==" ")return{node:ce,offset:be};be++}}}function Y(ee){const te=Ee(ee);if(n.$isLineBreakNode(te))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return te}function ie(ee,te,ce){const be=ee.getParent();E(be)?Z(be,te,ce):xe(ee)&&ee.replace(n.$createTextNode(ee.__text))}function K(ee,te){const ce=te.getElementByKey(ee.getKey());if(ce===null)return;const be=ee.getChildren(),Ne=be.length;if(Ne===ce.__cachedChildrenLength)return;ce.__cachedChildrenLength=Ne;let Re="1",Le=1;for(let Fe=0;Fe<Ne;Fe++)n.$isLineBreakNode(be[Fe])&&(Re+=`
|
|
87
|
-
`+ ++Le);ce.setAttribute("data-gutter",Re)}const P=new Set;function Z(ee,te,ce){const be=ee.getKey();P.has(be)||(P.add(be),ee.getLanguage()===void 0&&ee.setLanguage(ce.defaultLanguage),te.update(()=>{H(be,()=>{const Ne=n.$getNodeByKey(be);if(!E(Ne)||!Ne.isAttached())return!1;const Re=Ne.getTextContent(),Le=ce.tokenize(Re,Ne.getLanguage()||ce.defaultLanguage),Fe=O(Le),qe=J(Ne.getChildren(),Fe),{from:Be,to:ct,nodesForReplacement:Dt}=qe;return Be!==ct||Dt.length?(ee.splice(Be,ct-Be,Dt),!0):!1})},{onUpdate:()=>{P.delete(be)},skipTransforms:!0}))}function O(ee,te){const ce=[];for(const be of ee)if(typeof be=="string"){const Ne=be.split(/(\n|\t)/),Re=Ne.length;for(let Le=0;Le<Re;Le++){const Fe=Ne[Le];Fe===`
|
|
88
|
-
`||Fe===`\r
|
|
89
|
-
`?ce.push(n.$createLineBreakNode()):Fe===" "?ce.push(n.$createTabNode()):Fe.length>0&&ce.push(V(Fe,te))}}else{const{content:Ne}=be;typeof Ne=="string"?ce.push(...O([Ne],be.type)):Array.isArray(Ne)&&ce.push(...O(Ne,be.type))}return ce}function H(ee,te){const ce=n.$getNodeByKey(ee);if(!E(ce)||!ce.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){te();return}const Ne=be.anchor,Re=Ne.offset,Le=Ne.type==="element"&&n.$isLineBreakNode(ce.getChildAtIndex(Ne.offset-1));let Fe=0;if(!Le){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((ct,Dt)=>ct+Dt.getTextContentSize(),0)}if(te()){if(Le){Ne.getNode().select(Re,Re);return}ce.getChildren().some(Be=>{const ct=n.$isTextNode(Be);if(ct||n.$isLineBreakNode(Be)){const Dt=Be.getTextContentSize();if(ct&&Dt>=Fe)return Be.select(Fe,Fe),!0;Fe-=Dt}return!1})}}function J(ee,te){let ce=0;for(;ce<ee.length&&de(ee[ce],te[ce]);)ce++;const be=ee.length,Ne=te.length,Re=Math.min(be,Ne)-ce;let Le=0;for(;Le<Re;)if(Le++,!de(ee[be-Le],te[Ne-Le])){Le--;break}const Fe=ce,qe=be-Le,Be=te.slice(ce,Ne-Le);return{from:Fe,nodesForReplacement:Be,to:qe}}function de(ee,te){return xe(ee)&&xe(te)&&ee.__text===te.__text&&ee.__highlightType===te.__highlightType||n.$isTabNode(ee)&&n.$isTabNode(te)||n.$isLineBreakNode(ee)&&n.$isLineBreakNode(te)}function _e(ee){if(!n.$isRangeSelection(ee))return!1;const te=ee.anchor.getNode(),ce=ee.focus.getNode();if(te.is(ce)&&E(te))return!0;const be=te.getParent();return E(be)&&be.is(ce.getParent())}function b(ee){const te=ee.getNodes(),ce=[[]];if(te.length===1&&E(te[0]))return ce;let be=ce[0];for(let Ne=0;Ne<te.length;Ne++){const Re=te[Ne];if(!(xe(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=[],ce.push(be)):be.push(Re)}return ce}function v(ee){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!_e(te))return null;const ce=ee?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,be=ee?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(b(te).length>1)return ce;const Le=te.getNodes()[0];if(!(E(Le)||xe(Le)||n.$isTabNode(Le)||n.$isLineBreakNode(Le)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(E(Le))return ce;const Fe=we(Le),qe=Ee(Le),Be=te.anchor,ct=te.focus;let Dt,Ut;return ct.isBefore(Be)?(Dt=ct,Ut=Be):(Dt=Be,Ut=ct),Fe!==null&&qe!==null&&Dt.key===Fe.getKey()&&Dt.offset===0&&Ut.key===qe.getKey()&&Ut.offset===qe.getTextContentSize()?ce:be}function M(ee){const te=n.$getSelection();if(!n.$isRangeSelection(te)||!_e(te))return!1;const ce=b(te),be=ce.length;if(ce.length>1){for(let Fe=0;Fe<be;Fe++){const qe=ce[Fe];if(qe.length>0){let Be=qe[0];Fe===0&&(Be=we(Be)),Be!==null&&(ee===n.INDENT_CONTENT_COMMAND?Be.insertBefore(n.$createTabNode()):n.$isTabNode(Be)&&Be.remove())}}return!0}const Re=te.getNodes()[0];if(!(E(Re)||xe(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(E(Re))return ee===n.INDENT_CONTENT_COMMAND&&te.insertNodes([n.$createTabNode()]),!0;const Le=we(Re);if(Le===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return ee===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(Le)?Le.insertAfter(n.$createTabNode()):Le.insertBefore(n.$createTabNode()):n.$isTabNode(Le)&&Le.remove(),!0}function re(ee,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.offset,Le=Ne.offset,Fe=be.getNode(),qe=Ne.getNode(),Be=ee===n.KEY_ARROW_UP_COMMAND;if(!_e(ce)||!(xe(Fe)||n.$isTabNode(Fe))||!(xe(qe)||n.$isTabNode(qe)))return!1;if(!te.altKey){if(ce.isCollapsed()){const Se=Fe.getParentOrThrow();if(Be&&Re===0&&Fe.getPreviousSibling()===null){if(Se.getPreviousSibling()===null)return Se.selectPrevious(),te.preventDefault(),!0}else if(!Be&&Re===Fe.getTextContentSize()&&Fe.getNextSibling()===null&&Se.getNextSibling()===null)return Se.selectNext(),te.preventDefault(),!0}return!1}let ct,Dt;if(Fe.isBefore(qe)?(ct=we(Fe),Dt=Ee(qe)):(ct=we(qe),Dt=Ee(Fe)),ct==null||Dt==null)return!1;const Ut=ct.getNodesBetween(Dt);for(let Se=0;Se<Ut.length;Se++){const ke=Ut[Se];if(!xe(ke)&&!n.$isTabNode(ke)&&!n.$isLineBreakNode(ke))return!1}te.preventDefault(),te.stopPropagation();const en=Be?ct.getPreviousSibling():Dt.getNextSibling();if(!n.$isLineBreakNode(en))return!0;const Oe=Be?en.getPreviousSibling():en.getNextSibling();if(Oe==null)return!0;const ne=xe(Oe)||n.$isTabNode(Oe)||n.$isLineBreakNode(Oe)?Be?we(Oe):Ee(Oe):null;let oe=ne??Oe;return en.remove(),Ut.forEach(Se=>Se.remove()),ee===n.KEY_ARROW_UP_COMMAND?(Ut.forEach(Se=>oe.insertBefore(Se)),oe.insertBefore(en)):(oe.insertAfter(en),oe=en,Ut.forEach(Se=>{oe.insertAfter(Se),oe=Se})),ce.setTextNodeRange(Fe,Re,qe,Le),!0}function ye(ee,te){const ce=n.$getSelection();if(!n.$isRangeSelection(ce))return!1;const{anchor:be,focus:Ne}=ce,Re=be.getNode(),Le=Ne.getNode(),Fe=ee===n.MOVE_TO_START;if(!(xe(Re)||n.$isTabNode(Re))||!(xe(Le)||n.$isTabNode(Le)))return!1;if(Fe){const qe=$(Le,Ne.offset);if(qe!==null){const{node:Be,offset:ct}=qe;n.$isLineBreakNode(Be)?Be.selectNext(0,0):ce.setTextNodeRange(Be,ct,Be,ct)}else Le.getParentOrThrow().selectStart()}else Y(Le).select();return te.preventDefault(),te.stopPropagation(),!0}function Ae(ee,te){if(!ee.hasNodes([g,j]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return te==null&&(te=ue),t.mergeRegister(ee.registerMutationListener(g,ce=>{ee.update(()=>{for(const[be,Ne]of ce)if(Ne!=="destroyed"){const Re=n.$getNodeByKey(be);Re!==null&&K(Re,ee)}})}),ee.registerNodeTransform(g,ce=>Z(ce,ee,te)),ee.registerNodeTransform(n.TextNode,ce=>ie(ce,ee,te)),ee.registerNodeTransform(j,ce=>ie(ce,ee,te)),ee.registerCommand(n.KEY_TAB_COMMAND,ce=>{const be=v(ce.shiftKey);return be===null?!1:(ce.preventDefault(),ee.dispatchCommand(be,void 0),!0)},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ce=n.$getSelection();return _e(ce)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INDENT_CONTENT_COMMAND,ce=>M(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.OUTDENT_CONTENT_COMMAND,ce=>M(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_UP_COMMAND,ce=>re(n.KEY_ARROW_UP_COMMAND,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ce=>re(n.KEY_ARROW_DOWN_COMMAND,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_END,ce=>ye(n.MOVE_TO_END,ce),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_START,ce=>ye(n.MOVE_TO_START,ce),n.COMMAND_PRIORITY_LOW))}return Ln.$createCodeHighlightNode=V,Ln.$createCodeNode=y,Ln.$isCodeHighlightNode=xe,Ln.$isCodeNode=E,Ln.CODE_LANGUAGE_FRIENDLY_NAME_MAP=W,Ln.CODE_LANGUAGE_MAP=G,Ln.CodeHighlightNode=j,Ln.CodeNode=g,Ln.DEFAULT_CODE_LANGUAGE=F,Ln.PrismTokenizer=ue,Ln.getCodeLanguages=ge,Ln.getDefaultCodeLanguage=se,Ln.getEndOfCodeInLine=Y,Ln.getFirstCodeNodeOfLine=we,Ln.getLanguageFriendlyName=le,Ln.getLastCodeNodeOfLine=Ee,Ln.getStartOfCodeInLine=$,Ln.normalizeCodeLang=q,Ln.registerCodeHighlighting=Ae,Ln}var Pn={},jf;function Xy(){if(jf)return Pn;jf=1;var e=Cg();Eg(),Tg(),xg(),Sg(),vg(),wg(),Og(),Ag(),Dg(),Mg(),Rg(),bg(),Ig(),kg();var t=Xn(),n=gn();let r=O=>O!=null&&e.languages.hasOwnProperty(O)?O:void 0;function c(O,H){for(let J of O.childNodes){if(t.isHTMLElement(J)&&J.tagName===H)return!0;c(J,H)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(H){return new d(H.__language,H.__key)}constructor(H,J){super(J),this.__language=r(H)}createDOM(H){let J=document.createElement("code");return t.addClassNamesToElement(J,H.theme.code),J.setAttribute("spellcheck","false"),(H=this.getLanguage())&&J.setAttribute("data-highlight-language",H),J}updateDOM(H,J){let de=this.__language;return H=H.__language,de?de!==H&&J.setAttribute("data-highlight-language",de):H&&J.removeAttribute("data-highlight-language"),!1}exportDOM(){let H=document.createElement("pre");H.setAttribute("spellcheck","false");let J=this.getLanguage();return J&&H.setAttribute("data-highlight-language",J),{element:H}}static importDOM(){return{code:H=>H.textContent!=null&&(/\r?\n/.test(H.textContent)||c(H,"BR"))?{conversion:E,priority:1}:null,div:()=>({conversion:T,priority:1}),pre:()=>({conversion:E,priority:0}),table:H=>C(H)?{conversion:R,priority:3}:null,td:H=>{let J=H.closest("table");return H.classList.contains("js-file-line")?{conversion:k,priority:3}:J&&C(J)?{conversion:I,priority:3}:null},tr:H=>(H=H.closest("table"))&&C(H)?{conversion:I,priority:3}:null}}static importJSON(H){let J=g(H.language);return J.setFormat(H.format),J.setIndent(H.indent),J.setDirection(H.direction),J}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(H,J=!0){var de=this.getChildren(),_e=de.length;if(2<=_e&&de[_e-1].getTextContent()===`
|
|
90
|
-
`&&de[_e-2].getTextContent()===`
|
|
91
|
-
`&&H.isCollapsed()&&H.anchor.key===this.__key&&H.anchor.offset===_e)return de[_e-1].remove(),de[_e-2].remove(),H=n.$createParagraphNode(),this.insertAfter(H,J),H;let{anchor:b,focus:v}=H;if(J=(b.isBefore(v)?b:v).getNode(),n.$isTextNode(J)){for(_e=le(J),de=[];;)if(n.$isTabNode(_e))de.push(n.$createTabNode()),_e=_e.getNextSibling();else if(q(_e)){for(var M=0,re=_e.getTextContent(),ye=_e.getTextContentSize();M<ye&&re[M]===" ";M++);if(M!==0&&de.push(G(" ".repeat(M))),M!==ye)break;_e=_e.getNextSibling()}else break;_e=J.splitText(b.offset)[0],M=b.offset===0?0:1,M=_e.getIndexWithinParent()+M,re=J.getParentOrThrow(),ye=[n.$createLineBreakNode(),...de],re.splice(M,0,ye),(de=de[de.length-1])?de.select():b.offset===0?_e.selectPrevious():_e.getNextSibling().selectNext(0,0)}return y(J)&&({offset:H}=H.anchor,J.splice(H,0,[n.$createLineBreakNode()]),J.select(H+1,H+1)),null}canIndent(){return!1}collapseAtStart(){let H=n.$createParagraphNode();return this.getChildren().forEach(J=>H.append(J)),this.replace(H),!0}setLanguage(H){this.getWritable().__language=r(H)}getLanguage(){return this.getLatest().__language}}function g(O){return n.$applyNodeReplacement(new d(O))}function y(O){return O instanceof d}function E(O){let H;return t.isHTMLElement(O)&&(H=O.getAttribute("data-highlight-language")),{node:g(H)}}function T(O){let H=O.style.fontFamily.match("monospace")!==null;return H||U(O)?{after:J=>{let de=O.parentNode;return de!=null&&O!==de.lastChild&&J.push(n.$createLineBreakNode()),J},node:H?g():null}:{node:null}}function R(){return{node:g()}}function I(){return{node:null}}function k(O){return{after:H=>(O.parentNode&&O.parentNode.nextSibling&&H.push(n.$createLineBreakNode()),H),node:null}}function U(O){for(O=O.parentElement;O!==null;){if(O.style.fontFamily.match("monospace")!==null)return!0;O=O.parentElement}return!1}function C(O){return O.classList.contains("js-file-line-container")}let w={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},z={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function Q(O){return z[O]||O}class F extends n.TextNode{constructor(H,J,de){super(H,de),this.__highlightType=J}static getType(){return"code-highlight"}static clone(H){return new F(H.__text,H.__highlightType||void 0,H.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(H){let J=super.createDOM(H);return H=W(H.theme,this.__highlightType),t.addClassNamesToElement(J,H),J}updateDOM(H,J,de){let _e=super.updateDOM(H,J,de);return H=W(de.theme,H.__highlightType),de=W(de.theme,this.__highlightType),H!==de&&(H&&t.removeClassNamesFromElement(J,H),de&&t.addClassNamesToElement(J,de)),_e}static importJSON(H){let J=G(H.text,H.highlightType);return J.setFormat(H.format),J.setDetail(H.detail),J.setMode(H.mode),J.setStyle(H.style),J}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return g()}}function W(O,H){return H&&O&&O.codeHighlight&&O.codeHighlight[H]}function G(O,H){return n.$applyNodeReplacement(new F(O,H))}function q(O){return O instanceof F}function le(O){let H=O;for(;q(O)||n.$isTabNode(O);)H=O,O=O.getPreviousSibling();return H}function se(O){let H=O;for(;q(O)||n.$isTabNode(O);)H=O,O=O.getNextSibling();return H}let ge={defaultLanguage:"javascript",tokenize(O,H){return e.tokenize(O,e.languages[H||""]||e.languages[this.defaultLanguage])}};function j(O,H){let J=null;var de=null,_e=O;let b=H,v=O.getTextContent();for(;;){if(b===0){if(_e=_e.getPreviousSibling(),_e===null)break;if(!(q(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(_e)){J={node:_e,offset:1};break}b=Math.max(0,_e.getTextContentSize()-1),v=_e.getTextContent()}else b--;let M=v[b];q(_e)&&M!==" "&&(de={node:_e,offset:b})}if(de!==null)return de;if(de=null,H<O.getTextContentSize()?q(O)&&(de=O.getTextContent()[H]):(_e=O.getNextSibling(),q(_e)&&(de=_e.getTextContent()[0])),de!==null&&de!==" ")return J;e:for(de=O,_e=O.getTextContent(),O=O.getTextContentSize();;){if(!q(de)||H===O){if(de=de.getNextSibling(),de===null||n.$isLineBreakNode(de)){O=null;break e}q(de)&&(H=0,_e=de.getTextContent(),O=de.getTextContentSize())}if(q(de)){if(_e[H]!==" "){O={node:de,offset:H};break e}H++}}return O!==null?O:J}function B(O){if(O=se(O),n.$isLineBreakNode(O))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return O}function V(O,H,J){let de=O.getParent();y(de)?we(de,H,J):q(O)&&O.replace(n.$createTextNode(O.__text))}let xe=new Set;function we(O,H,J){let de=O.getKey();xe.has(de)||(xe.add(de),O.getLanguage()===void 0&&O.setLanguage(J.defaultLanguage),H.update(()=>{ue(de,()=>{var _e=n.$getNodeByKey(de);if(!y(_e)||!_e.isAttached())return!1;var b=_e.getTextContent();b=J.tokenize(b,_e.getLanguage()||J.defaultLanguage),b=Ee(b);var v=_e.getChildren();for(_e=0;_e<v.length&&$(v[_e],b[_e]);)_e++;var M=v.length;let re=b.length,ye=Math.min(M,re)-_e,Ae=0;for(;Ae<ye;)if(Ae++,!$(v[M-Ae],b[re-Ae])){Ae--;break}v=_e,M-=Ae,b=b.slice(_e,re-Ae);let{from:ee,to:te,nodesForReplacement:ce}={from:v,nodesForReplacement:b,to:M};return ee!==te||ce.length?(O.splice(ee,te-ee,ce),!0):!1})},{onUpdate:()=>{xe.delete(de)},skipTransforms:!0}))}function Ee(O,H){let J=[];for(let de of O)if(typeof de=="string"){O=de.split(/(\n|\t)/);let _e=O.length;for(let b=0;b<_e;b++){let v=O[b];v===`
|
|
92
|
-
`||v===`\r
|
|
93
|
-
`?J.push(n.$createLineBreakNode()):v===" "?J.push(n.$createTabNode()):0<v.length&&J.push(G(v,H))}}else({content:O}=de),typeof O=="string"?J.push(...Ee([O],de.type)):Array.isArray(O)&&J.push(...Ee(O,de.type));return J}function ue(O,H){if(O=n.$getNodeByKey(O),y(O)&&O.isAttached()){var J=n.$getSelection();if(n.$isRangeSelection(J)){J=J.anchor;var de=J.offset,_e=J.type==="element"&&n.$isLineBreakNode(O.getChildAtIndex(J.offset-1)),b=0;if(!_e){let v=J.getNode();b=de+v.getPreviousSiblings().reduce((M,re)=>M+re.getTextContentSize(),0)}H()&&(_e?J.getNode().select(de,de):O.getChildren().some(v=>{let M=n.$isTextNode(v);if(M||n.$isLineBreakNode(v)){let re=v.getTextContentSize();if(M&&re>=b)return v.select(b,b),!0;b-=re}return!1}))}else H()}}function $(O,H){return q(O)&&q(H)&&O.__text===H.__text&&O.__highlightType===H.__highlightType||n.$isTabNode(O)&&n.$isTabNode(H)||n.$isLineBreakNode(O)&&n.$isLineBreakNode(H)}function x(O){if(!n.$isRangeSelection(O))return!1;var H=O.anchor.getNode();return O=O.focus.getNode(),H.is(O)&&y(H)?!0:(H=H.getParent(),y(H)&&H.is(O.getParent()))}function Y(O){O=O.getNodes();let H=[[]];if(O.length===1&&y(O[0]))return H;let J=H[0];for(let de=0;de<O.length;de++){let _e=O[de];if(!(q(_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)?de!==0&&0<J.length&&(J=[],H.push(J)):J.push(_e)}return H}function ie(O){var H=n.$getSelection();if(!n.$isRangeSelection(H)||!x(H))return null;let J=O?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(O=O?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<Y(H).length)return J;var de=H.getNodes()[0];if(!(y(de)||q(de)||n.$isTabNode(de)||n.$isLineBreakNode(de)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(y(de))return J;let _e=le(de);de=se(de);var b=H.anchor;let v=H.focus;return v.isBefore(b)?H=v:(H=b,b=v),_e!==null&&de!==null&&H.key===_e.getKey()&&H.offset===0&&b.key===de.getKey()&&b.offset===de.getTextContentSize()?J:O}function K(O){var H=n.$getSelection();if(!n.$isRangeSelection(H)||!x(H))return!1;var J=Y(H);let de=J.length;if(1<J.length){for(H=0;H<de;H++){var _e=J[H];0<_e.length&&(_e=_e[0],H===0&&(_e=le(_e)),_e!==null&&(O===n.INDENT_CONTENT_COMMAND?_e.insertBefore(n.$createTabNode()):n.$isTabNode(_e)&&_e.remove()))}return!0}if(J=H.getNodes()[0],!(y(J)||q(J)||n.$isTabNode(J)||n.$isLineBreakNode(J)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(y(J))return O===n.INDENT_CONTENT_COMMAND&&H.insertNodes([n.$createTabNode()]),!0;if(J=le(J),J===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return O===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(J)?J.insertAfter(n.$createTabNode()):J.insertBefore(n.$createTabNode()):n.$isTabNode(J)&&J.remove(),!0}function P(O,H){let J=n.$getSelection();if(!n.$isRangeSelection(J))return!1;let{anchor:de,focus:_e}=J,b=de.offset,v=_e.offset,M=de.getNode(),re=_e.getNode();var ye=O===n.KEY_ARROW_UP_COMMAND;if(!x(J)||!q(M)&&!n.$isTabNode(M)||!q(re)&&!n.$isTabNode(re))return!1;if(!H.altKey){if(J.isCollapsed()){if(O=M.getParentOrThrow(),ye&&b===0&&M.getPreviousSibling()===null){if(O.getPreviousSibling()===null)return O.selectPrevious(),H.preventDefault(),!0}else if(!ye&&b===M.getTextContentSize()&&M.getNextSibling()===null&&O.getNextSibling()===null)return O.selectNext(),H.preventDefault(),!0}return!1}let Ae;if(M.isBefore(re)){var ee=le(M);Ae=se(re)}else ee=le(re),Ae=se(M);if(ee==null||Ae==null)return!1;let te=ee.getNodesBetween(Ae);for(let be=0;be<te.length;be++){let Ne=te[be];if(!q(Ne)&&!n.$isTabNode(Ne)&&!n.$isLineBreakNode(Ne))return!1}if(H.preventDefault(),H.stopPropagation(),H=ye?ee.getPreviousSibling():Ae.getNextSibling(),!n.$isLineBreakNode(H)||(ee=ye?H.getPreviousSibling():H.getNextSibling(),ee==null))return!0;ye=q(ee)||n.$isTabNode(ee)||n.$isLineBreakNode(ee)?ye?le(ee):se(ee):null;let ce=ye??ee;return H.remove(),te.forEach(be=>be.remove()),O===n.KEY_ARROW_UP_COMMAND?(te.forEach(be=>ce.insertBefore(be)),ce.insertBefore(H)):(ce.insertAfter(H),ce=H,te.forEach(be=>{ce.insertAfter(be),ce=be})),J.setTextNodeRange(M,b,re,v),!0}function Z(O,H){let J=n.$getSelection();if(!n.$isRangeSelection(J))return!1;let{anchor:de,focus:_e}=J;var b=de.getNode();let v=_e.getNode();if(O=O===n.MOVE_TO_START,!q(b)&&!n.$isTabNode(b)||!q(v)&&!n.$isTabNode(v))return!1;if(O)if(b=j(v,_e.offset),b!==null){let{node:M,offset:re}=b;n.$isLineBreakNode(M)?M.selectNext(0,0):J.setTextNodeRange(M,re,M,re)}else v.getParentOrThrow().selectStart();else B(v).select();return H.preventDefault(),H.stopPropagation(),!0}return Pn.$createCodeHighlightNode=G,Pn.$createCodeNode=g,Pn.$isCodeHighlightNode=q,Pn.$isCodeNode=y,Pn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=w,Pn.CODE_LANGUAGE_MAP=z,Pn.CodeHighlightNode=F,Pn.CodeNode=d,Pn.DEFAULT_CODE_LANGUAGE="javascript",Pn.PrismTokenizer=ge,Pn.getCodeLanguages=()=>Object.keys(e.languages).filter(O=>typeof e.languages[O]!="function").sort(),Pn.getDefaultCodeLanguage=()=>"javascript",Pn.getEndOfCodeInLine=B,Pn.getFirstCodeNodeOfLine=le,Pn.getLanguageFriendlyName=function(O){return O=Q(O),w[O]||O},Pn.getLastCodeNodeOfLine=se,Pn.getStartOfCodeInLine=j,Pn.normalizeCodeLang=Q,Pn.registerCodeHighlighting=function(O,H){if(!O.hasNodes([d,F]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return H==null&&(H=ge),t.mergeRegister(O.registerMutationListener(d,J=>{O.update(()=>{for(let[b,v]of J)if(v!=="destroyed"){var de=n.$getNodeByKey(b);if(de!==null)e:{var _e=de;if(de=O.getElementByKey(_e.getKey()),de===null)break e;_e=_e.getChildren();let M=_e.length;if(M===de.__cachedChildrenLength)break e;de.__cachedChildrenLength=M;let re="1",ye=1;for(let Ae=0;Ae<M;Ae++)n.$isLineBreakNode(_e[Ae])&&(re+=`
|
|
94
|
-
`+ ++ye);de.setAttribute("data-gutter",re)}}})}),O.registerNodeTransform(d,J=>we(J,O,H)),O.registerNodeTransform(n.TextNode,J=>V(J,O,H)),O.registerNodeTransform(F,J=>V(J,O,H)),O.registerCommand(n.KEY_TAB_COMMAND,J=>{let de=ie(J.shiftKey);return de===null?!1:(J.preventDefault(),O.dispatchCommand(de,void 0),!0)},n.COMMAND_PRIORITY_LOW),O.registerCommand(n.INSERT_TAB_COMMAND,()=>{let J=n.$getSelection();return x(J)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),O.registerCommand(n.INDENT_CONTENT_COMMAND,()=>K(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>K(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.KEY_ARROW_UP_COMMAND,J=>P(n.KEY_ARROW_UP_COMMAND,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.KEY_ARROW_DOWN_COMMAND,J=>P(n.KEY_ARROW_DOWN_COMMAND,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.MOVE_TO_END,J=>Z(n.MOVE_TO_END,J),n.COMMAND_PRIORITY_LOW),O.registerCommand(n.MOVE_TO_START,J=>Z(n.MOVE_TO_START,J),n.COMMAND_PRIORITY_LOW))},Pn}const Qy=process.env.NODE_ENV==="development"?Jy():Xy();var Vf=Qy,Ti={},qf;function eN(){if(qf)return Ti;qf=1;var e=Xn(),t=gn();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(C){return new r(C.__url,{rel:C.__rel,target:C.__target,title:C.__title},C.__key)}constructor(C,w={},z){super(z);const{target:Q=null,rel:F=null,title:W=null}=w;this.__url=C,this.__target=Q,this.__rel=F,this.__title=W}createDOM(C){const w=document.createElement("a");return w.href=this.sanitizeUrl(this.__url),this.__target!==null&&(w.target=this.__target),this.__rel!==null&&(w.rel=this.__rel),this.__title!==null&&(w.title=this.__title),e.addClassNamesToElement(w,C.theme.link),w}updateDOM(C,w,z){const Q=this.__url,F=this.__target,W=this.__rel,G=this.__title;return Q!==C.__url&&(w.href=Q),F!==C.__target&&(F?w.target=F:w.removeAttribute("target")),W!==C.__rel&&(W?w.rel=W:w.removeAttribute("rel")),G!==C.__title&&(G?w.title=G:w.removeAttribute("title")),!1}static importDOM(){return{a:C=>({conversion:c,priority:1})}}static importJSON(C){const w=d(C.url,{rel:C.rel,target:C.target,title:C.title});return w.setFormat(C.format),w.setIndent(C.indent),w.setDirection(C.direction),w}sanitizeUrl(C){try{const w=new URL(C);if(!n.has(w.protocol))return"about:blank"}catch{return C}return C}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(C){const w=this.getWritable();w.__url=C}getTarget(){return this.getLatest().__target}setTarget(C){const w=this.getWritable();w.__target=C}getRel(){return this.getLatest().__rel}setRel(C){const w=this.getWritable();w.__rel=C}getTitle(){return this.getLatest().__title}setTitle(C){const w=this.getWritable();w.__title=C}insertNewAfter(C,w=!0){const z=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(z,w),z}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(C,w,z){if(!t.$isRangeSelection(w))return!1;const Q=w.anchor.getNode(),F=w.focus.getNode();return this.isParentOf(Q)&&this.isParentOf(F)&&w.getTextContent().length>0}}function c(U){let C=null;if(e.isHTMLAnchorElement(U)){const w=U.textContent;(w!==null&&w!==""||U.children.length>0)&&(C=d(U.getAttribute("href")||"",{rel:U.getAttribute("rel"),target:U.getAttribute("target"),title:U.getAttribute("title")}))}return{node:C}}function d(U,C){return t.$applyNodeReplacement(new r(U,C))}function g(U){return U instanceof r}class y extends r{static getType(){return"autolink"}static clone(C){return new y(C.__url,{rel:C.__rel,target:C.__target,title:C.__title},C.__key)}static importJSON(C){const w=E(C.url,{rel:C.rel,target:C.target,title:C.title});return w.setFormat(C.format),w.setIndent(C.indent),w.setDirection(C.direction),w}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(C,w=!0){const z=this.getParentOrThrow().insertNewAfter(C,w);if(t.$isElementNode(z)){const Q=E(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return z.append(Q),Q}return null}}function E(U,C){return t.$applyNodeReplacement(new y(U,C))}function T(U){return U instanceof y}const R=t.createCommand("TOGGLE_LINK_COMMAND");function I(U,C={}){const{target:w,title:z}=C,Q=C.rel===void 0?"noreferrer":C.rel,F=t.$getSelection();if(!t.$isRangeSelection(F))return;const W=F.extract();if(U===null)W.forEach(G=>{const q=G.getParent();if(g(q)){const le=q.getChildren();for(let se=0;se<le.length;se++)q.insertBefore(le[se]);q.remove()}});else{if(W.length===1){const le=W[0],se=k(le,g);if(se!==null){se.setURL(U),w!==void 0&&se.setTarget(w),Q!==null&&se.setRel(Q),z!==void 0&&se.setTitle(z);return}}let G=null,q=null;W.forEach(le=>{const se=le.getParent();if(!(se===q||se===null||t.$isElementNode(le)&&!le.isInline())){if(g(se)){q=se,se.setURL(U),w!==void 0&&se.setTarget(w),Q!==null&&q.setRel(Q),z!==void 0&&q.setTitle(z);return}if(se.is(G)||(G=se,q=d(U,{rel:Q,target:w,title:z}),g(se)?le.getPreviousSibling()===null?se.insertBefore(q):se.insertAfter(q):le.insertBefore(q)),g(le)){if(le.is(q))return;if(q!==null){const ge=le.getChildren();for(let j=0;j<ge.length;j++)q.append(ge[j])}le.remove();return}q!==null&&q.append(le)}})}}function k(U,C){let w=U;for(;w!==null&&w.getParent()!==null&&!C(w);)w=w.getParentOrThrow();return C(w)?w:null}return Ti.$createAutoLinkNode=E,Ti.$createLinkNode=d,Ti.$isAutoLinkNode=T,Ti.$isLinkNode=g,Ti.AutoLinkNode=y,Ti.LinkNode=r,Ti.TOGGLE_LINK_COMMAND=R,Ti.toggleLink=I,Ti}var xi={},Zf;function tN(){if(Zf)return xi;Zf=1;var e=Xn(),t=gn();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(k){return new r(k.__url,{rel:k.__rel,target:k.__target,title:k.__title},k.__key)}constructor(k,U={},C){super(C);let{target:w=null,rel:z=null,title:Q=null}=U;this.__url=k,this.__target=w,this.__rel=z,this.__title=Q}createDOM(k){let U=document.createElement("a");return U.href=this.sanitizeUrl(this.__url),this.__target!==null&&(U.target=this.__target),this.__rel!==null&&(U.rel=this.__rel),this.__title!==null&&(U.title=this.__title),e.addClassNamesToElement(U,k.theme.link),U}updateDOM(k,U){let C=this.__url,w=this.__target,z=this.__rel,Q=this.__title;return C!==k.__url&&(U.href=C),w!==k.__target&&(w?U.target=w:U.removeAttribute("target")),z!==k.__rel&&(z?U.rel=z:U.removeAttribute("rel")),Q!==k.__title&&(Q?U.title=Q:U.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:c,priority:1})}}static importJSON(k){let U=d(k.url,{rel:k.rel,target:k.target,title:k.title});return U.setFormat(k.format),U.setIndent(k.indent),U.setDirection(k.direction),U}sanitizeUrl(k){try{let U=new URL(k);if(!n.has(U.protocol))return"about:blank"}catch{}return k}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(k){this.getWritable().__url=k}getTarget(){return this.getLatest().__target}setTarget(k){this.getWritable().__target=k}getRel(){return this.getLatest().__rel}setRel(k){this.getWritable().__rel=k}getTitle(){return this.getLatest().__title}setTitle(k){this.getWritable().__title=k}insertNewAfter(k,U=!0){return k=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(k,U),k}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(k,U){if(!t.$isRangeSelection(U))return!1;k=U.anchor.getNode();let C=U.focus.getNode();return this.isParentOf(k)&&this.isParentOf(C)&&0<U.getTextContent().length}}function c(I){let k=null;if(e.isHTMLAnchorElement(I)){let U=I.textContent;(U!==null&&U!==""||0<I.children.length)&&(k=d(I.getAttribute("href")||"",{rel:I.getAttribute("rel"),target:I.getAttribute("target"),title:I.getAttribute("title")}))}return{node:k}}function d(I,k){return t.$applyNodeReplacement(new r(I,k))}function g(I){return I instanceof r}class y extends r{static getType(){return"autolink"}static clone(k){return new y(k.__url,{rel:k.__rel,target:k.__target,title:k.__title},k.__key)}static importJSON(k){let U=E(k.url,{rel:k.rel,target:k.target,title:k.title});return U.setFormat(k.format),U.setIndent(k.indent),U.setDirection(k.direction),U}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(k,U=!0){return k=this.getParentOrThrow().insertNewAfter(k,U),t.$isElementNode(k)?(U=E(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),k.append(U),U):null}}function E(I,k){return t.$applyNodeReplacement(new y(I,k))}let T=t.createCommand("TOGGLE_LINK_COMMAND");function R(I,k){for(;I!==null&&I.getParent()!==null&&!k(I);)I=I.getParentOrThrow();return k(I)?I:null}return xi.$createAutoLinkNode=E,xi.$createLinkNode=d,xi.$isAutoLinkNode=function(I){return I instanceof y},xi.$isLinkNode=g,xi.AutoLinkNode=y,xi.LinkNode=r,xi.TOGGLE_LINK_COMMAND=T,xi.toggleLink=function(I,k={}){let{target:U,title:C}=k,w=k.rel===void 0?"noreferrer":k.rel;if(k=t.$getSelection(),t.$isRangeSelection(k))if(k=k.extract(),I===null)k.forEach(z=>{if(z=z.getParent(),g(z)){let Q=z.getChildren();for(let F=0;F<Q.length;F++)z.insertBefore(Q[F]);z.remove()}});else{if(k.length===1){let F=R(k[0],g);if(F!==null){F.setURL(I),U!==void 0&&F.setTarget(U),w!==null&&F.setRel(w),C!==void 0&&F.setTitle(C);return}}let z=null,Q=null;k.forEach(F=>{var W=F.getParent();if(W!==Q&&W!==null&&(!t.$isElementNode(F)||F.isInline()))if(g(W))Q=W,W.setURL(I),U!==void 0&&W.setTarget(U),w!==null&&Q.setRel(w),C!==void 0&&Q.setTitle(C);else if(W.is(z)||(z=W,Q=d(I,{rel:w,target:U,title:C}),g(W)?F.getPreviousSibling()===null?W.insertBefore(Q):W.insertAfter(Q):F.insertBefore(Q)),g(F)){if(!F.is(Q)){if(Q!==null){W=F.getChildren();for(let G=0;G<W.length;G++)Q.append(W[G])}F.remove()}}else Q!==null&&Q.append(F)})}},xi}const nN=process.env.NODE_ENV==="development"?eN():tN();var Jf=nN,ci={},Si={},Ga={},Xf;function rN(){if(Xf)return Ga;Xf=1;var e=Cs(),t=Xn(),n=gn();function r(T,R){const I=R.body?R.body.childNodes:[];let k=[];for(let U=0;U<I.length;U++){const C=I[U];if(!y.has(C.nodeName)){const w=E(C,T);w!==null&&(k=k.concat(w))}}return k}function c(T,R){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 I=document.createElement("div"),U=n.$getRoot().getChildren();for(let C=0;C<U.length;C++){const w=U[C];d(T,w,I,R)}return I.innerHTML}function d(T,R,I,k=null){let U=k!=null?R.isSelected(k):!0;const C=n.$isElementNode(R)&&R.excludeFromCopy("html");let w=R;if(k!==null){let le=e.$cloneWithProperties(R);le=n.$isTextNode(le)&&k!=null?e.$sliceSelectedTextNodeContent(k,le):le,w=le}const z=n.$isElementNode(w)?w.getChildren():[],Q=T._nodes.get(w.getType());let F;Q&&Q.exportDOM!==void 0?F=Q.exportDOM(T,w):F=w.exportDOM(T);const{element:W,after:G}=F;if(!W)return!1;const q=document.createDocumentFragment();for(let le=0;le<z.length;le++){const se=z[le],ge=d(T,se,q,k);!U&&n.$isElementNode(R)&&ge&&R.extractWithChild(se,k,"html")&&(U=!0)}if(U&&!C){if(t.isHTMLElement(W)&&W.append(q),I.append(W),G){const le=G.call(w,W);le&&W.replaceWith(le)}}else I.append(q);return U}function g(T,R){const{nodeName:I}=T,k=R._htmlConversions.get(I.toLowerCase());let U=null;if(k!==void 0)for(const C of k){const w=C(T);w!==null&&(U===null||(U.priority||0)<(w.priority||0))&&(U=w)}return U!==null?U.conversion:null}const y=new Set(["STYLE","SCRIPT"]);function E(T,R,I=new Map,k){let U=[];if(y.has(T.nodeName))return U;let C=null;const w=g(T,R),z=w?w(T):null;let Q=null;if(z!==null){Q=z.after;const G=z.node;if(C=Array.isArray(G)?G[G.length-1]:G,C!==null){for(const[,q]of I)if(C=q(C,k),!C)break;C&&U.push(...Array.isArray(G)?G:[C])}z.forChild!=null&&I.set(T.nodeName,z.forChild)}const F=T.childNodes;let W=[];for(let G=0;G<F.length;G++)W.push(...E(F[G],R,new Map(I),C));return Q!=null&&(W=Q(W)),C==null?U=U.concat(W):n.$isElementNode(C)&&C.append(...W),U}return Ga.$generateHtmlFromNodes=c,Ga.$generateNodesFromDOM=r,Ga}var Ya={},Qf;function iN(){if(Qf)return Ya;Qf=1;var e=Cs(),t=Xn(),n=gn();function r(g,y,E,T=null){let R=T!=null?y.isSelected(T):!0,I=n.$isElementNode(y)&&y.excludeFromCopy("html");var k=y;T!==null&&(k=e.$cloneWithProperties(y),k=n.$isTextNode(k)&&T!=null?e.$sliceSelectedTextNodeContent(T,k):k);let U=n.$isElementNode(k)?k.getChildren():[];var C=g._nodes.get(k.getType());C=C&&C.exportDOM!==void 0?C.exportDOM(g,k):k.exportDOM(g);let{element:w,after:z}=C;if(!w)return!1;C=document.createDocumentFragment();for(let Q=0;Q<U.length;Q++){let F=U[Q],W=r(g,F,C,T);!R&&n.$isElementNode(y)&&W&&y.extractWithChild(F,T,"html")&&(R=!0)}return R&&!I?(t.isHTMLElement(w)&&w.append(C),E.append(w),z&&(g=z.call(k,w))&&w.replaceWith(g)):E.append(C),R}let c=new Set(["STYLE","SCRIPT"]);function d(g,y,E=new Map,T){let R=[];if(c.has(g.nodeName))return R;let I=null;var k,{nodeName:U}=g,C=y._htmlConversions.get(U.toLowerCase());if(U=null,C!==void 0)for(k of C)C=k(g),C!==null&&(U===null||(U.priority||0)<(C.priority||0))&&(U=C);if(U=(k=U!==null?U.conversion:null)?k(g):null,k=null,U!==null){if(k=U.after,C=U.node,I=Array.isArray(C)?C[C.length-1]:C,I!==null){for(var[,w]of E)if(I=w(I,T),!I)break;I&&R.push(...Array.isArray(C)?C:[I])}U.forChild!=null&&E.set(g.nodeName,U.forChild)}for(g=g.childNodes,T=[],w=0;w<g.length;w++)T.push(...d(g[w],y,new Map(E),I));return k!=null&&(T=k(T)),I==null?R=R.concat(T):n.$isElementNode(I)&&I.append(...T),R}return Ya.$generateHtmlFromNodes=function(g,y){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 E=document.createElement("div"),T=n.$getRoot().getChildren();for(let R=0;R<T.length;R++)r(g,T[R],E,y);return E.innerHTML},Ya.$generateNodesFromDOM=function(g,y){y=y.body?y.body.childNodes:[];let E=[];for(let R=0;R<y.length;R++){var T=y[R];c.has(T.nodeName)||(T=d(T,g),T!==null&&(E=E.concat(T)))}return E},Ya}const sN=process.env.NODE_ENV==="development"?rN():iN();var Yu=sN,eh;function oN(){if(eh)return Si;eh=1;var e=Yu,t=Cs(),n=Xn(),r=gn();const c=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=W=>c?(W||window).getSelection():null;function g(W){const G=r.$getSelection();if(G==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(G)&&G.isCollapsed()||G.getNodes().length===0?"":e.$generateHtmlFromNodes(W,G)}function y(W){const G=r.$getSelection();if(G==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(G)&&G.isCollapsed()||G.getNodes().length===0?null:JSON.stringify(U(W,G))}function E(W,G){const q=W.getData("text/plain")||W.getData("text/uri-list");q!=null&&G.insertRawText(q)}function T(W,G,q){const le=W.getData("application/x-lexical-editor");if(le)try{const j=JSON.parse(le);if(j.namespace===q._config.namespace&&Array.isArray(j.nodes)){const B=C(j.nodes);return R(q,B,G)}}catch{}const se=W.getData("text/html");if(se)try{const B=new DOMParser().parseFromString(se,"text/html"),V=e.$generateNodesFromDOM(q,B);return R(q,V,G)}catch{}const ge=W.getData("text/plain")||W.getData("text/uri-list");if(ge!=null)if(r.$isRangeSelection(G)){const j=ge.split(/(\r?\n|\t)/);j[j.length-1]===""&&j.pop();for(let B=0;B<j.length;B++){const V=j[B];V===`
|
|
95
|
-
`||V===`\r
|
|
96
|
-
`?G.insertParagraph():V===" "?G.insertNodes([r.$createTabNode()]):G.insertText(V)}}else G.insertRawText(ge)}function R(W,G,q){W.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:G,selection:q})||q.insertNodes(G)}function I(W){const G=W.exportJSON(),q=W.constructor;if(G.type!==q.getType())throw Error(`LexicalNode: Node ${q.name} does not implement .exportJSON().`);if(r.$isElementNode(W)){const le=G.children;if(!Array.isArray(le))throw Error(`LexicalNode: Node ${q.name} is an element but .exportJSON() does not have a children array.`)}return G}function k(W,G,q,le=[]){let se=G!=null?q.isSelected(G):!0;const ge=r.$isElementNode(q)&&q.excludeFromCopy("html");let j=q;if(G!==null){let xe=t.$cloneWithProperties(q);xe=r.$isTextNode(xe)&&G!=null?t.$sliceSelectedTextNodeContent(G,xe):xe,j=xe}const B=r.$isElementNode(j)?j.getChildren():[],V=I(j);if(r.$isTextNode(j)){const xe=j.__text;xe.length>0?V.text=xe:se=!1}for(let xe=0;xe<B.length;xe++){const we=B[xe],Ee=k(W,G,we,V.children);!se&&r.$isElementNode(q)&&Ee&&q.extractWithChild(we,G,"clone")&&(se=!0)}if(se&&!ge)le.push(V);else if(Array.isArray(V.children))for(let xe=0;xe<V.children.length;xe++){const we=V.children[xe];le.push(we)}return se}function U(W,G){const q=[],se=r.$getRoot().getChildren();for(let ge=0;ge<se.length;ge++){const j=se[ge];k(W,G,j,q)}return{namespace:W._config.namespace,nodes:q}}function C(W){const G=[];for(let q=0;q<W.length;q++){const le=W[q],se=r.$parseSerializedNode(le);r.$isTextNode(se)&&t.$addNodeStyle(se),G.push(se)}return G}const w=50;let z=null;async function Q(W,G){if(z!==null)return!1;if(G!==null)return new Promise((B,V)=>{W.update(()=>{B(F(W,G))})});const q=W.getRootElement(),le=W._window==null?window.document:W._window.document,se=d(W._window);if(q===null||se===null)return!1;const ge=le.createElement("span");ge.style.cssText="position: fixed; top: -1000px;",ge.append(le.createTextNode("#")),q.append(ge);const j=new Range;return j.setStart(ge,0),j.setEnd(ge,1),se.removeAllRanges(),se.addRange(j),new Promise((B,V)=>{const xe=W.registerCommand(r.COPY_COMMAND,we=>(n.objectKlassEquals(we,ClipboardEvent)&&(xe(),z!==null&&(window.clearTimeout(z),z=null),B(F(W,we))),!0),r.COMMAND_PRIORITY_CRITICAL);z=window.setTimeout(()=>{xe(),z=null,B(!1)},w),le.execCommand("copy"),ge.remove()})}function F(W,G){const q=d(W._window);if(!q)return!1;const le=q.anchorNode,se=q.focusNode;if(le!==null&&se!==null&&!r.isSelectionWithinEditor(W,le,se))return!1;G.preventDefault();const ge=G.clipboardData,j=r.$getSelection();if(ge===null||j===null)return!1;const B=g(W),V=y(W);let xe="";return j!==null&&(xe=j.getTextContent()),B!==null&&ge.setData("text/html",B),V!==null&&ge.setData("application/x-lexical-editor",V),ge.setData("text/plain",xe),!0}return Si.$generateJSONFromSelectedNodes=U,Si.$generateNodesFromSerializedNodes=C,Si.$getHtmlContent=g,Si.$getLexicalContent=y,Si.$insertDataTransferForPlainText=E,Si.$insertDataTransferForRichText=T,Si.$insertGeneratedNodes=R,Si.copyToClipboard=Q,Si}var vi={},th;function lN(){if(th)return vi;th=1;var e=Yu,t=Cs(),n=Xn(),r=gn();function c(C){let w=new URLSearchParams;w.append("code",C);for(let z=1;z<arguments.length;z++)w.append("v",arguments[z]);throw Error(`Minified Lexical error #${C}; visit https://lexical.dev/docs/error?${w} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function g(C){let w=r.$getSelection();if(w==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(w)&&w.isCollapsed()||w.getNodes().length===0?"":e.$generateHtmlFromNodes(C,w)}function y(C){let w=r.$getSelection();if(w==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(w)&&w.isCollapsed()||w.getNodes().length===0?null:JSON.stringify(R(C,w))}function E(C,w,z){C.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:w,selection:z})||z.insertNodes(w)}function T(C,w,z,Q=[]){let F=w!=null?z.isSelected(w):!0,W=r.$isElementNode(z)&&z.excludeFromCopy("html");var G=z;if(w!==null){var q=t.$cloneWithProperties(z);G=q=r.$isTextNode(q)&&w!=null?t.$sliceSelectedTextNodeContent(w,q):q}let le=r.$isElementNode(G)?G.getChildren():[];var se=G;q=se.exportJSON();var ge=se.constructor;for(q.type!==ge.getType()&&c(58,ge.name),r.$isElementNode(se)&&(Array.isArray(q.children)||c(59,ge.name)),r.$isTextNode(G)&&(G=G.__text,0<G.length?q.text=G:F=!1),G=0;G<le.length;G++)se=le[G],ge=T(C,w,se,q.children),!F&&r.$isElementNode(z)&&ge&&z.extractWithChild(se,w,"clone")&&(F=!0);if(F&&!W)Q.push(q);else if(Array.isArray(q.children))for(C=0;C<q.children.length;C++)Q.push(q.children[C]);return F}function R(C,w){let z=[],Q=r.$getRoot().getChildren();for(let F=0;F<Q.length;F++)T(C,w,Q[F],z);return{namespace:C._config.namespace,nodes:z}}function I(C){let w=[];for(let z=0;z<C.length;z++){let Q=r.$parseSerializedNode(C[z]);r.$isTextNode(Q)&&t.$addNodeStyle(Q),w.push(Q)}return w}let k=null;function U(C,w){var z=d?(C._window||window).getSelection():null;if(!z)return!1;var Q=z.anchorNode;if(z=z.focusNode,Q!==null&&z!==null&&!r.isSelectionWithinEditor(C,Q,z)||(w.preventDefault(),w=w.clipboardData,Q=r.$getSelection(),w===null||Q===null))return!1;z=g(C),C=y(C);let F="";return Q!==null&&(F=Q.getTextContent()),z!==null&&w.setData("text/html",z),C!==null&&w.setData("application/x-lexical-editor",C),w.setData("text/plain",F),!0}return vi.$generateJSONFromSelectedNodes=R,vi.$generateNodesFromSerializedNodes=I,vi.$getHtmlContent=g,vi.$getLexicalContent=y,vi.$insertDataTransferForPlainText=function(C,w){C=C.getData("text/plain")||C.getData("text/uri-list"),C!=null&&w.insertRawText(C)},vi.$insertDataTransferForRichText=function(C,w,z){var Q=C.getData("application/x-lexical-editor");if(Q)try{let W=JSON.parse(Q);if(W.namespace===z._config.namespace&&Array.isArray(W.nodes)){let G=I(W.nodes);return E(z,G,w)}}catch{}if(Q=C.getData("text/html"))try{var F=new DOMParser().parseFromString(Q,"text/html");let W=e.$generateNodesFromDOM(z,F);return E(z,W,w)}catch{}if(C=C.getData("text/plain")||C.getData("text/uri-list"),C!=null)if(r.$isRangeSelection(w))for(C=C.split(/(\r?\n|\t)/),C[C.length-1]===""&&C.pop(),z=0;z<C.length;z++)F=C[z],F===`
|
|
97
|
-
`||F===`\r
|
|
98
|
-
`?w.insertParagraph():F===" "?w.insertNodes([r.$createTabNode()]):w.insertText(F);else w.insertRawText(C)},vi.$insertGeneratedNodes=E,vi.copyToClipboard=async function(C,w){if(k!==null)return!1;if(w!==null)return new Promise(G=>{C.update(()=>{G(U(C,w))})});var z=C.getRootElement();let Q=C._window==null?window.document:C._window.document,F=d?(C._window||window).getSelection():null;if(z===null||F===null)return!1;let W=Q.createElement("span");return W.style.cssText="position: fixed; top: -1000px;",W.append(Q.createTextNode("#")),z.append(W),z=new Range,z.setStart(W,0),z.setEnd(W,1),F.removeAllRanges(),F.addRange(z),new Promise(G=>{let q=C.registerCommand(r.COPY_COMMAND,le=>(n.objectKlassEquals(le,ClipboardEvent)&&(q(),k!==null&&(window.clearTimeout(k),k=null),G(U(C,le))),!0),r.COMMAND_PRIORITY_CRITICAL);k=window.setTimeout(()=>{q(),k=null,G(!1)},50),Q.execCommand("copy"),W.remove()})},vi}var nu,nh;function Lg(){return nh||(nh=1,nu=process.env.NODE_ENV==="development"?oN():lN()),nu}var rh;function aN(){if(rh)return ci;rh=1;var e=Lg(),t=Cs(),n=Xn(),r=gn();function c(we,Ee){if(typeof document.caretRangeFromPoint<"u"){const ue=document.caretRangeFromPoint(we,Ee);return ue===null?null:{node:ue.startContainer,offset:ue.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const ue=document.caretPositionFromPoint(we,Ee);return ue===null?null:{node:ue.offsetNode,offset:ue.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,y=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,E=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,R=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),I=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!R,k=r.createCommand("DRAG_DROP_PASTE_FILE");class U extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new U(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const ue=document.createElement("blockquote");return n.addClassNamesToElement(ue,Ee.theme.quote),ue}updateDOM(Ee,ue){return!1}static importDOM(){return{blockquote:Ee=>({conversion:W,priority:0})}}exportDOM(Ee){const{element:ue}=super.exportDOM(Ee);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const $=this.getFormatType();ue.style.textAlign=$;const x=this.getDirection();x&&(ue.dir=x)}return{element:ue}}static importJSON(Ee){const ue=C();return ue.setFormat(Ee.format),ue.setIndent(Ee.indent),ue.setDirection(Ee.direction),ue}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,ue){const $=r.$createParagraphNode(),x=this.getDirection();return $.setDirection(x),this.insertAfter($,ue),$}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach($=>Ee.append($)),this.replace(Ee),!0}}function C(){return r.$applyNodeReplacement(new U)}function w(we){return we instanceof U}class z extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new z(Ee.__tag,Ee.__key)}constructor(Ee,ue){super(ue),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const ue=this.__tag,$=document.createElement(ue),Y=Ee.theme.heading;if(Y!==void 0){const ie=Y[ue];n.addClassNamesToElement($,ie)}return $}updateDOM(Ee,ue){return!1}static importDOM(){return{h1:Ee=>({conversion:F,priority:0}),h2:Ee=>({conversion:F,priority:0}),h3:Ee=>({conversion:F,priority:0}),h4:Ee=>({conversion:F,priority:0}),h5:Ee=>({conversion:F,priority:0}),h6:Ee=>({conversion:F,priority:0}),p:Ee=>{const $=Ee.firstChild;return $!==null&&Q($)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>Q(Ee)?{conversion:ue=>({node:G("h1")}),priority:3}:null}}exportDOM(Ee){const{element:ue}=super.exportDOM(Ee);if(ue&&n.isHTMLElement(ue)){this.isEmpty()&&ue.append(document.createElement("br"));const $=this.getFormatType();ue.style.textAlign=$;const x=this.getDirection();x&&(ue.dir=x)}return{element:ue}}static importJSON(Ee){const ue=G(Ee.tag);return ue.setFormat(Ee.format),ue.setIndent(Ee.indent),ue.setDirection(Ee.direction),ue}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,ue=!0){const $=Ee?Ee.anchor.offset:0,x=$===this.getTextContentSize()||!Ee?r.$createParagraphNode():G(this.getTag()),Y=this.getDirection();if(x.setDirection(Y),this.insertAfter(x,ue),$===0&&!this.isEmpty()&&Ee){const ie=r.$createParagraphNode();ie.select(),this.replace(ie,!0)}return x}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():G(this.getTag());return this.getChildren().forEach($=>Ee.append($)),this.replace(Ee),!0}extractWithChild(){return!0}}function Q(we){return we.nodeName.toLowerCase()==="span"?we.style.fontSize==="26pt":!1}function F(we){const Ee=we.nodeName.toLowerCase();let ue=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(ue=G(Ee),we.style!==null&&ue.setFormat(we.style.textAlign)),{node:ue}}function W(we){const Ee=C();return we.style!==null&&Ee.setFormat(we.style.textAlign),{node:Ee}}function G(we){return r.$applyNodeReplacement(new z(we))}function q(we){return we instanceof z}function le(we,Ee){we.preventDefault(),Ee.update(()=>{const ue=r.$getSelection(),$=we instanceof InputEvent||we instanceof KeyboardEvent?null:we.clipboardData;$!=null&&r.$INTERNAL_isPointSelection(ue)&&e.$insertDataTransferForRichText($,ue,Ee)},{tag:"paste"})}async function se(we,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(we,ClipboardEvent)?we:null),Ee.update(()=>{const ue=r.$getSelection();r.$isRangeSelection(ue)?ue.removeText():r.$isNodeSelection(ue)&&ue.getNodes().forEach($=>$.remove())})}function ge(we){let Ee=null;if(we instanceof DragEvent?Ee=we.dataTransfer:we instanceof ClipboardEvent&&(Ee=we.clipboardData),Ee===null)return[!1,[],!1];const ue=Ee.types,$=ue.includes("Files"),x=ue.includes("text/html")||ue.includes("text/plain");return[$,Array.from(Ee.files),x]}function j(we){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const ue=new Set,$=Ee.getNodes();for(let x=0;x<$.length;x++){const Y=$[x],ie=Y.getKey();if(ue.has(ie))continue;const K=n.$getNearestBlockElementAncestorOrThrow(Y),P=K.getKey();K.canIndent()&&!ue.has(P)&&(ue.add(P),we(K))}return ue.size>0}function B(we){const Ee=r.$getNearestNodeFromDOMNode(we);return r.$isDecoratorNode(Ee)}function V(we){const Ee=we.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function xe(we){return n.mergeRegister(we.registerCommand(r.CLICK_COMMAND,ue=>{const $=r.$getSelection();return r.$isNodeSelection($)?($.clear(),!0):!1},0),we.registerCommand(r.DELETE_CHARACTER_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteCharacter(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DELETE_WORD_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteWord(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DELETE_LINE_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.deleteLine(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,ue=>{const $=r.$getSelection();if(typeof ue=="string")r.$INTERNAL_isPointSelection($)&&$.insertText(ue);else{if(!r.$INTERNAL_isPointSelection($))return!1;const x=ue.dataTransfer;if(x!=null)e.$insertDataTransferForRichText(x,$,we);else if(r.$isRangeSelection($)){const Y=ue.data;return Y&&$.insertText(Y),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.FORMAT_TEXT_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.formatText(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.FORMAT_ELEMENT_COMMAND,ue=>{const $=r.$getSelection();if(!r.$isRangeSelection($)&&!r.$isNodeSelection($))return!1;const x=$.getNodes();for(const Y of x){const ie=n.$findMatchingParent(Y,K=>r.$isElementNode(K)&&!K.isInline());ie!==null&&ie.setFormat(ue)}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_LINE_BREAK_COMMAND,ue=>{const $=r.$getSelection();return r.$isRangeSelection($)?($.insertLineBreak(ue),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(ue.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.INDENT_CONTENT_COMMAND,()=>j(ue=>{const $=ue.getIndent();ue.setIndent($+1)}),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>j(ue=>{const $=ue.getIndent();$>0&&ue.setIndent($-1)}),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_UP_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)&&!B(ue.target)){const x=$.getNodes();if(x.length>0)return x[0].selectPrevious(),!0}else if(r.$isRangeSelection($)){const x=r.$getAdjacentNode($.focus,!0);if(!ue.shiftKey&&r.$isDecoratorNode(x)&&!x.isIsolated()&&!x.isInline())return x.selectPrevious(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_DOWN_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)){const x=$.getNodes();if(x.length>0)return x[0].selectNext(0,0),!0}else if(r.$isRangeSelection($)){if(V($))return ue.preventDefault(),!0;const x=r.$getAdjacentNode($.focus,!1);if(!ue.shiftKey&&r.$isDecoratorNode(x)&&!x.isIsolated()&&!x.isInline())return x.selectNext(),ue.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_LEFT_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)){const x=$.getNodes();if(x.length>0)return ue.preventDefault(),x[0].selectPrevious(),!0}if(!r.$isRangeSelection($))return!1;if(t.$shouldOverrideDefaultCharacterSelection($,!0)){const x=ue.shiftKey;return ue.preventDefault(),t.$moveCharacter($,x,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,ue=>{const $=r.$getSelection();if(r.$isNodeSelection($)&&!B(ue.target)){const Y=$.getNodes();if(Y.length>0)return ue.preventDefault(),Y[0].selectNext(0,0),!0}if(!r.$isRangeSelection($))return!1;const x=ue.shiftKey;return t.$shouldOverrideDefaultCharacterSelection($,!1)?(ue.preventDefault(),t.$moveCharacter($,x,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_BACKSPACE_COMMAND,ue=>{if(B(ue.target))return!1;const $=r.$getSelection();if(!r.$isRangeSelection($))return!1;ue.preventDefault();const{anchor:x}=$,Y=x.getNode();return $.isCollapsed()&&x.offset===0&&!r.$isRootNode(Y)&&n.$getNearestBlockElementAncestorOrThrow(Y).getIndent()>0?we.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):we.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_DELETE_COMMAND,ue=>{if(B(ue.target))return!1;const $=r.$getSelection();return r.$isRangeSelection($)?(ue.preventDefault(),we.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ENTER_COMMAND,ue=>{const $=r.$getSelection();if(!r.$isRangeSelection($))return!1;if(ue!==null){if((T||E||I)&&y)return!1;if(ue.preventDefault(),ue.shiftKey)return we.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return we.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const ue=r.$getSelection();return r.$isRangeSelection(ue)?(we.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DROP_COMMAND,ue=>{const[,$]=ge(ue);if($.length>0){const Y=ue.clientX,ie=ue.clientY,K=c(Y,ie);if(K!==null){const{offset:P,node:Z}=K,O=r.$getNearestNodeFromDOMNode(Z);if(O!==null){const H=r.$createRangeSelection();if(r.$isTextNode(O))H.anchor.set(O.getKey(),P,"text"),H.focus.set(O.getKey(),P,"text");else{const de=O.getParentOrThrow().getKey(),_e=O.getIndexWithinParent()+1;H.anchor.set(de,_e,"element"),H.focus.set(de,_e,"element")}const J=r.$normalizeSelection__EXPERIMENTAL(H);r.$setSelection(J)}we.dispatchCommand(k,$)}return ue.preventDefault(),!0}const x=r.$getSelection();return!!r.$isRangeSelection(x)},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DRAGSTART_COMMAND,ue=>{const[$]=ge(ue),x=r.$getSelection();return!($&&!r.$isRangeSelection(x))},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.DRAGOVER_COMMAND,ue=>{const[$]=ge(ue),x=r.$getSelection();if($&&!r.$isRangeSelection(x))return!1;const Y=ue.clientX,ie=ue.clientY,K=c(Y,ie);if(K!==null){const P=r.$getNearestNodeFromDOMNode(K.node);r.$isDecoratorNode(P)&&ue.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.COPY_COMMAND,ue=>(e.copyToClipboard(we,n.objectKlassEquals(ue,ClipboardEvent)?ue:null),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.CUT_COMMAND,ue=>(se(ue,we),!0),r.COMMAND_PRIORITY_EDITOR),we.registerCommand(r.PASTE_COMMAND,ue=>{const[,$,x]=ge(ue);if($.length>0&&!x)return we.dispatchCommand(k,$),!0;if(r.isSelectionCapturedInDecoratorInput(ue.target))return!1;const Y=r.$getSelection();return r.$INTERNAL_isPointSelection(Y)?(le(ue,we),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return ci.$createHeadingNode=G,ci.$createQuoteNode=C,ci.$isHeadingNode=q,ci.$isQuoteNode=w,ci.DRAG_DROP_PASTE=k,ci.HeadingNode=z,ci.QuoteNode=U,ci.eventFiles=ge,ci.registerRichText=xe,ci}var ui={},ih;function cN(){if(ih)return ui;ih=1;var e=Lg(),t=Cs(),n=Xn(),r=gn();function c(j,B){return typeof document.caretRangeFromPoint<"u"?(j=document.caretRangeFromPoint(j,B),j===null?null:{node:j.startContainer,offset:j.startOffset}):document.caretPositionFromPoint!=="undefined"?(j=document.caretPositionFromPoint(j,B),j===null?null:{node:j.offsetNode,offset:j.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=d&&"documentMode"in document?document.documentMode:null,y=d&&"InputEvent"in window&&!g?"getTargetRanges"in new window.InputEvent("input"):!1,E=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,R=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),I=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!R,k=r.createCommand("DRAG_DROP_PASTE_FILE");class U extends r.ElementNode{static getType(){return"quote"}static clone(B){return new U(B.__key)}constructor(B){super(B)}createDOM(B){let V=document.createElement("blockquote");return n.addClassNamesToElement(V,B.theme.quote),V}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:F,priority:0})}}exportDOM(B){if({element:B}=super.exportDOM(B),B&&n.isHTMLElement(B)){this.isEmpty()&&B.append(document.createElement("br"));var V=this.getFormatType();B.style.textAlign=V,(V=this.getDirection())&&(B.dir=V)}return{element:B}}static importJSON(B){let V=C();return V.setFormat(B.format),V.setIndent(B.indent),V.setDirection(B.direction),V}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(B,V){B=r.$createParagraphNode();let xe=this.getDirection();return B.setDirection(xe),this.insertAfter(B,V),B}collapseAtStart(){let B=r.$createParagraphNode();return this.getChildren().forEach(V=>B.append(V)),this.replace(B),!0}}function C(){return r.$applyNodeReplacement(new U)}class w extends r.ElementNode{static getType(){return"heading"}static clone(B){return new w(B.__tag,B.__key)}constructor(B,V){super(V),this.__tag=B}getTag(){return this.__tag}createDOM(B){let V=this.__tag,xe=document.createElement(V);return B=B.theme.heading,B!==void 0&&n.addClassNamesToElement(xe,B[V]),xe}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:Q,priority:0}),h2:()=>({conversion:Q,priority:0}),h3:()=>({conversion:Q,priority:0}),h4:()=>({conversion:Q,priority:0}),h5:()=>({conversion:Q,priority:0}),h6:()=>({conversion:Q,priority:0}),p:B=>(B=B.firstChild,B!==null&&z(B)?{conversion:()=>({node:null}),priority:3}:null),span:B=>z(B)?{conversion:()=>({node:W("h1")}),priority:3}:null}}exportDOM(B){if({element:B}=super.exportDOM(B),B&&n.isHTMLElement(B)){this.isEmpty()&&B.append(document.createElement("br"));var V=this.getFormatType();B.style.textAlign=V,(V=this.getDirection())&&(B.dir=V)}return{element:B}}static importJSON(B){let V=W(B.tag);return V.setFormat(B.format),V.setIndent(B.indent),V.setDirection(B.direction),V}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(B,V=!0){let xe=B?B.anchor.offset:0,we=xe!==this.getTextContentSize()&&B?W(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return we.setDirection(Ee),this.insertAfter(we,V),xe===0&&!this.isEmpty()&&B&&(B=r.$createParagraphNode(),B.select(),this.replace(B,!0)),we}collapseAtStart(){let B=this.isEmpty()?r.$createParagraphNode():W(this.getTag());return this.getChildren().forEach(V=>B.append(V)),this.replace(B),!0}extractWithChild(){return!0}}function z(j){return j.nodeName.toLowerCase()==="span"?j.style.fontSize==="26pt":!1}function Q(j){let B=j.nodeName.toLowerCase(),V=null;return(B==="h1"||B==="h2"||B==="h3"||B==="h4"||B==="h5"||B==="h6")&&(V=W(B),j.style!==null&&V.setFormat(j.style.textAlign)),{node:V}}function F(j){let B=C();return j.style!==null&&B.setFormat(j.style.textAlign),{node:B}}function W(j){return r.$applyNodeReplacement(new w(j))}function G(j,B){j.preventDefault(),B.update(()=>{let V=r.$getSelection(),xe=j instanceof InputEvent||j instanceof KeyboardEvent?null:j.clipboardData;xe!=null&&r.$INTERNAL_isPointSelection(V)&&e.$insertDataTransferForRichText(xe,V,B)},{tag:"paste"})}async function q(j,B){await e.copyToClipboard(B,n.objectKlassEquals(j,ClipboardEvent)?j:null),B.update(()=>{let V=r.$getSelection();r.$isRangeSelection(V)?V.removeText():r.$isNodeSelection(V)&&V.getNodes().forEach(xe=>xe.remove())})}function le(j){let B=null;if(j instanceof DragEvent?B=j.dataTransfer:j instanceof ClipboardEvent&&(B=j.clipboardData),B===null)return[!1,[],!1];var V=B.types;return j=V.includes("Files"),V=V.includes("text/html")||V.includes("text/plain"),[j,Array.from(B.files),V]}function se(j){var B=r.$getSelection();if(!r.$isRangeSelection(B))return!1;let V=new Set;B=B.getNodes();for(let Ee=0;Ee<B.length;Ee++){var xe=B[Ee],we=xe.getKey();V.has(we)||(xe=n.$getNearestBlockElementAncestorOrThrow(xe),we=xe.getKey(),xe.canIndent()&&!V.has(we)&&(V.add(we),j(xe)))}return 0<V.size}function ge(j){return j=r.$getNearestNodeFromDOMNode(j),r.$isDecoratorNode(j)}return ui.$createHeadingNode=W,ui.$createQuoteNode=C,ui.$isHeadingNode=function(j){return j instanceof w},ui.$isQuoteNode=function(j){return j instanceof U},ui.DRAG_DROP_PASTE=k,ui.HeadingNode=w,ui.QuoteNode=U,ui.eventFiles=le,ui.registerRichText=function(j){return n.mergeRegister(j.registerCommand(r.CLICK_COMMAND,()=>{const B=r.$getSelection();return r.$isNodeSelection(B)?(B.clear(),!0):!1},0),j.registerCommand(r.DELETE_CHARACTER_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteCharacter(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_WORD_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteWord(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DELETE_LINE_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.deleteLine(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,B=>{const V=r.$getSelection();if(typeof B=="string")r.$INTERNAL_isPointSelection(V)&&V.insertText(B);else{if(!r.$INTERNAL_isPointSelection(V))return!1;const xe=B.dataTransfer;xe!=null?e.$insertDataTransferForRichText(xe,V,j):r.$isRangeSelection(V)&&(B=B.data)&&V.insertText(B)}return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(B.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_TEXT_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.formatText(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.FORMAT_ELEMENT_COMMAND,B=>{var V=r.$getSelection();if(!r.$isRangeSelection(V)&&!r.$isNodeSelection(V))return!1;V=V.getNodes();for(const xe of V)V=n.$findMatchingParent(xe,we=>r.$isElementNode(we)&&!we.isInline()),V!==null&&V.setFormat(B);return!0},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_LINE_BREAK_COMMAND,B=>{const V=r.$getSelection();return r.$isRangeSelection(V)?(V.insertLineBreak(B),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(B.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.INDENT_CONTENT_COMMAND,()=>se(B=>{const V=B.getIndent();B.setIndent(V+1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>se(B=>{const V=B.getIndent();0<V&&B.setIndent(V-1)}),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_UP_COMMAND,B=>{var V=r.$getSelection();if(r.$isNodeSelection(V)&&!ge(B.target)){if(B=V.getNodes(),0<B.length)return B[0].selectPrevious(),!0}else if(r.$isRangeSelection(V)&&(V=r.$getAdjacentNode(V.focus,!0),!B.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline()))return V.selectPrevious(),B.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_DOWN_COMMAND,B=>{var V=r.$getSelection();if(r.$isNodeSelection(V)){if(B=V.getNodes(),0<B.length)return B[0].selectNext(0,0),!0}else if(r.$isRangeSelection(V)){let xe=V.focus;if(xe.key==="root"&&xe.offset===r.$getRoot().getChildrenSize())return B.preventDefault(),!0;if(V=r.$getAdjacentNode(V.focus,!1),!B.shiftKey&&r.$isDecoratorNode(V)&&!V.isIsolated()&&!V.isInline())return V.selectNext(),B.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_LEFT_COMMAND,B=>{const V=r.$getSelection();if(r.$isNodeSelection(V)){var xe=V.getNodes();if(0<xe.length)return B.preventDefault(),xe[0].selectPrevious(),!0}return r.$isRangeSelection(V)&&t.$shouldOverrideDefaultCharacterSelection(V,!0)?(xe=B.shiftKey,B.preventDefault(),t.$moveCharacter(V,xe,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,B=>{const V=r.$getSelection();if(r.$isNodeSelection(V)&&!ge(B.target)){var xe=V.getNodes();if(0<xe.length)return B.preventDefault(),xe[0].selectNext(0,0),!0}return r.$isRangeSelection(V)?(xe=B.shiftKey,t.$shouldOverrideDefaultCharacterSelection(V,!1)?(B.preventDefault(),t.$moveCharacter(V,xe,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_BACKSPACE_COMMAND,B=>{if(ge(B.target))return!1;const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;B.preventDefault(),{anchor:B}=V;const xe=B.getNode();return V.isCollapsed()&&B.offset===0&&!r.$isRootNode(xe)&&0<n.$getNearestBlockElementAncestorOrThrow(xe).getIndent()?j.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_DELETE_COMMAND,B=>{if(ge(B.target))return!1;const V=r.$getSelection();return r.$isRangeSelection(V)?(B.preventDefault(),j.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ENTER_COMMAND,B=>{const V=r.$getSelection();if(!r.$isRangeSelection(V))return!1;if(B!==null){if((T||E||I)&&y)return!1;if(B.preventDefault(),B.shiftKey)return j.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return j.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const B=r.$getSelection();return r.$isRangeSelection(B)?(j.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DROP_COMMAND,B=>{const[,V]=le(B);if(0<V.length){var xe=c(B.clientX,B.clientY);if(xe!==null){const{offset:Ee,node:ue}=xe;var we=r.$getNearestNodeFromDOMNode(ue);if(we!==null){if(xe=r.$createRangeSelection(),r.$isTextNode(we))xe.anchor.set(we.getKey(),Ee,"text"),xe.focus.set(we.getKey(),Ee,"text");else{const $=we.getParentOrThrow().getKey();we=we.getIndexWithinParent()+1,xe.anchor.set($,we,"element"),xe.focus.set($,we,"element")}xe=r.$normalizeSelection__EXPERIMENTAL(xe),r.$setSelection(xe)}j.dispatchCommand(k,V)}return B.preventDefault(),!0}return B=r.$getSelection(),!!r.$isRangeSelection(B)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGSTART_COMMAND,B=>{[B]=le(B);const V=r.$getSelection();return!(B&&!r.$isRangeSelection(V))},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.DRAGOVER_COMMAND,B=>{var[V]=le(B);const xe=r.$getSelection();return V&&!r.$isRangeSelection(xe)?!1:(V=c(B.clientX,B.clientY),V!==null&&(V=r.$getNearestNodeFromDOMNode(V.node),r.$isDecoratorNode(V)&&B.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.COPY_COMMAND,B=>(e.copyToClipboard(j,n.objectKlassEquals(B,ClipboardEvent)?B:null),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.CUT_COMMAND,B=>(q(B,j),!0),r.COMMAND_PRIORITY_EDITOR),j.registerCommand(r.PASTE_COMMAND,B=>{const[,V,xe]=le(B);if(0<V.length&&!xe)return j.dispatchCommand(k,V),!0;if(r.isSelectionCapturedInDecoratorInput(B.target))return!1;const we=r.$getSelection();return r.$INTERNAL_isPointSelection(we)?(G(B,j),!0):!1},r.COMMAND_PRIORITY_EDITOR))},ui}const uN=process.env.NODE_ENV==="development"?aN():cN();var sh=uN,Gl={},oh;function dN(){if(oh)return Gl;oh=1;var e=Xn(),t=gn();class n extends t.TextNode{static getType(){return"hashtag"}static clone(g){return new n(g.__text,g.__key)}constructor(g,y){super(g,y)}createDOM(g){const y=super.createDOM(g);return e.addClassNamesToElement(y,g.theme.hashtag),y}static importJSON(g){const y=r(g.text);return y.setFormat(g.format),y.setDetail(g.detail),y.setMode(g.mode),y.setStyle(g.style),y}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function c(d){return d instanceof n}return Gl.$createHashtagNode=r,Gl.$isHashtagNode=c,Gl.HashtagNode=n,Gl}var Yl={},lh;function fN(){if(lh)return Yl;lh=1;var e=Xn(),t=gn();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,g){super(d,g)}createDOM(d){let g=super.createDOM(d);return e.addClassNamesToElement(g,d.theme.hashtag),g}static importJSON(d){let g=r(d.text);return g.setFormat(d.format),g.setDetail(d.detail),g.setMode(d.mode),g.setStyle(d.style),g}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(c=""){return t.$applyNodeReplacement(new n(c))}return Yl.$createHashtagNode=r,Yl.$isHashtagNode=function(c){return c instanceof n},Yl.HashtagNode=n,Yl}const hN=process.env.NODE_ENV==="development"?dN():fN();var gN=hN;const 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__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","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","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"},pN={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 ju=gn();function mN({src:e,altText:t,width:n,height:r,maxWidth:c}){const d=yt.useMemo(()=>({height:r,width:n,maxWidth:c}),[r,n,c]);return nt.jsx("img",{src:e,alt:t,style:d})}function _N({altText:e,height:t,maxWidth:n=500,src:r,width:c,key:d}){return ju.$applyNodeReplacement(new _c(r,e,n,c,t,d))}class _c extends ju.DecoratorNode{constructor(n,r,c,d,g,y){super(y);Ie(this,"__src");Ie(this,"__altText");Ie(this,"__width");Ie(this,"__height");Ie(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=c,this.__width=d||"inherit",this.__height=g||"inherit"}static getType(){return"image"}static clone(n){return new _c(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 _N(n)}createDOM(n){const r=document.createElement("span"),c=n.theme.image;return c&&(r.className=c),r}exportDOM(n){const r=document.createElement("span"),c=n._config.theme.image;c&&(r.className=c);const d=document.createElement("img");return d.src=this.__src,this.__altText&&(d.alt=this.__altText),this.__width!=="inherit"&&this.__width&&(d.width=Number(this.__width)),this.__height!=="inherit"&&this.__height&&(d.height=Number(this.__height)),this.__maxWidth&&(d.style.maxWidth=`${this.__maxWidth}px`),d.loading="lazy",d.decoding="async",r.appendChild(d),{element:r}}updateDOM(){return!1}decorate(){return nt.jsx(mN,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}var Bo={},ru={},ah;function yN(){if(ah)return ru;ah=1;var e=so,t=gn(),n=yt;function r(d,g){return d.getEditorState().read(()=>{const y=t.$getNodeByKey(g);return y===null?!1:y.isSelected()})}function c(d){const[g]=e.useLexicalComposerContext(),[y,E]=n.useState(()=>r(g,d));n.useEffect(()=>{let I=!0;const k=g.registerUpdateListener(()=>{I&&E(r(g,d))});return()=>{I=!1,k()}},[g,d]);const T=n.useCallback(I=>{g.update(()=>{let k=t.$getSelection();t.$isNodeSelection(k)||(k=t.$createNodeSelection(),t.$setSelection(k)),t.$isNodeSelection(k)&&(I?k.add(d):k.delete(d))})},[g,d]),R=n.useCallback(()=>{g.update(()=>{const I=t.$getSelection();t.$isNodeSelection(I)&&I.clear()})},[g]);return[y,T,R]}return ru.useLexicalNodeSelection=c,ru}var iu={},ch;function NN(){if(ch)return iu;ch=1;var e=so,t=gn(),n=yt;function r(c,d){return c.getEditorState().read(()=>{let g=t.$getNodeByKey(d);return g===null?!1:g.isSelected()})}return iu.useLexicalNodeSelection=function(c){let[d]=e.useLexicalComposerContext(),[g,y]=n.useState(()=>r(d,c));n.useEffect(()=>{let R=!0,I=d.registerUpdateListener(()=>{R&&y(r(d,c))});return()=>{R=!1,I()}},[d,c]);let E=n.useCallback(R=>{d.update(()=>{let I=t.$getSelection();t.$isNodeSelection(I)||(I=t.$createNodeSelection(),t.$setSelection(I)),t.$isNodeSelection(I)&&(R?I.add(c):I.delete(c))})},[d,c]),T=n.useCallback(()=>{d.update(()=>{const R=t.$getSelection();t.$isNodeSelection(R)&&R.clear()})},[d]);return[g,E,T]},iu}var su,uh;function Pg(){return uh||(uh=1,su=process.env.NODE_ENV==="development"?yN():NN()),su}var dh;function CN(){if(dh)return Bo;dh=1;var e=so,t=Pg(),n=Xn(),r=gn(),c=yt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:I}){const[k]=e.useLexicalComposerContext(),[U,C,w]=t.useLexicalNodeSelection(I),z=c.useCallback(Q=>{if(U&&r.$isNodeSelection(r.$getSelection())){Q.preventDefault();const F=r.$getNodeByKey(I);R(F)&&F.remove()}return!1},[U,I]);return c.useEffect(()=>n.mergeRegister(k.registerCommand(r.CLICK_COMMAND,Q=>{const F=k.getElementByKey(I);return Q.target===F?(Q.shiftKey||w(),C(!U),!0):!1},r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_DELETE_COMMAND,z,r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_BACKSPACE_COMMAND,z,r.COMMAND_PRIORITY_LOW)),[w,k,U,I,z,C]),c.useEffect(()=>{const Q=k.getElementByKey(I);Q!==null&&(Q.className=U?"selected":"")},[k,U,I]),null}class y extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(k){return new y(k.__key)}static importJSON(k){return T()}static importDOM(){return{hr:()=>({conversion:E,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 c.createElement(g,{nodeKey:this.__key})}}function E(){return{node:T()}}function T(){return r.$applyNodeReplacement(new y)}function R(I){return I instanceof y}return Bo.$createHorizontalRuleNode=T,Bo.$isHorizontalRuleNode=R,Bo.HorizontalRuleNode=y,Bo.INSERT_HORIZONTAL_RULE_COMMAND=d,Bo}var Ho={},fh;function EN(){if(fh)return Ho;fh=1;var e=so,t=Pg(),n=Xn(),r=gn(),c=yt;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function g({nodeKey:I}){let[k]=e.useLexicalComposerContext(),[U,C,w]=t.useLexicalNodeSelection(I),z=c.useCallback(Q=>(U&&r.$isNodeSelection(r.$getSelection())&&(Q.preventDefault(),Q=r.$getNodeByKey(I),R(Q)&&Q.remove()),!1),[U,I]);return c.useEffect(()=>n.mergeRegister(k.registerCommand(r.CLICK_COMMAND,Q=>{let F=k.getElementByKey(I);return Q.target===F?(Q.shiftKey||w(),C(!U),!0):!1},r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_DELETE_COMMAND,z,r.COMMAND_PRIORITY_LOW),k.registerCommand(r.KEY_BACKSPACE_COMMAND,z,r.COMMAND_PRIORITY_LOW)),[w,k,U,I,z,C]),c.useEffect(()=>{let Q=k.getElementByKey(I);Q!==null&&(Q.className=U?"selected":"")},[k,U,I]),null}class y extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(k){return new y(k.__key)}static importJSON(){return T()}static importDOM(){return{hr:()=>({conversion:E,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 c.createElement(g,{nodeKey:this.__key})}}function E(){return{node:T()}}function T(){return r.$applyNodeReplacement(new y)}function R(I){return I instanceof y}return Ho.$createHorizontalRuleNode=T,Ho.$isHorizontalRuleNode=R,Ho.HorizontalRuleNode=y,Ho.INSERT_HORIZONTAL_RULE_COMMAND=d,Ho}const TN=process.env.NODE_ENV==="development"?CN():EN();var xN=TN;class lc extends Tu.TableCellNode{static getType(){return"tablecell"}static clone(t){const n=new lc(t.__headerState,t.__colSpan,t.__width,t.__key);return n.__rowSpan=t.__rowSpan,n.__backgroundColor=t.__backgroundColor,n}static importJSON(t){const n=t.colSpan||1,r=t.rowSpan||1,c=ju.$applyNodeReplacement(new lc(t.headerState,n,t.width||void 0));return c.__rowSpan=r,c.__backgroundColor=t.backgroundColor||null,c}exportJSON(){return super.exportJSON()}exportDOM(t){const n=super.exportDOM(t);if(n.element){const r=n.element;return r.removeAttribute("style"),r.style.width=this.getWidth()?`${this.getWidth()}px`:"",{...n,element:r}}return n}}function SN(e,t){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:e,theme:t??pN,nodes:[sh.HeadingNode,gN.HashtagNode,_c,mf.ListNode,mf.ListItemNode,sh.QuoteNode,Vf.CodeNode,Vf.CodeHighlightNode,Tu.TableNode,lc,Tu.TableRowNode,Jf.AutoLinkNode,Jf.LinkNode,xN.HorizontalRuleNode]}}const ou={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function vN({serializedAST:e,nodeClassNames:t}){const[n,r]=yt.useState("");return nt.jsx(nt.Fragment,{children:nt.jsxs(Hy.LexicalComposer,{initialConfig:SN(e,t),children:[nt.jsx(wN,{onHTML:r}),nt.jsx("div",{className:`${ou["editor-inner"]} ${ou["no-border"]}`,children:nt.jsx("div",{className:ou["editor-inner"],children:nt.jsx("div",{dangerouslySetInnerHTML:{__html:n}})})})]})})}function wN({onHTML:e}){const[t]=so.useLexicalComposerContext();return yt.useEffect(()=>{t.update(()=>{const n=Yu.$generateHtmlFromNodes(t);e(n)})},[t,e]),null}function yc(e,t,n,r){const c=e.length;let d=0,g;if(t<0?t=-t>c?0:c+t:t=t>c?c:t,n=n>0?n:0,r.length<1e4)g=Array.from(r),g.unshift(t,n),[].splice.apply(e,g);else for(n&&[].splice.apply(e,[t,n]);d<r.length;)g=r.slice(d,d+1e4),g.unshift(t,0),[].splice.apply(e,g),d+=1e4,t+=1e4}function Uo(e,t){return e.length>0?(yc(e,e.length,0,t),e):t}const hh={}.hasOwnProperty;function $g(e){const t={};let n=-1;for(;++n<e.length;)ON(t,e[n]);return t}function ON(e,t){let n;for(n in t){const c=(hh.call(e,n)?e[n]:void 0)||(e[n]={}),d=t[n];let g;for(g in d){hh.call(c,g)||(c[g]=[]);const y=d[g];AN(c[g],Array.isArray(y)?y:y?[y]:[])}}}function AN(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 Zi={plusSign:43,caret:94,tilde:126};var gh=Object.prototype.hasOwnProperty;function ph(e,t,n){for(n of e.keys())if(ea(n,t))return n}function ea(e,t){var n,r,c;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--&&ea(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(c=r,c&&typeof c=="object"&&(c=ph(t,c),!c)||!t.has(c))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(c=r[0],c&&typeof c=="object"&&(c=ph(t,c),!c)||!ea(r[1],t.get(c)))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(gh.call(e,n)&&++r&&!gh.call(t,n)||!(n in t)||!ea(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}let xu,Fg,Bg,Hg,Wg=!0;typeof process<"u"&&({FORCE_COLOR:xu,NODE_DISABLE_COLORS:Fg,NO_COLOR:Bg,TERM:Hg}=process.env||{},Wg=process.stdout&&process.stdout.isTTY);const Xt={enabled:!Fg&&Bg==null&&Hg!=="dumb"&&(xu!=null&&xu!=="0"||Wg),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 mh(e,t){let n=0,r,c="",d="";for(;n<e.length;n++)r=e[n],c+=r.open,d+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return c+t+d}function DN(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?mh(this.keys,r+""):r+""):r===void 0?DN([e],[n]):Xt.enabled?mh([n],r+""):r+""}}function Es(){}Es.prototype={diff:function(t,n){var r,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=c.callback;typeof c=="function"&&(d=c,c={}),this.options=c;var g=this;function y(G){return d?(setTimeout(function(){d(void 0,G)},0),!0):G}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var E=n.length,T=t.length,R=1,I=E+T;c.maxEditLength&&(I=Math.min(I,c.maxEditLength));var k=(r=c.timeout)!==null&&r!==void 0?r:1/0,U=Date.now()+k,C=[{oldPos:-1,lastComponent:void 0}],w=this.extractCommon(C[0],n,t,0);if(C[0].oldPos+1>=T&&w+1>=E)return y([{value:this.join(n),count:n.length}]);var z=-1/0,Q=1/0;function F(){for(var G=Math.max(z,-R);G<=Math.min(Q,R);G+=2){var q=void 0,le=C[G-1],se=C[G+1];le&&(C[G-1]=void 0);var ge=!1;if(se){var j=se.oldPos-G;ge=se&&0<=j&&j<E}var B=le&&le.oldPos+1<T;if(!ge&&!B){C[G]=void 0;continue}if(!B||ge&&le.oldPos+1<se.oldPos?q=g.addToPath(se,!0,void 0,0):q=g.addToPath(le,void 0,!0,1),w=g.extractCommon(q,n,t,G),q.oldPos+1>=T&&w+1>=E)return y(MN(g,q.lastComponent,n,t,g.useLongestToken));C[G]=q,q.oldPos+1>=T&&(Q=Math.min(Q,G-1)),w+1>=E&&(z=Math.max(z,G+1))}R++}if(d)(function G(){setTimeout(function(){if(R>I||Date.now()>U)return d();F()||G()},0)})();else for(;R<=I&&Date.now()<=U;){var W=F();if(W)return W}},addToPath:function(t,n,r,c){var d=t.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:t.oldPos+c,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:t.oldPos+c,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(t,n,r,c){for(var d=n.length,g=r.length,y=t.oldPos,E=y-c,T=0;E+1<d&&y+1<g&&this.equals(n[E+1],r[y+1]);)E++,y++,T++;return T&&(t.lastComponent={count:T,previousComponent:t.lastComponent}),t.oldPos=y,E},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 MN(e,t,n,r,c){for(var d=[],g;t;)d.push(t),g=t.previousComponent,delete t.previousComponent,t=g;d.reverse();for(var y=0,E=d.length,T=0,R=0;y<E;y++){var I=d[y];if(I.removed){if(I.value=e.join(r.slice(R,R+I.count)),R+=I.count,y&&d[y-1].added){var U=d[y-1];d[y-1]=d[y],d[y]=U}}else{if(!I.added&&c){var k=n.slice(T,T+I.count);k=k.map(function(w,z){var Q=r[R+z];return Q.length>w.length?Q:w}),I.value=e.join(k)}else I.value=e.join(n.slice(T,T+I.count));T+=I.count,I.added||(R+=I.count)}}var C=d[E-1];return E>1&&typeof C.value=="string"&&(C.added||C.removed)&&e.equals("",C.value)&&(d[E-2].value+=C.value,d.pop()),d}var _h=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,yh=/\S/,Kg=new Es;Kg.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!yh.test(e)&&!yh.test(t)};Kg.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]&&_h.test(t[n])&&_h.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var zg=new Es;zg.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 c=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=c:(this.options.ignoreWhitespace&&(c=c.trim()),t.push(c))}return t};var RN=new Es;RN.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var bN=new Es;bN.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ec(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ec=function(t){return typeof t}:ec=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ec(e)}var IN=Object.prototype.toString,na=new Es;na.useLongestToken=!0;na.tokenize=zg.tokenize;na.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,c=r===void 0?function(d,g){return typeof g>"u"?n:g}:r;return typeof e=="string"?e:JSON.stringify(Su(e,null,null,c),c," ")};na.equals=function(e,t){return Es.prototype.equals.call(na,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Su(e,t,n,r,c){t=t||[],n=n||[],r&&(e=r(c,e));var d;for(d=0;d<t.length;d+=1)if(t[d]===e)return n[d];var g;if(IN.call(e)==="[object Array]"){for(t.push(e),g=new Array(e.length),n.push(g),d=0;d<e.length;d+=1)g[d]=Su(e[d],t,n,r,c);return t.pop(),n.pop(),g}if(e&&e.toJSON&&(e=e.toJSON()),ec(e)==="object"&&e!==null){t.push(e),g={},n.push(g);var y=[],E;for(E in e)e.hasOwnProperty(E)&&y.push(E);for(y.sort(),d=0;d<y.length;d+=1)E=y[d],g[E]=Su(e[E],t,n,r,E);t.pop(),n.pop()}else g=e;return g}var vu=new Es;vu.tokenize=function(e){return e.slice()};vu.join=vu.removeEmpty=function(e){return e};Xt.red,Xt.grey,Xt.green;Xt.dim().italic;Xt.dim("→");Xt.dim("·");Xt.dim("↵");function ac(e){e=e.replace(/\r?\n/g,`
|
|
102
|
-
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,c=(t||[]).length;for(;n<c;n++)r=Math.min(r,t[n].length);return c&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class kN 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 ei(e,t,n,r,c,d,g){if(e)return;let y=g||d;if(g instanceof Error)throw g;let E=c;throw new kN({actual:t,expects:n,operator:r,message:y,details:E,generated:!g})}function Nc(e,t){ei(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}function Ji(e,t){ei(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}Ji.ok=Ji;Ji.equal=function(e,t,n){ei(!ea(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};Ji.type=function(e,t,n){let r=typeof e;ei(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};Ji.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";ei(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};Ji.snapshot=function(e,t,n){e=ac(e),t=ac(t),ei(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};Ji.fixture=function(e,t,n){e=ac(e),t=ac(t),ei(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};Ji.match=function(e,t,n){typeof t=="string"?ei(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):ei(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};Ji.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?ei(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?ei(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||ei(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const LN=/[!-\/:-@\[-`\{-~\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]/,PN=Ts(/[A-Za-z]/),wu=Ts(/[\dA-Za-z]/),$N=Ts(/[#-'*+\--9=?A-Z^-~]/);function FN(e){return e!==null&&(e<32||e===127)}const BN=Ts(/\d/),HN=Ts(/[\dA-Fa-f]/),WN=Ts(/[!-/:-@[-`{-~]/);function KN(e){return e!==null&&e<-2}function Ug(e){return e!==null&&(e<0||e===32)}function zN(e){return e===-2||e===-1||e===32}const UN=Ts(LN),GN=Ts(/\s/);function Ts(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function ra(e){if(e===null||Ug(e)||GN(e))return 1;if(UN(e))return 2}const cc={characterGroupPunctuation:2};function YN(e,t){const n=this.previous,r=ra(n);return c;function c(g){return Nc(g===Zi.tilde,"expected `~`"),e.enter("tildeSequenceTemporary"),d(g)}function d(g){if(g===Zi.tilde)return e.consume(g),d;const y=e.exit("tildeSequenceTemporary"),E=ra(g);return y._open=!E||E===cc.characterGroupPunctuation&&!!r,y._close=!r||r===cc.characterGroupPunctuation&&!!E,t(g)}}function Gg(e,t,n){const r=[];let c=-1;for(;++c<e.length;){const d=e[c].resolveAll;d&&!r.includes(d)&&(t=d(t,n),r.push(d))}return t}const jN={data:"data"};function Vu(e,t){return!!(e[0]==="enter"&&e[1].type===`${t}SequenceTemporary`&&e[1]._close)}function qu(e,t){return!!(e[0]==="exit"&&e[1].type===`${t}SequenceTemporary`&&e[1]._open)}function Zu(e,t,n,r,c,d){const[g,y,E,T]=VN(e[t],e[n],c,d);e[t][1].end=Object.assign({},g.start),e[n][1].start=Object.assign({},y.end);let R=[];e[t][1].end.offset-e[t][1].start.offset&&(R=Uo(R,[["enter",e[t][1],r],["exit",e[t][1],r]])),R=Uo(R,[["enter",T,r],["enter",g,r],["exit",g,r],["enter",E,r]]),R=Uo(R,Gg(r.parser.constructs.insideSpan.null,e.slice(t+1,n),r)),R=Uo(R,[["exit",E,r],["enter",y,r],["exit",y,r],["exit",T,r]]);let I=0;return e[n][1].end.offset-e[n][1].start.offset&&(I=2,R=Uo(R,[["enter",e[n][1],r],["exit",e[n][1],r]])),yc(e,t-1,n-t+3,R),t+R.length-I-2}function VN(e,t,n,r){const c=Object.assign({},e[1].end),d=Object.assign({},t[1].start);Nh(c,-r),Nh(d,r);const g={type:`${n}Sequence`,start:c,end:Object.assign({},e[1].end)},y={type:`${n}Sequence`,start:Object.assign({},t[1].start),end:d},E={type:`${n}Text`,start:Object.assign({},e[1].end),end:Object.assign({},t[1].start)},T={type:`${n}`,start:Object.assign({},g.start),end:Object.assign({},y.end)};return[g,y,E,T]}function Nh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Ju(e,t){e.forEach(n=>{n[1].type===`${t}SequenceTemporary`&&(n[1].type=jN.data)})}function qN(e,t){let n=-1;for(;++n<e.length;)if(Vu(e[n],"tilde")){let r=n;for(;r--;)if(qu(e[r],"tilde")){const c=ZN(e[r],e[n]);n=Zu(e,r,n,t,c===1?"subscript":"strikethrough",c);break}}return Ju(e,"tilde"),e}function ZN(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 JN(){const e={tokenize:YN,resolveAll:qN};return{text:{[Zi.tilde]:e},insideSpan:{null:[e]}}}function XN(e,t){let n=-1;for(;++n<e.length;)if(Vu(e[n],"superscript")){let r=n;for(;r--;)if(qu(e[r],"superscript")){n=Zu(e,r,n,t,"superscript",1);break}}return Ju(e,"superscript"),e}function QN(e,t){return n;function n(c){return Nc(c===Zi.caret,"expected `^`"),e.enter("superscriptSequenceTemporary"),r(c)}function r(c){if(c===Zi.caret)return e.consume(c),r;const d=e.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,t(c)}}function eC(){const e={tokenize:QN,resolveAll:XN};return{text:{[Zi.caret]:e},insideSpan:{null:[e]}}}function tC(e,t,n){const r=this.previous,c=ra(r);let d=0;return g;function g(E){return Nc(E===Zi.plusSign,"expected `+`"),e.enter("underlineSequenceTemporary"),y(E)}function y(E){if(E===Zi.plusSign)return e.consume(E),d++,y;if(d<2)return n(E);const T=e.exit("underlineSequenceTemporary"),R=ra(E);return T._open=!R||R===cc.characterGroupPunctuation&&!!c,T._close=!c||c===cc.characterGroupPunctuation&&!!R,t(E)}}function nC(e,t){let n=-1;for(;++n<e.length;)if(Vu(e[n],"underline")&&e[n][1].end.offset-e[n][1].start.offset>1){let r=n;for(;r--;)if(qu(e[r],"underline")&&e[r][1].end.offset-e[r][1].start.offset>1){n=Zu(e,r,n,t,"underline",2);break}}return Ju(e,"underline"),e}function rC(){const e={tokenize:tC,resolveAll:nC};return{text:{[Zi.plusSign]:e},insideSpan:{null:[e]}}}function iC(){return $g([rC(),eC(),JN()])}const sC={canContainEols:["strikethrough"],enter:{strikethrough:oC},exit:{strikethrough:lC}};function oC(e){this.enter({type:"strikethrough",children:[]},e)}function lC(e){this.exit(e)}const aC={canContainEols:["subscript"],enter:{subscript:cC},exit:{subscript:uC}};function cC(e){this.enter({type:"subscript",children:[]},e)}function uC(e){this.exit(e)}const dC={canContainEols:["superscript"],enter:{superscript:fC},exit:{superscript:hC}};function fC(e){this.enter({type:"superscript",children:[]},e)}function hC(e){this.exit(e)}const gC={canContainEols:["underline"],enter:{underline:pC},exit:{underline:mC}};function pC(e){this.enter({type:"underline",children:[]},e)}function mC(e){this.exit(e)}function _C(){return[gC,sC,aC,dC]}function yC(){const e=this.data();t("micromarkExtensions",iC()),t("fromMarkdownExtensions",_C());function t(n,r){const c=e[n];c?(Nc(Array.isArray(c)),c.push(r)):e[n]=[r]}}function NC(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 CC(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
103
|
-
`}]}function EC(e,t){const n=t.value?t.value+`
|
|
104
|
-
`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,c={};r&&(c.className=["language-"+r]);let d={type:"element",tagName:"code",properties:c,children:[{type:"text",value:n}]};return 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 TC(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xC(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tl(e){const t=[];let n=-1,r=0,c=0;for(;++n<e.length;){const d=e.charCodeAt(n);let g="";if(d===37&&wu(e.charCodeAt(n+1))&&wu(e.charCodeAt(n+2)))c=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(g=String.fromCharCode(d));else if(d>55295&&d<57344){const y=e.charCodeAt(n+1);d<56320&&y>56319&&y<57344?(g=String.fromCharCode(d,y),c=1):g="�"}else g=String.fromCharCode(d);g&&(t.push(e.slice(r,n),encodeURIComponent(g)),r=n+c+1,g=""),c&&(n+=c,c=0)}return t.join("")+e.slice(r)}function Yg(e,t){const n=String(t.identifier).toUpperCase(),r=tl(n.toLowerCase()),c=e.footnoteOrder.indexOf(n);let d;c===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,d=e.footnoteOrder.length):(e.footnoteCounts[n]++,d=c+1);const g=e.footnoteCounts[n],y={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(g>1?"-"+g:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,y);const E={type:"element",tagName:"sup",properties:{},children:[y]};return e.patch(t,E),e.applyData(t,E)}function SC(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const c=String(r);return n[c]={type:"footnoteDefinition",identifier:c,children:[{type:"paragraph",children:t.children}],position:t.position},Yg(e,{type:"footnoteReference",identifier:c,position:t.position})}function vC(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 wC(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function jg(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 c=e.all(t),d=c[0];d&&d.type==="text"?d.value="["+d.value:c.unshift({type:"text",value:"["});const g=c[c.length-1];return g&&g.type==="text"?g.value+=r:c.push({type:"text",value:r}),c}function OC(e,t){const n=e.definition(t.identifier);if(!n)return jg(e,t);const r={src:tl(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,c),e.applyData(t,c)}function AC(e,t){const n={src:tl(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 DC(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 MC(e,t){const n=e.definition(t.identifier);if(!n)return jg(e,t);const r={href:tl(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const c={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,c),e.applyData(t,c)}function RC(e,t){const n={href:tl(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 bC(e,t,n){const r=e.all(t),c=n?IC(n):Vg(t),d={},g=[];if(typeof t.checked=="boolean"){const R=r[0];let I;R&&R.type==="element"&&R.tagName==="p"?I=R:(I={type:"element",tagName:"p",properties:{},children:[]},r.unshift(I)),I.children.length>0&&I.children.unshift({type:"text",value:" "}),I.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let y=-1;for(;++y<r.length;){const R=r[y];(c||y!==0||R.type!=="element"||R.tagName!=="p")&&g.push({type:"text",value:`
|
|
105
|
-
`}),R.type==="element"&&R.tagName==="p"&&!c?g.push(...R.children):g.push(R)}const E=r[r.length-1];E&&(c||E.type!=="element"||E.tagName!=="p")&&g.push({type:"text",value:`
|
|
106
|
-
`});const T={type:"element",tagName:"li",properties:d,children:g};return e.patch(t,T),e.applyData(t,T)}function IC(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=Vg(n[r])}return t}function Vg(e){const t=e.spread;return t??e.children.length>1}function kC(e,t){const n={},r=e.all(t);let c=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++c<r.length;){const g=r[c];if(g.type==="element"&&g.tagName==="li"&&g.properties&&Array.isArray(g.properties.className)&&g.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const d={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,d),e.applyData(t,d)}function LC(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function PC(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function $C(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xu=qg("start"),Qu=qg("end");function FC(e){return{start:Xu(e),end:Qu(e)}}function qg(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 BC(e,t){const n=e.all(t),r=n.shift(),c=[];if(r){const g={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],g),c.push(g)}if(n.length>0){const g={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},y=Xu(t.children[1]),E=Qu(t.children[t.children.length-1]);y.line&&E.line&&(g.position={start:y,end:E}),c.push(g)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(c,!0)};return e.patch(t,d),e.applyData(t,d)}function HC(e,t,n){const r=n?n.children:void 0,d=(r?r.indexOf(t):1)===0?"th":"td",g=n&&n.type==="table"?n.align:void 0,y=g?g.length:t.children.length;let E=-1;const T=[];for(;++E<y;){const I=t.children[E],k={},U=g?g[E]:void 0;U&&(k.align=U);let C={type:"element",tagName:d,properties:k,children:[]};I&&(C.children=e.all(I),e.patch(I,C),C=e.applyData(t,C)),T.push(C)}const R={type:"element",tagName:"tr",properties:{},children:e.wrap(T,!0)};return e.patch(t,R),e.applyData(t,R)}function WC(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Ch=9,Eh=32;function KC(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),c=0;const d=[];for(;r;)d.push(Th(t.slice(c,r.index),c>0,!0),r[0]),c=r.index+r[0].length,r=n.exec(t);return d.push(Th(t.slice(c),c>0,!1)),d.join("")}function Th(e,t,n){let r=0,c=e.length;if(t){let d=e.codePointAt(r);for(;d===Ch||d===Eh;)r++,d=e.codePointAt(r)}if(n){let d=e.codePointAt(c-1);for(;d===Ch||d===Eh;)c--,d=e.codePointAt(c-1)}return c>r?e.slice(r,c):""}function zC(e,t){const n={type:"text",value:KC(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function UC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const GC={blockquote:NC,break:CC,code:EC,delete:TC,emphasis:xC,footnoteReference:Yg,footnote:SC,heading:vC,html:wC,imageReference:OC,image:AC,inlineCode:DC,linkReference:MC,link:RC,listItem:bC,list:kC,paragraph:LC,root:PC,strong:$C,table:BC,tableCell:WC,tableRow:HC,text:zC,thematicBreak:UC,toml:ja,yaml:ja,definition:ja,footnoteDefinition:ja};function ja(){return null}const Zg=function(e){if(e==null)return qC;if(typeof e=="string")return VC(e);if(typeof e=="object")return Array.isArray(e)?YC(e):jC(e);if(typeof e=="function")return Cc(e);throw new Error("Expected function, string, or object as test")};function YC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Zg(e[n]);return Cc(r);function r(...c){let d=-1;for(;++d<t.length;)if(t[d].call(this,...c))return!0;return!1}}function jC(e){return Cc(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function VC(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 qC(){return!0}const ZC=!0,xh=!1,JC="skip",XC=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const c=Zg(t),d=r?-1:1;g(e,void 0,[])();function g(y,E,T){const R=y&&typeof y=="object"?y:{};if(typeof R.type=="string"){const k=typeof R.tagName=="string"?R.tagName:typeof R.name=="string"?R.name:void 0;Object.defineProperty(I,"name",{value:"node ("+(y.type+(k?"<"+k+">":""))+")"})}return I;function I(){let k=[],U,C,w;if((!t||c(y,E,T[T.length-1]||null))&&(k=QC(n(y,T)),k[0]===xh))return k;if(y.children&&k[0]!==JC)for(C=(r?y.children.length:-1)+d,w=T.concat(y);C>-1&&C<y.children.length;){if(U=g(y.children[C],C,w)(),U[0]===xh)return U;C=typeof U[1]=="number"?U[1]:C+d}return k}}};function QC(e){return Array.isArray(e)?e:typeof e=="number"?[ZC,e]:[e]}const ed=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),XC(e,t,c,r);function c(d,g){const y=g[g.length-1];return n(d,y?y.children.indexOf(d):null,y)}};function eE(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 Sh={}.hasOwnProperty;function tE(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return ed(e,"definition",r=>{const c=vh(r.identifier);c&&!Sh.call(t,c)&&(t[c]=r)}),n;function n(r){const c=vh(r);return c&&Sh.call(t,c)?t[c]:null}}function vh(e){return String(e||"").toUpperCase()}const uc={}.hasOwnProperty;function nE(e,t){const n=t||{},r=n.allowDangerousHtml||!1,c={};return g.dangerous=r,g.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,g.footnoteLabel=n.footnoteLabel||"Footnotes",g.footnoteLabelTagName=n.footnoteLabelTagName||"h2",g.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},g.footnoteBackLabel=n.footnoteBackLabel||"Back to content",g.unknownHandler=n.unknownHandler,g.passThrough=n.passThrough,g.handlers={...GC,...n.handlers},g.definition=tE(e),g.footnoteById=c,g.footnoteOrder=[],g.footnoteCounts={},g.patch=rE,g.applyData=iE,g.one=y,g.all=E,g.wrap=oE,g.augment=d,ed(e,"footnoteDefinition",T=>{const R=String(T.identifier).toUpperCase();uc.call(c,R)||(c[R]=T)}),g;function d(T,R){if(T&&"data"in T&&T.data){const I=T.data;I.hName&&(R.type!=="element"&&(R={type:"element",tagName:"",properties:{},children:[]}),R.tagName=I.hName),R.type==="element"&&I.hProperties&&(R.properties={...R.properties,...I.hProperties}),"children"in R&&R.children&&I.hChildren&&(R.children=I.hChildren)}if(T){const I="type"in T?T:{position:T};eE(I)||(R.position={start:Xu(I),end:Qu(I)})}return R}function g(T,R,I,k){return Array.isArray(I)&&(k=I,I={}),d(T,{type:"element",tagName:R,properties:I||{},children:k||[]})}function y(T,R){return Jg(g,T,R)}function E(T){return Qi(g,T)}}function rE(e,t){e.position&&(t.position=FC(e))}function iE(e,t){let n=t;if(e&&e.data){const r=e.data.hName,c=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&&c!==null&&c!==void 0&&(n.children=c)}return n}function Jg(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return uc.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:Qi(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):sE(e,t)}function Qi(e,t){const n=[];if("children"in t){const r=t.children;let c=-1;for(;++c<r.length;){const d=Jg(e,r[c],t);if(d){if(c&&r[c-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=d.value.replace(/^\s+/,"")),!Array.isArray(d)&&d.type==="element")){const g=d.children[0];g&&g.type==="text"&&(g.value=g.value.replace(/^\s+/,""))}Array.isArray(d)?n.push(...d):n.push(d)}}}return n}function sE(e,t){const n=t.data||{},r="value"in t&&!(uc.call(n,"hProperties")||uc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:Qi(e,t)};return e.patch(t,r),e.applyData(t,r)}function oE(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 lE=(e,t)=>e(t,"i",Qi(e,t)),aE=(e,t)=>e(t,"b",Qi(e,t)),cE=(e,t)=>e(t,"u",Qi(e,t)),uE=(e,t)=>e(t,"s",Qi(e,t)),dE=(e,t)=>e(t,"sub",Qi(e,t)),fE=(e,t)=>e(t,"sup",Qi(e,t)),hE={emphasis:lE,strong:aE,underline:cE,strikethrough:uE,subscript:dE,superscript:fE},gE=e=>{const[t,n]=yt.useState();let r;return yt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-7fAhZ2Ii.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[yC],remarkRehypeOptions:{handlers:hE}});n(d)})()},[e.markdown]),t||null};class oo extends Error{}class pE extends oo{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class mE extends oo{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class _E extends oo{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Yo extends oo{}class Xg extends oo{constructor(t){super(`Invalid unit ${t}`)}}class gr extends oo{}class gs extends oo{constructor(){super("Zone is an abstract class")}}const lt="numeric",gi="short",zr="long",dc={year:lt,month:lt,day:lt},Qg={year:lt,month:gi,day:lt},yE={year:lt,month:gi,day:lt,weekday:gi},ep={year:lt,month:zr,day:lt},tp={year:lt,month:zr,day:lt,weekday:zr},np={hour:lt,minute:lt},rp={hour:lt,minute:lt,second:lt},ip={hour:lt,minute:lt,second:lt,timeZoneName:gi},sp={hour:lt,minute:lt,second:lt,timeZoneName:zr},op={hour:lt,minute:lt,hourCycle:"h23"},lp={hour:lt,minute:lt,second:lt,hourCycle:"h23"},ap={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:gi},cp={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:zr},up={year:lt,month:lt,day:lt,hour:lt,minute:lt},dp={year:lt,month:lt,day:lt,hour:lt,minute:lt,second:lt},fp={year:lt,month:gi,day:lt,hour:lt,minute:lt},hp={year:lt,month:gi,day:lt,hour:lt,minute:lt,second:lt},NE={year:lt,month:gi,day:lt,weekday:gi,hour:lt,minute:lt},gp={year:lt,month:zr,day:lt,hour:lt,minute:lt,timeZoneName:gi},pp={year:lt,month:zr,day:lt,hour:lt,minute:lt,second:lt,timeZoneName:gi},mp={year:lt,month:zr,day:lt,weekday:zr,hour:lt,minute:lt,timeZoneName:zr},_p={year:lt,month:zr,day:lt,weekday:zr,hour:lt,minute:lt,second:lt,timeZoneName:zr};class sa{get type(){throw new gs}get name(){throw new gs}get ianaName(){return this.name}get isUniversal(){throw new gs}offsetName(t,n){throw new gs}formatOffset(t,n){throw new gs}offset(t){throw new gs}equals(t){throw new gs}get isValid(){throw new gs}}let lu=null;class Ec extends sa{static get instance(){return lu===null&&(lu=new Ec),lu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return wp(t,n,r)}formatOffset(t,n){return ta(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let tc={};function CE(e){return tc[e]||(tc[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"})),tc[e]}const EE={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function TE(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,c,d,g,y,E,T,R]=r;return[g,c,d,y,E,T,R]}function xE(e,t){const n=e.formatToParts(t),r=[];for(let c=0;c<n.length;c++){const{type:d,value:g}=n[c],y=EE[d];d==="era"?r[y]=g:It(y)||(r[y]=parseInt(g,10))}return r}let Va={};class Xi extends sa{static create(t){return Va[t]||(Va[t]=new Xi(t)),Va[t]}static resetCache(){Va={},tc={}}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=Xi.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return wp(t,n,r,this.name)}formatOffset(t,n){return ta(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=CE(this.name);let[c,d,g,y,E,T,R]=r.formatToParts?xE(r,n):TE(r,n);y==="BC"&&(c=-Math.abs(c)+1);const k=xc({year:c,month:d,day:g,hour:E===24?0:E,minute:T,second:R,millisecond:0});let U=+n;const C=U%1e3;return U-=C>=0?C:1e3+C,(k-U)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let wh={};function SE(e,t={}){const n=JSON.stringify([e,t]);let r=wh[n];return r||(r=new Intl.ListFormat(e,t),wh[n]=r),r}let Ou={};function Au(e,t={}){const n=JSON.stringify([e,t]);let r=Ou[n];return r||(r=new Intl.DateTimeFormat(e,t),Ou[n]=r),r}let Du={};function vE(e,t={}){const n=JSON.stringify([e,t]);let r=Du[n];return r||(r=new Intl.NumberFormat(e,t),Du[n]=r),r}let Mu={};function wE(e,t={}){const{base:n,...r}=t,c=JSON.stringify([e,r]);let d=Mu[c];return d||(d=new Intl.RelativeTimeFormat(e,t),Mu[c]=d),d}let Zl=null;function OE(){return Zl||(Zl=new Intl.DateTimeFormat().resolvedOptions().locale,Zl)}let Oh={};function AE(e){let t=Oh[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Oh[e]=t}return t}function DE(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,c;try{r=Au(e).resolvedOptions(),c=e}catch{const E=e.substring(0,n);r=Au(E).resolvedOptions(),c=E}const{numberingSystem:d,calendar:g}=r;return[c,d,g]}}function ME(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function RE(e){const t=[];for(let n=1;n<=12;n++){const r=St.utc(2009,n,1);t.push(e(r))}return t}function bE(e){const t=[];for(let n=1;n<=7;n++){const r=St.utc(2016,11,13+n);t.push(e(r))}return t}function qa(e,t,n,r){const c=e.listingMode();return c==="error"?null:c==="en"?n(t):r(t)}function IE(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 kE{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:c,floor:d,...g}=r;if(!n||Object.keys(g).length>0){const y={useGrouping:!1,...r};r.padTo>0&&(y.minimumIntegerDigits=r.padTo),this.inf=vE(t,y)}}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):sd(t,3);return Hn(n,this.padTo)}}}class LE{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let c;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const g=-1*(t.offset/60),y=g>=0?`Etc/GMT+${g}`:`Etc/GMT${g}`;t.offset!==0&&Xi.create(y).valid?(c=y,this.dt=t):(c="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,c=t.zone.name):(c="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||c,this.dtf=Au(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 PE{constructor(t,n,r){this.opts={style:"long",...r},!n&&Sp()&&(this.rtf=wE(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):sT(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const $E={firstDay:1,minimalDays:4,weekend:[6,7]};class cn{static fromOpts(t){return cn.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,c,d=!1){const g=t||Mn.defaultLocale,y=g||(d?"en-US":OE()),E=n||Mn.defaultNumberingSystem,T=r||Mn.defaultOutputCalendar,R=Ru(c)||Mn.defaultWeekSettings;return new cn(y,E,T,R,g)}static resetCache(){Zl=null,Ou={},Du={},Mu={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:c}={}){return cn.create(t,n,r,c)}constructor(t,n,r,c,d){const[g,y,E]=DE(t);this.locale=g,this.numberingSystem=n||y||null,this.outputCalendar=r||E||null,this.weekSettings=c,this.intl=ME(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=IE(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:cn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Ru(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,Dp,()=>{const r=n?{month:t,day:"numeric"}:{month:t},c=n?"format":"standalone";return this.monthsCache[c][t]||(this.monthsCache[c][t]=RE(d=>this.extract(d,r,"month"))),this.monthsCache[c][t]})}weekdays(t,n=!1){return qa(this,t,bp,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},c=n?"format":"standalone";return this.weekdaysCache[c][t]||(this.weekdaysCache[c][t]=bE(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[c][t]})}meridiems(){return qa(this,void 0,()=>Ip,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[St.utc(2016,11,13,9),St.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return qa(this,t,kp,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[St.utc(-40,1,1),St.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const c=this.dtFormatter(t,n),d=c.formatToParts(),g=d.find(y=>y.type.toLowerCase()===r);return g?g.value:null}numberFormatter(t={}){return new kE(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new LE(t,this.intl,n)}relFormatter(t={}){return new PE(this.intl,this.isEnglish(),t)}listFormatter(t={}){return SE(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:vp()?AE(this.locale):$E}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 au=null;class Tr extends sa{static get utcInstance(){return au===null&&(au=new Tr(0)),au}static instance(t){return t===0?Tr.utcInstance:new Tr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Tr(Sc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${ta(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${ta(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return ta(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 FE extends sa{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 _s(e,t){if(It(e)||e===null)return t;if(e instanceof sa)return e;if(UE(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ec.instance:n==="utc"||n==="gmt"?Tr.utcInstance:Tr.parseSpecifier(n)||Xi.create(e)}else return ys(e)?Tr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new FE(e)}const td={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ah={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]},BE=td.hanidec.replace(/[\[|\]]/g,"").split("");function HE(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(td.hanidec)!==-1)t+=BE.indexOf(e[n]);else for(const c in Ah){const[d,g]=Ah[c];r>=d&&r<=g&&(t+=r-d)}}return parseInt(t,10)}else return t}let Go={};function WE(){Go={}}function di({numberingSystem:e},t=""){const n=e||"latn";return Go[n]||(Go[n]={}),Go[n][t]||(Go[n][t]=new RegExp(`${td[n]}${t}`)),Go[n][t]}let Dh=()=>Date.now(),Mh="system",Rh=null,bh=null,Ih=null,kh=60,Lh,Ph=null;class Mn{static get now(){return Dh}static set now(t){Dh=t}static set defaultZone(t){Mh=t}static get defaultZone(){return _s(Mh,Ec.instance)}static get defaultLocale(){return Rh}static set defaultLocale(t){Rh=t}static get defaultNumberingSystem(){return bh}static set defaultNumberingSystem(t){bh=t}static get defaultOutputCalendar(){return Ih}static set defaultOutputCalendar(t){Ih=t}static get defaultWeekSettings(){return Ph}static set defaultWeekSettings(t){Ph=Ru(t)}static get twoDigitCutoffYear(){return kh}static set twoDigitCutoffYear(t){kh=t%100}static get throwOnInvalid(){return Lh}static set throwOnInvalid(t){Lh=t}static resetCaches(){cn.resetCache(),Xi.resetCache(),St.resetCache(),WE()}}class hi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const yp=[0,31,59,90,120,151,181,212,243,273,304,334],Np=[0,31,60,91,121,152,182,213,244,274,305,335];function Jr(e,t){return new hi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function nd(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const c=r.getUTCDay();return c===0?7:c}function Cp(e,t,n){return n+(oa(e)?Np:yp)[t-1]}function Ep(e,t){const n=oa(e)?Np:yp,r=n.findIndex(d=>d<t),c=t-n[r];return{month:r+1,day:c}}function rd(e,t){return(e-t+7)%7+1}function fc(e,t=4,n=1){const{year:r,month:c,day:d}=e,g=Cp(r,c,d),y=rd(nd(r,c,d),n);let E=Math.floor((g-y+14-t)/7),T;return E<1?(T=r-1,E=ia(T,t,n)):E>ia(r,t,n)?(T=r+1,E=1):T=r,{weekYear:T,weekNumber:E,weekday:y,...vc(e)}}function $h(e,t=4,n=1){const{weekYear:r,weekNumber:c,weekday:d}=e,g=rd(nd(r,1,t),n),y=jo(r);let E=c*7+d-g-7+t,T;E<1?(T=r-1,E+=jo(T)):E>y?(T=r+1,E-=jo(r)):T=r;const{month:R,day:I}=Ep(T,E);return{year:T,month:R,day:I,...vc(e)}}function cu(e){const{year:t,month:n,day:r}=e,c=Cp(t,n,r);return{year:t,ordinal:c,...vc(e)}}function Fh(e){const{year:t,ordinal:n}=e,{month:r,day:c}=Ep(t,n);return{year:t,month:r,day:c,...vc(e)}}function Bh(e,t){if(!It(e.localWeekday)||!It(e.localWeekNumber)||!It(e.localWeekYear)){if(!It(e.weekday)||!It(e.weekNumber)||!It(e.weekYear))throw new Yo("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 KE(e,t=4,n=1){const r=Tc(e.weekYear),c=Xr(e.weekNumber,1,ia(e.weekYear,t,n)),d=Xr(e.weekday,1,7);return r?c?d?!1:Jr("weekday",e.weekday):Jr("week",e.weekNumber):Jr("weekYear",e.weekYear)}function zE(e){const t=Tc(e.year),n=Xr(e.ordinal,1,jo(e.year));return t?n?!1:Jr("ordinal",e.ordinal):Jr("year",e.year)}function Tp(e){const t=Tc(e.year),n=Xr(e.month,1,12),r=Xr(e.day,1,hc(e.year,e.month));return t?n?r?!1:Jr("day",e.day):Jr("month",e.month):Jr("year",e.year)}function xp(e){const{hour:t,minute:n,second:r,millisecond:c}=e,d=Xr(t,0,23)||t===24&&n===0&&r===0&&c===0,g=Xr(n,0,59),y=Xr(r,0,59),E=Xr(c,0,999);return d?g?y?E?!1:Jr("millisecond",c):Jr("second",r):Jr("minute",n):Jr("hour",t)}function It(e){return typeof e>"u"}function ys(e){return typeof e=="number"}function Tc(e){return typeof e=="number"&&e%1===0}function UE(e){return typeof e=="string"}function GE(e){return Object.prototype.toString.call(e)==="[object Date]"}function Sp(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function vp(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function YE(e){return Array.isArray(e)?e:[e]}function Hh(e,t,n){if(e.length!==0)return e.reduce((r,c)=>{const d=[t(c),c];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function jE(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Zo(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ru(e){if(e==null)return null;if(typeof e!="object")throw new gr("Week settings must be an object");if(!Xr(e.firstDay,1,7)||!Xr(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!Xr(t,1,7)))throw new gr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function Xr(e,t,n){return Tc(e)&&e>=t&&e<=n}function VE(e,t){return e-t*Math.floor(e/t)}function Hn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function ms(e){if(!(It(e)||e===null||e===""))return parseInt(e,10)}function qs(e){if(!(It(e)||e===null||e===""))return parseFloat(e)}function id(e){if(!(It(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function sd(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function oa(e){return e%4===0&&(e%100!==0||e%400===0)}function jo(e){return oa(e)?366:365}function hc(e,t){const n=VE(t-1,12)+1,r=e+(t-n)/12;return n===2?oa(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 Wh(e,t,n){return-rd(nd(e,1,t),n)+t-1}function ia(e,t=4,n=1){const r=Wh(e,t,n),c=Wh(e+1,t,n);return(jo(e)-r+c)/7}function bu(e){return e>99?e:e>Mn.twoDigitCutoffYear?1900+e:2e3+e}function wp(e,t,n,r=null){const c=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 g={timeZoneName:t,...d},y=new Intl.DateTimeFormat(n,g).formatToParts(c).find(E=>E.type.toLowerCase()==="timezonename");return y?y.value:null}function Sc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,c=n<0||Object.is(n,-0)?-r:r;return n*60+c}function Op(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new gr(`Invalid unit value ${e}`);return t}function gc(e,t){const n={};for(const r in e)if(Zo(e,r)){const c=e[r];if(c==null)continue;n[t(r)]=Op(c)}return n}function ta(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),c=e>=0?"+":"-";switch(t){case"short":return`${c}${Hn(n,2)}:${Hn(r,2)}`;case"narrow":return`${c}${n}${r>0?`:${r}`:""}`;case"techie":return`${c}${Hn(n,2)}${Hn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function vc(e){return jE(e,["hour","minute","second","millisecond"])}const qE=["January","February","March","April","May","June","July","August","September","October","November","December"],Ap=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ZE=["J","F","M","A","M","J","J","A","S","O","N","D"];function Dp(e){switch(e){case"narrow":return[...ZE];case"short":return[...Ap];case"long":return[...qE];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 Mp=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Rp=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],JE=["M","T","W","T","F","S","S"];function bp(e){switch(e){case"narrow":return[...JE];case"short":return[...Rp];case"long":return[...Mp];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ip=["AM","PM"],XE=["Before Christ","Anno Domini"],QE=["BC","AD"],eT=["B","A"];function kp(e){switch(e){case"narrow":return[...eT];case"short":return[...QE];case"long":return[...XE];default:return null}}function tT(e){return Ip[e.hour<12?0:1]}function nT(e,t){return bp(t)[e.weekday-1]}function rT(e,t){return Dp(t)[e.month-1]}function iT(e,t){return kp(t)[e.year<0?0:1]}function sT(e,t,n="always",r=!1){const c={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},d=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&d){const I=e==="days";switch(t){case 1:return I?"tomorrow":`next ${c[e][0]}`;case-1:return I?"yesterday":`last ${c[e][0]}`;case 0:return I?"today":`this ${c[e][0]}`}}const g=Object.is(t,-0)||t<0,y=Math.abs(t),E=y===1,T=c[e],R=r?E?T[1]:T[2]||T[1]:E?c[e][0]:e;return g?`${y} ${R} ago`:`in ${y} ${R}`}function Kh(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const oT={D:dc,DD:Qg,DDD:ep,DDDD:tp,t:np,tt:rp,ttt:ip,tttt:sp,T:op,TT:lp,TTT:ap,TTTT:cp,f:up,ff:fp,fff:gp,ffff:mp,F:dp,FF:hp,FFF:pp,FFFF:_p};class pr{static create(t,n={}){return new pr(t,n)}static parseFormat(t){let n=null,r="",c=!1;const d=[];for(let g=0;g<t.length;g++){const y=t.charAt(g);y==="'"?(r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),n=null,r="",c=!c):c||y===n?r+=y:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=y,n=y)}return r.length>0&&d.push({literal:c||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return oT[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 Hn(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",c=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(U,C)=>this.loc.extract(t,U,C),g=U=>t.isOffsetFixed&&t.offset===0&&U.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,U.format):"",y=()=>r?tT(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),E=(U,C)=>r?rT(t,U):d(C?{month:U}:{month:U,day:"numeric"},"month"),T=(U,C)=>r?nT(t,U):d(C?{weekday:U}:{weekday:U,month:"long",day:"numeric"},"weekday"),R=U=>{const C=pr.macroTokenToFormatOpts(U);return C?this.formatWithSystemDefault(t,C):U},I=U=>r?iT(t,U):d({era:U},"era"),k=U=>{switch(U){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 g({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return g({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return g({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return 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 y();case"d":return c?d({day:"numeric"},"day"):this.num(t.day);case"dd":return c?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 c?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return c?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return E("short",!0);case"LLLL":return E("long",!0);case"LLLLL":return E("narrow",!0);case"M":return c?d({month:"numeric"},"month"):this.num(t.month);case"MM":return c?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return E("short",!1);case"MMMM":return E("long",!1);case"MMMMM":return E("narrow",!1);case"y":return c?d({year:"numeric"},"year"):this.num(t.year);case"yy":return c?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return c?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return c?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return I("short");case"GG":return I("long");case"GGGGG":return I("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 R(U)}};return Kh(pr.parseFormat(n),k)}formatDurationFromString(t,n){const r=E=>{switch(E[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},c=E=>T=>{const R=r(T);return R?this.num(E.get(R),T.length):T},d=pr.parseFormat(n),g=d.reduce((E,{literal:T,val:R})=>T?E:E.concat(R),[]),y=t.shiftTo(...g.map(r).filter(E=>E));return Kh(d,c(y))}}const Lp=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function nl(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function rl(...e){return t=>e.reduce(([n,r,c],d)=>{const[g,y,E]=d(t,c);return[{...n,...g},y||r,E]},[{},null,1]).slice(0,2)}function il(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const c=n.exec(e);if(c)return r(c)}return[null,null]}function Pp(...e){return(t,n)=>{const r={};let c;for(c=0;c<e.length;c++)r[e[c]]=ms(t[n+c]);return[r,null,n+c]}}const $p=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,lT=`(?:${$p.source}?(?:\\[(${Lp.source})\\])?)?`,od=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Fp=RegExp(`${od.source}${lT}`),ld=RegExp(`(?:T${Fp.source})?`),aT=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,cT=/(\d{4})-?W(\d\d)(?:-?(\d))?/,uT=/(\d{4})-?(\d{3})/,dT=Pp("weekYear","weekNumber","weekDay"),fT=Pp("year","ordinal"),hT=/(\d{4})-(\d\d)-(\d\d)/,Bp=RegExp(`${od.source} ?(?:${$p.source}|(${Lp.source}))?`),gT=RegExp(`(?: ${Bp.source})?`);function Vo(e,t,n){const r=e[t];return It(r)?n:ms(r)}function pT(e,t){return[{year:Vo(e,t),month:Vo(e,t+1,1),day:Vo(e,t+2,1)},null,t+3]}function sl(e,t){return[{hours:Vo(e,t,0),minutes:Vo(e,t+1,0),seconds:Vo(e,t+2,0),milliseconds:id(e[t+3])},null,t+4]}function la(e,t){const n=!e[t]&&!e[t+1],r=Sc(e[t+1],e[t+2]),c=n?null:Tr.instance(r);return[{},c,t+3]}function aa(e,t){const n=e[t]?Xi.create(e[t]):null;return[{},n,t+1]}const mT=RegExp(`^T?${od.source}$`),_T=/^-?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 yT(e){const[t,n,r,c,d,g,y,E,T]=e,R=t[0]==="-",I=E&&E[0]==="-",k=(U,C=!1)=>U!==void 0&&(C||U&&R)?-U:U;return[{years:k(qs(n)),months:k(qs(r)),weeks:k(qs(c)),days:k(qs(d)),hours:k(qs(g)),minutes:k(qs(y)),seconds:k(qs(E),E==="-0"),milliseconds:k(id(T),I)}]}const NT={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 ad(e,t,n,r,c,d,g){const y={year:t.length===2?bu(ms(t)):ms(t),month:Ap.indexOf(n)+1,day:ms(r),hour:ms(c),minute:ms(d)};return g&&(y.second=ms(g)),e&&(y.weekday=e.length>3?Mp.indexOf(e)+1:Rp.indexOf(e)+1),y}const CT=/^(?:(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 ET(e){const[,t,n,r,c,d,g,y,E,T,R,I]=e,k=ad(t,c,r,n,d,g,y);let U;return E?U=NT[E]:T?U=0:U=Sc(R,I),[k,new Tr(U)]}function TT(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const xT=/^(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$/,ST=/^(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$/,vT=/^(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 zh(e){const[,t,n,r,c,d,g,y]=e;return[ad(t,c,r,n,d,g,y),Tr.utcInstance]}function wT(e){const[,t,n,r,c,d,g,y]=e;return[ad(t,y,n,r,c,d,g),Tr.utcInstance]}const OT=nl(aT,ld),AT=nl(cT,ld),DT=nl(uT,ld),MT=nl(Fp),Hp=rl(pT,sl,la,aa),RT=rl(dT,sl,la,aa),bT=rl(fT,sl,la,aa),IT=rl(sl,la,aa);function kT(e){return il(e,[OT,Hp],[AT,RT],[DT,bT],[MT,IT])}function LT(e){return il(TT(e),[CT,ET])}function PT(e){return il(e,[xT,zh],[ST,zh],[vT,wT])}function $T(e){return il(e,[_T,yT])}const FT=rl(sl);function BT(e){return il(e,[mT,FT])}const HT=nl(hT,gT),WT=nl(Bp),KT=rl(sl,la,aa);function zT(e){return il(e,[HT,Hp],[WT,KT])}const Uh="Invalid Duration",Wp={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}},UT={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},...Wp},Zr=146097/400,Wo=146097/4800,GT={years:{quarters:4,months:12,weeks:Zr/7,days:Zr,hours:Zr*24,minutes:Zr*24*60,seconds:Zr*24*60*60,milliseconds:Zr*24*60*60*1e3},quarters:{months:3,weeks:Zr/28,days:Zr/4,hours:Zr*24/4,minutes:Zr*24*60/4,seconds:Zr*24*60*60/4,milliseconds:Zr*24*60*60*1e3/4},months:{weeks:Wo/7,days:Wo,hours:Wo*24,minutes:Wo*24*60,seconds:Wo*24*60*60,milliseconds:Wo*24*60*60*1e3},...Wp},eo=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],YT=eo.slice(0).reverse();function ps(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 Qt(r)}function Kp(e,t){let n=t.milliseconds??0;for(const r of YT.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Gh(e,t){const n=Kp(e,t)<0?-1:1;eo.reduceRight((r,c)=>{if(It(t[c]))return r;if(r){const d=t[r]*n,g=e[c][r],y=Math.floor(d/g);t[c]+=y*n,t[r]-=y*g*n}return c},null),eo.reduce((r,c)=>{if(It(t[c]))return r;if(r){const d=t[r]%1;t[r]-=d,t[c]+=d*e[r][c]}return c},null)}function jT(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Qt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?GT:UT;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||cn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Qt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new gr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Qt({values:gc(t,Qt.normalizeUnit),loc:cn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(ys(t))return Qt.fromMillis(t);if(Qt.isDuration(t))return t;if(typeof t=="object")return Qt.fromObject(t);throw new gr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=$T(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=BT(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new gr("need to specify a reason the Duration is invalid");const r=t instanceof hi?t:new hi(t,n);if(Mn.throwOnInvalid)throw new _E(r);return new Qt({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 Xg(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?pr.create(this.loc,r).formatDurationFromString(this,t):Uh}toHuman(t={}){if(!this.isValid)return Uh;const n=eo.map(r=>{const c=this.values[r];return It(c)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(c)}).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+=sd(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},St.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?Kp(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t),r={};for(const c of eo)(Zo(n.values,c)||Zo(this.values,c))&&(r[c]=n.get(c)+this.get(c));return ps(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Qt.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]=Op(t(this.values[r],r));return ps(this,{values:n},!0)}get(t){return this[Qt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...gc(t,Qt.normalizeUnit)};return ps(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:c}={}){const g={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:c,conversionAccuracy:r};return ps(this,g)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Gh(this.matrix,t),ps(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=jT(this.normalize().shiftToAll().toObject());return ps(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(g=>Qt.normalizeUnit(g));const n={},r={},c=this.toObject();let d;for(const g of eo)if(t.indexOf(g)>=0){d=g;let y=0;for(const T in r)y+=this.matrix[T][g]*r[T],r[T]=0;ys(c[g])&&(y+=c[g]);const E=Math.trunc(y);n[g]=E,r[g]=(y*1e3-E*1e3)/1e3}else ys(c[g])&&(r[g]=c[g]);for(const g in r)r[g]!==0&&(n[d]+=g===d?r[g]:r[g]/this.matrix[d][g]);return Gh(this.matrix,n),ps(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 ps(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,c){return r===void 0||r===0?c===void 0||c===0:r===c}for(const r of eo)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Ko="Invalid Interval";function VT(e,t){return!e||!e.isValid?Dn.invalid("missing or invalid start"):!t||!t.isValid?Dn.invalid("missing or invalid end"):t<e?Dn.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 Dn{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 gr("need to specify a reason the Interval is invalid");const r=t instanceof hi?t:new hi(t,n);if(Mn.throwOnInvalid)throw new mE(r);return new Dn({invalid:r})}static fromDateTimes(t,n){const r=jl(t),c=jl(n),d=VT(r,c);return d??new Dn({start:r,end:c})}static after(t,n){const r=Qt.fromDurationLike(n),c=jl(t);return Dn.fromDateTimes(c,c.plus(r))}static before(t,n){const r=Qt.fromDurationLike(n),c=jl(t);return Dn.fromDateTimes(c.minus(r),c)}static fromISO(t,n){const[r,c]=(t||"").split("/",2);if(r&&c){let d,g;try{d=St.fromISO(r,n),g=d.isValid}catch{g=!1}let y,E;try{y=St.fromISO(c,n),E=y.isValid}catch{E=!1}if(g&&E)return Dn.fromDateTimes(d,y);if(g){const T=Qt.fromISO(c,n);if(T.isValid)return Dn.after(d,T)}else if(E){const T=Qt.fromISO(r,n);if(T.isValid)return Dn.before(y,T)}}return Dn.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 c;return n!=null&&n.useLocaleWeeks?c=this.end.reconfigure({locale:r.locale}):c=this.end,c=c.startOf(t,n),Math.floor(c.diff(r,t).get(t))+(c.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?Dn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(jl).filter(g=>this.contains(g)).sort((g,y)=>g.toMillis()-y.toMillis()),r=[];let{s:c}=this,d=0;for(;c<this.e;){const g=n[d]||this.e,y=+g>+this.e?this.e:g;r.push(Dn.fromDateTimes(c,y)),c=y,d+=1}return r}splitBy(t){const n=Qt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,c=1,d;const g=[];for(;r<this.e;){const y=this.start.plus(n.mapUnits(E=>E*c));d=+y>+this.e?this.e:y,g.push(Dn.fromDateTimes(r,d)),r=d,c+=1}return g}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:Dn.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 Dn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((c,d)=>c.s-d.s).reduce(([c,d],g)=>d?d.overlaps(g)||d.abutsStart(g)?[c,d.union(g)]:[c.concat([d]),g]:[c,g],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const c=[],d=t.map(E=>[{time:E.s,type:"s"},{time:E.e,type:"e"}]),g=Array.prototype.concat(...d),y=g.sort((E,T)=>E.time-T.time);for(const E of y)r+=E.type==="s"?1:-1,r===1?n=E.time:(n&&+n!=+E.time&&c.push(Dn.fromDateTimes(n,E.time)),n=null);return Dn.merge(c)}difference(...t){return Dn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ko}[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=dc,n={}){return this.isValid?pr.create(this.s.loc.clone(n),t).formatInterval(this):Ko}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Ko}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ko}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Ko}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Ko}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Qt.invalid(this.invalidReason)}mapEndpoints(t){return Dn.fromDateTimes(t(this.s),t(this.e))}}class Za{static hasDST(t=Mn.defaultZone){const n=St.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Xi.isValidZone(t)}static normalizeZone(t){return _s(t,Mn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||cn.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||cn.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null,outputCalendar:d="gregory"}={}){return(c||cn.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||cn.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:c=null}={}){return(c||cn.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return cn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return cn.create(n,null,"gregory").eras(t)}static features(){return{relative:Sp(),localeWeek:vp()}}}function Yh(e,t){const n=c=>c.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Qt.fromMillis(r).as("days"))}function qT(e,t,n){const r=[["years",(E,T)=>T.year-E.year],["quarters",(E,T)=>T.quarter-E.quarter+(T.year-E.year)*4],["months",(E,T)=>T.month-E.month+(T.year-E.year)*12],["weeks",(E,T)=>{const R=Yh(E,T);return(R-R%7)/7}],["days",Yh]],c={},d=e;let g,y;for(const[E,T]of r)n.indexOf(E)>=0&&(g=E,c[E]=T(e,t),y=d.plus(c),y>t?(c[E]--,e=d.plus(c),e>t&&(y=e,c[E]--,e=d.plus(c))):e=y);return[e,c,y,g]}function ZT(e,t,n,r){let[c,d,g,y]=qT(e,t,n);const E=t-c,T=n.filter(I=>["hours","minutes","seconds","milliseconds"].indexOf(I)>=0);T.length===0&&(g<t&&(g=c.plus({[y]:1})),g!==c&&(d[y]=(d[y]||0)+E/(g-c)));const R=Qt.fromObject(d,r);return T.length>0?Qt.fromMillis(E,r).shiftTo(...T).plus(R):R}const JT="missing Intl.DateTimeFormat.formatToParts support";function on(e,t=n=>n){return{regex:e,deser:([n])=>t(HE(n))}}const XT=" ",zp=`[ ${XT}]`,Up=new RegExp(zp,"g");function QT(e){return e.replace(/\./g,"\\.?").replace(Up,zp)}function jh(e){return e.replace(/\./g,"").replace(Up," ").toLowerCase()}function fi(e,t){return e===null?null:{regex:RegExp(e.map(QT).join("|")),deser:([n])=>e.findIndex(r=>jh(n)===jh(r))+t}}function Vh(e,t){return{regex:e,deser:([,n,r])=>Sc(n,r),groups:t}}function Ja(e){return{regex:e,deser:([t])=>t}}function ex(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function tx(e,t){const n=di(t),r=di(t,"{2}"),c=di(t,"{3}"),d=di(t,"{4}"),g=di(t,"{6}"),y=di(t,"{1,2}"),E=di(t,"{1,3}"),T=di(t,"{1,6}"),R=di(t,"{1,9}"),I=di(t,"{2,4}"),k=di(t,"{4,6}"),U=z=>({regex:RegExp(ex(z.val)),deser:([Q])=>Q,literal:!0}),w=(z=>{if(e.literal)return U(z);switch(z.val){case"G":return fi(t.eras("short"),0);case"GG":return fi(t.eras("long"),0);case"y":return on(T);case"yy":return on(I,bu);case"yyyy":return on(d);case"yyyyy":return on(k);case"yyyyyy":return on(g);case"M":return on(y);case"MM":return on(r);case"MMM":return fi(t.months("short",!0),1);case"MMMM":return fi(t.months("long",!0),1);case"L":return on(y);case"LL":return on(r);case"LLL":return fi(t.months("short",!1),1);case"LLLL":return fi(t.months("long",!1),1);case"d":return on(y);case"dd":return on(r);case"o":return on(E);case"ooo":return on(c);case"HH":return on(r);case"H":return on(y);case"hh":return on(r);case"h":return on(y);case"mm":return on(r);case"m":return on(y);case"q":return on(y);case"qq":return on(r);case"s":return on(y);case"ss":return on(r);case"S":return on(E);case"SSS":return on(c);case"u":return Ja(R);case"uu":return Ja(y);case"uuu":return on(n);case"a":return fi(t.meridiems(),0);case"kkkk":return on(d);case"kk":return on(I,bu);case"W":return on(y);case"WW":return on(r);case"E":case"c":return on(n);case"EEE":return fi(t.weekdays("short",!1),1);case"EEEE":return fi(t.weekdays("long",!1),1);case"ccc":return fi(t.weekdays("short",!0),1);case"cccc":return fi(t.weekdays("long",!0),1);case"Z":case"ZZ":return Vh(new RegExp(`([+-]${y.source})(?::(${r.source}))?`),2);case"ZZZ":return Vh(new RegExp(`([+-]${y.source})(${r.source})?`),2);case"z":return Ja(/[a-z_+-/]{1,256}?/i);case" ":return Ja(/[^\S\n\r]/);default:return U(z)}})(e)||{invalidReason:JT};return w.token=e,w}const nx={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 rx(e,t,n){const{type:r,value:c}=e;if(r==="literal"){const E=/^\s+$/.test(c);return{literal:!E,val:E?" ":c}}const d=t[r];let g=r;r==="hour"&&(t.hour12!=null?g=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?g="hour12":g="hour24":g=n.hour12?"hour12":"hour24");let y=nx[g];if(typeof y=="object"&&(y=y[d]),y)return{literal:!1,val:y}}function ix(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function sx(e,t,n){const r=e.match(t);if(r){const c={};let d=1;for(const g in n)if(Zo(n,g)){const y=n[g],E=y.groups?y.groups+1:1;!y.literal&&y.token&&(c[y.token.val[0]]=y.deser(r.slice(d,d+E))),d+=E}return[r,c]}else return[r,{}]}function ox(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=Xi.create(e.z)),It(e.Z)||(n||(n=new Tr(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=id(e.u)),[Object.keys(e).reduce((d,g)=>{const y=t(g);return y&&(d[y]=e[g]),d},{}),n,r]}let uu=null;function lx(){return uu||(uu=St.fromMillis(1555555555555)),uu}function ax(e,t){if(e.literal)return e;const n=pr.macroTokenToFormatOpts(e.val),r=Vp(n,t);return r==null||r.includes(void 0)?e:r}function Gp(e,t){return Array.prototype.concat(...e.map(n=>ax(n,t)))}class Yp{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Gp(pr.parseFormat(n),t),this.units=this.tokens.map(r=>tx(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,c]=ix(this.units);this.regex=RegExp(r,"i"),this.handlers=c}}explainFromTokens(t){if(this.isValid){const[n,r]=sx(t,this.regex,this.handlers),[c,d,g]=r?ox(r):[null,null,void 0];if(Zo(r,"a")&&Zo(r,"H"))throw new Yo("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:c,zone:d,specificOffset:g}}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 jp(e,t,n){return new Yp(e,n).explainFromTokens(t)}function cx(e,t,n){const{result:r,zone:c,specificOffset:d,invalidReason:g}=jp(e,t,n);return[r,c,d,g]}function Vp(e,t){if(!e)return null;const r=pr.create(t,e).dtFormatter(lx()),c=r.formatToParts(),d=r.resolvedOptions();return c.map(g=>rx(g,e,d))}const du="Invalid DateTime",ux=864e13;function Jl(e){return new hi("unsupported zone",`the zone "${e.name}" is not supported`)}function fu(e){return e.weekData===null&&(e.weekData=fc(e.c)),e.weekData}function hu(e){return e.localWeekData===null&&(e.localWeekData=fc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Zs(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new St({...n,...t,old:n})}function qp(e,t,n){let r=e-t*60*1e3;const c=n.offset(r);if(t===c)return[r,t];r-=(c-t)*60*1e3;const d=n.offset(r);return c===d?[r,c]:[e-Math.min(c,d)*60*1e3,Math.max(c,d)]}function Xa(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 nc(e,t,n){return qp(xc(e),t,n)}function qh(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),c=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:c,day:Math.min(e.c.day,hc(r,c))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},g=Qt.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"),y=xc(d);let[E,T]=qp(y,n,e.zone);return g!==0&&(E+=g,T=e.zone.offset(E)),{ts:E,o:T}}function zo(e,t,n,r,c,d){const{setZone:g,zone:y}=n;if(e&&Object.keys(e).length!==0||t){const E=t||y,T=St.fromObject(e,{...n,zone:E,specificOffset:d});return g?T:T.setZone(y)}else return St.invalid(new hi("unparsable",`the input "${c}" can't be parsed as ${r}`))}function Qa(e,t,n=!0){return e.isValid?pr.create(cn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function gu(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Hn(e.c.year,n?6:4),t?(r+="-",r+=Hn(e.c.month),r+="-",r+=Hn(e.c.day)):(r+=Hn(e.c.month),r+=Hn(e.c.day)),r}function Zh(e,t,n,r,c,d){let g=Hn(e.c.hour);return t?(g+=":",g+=Hn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(g+=":")):g+=Hn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(g+=Hn(e.c.second),(e.c.millisecond!==0||!r)&&(g+=".",g+=Hn(e.c.millisecond,3))),c&&(e.isOffsetFixed&&e.offset===0&&!d?g+="Z":e.o<0?(g+="-",g+=Hn(Math.trunc(-e.o/60)),g+=":",g+=Hn(Math.trunc(-e.o%60))):(g+="+",g+=Hn(Math.trunc(e.o/60)),g+=":",g+=Hn(Math.trunc(e.o%60)))),d&&(g+="["+e.zone.ianaName+"]"),g}const Zp={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},dx={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},fx={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Jp=["year","month","day","hour","minute","second","millisecond"],hx=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],gx=["year","ordinal","hour","minute","second","millisecond"];function px(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 Xg(e);return t}function Jh(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return px(e)}}function mx(e){return ic[e]||(rc===void 0&&(rc=Mn.now()),ic[e]=e.offset(rc)),ic[e]}function Xh(e,t){const n=_s(t.zone,Mn.defaultZone);if(!n.isValid)return St.invalid(Jl(n));const r=cn.fromObject(t);let c,d;if(It(e.year))c=Mn.now();else{for(const E of Jp)It(e[E])&&(e[E]=Zp[E]);const g=Tp(e)||xp(e);if(g)return St.invalid(g);const y=mx(n);[c,d]=nc(e,y,n)}return new St({ts:c,zone:n,loc:r,o:d})}function Qh(e,t,n){const r=It(n.round)?!0:n.round,c=(g,y)=>(g=sd(g,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(g,y)),d=g=>n.calendary?t.hasSame(e,g)?0:t.startOf(g).diff(e.startOf(g),g).get(g):t.diff(e,g).get(g);if(n.unit)return c(d(n.unit),n.unit);for(const g of n.units){const y=d(g);if(Math.abs(y)>=1)return c(y,g)}return c(e>t?-0:0,n.units[n.units.length-1])}function eg(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 rc,ic={};class St{constructor(t){const n=t.zone||Mn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new hi("invalid input"):null)||(n.isValid?null:Jl(n));this.ts=It(t.ts)?Mn.now():t.ts;let c=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[c,d]=[t.old.c,t.old.o];else{const y=ys(t.o)&&!t.old?t.o:n.offset(this.ts);c=Xa(this.ts,y),r=Number.isNaN(c.year)?new hi("invalid input"):null,c=r?null:c,d=r?null:y}this._zone=n,this.loc=t.loc||cn.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=c,this.o=d,this.isLuxonDateTime=!0}static now(){return new St({})}static local(){const[t,n]=eg(arguments),[r,c,d,g,y,E,T]=n;return Xh({year:r,month:c,day:d,hour:g,minute:y,second:E,millisecond:T},t)}static utc(){const[t,n]=eg(arguments),[r,c,d,g,y,E,T]=n;return t.zone=Tr.utcInstance,Xh({year:r,month:c,day:d,hour:g,minute:y,second:E,millisecond:T},t)}static fromJSDate(t,n={}){const r=GE(t)?t.valueOf():NaN;if(Number.isNaN(r))return St.invalid("invalid input");const c=_s(n.zone,Mn.defaultZone);return c.isValid?new St({ts:r,zone:c,loc:cn.fromObject(n)}):St.invalid(Jl(c))}static fromMillis(t,n={}){if(ys(t))return t<-864e13||t>ux?St.invalid("Timestamp out of range"):new St({ts:t,zone:_s(n.zone,Mn.defaultZone),loc:cn.fromObject(n)});throw new gr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(ys(t))return new St({ts:t*1e3,zone:_s(n.zone,Mn.defaultZone),loc:cn.fromObject(n)});throw new gr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=_s(n.zone,Mn.defaultZone);if(!r.isValid)return St.invalid(Jl(r));const c=cn.fromObject(n),d=gc(t,Jh),{minDaysInFirstWeek:g,startOfWeek:y}=Bh(d,c),E=Mn.now(),T=It(n.specificOffset)?r.offset(E):n.specificOffset,R=!It(d.ordinal),I=!It(d.year),k=!It(d.month)||!It(d.day),U=I||k,C=d.weekYear||d.weekNumber;if((U||R)&&C)throw new Yo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(k&&R)throw new Yo("Can't mix ordinal dates with month/day");const w=C||d.weekday&&!U;let z,Q,F=Xa(E,T);w?(z=hx,Q=dx,F=fc(F,g,y)):R?(z=gx,Q=fx,F=cu(F)):(z=Jp,Q=Zp);let W=!1;for(const B of z){const V=d[B];It(V)?W?d[B]=Q[B]:d[B]=F[B]:W=!0}const G=w?KE(d,g,y):R?zE(d):Tp(d),q=G||xp(d);if(q)return St.invalid(q);const le=w?$h(d,g,y):R?Fh(d):d,[se,ge]=nc(le,T,r),j=new St({ts:se,zone:r,o:ge,loc:c});return d.weekday&&U&&t.weekday!==j.weekday?St.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${j.toISO()}`):j.isValid?j:St.invalid(j.invalid)}static fromISO(t,n={}){const[r,c]=kT(t);return zo(r,c,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,c]=LT(t);return zo(r,c,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,c]=PT(t);return zo(r,c,n,"HTTP",n)}static fromFormat(t,n,r={}){if(It(t)||It(n))throw new gr("fromFormat requires an input string and a format");const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0}),[y,E,T,R]=cx(g,t,n);return R?St.invalid(R):zo(y,E,r,`format ${n}`,t,T)}static fromString(t,n,r={}){return St.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,c]=zT(t);return zo(r,c,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new gr("need to specify a reason the DateTime is invalid");const r=t instanceof hi?t:new hi(t,n);if(Mn.throwOnInvalid)throw new pE(r);return new St({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=Vp(t,cn.fromObject(n));return r?r.map(c=>c?c.val:null).join(""):null}static expandFormat(t,n={}){return Gp(pr.parseFormat(t),cn.fromObject(n)).map(c=>c.val).join("")}static resetCache(){rc=void 0,ic={}}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?fu(this).weekYear:NaN}get weekNumber(){return this.isValid?fu(this).weekNumber:NaN}get weekday(){return this.isValid?fu(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?hu(this).weekday:NaN}get localWeekNumber(){return this.isValid?hu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?hu(this).weekYear:NaN}get ordinal(){return this.isValid?cu(this.c).ordinal:NaN}get monthShort(){return this.isValid?Za.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Za.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Za.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Za.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),c=this.zone.offset(r-t),d=this.zone.offset(r+t),g=this.zone.offset(r-c*n),y=this.zone.offset(r-d*n);if(g===y)return[this];const E=r-g*n,T=r-y*n,R=Xa(E,g),I=Xa(T,y);return R.hour===I.hour&&R.minute===I.minute&&R.second===I.second&&R.millisecond===I.millisecond?[Zs(this,{ts:E}),Zs(this,{ts:T})]:[this]}get isInLeapYear(){return oa(this.year)}get daysInMonth(){return hc(this.year,this.month)}get daysInYear(){return this.isValid?jo(this.year):NaN}get weeksInWeekYear(){return this.isValid?ia(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ia(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:c}=pr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:c}}toUTC(t=0,n={}){return this.setZone(Tr.instance(t),n)}toLocal(){return this.setZone(Mn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=_s(t,Mn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let c=this.ts;if(n||r){const d=t.offset(this.ts),g=this.toObject();[c]=nc(g,d,t)}return Zs(this,{ts:c,zone:t})}else return St.invalid(Jl(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const c=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Zs(this,{loc:c})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=gc(t,Jh),{minDaysInFirstWeek:r,startOfWeek:c}=Bh(n,this.loc),d=!It(n.weekYear)||!It(n.weekNumber)||!It(n.weekday),g=!It(n.ordinal),y=!It(n.year),E=!It(n.month)||!It(n.day),T=y||E,R=n.weekYear||n.weekNumber;if((T||g)&&R)throw new Yo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(E&&g)throw new Yo("Can't mix ordinal dates with month/day");let I;d?I=$h({...fc(this.c,r,c),...n},r,c):It(n.ordinal)?(I={...this.toObject(),...n},It(n.day)&&(I.day=Math.min(hc(I.year,I.month),I.day))):I=Fh({...cu(this.c),...n});const[k,U]=nc(I,this.o,this.zone);return Zs(this,{ts:k,o:U})}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return Zs(this,qh(this,n))}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t).negate();return Zs(this,qh(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},c=Qt.normalizeUnit(t);switch(c){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(c==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:g}=this;g<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(c==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?pr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):du}toLocaleString(t=dc,n={}){return this.isValid?pr.create(this.loc.clone(n),t).formatDateTime(this):du}toLocaleParts(t={}){return this.isValid?pr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:c=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const g=t==="extended";let y=gu(this,g);return y+="T",y+=Zh(this,g,n,r,c,d),y}toISODate({format:t="extended"}={}){return this.isValid?gu(this,t==="extended"):null}toISOWeekDate(){return Qa(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:c=!1,extendedZone:d=!1,format:g="extended"}={}){return this.isValid?(c?"T":"")+Zh(this,g==="extended",n,t,r,d):null}toRFC2822(){return Qa(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Qa(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?gu(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let c="HH:mm:ss.SSS";return(n||t)&&(r&&(c+=" "),n?c+="z":t&&(c+="ZZ")),Qa(this,c,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():du}[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 Qt.invalid("created by diffing an invalid DateTime");const c={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=YE(n).map(Qt.normalizeUnit),g=t.valueOf()>this.valueOf(),y=g?this:t,E=g?t:this,T=ZT(y,E,d,c);return g?T.negate():T}diffNow(t="milliseconds",n={}){return this.diff(St.now(),t,n)}until(t){return this.isValid?Dn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const c=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=c&&c<=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||St.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let c=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(c=t.unit,d=void 0),Qh(n,this.plus(r),{...t,numeric:"always",units:c,unit:d})}toRelativeCalendar(t={}){return this.isValid?Qh(t.base||St.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(St.isDateTime))throw new gr("min requires all arguments be DateTimes");return Hh(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(St.isDateTime))throw new gr("max requires all arguments be DateTimes");return Hh(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});return jp(g,t,n)}static fromStringExplain(t,n,r={}){return St.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:c=null}=n,d=cn.fromOpts({locale:r,numberingSystem:c,defaultToEN:!0});return new Yp(d,t)}static fromFormatParser(t,n,r={}){if(It(t)||It(n))throw new gr("fromFormatParser requires an input string and a format parser");const{locale:c=null,numberingSystem:d=null}=r,g=cn.fromOpts({locale:c,numberingSystem:d,defaultToEN:!0});if(!g.equals(n.locale))throw new gr(`fromFormatParser called with a locale of ${g}, but the format parser was created for ${n.locale}`);const{result:y,zone:E,specificOffset:T,invalidReason:R}=n.explainFromTokens(t);return R?St.invalid(R):zo(y,E,r,`format ${n.format}`,t,T)}static get DATE_SHORT(){return dc}static get DATE_MED(){return Qg}static get DATE_MED_WITH_WEEKDAY(){return yE}static get DATE_FULL(){return ep}static get DATE_HUGE(){return tp}static get TIME_SIMPLE(){return np}static get TIME_WITH_SECONDS(){return rp}static get TIME_WITH_SHORT_OFFSET(){return ip}static get TIME_WITH_LONG_OFFSET(){return sp}static get TIME_24_SIMPLE(){return op}static get TIME_24_WITH_SECONDS(){return lp}static get TIME_24_WITH_SHORT_OFFSET(){return ap}static get TIME_24_WITH_LONG_OFFSET(){return cp}static get DATETIME_SHORT(){return up}static get DATETIME_SHORT_WITH_SECONDS(){return dp}static get DATETIME_MED(){return fp}static get DATETIME_MED_WITH_SECONDS(){return hp}static get DATETIME_MED_WITH_WEEKDAY(){return NE}static get DATETIME_FULL(){return gp}static get DATETIME_FULL_WITH_SECONDS(){return pp}static get DATETIME_HUGE(){return mp}static get DATETIME_HUGE_WITH_SECONDS(){return _p}}function jl(e){if(St.isDateTime(e))return e;if(e&&e.valueOf&&ys(e.valueOf()))return St.fromJSDate(e);if(e&&typeof e=="object")return St.fromObject(e);throw new gr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var Yt=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(Yt||{});function wc(e){const t={1:Yt.Monday,2:Yt.Tuesday,3:Yt.Wednesday,4:Yt.Thursday,5:Yt.Friday,6:Yt.Saturday,7:Yt.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function no(e){return{[Yt.Monday]:"Monday",[Yt.Tuesday]:"Tuesday",[Yt.Wednesday]:"Wednesday",[Yt.Thursday]:"Thursday",[Yt.Friday]:"Friday",[Yt.Saturday]:"Saturday",[Yt.Sunday]:"Sunday"}[e]}const Iu=[Yt.Monday,Yt.Tuesday,Yt.Wednesday,Yt.Thursday,Yt.Friday,Yt.Saturday,Yt.Sunday],Xl={[Yt.Monday]:"monday",[Yt.Tuesday]:"tuesday",[Yt.Wednesday]:"wednesday",[Yt.Thursday]:"thursday",[Yt.Friday]:"friday",[Yt.Saturday]:"saturday",[Yt.Sunday]:"sunday"};class pc{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(T=>{if(T.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[c,d]=n.start.split(":").map(Number),[g,y]=n.end.split(":").map(Number);let E=0;g<c&&(E=1),this.end=this.end.set({hour:g,minute:y,day:this.end.day+E}),this.start=this.start.set({hour:c,minute:d}),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).replace(" "," ")}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r).replace(" "," ")}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 Xp{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;const n=t.minus({days:1});for(const r of[n,t]){const c=this.getHours(r);if(c&&!c.isClosed)for(const d of c.openIntervals||[]){const g=new pc(r,d,this.timezone);if(g.contains(t))return g}}return null}getCurrentInterval(){return this.getInterval(St.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,g)=>d.start===g.start?0:d.start>g.start?1:-1,c=n.sort(r);for(const[d,g]of c.entries())if(g.contains(t)&&c.length>d+1)return c[d+1];for(const d of c)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let c=0;c<t;c++){let d=n;d=d.plus({days:c});const g=this.getHours(d);g!=null&&g.openIntervals&&!g.isClosed&&r.push(...g.openIntervals.map(y=>new pc(d,y,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=no(wc(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(St.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,c,d]=n,g=St.fromObject({year:Number(r),month:Number(c),day:Number(d)},{zone:this.timezone});if(t<g)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(St.now())}}function _x(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function yx(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 ca(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 ua(e){return!e.futureInterval}function Nx(e){return ca(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):ua(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):nt.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function Cx(e){return ca(e)||ua(e)?null:nt.jsx("span",{className:"HoursStatus-separator",children:" • "})}function Ex(e){return ca(e)||ua(e)?null:nt.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function Tx(e){if(ca(e)||ua(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 nt.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function xx(e){var r,c;if(ca(e)||ua(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+=((c=d==null?void 0:d.start)==null?void 0:c.setLocale("en-US").toLocaleString(t))||""}return nt.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function Sx(e,t){const n=e.currentTemplate||Nx,r=e.separatorTemplate||Cx,c=e.futureTemplate||Ex,d=e.timeTemplate||Tx,g=e.dayOfWeekTemplate||xx;return nt.jsxs("div",{className:ro("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),c(e),d(e),g(e)]})}const vx={minHeight:`${1.5}em`},wx=e=>{const[t,n]=yt.useState(!1),[r,c]=yt.useState(!1);if(yt.useEffect(()=>{c(!0)},[]),!e.hours)return nt.jsx(nt.Fragment,{});const d=e.statusTemplate||Sx,g=new Xp(e.hours,e.timezone),y=g.isOpenNow(),E=g.getCurrentInterval(),T=g.getNextInterval(),R=(E==null?void 0:E.end)||(T==null?void 0:T.start);if(R&&!t){n(!0);const k=R.toMillis()-St.now().toMillis();setTimeout(()=>n(!1),k)}const I={isOpen:y,currentInterval:E,futureInterval:T,...e};return nt.jsx(nt.Fragment,{children:r?d(I,e):nt.jsx("div",{style:vx,className:ro("HoursStatus",(e==null?void 0:e.className)||"")})})};function Ox(e,t){const n=[];return e.forEach(r=>{const c=n[n.length-1];c?yx(c.intervals,r.intervals)?(c.endDay=r.endDay,c.isToday=c.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const c=t&&Xl[r.startDay]in t?t[Xl[r.startDay]]||"":no(r.startDay),d=t&&Xl[r.endDay]in t?t[Xl[r.endDay]]||"":no(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${c}`:`${c} - ${d}`}})}function Ax(e,t,n){const r=[],c=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?r.push((n==null?void 0:n.isClosed)||"Closed"):c?r.push((n==null?void 0:n.open24Hours)||"Open 24 hours"):e.intervals.forEach(d=>{const g=d.getStartTime((n==null?void 0:n.timeFormatLocale)||"en-US",t),y=d.getEndTime((n==null?void 0:n.timeFormatLocale)||"en-US",t);r.push(`${g} - ${y}`)}),r}function Dx(e,t,n){const r=[];for(let c=1;c<=7;c++){const d=St.fromObject({weekday:c}),g=wc(d);r.push({startDay:g,endDay:g,dayName:n&&no(g).toLowerCase()in n?n[no(g).toLowerCase()]||"":no(g),intervals:e.filter(y=>y.start.weekday===c),isToday:(t==null?void 0:t.weekday)===c})}return r}const Mx=e=>{const[t,n]=yt.useState(!1);return yt.useEffect(()=>{n(!0)},[]),e.hours?nt.jsx(nt.Fragment,{children:t?nt.jsx(Rx,{...e}):nt.jsx(bx,{...e})}):nt.jsx(nt.Fragment,{})},Rx=e=>{const t=new Xp(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),n=St.now(),r=t.getIntervalsForNDays(7,n),c=Dx(r,n,e.dayOfWeekNames);return nt.jsx(ku,{...e,hoursData:c,isClient:!0})},bx=e=>{var g;const{hours:t,dayOfWeekNames:n,intervalTranslations:r}=e,c=Iu.map(y=>{var T,R;const E=Xl[y];return{dayName:(n==null?void 0:n[E])||no(y),startDay:y,endDay:y,isToday:!1,intervals:((R=(T=t[E])==null?void 0:T.openIntervals)==null?void 0:R.map(I=>new pc(St.now(),I,"UTC")))??[]}}),d=(g=t.holidayHours)==null?void 0:g.map(y=>{var R,I;const E=St.fromFormat(y.date,"yyyy-MM-dd"),T=wc(E);return{dayName:E.setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString(),isToday:!1,startDay:T,endDay:T,intervals:(y.isRegularHours?(R=y.openIntervals)==null?void 0:R.map(k=>new pc(E,k,"UTC")):(I=c.find(k=>k.startDay===T))==null?void 0:I.intervals)??[]}});return nt.jsxs(nt.Fragment,{children:[nt.jsx(ku,{...e,hoursData:c,isClient:!1}),d&&d.length>0&&nt.jsx(ku,{...e,hoursData:d,isClient:!1,isHolidayHours:!0}),t.reopenDate&&nt.jsxs("div",{className:"HoursTable-row",children:[nt.jsx("span",{className:"HoursTable-day",children:(r==null?void 0:r.reopenDate)||"Reopen Date"}),nt.jsx("span",{className:"HoursTable-intervals",children:St.fromFormat(t.reopenDate,"yyyy-MM-dd").setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString()})]})]})},ku=e=>{const{intervalStringsBuilderFn:t,className:n,timeOptions:r,intervalTranslations:c,dayOfWeekNames:d,startOfWeek:g,isClient:y,isHolidayHours:E}=e;let T=e.hoursData;function R(U){return U?{today:wc(St.now()),monday:Yt.Monday,tuesday:Yt.Tuesday,wednesday:Yt.Wednesday,thursday:Yt.Thursday,friday:Yt.Friday,saturday:Yt.Saturday,sunday:Yt.Sunday}[U]:Yt.Sunday}const I=Iu.indexOf(R(y||g!=="today"?g:"sunday")),k=_x(Iu,7-I);return E||(T.sort((U,C)=>k.indexOf(U.startDay)-k.indexOf(C.startDay)),e.collapseDays&&(T=Ox(T,d))),nt.jsx("div",{className:ro("HoursTable",n),children:T.map(U=>{const w=(t||Ax)(U,r,c);return nt.jsxs("div",{className:ro("HoursTable-row",{"is-today":U.isToday}),children:[nt.jsx("span",{className:"HoursTable-day",children:U.dayName}),nt.jsx("span",{className:"HoursTable-intervals",children:w.map((z,Q)=>nt.jsx("span",{className:"HoursTable-interval",children:z},Q))})]},U.dayName)})})},Ix=e=>`<script type="application/ld+json">
|
|
110
|
-
${JSON.stringify(e)}
|
|
111
|
-
<\/script>`,Oc=(e,t)=>{if(!(!e.name||typeof e.name!="string"))return{"@context":"https://schema.org","@type":t,name:e.name}},kx=e=>typeof e!="object"?!1:!!e.name||!!e.address,Lx=e=>typeof e!="object"?!1:!!e.line1||!!e.city||!!e.region||!!e.postalCode||!!e.countryCode,cd=e=>Lx(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},Qp=e=>kx(e)&&{"@type":"Place",name:e.name,...cd(e.address)},em=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image&&typeof e.image.url=="string",Ac=e=>{if(!e)return{};const t=new Array;for(const n of e)em(n)&&t.push(n.image.url);return{image:t}},Px=e=>em(e)&&{image:e.image.url},$x=e=>typeof e!="object"?!1:!!e.name,Fx=e=>Array.isArray(e)&&e.length>0,tm=e=>Fx(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},nm=e=>$x(e)&&{organizer:{"@type":"Organization",name:e.name,...e.url&&{url:e.url}}},Bx=["BackOrder","Discontinued","InStock","InStoreOnly","LimitedAvailability","MadeToOrder","OnlineOnly","OutOfStock","PreOrder","PreSale","Reserved","SoldOut"],Hx=e=>typeof e!="object"?!1:"priceCurrency"in e&&"price"in e&&"availability"in e&&Bx.includes(e.availability),ud=e=>Hx(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},Wx=(e,t)=>{const n=Qp({name:e.geomodifier,address:e.address});return{...Oc(e,t??"Event"),...Ac(e.photoGallery),...n&&{location:n},...tm(e.performers),...nm({name:e.organizerName}),...ud({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),...e.c_startDate&&{startDate:e.c_startDate},...e.c_endDate&&{endDate:e.c_endDate},...e.description&&{description:e.description},...e.attendance&&{eventAttendanceMode:e.attendance},...e.eventStatus&&{eventStatus:e.eventStatus}}},Kx=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,zx=e=>typeof e!="object"?!1:e.isClosed?!0:"openIntervals"in e&&Array.isArray(e.openIntervals)&&e.openIntervals.length?e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,rm=e=>{if(!Kx(e))return{};let t=new Map;t=Js(e.monday,t,"Mo"),t=Js(e.tuesday,t,"Tu"),t=Js(e.wednesday,t,"We"),t=Js(e.thursday,t,"Th"),t=Js(e.friday,t,"Fr"),t=Js(e.saturday,t,"Sa"),t=Js(e.sunday,t,"Su");const n=new Array;for(const[r,c]of t){const d=c.join(",");n.push(d+" "+r)}return{openingHours:n}},Js=(e,t,n)=>{if(!zx(e))return t;if(e.isClosed||!e.openIntervals){const r="00:00-00:00",c=t.get(r)??[];return c.push(n),t.set(r,c),t}for(let r=0;r<e.openIntervals.length;r++){const c=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(c)??[];d.push(n),t.set(c,d)}return t},Ux=(e,t)=>({...Oc(e,t??"LocalBusiness"),...cd(e.address),...rm(e.hours),...Ac(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),Gx=e=>typeof e!="object"?!1:"ratingValue"in e,Yx=e=>typeof e!="object"?!1:"ratingValue"in e&&"reviewCount"in e,im=e=>Gx(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},...e.author&&{author:{"@type":"Person",name:e.author}}}},sm=e=>Yx(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,jx=(e,t)=>({...Oc(e,t??"Product"),...Ac(e.photoGallery),...im(e.c_reviews),...sm(e.c_aggregateRating),...ud({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),description:e.description,sku:e.sku,mpn:e.mpn,...e.brand&&{brand:{"@type":"Brand",name:e.brand}}}),Vx=e=>!e||typeof e!="object"?!1:"question"in e&&"answer"in e,qx=e=>!e||typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function Lu(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++)Lu(e[n][r],t);else Lu(e[n],t);else n==="text"&&t.push(e[n])}function om(e){if(e.json){const t=[];return Lu(e.json,t),t.join("")}return""}const Zx=e=>{const t=e.map(n=>{if(Vx(n)||qx(n))return{"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:"answer"in n?n.answer:om(n.answerV2)}}}).filter(Boolean);if(t.length)return{"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t}},Pu=Math.log2(1.6745627884839434),Jx=4,Xx=19,$u="js-baidu-neg-lng-fix";let lm;const Qx=new Promise(e=>lm=e),eS="https://api.map.baidu.com/geoconv/v1/";let Vl=[];const tS="gcj02ToBD09Callback_b872c21c";let nS=0,tg;async function am(e){return await new Promise((t,n)=>{Vl.push({coordinates:e,resolve:t,reject:n}),Vl.length===1&&(tg=setTimeout(r,100)),Vl.length>40&&(clearTimeout(tg),r());function r(){const c=Vl;Vl=[];const d=[].concat(...c.map(E=>E.coordinates)),g=tS+"_"+nS++,y=document.createElement("script");window[g]=E=>{var I;if(E.status){const k=new Error(`Unable to convert coordinates to BD-09: Received status code ${E.status}${E.message?": "+E.message:""}`);c.forEach(U=>U.reject(k))}const T=E.result.map(k=>new un(k.y,k.x));let R=0;c.forEach(k=>{k.resolve(T.slice(R,R+=k.coordinates.length))}),delete window[g],(I=y.parentNode)==null||I.removeChild(y)},Qx.then(E=>{const T={ak:E,callback:g,coords:d.map(R=>`${R.longitude},${R.latitude}`).join(";"),from:3,to:5};y.src=eS+"?"+Object.entries(T).map(([R,I])=>R+"="+I).join("&"),document.head.appendChild(y)})}})}class rS extends Qo{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()-Pu}setCenter(n,r){this._centerReady=am([n]).then(([c])=>{const d=new BMap.Point(c.longitude,c.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+Pu)},{enableAnimation:r})})}}class iS extends el{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(y,E){super(y);Ie(this,"pin");this.pin=E}initialize(y){return this.pin._wrapper=super.initialize(y),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 y=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=y}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const c=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(c),this.pin.setShadow(c)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=am([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"]($u)})}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?$u:""} ${this._wrapperClass}`}}const sS="https://api.map.baidu.com/getscript";function oS(e,t,n,{params:r={},version:c="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,g={ak:d,v:c,...r};lm(d);const y=document.createElement("script");y.src=sS+"?"+Object.entries(g).map(([R,I])=>R+"="+I).join("&"),y.onload=()=>e(),document.head.appendChild(y);let E="";for(let R=Jx;R<=Xx;R++){const I=2**(R-Pu+7);E+=`[data-baidu-zoom="${R}"] .${$u}{transform:translateX(-${I}px);}`}const T=document.createElement("style");T.appendChild(document.createTextNode(E)),document.head.appendChild(T)}const lS=new io().withLoadFunction(oS).withMapClass(rS).withPinClass(iS).withProviderName("Baidu").build();let cm;function aS(){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 c=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&c instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=c.x+"px",r._wrapper.style.top=c.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}cm=e}class cS extends Qo{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 cm(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 c=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:c}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var c;(c=this.map)==null||c.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class um extends el{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(um,"_pinId");const ng="BingMapsCallback_593d7d33",uS="https://www.bing.com/api/maps/mapcontrol";function dS(e,t,n,{params:r={}}={}){window[ng]=()=>{aS(),e()};const c={callback:ng,key:n,...r};hg(uS+"?"+Object.entries(c).map(([d,g])=>d+"="+g).join("&"))}const fS=new io().withLoadFunction(dS).withMapClass(cS).withPinClass(um).withProviderName("Bing").build();class hS extends Qo{constructor(n){var c,d,g,y;super(n);Ie(this,"instance");Ie(this,"map");const r=((c=n==null?void 0:n.iframeWindow)==null?void 0:c.mapboxgl)??pu;if(r.accessToken=(n==null?void 0:n.apiKey)??"",this.instance=r,n.wrapper&&(this.map=new this.instance.Map({container:n.wrapper,interactive:n.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...n.providerOptions})),n.controlEnabled){const E=new this.instance.NavigationControl({showCompass:!1});(d=this.map)==null||d.addControl(E)}(g=this.map)==null||g.on("movestart",()=>this._panStartHandler()),(y=this.map)==null||y.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 c=new this.instance.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](c)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,c){const d=new this.instance.LngLat(r.longitude,r.latitude);this.map&&this.map[c?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class gS extends el{constructor(n){super(n);Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new pu.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new pu.LngLat(n.longitude,n.latitude))}setMap(n,r){var c,d;if(n){const g=n.getProviderMap().map;g&&((c=this.pin)==null||c.addTo(g))}else(d=this.pin)==null||d.remove()}}function pS(e,t,n,{version:r="v1.13.0"}={}){const c=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{e()},document.head.appendChild(d),document.head.appendChild(g)}const mS=new io().withLoadFunction(pS).withMapClass(hS).withPinClass(gS).withProviderName("Mapbox").build();var to;let dm=(to=class extends Qo{constructor(n){var r,c,d;super(n);Ie(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(c=this.map)==null||c.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 c=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(c,{animate:r})}setZoom(n,r){var c;(c=this.map)==null||c.setZoom(n,{animate:r})}setZoomCenter(n,r,c){var g;const d=new L.LatLng(r.latitude,r.longitude);(g=this.map)==null||g.setView(d,n,{animate:c})}_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,c=r.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",d=r.tileLayerOptions||{attribution:'Map data © <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=to.apiKey,this.map&&L.tileLayer(c,d).addTo(this.map)}},Ie(to,"apiKey"),to),_S=class extends Ku{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 c=n.getProviderMap().map;c&&this.pin.addTo(c)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),c=n.getHeight(),d=n.getAnchorX(),g=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,c],iconAnchor:[d*r,g*c],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function yS(e,t,n,{version:r="1.7.1"}={}){const c=`https://unpkg.com/leaflet@${r}/dist/leaflet`;dm.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(g)}const dd=new io().withLoadFunction(yS).withMapClass(dm).withPinClass(_S).withProviderName("Leaflet").build(),NS=dd.getMapClass(),CS=dd.getPinClass();class ES extends NS{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 TS extends CS{}function xS(e,t,n,{version:r="v1.3.2"}={}){const c=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=c+".css";const g=document.createElement("script");g.src=c+".js",g.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(g)}const SS=new io().withLoadFunction(xS).withMapClass(ES).withPinClass(TS).withProviderName("MapQuest").build();exports.Address=r_;exports.AddressSchema=cd;exports.AggregateRatingSchema=sm;exports.Analytics=ag;exports.AnalyticsContext=Bu;exports.AnalyticsProvider=K_;exports.AnalyticsScopeProvider=z_;exports.BaiduMaps=lS;exports.BaseSchema=Oc;exports.BingMaps=fS;exports.Clusterer=Ay;exports.Coordinate=un;exports.Day=Yt;exports.Event=Wx;exports.FAQPage=Zx;exports.GoogleMaps=mg;exports.HoursStatus=wx;exports.HoursTable=Mx;exports.Image=J_;exports.ImageLayoutOption=qi;exports.LeafletMaps=dd;exports.LegacyRichText=gE;exports.LexicalRichText=vN;exports.Link=fg;exports.ListingPublisherOption=ig;exports.LocalBusiness=Ux;exports.LocationMap=Ry;exports.LocationSchema=Qp;exports.Map=Ng;exports.MapProviderOption=_u;exports.MapQuestMaps=SS;exports.MapboxMaps=mS;exports.Marker=Gu;exports.OfferSchema=ud;exports.OpeningHoursSchema=rm;exports.OrganizationSchema=nm;exports.PerformerSchema=tm;exports.PhotoGallerySchema=Ac;exports.PhotoSchema=Px;exports.Product=jx;exports.ReviewSchema=im;exports.SchemaWrapper=Ix;exports.asciiAlpha=PN;exports.asciiAlphanumeric=wu;exports.asciiAtext=$N;exports.asciiControl=FN;exports.asciiDigit=BN;exports.asciiHexDigit=HN;exports.asciiPunctuation=WN;exports.c=ro;exports.classifyCharacter=ra;exports.combineExtensions=$g;exports.createState=nE;exports.debuggingParamDetected=sc;exports.getDefaultExportFromCjs=rg;exports.getDirections=t_;exports.getImageUrl=oc;exports.getRichTextContent=om;exports.getRuntime=qo;exports.jsxRuntimeExports=nt;exports.markdownLineEnding=KN;exports.markdownLineEndingOrSpace=Ug;exports.markdownSpace=zN;exports.normalizeUri=tl;exports.push=Uo;exports.resolveAll=Gg;exports.splice=yc;exports.useAnalytics=Xo;exports.useClusterContext=Oy;exports.useIdentify=Y_;exports.useMapContext=vy;exports.usePageView=G_;exports.useScope=Hu;exports.useTrack=U_;exports.visit=ed;
|